@px-ui/forms 4.0.0 → 4.1.0

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.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React$1 from "react";
2
2
  import { ReactNode } from "react";
3
3
  import { Combobox, FileUploadWithUploaderOptions, FileWithUploadStatus, Label, Select, VariantProps } from "@px-ui/core";
4
- import * as react_jsx_runtime0 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
5
5
  import { ControllerProps, FieldPath, FieldValues } from "react-hook-form";
6
6
 
7
7
  //#region src/components/select-field.d.ts
@@ -58,7 +58,7 @@ interface SelectFieldProps<TItem = any, TMultiple extends boolean | undefined =
58
58
  * />
59
59
  * ```
60
60
  */
61
- declare function SelectField<TItem = any, TMultiple extends boolean | undefined = false>(props: SelectFieldProps<TItem, TMultiple>): react_jsx_runtime0.JSX.Element;
61
+ declare function SelectField<TItem = any, TMultiple extends boolean | undefined = false>(props: SelectFieldProps<TItem, TMultiple>): react_jsx_runtime1.JSX.Element;
62
62
  //#endregion
63
63
  //#region src/components/combobox-field.d.ts
64
64
  type AllRootProps<TItem = any, TSelectedValue = TItem, TMultiple extends boolean | undefined = false> = React$1.ComponentProps<typeof Combobox.Root<TItem, TSelectedValue, TMultiple>>;
@@ -149,7 +149,7 @@ interface ComboboxFieldProps<TItem = any, TSelectedValue = TItem, TMultiple exte
149
149
  * onValueChange={setSelected}
150
150
  * />
151
151
  */
152
- declare function ComboboxField<TItem = any, TSelectedValue = TItem, TMultiple extends boolean | undefined = false>(props: ComboboxFieldProps<TItem, TSelectedValue, TMultiple>): react_jsx_runtime0.JSX.Element;
152
+ declare function ComboboxField<TItem = any, TSelectedValue = TItem, TMultiple extends boolean | undefined = false>(props: ComboboxFieldProps<TItem, TSelectedValue, TMultiple>): react_jsx_runtime1.JSX.Element;
153
153
  //#endregion
154
154
  //#region src/components/file-upload-field.d.ts
155
155
  interface FileUploadFieldProps extends Omit<FileUploadWithUploaderOptions, "initialFiles"> {
@@ -211,25 +211,25 @@ declare function FileUploadField({
211
211
  onFilesChange,
212
212
  onFilesAdded,
213
213
  upload
214
- }: FileUploadFieldProps): react_jsx_runtime0.JSX.Element;
214
+ }: FileUploadFieldProps): react_jsx_runtime1.JSX.Element;
215
215
  declare namespace field_d_exports {
216
216
  export { Content, Description, Error, Group, Label$1 as Label, Legend, Root, Separator$1 as Separator, Set, Title };
217
217
  }
218
218
  declare function Set({
219
219
  className,
220
220
  ...props
221
- }: React.ComponentProps<"fieldset">): react_jsx_runtime0.JSX.Element;
221
+ }: React.ComponentProps<"fieldset">): react_jsx_runtime1.JSX.Element;
222
222
  declare function Legend({
223
223
  className,
224
224
  variant,
225
225
  ...props
226
226
  }: React.ComponentProps<"legend"> & {
227
227
  variant?: "legend" | "label";
228
- }): react_jsx_runtime0.JSX.Element;
228
+ }): react_jsx_runtime1.JSX.Element;
229
229
  declare function Group({
230
230
  className,
231
231
  ...props
232
- }: React.ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
232
+ }: React.ComponentProps<"div">): react_jsx_runtime1.JSX.Element;
233
233
  type FieldVariantsType = (props?: {
234
234
  orientation?: "vertical" | "horizontal" | "responsive";
235
235
  } | undefined) => string;
@@ -238,30 +238,30 @@ declare function Root({
238
238
  className,
239
239
  orientation,
240
240
  ...props
241
- }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): react_jsx_runtime0.JSX.Element;
241
+ }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): react_jsx_runtime1.JSX.Element;
242
242
  declare function Content({
243
243
  className,
244
244
  ...props
245
- }: React.ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
245
+ }: React.ComponentProps<"div">): react_jsx_runtime1.JSX.Element;
246
246
  declare function Label$1({
247
247
  className,
248
248
  ...props
249
- }: React.ComponentProps<typeof Label>): react_jsx_runtime0.JSX.Element;
249
+ }: React.ComponentProps<typeof Label>): react_jsx_runtime1.JSX.Element;
250
250
  declare function Title({
251
251
  className,
252
252
  ...props
253
- }: React.ComponentProps<"div">): react_jsx_runtime0.JSX.Element;
253
+ }: React.ComponentProps<"div">): react_jsx_runtime1.JSX.Element;
254
254
  declare function Description({
255
255
  className,
256
256
  ...props
257
- }: React.ComponentProps<"p">): react_jsx_runtime0.JSX.Element;
257
+ }: React.ComponentProps<"p">): react_jsx_runtime1.JSX.Element;
258
258
  declare function Separator$1({
259
259
  children,
260
260
  className,
261
261
  ...props
262
262
  }: React.ComponentProps<"div"> & {
263
263
  children?: React.ReactNode;
264
- }): react_jsx_runtime0.JSX.Element;
264
+ }): react_jsx_runtime1.JSX.Element;
265
265
  declare function Error({
266
266
  className,
267
267
  children,
@@ -271,7 +271,7 @@ declare function Error({
271
271
  errors?: Array<{
272
272
  message?: string;
273
273
  } | undefined>;
274
- }): react_jsx_runtime0.JSX.Element | null;
274
+ }): react_jsx_runtime1.JSX.Element | null;
275
275
  //#endregion
276
276
  //#region src/components/form.d.ts
277
277
  type FormControlProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TTransformedValues = TFieldValues> = {
@@ -280,6 +280,7 @@ type FormControlProps<TFieldValues extends FieldValues = FieldValues, TName exte
280
280
  description?: ReactNode;
281
281
  control: ControllerProps<TFieldValues, TName, TTransformedValues>["control"];
282
282
  required?: boolean;
283
+ placeholder?: string;
283
284
  };
284
285
  type FormControlFunc<ExtraProps extends Record<string, unknown> = Record<never, never>> = <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TTransformedValues = TFieldValues>(props: FormControlProps<TFieldValues, TName, TTransformedValues> & ExtraProps) => ReactNode;
285
286
  declare const FormInput: FormControlFunc;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/components/select-field.tsx","../src/components/combobox-field.tsx","../src/components/file-upload-field.tsx","../src/components/field.tsx","../src/components/form.ts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AA,EG4JZ,KAAA,CAAM,cH5JM,CAAA,KAAA,CAAA,GAAA;EAAO,QAAA,CAAA,EG6JT,KAAA,CAAM,SH7JG;CAApB,CAAA,EG8JD,kBAAA,CAAA,GAAA,CAAA,OH9JC;AADE,iBG0LY,KAAA,CH1LZ;EAAA,SAAA;EAAA,QAAA;EAAA,MAAA;EAAA,GAAA;CAAA,EG+LD,KAAA,CAAM,cH/LL,CAAA,KAAA,CAAA,GAAA;EAAI,MAAA,CAAA,EGgMG,KHhMH,CAAA;IAaE,OAAA,CAAA,EAAA,MAAgB;EAGN,CAAA,GAAA,SAAA,CAAA;CAAO,CAAA,EGiL1B,kBAAA,CAAA,GAAA,CAAA,OAAA,GHjL0B,IAAA;;;KIjBtB,sCACkB,cAAc,2BACrB,UAAU,gBAAgB,UAAU,oCAC7B;QAEf;SACC;gBACO;WACL,gBAAgB,cAAc,OAAO;;AJjBX,CAAA;KIsChC,eJjCuC,CAAA,mBIkCvB,MJlCuB,CAAA,MAAA,EAAA,OAAA,CAAA,GIkCG,MJlCH,CAAA,KAAA,EAAA,KAAA,CAAA,CAAA,GAAA,CAAA,qBIoCrB,WJpCqB,GIoCP,WJpCO,EAAA,cIqC5B,SJrC4B,CIqClB,YJrCkB,CAAA,GIqCF,SJrCE,CIqCQ,YJrCR,CAAA,EAAA,qBIsCrB,YJtCqB,CAAA,CAAA,KAAA,EIwCnC,gBJxCmC,CIwClB,YJxCkB,EIwCJ,KJxCI,EIwCG,kBJxCH,CAAA,GIwCyB,UJxCzB,EAAA,GIyCvC,SJzCuC;AAAO,cI6GtC,SJ7GsC,EI6G3B,eJ7G2B;AAAnB,cIiHnB,YJjH0B,EIiHZ,eJjHY;AAAnC,cIqHS,YJrHH,EIqHiB,eJrHjB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/components/select-field.tsx","../src/components/combobox-field.tsx","../src/components/file-upload-field.tsx","../src/components/field.tsx","../src/components/form.tsx"],"sourcesContent":[],"mappings":";;;;;;;K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CAAA,KAAA,CAAA,GAAA;EAAO,QAAA,CAAA,EG6JT,KAAA,CAAM,SH7JG;CAApB,CAAA,EG8JD,kBAAA,CAAA,GAAA,CAAA,OH9JC;AADE,iBG0LY,KAAA,CH1LZ;EAAA,SAAA;EAAA,QAAA;EAAA,MAAA;EAAA,GAAA;CAAA,EG+LD,KAAA,CAAM,cH/LL,CAAA,KAAA,CAAA,GAAA;EAAI,MAAA,CAAA,EGgMG,KHhMH,CAAA;IAaE,OAAA,CAAA,EAAA,MAAgB;EAGN,CAAA,GAAA,SAAA,CAAA;CAAO,CAAA,EGiL1B,kBAAA,CAAA,GAAA,CAAA,OAAA,GHjL0B,IAAA;;;KIjBtB,sCACkB,cAAc,2BACrB,UAAU,gBAAgB,UAAU,oCAC7B;QAEf;SACC;gBACO;WACL,gBAAgB,cAAc,OAAO;;EJf3C,WAAA,CAAA,EAAA,MAAY;CAG2B;KIkCvC,eJlC8C,CAAA,mBImC9B,MJnC8B,CAAA,MAAA,EAAA,OAAA,CAAA,GImCJ,MJnCI,CAAA,KAAA,EAAA,KAAA,CAAA,CAAA,GAAA,CAAA,qBIqC5B,WJrC4B,GIqCd,WJrCc,EAAA,cIsCnC,SJtCmC,CIsCzB,YJtCyB,CAAA,GIsCT,SJtCS,CIsCC,YJtCD,CAAA,EAAA,qBIuC5B,YJvC4B,CAAA,CAAA,KAAA,EIyC1C,gBJzC0C,CIyCzB,YJzCyB,EIyCX,KJzCW,EIyCJ,kBJzCI,CAAA,GIyCkB,UJzClB,EAAA,GI0C9C,SJ1C8C;AAAnB,cI8GnB,SJ9G0B,EI8Gf,eJ9Ge;AAAnC,cIsHS,YJtHH,EIsHiB,eJtHjB;AAAc,cI8HX,YJ9HW,EI8HG,eJ9HH"}
package/dist/index.js CHANGED
@@ -509,16 +509,22 @@ function FormBase({ children, control, label, name, required, description, contr
509
509
  }
510
510
  });
511
511
  }
512
- const FormInput = (props) => {
512
+ const FormInput = ({ placeholder, ...props }) => {
513
513
  return /* @__PURE__ */ jsx(FormBase, {
514
514
  ...props,
515
- children: (field) => /* @__PURE__ */ jsx(Input, { ...field })
515
+ children: (field) => /* @__PURE__ */ jsx(Input, {
516
+ ...field,
517
+ placeholder
518
+ })
516
519
  });
517
520
  };
518
- const FormTextarea = (props) => {
521
+ const FormTextarea = ({ placeholder, ...props }) => {
519
522
  return /* @__PURE__ */ jsx(FormBase, {
520
523
  ...props,
521
- children: (field) => /* @__PURE__ */ jsx(Textarea, { ...field })
524
+ children: (field) => /* @__PURE__ */ jsx(Textarea, {
525
+ ...field,
526
+ placeholder
527
+ })
522
528
  });
523
529
  };
524
530
  const FormCheckbox = (props) => {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["items","fieldVariants: FieldVariantsType","Label","LabelPrimitive","Separator","SeperatorPrimitive","Field.Label","Field.Description","control","Field.Error","Field.Root","FormInput: FormControlFunc","FormTextarea: FormControlFunc","FormCheckbox: FormControlFunc"],"sources":["../src/components/select-field.tsx","../src/components/combobox-field.tsx","../src/components/file-upload-field.tsx","../src/components/field.tsx","../src/components/form.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Select } from \"@px-ui/core\";\n\ntype AllRootProps<\n TItem = any,\n TMultiple extends boolean | undefined = false,\n> = React.ComponentProps<typeof Select.Root<TItem, TMultiple>>;\n\ntype RootProps<\n TItem = any,\n TMultiple extends boolean | undefined = false,\n> = Pick<\n AllRootProps<TItem, TMultiple>,\n | \"value\"\n | \"onValueChange\"\n | \"multiple\"\n | \"disabled\"\n | \"invalid\"\n | \"isItemEqualToValue\"\n | \"inputRef\"\n | \"readOnly\"\n | \"name\"\n>;\n\ninterface SelectFieldProps<\n TItem = any,\n TMultiple extends boolean | undefined = false,\n> extends RootProps<TItem, TMultiple> {\n /**\n * Array of items to display in the select dropdown\n */\n items: ReadonlyArray<TItem>;\n /**\n * Function to render the label in the trigger for the selected item\n * If not provided and item has a 'label' property, it will be used automatically\n */\n renderLabel?: (item: TItem) => React.ReactNode;\n\n /**\n * Function to render each option in the dropdown\n * If not provided and item has a 'label' property, it will be used automatically\n */\n renderOption?: (item: TItem) => React.ReactNode;\n\n /**\n * Placeholder text when no value is selected\n */\n placeholder?: string;\n\n size?: React.ComponentProps<typeof Select.Trigger>[\"size\"];\n\n widthVariant?: React.ComponentProps<typeof Select.Trigger>[\"widthVariant\"];\n\n /**\n * Width variant for the dropdown content\n */\n contentWidthVariant?: React.ComponentProps<\n typeof Select.Content\n >[\"widthVariant\"];\n\n triggerClassName?: string;\n\n /**\n * Additional props for Select.Content\n */\n contentProps?: Omit<\n React.ComponentProps<typeof Select.Content>,\n \"children\" | \"widthVariant\"\n >;\n}\n\n/**\n * A simplified Select component for common use cases.\n * For advanced customization, use the composable Select.* components from @px-ui/core.\n *\n * @example\n * ```tsx\n * const items = [\n * { id: 1, label: 'Option 1' },\n * { id: 2, label: 'Option 2' },\n * ];\n *\n * <SelectField\n * items={items}\n * value={selected}\n * onValueChange={setSelected}\n * renderLabel={(item) => item.label}\n * renderOption={(item) => item.label}\n * />\n * ```\n */\nexport function SelectField<\n TItem = any,\n TMultiple extends boolean | undefined = false,\n>(props: SelectFieldProps<TItem, TMultiple>) {\n const {\n items,\n value,\n onValueChange,\n renderLabel,\n renderOption,\n placeholder,\n multiple,\n disabled,\n invalid,\n name,\n isItemEqualToValue,\n size,\n widthVariant,\n contentWidthVariant,\n contentProps,\n triggerClassName,\n inputRef,\n readOnly,\n } = props;\n\n // Helper to get the key for an item\n const getItemKey = (item: TItem, index: number): string => {\n if (item && typeof item === \"object\") {\n if (\"value\" in item) {\n const val = (item as any).value;\n return typeof val === \"string\" || typeof val === \"number\"\n ? String(val)\n : index.toString();\n }\n if (\"id\" in item) {\n const id = (item as any).id;\n return typeof id === \"string\" || typeof id === \"number\"\n ? String(id)\n : index.toString();\n }\n }\n return index.toString();\n };\n\n // Helper to render item content\n const renderItemContent = (item: TItem): React.ReactNode => {\n if (renderOption) {\n return renderOption(item);\n }\n // Auto-detect label property\n if (item && typeof item === \"object\" && \"label\" in item) {\n return (item as any).label;\n }\n // Fallback to string representation\n return String(item);\n };\n\n // Helper to render selected value label\n const renderValueLabel = (item: TItem): React.ReactNode => {\n if (renderLabel) {\n return renderLabel(item);\n }\n // Use same logic as renderOption\n return renderItemContent(item);\n };\n\n return (\n <Select.Root<TItem, TMultiple>\n value={value}\n onValueChange={onValueChange}\n multiple={multiple}\n disabled={disabled}\n invalid={invalid}\n name={name}\n isItemEqualToValue={isItemEqualToValue}\n inputRef={inputRef}\n readOnly={readOnly}\n >\n <Select.Trigger\n size={size}\n widthVariant={widthVariant}\n className={triggerClassName}\n >\n <Select.Value placeholder={placeholder}>\n {(selectedValue: any) => {\n // Handle multiple selection\n if (multiple && Array.isArray(selectedValue)) {\n // For multiple, show MultiSelectedValue by default\n const labels = selectedValue.map((item: TItem) => {\n const label = renderValueLabel(item);\n return typeof label === \"string\" ? label : String(label);\n });\n return (\n <Select.MultiSelectedValue\n selectedValue={labels}\n maxItems={2}\n />\n );\n }\n\n // Single selection - show placeholder if no value\n if (selectedValue == null) {\n return placeholder || null;\n }\n\n return renderValueLabel(selectedValue as TItem);\n }}\n </Select.Value>\n </Select.Trigger>\n\n <Select.Content widthVariant={contentWidthVariant} {...contentProps}>\n <Select.List>\n {(items as any[])?.map((item, index) => {\n const key = getItemKey(item, index);\n const ItemComponent = multiple ? Select.MultiItem : Select.Item;\n\n return (\n <ItemComponent key={key} value={item}>\n {renderItemContent(item)}\n </ItemComponent>\n );\n })}\n </Select.List>\n </Select.Content>\n </Select.Root>\n );\n}\n","import * as React from \"react\";\nimport { Combobox } from \"@px-ui/core\";\n\ntype AllRootProps<\n TItem = any,\n TSelectedValue = TItem,\n TMultiple extends boolean | undefined = false,\n> = React.ComponentProps<\n typeof Combobox.Root<TItem, TSelectedValue, TMultiple>\n>;\n\ntype RootProps<\n TItem = any,\n TSelectedValue = TItem,\n TMultiple extends boolean | undefined = false,\n> = Pick<\n AllRootProps<TItem, TSelectedValue, TMultiple>,\n | \"items\"\n | \"loadOptions\"\n | \"value\"\n | \"onValueChange\"\n | \"multiple\"\n | \"disabled\"\n | \"invalid\"\n | \"isItemEqualToValue\"\n | \"inputRef\"\n | \"readOnly\"\n>;\n\ninterface ComboboxFieldProps<\n TItem = any,\n TSelectedValue = TItem,\n TMultiple extends boolean | undefined = false,\n> extends RootProps<TItem, TSelectedValue, TMultiple> {\n /**\n * Function to render the label in the trigger for the selected item(s)\n * - For single select: receives a single item\n * - For multiple select: receives an array of items\n * If not provided and item has a 'label' property, it will be used automatically\n */\n renderLabel?: TMultiple extends true\n ? (items: TSelectedValue[]) => React.ReactNode\n : (item: TSelectedValue) => string | React.ReactNode;\n\n /**\n * Function to render each option in the dropdown\n * If not provided and item has a 'label' property, it will be used automatically\n */\n renderOption?: (item: TItem) => React.ReactNode;\n\n /**\n * Function to render each chip in ChipsTrigger (multiple selection only)\n * If not provided, renderLabel or auto-detected label will be used\n */\n renderChip?: (item: TSelectedValue) => React.ReactNode | string;\n\n /**\n * Placeholder text when no value is selected\n */\n placeholder?: string;\n\n /**\n * Show search input inside the popup instead of in trigger\n * Only applicable when not using searchable trigger\n * @default false\n */\n searchInPopup?: boolean;\n\n /**\n * Size variant for trigger\n */\n size?: React.ComponentProps<typeof Combobox.SearchableTrigger>[\"size\"];\n\n /**\n * Width variant for trigger\n */\n widthVariant?: \"enforced\" | \"full\";\n\n /**\n * Width variant for the dropdown content\n */\n contentWidthVariant?: \"trigger\" | \"fit\" | \"enforced\";\n\n /**\n * Additional className for the trigger\n */\n triggerClassName?: string;\n\n /**\n * Additional props for Combobox.Content\n */\n contentProps?: Omit<\n React.ComponentProps<typeof Combobox.Content>,\n \"children\" | \"widthVariant\" | \"empty\"\n >;\n}\n\n/**\n * A simplified Combobox component for common use cases.\n * For advanced customization, use the composable Combobox.* components from @px-ui/core.\n *\n * Features:\n * - Single and multiple selection\n * - Inline search (SearchableTrigger or ChipsTrigger)\n * - Async data loading with loadOptions\n * - Type-safe with full inference\n *\n * @example\n * // Single select with search\n * <ComboboxField\n * items={items}\n * value={selected}\n * onValueChange={setSelected}\n * placeholder=\"Select an option\"\n * />\n *\n * @example\n * // Multiple select with chips\n * <ComboboxField\n * items={items}\n * value={selected}\n * onValueChange={setSelected}\n * multiple\n * placeholder=\"Select options\"\n * />\n *\n * @example\n * // Async loading\n * <ComboboxField\n * loadOptions={loadUsers}\n * value={selected}\n * onValueChange={setSelected}\n * />\n */\nexport function ComboboxField<\n TItem = any,\n TSelectedValue = TItem,\n TMultiple extends boolean | undefined = false,\n>(props: ComboboxFieldProps<TItem, TSelectedValue, TMultiple>) {\n const {\n items,\n loadOptions,\n value,\n onValueChange,\n renderLabel,\n renderOption,\n renderChip,\n placeholder,\n searchInPopup = false,\n multiple,\n disabled,\n invalid,\n isItemEqualToValue,\n size,\n widthVariant,\n contentWidthVariant = \"trigger\",\n triggerClassName,\n contentProps,\n inputRef,\n readOnly,\n } = props;\n\n // Helper to get the key for an item\n const getItemKey = (item: TItem, index: number): string => {\n if (item && typeof item === \"object\") {\n if (\"value\" in item) {\n const val = (item as any).value;\n return typeof val === \"string\" || typeof val === \"number\"\n ? String(val)\n : index.toString();\n }\n if (\"id\" in item) {\n const id = (item as any).id;\n return typeof id === \"string\" || typeof id === \"number\"\n ? String(id)\n : index.toString();\n }\n }\n return index.toString();\n };\n\n // Helper to render item content\n const renderItemContent = (item: TItem): React.ReactNode => {\n if (renderOption) {\n return renderOption(item);\n }\n // Auto-detect label property\n if (item && typeof item === \"object\" && \"label\" in item) {\n return (item as any).label;\n }\n // Fallback to string representation\n return String(item);\n };\n\n // Helper to render selected value label (single item)\n const renderSingleValueLabel = (item: TSelectedValue): React.ReactNode => {\n if (renderLabel && !multiple) {\n return (renderLabel as (item: TSelectedValue) => React.ReactNode)(item);\n }\n // Auto-detect label property\n if (item && typeof item === \"object\" && \"label\" in item) {\n return (item as any).label;\n }\n // Fallback to string representation\n return String(item);\n };\n\n // Helper to render selected value label (multiple items)\n const renderMultipleValueLabel = (\n items: TSelectedValue[],\n ): React.ReactNode => {\n if (renderLabel && multiple) {\n return (renderLabel as (items: TSelectedValue[]) => React.ReactNode)(\n items,\n );\n }\n // Default: show count\n return `${items.length} selected`;\n };\n\n // Helper to render chip content\n const renderChipContent = (item: TSelectedValue): React.ReactNode => {\n if (renderChip) {\n return renderChip(item);\n }\n return renderSingleValueLabel(item);\n };\n\n return (\n <Combobox.Root<TItem, TSelectedValue, TMultiple>\n items={items}\n loadOptions={loadOptions}\n value={value}\n onValueChange={onValueChange}\n multiple={multiple}\n disabled={disabled}\n invalid={invalid}\n isItemEqualToValue={isItemEqualToValue}\n // @ts-expect-error\n itemToStringLabel={multiple ? undefined : renderLabel}\n inputRef={inputRef}\n readOnly={readOnly}\n >\n {/* If searchInPopup, use regular Trigger (regardless of multiple) */}\n {searchInPopup ? (\n <Combobox.Trigger\n size={size}\n widthVariant={widthVariant}\n className={triggerClassName}\n >\n <Combobox.Value placeholder={placeholder}>\n {(selectedValue: any) => {\n if (selectedValue == null) {\n return null;\n }\n\n // Handle multiple selection\n if (multiple && Array.isArray(selectedValue)) {\n if (selectedValue.length === 0) {\n return null;\n }\n return renderMultipleValueLabel(selectedValue);\n }\n\n // Single selection\n return renderSingleValueLabel(selectedValue);\n }}\n </Combobox.Value>\n </Combobox.Trigger>\n ) : multiple ? (\n /* Multiple selection uses ChipsTrigger */\n <Combobox.ChipsTrigger\n placeholder={placeholder}\n size={size}\n widthVariant={widthVariant}\n className={triggerClassName}\n >\n {(item: TSelectedValue) => (\n <Combobox.Chip key={getItemKey(item as any, 0)}>\n {renderChipContent(item)}\n </Combobox.Chip>\n )}\n </Combobox.ChipsTrigger>\n ) : (\n /* Single selection uses SearchableTrigger */\n <Combobox.SearchableTrigger\n placeholder={placeholder}\n size={size}\n widthVariant={widthVariant}\n className={triggerClassName}\n />\n )}\n\n <Combobox.Content widthVariant={contentWidthVariant} {...contentProps}>\n {/* Search in popup when using regular Trigger */}\n {searchInPopup && <Combobox.Search placeholder={placeholder} />}\n\n <Combobox.List>\n {(item: TItem) => {\n const key = getItemKey(item, 0);\n const ItemComponent = multiple ? Combobox.MultiItem : Combobox.Item;\n\n return (\n <ItemComponent key={key} value={item}>\n {renderItemContent(item)}\n </ItemComponent>\n );\n }}\n </Combobox.List>\n </Combobox.Content>\n </Combobox.Root>\n );\n}\n","import * as React from \"react\";\nimport {\n FileIcon,\n UploadIcon,\n FileUpload,\n useFileUpload,\n type FileUploadWithUploaderOptions,\n type FileWithPreview,\n type FileWithUploadStatus,\n} from \"@px-ui/core\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface FileUploadFieldProps\n extends Omit<FileUploadWithUploaderOptions, \"initialFiles\"> {\n /** Variant determines the visual layout */\n variant?: \"dropzone\" | \"button\" | \"compact\";\n /** Size of the dropzone (only applies to dropzone variant) */\n size?: \"sm\" | \"default\" | \"lg\";\n /** Text displayed in the dropzone */\n dropzoneText?: string;\n /** Text for the browse/upload button */\n buttonText?: string;\n /** Show file list below the dropzone */\n showFileList?: boolean;\n /** Show image grid instead of list for image files */\n showImageGrid?: boolean;\n /** Initial files (already uploaded) */\n initialFiles?: Array<{\n id: string;\n name: string;\n size: number;\n type: string;\n url: string;\n }>;\n /** Whether the upload is disabled */\n disabled?: boolean;\n /** Custom className */\n className?: string;\n /** Custom content to render inside the dropzone */\n children?: React.ReactNode;\n /** Render prop for custom file item rendering */\n renderFileItem?: (\n file: FileWithUploadStatus,\n actions: { remove: () => void; retry: () => void },\n ) => React.ReactNode;\n /** Error handler */\n onError?: (error: { type: string; message: string; files?: File[] }) => void;\n}\n\n// ============================================================================\n// Main Component\n// ============================================================================\n\nexport function FileUploadField({\n variant = \"dropzone\",\n size = \"default\",\n dropzoneText = \"Paste Or Drag & Drop Files Here\",\n buttonText = \"Browse for files\",\n showFileList = true,\n showImageGrid = false,\n initialFiles = [],\n disabled = false,\n className,\n children,\n renderFileItem,\n onError,\n // Hook options\n maxFiles,\n maxSize,\n accept,\n multiple = false,\n onFilesChange,\n onFilesAdded,\n upload,\n}: FileUploadFieldProps) {\n const [state, actions] = useFileUpload({\n maxFiles,\n maxSize,\n accept,\n multiple,\n initialFiles: initialFiles.map((f) => ({\n ...f,\n id: f.id,\n name: f.name,\n size: f.size,\n type: f.type,\n url: f.url,\n })),\n onFilesChange: onFilesChange as (files: FileWithPreview[]) => void,\n onFilesAdded: onFilesAdded as (files: FileWithPreview[]) => void,\n upload,\n });\n\n const { files, isDragging, errors, isUploading } = state;\n const {\n addFiles,\n removeFile,\n clearFiles,\n handleDragEnter,\n handleDragLeave,\n handleDragOver,\n handleDrop,\n openFileDialog,\n getInputProps,\n retryUpload,\n } = actions;\n\n // Handle errors\n React.useEffect(() => {\n if (errors.length > 0 && onError) {\n onError({\n type: \"validation\",\n message: errors[0],\n });\n }\n }, [errors, onError]);\n\n // Common props for FileUpload.Root\n const rootProps = {\n files,\n addFiles,\n removeFile,\n clearFiles,\n retryUpload,\n openFileDialog,\n getInputProps,\n handleDragEnter,\n handleDragLeave,\n handleDragOver,\n handleDrop,\n isDragActive: isDragging,\n isUploading,\n accept,\n multiple,\n disabled,\n };\n\n // Render file item using primitives or custom render prop\n const renderDefaultFileItem = (file: FileWithUploadStatus) => {\n if (renderFileItem) {\n return renderFileItem(file, {\n remove: () => removeFile(file.id),\n retry: () => retryUpload(file.id),\n });\n }\n\n const isImage = file.file.type?.startsWith(\"image/\") ?? false;\n\n return (\n <FileUpload.Item key={file.id} file={file}>\n <FileUpload.ItemPreview\n fallback={\n isImage ? undefined : (\n <FileIcon className=\"text-ppx-neutral-10 size-5\" />\n )\n }\n />\n\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <FileUpload.ItemName />\n\n <div className=\"flex items-center gap-2\">\n <FileUpload.ItemSize />\n {file.status === \"uploading\" && (\n <FileUpload.ItemProgress className=\"flex-1\" />\n )}\n </div>\n\n <FileUpload.ItemError />\n </div>\n\n <div className=\"flex shrink-0 items-center gap-1\">\n <FileUpload.ItemStatus />\n <FileUpload.ItemRetry />\n <FileUpload.ItemRemove />\n </div>\n </FileUpload.Item>\n );\n };\n\n // Render image grid item using primitives\n const renderImageGridItem = (file: FileWithUploadStatus) => (\n <FileUpload.ImageGridItem key={file.id} file={file} showStatusOverlay />\n );\n\n // Render based on variant\n if (variant === \"button\" || variant === \"compact\") {\n return (\n <FileUpload.Root {...rootProps} className={className}>\n <div className=\"flex items-center gap-3\">\n <FileUpload.Trigger\n variant={variant === \"compact\" ? \"outline\" : \"default\"}\n size={variant === \"compact\" ? \"sm\" : \"default\"}\n showUploadingState\n >\n <UploadIcon className=\"size-4\" />\n {buttonText}\n </FileUpload.Trigger>\n\n {variant === \"compact\" && files.length > 0 && (\n <span className=\"text-ppx-neutral-12 truncate text-sm\">\n {files.length === 1\n ? files[0].file.name\n : `${files.length} files selected`}\n </span>\n )}\n </div>\n\n {/* File List */}\n {showFileList && files.length > 0 && variant !== \"compact\" && (\n <FileUpload.ItemList>\n {files.map(renderDefaultFileItem)}\n </FileUpload.ItemList>\n )}\n </FileUpload.Root>\n );\n }\n\n // Dropzone variant (default)\n return (\n <FileUpload.Root {...rootProps} className={className}>\n <FileUpload.Dropzone\n size={size}\n dropzoneText={dropzoneText}\n browseText={buttonText}\n hideDefaultContent={!!children}\n >\n {children}\n </FileUpload.Dropzone>\n\n {/* Errors */}\n {errors.length > 0 && (\n <div className=\"text-ppx-red-5 text-sm\">\n {errors.map((error, i) => (\n <p key={i}>{error}</p>\n ))}\n </div>\n )}\n\n {/* File List or Image Grid */}\n {showFileList && files.length > 0 && (\n <div>\n <div className=\"mb-2 flex items-center justify-between\">\n <span className=\"text-ppx-neutral-14 text-sm font-medium\">\n {multiple ? `Files (${files.length})` : \"Selected file\"}\n </span>\n {multiple && files.length > 1 && (\n <FileUpload.ClearButton\n size=\"sm\"\n className=\"text-ppx-red-5 hover:text-ppx-red-6\"\n >\n Remove all\n </FileUpload.ClearButton>\n )}\n </div>\n\n {showImageGrid ? (\n <FileUpload.ImageGrid>\n {files.map(renderImageGridItem)}\n </FileUpload.ImageGrid>\n ) : (\n <FileUpload.ItemList>\n {files.map(renderDefaultFileItem)}\n </FileUpload.ItemList>\n )}\n </div>\n )}\n </FileUpload.Root>\n );\n}\n\nexport type {\n FileWithUploadStatus,\n UploadConfig,\n FileUploadWithUploaderOptions,\n} from \"@px-ui/core\";\n","import { useMemo } from \"react\";\nimport {\n cn,\n cva,\n type VariantProps,\n Label as LabelPrimitive,\n Separator as SeperatorPrimitive,\n} from \"@px-ui/core\";\n\nexport function Set({ className, ...props }: React.ComponentProps<\"fieldset\">) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n \"flex flex-col gap-6\",\n \"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Legend({\n className,\n variant = \"legend\",\n ...props\n}: React.ComponentProps<\"legend\"> & { variant?: \"legend\" | \"label\" }) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn(\n \"mb-3 font-medium\",\n \"data-[variant=legend]:text-base\",\n \"data-[variant=label]:text-sm\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Group({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n \"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\ntype FieldVariantsType = (\n props?:\n | {\n orientation?: \"vertical\" | \"horizontal\" | \"responsive\";\n }\n | undefined,\n) => string;\n\nconst fieldVariants: FieldVariantsType = cva(\n \"group/field flex w-full gap-2 data-[invalid=true]:text-ppx-red-5\",\n {\n variants: {\n orientation: {\n vertical: [\"flex-col [&>*]:w-full [&>.sr-only]:w-auto\"],\n horizontal: [\n \"flex-row items-center\",\n \"[&>[data-slot=field-label]]:flex-auto\",\n \"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n responsive: [\n \"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto\",\n \"@md/field-group:[&>[data-slot=field-label]]:flex-auto\",\n \"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n },\n) as FieldVariantsType;\n\nexport function Root({\n className,\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof fieldVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n );\n}\n\nexport function Content({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn(\n \"group/field-content flex flex-1 flex-col gap-1.5 leading-snug\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Label({\n className,\n ...props\n}: React.ComponentProps<typeof LabelPrimitive>) {\n return (\n <LabelPrimitive\n data-slot=\"field-label\"\n className={cn(\n \"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50\",\n \"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Title({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n \"text-ppx-sm flex w-fit items-center gap-2 font-medium leading-snug group-data-[disabled=true]/field:opacity-50\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Description({\n className,\n ...props\n}: React.ComponentProps<\"p\">) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n \"text-ppx-sm text-ppx-muted-foreground font-normal leading-normal group-has-[[data-orientation=horizontal]]/field:text-balance\",\n \"nth-last-2:-mt-1 last:mt-0 [[data-variant=legend]+&]:-mt-1.5\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Separator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n children?: React.ReactNode;\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn(\n \"text-ppx-sm relative -my-2 h-5 group-data-[variant=outline]/field-group:-mb-2\",\n className,\n )}\n {...props}\n >\n <SeperatorPrimitive\n orientation=\"horizontal\"\n className=\"absolute inset-0 top-1/2\"\n />\n {children && (\n <span\n className=\"bg-ppx-background text-ppx-muted-foreground relative mx-auto block w-fit px-2\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n );\n}\n\nexport function Error({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<\"div\"> & {\n errors?: Array<{ message?: string } | undefined>;\n}) {\n const content = useMemo(() => {\n if (children) {\n return children;\n }\n\n if (!errors?.length) {\n return null;\n }\n\n const uniqueErrors = [\n ...new Map(errors.map((error) => [error?.message, error])).values(),\n ];\n\n if (uniqueErrors?.length == 1) {\n return uniqueErrors[0]?.message;\n }\n\n return (\n <ul className=\"ml-4 flex list-disc flex-col gap-1\">\n {uniqueErrors.map(\n (error, index) =>\n error?.message && <li key={index}>{error.message}</li>,\n )}\n </ul>\n );\n }, [children, errors]);\n\n if (!content) {\n return null;\n }\n\n return (\n <div\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn(\"text-ppx-sm text-ppx-red-5 font-normal\", className)}\n {...props}\n >\n {content}\n </div>\n );\n}\n","import {\n Controller,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n} from \"react-hook-form\";\nimport * as Field from \"./field\";\nimport { type ReactNode } from \"react\";\nimport { Textarea, Checkbox, Input } from \"@px-ui/core\";\n\ntype FormControlProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformedValues = TFieldValues,\n> = {\n name: TName;\n label: ReactNode;\n description?: ReactNode;\n control: ControllerProps<TFieldValues, TName, TTransformedValues>[\"control\"];\n required?: boolean;\n};\n\ntype FormBaseProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformedValues = TFieldValues,\n> = FormControlProps<TFieldValues, TName, TTransformedValues> & {\n horizontal?: boolean;\n controlFirst?: boolean;\n children: (\n field: Parameters<\n ControllerProps<TFieldValues, TName, TTransformedValues>[\"render\"]\n >[0][\"field\"] & {\n invalid?: boolean;\n id: string;\n },\n ) => ReactNode;\n};\n\ntype FormControlFunc<\n ExtraProps extends Record<string, unknown> = Record<never, never>,\n> = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformedValues = TFieldValues,\n>(\n props: FormControlProps<TFieldValues, TName, TTransformedValues> & ExtraProps,\n) => ReactNode;\n\nfunction FormBase<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformedValues = TFieldValues,\n>({\n children,\n control,\n label,\n name,\n required,\n description,\n controlFirst,\n horizontal,\n}: FormBaseProps<TFieldValues, TName, TTransformedValues>) {\n return (\n <Controller\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n const labelElement = (\n <Field.Label\n className={required ? \"required\" : \"\"}\n htmlFor={field.name}\n >\n {label}\n </Field.Label>\n );\n\n const descriptionElement = description ? (\n <Field.Description>{description}</Field.Description>\n ) : null;\n\n const control = children({\n ...field,\n id: field.name,\n invalid: fieldState.invalid,\n });\n\n const errorElement = fieldState.invalid && (\n <Field.Error errors={[fieldState.error]} />\n );\n\n return (\n <Field.Root orientation={horizontal ? \"horizontal\" : undefined}>\n {controlFirst ? (\n <>\n {control}\n {labelElement}\n {descriptionElement}\n {errorElement}\n </>\n ) : (\n <>\n {labelElement}\n {control}\n {descriptionElement}\n {errorElement}\n </>\n )}\n </Field.Root>\n );\n }}\n />\n );\n}\n\nexport const FormInput: FormControlFunc = (props) => {\n return <FormBase {...props}>{(field) => <Input {...field} />}</FormBase>;\n};\n\nexport const FormTextarea: FormControlFunc = (props) => {\n return <FormBase {...props}>{(field) => <Textarea {...field} />}</FormBase>;\n};\n\nexport const FormCheckbox: FormControlFunc = (props) => {\n return (\n <FormBase {...props} horizontal controlFirst>\n {({ onChange, value, ...field }) => (\n <Checkbox {...field} checked={value} onCheckedChange={onChange} />\n )}\n </FormBase>\n );\n};\n\n// Note: FormRadioItem is not included in the abstractions because radio buttons\n// work as a group and require a different pattern. Use the verbose Controller\n// approach with RadioGroup for radio buttons. See the stories for examples.\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FA,SAAgB,YAGd,OAA2C;CAC3C,MAAM,EACJ,OACA,OACA,eACA,aACA,cACA,aACA,UACA,UACA,SACA,MACA,oBACA,MACA,cACA,qBACA,cACA,kBACA,UACA,aACE;CAGJ,MAAM,cAAc,MAAa,UAA0B;AACzD,MAAI,QAAQ,OAAO,SAAS,UAAU;AACpC,OAAI,WAAW,MAAM;IACnB,MAAM,MAAO,KAAa;AAC1B,WAAO,OAAO,QAAQ,YAAY,OAAO,QAAQ,WAC7C,OAAO,IAAI,GACX,MAAM,UAAU;;AAEtB,OAAI,QAAQ,MAAM;IAChB,MAAM,KAAM,KAAa;AACzB,WAAO,OAAO,OAAO,YAAY,OAAO,OAAO,WAC3C,OAAO,GAAG,GACV,MAAM,UAAU;;;AAGxB,SAAO,MAAM,UAAU;;CAIzB,MAAM,qBAAqB,SAAiC;AAC1D,MAAI,aACF,QAAO,aAAa,KAAK;AAG3B,MAAI,QAAQ,OAAO,SAAS,YAAY,WAAW,KACjD,QAAQ,KAAa;AAGvB,SAAO,OAAO,KAAK;;CAIrB,MAAM,oBAAoB,SAAiC;AACzD,MAAI,YACF,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ACJ,oBAACC;IACC,WAAW,WAAW,aAAa;IACnC,SAAS,MAAM;cAEd;KACW;GAGhB,MAAM,qBAAqB,cACzB,oBAACC,yBAAmB,cAAgC,GAClD;GAEJ,MAAMC,YAAU,SAAS;IACvB,GAAG;IACH,IAAI,MAAM;IACV,SAAS,WAAW;IACrB,CAAC;GAEF,MAAM,eAAe,WAAW,WAC9B,oBAACC,SAAY,QAAQ,CAAC,WAAW,MAAM,GAAI;AAG7C,UACE,oBAACC;IAAW,aAAa,aAAa,eAAe;cAClD,eACC;KACGF;KACA;KACA;KACA;QACA,GAEH;KACG;KACAA;KACA;KACA;QACA;KAEM;;GAGjB;;AAIN,MAAaG,aAA8B,UAAU;AACnD,QAAO,oBAAC;EAAS,GAAI;aAAS,UAAU,oBAAC,SAAM,GAAI,QAAS;GAAY;;AAG1E,MAAaC,gBAAiC,UAAU;AACtD,QAAO,oBAAC;EAAS,GAAI;aAAS,UAAU,oBAAC,YAAS,GAAI,QAAS;GAAY;;AAG7E,MAAaC,gBAAiC,UAAU;AACtD,QACE,oBAAC;EAAS,GAAI;EAAO;EAAW;aAC5B,EAAE,UAAU,OAAO,GAAG,YACtB,oBAAC;GAAS,GAAI;GAAO,SAAS;GAAO,iBAAiB;IAAY;GAE3D"}
1
+ {"version":3,"file":"index.js","names":["items","fieldVariants: FieldVariantsType","Label","LabelPrimitive","Separator","SeperatorPrimitive","Field.Label","Field.Description","control","Field.Error","Field.Root","FormInput: FormControlFunc","FormTextarea: FormControlFunc","FormCheckbox: FormControlFunc"],"sources":["../src/components/select-field.tsx","../src/components/combobox-field.tsx","../src/components/file-upload-field.tsx","../src/components/field.tsx","../src/components/form.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Select } from \"@px-ui/core\";\n\ntype AllRootProps<\n TItem = any,\n TMultiple extends boolean | undefined = false,\n> = React.ComponentProps<typeof Select.Root<TItem, TMultiple>>;\n\ntype RootProps<\n TItem = any,\n TMultiple extends boolean | undefined = false,\n> = Pick<\n AllRootProps<TItem, TMultiple>,\n | \"value\"\n | \"onValueChange\"\n | \"multiple\"\n | \"disabled\"\n | \"invalid\"\n | \"isItemEqualToValue\"\n | \"inputRef\"\n | \"readOnly\"\n | \"name\"\n>;\n\ninterface SelectFieldProps<\n TItem = any,\n TMultiple extends boolean | undefined = false,\n> extends RootProps<TItem, TMultiple> {\n /**\n * Array of items to display in the select dropdown\n */\n items: ReadonlyArray<TItem>;\n /**\n * Function to render the label in the trigger for the selected item\n * If not provided and item has a 'label' property, it will be used automatically\n */\n renderLabel?: (item: TItem) => React.ReactNode;\n\n /**\n * Function to render each option in the dropdown\n * If not provided and item has a 'label' property, it will be used automatically\n */\n renderOption?: (item: TItem) => React.ReactNode;\n\n /**\n * Placeholder text when no value is selected\n */\n placeholder?: string;\n\n size?: React.ComponentProps<typeof Select.Trigger>[\"size\"];\n\n widthVariant?: React.ComponentProps<typeof Select.Trigger>[\"widthVariant\"];\n\n /**\n * Width variant for the dropdown content\n */\n contentWidthVariant?: React.ComponentProps<\n typeof Select.Content\n >[\"widthVariant\"];\n\n triggerClassName?: string;\n\n /**\n * Additional props for Select.Content\n */\n contentProps?: Omit<\n React.ComponentProps<typeof Select.Content>,\n \"children\" | \"widthVariant\"\n >;\n}\n\n/**\n * A simplified Select component for common use cases.\n * For advanced customization, use the composable Select.* components from @px-ui/core.\n *\n * @example\n * ```tsx\n * const items = [\n * { id: 1, label: 'Option 1' },\n * { id: 2, label: 'Option 2' },\n * ];\n *\n * <SelectField\n * items={items}\n * value={selected}\n * onValueChange={setSelected}\n * renderLabel={(item) => item.label}\n * renderOption={(item) => item.label}\n * />\n * ```\n */\nexport function SelectField<\n TItem = any,\n TMultiple extends boolean | undefined = false,\n>(props: SelectFieldProps<TItem, TMultiple>) {\n const {\n items,\n value,\n onValueChange,\n renderLabel,\n renderOption,\n placeholder,\n multiple,\n disabled,\n invalid,\n name,\n isItemEqualToValue,\n size,\n widthVariant,\n contentWidthVariant,\n contentProps,\n triggerClassName,\n inputRef,\n readOnly,\n } = props;\n\n // Helper to get the key for an item\n const getItemKey = (item: TItem, index: number): string => {\n if (item && typeof item === \"object\") {\n if (\"value\" in item) {\n const val = (item as any).value;\n return typeof val === \"string\" || typeof val === \"number\"\n ? String(val)\n : index.toString();\n }\n if (\"id\" in item) {\n const id = (item as any).id;\n return typeof id === \"string\" || typeof id === \"number\"\n ? String(id)\n : index.toString();\n }\n }\n return index.toString();\n };\n\n // Helper to render item content\n const renderItemContent = (item: TItem): React.ReactNode => {\n if (renderOption) {\n return renderOption(item);\n }\n // Auto-detect label property\n if (item && typeof item === \"object\" && \"label\" in item) {\n return (item as any).label;\n }\n // Fallback to string representation\n return String(item);\n };\n\n // Helper to render selected value label\n const renderValueLabel = (item: TItem): React.ReactNode => {\n if (renderLabel) {\n return renderLabel(item);\n }\n // Use same logic as renderOption\n return renderItemContent(item);\n };\n\n return (\n <Select.Root<TItem, TMultiple>\n value={value}\n onValueChange={onValueChange}\n multiple={multiple}\n disabled={disabled}\n invalid={invalid}\n name={name}\n isItemEqualToValue={isItemEqualToValue}\n inputRef={inputRef}\n readOnly={readOnly}\n >\n <Select.Trigger\n size={size}\n widthVariant={widthVariant}\n className={triggerClassName}\n >\n <Select.Value placeholder={placeholder}>\n {(selectedValue: any) => {\n // Handle multiple selection\n if (multiple && Array.isArray(selectedValue)) {\n // For multiple, show MultiSelectedValue by default\n const labels = selectedValue.map((item: TItem) => {\n const label = renderValueLabel(item);\n return typeof label === \"string\" ? label : String(label);\n });\n return (\n <Select.MultiSelectedValue\n selectedValue={labels}\n maxItems={2}\n />\n );\n }\n\n // Single selection - show placeholder if no value\n if (selectedValue == null) {\n return placeholder || null;\n }\n\n return renderValueLabel(selectedValue as TItem);\n }}\n </Select.Value>\n </Select.Trigger>\n\n <Select.Content widthVariant={contentWidthVariant} {...contentProps}>\n <Select.List>\n {(items as any[])?.map((item, index) => {\n const key = getItemKey(item, index);\n const ItemComponent = multiple ? Select.MultiItem : Select.Item;\n\n return (\n <ItemComponent key={key} value={item}>\n {renderItemContent(item)}\n </ItemComponent>\n );\n })}\n </Select.List>\n </Select.Content>\n </Select.Root>\n );\n}\n","import * as React from \"react\";\nimport { Combobox } from \"@px-ui/core\";\n\ntype AllRootProps<\n TItem = any,\n TSelectedValue = TItem,\n TMultiple extends boolean | undefined = false,\n> = React.ComponentProps<\n typeof Combobox.Root<TItem, TSelectedValue, TMultiple>\n>;\n\ntype RootProps<\n TItem = any,\n TSelectedValue = TItem,\n TMultiple extends boolean | undefined = false,\n> = Pick<\n AllRootProps<TItem, TSelectedValue, TMultiple>,\n | \"items\"\n | \"loadOptions\"\n | \"value\"\n | \"onValueChange\"\n | \"multiple\"\n | \"disabled\"\n | \"invalid\"\n | \"isItemEqualToValue\"\n | \"inputRef\"\n | \"readOnly\"\n>;\n\ninterface ComboboxFieldProps<\n TItem = any,\n TSelectedValue = TItem,\n TMultiple extends boolean | undefined = false,\n> extends RootProps<TItem, TSelectedValue, TMultiple> {\n /**\n * Function to render the label in the trigger for the selected item(s)\n * - For single select: receives a single item\n * - For multiple select: receives an array of items\n * If not provided and item has a 'label' property, it will be used automatically\n */\n renderLabel?: TMultiple extends true\n ? (items: TSelectedValue[]) => React.ReactNode\n : (item: TSelectedValue) => string | React.ReactNode;\n\n /**\n * Function to render each option in the dropdown\n * If not provided and item has a 'label' property, it will be used automatically\n */\n renderOption?: (item: TItem) => React.ReactNode;\n\n /**\n * Function to render each chip in ChipsTrigger (multiple selection only)\n * If not provided, renderLabel or auto-detected label will be used\n */\n renderChip?: (item: TSelectedValue) => React.ReactNode | string;\n\n /**\n * Placeholder text when no value is selected\n */\n placeholder?: string;\n\n /**\n * Show search input inside the popup instead of in trigger\n * Only applicable when not using searchable trigger\n * @default false\n */\n searchInPopup?: boolean;\n\n /**\n * Size variant for trigger\n */\n size?: React.ComponentProps<typeof Combobox.SearchableTrigger>[\"size\"];\n\n /**\n * Width variant for trigger\n */\n widthVariant?: \"enforced\" | \"full\";\n\n /**\n * Width variant for the dropdown content\n */\n contentWidthVariant?: \"trigger\" | \"fit\" | \"enforced\";\n\n /**\n * Additional className for the trigger\n */\n triggerClassName?: string;\n\n /**\n * Additional props for Combobox.Content\n */\n contentProps?: Omit<\n React.ComponentProps<typeof Combobox.Content>,\n \"children\" | \"widthVariant\" | \"empty\"\n >;\n}\n\n/**\n * A simplified Combobox component for common use cases.\n * For advanced customization, use the composable Combobox.* components from @px-ui/core.\n *\n * Features:\n * - Single and multiple selection\n * - Inline search (SearchableTrigger or ChipsTrigger)\n * - Async data loading with loadOptions\n * - Type-safe with full inference\n *\n * @example\n * // Single select with search\n * <ComboboxField\n * items={items}\n * value={selected}\n * onValueChange={setSelected}\n * placeholder=\"Select an option\"\n * />\n *\n * @example\n * // Multiple select with chips\n * <ComboboxField\n * items={items}\n * value={selected}\n * onValueChange={setSelected}\n * multiple\n * placeholder=\"Select options\"\n * />\n *\n * @example\n * // Async loading\n * <ComboboxField\n * loadOptions={loadUsers}\n * value={selected}\n * onValueChange={setSelected}\n * />\n */\nexport function ComboboxField<\n TItem = any,\n TSelectedValue = TItem,\n TMultiple extends boolean | undefined = false,\n>(props: ComboboxFieldProps<TItem, TSelectedValue, TMultiple>) {\n const {\n items,\n loadOptions,\n value,\n onValueChange,\n renderLabel,\n renderOption,\n renderChip,\n placeholder,\n searchInPopup = false,\n multiple,\n disabled,\n invalid,\n isItemEqualToValue,\n size,\n widthVariant,\n contentWidthVariant = \"trigger\",\n triggerClassName,\n contentProps,\n inputRef,\n readOnly,\n } = props;\n\n // Helper to get the key for an item\n const getItemKey = (item: TItem, index: number): string => {\n if (item && typeof item === \"object\") {\n if (\"value\" in item) {\n const val = (item as any).value;\n return typeof val === \"string\" || typeof val === \"number\"\n ? String(val)\n : index.toString();\n }\n if (\"id\" in item) {\n const id = (item as any).id;\n return typeof id === \"string\" || typeof id === \"number\"\n ? String(id)\n : index.toString();\n }\n }\n return index.toString();\n };\n\n // Helper to render item content\n const renderItemContent = (item: TItem): React.ReactNode => {\n if (renderOption) {\n return renderOption(item);\n }\n // Auto-detect label property\n if (item && typeof item === \"object\" && \"label\" in item) {\n return (item as any).label;\n }\n // Fallback to string representation\n return String(item);\n };\n\n // Helper to render selected value label (single item)\n const renderSingleValueLabel = (item: TSelectedValue): React.ReactNode => {\n if (renderLabel && !multiple) {\n return (renderLabel as (item: TSelectedValue) => React.ReactNode)(item);\n }\n // Auto-detect label property\n if (item && typeof item === \"object\" && \"label\" in item) {\n return (item as any).label;\n }\n // Fallback to string representation\n return String(item);\n };\n\n // Helper to render selected value label (multiple items)\n const renderMultipleValueLabel = (\n items: TSelectedValue[],\n ): React.ReactNode => {\n if (renderLabel && multiple) {\n return (renderLabel as (items: TSelectedValue[]) => React.ReactNode)(\n items,\n );\n }\n // Default: show count\n return `${items.length} selected`;\n };\n\n // Helper to render chip content\n const renderChipContent = (item: TSelectedValue): React.ReactNode => {\n if (renderChip) {\n return renderChip(item);\n }\n return renderSingleValueLabel(item);\n };\n\n return (\n <Combobox.Root<TItem, TSelectedValue, TMultiple>\n items={items}\n loadOptions={loadOptions}\n value={value}\n onValueChange={onValueChange}\n multiple={multiple}\n disabled={disabled}\n invalid={invalid}\n isItemEqualToValue={isItemEqualToValue}\n // @ts-expect-error\n itemToStringLabel={multiple ? undefined : renderLabel}\n inputRef={inputRef}\n readOnly={readOnly}\n >\n {/* If searchInPopup, use regular Trigger (regardless of multiple) */}\n {searchInPopup ? (\n <Combobox.Trigger\n size={size}\n widthVariant={widthVariant}\n className={triggerClassName}\n >\n <Combobox.Value placeholder={placeholder}>\n {(selectedValue: any) => {\n if (selectedValue == null) {\n return null;\n }\n\n // Handle multiple selection\n if (multiple && Array.isArray(selectedValue)) {\n if (selectedValue.length === 0) {\n return null;\n }\n return renderMultipleValueLabel(selectedValue);\n }\n\n // Single selection\n return renderSingleValueLabel(selectedValue);\n }}\n </Combobox.Value>\n </Combobox.Trigger>\n ) : multiple ? (\n /* Multiple selection uses ChipsTrigger */\n <Combobox.ChipsTrigger\n placeholder={placeholder}\n size={size}\n widthVariant={widthVariant}\n className={triggerClassName}\n >\n {(item: TSelectedValue) => (\n <Combobox.Chip key={getItemKey(item as any, 0)}>\n {renderChipContent(item)}\n </Combobox.Chip>\n )}\n </Combobox.ChipsTrigger>\n ) : (\n /* Single selection uses SearchableTrigger */\n <Combobox.SearchableTrigger\n placeholder={placeholder}\n size={size}\n widthVariant={widthVariant}\n className={triggerClassName}\n />\n )}\n\n <Combobox.Content widthVariant={contentWidthVariant} {...contentProps}>\n {/* Search in popup when using regular Trigger */}\n {searchInPopup && <Combobox.Search placeholder={placeholder} />}\n\n <Combobox.List>\n {(item: TItem) => {\n const key = getItemKey(item, 0);\n const ItemComponent = multiple ? Combobox.MultiItem : Combobox.Item;\n\n return (\n <ItemComponent key={key} value={item}>\n {renderItemContent(item)}\n </ItemComponent>\n );\n }}\n </Combobox.List>\n </Combobox.Content>\n </Combobox.Root>\n );\n}\n","import * as React from \"react\";\nimport {\n FileIcon,\n UploadIcon,\n FileUpload,\n useFileUpload,\n type FileUploadWithUploaderOptions,\n type FileWithPreview,\n type FileWithUploadStatus,\n} from \"@px-ui/core\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface FileUploadFieldProps\n extends Omit<FileUploadWithUploaderOptions, \"initialFiles\"> {\n /** Variant determines the visual layout */\n variant?: \"dropzone\" | \"button\" | \"compact\";\n /** Size of the dropzone (only applies to dropzone variant) */\n size?: \"sm\" | \"default\" | \"lg\";\n /** Text displayed in the dropzone */\n dropzoneText?: string;\n /** Text for the browse/upload button */\n buttonText?: string;\n /** Show file list below the dropzone */\n showFileList?: boolean;\n /** Show image grid instead of list for image files */\n showImageGrid?: boolean;\n /** Initial files (already uploaded) */\n initialFiles?: Array<{\n id: string;\n name: string;\n size: number;\n type: string;\n url: string;\n }>;\n /** Whether the upload is disabled */\n disabled?: boolean;\n /** Custom className */\n className?: string;\n /** Custom content to render inside the dropzone */\n children?: React.ReactNode;\n /** Render prop for custom file item rendering */\n renderFileItem?: (\n file: FileWithUploadStatus,\n actions: { remove: () => void; retry: () => void },\n ) => React.ReactNode;\n /** Error handler */\n onError?: (error: { type: string; message: string; files?: File[] }) => void;\n}\n\n// ============================================================================\n// Main Component\n// ============================================================================\n\nexport function FileUploadField({\n variant = \"dropzone\",\n size = \"default\",\n dropzoneText = \"Paste Or Drag & Drop Files Here\",\n buttonText = \"Browse for files\",\n showFileList = true,\n showImageGrid = false,\n initialFiles = [],\n disabled = false,\n className,\n children,\n renderFileItem,\n onError,\n // Hook options\n maxFiles,\n maxSize,\n accept,\n multiple = false,\n onFilesChange,\n onFilesAdded,\n upload,\n}: FileUploadFieldProps) {\n const [state, actions] = useFileUpload({\n maxFiles,\n maxSize,\n accept,\n multiple,\n initialFiles: initialFiles.map((f) => ({\n ...f,\n id: f.id,\n name: f.name,\n size: f.size,\n type: f.type,\n url: f.url,\n })),\n onFilesChange: onFilesChange as (files: FileWithPreview[]) => void,\n onFilesAdded: onFilesAdded as (files: FileWithPreview[]) => void,\n upload,\n });\n\n const { files, isDragging, errors, isUploading } = state;\n const {\n addFiles,\n removeFile,\n clearFiles,\n handleDragEnter,\n handleDragLeave,\n handleDragOver,\n handleDrop,\n openFileDialog,\n getInputProps,\n retryUpload,\n } = actions;\n\n // Handle errors\n React.useEffect(() => {\n if (errors.length > 0 && onError) {\n onError({\n type: \"validation\",\n message: errors[0],\n });\n }\n }, [errors, onError]);\n\n // Common props for FileUpload.Root\n const rootProps = {\n files,\n addFiles,\n removeFile,\n clearFiles,\n retryUpload,\n openFileDialog,\n getInputProps,\n handleDragEnter,\n handleDragLeave,\n handleDragOver,\n handleDrop,\n isDragActive: isDragging,\n isUploading,\n accept,\n multiple,\n disabled,\n };\n\n // Render file item using primitives or custom render prop\n const renderDefaultFileItem = (file: FileWithUploadStatus) => {\n if (renderFileItem) {\n return renderFileItem(file, {\n remove: () => removeFile(file.id),\n retry: () => retryUpload(file.id),\n });\n }\n\n const isImage = file.file.type?.startsWith(\"image/\") ?? false;\n\n return (\n <FileUpload.Item key={file.id} file={file}>\n <FileUpload.ItemPreview\n fallback={\n isImage ? undefined : (\n <FileIcon className=\"text-ppx-neutral-10 size-5\" />\n )\n }\n />\n\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <FileUpload.ItemName />\n\n <div className=\"flex items-center gap-2\">\n <FileUpload.ItemSize />\n {file.status === \"uploading\" && (\n <FileUpload.ItemProgress className=\"flex-1\" />\n )}\n </div>\n\n <FileUpload.ItemError />\n </div>\n\n <div className=\"flex shrink-0 items-center gap-1\">\n <FileUpload.ItemStatus />\n <FileUpload.ItemRetry />\n <FileUpload.ItemRemove />\n </div>\n </FileUpload.Item>\n );\n };\n\n // Render image grid item using primitives\n const renderImageGridItem = (file: FileWithUploadStatus) => (\n <FileUpload.ImageGridItem key={file.id} file={file} showStatusOverlay />\n );\n\n // Render based on variant\n if (variant === \"button\" || variant === \"compact\") {\n return (\n <FileUpload.Root {...rootProps} className={className}>\n <div className=\"flex items-center gap-3\">\n <FileUpload.Trigger\n variant={variant === \"compact\" ? \"outline\" : \"default\"}\n size={variant === \"compact\" ? \"sm\" : \"default\"}\n showUploadingState\n >\n <UploadIcon className=\"size-4\" />\n {buttonText}\n </FileUpload.Trigger>\n\n {variant === \"compact\" && files.length > 0 && (\n <span className=\"text-ppx-neutral-12 truncate text-sm\">\n {files.length === 1\n ? files[0].file.name\n : `${files.length} files selected`}\n </span>\n )}\n </div>\n\n {/* File List */}\n {showFileList && files.length > 0 && variant !== \"compact\" && (\n <FileUpload.ItemList>\n {files.map(renderDefaultFileItem)}\n </FileUpload.ItemList>\n )}\n </FileUpload.Root>\n );\n }\n\n // Dropzone variant (default)\n return (\n <FileUpload.Root {...rootProps} className={className}>\n <FileUpload.Dropzone\n size={size}\n dropzoneText={dropzoneText}\n browseText={buttonText}\n hideDefaultContent={!!children}\n >\n {children}\n </FileUpload.Dropzone>\n\n {/* Errors */}\n {errors.length > 0 && (\n <div className=\"text-ppx-red-5 text-sm\">\n {errors.map((error, i) => (\n <p key={i}>{error}</p>\n ))}\n </div>\n )}\n\n {/* File List or Image Grid */}\n {showFileList && files.length > 0 && (\n <div>\n <div className=\"mb-2 flex items-center justify-between\">\n <span className=\"text-ppx-neutral-14 text-sm font-medium\">\n {multiple ? `Files (${files.length})` : \"Selected file\"}\n </span>\n {multiple && files.length > 1 && (\n <FileUpload.ClearButton\n size=\"sm\"\n className=\"text-ppx-red-5 hover:text-ppx-red-6\"\n >\n Remove all\n </FileUpload.ClearButton>\n )}\n </div>\n\n {showImageGrid ? (\n <FileUpload.ImageGrid>\n {files.map(renderImageGridItem)}\n </FileUpload.ImageGrid>\n ) : (\n <FileUpload.ItemList>\n {files.map(renderDefaultFileItem)}\n </FileUpload.ItemList>\n )}\n </div>\n )}\n </FileUpload.Root>\n );\n}\n\nexport type {\n FileWithUploadStatus,\n UploadConfig,\n FileUploadWithUploaderOptions,\n} from \"@px-ui/core\";\n","import { useMemo } from \"react\";\nimport {\n cn,\n cva,\n type VariantProps,\n Label as LabelPrimitive,\n Separator as SeperatorPrimitive,\n} from \"@px-ui/core\";\n\nexport function Set({ className, ...props }: React.ComponentProps<\"fieldset\">) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n \"flex flex-col gap-6\",\n \"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Legend({\n className,\n variant = \"legend\",\n ...props\n}: React.ComponentProps<\"legend\"> & { variant?: \"legend\" | \"label\" }) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn(\n \"mb-3 font-medium\",\n \"data-[variant=legend]:text-base\",\n \"data-[variant=label]:text-sm\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Group({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n \"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\ntype FieldVariantsType = (\n props?:\n | {\n orientation?: \"vertical\" | \"horizontal\" | \"responsive\";\n }\n | undefined,\n) => string;\n\nconst fieldVariants: FieldVariantsType = cva(\n \"group/field flex w-full gap-2 data-[invalid=true]:text-ppx-red-5\",\n {\n variants: {\n orientation: {\n vertical: [\"flex-col [&>*]:w-full [&>.sr-only]:w-auto\"],\n horizontal: [\n \"flex-row items-center\",\n \"[&>[data-slot=field-label]]:flex-auto\",\n \"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n responsive: [\n \"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto\",\n \"@md/field-group:[&>[data-slot=field-label]]:flex-auto\",\n \"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n },\n) as FieldVariantsType;\n\nexport function Root({\n className,\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof fieldVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n );\n}\n\nexport function Content({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn(\n \"group/field-content flex flex-1 flex-col gap-1.5 leading-snug\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Label({\n className,\n ...props\n}: React.ComponentProps<typeof LabelPrimitive>) {\n return (\n <LabelPrimitive\n data-slot=\"field-label\"\n className={cn(\n \"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50\",\n \"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Title({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n \"text-ppx-sm flex w-fit items-center gap-2 font-medium leading-snug group-data-[disabled=true]/field:opacity-50\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Description({\n className,\n ...props\n}: React.ComponentProps<\"p\">) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n \"text-ppx-sm text-ppx-muted-foreground font-normal leading-normal group-has-[[data-orientation=horizontal]]/field:text-balance\",\n \"nth-last-2:-mt-1 last:mt-0 [[data-variant=legend]+&]:-mt-1.5\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Separator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n children?: React.ReactNode;\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn(\n \"text-ppx-sm relative -my-2 h-5 group-data-[variant=outline]/field-group:-mb-2\",\n className,\n )}\n {...props}\n >\n <SeperatorPrimitive\n orientation=\"horizontal\"\n className=\"absolute inset-0 top-1/2\"\n />\n {children && (\n <span\n className=\"bg-ppx-background text-ppx-muted-foreground relative mx-auto block w-fit px-2\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n );\n}\n\nexport function Error({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<\"div\"> & {\n errors?: Array<{ message?: string } | undefined>;\n}) {\n const content = useMemo(() => {\n if (children) {\n return children;\n }\n\n if (!errors?.length) {\n return null;\n }\n\n const uniqueErrors = [\n ...new Map(errors.map((error) => [error?.message, error])).values(),\n ];\n\n if (uniqueErrors?.length == 1) {\n return uniqueErrors[0]?.message;\n }\n\n return (\n <ul className=\"ml-4 flex list-disc flex-col gap-1\">\n {uniqueErrors.map(\n (error, index) =>\n error?.message && <li key={index}>{error.message}</li>,\n )}\n </ul>\n );\n }, [children, errors]);\n\n if (!content) {\n return null;\n }\n\n return (\n <div\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn(\"text-ppx-sm text-ppx-red-5 font-normal\", className)}\n {...props}\n >\n {content}\n </div>\n );\n}\n","import {\n Controller,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n} from \"react-hook-form\";\nimport * as Field from \"./field\";\nimport { type ReactNode } from \"react\";\nimport { Textarea, Checkbox, Input } from \"@px-ui/core\";\n\ntype FormControlProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformedValues = TFieldValues,\n> = {\n name: TName;\n label: ReactNode;\n description?: ReactNode;\n control: ControllerProps<TFieldValues, TName, TTransformedValues>[\"control\"];\n required?: boolean;\n placeholder?: string;\n};\n\ntype FormBaseProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformedValues = TFieldValues,\n> = FormControlProps<TFieldValues, TName, TTransformedValues> & {\n horizontal?: boolean;\n controlFirst?: boolean;\n children: (\n field: Parameters<\n ControllerProps<TFieldValues, TName, TTransformedValues>[\"render\"]\n >[0][\"field\"] & {\n invalid?: boolean;\n id: string;\n },\n ) => ReactNode;\n};\n\ntype FormControlFunc<\n ExtraProps extends Record<string, unknown> = Record<never, never>,\n> = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformedValues = TFieldValues,\n>(\n props: FormControlProps<TFieldValues, TName, TTransformedValues> & ExtraProps,\n) => ReactNode;\n\nfunction FormBase<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformedValues = TFieldValues,\n>({\n children,\n control,\n label,\n name,\n required,\n description,\n controlFirst,\n horizontal,\n}: FormBaseProps<TFieldValues, TName, TTransformedValues>) {\n return (\n <Controller\n control={control}\n name={name}\n render={({ field, fieldState }) => {\n const labelElement = (\n <Field.Label\n className={required ? \"required\" : \"\"}\n htmlFor={field.name}\n >\n {label}\n </Field.Label>\n );\n\n const descriptionElement = description ? (\n <Field.Description>{description}</Field.Description>\n ) : null;\n\n const control = children({\n ...field,\n id: field.name,\n invalid: fieldState.invalid,\n });\n\n const errorElement = fieldState.invalid && (\n <Field.Error errors={[fieldState.error]} />\n );\n\n return (\n <Field.Root orientation={horizontal ? \"horizontal\" : undefined}>\n {controlFirst ? (\n <>\n {control}\n {labelElement}\n {descriptionElement}\n {errorElement}\n </>\n ) : (\n <>\n {labelElement}\n {control}\n {descriptionElement}\n {errorElement}\n </>\n )}\n </Field.Root>\n );\n }}\n />\n );\n}\n\nexport const FormInput: FormControlFunc = ({ placeholder, ...props }) => {\n return (\n <FormBase {...props}>\n {(field) => <Input {...field} placeholder={placeholder} />}\n </FormBase>\n );\n};\n\nexport const FormTextarea: FormControlFunc = ({ placeholder, ...props }) => {\n return (\n <FormBase {...props}>\n {(field) => <Textarea {...field} placeholder={placeholder} />}\n </FormBase>\n );\n};\n\nexport const FormCheckbox: FormControlFunc = (props) => {\n return (\n <FormBase {...props} horizontal controlFirst>\n {({ onChange, value, ...field }) => (\n <Checkbox {...field} checked={value} onCheckedChange={onChange} />\n )}\n </FormBase>\n );\n};\n\n// Note: FormRadioItem is not included in the abstractions because radio buttons\n// work as a group and require a different pattern. Use the verbose Controller\n// approach with RadioGroup for radio buttons. See the stories for examples.\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FA,SAAgB,YAGd,OAA2C;CAC3C,MAAM,EACJ,OACA,OACA,eACA,aACA,cACA,aACA,UACA,UACA,SACA,MACA,oBACA,MACA,cACA,qBACA,cACA,kBACA,UACA,aACE;CAGJ,MAAM,cAAc,MAAa,UAA0B;AACzD,MAAI,QAAQ,OAAO,SAAS,UAAU;AACpC,OAAI,WAAW,MAAM;IACnB,MAAM,MAAO,KAAa;AAC1B,WAAO,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BAAiB;IAAY;GAE3D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@px-ui/forms",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "Form components built on top of px-ui-core",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",