@page-speed/forms 0.7.2 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/utils.ts","../src/components/ui/label.tsx","../src/components/ui/field.tsx","../src/components/ui/input.tsx","../src/inputs/TextInput.tsx","../src/components/ui/button.tsx","../src/core/label-group.tsx"],"names":["twMerge","clsx","React","LabelPrimitive","React2","React3","React4","cva","Slot","React5","React6"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;AAUO,SAAS,kBAAkB,IAAA,EAAsB;AACtD,EAAA,IAAI,CAAC,MAAM,OAAO,YAAA;AAGlB,EAAA,MAAM,KAAA,GAAQ,IAAA,CACX,OAAA,CAAQ,IAAA,EAAM,GAAG,CAAA,CACjB,OAAA,CAAQ,iBAAA,EAAmB,OAAO,CAAA,CAClC,WAAA,EAAY,CACZ,IAAA,EAAK;AAGR,EAAA,OAAO,KAAA,CAAM,OAAO,CAAC,CAAA,CAAE,aAAY,GAAI,KAAA,CAAM,MAAM,CAAC,CAAA;AACtD;AAKO,IAAM,4BAAA,GACX;AAcK,SAAS,kBAAkB,KAAA,EAAwB;AACxD,EAAA,IAAI,CAAC,OAAA,EAAS,gBAAgB,EAAE,QAAA,CAAS,KAAA,CAAM,IAAI,CAAA,EAAG;AACpD,IAAA,OAAO,KAAA,EAAO,UACV,KAAA,EAAO,OAAA,EAAS,KAAK,CAAC,GAAA,KAAQ,GAAA,CAAI,WAAW,CAAA,GAC7C,KAAA;AAAA,EACN,CAAA,MAAO;AACL,IAAA,OAAO,KAAA;AAAA,EACT;AACF;;;ACnDA,SAAS,KAAA,CAAM;AAAA,EACb,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAqD;AACnD,EAAA,uB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AAA;AAAA,UACT,QAAA;AAAA,UACA,SAAA,EAAW;AAAA,SAAA;AAAA,QAEV;AAAA,OACH;AAAA,IAEJ,CAAA,MAAA,IAAW,YAAY,QAAA,EAAU;AAC/B,MAAA,cAAA,mDACG,QAAA,EAAA,EAAO,WAAA,EAAU,gBAAe,SAAA,EAAW,cAAA,EAAA,EACzC,SACA,iBACH,CAAA;AAAA,IAEJ,CAAA,MAAO;AACL,MAAA,cAAA,mDACG,KAAA,EAAA,EAAI,WAAA,EAAU,eAAc,SAAA,EAAW,cAAA,EAAA,EACrC,SACA,iBACH,CAAA;AAAA,IAEJ;AAAA,EACF;AAEA,EAAA,MAAM,mBAAmB,SAAA,mBACvBA,iBAAA,CAAA,aAAA;AAAA,IAAC,gBAAA;AAAA,IAAA;AAAA,MACC,EAAA,EAAI,WAAA;AAAA,MACJ,SAAA,EAAW,EAAA,CAAG,4BAAA,EAA8B,kBAAkB;AAAA,KAAA;AAAA,IAE7D;AAAA,GACH,GACE,IAAA;AAEJ,EAAA,IAAI,CAAC,cAAA,IAAkB,CAAC,gBAAA,EAAkB,OAAO,IAAA;AAGjD,EAAA,IAAI,YAAY,QAAA,EAAU;AACxB,IAAA,uBACEA,iBAAA,CAAA,aAAA,CAAAA,iBAAA,CAAA,QAAA,EAAA,IAAA,EACG,gBACA,gBACH,CAAA;AAAA,EAEJ;AAEA,EAAA,uBACEA,iBAAA,CAAA,aAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,8BAAA,EAAA,EACZ,gBACA,gBACH,CAAA;AAEJ","file":"chunk-PDMFWP5I.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\nimport { FormFieldConfig } from \"../integration\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n/**\n * Converts a field name (snake_case or camelCase) to a human-readable label.\n *\n * @example\n * humanizeFieldName(\"first_name\") // \"First name\"\n * humanizeFieldName(\"email\") // \"Email\"\n * humanizeFieldName(\"accepts_sms_marketing\") // \"Accepts sms marketing\"\n */\nexport function humanizeFieldName(name: string): string {\n if (!name) return \"This field\";\n\n // Replace underscores with spaces and split camelCase\n const words = name\n .replace(/_/g, \" \")\n .replace(/([a-z])([A-Z])/g, \"$1 $2\")\n .toLowerCase()\n .trim();\n\n // Capitalize first letter only\n return words.charAt(0).toUpperCase() + words.slice(1);\n}\n\n/**\n * Normalizes browser autofill colors so inputs keep theme colors.\n */\nexport const INPUT_AUTOFILL_RESET_CLASSES =\n \"autofill:bg-transparent autofill:text-foreground \" +\n \"[&:-webkit-autofill]:[-webkit-text-fill-color:hsl(var(--foreground))] \" +\n \"[&:-webkit-autofill]:[caret-color:hsl(var(--foreground))] \" +\n \"[&:-webkit-autofill]:[box-shadow:0_0_0px_1000px_hsl(var(--background))_inset] \" +\n \"[&:-webkit-autofill:hover]:[box-shadow:0_0_0px_1000px_hsl(var(--background))_inset] \" +\n \"[&:-webkit-autofill:focus]:[box-shadow:0_0_0px_1000px_hsl(var(--background))_inset] \" +\n \"[&:-webkit-autofill]:[transition:background-color_9999s_ease-out,color_9999s_ease-out]\";\n\n/**\n * Converts a field name (snake_case or camelCase) to a human-readable label.\n *\n * @example\n * fieldIsChoiceCard(field) // false\n */\nexport function fieldIsChoiceCard(field: FormFieldConfig) {\n if ([\"radio\", \"checkbox-group\"].includes(field.type)) {\n return field?.options\n ? field?.options?.some((opt) => opt.description)\n : false;\n } else {\n return false;\n }\n}\n","import * as React from \"react\"\nimport { Label as LabelPrimitive } from \"radix-ui\"\n\nimport { cn } from \"../../lib/utils\"\n\nfunction Label({\n className,\n ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n \"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Label }\n","import * as React from \"react\";\nimport { Label } from \"./label\";\nimport { cn } from \"../../lib/utils\";\n\ntype FieldOrientation = \"vertical\" | \"horizontal\";\n\ninterface FieldProps extends React.HTMLAttributes<HTMLDivElement> {\n orientation?: FieldOrientation;\n invalid?: boolean;\n}\n\n/**\n * Field - Container component for form inputs with validation display\n *\n * Provides consistent layout and spacing for form fields with labels,\n * inputs, descriptions, and error messages.\n */\nconst Field = React.forwardRef<HTMLDivElement, FieldProps>(\n({ className, orientation = \"vertical\", invalid = false, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-slot=\"field\"\n data-orientation={orientation}\n data-invalid={invalid || undefined}\n className={cn(\n // Use space-y instead of flex to avoid interfering with parent grid layouts\n orientation === \"horizontal\"\n ? \"flex items-center gap-2\"\n : \"space-y-1.5\",\n className,\n )}\n {...props}\n />\n );\n});\nField.displayName = \"Field\";\n\n/**\n * FieldGroup - Container for multiple related fields\n *\n * Used to group fields together (e.g., first name + last name in a row)\n */\nconst FieldGroup = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-slot=\"field-group\"\n className={cn(\"flex flex-col gap-4\", className)}\n {...props}\n />\n );\n});\nFieldGroup.displayName = \"FieldGroup\";\n\n/**\n * FieldLabel - Label component for form fields\n *\n * Wrapper around ShadCN Label with consistent styling\n */\nconst FieldLabel = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & {\n required?: boolean;\n }\n>(({ className, required, children, ...props }, ref) => {\n return (\n <Label\n ref={ref}\n data-slot=\"field-label\"\n className={cn(\n \"text-sm font-medium leading-none select-none\",\n \"peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n {children}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </Label>\n );\n});\nFieldLabel.displayName = \"FieldLabel\";\n\n/**\n * FieldDescription - Helper text for form fields\n *\n * Displays additional information or instructions for the field\n */\nconst FieldDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n return (\n <p\n ref={ref}\n data-slot=\"field-description\"\n className={cn(\"text-sm opacity-70\", className)}\n {...props}\n />\n );\n});\nFieldDescription.displayName = \"FieldDescription\";\n\n/**\n * FieldError - Error message display for form fields\n *\n * Shows validation errors with proper styling and accessibility\n */\nconst FieldError = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n return (\n <p\n ref={ref}\n data-slot=\"field-error\"\n role=\"alert\"\n aria-live=\"polite\"\n className={cn(\"text-sm text-destructive\", className)}\n {...props}\n />\n );\n});\nFieldError.displayName = \"FieldError\";\n\nexport { Field, FieldGroup, FieldLabel, FieldDescription, FieldError };\n","import * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { INPUT_AUTOFILL_RESET_CLASSES } from \"../../lib/utils\";\n\n/**\n * Input component - Optimized for dynamic theming across thousands of client brands\n *\n * CRITICAL: This component must work with dynamic Section backgrounds (light/dark/primary/etc)\n * Only uses CSS variables that adapt automatically - NO hardcoded semantic colors\n *\n * See: SHADCN_INTEGRATION_GUIDE.md for full documentation\n */\nconst Input = React.forwardRef<HTMLInputElement, React.ComponentProps<\"input\">>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n ref={ref}\n type={type}\n data-slot=\"input\"\n className={cn(\n // Core structure - no hardcoded colors, uses CSS variables\n \"flex h-9 w-full min-w-0 rounded-md border border-input\",\n \"bg-transparent px-3 py-1 text-base shadow-sm\",\n \"transition-colors outline-none md:text-sm\",\n\n // Focus state - uses ring-ring CSS variable (adapts to theme)\n \"focus-visible:ring-1 focus-visible:ring-ring\",\n\n // Error state - uses destructive CSS variables (adapts to theme)\n \"aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive\",\n\n // Disabled state - no color hardcoding\n \"disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50\",\n\n // File input specific - inherits text color from parent\n \"file:inline-flex file:h-7 file:border-0 file:bg-transparent\",\n \"file:text-sm file:font-medium\",\n\n // Autofill reset - prevents browser from overriding our dynamic colors\n INPUT_AUTOFILL_RESET_CLASSES,\n\n className,\n )}\n {...props}\n />\n );\n },\n);\nInput.displayName = \"Input\";\n\nexport { Input };\n","\"use client\";\n\nimport * as React from \"react\";\nimport type { InputProps } from \"../core/types\";\nimport { Input } from \"../components/ui/input\";\nimport { cn } from \"../lib/utils\";\n\n/**\n * TextInput - High-performance text input component (ShadCN-based)\n *\n * Built on ShadCN Input component with form-specific behavior:\n * - Error state handling\n * - Valid value indicator (ring-2)\n * - Form integration (onChange, onBlur)\n * - Full accessibility support\n * - Optional start/end icon support with automatic padding\n *\n * @example\n * ```tsx\n * const form = useForm({ initialValues: { email: '' } });\n *\n * <TextInput\n * {...form.getFieldProps('email')}\n * type=\"email\"\n * placeholder=\"Enter your email\"\n * error={!!form.errors.email}\n * aria-invalid={!!form.errors.email}\n * aria-describedby={form.errors.email ? 'email-error' : undefined}\n * />\n * ```\n *\n * @see https://opensite.ai/developers/page-speed/forms/text-input\n */\nexport function TextInput({\n name,\n value,\n onChange,\n onBlur,\n placeholder,\n disabled = false,\n required = false,\n error = false,\n className = \"\",\n type = \"text\",\n id = \"text\",\n suppressValueRing = false,\n iconStart,\n iconEnd,\n ...props\n}: InputProps<string> & {\n type?: \"text\" | \"email\" | \"password\" | \"url\" | \"tel\" | \"search\";\n /**\n * When true, suppresses the `ring-2 ring-ring` applied when a value is\n * present. Use this when the component is embedded inside a wrapper (e.g.\n * ButtonGroupForm) that renders its own unified ring.\n */\n suppressValueRing?: boolean;\n /**\n * Optional icon rendered at the start (left) of the input.\n * Automatically adjusts input padding when provided.\n */\n iconStart?: React.ReactNode;\n /**\n * Optional icon rendered at the end (right) of the input.\n * Automatically adjusts input padding when provided.\n */\n iconEnd?: React.ReactNode;\n}) {\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(e.target.value);\n };\n\n const handleBlur = () => {\n onBlur?.();\n };\n\n const hasValue = String(value ?? \"\").trim().length > 0;\n const hasIconStart = Boolean(iconStart);\n const hasIconEnd = Boolean(iconEnd);\n\n if (hasIconStart || hasIconEnd) {\n return (\n <div className=\"relative\">\n {hasIconStart && (\n <span\n className=\"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none\"\n aria-hidden=\"true\"\n >\n {iconStart}\n </span>\n )}\n <Input\n type={type}\n id={id}\n name={name}\n value={value ?? \"\"}\n onChange={handleChange}\n onBlur={handleBlur}\n placeholder={placeholder}\n disabled={disabled}\n required={required}\n className={cn(\n !suppressValueRing && !error && hasValue && \"ring-2 ring-ring\",\n hasIconStart && \"pl-10\",\n hasIconEnd && \"pr-10\",\n className,\n )}\n aria-invalid={error || props[\"aria-invalid\"]}\n aria-describedby={props[\"aria-describedby\"]}\n aria-required={required || props[\"aria-required\"]}\n {...props}\n />\n {hasIconEnd && (\n <span\n className=\"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none\"\n aria-hidden=\"true\"\n >\n {iconEnd}\n </span>\n )}\n </div>\n );\n }\n\n return (\n <Input\n type={type}\n id={id}\n name={name}\n value={value ?? \"\"}\n onChange={handleChange}\n onBlur={handleBlur}\n placeholder={placeholder}\n disabled={disabled}\n required={required}\n className={cn(\n // Valid value indicator - ring-2 when has value, no error, and not suppressed\n !suppressValueRing && !error && hasValue && \"ring-2 ring-ring\",\n // Error state - handled by Input component via aria-invalid\n className,\n )}\n aria-invalid={error || props[\"aria-invalid\"]}\n aria-describedby={props[\"aria-describedby\"]}\n aria-required={required || props[\"aria-required\"]}\n {...props}\n />\n );\n}\n\nTextInput.displayName = \"TextInput\";\n","import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { Slot } from \"radix-ui\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20\",\n outline:\n \"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n xs: \"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9\",\n \"icon-xs\": \"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\": \"size-8\",\n \"icon-lg\": \"size-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nfunction Button({\n className,\n variant = \"default\",\n size = \"default\",\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? Slot.Root : \"button\"\n\n return (\n <Comp\n data-slot=\"button\"\n data-variant={variant}\n data-size={size}\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n","\"use client\";\n\nimport * as React from \"react\";\nimport type { ReactNode } from \"react\";\nimport { FieldDescription, FieldLabel } from \"../components/ui/field\";\nimport { cn } from \"../lib/utils\";\n\nexport type LabelGroupProps = {\n variant?: \"legend\" | \"label\" | \"text\";\n secondary?: ReactNode;\n secondaryId?: string;\n primary?: ReactNode;\n labelHtmlFor?: string;\n required?: boolean;\n primaryClassName?: string;\n secondaryClassName?: string;\n};\n\nconst LabelGroup = ({\n labelHtmlFor,\n required = false,\n variant = \"label\",\n secondaryId,\n secondary,\n primary,\n primaryClassName,\n secondaryClassName,\n}: LabelGroupProps) => {\n const primaryClasses = cn(\n \"text-sm font-medium leading-snug\",\n variant === \"legend\" ? \"mb-2.5\" : \"mb-1 block\",\n primaryClassName,\n );\n\n const requiredIndicator =\n required && variant !== \"label\" ? (\n <span className=\"text-destructive pl-0.5\" aria-label=\"required\">\n *\n </span>\n ) : null;\n\n let primaryElement: ReactNode = null;\n if (primary) {\n if (variant === \"label\") {\n primaryElement = (\n <FieldLabel\n htmlFor={labelHtmlFor}\n required={required}\n className={primaryClasses}\n >\n {primary}\n </FieldLabel>\n );\n } else if (variant === \"legend\") {\n primaryElement = (\n <legend data-slot=\"field-legend\" className={primaryClasses}>\n {primary}\n {requiredIndicator}\n </legend>\n );\n } else {\n primaryElement = (\n <div data-slot=\"field-label\" className={primaryClasses}>\n {primary}\n {requiredIndicator}\n </div>\n );\n }\n }\n\n const secondaryElement = secondary ? (\n <FieldDescription\n id={secondaryId}\n className={cn(\"leading-normal font-normal\", secondaryClassName)}\n >\n {secondary}\n </FieldDescription>\n ) : null;\n\n if (!primaryElement && !secondaryElement) return null;\n\n // Legend should remain a direct child of fieldset for proper semantics.\n if (variant === \"legend\") {\n return (\n <>\n {primaryElement}\n {secondaryElement}\n </>\n );\n }\n\n return (\n <div className=\"flex flex-1 flex-col gap-0.5\">\n {primaryElement}\n {secondaryElement}\n </div>\n );\n};\n\nexport { LabelGroup };\n"]}
@@ -14,6 +14,13 @@ function humanizeFieldName(name) {
14
14
  return words.charAt(0).toUpperCase() + words.slice(1);
15
15
  }
