optimizations

This commit is contained in:
2026-03-28 19:15:39 +01:00
parent 0b25d9570a
commit cab4fbd83e
509 changed files with 1016804 additions and 1605 deletions

View File

@@ -1,4 +1,4 @@
import React, { forwardRef } from 'react'
import React, { forwardRef, useId } from 'react'
/**
* Nova Textarea
@@ -14,7 +14,11 @@ const Textarea = forwardRef(function Textarea(
{ label, error, hint, required, rows = 4, resize = false, id, className = '', ...rest },
ref,
) {
const inputId = id ?? (label ? label.toLowerCase().replace(/\s+/g, '-') : undefined)
const generatedId = useId()
const labelSlug = typeof label === 'string'
? label.toLowerCase().replace(/\s+/g, '-')
: null
const inputId = id ?? labelSlug ?? `textarea-${generatedId.replace(/[:]/g, '')}`
const inputClass = [
'block w-full rounded-xl border bg-white/[0.06] text-white text-sm',