16
16
  var INPUT_AUTOFILL_RESET_CLASSES = "autofill:bg-transparent autofill:text-foreground [&:-webkit-autofill]:[-webkit-text-fill-color:hsl(var(--foreground))] [&:-webkit-autofill]:[caret-color:hsl(var(--foreground))] [&:-webkit-autofill]:[box-shadow:0_0_0px_1000px_hsl(var(--background))_inset] [&:-webkit-autofill:hover]:[box-shadow:0_0_0px_1000px_hsl(var(--background))_inset] [&:-webkit-autofill:focus]:[box-shadow:0_0_0px_1000px_hsl(var(--background))_inset] [&:-webkit-autofill]:[transition:background-color_9999s_ease-out,color_9999s_ease-out]";
17
+ function fieldIsChoiceCard(field) {
18
+ if (["radio", "checkbox-group"].includes(field.type)) {
19
+ return field?.options ? field?.options?.some((opt) => opt.description) : false;
20
+ } else {
21
+ return false;
22
+ }
23
+ }
17
24
 
18
25
  // src/components/ui/label.tsx
19
26
  function Label({
@@ -157,6 +164,8 @@ function TextInput({
157
164
  type = "text",
158
165
  id = "text",
159
166
  suppressValueRing = false,
167
+ iconStart,
168
+ iconEnd,
160
169
  ...props
161
170
  }) {
162
171
  const handleChange = (e) => {
@@ -166,6 +175,48 @@ function TextInput({
166
175
  onBlur?.();
167
176
  };
168
177
  const hasValue = String(value ?? "").trim().length > 0;
178
+ const hasIconStart = Boolean(iconStart);
179
+ const hasIconEnd = Boolean(iconEnd);
180
+ if (hasIconStart || hasIconEnd) {
181
+ return /* @__PURE__ */ React2.createElement("div", { className: "relative" }, hasIconStart && /* @__PURE__ */ React2.createElement(
182
+ "span",
183
+ {
184
+ className: "absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none",
185
+ "aria-hidden": "true"
186
+ },
187
+ iconStart
188
+ ), /* @__PURE__ */ React2.createElement(
189
+ Input,
190
+ {
191
+ type,
192
+ id,
193
+ name,
194
+ value: value ?? "",
195
+ onChange: handleChange,
196
+ onBlur: handleBlur,
197
+ placeholder,
198
+ disabled,
199
+ required,
200
+ className: cn(
201
+ !suppressValueRing && !error && hasValue && "ring-2 ring-ring",
202
+ hasIconStart && "pl-10",
203
+ hasIconEnd && "pr-10",
204
+ className
205
+ ),
206
+ "aria-invalid": error || props["aria-invalid"],
207
+ "aria-describedby": props["aria-describedby"],
208
+ "aria-required": required || props["aria-required"],
209
+ ...props
210
+ }
211
+ ), hasIconEnd && /* @__PURE__ */ React2.createElement(
212
+ "span",
213
+ {
214
+ className: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none",
215
+ "aria-hidden": "true"
216
+ },
217
+ iconEnd
218
+ ));
219
+ }
169
220
  return /* @__PURE__ */ React2.createElement(
170
221
  Input,
171
222
  {
@@ -252,7 +303,7 @@ var LabelGroup = ({
252
303
  }) => {
253
304
  const primaryClasses = cn(
254
305
  "text-sm font-medium leading-snug",
255
- variant === "legend" ? "mb-1.5" : "mb-1 block",
306
+ variant === "legend" ? "mb-2.5" : "mb-1 block",
256
307
  primaryClassName
257
308
  );
258
309
  const requiredIndicator = required && variant !== "label" ? /* @__PURE__ */ React2.createElement("span", { className: "text-destructive pl-0.5", "aria-label": "required" }, "*") : null;
@@ -289,6 +340,6 @@ var LabelGroup = ({
289
340
  return /* @__PURE__ */ React2.createElement("div", { className: "flex flex-1 flex-col gap-0.5" }, primaryElement, secondaryElement);
290
341
  };
291
342
 
292
- export { Button, Field, FieldDescription, FieldError, FieldGroup, FieldLabel, INPUT_AUTOFILL_RESET_CLASSES, Input, LabelGroup, TextInput, buttonVariants, cn, humanizeFieldName };
293
- //# sourceMappingURL=chunk-SUF7WJS6.js.map
294
- //# sourceMappingURL=chunk-SUF7WJS6.js.map
343
+ export { Button, Field, FieldDescription, FieldError, FieldGroup, FieldLabel, INPUT_AUTOFILL_RESET_CLASSES, Input, LabelGroup, TextInput, buttonVariants, cn, fieldIsChoiceCard, humanizeFieldName };
344
+ //# sourceMappingURL=chunk-QHAQYOBT.js.map
345
+ //# sourceMappingURL=chunk-QHAQYOBT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/utils.ts","../src/components/ui/label.tsx","../src/components/ui/field.tsx","../src/components/ui/input.tsx","../src/inputs/TextInput.tsx","../src/components/ui/button.tsx","../src/core/label-group.tsx"],"names":["React","LabelPrimitive","React3","React4","React5","React6"],"mappings":";;;;;;;AAIO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;AAUO,SAAS,kBAAkB,IAAA,EAAsB;AACtD,EAAA,IAAI,CAAC,MAAM,OAAO,YAAA;AAGlB,EAAA,MAAM,KAAA,GAAQ,IAAA,CACX,OAAA,CAAQ,IAAA,EAAM,GAAG,CAAA,CACjB,OAAA,CAAQ,iBAAA,EAAmB,OAAO,CAAA,CAClC,WAAA,EAAY,CACZ,IAAA,EAAK;AAGR,EAAA,OAAO,KAAA,CAAM,OAAO,CAAC,CAAA,CAAE,aAAY,GAAI,KAAA,CAAM,MAAM,CAAC,CAAA;AACtD;AAKO,IAAM,4BAAA,GACX;AAcK,SAAS,kBAAkB,KAAA,EAAwB;AACxD,EAAA,IAAI,CAAC,OAAA,EAAS,gBAAgB,EAAE,QAAA,CAAS,KAAA,CAAM,IAAI,CAAA,EAAG;AACpD,IAAA,OAAO,KAAA,EAAO,UACV,KAAA,EAAO,OAAA,EAAS,KAAK,CAAC,GAAA,KAAQ,GAAA,CAAI,WAAW,CAAA,GAC7C,KAAA;AAAA,EACN,CAAA,MAAO;AACL,IAAA,OAAO,KAAA;AAAA,EACT;AACF;;;ACnDA,SAAS,KAAA,CAAM;AAAA,EACb,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAqD;AACnD,EAAA,uBACEA,MAAA,CAAA,aAAA;AAAA,IAACC,OAAA,CAAe,IAAA;AAAA,IAAf;AAAA,MACC,WAAA,EAAU,OAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,qNAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;;;ACFA,IAAM,KAAA,GAAc,MAAA,CAAA,UAAA;AAAA,EACp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,EAAI,WAAA,EAAU,eAAc,SAAA,EAAW,cAAA,EAAA,EACrC,SACA,iBACH,CAAA;AAAA,IAEJ;AAAA,EACF;AAEA,EAAA,MAAM,mBAAmB,SAAA,mBACvBA,MAAA,CAAA,aAAA;AAAA,IAAC,gBAAA;AAAA,IAAA;AAAA,MACC,EAAA,EAAI,WAAA;AAAA,MACJ,SAAA,EAAW,EAAA,CAAG,4BAAA,EAA8B,kBAAkB;AAAA,KAAA;AAAA,IAE7D;AAAA,GACH,GACE,IAAA;AAEJ,EAAA,IAAI,CAAC,cAAA,IAAkB,CAAC,gBAAA,EAAkB,OAAO,IAAA;AAGjD,EAAA,IAAI,YAAY,QAAA,EAAU;AACxB,IAAA,uBACEA,MAAA,CAAA,aAAA,CAAAA,MAAA,CAAA,QAAA,EAAA,IAAA,EACG,gBACA,gBACH,CAAA;AAAA,EAEJ;AAEA,EAAA,uBACEA,MAAA,CAAA,aAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,8BAAA,EAAA,EACZ,gBACA,gBACH,CAAA;AAEJ","file":"chunk-QHAQYOBT.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\nimport { FormFieldConfig } from \"../integration\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\n/**\n * Converts a field name (snake_case or camelCase) to a human-readable label.\n *\n * @example\n * humanizeFieldName(\"first_name\") // \"First name\"\n * humanizeFieldName(\"email\") // \"Email\"\n * humanizeFieldName(\"accepts_sms_marketing\") // \"Accepts sms marketing\"\n */\nexport function humanizeFieldName(name: string): string {\n if (!name) return \"This field\";\n\n // Replace underscores with spaces and split camelCase\n const words = name\n .replace(/_/g, \" \")\n .replace(/([a-z])([A-Z])/g, \"$1 $2\")\n .toLowerCase()\n .trim();\n\n // Capitalize first letter only\n return words.charAt(0).toUpperCase() + words.slice(1);\n}\n\n/**\n * Normalizes browser autofill colors so inputs keep theme colors.\n */\nexport const INPUT_AUTOFILL_RESET_CLASSES =\n \"autofill:bg-transparent autofill:text-foreground \" +\n \"[&:-webkit-autofill]:[-webkit-text-fill-color:hsl(var(--foreground))] \" +\n \"[&:-webkit-autofill]:[caret-color:hsl(var(--foreground))] \" +\n \"[&:-webkit-autofill]:[box-shadow:0_0_0px_1000px_hsl(var(--background))_inset] \" +\n \"[&:-webkit-autofill:hover]:[box-shadow:0_0_0px_1000px_hsl(var(--background))_inset] \" +\n \"[&:-webkit-autofill:focus]:[box-shadow:0_0_0px_1000px_hsl(var(--background))_inset] \" +\n \"[&:-webkit-autofill]:[transition:background-color_9999s_ease-out,color_9999s_ease-out]\";\n\n/**\n * Converts a field name (snake_case or camelCase) to a human-readable label.\n *\n * @example\n * fieldIsChoiceCard(field) // false\n */\nexport function fieldIsChoiceCard(field: FormFieldConfig) {\n if ([\"radio\", \"checkbox-group\"].includes(field.type)) {\n return field?.options\n ? field?.options?.some((opt) => opt.description)\n : false;\n } else {\n return false;\n }\n}\n","import * as React from \"react\"\nimport { Label as LabelPrimitive } from \"radix-ui\"\n\nimport { cn } from \"../../lib/utils\"\n\nfunction Label({\n className,\n ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n \"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Label }\n","import * as React from \"react\";\nimport { Label } from \"./label\";\nimport { cn } from \"../../lib/utils\";\n\ntype FieldOrientation = \"vertical\" | \"horizontal\";\n\ninterface FieldProps extends React.HTMLAttributes<HTMLDivElement> {\n orientation?: FieldOrientation;\n invalid?: boolean;\n}\n\n/**\n * Field - Container component for form inputs with validation display\n *\n * Provides consistent layout and spacing for form fields with labels,\n * inputs, descriptions, and error messages.\n */\nconst Field = React.forwardRef<HTMLDivElement, FieldProps>(\n({ className, orientation = \"vertical\", invalid = false, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-slot=\"field\"\n data-orientation={orientation}\n data-invalid={invalid || undefined}\n className={cn(\n // Use space-y instead of flex to avoid interfering with parent grid layouts\n orientation === \"horizontal\"\n ? \"flex items-center gap-2\"\n : \"space-y-1.5\",\n className,\n )}\n {...props}\n />\n );\n});\nField.displayName = \"Field\";\n\n/**\n * FieldGroup - Container for multiple related fields\n *\n * Used to group fields together (e.g., first name + last name in a row)\n */\nconst FieldGroup = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-slot=\"field-group\"\n className={cn(\"flex flex-col gap-4\", className)}\n {...props}\n />\n );\n});\nFieldGroup.displayName = \"FieldGroup\";\n\n/**\n * FieldLabel - Label component for form fields\n *\n * Wrapper around ShadCN Label with consistent styling\n */\nconst FieldLabel = React.forwardRef<\n HTMLLabelElement,\n React.LabelHTMLAttributes<HTMLLabelElement> & {\n required?: boolean;\n }\n>(({ className, required, children, ...props }, ref) => {\n return (\n <Label\n ref={ref}\n data-slot=\"field-label\"\n className={cn(\n \"text-sm font-medium leading-none select-none\",\n \"peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n {children}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </Label>\n );\n});\nFieldLabel.displayName = \"FieldLabel\";\n\n/**\n * FieldDescription - Helper text for form fields\n *\n * Displays additional information or instructions for the field\n */\nconst FieldDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n return (\n <p\n ref={ref}\n data-slot=\"field-description\"\n className={cn(\"text-sm opacity-70\", className)}\n {...props}\n />\n );\n});\nFieldDescription.displayName = \"FieldDescription\";\n\n/**\n * FieldError - Error message display for form fields\n *\n * Shows validation errors with proper styling and accessibility\n */\nconst FieldError = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n return (\n <p\n ref={ref}\n data-slot=\"field-error\"\n role=\"alert\"\n aria-live=\"polite\"\n className={cn(\"text-sm text-destructive\", className)}\n {...props}\n />\n );\n});\nFieldError.displayName = \"FieldError\";\n\nexport { Field, FieldGroup, FieldLabel, FieldDescription, FieldError };\n","import * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { INPUT_AUTOFILL_RESET_CLASSES } from \"../../lib/utils\";\n\n/**\n * Input component - Optimized for dynamic theming across thousands of client brands\n *\n * CRITICAL: This component must work with dynamic Section backgrounds (light/dark/primary/etc)\n * Only uses CSS variables that adapt automatically - NO hardcoded semantic colors\n *\n * See: SHADCN_INTEGRATION_GUIDE.md for full documentation\n */\nconst Input = React.forwardRef<HTMLInputElement, React.ComponentProps<\"input\">>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n ref={ref}\n type={type}\n data-slot=\"input\"\n className={cn(\n // Core structure - no hardcoded colors, uses CSS variables\n \"flex h-9 w-full min-w-0 rounded-md border border-input\",\n \"bg-transparent px-3 py-1 text-base shadow-sm\",\n \"transition-colors outline-none md:text-sm\",\n\n // Focus state - uses ring-ring CSS variable (adapts to theme)\n \"focus-visible:ring-1 focus-visible:ring-ring\",\n\n // Error state - uses destructive CSS variables (adapts to theme)\n \"aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive\",\n\n // Disabled state - no color hardcoding\n \"disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50\",\n\n // File input specific - inherits text color from parent\n \"file:inline-flex file:h-7 file:border-0 file:bg-transparent\",\n \"file:text-sm file:font-medium\",\n\n // Autofill reset - prevents browser from overriding our dynamic colors\n INPUT_AUTOFILL_RESET_CLASSES,\n\n className,\n )}\n {...props}\n />\n );\n },\n);\nInput.displayName = \"Input\";\n\nexport { Input };\n","\"use client\";\n\nimport * as React from \"react\";\nimport type { InputProps } from \"../core/types\";\nimport { Input } from \"../components/ui/input\";\nimport { cn } from \"../lib/utils\";\n\n/**\n * TextInput - High-performance text input component (ShadCN-based)\n *\n * Built on ShadCN Input component with form-specific behavior:\n * - Error state handling\n * - Valid value indicator (ring-2)\n * - Form integration (onChange, onBlur)\n * - Full accessibility support\n * - Optional start/end icon support with automatic padding\n *\n * @example\n * ```tsx\n * const form = useForm({ initialValues: { email: '' } });\n *\n * <TextInput\n * {...form.getFieldProps('email')}\n * type=\"email\"\n * placeholder=\"Enter your email\"\n * error={!!form.errors.email}\n * aria-invalid={!!form.errors.email}\n * aria-describedby={form.errors.email ? 'email-error' : undefined}\n * />\n * ```\n *\n * @see https://opensite.ai/developers/page-speed/forms/text-input\n */\nexport function TextInput({\n name,\n value,\n onChange,\n onBlur,\n placeholder,\n disabled = false,\n required = false,\n error = false,\n className = \"\",\n type = \"text\",\n id = \"text\",\n suppressValueRing = false,\n iconStart,\n iconEnd,\n ...props\n}: InputProps<string> & {\n type?: \"text\" | \"email\" | \"password\" | \"url\" | \"tel\" | \"search\";\n /**\n * When true, suppresses the `ring-2 ring-ring` applied when a value is\n * present. Use this when the component is embedded inside a wrapper (e.g.\n * ButtonGroupForm) that renders its own unified ring.\n */\n suppressValueRing?: boolean;\n /**\n * Optional icon rendered at the start (left) of the input.\n * Automatically adjusts input padding when provided.\n */\n iconStart?: React.ReactNode;\n /**\n * Optional icon rendered at the end (right) of the input.\n * Automatically adjusts input padding when provided.\n */\n iconEnd?: React.ReactNode;\n}) {\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(e.target.value);\n };\n\n const handleBlur = () => {\n onBlur?.();\n };\n\n const hasValue = String(value ?? \"\").trim().length > 0;\n const hasIconStart = Boolean(iconStart);\n const hasIconEnd = Boolean(iconEnd);\n\n if (hasIconStart || hasIconEnd) {\n return (\n <div className=\"relative\">\n {hasIconStart && (\n <span\n className=\"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none\"\n aria-hidden=\"true\"\n >\n {iconStart}\n </span>\n )}\n <Input\n type={type}\n id={id}\n name={name}\n value={value ?? \"\"}\n onChange={handleChange}\n onBlur={handleBlur}\n placeholder={placeholder}\n disabled={disabled}\n required={required}\n className={cn(\n !suppressValueRing && !error && hasValue && \"ring-2 ring-ring\",\n hasIconStart && \"pl-10\",\n hasIconEnd && \"pr-10\",\n className,\n )}\n aria-invalid={error || props[\"aria-invalid\"]}\n aria-describedby={props[\"aria-describedby\"]}\n aria-required={required || props[\"aria-required\"]}\n {...props}\n />\n {hasIconEnd && (\n <span\n className=\"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none\"\n aria-hidden=\"true\"\n >\n {iconEnd}\n </span>\n )}\n </div>\n );\n }\n\n return (\n <Input\n type={type}\n id={id}\n name={name}\n value={value ?? \"\"}\n onChange={handleChange}\n onBlur={handleBlur}\n placeholder={placeholder}\n disabled={disabled}\n required={required}\n className={cn(\n // Valid value indicator - ring-2 when has value, no error, and not suppressed\n !suppressValueRing && !error && hasValue && \"ring-2 ring-ring\",\n // Error state - handled by Input component via aria-invalid\n className,\n )}\n aria-invalid={error || props[\"aria-invalid\"]}\n aria-describedby={props[\"aria-describedby\"]}\n aria-required={required || props[\"aria-required\"]}\n {...props}\n />\n );\n}\n\nTextInput.displayName = \"TextInput\";\n","import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { Slot } from \"radix-ui\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20\",\n outline:\n \"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n xs: \"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9\",\n \"icon-xs\": \"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\": \"size-8\",\n \"icon-lg\": \"size-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nfunction Button({\n className,\n variant = \"default\",\n size = \"default\",\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? Slot.Root : \"button\"\n\n return (\n <Comp\n data-slot=\"button\"\n data-variant={variant}\n data-size={size}\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n","\"use client\";\n\nimport * as React from \"react\";\nimport type { ReactNode } from \"react\";\nimport { FieldDescription, FieldLabel } from \"../components/ui/field\";\nimport { cn } from \"../lib/utils\";\n\nexport type LabelGroupProps = {\n variant?: \"legend\" | \"label\" | \"text\";\n secondary?: ReactNode;\n secondaryId?: string;\n primary?: ReactNode;\n labelHtmlFor?: string;\n required?: boolean;\n primaryClassName?: string;\n secondaryClassName?: string;\n};\n\nconst LabelGroup = ({\n labelHtmlFor,\n required = false,\n variant = \"label\",\n secondaryId,\n secondary,\n primary,\n primaryClassName,\n secondaryClassName,\n}: LabelGroupProps) => {\n const primaryClasses = cn(\n \"text-sm font-medium leading-snug\",\n variant === \"legend\" ? \"mb-2.5\" : \"mb-1 block\",\n primaryClassName,\n );\n\n const requiredIndicator =\n required && variant !== \"label\" ? (\n <span className=\"text-destructive pl-0.5\" aria-label=\"required\">\n *\n </span>\n ) : null;\n\n let primaryElement: ReactNode = null;\n if (primary) {\n if (variant === \"label\") {\n primaryElement = (\n <FieldLabel\n htmlFor={labelHtmlFor}\n required={required}\n className={primaryClasses}\n >\n {primary}\n </FieldLabel>\n );\n } else if (variant === \"legend\") {\n primaryElement = (\n <legend data-slot=\"field-legend\" className={primaryClasses}>\n {primary}\n {requiredIndicator}\n </legend>\n );\n } else {\n primaryElement = (\n <div data-slot=\"field-label\" className={primaryClasses}>\n {primary}\n {requiredIndicator}\n </div>\n );\n }\n }\n\n const secondaryElement = secondary ? (\n <FieldDescription\n id={secondaryId}\n className={cn(\"leading-normal font-normal\", secondaryClassName)}\n >\n {secondary}\n </FieldDescription>\n ) : null;\n\n if (!primaryElement && !secondaryElement) return null;\n\n // Legend should remain a direct child of fieldset for proper semantics.\n if (variant === \"legend\") {\n return (\n <>\n {primaryElement}\n {secondaryElement}\n </>\n );\n }\n\n return (\n <div className=\"flex flex-1 flex-col gap-0.5\">\n {primaryElement}\n {secondaryElement}\n </div>\n );\n};\n\nexport { LabelGroup };\n"]}
@@ -1,10 +1,11 @@
1
- import { cn, FieldLabel, FieldDescription, LabelGroup, Field, INPUT_AUTOFILL_RESET_CLASSES, Button, Input, buttonVariants } from './chunk-SUF7WJS6.js';
1
+ import { cn, FieldLabel, FieldDescription, LabelGroup, Field, INPUT_AUTOFILL_RESET_CLASSES, Button, Input, buttonVariants } from './chunk-QHAQYOBT.js';
2
2
  import * as React19 from 'react';
3
3
  import { Dialog as Dialog$1, Checkbox as Checkbox$1, RadioGroup as RadioGroup$1, Switch as Switch$1, Select as Select$1, Popover as Popover$1 } from 'radix-ui';
4
4
  import { Command as Command$1 } from 'cmdk';
5
5
  import { useDirection } from '@radix-ui/react-direction';
6
6
  import { Slot } from '@radix-ui/react-slot';
7
7
  import { getDefaultClassNames, DayPicker } from 'react-day-picker';
8
+ import { Icon, DEFAULT_ICON_API_BASE_URL } from '@page-speed/icon';
8
9
 
9
10
  function Textarea({ className, ...props }) {
10
11
  return /* @__PURE__ */ React19.createElement(
@@ -13,7 +14,7 @@ function Textarea({ className, ...props }) {
13
14
  "data-slot": "textarea",
14
15
  className: cn(
15
16
  // Core structure - uses CSS variables only
16
- "flex field-sizing-content min-h-16 w-full rounded-md border border-input",
17
+ "flex field-sizing-content min-h-32 w-full rounded-md border border-input",
17
18
  "bg-transparent px-3 py-2 text-base shadow-xs",
18
19
  "transition-[color,box-shadow] outline-none md:text-sm",
19
20
  // Focus state - uses ring-ring CSS variable
@@ -104,6 +105,7 @@ function Checkbox({
104
105
  "aria-invalid:border-destructive aria-invalid:ring-destructive/20",
105
106
  // Disabled state
106
107
  "disabled:cursor-not-allowed disabled:opacity-50",
108
+ " mt-1",
107
109
  className
108
110
  ),
109
111
  ...props
@@ -448,7 +450,17 @@ function Radio({
448
450
  return options.some((option) => option.description);
449
451
  }, [options]);
450
452
  const groupDescriptionId = description ? `${name}-description` : void 0;
451
- return /* @__PURE__ */ React19.createElement("div", { className: cn("w-full", className), "data-invalid": error || void 0 }, (label || description) && /* @__PURE__ */ React19.createElement("div", { className: "mb-3 space-y-1" }, label && /* @__PURE__ */ React19.createElement("div", { className: "text-base font-medium leading-none" }, label), description && /* @__PURE__ */ React19.createElement(FieldDescription, { id: groupDescriptionId, className: "leading-snug" }, description)), /* @__PURE__ */ React19.createElement(
453
+ return /* @__PURE__ */ React19.createElement("div", { className: cn("w-full", className), "data-invalid": error || void 0 }, /* @__PURE__ */ React19.createElement(
454
+ LabelGroup,
455
+ {
456
+ labelHtmlFor: name,
457
+ required,
458
+ variant: "legend",
459
+ secondaryId: groupDescriptionId,
460
+ secondary: description,
461
+ primary: label
462
+ }
463
+ ), /* @__PURE__ */ React19.createElement(
452
464
  RadioGroup,
453
465
  {
454
466
  name,
@@ -458,8 +470,9 @@ function Radio({
458
470
  disabled,
459
471
  required,
460
472
  className: cn(
461
- layout === "grid" && "grid grid-cols-1 md:grid-cols-2 gap-3",
462
- layout === "inline" && "flex flex-wrap gap-0"
473
+ layout === "grid" && "grid grid-cols-1 md:grid-cols-2",
474
+ layout === "inline" && "flex flex-wrap",
475
+ useChoiceCard ? "gap-3" : "gap-0"
463
476
  ),
464
477
  "aria-invalid": error || props["aria-invalid"],
465
478
  "aria-describedby": groupDescriptionId || props["aria-describedby"],
@@ -476,8 +489,11 @@ function Radio({
476
489
  key: option.value,
477
490
  htmlFor: radioId,
478
491
  className: cn(
479
- "flex gap-3 p-3 duration-200 select-auto font-normal leading-normal",
480
- useChoiceCard && "border rounded-lg hover:ring-2 hover:ring-ring/50",
492
+ "flex gap-3 duration-200",
493
+ "select-auto font-normal leading-normal",
494
+ useChoiceCard && "hover:ring-2 hover:ring-ring",
495
+ useChoiceCard && "border rounded-lg p-3",
496
+ !useChoiceCard && "p-1",
481
497
  useChoiceCard && isSelected && "ring-2 ring-ring",
482
498
  useChoiceCard && error && "border-destructive",
483
499
  isDisabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
@@ -2551,7 +2567,7 @@ function FileInput({
2551
2567
  value = [],
2552
2568
  onChange,
2553
2569
  onBlur,
2554
- placeholder = "Choose file...",
2570
+ placeholder,
2555
2571
  disabled = false,
2556
2572
  required = false,
2557
2573
  error = false,
@@ -2829,7 +2845,26 @@ function FileInput({
2829
2845
  }
2830
2846
  };
2831
2847
  }, [imageToCrop]);
2832
- const fileCountLabel = normalizedValue.length > 0 ? `${normalizedValue.length} file(s) selected` : placeholder;
2848
+ const dynamicPlaceholder = React19.useMemo(() => {
2849
+ if (placeholder) {
2850
+ return placeholder;
2851
+ }
2852
+ return `Drag & drop file${multiple ? "s" : ""} here`;
2853
+ }, [multiple, placeholder]);
2854
+ const metadataElement = React19.useMemo(() => {
2855
+ const metaList = [];
2856
+ if (accept) {
2857
+ metaList.push(`Accepted: ${accept}`);
2858
+ }
2859
+ if (maxSize) {
2860
+ metaList.push(`Max size: ${formatFileSize(maxSize)}`);
2861
+ }
2862
+ if (metaList.length > 0) {
2863
+ return /* @__PURE__ */ React19.createElement("div", { className: "flex text-center items-center justify-center gap-4" }, metaList.map((str) => /* @__PURE__ */ React19.createElement("span", { key: str, className: "font-sm opacity-75" }, str)));
2864
+ } else {
2865
+ return null;
2866
+ }
2867
+ }, [accept, maxSize]);
2833
2868
  return /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement(
2834
2869
  FileUpload,
2835
2870
  {
@@ -2860,33 +2895,33 @@ function FileInput({
2860
2895
  FileUploadDropzone,
2861
2896
  {
2862
2897
  role: "button",
2863
- "aria-label": placeholder,
2898
+ "aria-label": dynamicPlaceholder,
2864
2899
  className: cn(
2865
- "flex min-h-32 w-full cursor-pointer items-center justify-center border-input bg-transparent p-6 transition-colors",
2866
- "hover:bg-accent/50",
2867
- "data-[dragging]:bg-accent/50",
2900
+ "flex min-h-32 w-full cursor-pointer",
2901
+ "items-center justify-center border-input",
2902
+ "bg-transparent p-6 transition-colors",
2903
+ "data-[dragging]:ring-2 hover:ring-2",
2868
2904
  disabled && "cursor-not-allowed opacity-50",
2869
2905
  error && "border-destructive"
2870
2906
  )
2871
2907
  },
2872
- /* @__PURE__ */ React19.createElement("div", { className: "flex flex-col items-center gap-1 text-center" }, /* @__PURE__ */ React19.createElement("div", { className: "flex items-center justify-center rounded-full border p-2.5" }, /* @__PURE__ */ React19.createElement(
2908
+ /* @__PURE__ */ React19.createElement("div", { className: "flex flex-col items-center gap-3 text-center" }, /* @__PURE__ */ React19.createElement("div", { className: "flex items-center justify-center rounded-full border p-2.5" }, /* @__PURE__ */ React19.createElement(
2873
2909
  "svg",
2874
2910
  {
2875
- width: "24",
2876
- height: "24",
2911
+ width: "18",
2912
+ height: "18",
2877
2913
  viewBox: "0 0 24 24",
2878
2914
  fill: "none",
2879
2915
  stroke: "currentColor",
2880
2916
  strokeWidth: "2",
2881
2917
  strokeLinecap: "round",
2882
2918
  strokeLinejoin: "round",
2883
- className: "text-muted-foreground",
2884
2919
  "aria-hidden": "true"
2885
2920
  },
2886
2921
  /* @__PURE__ */ React19.createElement("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
2887
2922
  /* @__PURE__ */ React19.createElement("polyline", { points: "17 8 12 3 7 8" }),
2888
2923
  /* @__PURE__ */ React19.createElement("line", { x1: "12", y1: "3", x2: "12", y2: "15" })
2889
- )), /* @__PURE__ */ React19.createElement("p", { className: "text-sm font-medium" }, fileCountLabel), accept && /* @__PURE__ */ React19.createElement("p", { className: "text-muted-foreground text-xs" }, "Accepted: ", accept), /* @__PURE__ */ React19.createElement("p", { className: "text-muted-foreground text-xs" }, "Max size: ", formatFileSize(maxSize)))
2924
+ )), /* @__PURE__ */ React19.createElement("div", { className: "flex flex-col items-center justify-center gap-1 text-center" }, /* @__PURE__ */ React19.createElement("p", { className: "text-sm font-medium" }, dynamicPlaceholder), metadataElement))
2890
2925
  ),
2891
2926
  /* @__PURE__ */ React19.createElement(FileUploadList, { className: "mt-4" }, normalizedValue.map((file, index) => {
2892
2927
  const progressValue = uploadProgress[file.name];
@@ -2896,9 +2931,12 @@ function FileInput({
2896
2931
  {
2897
2932
  key: `${file.name}-${index}`,
2898
2933
  value: file,
2899
- className: "flex items-center gap-3 border-border bg-card text-card-foreground hover:bg-accent/50 transition-colors"
2934
+ className: cn(
2935
+ "flex items-center gap-3",
2936
+ "border-border bg-card text-card-foreground"
2937
+ )
2900
2938
  },
2901
- showPreview ? /* @__PURE__ */ React19.createElement(FileUploadItemPreview, { className: "h-12 w-12 rounded [&>img]:h-full [&>img]:w-full [&>img]:object-cover [&>svg]:size-6" }) : null,
2939
+ showPreview ? /* @__PURE__ */ React19.createElement(FileUploadItemPreview, { className: "size-12 rounded [&>img]:h-full [&>img]:w-full [&>img]:object-cover [&>svg]:size-6" }) : null,
2902
2940
  /* @__PURE__ */ React19.createElement("div", { className: "flex min-w-0 flex-1 flex-col" }, /* @__PURE__ */ React19.createElement(FileUploadItemMetadata, { className: "min-w-0" }), hasProgress && progressValue < 100 ? /* @__PURE__ */ React19.createElement("div", { className: "mt-1 flex items-center gap-2" }, /* @__PURE__ */ React19.createElement(
2903
2941
  "div",
2904
2942
  {
@@ -2916,7 +2954,7 @@ function FileInput({
2916
2954
  style: { width: `${progressValue}%` }
2917
2955
  }
2918
2956
  )
2919
- ), /* @__PURE__ */ React19.createElement("span", { className: "text-xs" }, progressValue, "%")) : null),
2957
+ ), /* @__PURE__ */ React19.createElement("span", { className: "text-xs" }, progressValue, "%")) : /* @__PURE__ */ React19.createElement("span", { className: "text-xs" }, formatFileSize(file.size))),
2920
2958
  enableCropping && file.type.startsWith("image/") ? /* @__PURE__ */ React19.createElement(
2921
2959
  Button,
2922
2960
  {
@@ -2928,7 +2966,7 @@ function FileInput({
2928
2966
  handleCrop(file);
2929
2967
  },
2930
2968
  disabled,
2931
- className: "h-8 w-8 p-0",
2969
+ className: "size-8 p-0",
2932
2970
  "aria-label": `Crop ${file.name}`
2933
2971
  },
2934
2972
  /* @__PURE__ */ React19.createElement(
@@ -2952,10 +2990,10 @@ function FileInput({
2952
2990
  Button,
2953
2991
  {
2954
2992
  type: "button",
2955
- variant: "ghost",
2956
- size: "icon",
2993
+ variant: "outline",
2994
+ size: "icon-sm",
2957
2995
  disabled,
2958
- className: "h-8 w-8 p-0",
2996
+ className: "size-8 p-0",
2959
2997
  "aria-label": `Remove ${file.name}`
2960
2998
  },
2961
2999
  /* @__PURE__ */ React19.createElement(
@@ -3023,7 +3061,7 @@ function FileInput({
3023
3061
  /* @__PURE__ */ React19.createElement("div", { className: "p-4" }, /* @__PURE__ */ React19.createElement(
3024
3062
  "div",
3025
3063
  {
3026
- className: "relative h-96 w-full overflow-hidden rounded-md bg-accent/40",
3064
+ className: "relative h-96 w-full overflow-hidden rounded-md",
3027
3065
  onMouseDown: (event) => {
3028
3066
  event.preventDefault();
3029
3067
  const startX = event.clientX - crop.x;
@@ -3107,7 +3145,7 @@ function FileInput({
3107
3145
  step: "0.1",
3108
3146
  value: zoom,
3109
3147
  onChange: (event) => onZoomChange(parseFloat(event.target.value)),
3110
- className: "h-2 flex-1 cursor-pointer appearance-none rounded-lg bg-accent/60",
3148
+ className: "h-2 flex-1 cursor-pointer appearance-none rounded-lg bg-primary",
3111
3149
  "aria-label": "Zoom level"
3112
3150
  }
3113
3151
  ))),
@@ -3349,8 +3387,6 @@ function CalendarDayButton({
3349
3387
  }
3350
3388
  );
3351
3389
  }
3352
-
3353
- // src/inputs/DatePicker.tsx
3354
3390
  function formatDate(date, format) {
3355
3391
  if (!date) return "";
3356
3392
  const d = new Date(date);
@@ -3495,19 +3531,12 @@ function DatePicker({
3495
3531
  "aria-hidden": "true"
3496
3532
  },
3497
3533
  /* @__PURE__ */ React19.createElement(
3498
- "svg",
3534
+ Icon,
3499
3535
  {
3500
- xmlns: "http://www.w3.org/2000/svg",
3501
- width: "18",
3502
- height: "18",
3503
- viewBox: "0 0 24 24",
3504
- fill: "none",
3505
- stroke: "currentColor",
3506
- strokeLinecap: "round",
3507
- strokeLinejoin: "round",
3508
- strokeWidth: "2"
3509
- },
3510
- /* @__PURE__ */ React19.createElement("path", { d: "M8 2v4m8-4v4m5 8V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8M3 10h18m-5 10l2 2l4-4" })
3536
+ name: "material-symbols/edit-calendar-outline",
3537
+ apiKey: DEFAULT_ICON_API_BASE_URL,
3538
+ size: 18
3539
+ }
3511
3540
  )
3512
3541
  ), /* @__PURE__ */ React19.createElement(PopoverTrigger, { asChild: true }, /* @__PURE__ */ React19.createElement(
3513
3542
  "input",
@@ -3516,9 +3545,13 @@ function DatePicker({
3516
3545
  id: props.id,
3517
3546
  type: "text",
3518
3547
  className: cn(
3519
- "flex h-9 w-full rounded-md border border-input bg-transparent py-1 text-base shadow-sm transition-colors",
3520
- "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
3521
- "disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
3548
+ "flex h-9 w-full rounded-md border",
3549
+ "border-input bg-transparent py-1 text-base",
3550
+ "shadow-sm transition-colors",
3551
+ "focus-visible:outline-none focus-visible:ring-1",
3552
+ "focus-visible:ring-ring",
3553
+ "disabled:cursor-not-allowed",
3554
+ "disabled:opacity-50 md:text-sm",
3522
3555
  INPUT_AUTOFILL_RESET_CLASSES,
3523
3556
  showIcon ? "pl-10" : "pl-3",
3524
3557
  clearable && value ? "pr-10" : "pr-3",
@@ -4058,5 +4091,5 @@ function DateRangePicker({
4058
4091
  DateRangePicker.displayName = "DateRangePicker";
4059
4092
 
4060
4093
  export { Checkbox2 as Checkbox, CheckboxGroup, DatePicker, DateRangePicker, FileInput, MultiSelect, Radio, Select2 as Select, Switch2 as Switch, TextArea, TimePicker };
4061
- //# sourceMappingURL=chunk-ZH6XDBWH.js.map
4062
- //# sourceMappingURL=chunk-ZH6XDBWH.js.map
4094
+ //# sourceMappingURL=chunk-SF6NKDID.js.map
4095
+ //# sourceMappingURL=chunk-SF6NKDID.js.map