@ckc-net/puck-extended 0.1.0 → 0.1.2
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 +17 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +160 -194
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Label","Label","LabelBaseUI","Checkbox","CheckboxPrimitive","Checkbox","newValues: any[]","Label","CheckboxBaseUI","Input","InputPrimitive","Input","Label","InputBaseUI","cssAnimationPresets","cssTransitionPresets","Select","SelectPrimitive","ArrowSvg","Label","InputBaseUI","SelectBaseUI","Select","Label","SelectBaseUI","RadioGroup","RadioGroupPrimitive","RadioPrimitive","Radio","Label","RadioGroup","Textarea","FieldPrimitive","Label","TextareaBaseUI","Tabs","TabsPrimitive","cssAnimationPresets","cssTransitionPresets","Accordion","handleValueChange: AccordionProps[\"onValueChange\"]","value","AccordionPrimitive","handleItemOpenChange: AccordionItemProps[\"onOpenChange\"]","usePuck","result: OrganizedStructure","ungrouped: React.ReactNode[]","fieldName: string | null","Tabs","Accordion","cssAnimationPresets","cssTransitionPresets","TooltipPrimitive","Tooltip","TooltipBaseUI","ActionBar","DrawerItem","FieldGroups","Label","Checkbox","NumberUnit","Radio","Select","Input","Textarea","Button","BaseButton","cssAnimationPresets","cssTransitionPresets","Dialog","DialogPrimitive","Button","Select","PaginationUI","Input","DEFAULT_VALUE: MediaPickerValue","Input","Dialog","Button","RadioGroup","displayField: Fields","classes: string[]","displayDefaultProps: DisplayTraitProps","fontWeightField: Fields","lineHeightField: Fields","marginsField: Fields","classes: string[]","paddingsField: Fields","classes: string[]","positionField: Fields","classes: string[]","positionDefaultProps: PositionTraitProps","sizeField: Fields","classes: string[]","sizeDefaultProps: SizeTraitProps","textAlignField: Fields","Menu","MenuPrimitive","ColorPicker: React.FC<ColorPickerProps>","MenuBaseUI","Input","textColorField: Fields","Label","ColorPicker","textDecorationField: Fields","classes: string[]","textDecorationDefaultProps: TextDecorationTraitProps","textSizeField: Fields","textTransformField: Fields"],"sources":["../src/lib/utils.ts","../src/components/ui/label.tsx","../src/components/Fields/Label/index.tsx","../src/components/ui/checkbox.tsx","../src/components/Fields/Checkbox/index.tsx","../src/components/ui/input.tsx","../src/components/Fields/Input/index.tsx","../src/components/ui/select.tsx","../src/components/Fields/NumberUnit/index.tsx","../src/components/Fields/Select/index.tsx","../src/components/ui/radio.tsx","../src/components/Fields/Radio/index.tsx","../src/components/ui/textarea.tsx","../src/components/Fields/Textarea/index.tsx","../src/components/ActionBar/index.tsx","../src/components/ui/tabs.tsx","../src/components/ui/accordion.tsx","../src/components/FieldGroups/index.tsx","../src/components/ui/tooltip.tsx","../src/components/DrawerItem/index.tsx","../src/overrides/plugin.tsx","../src/components/ui/button.tsx","../src/components/ui/dialog.tsx","../src/components/ui/table.tsx","../src/components/ui/pagination.tsx","../src/components/Pagination/index.tsx","../src/components/ui/input-group.tsx","../src/components/MediaPicker/index.tsx","../src/utils/display.tsx","../src/utils/fontWeight.tsx","../src/utils/lineHeight.tsx","../src/utils/margins.tsx","../src/utils/paddings.tsx","../src/utils/position.tsx","../src/utils/size.tsx","../src/utils/spacing.tsx","../src/utils/spacingOptions.ts","../src/utils/textAlign.tsx","../src/components/ui/menu.tsx","../src/components/ColorPicker/index.tsx","../src/utils/textColor.tsx","../src/utils/textDecoration.tsx","../src/utils/textSize.tsx","../src/utils/textTransform.tsx","../src/utils/typography.tsx"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\n\nimport { cn } from \"../../lib/utils\"\nimport { LockIcon } from \"lucide-react\"\n\nfunction Label({\n className,\n readOnly,\n children,\n ...props\n}: React.ComponentProps<\"label\"> & { readOnly?: boolean }) {\n return (\n <label\n data-slot=\"label\"\n data-readonly={readOnly ? \"\" : undefined}\n className={cn(\n \"text-foreground mb-2 flex items-center justify-between 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 {children}\n {readOnly && <LockIcon className=\"size-4\" />}\n </label>\n )\n}\n\nexport { Label }\n","import { Label as LabelBaseUI } from \"../../ui/label\"\n\nconst Label = ({ label, readOnly }: { label?: string; readOnly?: boolean }) => (\n <LabelBaseUI\n readOnly={readOnly}\n className=\"rounded-md border border-dashed border-red-500 bg-red-500/10 p-3\"\n >\n {label}\n </LabelBaseUI>\n)\n\nexport default Label\n","\"use client\"\n\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\"\n\nimport { cn } from \"../../lib/utils\"\nimport { CheckIcon } from \"lucide-react\"\n\ntype CheckboxLayout = \"horizontal\" | \"inline\"\n\ninterface CheckboxProps extends CheckboxPrimitive.Root.Props {\n layout?: CheckboxLayout\n}\n\nfunction Checkbox({\n className,\n layout = \"horizontal\",\n ...props\n}: CheckboxProps) {\n const isHorizontal = layout === \"horizontal\"\n\n if (isHorizontal) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[checked]:text-primary-500 border-input relative block flex shrink-0 cursor-pointer items-center justify-center rounded-md border bg-white p-2 transition-shadow outline-none hover:bg-stone-50 focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[checked]:bg-stone-50 data-[checked]:font-semibold\",\n className\n )}\n {...props}\n />\n )\n }\n\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive border-input size-5 shrink-0 rounded-sm border bg-white transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"cn-checkbox-indicator grid h-full place-content-center text-current transition-none\"\n >\n <CheckIcon className=\"size-4\" strokeWidth={3} />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n}\n\nexport { Checkbox }\nexport type { CheckboxLayout }\n","import React from \"react\"\nimport { Field, FieldProps } from \"@measured/puck\"\nimport Label from \"../Label\"\nimport { Checkbox as CheckboxBaseUI, CheckboxLayout } from \"../../ui/checkbox\"\n\ntype CheckboxProps = FieldProps<Field<any>> & {\n name: string\n field: Field<any> & {\n options?: ReadonlyArray<{ label: React.ReactNode; value: any }>\n layout?: CheckboxLayout\n }\n}\n\nconst Checkbox = ({\n onChange,\n value,\n readOnly,\n field,\n label,\n}: CheckboxProps & { label: string }) => {\n if (!field.options || !Array.isArray(field.options)) {\n return null\n }\n\n const selectedValues = Array.isArray(value) ? value : []\n const layout = field.layout || \"horizontal\"\n\n const handleChange = (optionValue: any, checked: unknown) => {\n if (!readOnly && typeof checked === \"boolean\") {\n let newValues: any[]\n if (checked) {\n newValues = [...selectedValues, optionValue]\n } else {\n newValues = selectedValues.filter((v) => v !== optionValue)\n }\n onChange(newValues)\n }\n }\n\n const containerClassName =\n layout === \"horizontal\"\n ? \"flex w-fit flex-wrap gap-1.5\"\n : \"flex flex-col gap-3\"\n\n return (\n <>\n <Label label={label} readOnly={readOnly} />\n <div className=\"rounded-md border border-dashed border-purple-500 bg-purple-500/10 p-3\">\n <div className={containerClassName}>\n {field.options.map((option, index) => {\n const optionValue = option.value\n const key = `${String(optionValue)}-${index}`\n const isChecked = selectedValues.includes(optionValue)\n\n if (layout === \"horizontal\") {\n return (\n <label key={key} className=\"flex-1\">\n <CheckboxBaseUI\n layout=\"horizontal\"\n checked={isChecked}\n onCheckedChange={(checked) =>\n handleChange(optionValue, checked)\n }\n disabled={readOnly}\n >\n {option.label ||\n option.value?.toString()}\n </CheckboxBaseUI>\n </label>\n )\n }\n\n return (\n <label\n key={key}\n className=\"flex cursor-pointer items-center gap-3\"\n >\n <CheckboxBaseUI\n layout=\"inline\"\n checked={isChecked}\n onCheckedChange={(checked) =>\n handleChange(optionValue, checked)\n }\n disabled={readOnly}\n />\n <span className=\"text-sm\">\n {option.label || option.value?.toString()}\n </span>\n </label>\n )\n })}\n </div>\n </div>\n </>\n )\n}\n\nexport default Checkbox\n","import { Input as InputPrimitive } from \"@base-ui/react/input\"\nimport { cn } from \"../../lib/utils\"\n\nexport interface InputProps extends Omit<InputPrimitive.Props, \"size\"> {\n size?: \"sm\" | \"default\" | \"lg\" | number\n}\n\nfunction Input({ className, size = \"default\", ...props }: InputProps) {\n return (\n <InputPrimitive\n data-slot=\"input\"\n className={cn(\n \"border-border bg-background dark:bg-input/32 placeholder:text-muted-foreground/80 relative h-9 w-full min-w-0 rounded-lg border px-3 py-2 text-base/5 outline-none [transition:box-shadow_150ms_ease-out] sm:text-sm\",\n // Focus State\n \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[2px]\",\n \"aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/16 dark:aria-invalid:ring-destructive/24 disabled:opacity-64 [disabled,focus-visible,aria-invalid]:shadow-none\",\n size === \"sm\" && \"h-8 px-3\",\n size === \"lg\" && \"h-10 px-6\",\n props.type === \"search\" &&\n \"[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none\",\n props.type === \"file\" &&\n \"text-muted-foreground file:text-foreground file:me-3 file:bg-transparent file:text-sm file:font-medium\",\n className\n )}\n size={typeof size === \"number\" ? size : undefined}\n {...props}\n />\n )\n}\n\nexport { Input }\n","import { Input as InputBaseUI } from \"../../ui/input\"\nimport Label from \"../Label\"\n\nconst Input = ({\n onChange,\n label,\n field,\n readOnly,\n}: {\n onChange: (value: any) => void\n label: string\n field: any\n readOnly?: boolean\n}) => (\n <>\n <Label label={label} readOnly={field.readOnly || readOnly} />\n <div className=\"rounded-md border border-dashed border-cyan-500 bg-cyan-500/10 p-3\">\n <InputBaseUI\n type=\"text\"\n placeholder={field.placeholder}\n onChange={(e) => onChange(e.currentTarget.value)}\n readOnly={field.readOnly || readOnly}\n />\n </div>\n </>\n)\n\nexport default Input\n","\"use client\"\n\nimport { createContext, useContext, useMemo } from \"react\"\nimport { Select as SelectPrimitive } from \"@base-ui/react/select\"\nimport { ChevronDownIcon, ChevronUpIcon } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst cssAnimationPresets = {\n none: \"transition-none\",\n scale: [\n `[transition-property:scale,opacity] [will-change:scale,opacity]`,\n `data-starting-style:scale-80 data-starting-style:opacity-0 data-ending-style:opacity-0 data-ending-style:scale-80`,\n ],\n fade: [\n `[transition-property:opacity] [will-change:opacity]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0`,\n ],\n slideOutside: [\n `[transition-property:translate,opacity] [will-change:translate,opacity]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:translate-y-[10px] data-[side=bottom]:data-ending-style:translate-y-[10px] data-[side=bottom]:data-ending-style:opacity-0`,\n // side=top\n `data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:translate-y-[-10px] data-[side=top]:data-ending-style:translate-y-[-10px] data-[side=top]:data-ending-style:opacity-0`,\n // side=left\n `data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:translate-x-[-10px] data-[side=left]:data-ending-style:translate-x-[-10px] data-[side=left]:data-ending-style:opacity-0`,\n // side=right\n `data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:translate-x-[10px] data-[side=right]:data-ending-style:translate-x-[10px] data-[side=right]:data-ending-style:opacity-0`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:translate-x-[-10px] data-[side=inline-start]:data-ending-style:translate-x-[-10px] data-[side=inline-start]:data-ending-style:opacity-0`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:translate-x-[10px] data-[side=inline-end]:data-ending-style:translate-x-[10px] data-[side=inline-end]:data-ending-style:opacity-0`,\n ],\n slideInside: [\n `[transition-property:translate,opacity] [will-change:translate,opacity]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:translate-y-[-10px] data-[side=bottom]:data-ending-style:translate-y-[-10px] data-[side=bottom]:data-ending-style:opacity-0`,\n // side=top\n `data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:translate-y-[10px] data-[side=top]:data-ending-style:translate-y-[10px] data-[side=top]:data-ending-style:opacity-0`,\n // side=left\n `data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:translate-x-[10px] data-[side=left]:data-ending-style:translate-x-[10px] data-[side=left]:data-ending-style:opacity-0`,\n // side=right\n `data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:translate-x-[-10px] data-[side=right]:data-ending-style:translate-x-[-10px] data-[side=right]:data-ending-style:opacity-0`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:translate-x-[10px] data-[side=inline-start]:data-ending-style:translate-x-[10px] data-[side=inline-start]:data-ending-style:opacity-0`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:translate-x-[-10px] data-[side=inline-end]:data-ending-style:translate-x-[-10px] data-[side=inline-end]:data-ending-style:opacity-0`,\n ],\n wipe: [\n `[transition-property:clip-path] [will-change:clip-path]`,\n `[clip-path:inset(0_0_0_0_round_12px)] [-webkit-clip-path:inset(0_0_0_0_round_12px)]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:[clip-path:inset(0_0_100%_0_round_12px)] data-[side=bottom]:data-ending-style:[clip-path:inset(0_0_100%_0_round_12px)]`,\n // side=top\n `data-[side=top]:data-starting-style:[clip-path:inset(100%_0_0_0_round_12px)] data-[side=top]:data-ending-style:[clip-path:inset(100%_0_0_0_round_12px)]`,\n // side=left\n `data-[side=left]:data-starting-style:[clip-path:inset(0_0_0_100%_round_12px)] data-[side=left]:data-ending-style:[clip-path:inset(0_0_0_100%_round_12px)]`,\n // side=right\n `data-[side=right]:data-starting-style:[clip-path:inset(0_100%_0_0_round_12px)] data-[side=right]:data-ending-style:[clip-path:inset(0_100%_0_0_round_12px)]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:[clip-path:inset(0_0_0_100%_round_12px)] data-[side=inline-start]:data-ending-style:[clip-path:inset(0_0_0_100%_round_12px)]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:[clip-path:inset(0_100%_0_0_round_12px)] data-[side=inline-end]:data-ending-style:[clip-path:inset(0_100%_0_0_round_12px)]`,\n ],\n wipeScale: [\n `[transition-property:clip-path,scale] [will-change:clip-path,scale]`,\n `[clip-path:inset(0_0_0_0_round_12px)] [-webkit-clip-path:inset(0_0_0_0_round_12px)]`,\n `data-starting-style:scale-80 data-ending-style:scale-80`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:[clip-path:inset(0_0_100%_0_round_12px)] data-[side=bottom]:data-ending-style:[clip-path:inset(0_0_100%_0_round_12px)]`,\n // side=top\n `data-[side=top]:data-starting-style:[clip-path:inset(100%_0_0_0_round_12px)] data-[side=top]:data-ending-style:[clip-path:inset(100%_0_0_0_round_12px)]`,\n // side=left\n `data-[side=left]:data-starting-style:[clip-path:inset(0_0_0_100%_round_12px)] data-[side=left]:data-ending-style:[clip-path:inset(0_0_0_100%_round_12px)]`,\n // side=right\n `data-[side=right]:data-starting-style:[clip-path:inset(0_100%_0_0_round_12px)] data-[side=right]:data-ending-style:[clip-path:inset(0_100%_0_0_round_12px)]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:[clip-path:inset(0_0_0_100%_round_12px)] data-[side=inline-start]:data-ending-style:[clip-path:inset(0_0_0_100%_round_12px)]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:[clip-path:inset(0_100%_0_0_round_12px)] data-[side=inline-end]:data-ending-style:[clip-path:inset(0_100%_0_0_round_12px)]`,\n ],\n motion: [\n `[transition-property:translate,scale,opacity,rotateX,rotateY,transform] [will-change:translate,scale,opacity,rotateX,rotateY,transform]`,\n `[transform:perspective(1000px)]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:translate-y-[7px] data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:scale-[0.26] data-[side=bottom]:data-starting-style:rotate-x-[70deg] data-[side=bottom]:data-ending-style:translate-y-[7px] data-[side=bottom]:data-ending-style:opacity-0 data-[side=bottom]:data-ending-style:scale-[0.26] data-[side=bottom]:data-ending-style:rotate-x-[70deg]`,\n // side=top\n `data-[side=top]:data-starting-style:translate-y-[7px] data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:scale-[0.26] data-[side=top]:data-starting-style:rotate-x-[70deg] data-[side=top]:data-ending-style:translate-y-[7px] data-[side=top]:data-ending-style:opacity-0 data-[side=top]:data-ending-style:scale-[0.26] data-[side=top]:data-ending-style:rotate-x-[70deg]`,\n // side=left\n `data-[side=left]:data-starting-style:translate-x-[-7px] data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:scale-[0.26] data-[side=left]:data-starting-style:rotate-y-[-40deg] data-[side=left]:data-ending-style:translate-x-[-7px] data-[side=left]:data-ending-style:opacity-0 data-[side=left]:data-ending-style:scale-[0.26] data-[side=left]:data-ending-style:rotate-y-[-40deg]`,\n // side=right\n `data-[side=right]:data-starting-style:translate-x-[7px] data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:scale-[0.26] data-[side=right]:data-starting-style:rotate-y-[40deg] data-[side=right]:data-ending-style:translate-x-[7px] data-[side=right]:data-ending-style:opacity-0 data-[side=right]:data-ending-style:scale-[0.26] data-[side=right]:data-ending-style:rotate-y-[40deg]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:translate-x-[-7px] data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:scale-[0.26] data-[side=inline-start]:data-starting-style:rotate-y-[-40deg] data-[side=inline-start]:data-ending-style:translate-x-[-7px] data-[side=inline-start]:data-ending-style:opacity-0 data-[side=inline-start]:data-ending-style:scale-[0.26] data-[side=inline-start]:data-ending-style:rotate-y-[-40deg]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:translate-x-[7px] data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:scale-[0.26] data-[side=inline-end]:data-starting-style:rotate-y-[40deg] data-[side=inline-end]:data-ending-style:translate-x-[7px] data-[side=inline-end]:data-ending-style:opacity-0 data-[side=inline-end]:data-ending-style:scale-[0.26] data-[side=inline-end]:data-ending-style:rotate-y-[40deg]`,\n ],\n motionBlur: [\n `[transition-property:translate,scale,opacity,rotateX,rotateY,transform,filter] [will-change:translate,scale,opacity,rotateX,rotateY,transform,filter]`,\n `[transform:perspective(1000px)]`,\n `data-starting-style:blur-[9px] data-ending-style:blur-[9px]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:translate-y-[7px] data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:scale-[0.26] data-[side=bottom]:data-starting-style:rotate-x-[70deg] data-[side=bottom]:data-ending-style:translate-y-[7px] data-[side=bottom]:data-ending-style:opacity-0 data-[side=bottom]:data-ending-style:scale-[0.26] data-[side=bottom]:data-ending-style:rotate-x-[70deg]`,\n // side=top\n `data-[side=top]:data-starting-style:translate-y-[7px] data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:scale-[0.26] data-[side=top]:data-starting-style:rotate-x-[70deg] data-[side=top]:data-ending-style:translate-y-[7px] data-[side=top]:data-ending-style:opacity-0 data-[side=top]:data-ending-style:scale-[0.26] data-[side=top]:data-ending-style:rotate-x-[70deg]`,\n // side=left\n `data-[side=left]:data-starting-style:translate-x-[-7px] data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:scale-[0.26] data-[side=left]:data-starting-style:rotate-y-[-40deg] data-[side=left]:data-ending-style:translate-x-[-7px] data-[side=left]:data-ending-style:opacity-0 data-[side=left]:data-ending-style:scale-[0.26] data-[side=left]:data-ending-style:rotate-y-[-40deg]`,\n // side=right\n `data-[side=right]:data-starting-style:translate-x-[7px] data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:scale-[0.26] data-[side=right]:data-starting-style:rotate-y-[40deg] data-[side=right]:data-ending-style:translate-x-[7px] data-[side=right]:data-ending-style:opacity-0 data-[side=right]:data-ending-style:scale-[0.26] data-[side=right]:data-ending-style:rotate-y-[40deg]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:translate-x-[-7px] data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:scale-[0.26] data-[side=inline-start]:data-starting-style:rotate-y-[-40deg] data-[side=inline-start]:data-ending-style:translate-x-[-7px] data-[side=inline-start]:data-ending-style:opacity-0 data-[side=inline-start]:data-ending-style:scale-[0.26] data-[side=inline-start]:data-ending-style:rotate-y-[-40deg]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:translate-x-[7px] data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:scale-[0.26] data-[side=inline-end]:data-starting-style:rotate-y-[40deg] data-[side=inline-end]:data-ending-style:translate-x-[7px] data-[side=inline-end]:data-ending-style:opacity-0 data-[side=inline-end]:data-ending-style:scale-[0.26] data-[side=inline-end]:data-ending-style:rotate-y-[40deg]`,\n ],\n}\n\nconst cssTransitionPresets = {\n inExpo: `duration-[0.35s] ease-[cubic-bezier(0.95,0.05,0.795,0.035)]`,\n outExpo: `duration-[0.35s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n inOutExpo: `duration-[0.35s] ease-[cubic-bezier(1,0,0,1)]`,\n anticipate: `duration-[0.35s] ease-[cubic-bezier(1,-0.4,0.35,0.95)]`,\n quickOut: `duration-[0.35s] ease-out`,\n overshootOut: `duration-[0.35s] ease-[cubic-bezier(0.175,0.885,0.32,1.275)]`,\n swiftOut: `duration-[0.35s] ease-[cubic-bezier(0.175,0.885,0.32,1.1)]`,\n snappyOut: `duration-[0.35s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n in: `duration-[0.35s] ease-[cubic-bezier(0.42,0,1,1)]`,\n out: `duration-[0.35s] ease-[cubic-bezier(0,0,0.58,1)]`,\n inOut: `duration-[0.25s] ease-[cubic-bezier(0.42,0,0.58,1)]`,\n outIn: `duration-[0.35s] ease-[cubic-bezier(0.1,0.7,0.9,0.5)]`,\n inQuad: `duration-[0.35s] ease-[cubic-bezier(0.55,0.085,0.68,0.53)]`,\n outQuad: `duration-[0.25s] ease-[cubic-bezier(0.25,0.46,0.45,0.94)]`,\n inOutQuad: `duration-[0.32s] ease-[cubic-bezier(0.455,0.03,0.515,0.955)]`,\n inCubic: `duration-[0.35s] ease-[cubic-bezier(0.55,0.055,0.675,0.19)]`,\n outCubic: `duration-[0.35s] ease-[cubic-bezier(0.215,0.61,0.355,1)]`,\n inOutCubic: `duration-[0.35s] ease-[cubic-bezier(0.645,0.045,0.355,1)]`,\n inQuart: `duration-[0.35s] ease-[cubic-bezier(0.895,0.03,0.685,0.22)]`,\n outQuart: `duration-[0.35s] ease-[cubic-bezier(0.165,0.84,0.44,1)]`,\n inOutQuart: `duration-[0.35s] ease-[cubic-bezier(0.77,0,0.175,1)]`,\n inQuint: `duration-[0.35s] ease-[cubic-bezier(0.755,0.05,0.855,0.06)]`,\n outQuint: `duration-[0.35s] ease-[cubic-bezier(0.23,1,0.32,1)]`,\n inOutQuint: `duration-[0.35s] ease-[cubic-bezier(0.86,0,0.07,1)]`,\n inCirc: `duration-[0.35s] ease-[cubic-bezier(0.6,0.04,0.98,0.335)]`,\n outCirc: `duration-[0.35s] ease-[cubic-bezier(0.075,0.82,0.165,1)]`,\n inOutCirc: `duration-[0.35s] ease-[cubic-bezier(0.785,0.135,0.15,0.86)]`,\n inOutBase: `duration-[0.35s] ease-[cubic-bezier(0.25,0.1,0.25,1)]`,\n}\n\ntype CSSAnimationPresets = keyof typeof cssAnimationPresets\ntype CSSTransitionPresets = keyof typeof cssTransitionPresets\n\ntype Backdrop = \"opaque\" | \"blur\" | \"transparent\"\n\ninterface SelectContextType {\n backdrop?: Backdrop\n}\n\nconst SelectContext = createContext<SelectContextType | undefined>(undefined)\n\nfunction useSelect() {\n const context = useContext(SelectContext)\n if (!context) {\n throw new Error(\"useSelect must be used within a SelectProvider\")\n }\n return context\n}\n\ninterface SelectRootProps extends React.ComponentProps<\n typeof SelectPrimitive.Root\n> {\n backdrop?: Backdrop\n}\n\nfunction Select({ backdrop = \"transparent\", ...props }: SelectRootProps) {\n return (\n <SelectContext.Provider value={{ backdrop }}>\n <SelectPrimitive.Root data-slot=\"select\" {...props} />\n </SelectContext.Provider>\n )\n}\n\ninterface SelectTriggerProps extends React.ComponentProps<\n typeof SelectPrimitive.Trigger\n> {}\n\nfunction SelectTrigger({ className, ...props }: SelectTriggerProps) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n className={cn(\n \"group/select-trigger border-input text-foreground focus-visible:border-primary bg-background dark:bg-input/40 inline-flex h-fit w-full touch-none items-center justify-between gap-3 rounded-lg border px-[calc(--spacing(2.5)-1px)] py-[calc(--spacing(2)-1px)] text-sm transition-colors ease-out select-none focus-visible:outline-none\",\n className\n )}\n {...props}\n />\n )\n}\n\ninterface SelectValueProps extends React.ComponentProps<\n typeof SelectPrimitive.Value\n> {\n placeholder?: string\n}\n\nfunction SelectValue({\n className,\n placeholder = \"Select...\",\n ...props\n}: SelectValueProps) {\n return (\n <SelectPrimitive.Value\n data-slot=\"select-value\"\n {...props}\n render={(renderProps, state) => {\n const newValue = state.value\n const isNull = !newValue && !renderProps.children\n\n if (isNull) {\n return (\n <span\n {...renderProps}\n className={cn(\n \"text-foreground/60 w-full text-left\",\n className\n )}\n >\n {placeholder}\n </span>\n )\n }\n\n return (\n <span\n key={newValue}\n {...renderProps}\n className={cn(\n \"fadeIn w-full truncate text-left\",\n className\n )}\n />\n )\n }}\n />\n )\n}\n\ninterface SelectIconProps extends React.ComponentProps<\n typeof SelectPrimitive.Icon\n> {}\n\nfunction SelectIcon({ className, ...props }: SelectIconProps) {\n return (\n <SelectPrimitive.Icon\n data-slot=\"select-icon\"\n className={cn(\"text-foreground/72 size-3.5 shrink-0\", className)}\n {...props}\n />\n )\n}\n\ninterface SelectPortalProps extends React.ComponentProps<\n typeof SelectPrimitive.Portal\n> {}\n\nfunction SelectPortal(props: SelectPortalProps) {\n return <SelectPrimitive.Portal data-slot=\"select-portal\" {...props} />\n}\n\ninterface SelectBackdropProps extends React.ComponentProps<\n typeof SelectPrimitive.Backdrop\n> {}\n\nfunction SelectBackdrop({ className, ...props }: SelectBackdropProps) {\n const { backdrop = \"transparent\" } = useSelect()\n\n return (\n <SelectPrimitive.Backdrop\n data-slot=\"select-backdrop\"\n className={cn(\n backdrop === \"opaque\" &&\n \"fixed inset-0 z-100 bg-black opacity-40 transition-all duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:opacity-60\",\n backdrop === \"blur\" &&\n \"fixed inset-0 z-100 backdrop-blur-sm transition-all duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0\",\n backdrop === \"transparent\" && \"hidden\",\n className\n )}\n {...props}\n />\n )\n}\n\ninterface SelectPositionerProps extends React.ComponentProps<\n typeof SelectPrimitive.Positioner\n> {}\n\nfunction SelectPositioner({\n sideOffset = 4,\n side = \"bottom\",\n className,\n alignItemWithTrigger = true,\n ...props\n}: SelectPositionerProps) {\n return (\n <SelectPortal>\n <SelectBackdrop />\n <SelectPrimitive.Positioner\n sideOffset={sideOffset}\n side={side}\n alignItemWithTrigger={alignItemWithTrigger}\n data-slot=\"select-positioner\"\n className={cn(\"z-100 outline-none select-none\", className)}\n {...props}\n />\n </SelectPortal>\n )\n}\n\ninterface SelectArrowProps extends React.ComponentProps<\n typeof SelectPrimitive.Arrow\n> {}\n\nfunction SelectArrow({ className, ...rest }: SelectArrowProps) {\n return (\n <SelectPrimitive.Arrow\n data-slot=\"select-arrow\"\n className={cn(\n \"data-[side=bottom]:top-[-9px] data-[side=left]:right-[-14px] data-[side=left]:rotate-90 data-[side=right]:left-[-14px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-9px] data-[side=top]:rotate-180\",\n className\n )}\n {...rest}\n />\n )\n}\n\nfunction ArrowSvg(props: React.ComponentProps<\"svg\">) {\n return (\n <svg width=\"20\" height=\"10\" viewBox=\"0 0 20 10\" fill=\"none\" {...props}>\n <path\n d=\"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\"\n className=\"fill-popover\"\n />\n <path\n d=\"M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z\"\n className=\"fill-border/60\"\n />\n </svg>\n )\n}\n\ninterface SelectPopupProps\n extends\n React.ComponentProps<typeof SelectPrimitive.Popup>,\n Pick<\n SelectPositionerProps,\n | \"side\"\n | \"sideOffset\"\n | \"align\"\n | \"alignOffset\"\n | \"alignItemWithTrigger\"\n > {\n animationPreset?: CSSAnimationPresets\n transitionPreset?: CSSTransitionPresets\n reduceMotion?: boolean\n showArrow?: boolean\n}\n\nfunction SelectPopup({\n className,\n animationPreset = \"scale\",\n transitionPreset = \"outQuint\",\n reduceMotion = false,\n showArrow = false,\n side = \"bottom\",\n sideOffset = 4,\n align = \"center\",\n alignOffset = 0,\n alignItemWithTrigger = false,\n children,\n ...rest\n}: SelectPopupProps) {\n const cssAnimationConfig = useMemo(() => {\n if (reduceMotion) return \"\"\n\n if (animationPreset) {\n return cssAnimationPresets[animationPreset]\n }\n\n return cssAnimationPresets.scale\n }, [animationPreset, reduceMotion, side])\n\n const cssTransitionConfig = useMemo(() => {\n if (reduceMotion) return \"\"\n\n if (transitionPreset) {\n return cssTransitionPresets[transitionPreset]\n }\n\n return cssTransitionPresets.snappyOut\n }, [transitionPreset, reduceMotion, side])\n\n return (\n <SelectPositioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n alignItemWithTrigger={alignItemWithTrigger}\n className=\"\"\n >\n <SelectPrimitive.Popup\n data-slot=\"select-popup\"\n render={(renderProps) => {\n if (alignItemWithTrigger) {\n return (\n <div\n key=\"select-popup\"\n {...renderProps}\n className={cn(\n \"pointer-events-auto origin-(--transform-origin)\",\n className\n )}\n style={{\n ...renderProps.style,\n }}\n >\n {showArrow && (\n <SelectArrow>\n <ArrowSvg />\n </SelectArrow>\n )}\n <SelectPrimitive.ScrollUpArrow\n className={cn(\n \"top-0 z-50 flex h-6 w-full cursor-default items-center justify-center\",\n \"before:from-popover before:pointer-events-none before:absolute before:inset-x-px before:top-px before:h-[140%] before:rounded-t-[calc(var(--radius-lg)-1px)] before:bg-linear-to-b before:from-50%\"\n )}\n data-slot=\"select-scroll-up-arrow\"\n >\n <ChevronUpIcon className=\"relative size-4\" />\n </SelectPrimitive.ScrollUpArrow>\n {children}\n <SelectPrimitive.ScrollDownArrow\n className={cn(\n \"bottom-0 z-50 flex h-6 w-full cursor-default items-center justify-center\",\n \"before:from-popover before:pointer-events-none before:absolute before:inset-x-px before:bottom-px before:h-[140%] before:rounded-b-[calc(var(--radius-lg)-1px)] before:bg-linear-to-t before:from-50%\"\n )}\n data-slot=\"select-scroll-down-arrow\"\n >\n <ChevronDownIcon className=\"relative size-4\" />\n </SelectPrimitive.ScrollDownArrow>\n </div>\n )\n }\n\n return (\n <div\n key=\"select-popup\"\n {...renderProps}\n className={cn(\n \"pointer-events-auto origin-(--transform-origin)\",\n className,\n renderProps.className,\n cssTransitionConfig,\n cssAnimationConfig\n )}\n >\n {showArrow && (\n <SelectArrow>\n <ArrowSvg />\n </SelectArrow>\n )}\n <SelectPrimitive.ScrollUpArrow\n className={cn(\n \"top-0 z-50 flex h-6 w-full cursor-default items-center justify-center\",\n \"before:from-popover before:pointer-events-none before:absolute before:inset-x-px before:top-px before:h-[140%] before:rounded-t-[calc(var(--radius-lg)-1px)] before:bg-linear-to-b before:from-50%\"\n )}\n data-slot=\"select-scroll-up-arrow\"\n >\n <ChevronUpIcon className=\"relative size-4\" />\n </SelectPrimitive.ScrollUpArrow>\n {children}\n <SelectPrimitive.ScrollDownArrow\n className={cn(\n \"bottom-0 z-50 flex h-6 w-full cursor-default items-center justify-center\",\n \"before:from-popover before:pointer-events-none before:absolute before:inset-x-px before:bottom-px before:h-[140%] before:rounded-b-[calc(var(--radius-lg)-1px)] before:bg-linear-to-t before:from-50%\"\n )}\n data-slot=\"select-scroll-down-arrow\"\n >\n <ChevronDownIcon className=\"relative size-4\" />\n </SelectPrimitive.ScrollDownArrow>\n </div>\n )\n }}\n {...rest}\n />\n </SelectPositioner>\n )\n}\n\ninterface SelectListProps extends React.ComponentProps<\n typeof SelectPrimitive.List\n> {}\n\nfunction SelectList({ className, ...props }: SelectListProps) {\n return (\n <SelectPrimitive.List\n data-slot=\"select-list\"\n className={cn(\n \"bg-popover relative block h-full max-h-[min(var(--available-height),260px)] min-w-(--anchor-width) overflow-y-auto rounded-lg border p-1 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\",\n className\n )}\n {...props}\n />\n )\n}\n\ninterface SelectItemProps extends React.ComponentProps<\n typeof SelectPrimitive.Item\n> {}\n\nfunction SelectItem({ className, ...props }: SelectItemProps) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n \"relative flex min-w-(--anchor-width) cursor-default items-center gap-2 px-3 py-1.5 text-sm outline-none select-none group-data-[side=none]:min-w-[calc(var(--anchor-width))]\",\n `data-highlighted:before:bg-accent/70 dark:data-highlighted:before:bg-accent data-highlighted:text-accent-foreground data-highlighted:before:border-border/30 data-highlighted:z-0 data-highlighted:before:absolute data-highlighted:before:inset-x-0 data-highlighted:before:inset-y-0 data-highlighted:before:z-[-1] data-highlighted:before:rounded-md data-highlighted:before:border`,\n className\n )}\n {...props}\n />\n )\n}\n\ninterface SelectItemTextProps extends React.ComponentProps<\n typeof SelectPrimitive.ItemText\n> {}\n\nfunction SelectItemText({ className, ...props }: SelectItemTextProps) {\n return (\n <SelectPrimitive.ItemText\n data-slot=\"select-item-text\"\n className={cn(\"flex-1\", className)}\n {...props}\n />\n )\n}\n\ninterface SelectItemIndicatorProps extends React.ComponentProps<\n typeof SelectPrimitive.ItemIndicator\n> {}\n\nfunction SelectItemIndicator({\n className,\n ...props\n}: SelectItemIndicatorProps) {\n return (\n <SelectPrimitive.ItemIndicator\n data-slot=\"select-item-indicator\"\n className={cn(\"ml-auto min-w-fit\", className)}\n {...props}\n />\n )\n}\n\ninterface SelectGroupProps extends React.ComponentProps<\n typeof SelectPrimitive.Group\n> {}\n\nfunction SelectGroup({ ...props }: SelectGroupProps) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />\n}\n\ninterface SelectGroupLabelProps extends React.ComponentProps<\n typeof SelectPrimitive.GroupLabel\n> {}\n\nfunction SelectGroupLabel({ ...props }: SelectGroupLabelProps) {\n return (\n <SelectPrimitive.GroupLabel data-slot=\"select-group-label\" {...props} />\n )\n}\n\nfunction SelectScrollUpArrow(\n props: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>\n) {\n return (\n <SelectPrimitive.ScrollUpArrow\n data-slot=\"select-scroll-up-arrow\"\n {...props}\n />\n )\n}\n\nfunction SelectScrollDownArrow(\n props: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>\n) {\n return (\n <SelectPrimitive.ScrollDownArrow\n data-slot=\"select-scroll-down-arrow\"\n {...props}\n />\n )\n}\n\ninterface SelectSeparatorProps extends React.ComponentProps<\n typeof SelectPrimitive.Separator\n> {}\n\nfunction SelectSeparator({ ...props }: SelectSeparatorProps) {\n return <SelectPrimitive.Separator data-slot=\"select-separator\" {...props} />\n}\n\nexport {\n Select,\n SelectTrigger,\n SelectValue,\n SelectIcon,\n SelectPopup,\n SelectList,\n SelectItem,\n SelectItemText,\n SelectItemIndicator,\n SelectGroup,\n SelectGroupLabel,\n SelectScrollUpArrow,\n SelectScrollDownArrow,\n SelectSeparator,\n}\n","import { Input as InputBaseUI } from \"../../ui/input\"\nimport {\n Select as SelectBaseUI,\n SelectList,\n SelectIcon,\n SelectItem,\n SelectItemIndicator,\n SelectPopup,\n SelectTrigger,\n SelectValue,\n} from \"../../ui/select\"\nimport Label from \"../Label\"\nimport { ChevronDownIcon, CheckIcon } from \"lucide-react\"\n\nexport type NumberUnitValue = {\n value: string\n unit: string\n}\n\nconst NumberUnit = ({\n onChange,\n value,\n label,\n field,\n readOnly,\n}: {\n onChange: (value: NumberUnitValue) => void\n value: NumberUnitValue\n label: string\n field: any\n readOnly?: boolean\n}) => {\n const currentValue = value || {\n value: \"\",\n unit: field.options?.[0]?.value || \"\",\n }\n\n const handleInputChange = (newValue: string) => {\n if (!readOnly) {\n onChange({\n ...currentValue,\n value: newValue,\n })\n }\n }\n\n const handleUnitChange = (newUnit: string) => {\n if (!readOnly) {\n onChange({\n ...currentValue,\n unit: newUnit,\n })\n }\n }\n\n return (\n <>\n <Label label={label} readOnly={field.readOnly || readOnly} />\n <div className=\"rounded-md border border-dashed border-purple-500 bg-purple-500/10 p-3\">\n <div className=\"flex\">\n <div className=\"flex-1\">\n <InputBaseUI\n className=\"rounded-r-none\"\n type=\"text\"\n placeholder={field.placeholder || \"Value\"}\n value={currentValue.value}\n onChange={(e) =>\n handleInputChange(e.currentTarget.value)\n }\n readOnly={field.readOnly || readOnly}\n />\n </div>\n <div className=\"w-18\">\n <SelectBaseUI\n items={field.options || []}\n value={currentValue.unit}\n onValueChange={handleUnitChange}\n disabled={field.readOnly || readOnly}\n >\n <SelectTrigger className=\"rounded-l-none border-l-0\">\n <SelectValue />\n <SelectIcon>\n <ChevronDownIcon className=\"size-3.5\" />\n </SelectIcon>\n </SelectTrigger>\n <SelectPopup align=\"end\" side=\"bottom\">\n <SelectList>\n {(field.options || []).map(\n (option: any) => (\n <SelectItem\n key={option.value}\n value={option.value}\n >\n {option.label}\n <SelectItemIndicator>\n <CheckIcon className=\"size-3.5\" />\n </SelectItemIndicator>\n </SelectItem>\n )\n )}\n </SelectList>\n </SelectPopup>\n </SelectBaseUI>\n </div>\n </div>\n </div>\n </>\n )\n}\n\nexport default NumberUnit\n","import {\n Select as SelectBaseUI,\n SelectItem,\n SelectItemIndicator,\n SelectTrigger,\n SelectValue,\n SelectIcon,\n SelectPopup,\n SelectList,\n} from \"../../ui/select\"\nimport Label from \"../Label\"\nimport { ChevronDownIcon, CheckIcon } from \"lucide-react\"\n\nconst Select = ({\n onChange,\n value,\n label,\n field,\n readOnly,\n}: {\n onChange: (value: any) => void\n value: any\n label: string\n field: any\n readOnly?: boolean\n}) => {\n const placeholder = field.placeholder || \"Select an option\"\n\n const itemsWithPlaceholder = [\n { label: placeholder, value: null },\n ...field.options.map((option: any) => ({\n label: option.label,\n value: option.value,\n })),\n ]\n\n const handleValueChange = (newValue: string | null) => {\n if (!readOnly && newValue !== null) {\n onChange(newValue)\n }\n }\n\n return (\n <>\n <Label label={label} readOnly={field.readOnly || readOnly} />\n <div className=\"rounded-md border border-dashed border-green-500 bg-green-500/10 p-3\">\n <SelectBaseUI\n items={itemsWithPlaceholder}\n value={value || null}\n onValueChange={handleValueChange}\n disabled={field.readOnly || readOnly}\n >\n <SelectTrigger className=\"min-w-46\">\n <SelectValue />\n <SelectIcon>\n <ChevronDownIcon className=\"size-3.5\" />\n </SelectIcon>\n </SelectTrigger>\n <SelectPopup align=\"center\" side=\"bottom\">\n <SelectList>\n {field.options.map((option: any) => (\n <SelectItem\n key={\n typeof option.label === \"string\"\n ? option.label\n : JSON.stringify(option.value)\n }\n value={option.value}\n >\n {option.label}\n <SelectItemIndicator>\n <CheckIcon className=\"size-3\" />\n </SelectItemIndicator>\n </SelectItem>\n ))}\n </SelectList>\n </SelectPopup>\n </SelectBaseUI>\n </div>\n </>\n )\n}\n\nexport default Select\n","\"use client\"\n\nimport { Radio as RadioPrimitive } from \"@base-ui/react/radio\"\nimport { RadioGroup as RadioGroupPrimitive } from \"@base-ui/react/radio-group\"\n\nimport { cn } from \"../../lib/utils\"\n\ntype RadioLayout = \"horizontal\" | \"inline\"\n\ninterface RadioGroupProps extends RadioGroupPrimitive.Props {\n layout?: RadioLayout\n}\n\ninterface RadioGroupItemProps extends RadioPrimitive.Root.Props {\n layout?: RadioLayout\n}\n\nfunction RadioGroup({\n className,\n layout = \"horizontal\",\n ...props\n}: RadioGroupProps) {\n return (\n <RadioGroupPrimitive\n data-slot=\"radio-group\"\n className={cn(\"cn-radio-group w-full\", className)}\n {...props}\n />\n )\n}\n\nfunction RadioGroupItem({\n className,\n layout = \"horizontal\",\n ...props\n}: RadioGroupItemProps) {\n const isHorizontal = layout === \"horizontal\"\n\n if (isHorizontal) {\n return (\n <RadioPrimitive.Root\n data-slot=\"radio-group-item\"\n className={cn(\n \"text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 group/radio-group-item peer data-[checked]:text-primary-500 relative block flex h-full shrink-0 cursor-pointer items-center justify-center border border-transparent bg-white p-2 text-xs transition-[color,box-shadow] outline-none hover:bg-stone-50 focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[checked]:bg-stone-50 data-[checked]:font-semibold\",\n className\n )}\n {...props}\n />\n )\n }\n\n return (\n <RadioPrimitive.Root\n data-slot=\"radio-group-item\"\n className={cn(\n \"text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 group/radio-group-item peer border-input relative aspect-square size-4 shrink-0 rounded-full border bg-white transition-[color,box-shadow] outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <RadioPrimitive.Indicator\n data-slot=\"radio-group-indicator\"\n className=\"cn-radio-group-indicator\"\n >\n <span className=\"bg-foreground m-1 block size-1.5 rounded-full\"></span>\n </RadioPrimitive.Indicator>\n </RadioPrimitive.Root>\n )\n}\n\nexport { RadioGroup, RadioGroupItem }\nexport type { RadioLayout }\n","import React from \"react\"\nimport { Field, FieldProps } from \"@measured/puck\"\nimport Label from \"../Label\"\nimport { RadioGroup, RadioGroupItem, RadioLayout } from \"../../ui/radio\"\n\ntype RadioProps = FieldProps<Field<any>> & {\n name: string\n field: Field<any> & {\n options?: ReadonlyArray<{ label: React.ReactNode; value: any }>\n layout?: RadioLayout\n }\n}\n\nconst Radio = ({\n onChange,\n value,\n readOnly,\n field,\n label,\n}: RadioProps & { label: string }) => {\n if (!field.options || !Array.isArray(field.options)) {\n return null\n }\n\n const layout = field.layout || \"horizontal\"\n\n const handleChange = (newValue: unknown) => {\n if (!readOnly && newValue != null) {\n onChange(newValue)\n }\n }\n\n const groupClassName =\n layout === \"horizontal\"\n ? \"border-input flex w-fit flex-wrap divide-x divide-stone-200 overflow-hidden rounded-md border\"\n : \"flex flex-col gap-3\"\n\n return (\n <>\n <Label label={label} readOnly={readOnly} />\n <div className=\"rounded-md border border-dashed border-amber-500 bg-amber-500/10 p-3\">\n <RadioGroup\n layout={layout}\n value={value?.toString() || \"\"}\n onValueChange={handleChange}\n disabled={readOnly}\n className={groupClassName}\n >\n {field.options.map((option, index) => {\n const optionValue = String(option.value ?? \"\")\n const key = `${optionValue}-${index}`\n\n if (layout === \"horizontal\") {\n return (\n <label key={key} className=\"flex-1\">\n <RadioGroupItem\n layout=\"horizontal\"\n value={optionValue}\n disabled={readOnly}\n >\n {option.label ||\n option.value?.toString()}\n </RadioGroupItem>\n </label>\n )\n }\n\n return (\n <label\n key={key}\n className=\"flex cursor-pointer items-center gap-3\"\n >\n <RadioGroupItem\n layout=\"inline\"\n value={optionValue}\n disabled={readOnly}\n />\n <span className=\"text-sm\">\n {option.label || option.value?.toString()}\n </span>\n </label>\n )\n })}\n </RadioGroup>\n </div>\n </>\n )\n}\n\nexport default Radio\n","\"use client\"\n\nimport * as React from \"react\"\nimport { Field as FieldPrimitive } from \"@base-ui/react/field\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\n\nimport { cn } from \"../../lib/utils\"\n\nexport interface TextareaProps extends React.ComponentProps<\"textarea\"> {\n size?: \"sm\" | \"default\" | \"lg\" | number\n}\n\nfunction Textarea({ className, size = \"default\", ...props }: TextareaProps) {\n return (\n <FieldPrimitive.Control\n render={(defaultProps) => (\n <textarea\n data-slot=\"textarea\"\n className={cn(\n \"border-border bg-background dark:bg-input/32 placeholder:text-muted-foreground/80 relative field-sizing-content min-h-17.5 w-full rounded-lg border px-3 py-2 text-base/5 outline-none [transition:box-shadow_150ms_ease-out] max-sm:min-h-20.5 sm:text-sm\",\n // Focus State\n \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n \"focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/16 dark:aria-invalid:ring-destructive/24 disabled:opacity-64 [disabled,focus-visible,aria-invalid]:shadow-none\",\n size === \"sm\" &&\n \"min-h-16.5 px-[calc(--spacing(2.5)-1px)] py-[calc(--spacing(1)-1px)] max-sm:min-h-19.5\",\n size === \"lg\" &&\n \"min-h-18.5 py-[calc(--spacing(2)-1px)] max-sm:min-h-21.5\",\n className\n )}\n {...mergeProps(defaultProps, props)}\n />\n )}\n />\n )\n}\n\nexport { Textarea }\n","import { Textarea as TextareaBaseUI } from \"../../ui/textarea\"\nimport Label from \"../Label\"\n\nconst Textarea = ({\n onChange,\n label,\n field,\n readOnly,\n}: {\n onChange: (value: any) => void\n label: string\n field: any\n readOnly?: boolean\n}) => (\n <>\n <Label label={label} readOnly={field.readOnly || readOnly} />\n <div className=\"rounded-md border border-dashed border-lime-500 bg-lime-500/10 p-3\">\n <TextareaBaseUI\n placeholder={field.placeholder}\n onChange={(e) => onChange(e.currentTarget.value)}\n readOnly={field.readOnly || readOnly}\n />\n </div>\n </>\n)\n\nexport default Textarea\n","import { ReactNode, SyntheticEvent } from \"react\"\n\nconst Action = ({\n children,\n label,\n onClick,\n}: {\n children: ReactNode\n label?: string\n onClick: (e: SyntheticEvent) => void\n}) => (\n <button\n type=\"button\"\n className=\"hover:text-primary-500 mx-1 flex cursor-pointer items-center justify-center rounded border-none bg-transparent p-1.5 text-stone-700 transition-colors duration-50 hover:bg-stone-50\"\n onClick={onClick}\n title={label}\n >\n {children}\n </button>\n)\n\nconst Group = ({ children }: { children: ReactNode }) => (\n <div className=\"mx-2 flex h-full items-center first:ml-0 last:mr-0 empty:hidden [&>*]:m-0\">\n {children}\n </div>\n)\n\nconst Label = ({ label }: { label: string }) => (\n <div className=\"text-sm font-[var(--puck-font-family)] font-medium overflow-ellipsis whitespace-nowrap text-stone-700\">\n {label}\n </div>\n)\n\nconst Separator = () => <div className=\"h-full w-px bg-stone-300\" />\n\nconst ActionBar = ({\n label,\n parentAction,\n children,\n}: {\n label?: string\n parentAction?: ReactNode\n children?: ReactNode\n}) => (\n <div\n className=\"border-input flex w-auto items-center rounded-lg border bg-white p-2\"\n onClick={(e) => {\n e.stopPropagation()\n }}\n >\n {parentAction && (\n <>\n <ActionBar.Group>{parentAction}</ActionBar.Group>\n <ActionBar.Separator />\n </>\n )}\n {label && (\n <>\n <ActionBar.Group>\n <ActionBar.Label label={label} />\n </ActionBar.Group>\n <ActionBar.Separator />\n </>\n )}\n <ActionBar.Group>{children}</ActionBar.Group>\n </div>\n)\n\nActionBar.Action = Action\nActionBar.Label = Label\nActionBar.Group = Group\nActionBar.Separator = Separator\n\nexport default ActionBar\n","\"use client\"\n\nimport { createContext, useContext, useEffect, useRef, useState } from \"react\"\nimport { Tabs as TabsPrimitive } from \"@base-ui/react/tabs\"\n\nimport { cn } from \"../../lib/utils\"\n\ntype TabsVariant = \"segmented\" | \"underline\" | \"card\"\n\nfunction isValidVariant(variant: TabsVariant): variant is TabsVariant {\n return (\n variant === \"segmented\" || variant === \"underline\" || variant === \"card\"\n )\n}\n\ninterface TabsContextType {\n variant?: TabsVariant\n}\n\nconst TabsContext = createContext<TabsContextType>({\n variant: \"segmented\",\n})\n\nfunction useTabs() {\n const context = useContext(TabsContext)\n if (!context) {\n throw new Error(\"useTabs must be used within a Tabs component\")\n }\n return context\n}\n\ninterface TabsProps extends TabsPrimitive.Root.Props {\n variant?: TabsVariant\n}\n\nfunction Tabs({ className, variant = \"segmented\", ...props }: TabsProps) {\n const finalVariant = isValidVariant(variant) ? variant : \"segmented\"\n\n return (\n <TabsContext.Provider value={{ variant: finalVariant }}>\n <TabsPrimitive.Root\n data-slot=\"tabs\"\n className={cn(\n \"flex gap-2 data-[orientation=horizontal]:flex-col data-[orientation=vertical]:flex-row\",\n className\n )}\n {...props}\n />\n </TabsContext.Provider>\n )\n}\n\ninterface TabsListProps extends TabsPrimitive.List.Props {}\n\nfunction TabsList({ className, children, ...props }: TabsListProps) {\n const { variant } = useTabs()\n\n return (\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n className={cn(\n \"text-muted-foreground relative z-0 flex w-fit max-w-full items-center justify-start gap-x-0.5 data-[orientation=vertical]:flex-col max-sm:data-[orientation=horizontal]:overflow-x-auto max-sm:data-[orientation=horizontal]:overflow-y-hidden\",\n variant === \"segmented\" && \"bg-muted rounded-md p-1\",\n variant === \"underline\" &&\n \"data-[orientation=horizontal]:py-1 data-[orientation=vertical]:px-1\",\n variant === \"card\" && \"p-1\",\n className\n )}\n {...props}\n >\n {children}\n <TabsPrimitive.Indicator\n data-slot=\"tabs-indicator\"\n className={cn(\n \"absolute bottom-0 left-0 h-(--active-tab-height) w-(--active-tab-width) translate-x-(--active-tab-left) -translate-y-(--active-tab-bottom) transform-gpu transition-[translate,width] duration-200 ease-[cubic-bezier(.25,.46,.45,.94)] will-change-[translate,width]\",\n variant === \"segmented\" &&\n \"bg-card dark:bg-secondary border-border/10 -z-1 h-(--active-tab-height) rounded-sm border shadow-sm\",\n variant === \"underline\" &&\n \"bg-primary z-10 data-[orientation=horizontal]:h-0.5 data-[orientation=horizontal]:translate-y-[1.3px] data-[orientation=vertical]:w-0.5 data-[orientation=vertical]:-translate-x-px\",\n variant === \"card\" &&\n \"bg-secondary border-border/10 -z-1 rounded-sm border\"\n )}\n />\n </TabsPrimitive.List>\n )\n}\n\ninterface TabsTriggerProps extends TabsPrimitive.Tab.Props {}\n\nfunction TabsTrigger({ className, ...props }: TabsTriggerProps) {\n const { variant } = useTabs()\n\n return (\n <TabsPrimitive.Tab\n data-slot=\"tabs-trigger\"\n className={cn(\n \"text-secondary-foreground/66 data-active:text-foreground hover:text-foreground flex shrink-0 cursor-pointer items-center justify-center gap-2 px-3 py-1 text-sm font-medium break-keep whitespace-nowrap [transition-property:color] duration-200 ease-[cubic-bezier(.25,.46,.45,.94)] outline-none data-[orientation=vertical]:w-full [&_svg]:size-4 [&_svg]:shrink-0\",\n variant === \"segmented\" && \"rounded-md\",\n variant === \"underline\" &&\n \"data-[orientation=horizontal]:py-1.5 data-[orientation=vertical]:items-start data-[orientation=vertical]:justify-start data-[orientation=vertical]:px-2\",\n variant === \"card\" && \"rounded-md\",\n className\n )}\n {...props}\n />\n )\n}\n\ninterface TabsPanelWrapperProps {\n children: React.ReactNode\n}\n\nfunction TabsPanelsWrapper({ children }: TabsPanelWrapperProps) {\n const contentContainerRef = useRef<HTMLDivElement>(null)\n const [height, setHeight] = useState(0)\n\n useEffect(() => {\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const rect = entry.target.getBoundingClientRect()\n\n setHeight(rect.height)\n }\n })\n\n if (contentContainerRef.current) {\n resizeObserver.observe(contentContainerRef.current)\n }\n\n return () => {\n if (contentContainerRef.current) {\n resizeObserver.disconnect()\n }\n }\n }, [])\n\n return (\n <div\n className=\"relative overflow-hidden [transition-property:height] duration-200 ease-[cubic-bezier(.25,.46,.45,.94)]\"\n style={{ height: height ?? null }}\n >\n <div data-slot=\"tabs-panel-wrapper\" ref={contentContainerRef}>\n {children}\n </div>\n </div>\n )\n}\n\ninterface TabsPanelProps extends TabsPrimitive.Panel.Props {}\n\nfunction TabsPanel({ className, ...props }: TabsPanelProps) {\n return (\n <TabsPrimitive.Panel\n data-slot=\"tabs-panel\"\n className={cn(className)}\n {...props}\n />\n )\n}\n\nexport { Tabs, TabsList, TabsTrigger, TabsPanelsWrapper, TabsPanel }\n","\"use client\"\n\nimport React, {\n createContext,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\"\nimport { Accordion as AccordionPrimitive } from \"@base-ui/react/accordion\"\n\nimport { cn } from \"../../lib/utils\"\nimport { ChevronDownIcon } from \"lucide-react\"\n\nconst cssAnimationPresets = {\n none: \"transition-none\",\n fade: [\n `[transition-property:opacity,height] [will-change:opacity,height]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 data-starting-style:h-0 data-ending-style:h-0`,\n ],\n scale: [\n `[transition-property:scale,opacity,height] [will-change:scale,opacity,height] origin-left`,\n `data-starting-style:scale-85 data-starting-style:opacity-0 data-starting-style:h-0 data-ending-style:opacity-0 data-ending-style:h-0 data-ending-style:scale-85`,\n ],\n slide: [\n `[transition-property:translate,opacity,height] [will-change:translate,opacity,height]`,\n `data-starting-style:opacity-0 data-starting-style:translate-y-[10px] data-ending-style:translate-y-[10px] data-ending-style:opacity-0 data-ending-style:h-0 data-starting-style:h-0`,\n ],\n perspective: [\n `[transition-property:opacity,rotateX,rotateY,transform,height] [will-change:opacity,rotateX,rotateY,transform,height]`,\n `[transform:perspective(1000px)] origin-top`,\n `data-starting-style:h-0 data-ending-style:h-0`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0`,\n `data-starting-style:-rotate-x-[90deg] data-ending-style:-rotate-x-[90deg]`,\n ],\n perspectiveBlur: [\n `[transition-property:opacity,rotateX,rotateY,transform,height,filter] [will-change:opacity,rotateX,rotateY,transform,height,filter]`,\n `[transform:perspective(1000px)] origin-top`,\n `data-starting-style:h-0 data-ending-style:h-0`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0`,\n `data-starting-style:-rotate-x-[90deg] data-ending-style:-rotate-x-[90deg]`,\n `data-starting-style:blur-[9px] data-ending-style:blur-[9px]`,\n ],\n}\n\nconst cssTransitionPresets = {\n inExpo: `duration-[0.35s] ease-[cubic-bezier(0.95,0.05,0.795,0.035)]`,\n outExpo: `duration-[0.35s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n inOutExpo: `duration-[0.35s] ease-[cubic-bezier(1,0,0,1)]`,\n anticipate: `duration-[0.35s] ease-[cubic-bezier(1,-0.4,0.35,0.95)]`,\n quickOut: `duration-[0.35s] ease-out`,\n overshootOut: `duration-[0.35s] ease-[cubic-bezier(0.175,0.885,0.32,1.275)]`,\n swiftOut: `duration-[0.35s] ease-[cubic-bezier(0.175,0.885,0.32,1.1)]`,\n snappyOut: `duration-[0.35s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n in: `duration-[0.35s] ease-[cubic-bezier(0.42,0,1,1)]`,\n out: `duration-[0.35s] ease-[cubic-bezier(0,0,0.58,1)]`,\n inOut: `duration-[0.25s] ease-[cubic-bezier(0.42,0,0.58,1)]`,\n outIn: `duration-[0.35s] ease-[cubic-bezier(0.1,0.7,0.9,0.5)]`,\n inQuad: `duration-[0.35s] ease-[cubic-bezier(0.55,0.085,0.68,0.53)]`,\n outQuad: `duration-[0.25s] ease-[cubic-bezier(0.25,0.46,0.45,0.94)]`,\n inOutQuad: `duration-[0.32s] ease-[cubic-bezier(0.455,0.03,0.515,0.955)]`,\n inCubic: `duration-[0.35s] ease-[cubic-bezier(0.55,0.055,0.675,0.19)]`,\n outCubic: `duration-[0.35s] ease-[cubic-bezier(0.215,0.61,0.355,1)]`,\n inOutCubic: `duration-[0.35s] ease-[cubic-bezier(0.645,0.045,0.355,1)]`,\n inQuart: `duration-[0.35s] ease-[cubic-bezier(0.895,0.03,0.685,0.22)]`,\n outQuart: `duration-[0.35s] ease-[cubic-bezier(0.165,0.84,0.44,1)]`,\n inOutQuart: `duration-[0.35s] ease-[cubic-bezier(0.77,0,0.175,1)]`,\n inQuint: `duration-[0.35s] ease-[cubic-bezier(0.755,0.05,0.855,0.06)]`,\n outQuint: `duration-[0.35s] ease-[cubic-bezier(0.23,1,0.32,1)]`,\n inOutQuint: `duration-[0.35s] ease-[cubic-bezier(0.86,0,0.07,1)]`,\n inCirc: `duration-[0.35s] ease-[cubic-bezier(0.6,0.04,0.98,0.335)]`,\n outCirc: `duration-[0.35s] ease-[cubic-bezier(0.075,0.82,0.165,1)]`,\n inOutCirc: `duration-[0.35s] ease-[cubic-bezier(0.785,0.135,0.15,0.86)]`,\n inOutBase: `duration-[0.35s] ease-[cubic-bezier(0.25,0.1,0.25,1)]`,\n}\n\ntype CSSAnimationPreset = keyof typeof cssAnimationPresets\ntype CSSTransitionPreset = keyof typeof cssTransitionPresets\n\ntype AccordionVariant = \"default\" | \"card\" | \"swiss\"\n\ninterface AccordionContextType {\n animationPreset?: CSSAnimationPreset\n transitionPreset?: CSSTransitionPreset\n reduceMotion?: boolean\n value: AccordionProps[\"value\"]\n onValueChange: AccordionProps[\"onValueChange\"]\n variant?: AccordionVariant\n}\n\nconst AccordionContext = createContext<AccordionContextType | undefined>(\n undefined\n)\n\nfunction useAccordion() {\n const context = useContext(AccordionContext)\n if (!context) {\n throw new Error(\"useAccordion must be used within a AccordionProvider\")\n }\n return context\n}\n\ninterface AccordionProps extends AccordionPrimitive.Root.Props {\n animationPreset?: CSSAnimationPreset\n transitionPreset?: CSSTransitionPreset\n reduceMotion?: boolean\n variant?: AccordionVariant\n}\n\nfunction Accordion({\n value,\n defaultValue,\n onValueChange,\n animationPreset = \"fade\",\n transitionPreset = \"outQuad\",\n reduceMotion,\n variant = \"default\",\n className,\n multiple = false,\n ...props\n}: AccordionProps) {\n const [accordionValue, setAccordionValue] = useState(\n value ?? defaultValue ?? []\n )\n\n const handleValueChange: AccordionProps[\"onValueChange\"] = (\n value,\n eventDetails\n ) => {\n setAccordionValue(value)\n onValueChange?.(value, eventDetails)\n }\n\n return (\n <AccordionContext.Provider\n value={{\n value: accordionValue,\n onValueChange: handleValueChange,\n animationPreset,\n transitionPreset,\n reduceMotion,\n variant,\n }}\n >\n <AccordionPrimitive.Root\n data-slot=\"accordion\"\n value={accordionValue}\n onValueChange={handleValueChange}\n multiple={multiple}\n className={cn(\n \"w-full\",\n variant === \"default\" &&\n \"flex flex-col rounded-2xl border outline-hidden\",\n variant === \"card\" && \"flex flex-col gap-1.5\",\n variant === \"swiss\" && \"rounded-2xl\",\n className\n )}\n {...props}\n />\n </AccordionContext.Provider>\n )\n}\n\ninterface AccordionItemContextType {\n open: boolean\n onOpenChange: AccordionItemProps[\"onOpenChange\"]\n variant?: AccordionVariant\n}\n\nconst AccordionItemContext = createContext<\n AccordionItemContextType | undefined\n>(undefined)\n\nfunction useAccordionItem() {\n const context = useContext(AccordionItemContext)\n if (!context) {\n throw new Error(\n \"useAccordionItem must be used within a AccordionItemProvider\"\n )\n }\n return context\n}\n\ninterface AccordionItemProps extends AccordionPrimitive.Item.Props {}\n\nfunction AccordionItem({\n value: itemValue,\n onOpenChange,\n className,\n ...rest\n}: AccordionItemProps) {\n const { value, variant = \"default\" } = useAccordion()\n\n const [isOpen, setIsOpen] = useState(value?.includes(itemValue) ?? false)\n\n useEffect(() => {\n setIsOpen(value?.includes(itemValue) ?? false)\n }, [value, itemValue])\n\n const handleItemOpenChange: AccordionItemProps[\"onOpenChange\"] = (\n open,\n eventDetails\n ) => {\n setIsOpen(open)\n onOpenChange?.(open, eventDetails)\n }\n\n return (\n <AccordionItemContext.Provider\n value={{\n open: isOpen,\n onOpenChange: handleItemOpenChange,\n variant,\n }}\n >\n <AccordionPrimitive.Item\n data-slot=\"accordion-item\"\n value={itemValue}\n onOpenChange={handleItemOpenChange}\n className={cn(\n \"w-full outline-hidden contain-layout\",\n // Base transitions - smooth all property changes\n `[transition-property:border-radius,margin,border] duration-260 ease-[cubic-bezier(0.215,0.61,0.355,1)] will-change-[border-radius,margin,border]`,\n \"focus-within:relative focus-within:z-2\",\n variant === \"default\" &&\n \"border-border bg-card border-b first:rounded-t-2xl last:rounded-b-2xl last:border-b-0\",\n variant === \"card\" && \"rounded-[14px] border p-1\",\n variant === \"swiss\" && [\n \"bg-popover border-border/60 relative overflow-hidden border-x\",\n\n // Base state - closed items\n \"data-closed:border-border/60 data-closed:border-b\",\n\n // First and last items\n \"first:border-border/60 first:rounded-t-2xl first:border-t\",\n \"last:border-border/60 last:rounded-b-2xl last:border-b\",\n\n // Open state - full rounded with margins\n \"data-open:border-primary/70 data-open:z-2 data-open:rounded-2xl data-open:border\",\n \"data-open:my-6 data-open:first:mt-0 data-open:last:mb-0\",\n\n // Item before open item - gets bottom rounded corners\n \"has-[+_[data-slot='accordion-item'][data-open]]:rounded-b-2xl\",\n \"has-[+_[data-slot='accordion-item'][data-open]]:border-b!\",\n \"has-[+_[data-slot='accordion-item'][data-open]]:border-border/60\",\n\n // Item after open item - gets top rounded corners\n \"data-open:[&+[data-slot='accordion-item']]:rounded-t-2xl\",\n \"data-open:[&+[data-slot='accordion-item'][data-closed]]:border-t\",\n \"data-open:[&+[data-slot='accordion-item']]:border-border/60\",\n\n // Remove middle borders between closed items\n \"data-closed:first:border-t\",\n \"data-closed:last:border-b\",\n ],\n className\n )}\n {...rest}\n />\n </AccordionItemContext.Provider>\n )\n}\n\ninterface AccordionHeaderProps extends AccordionPrimitive.Header.Props {}\n\nfunction AccordionHeader({ className, ...props }: AccordionHeaderProps) {\n return (\n <AccordionPrimitive.Header\n data-slot=\"accordion-header\"\n className={cn(className)}\n {...props}\n />\n )\n}\n\ninterface AccordionTriggerProps extends AccordionPrimitive.Trigger.Props {\n icon?: (props: { open: boolean }) => React.ReactNode\n}\n\nfunction AccordionTrigger({\n className,\n icon,\n children,\n ...props\n}: AccordionTriggerProps) {\n const { open, variant = \"default\" } = useAccordionItem()\n\n return (\n <AccordionHeader className=\"flex\">\n <AccordionPrimitive.Trigger\n data-slot=\"accordion-trigger\"\n className={cn(\n \"flex w-full cursor-pointer items-center px-4 py-3 text-left text-sm\",\n \"[transition-property:background-color,border-radius] duration-200 ease-[cubic-bezier(0.215,0.61,0.355,1)] will-change-[background-color,border-radius]\",\n `focus-visible:bg-accent not-data-panel-open:dark:hover:bg-accent dark:focus-visible:bg-accent focus-visible:outline-ring focus-visible:outline-2 data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50`,\n variant === \"card\" && [\n `not-data-panel-open:bg-secondary/80 data-panel-open:bg-secondary/80 rounded-lg data-panel-open:rounded-b-none`,\n ],\n className\n )}\n {...props}\n >\n {children}\n\n <span className=\"ml-auto\">\n <ChevronDownIcon\n className={cn(\n \"h-4 w-4 transition-transform duration-200\",\n open ? \"rotate-180\" : \"\"\n )}\n />\n </span>\n </AccordionPrimitive.Trigger>\n </AccordionHeader>\n )\n}\n\ninterface AccordionPanelProps extends AccordionPrimitive.Panel.Props {}\n\nfunction AccordionPanel({\n className,\n children,\n style,\n ...props\n}: AccordionPanelProps) {\n const {\n variant = \"default\",\n animationPreset = \"fade\",\n transitionPreset = \"snappyOut\",\n reduceMotion = false,\n } = useAccordion()\n\n const cssAnimationConfig = useMemo(() => {\n if (reduceMotion) return cssAnimationPresets.none\n\n if (animationPreset) {\n return cssAnimationPresets[animationPreset]\n }\n\n return cssAnimationPresets.fade\n }, [animationPreset, reduceMotion])\n\n const cssTransitionConfig = useMemo(() => {\n if (reduceMotion) return \"\"\n\n if (transitionPreset) {\n return cssTransitionPresets[transitionPreset]\n }\n\n return cssTransitionPresets.inOutExpo\n }, [transitionPreset, reduceMotion])\n\n return (\n <AccordionPrimitive.Panel\n data-slot=\"accordion-panel\"\n className={cn(\n \"h-(--accordion-panel-height) overflow-hidden text-sm\",\n cssAnimationConfig,\n cssTransitionConfig,\n className\n )}\n style={{\n willChange: \"height, opacity, transform\",\n ...style,\n }}\n {...props}\n >\n <div\n data-slot=\"accordion-panel-content\"\n className={cn(variant === \"default\" ? \"p-0\" : \"p-3 pl-4\")}\n >\n {children}\n </div>\n </AccordionPrimitive.Panel>\n )\n}\n\nexport {\n Accordion,\n AccordionItem,\n AccordionHeader,\n AccordionTrigger,\n AccordionPanel,\n}\n","import React, { useMemo, Children, isValidElement, cloneElement } from \"react\"\nimport { createUsePuck } from \"@measured/puck\"\nimport {\n Tabs,\n TabsList,\n TabsTrigger,\n TabsPanel,\n TabsPanelsWrapper,\n} from \"../ui/tabs\"\nimport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionPanel,\n} from \"../ui/accordion\"\n\n// Create typed usePuck hook with selector support\nconst usePuck = createUsePuck()\n\ntype ItemSelector = {\n path?: string\n index?: number\n}\n\ntype FieldGroupsProps = {\n children: React.ReactNode\n isLoading: boolean\n itemSelector?: ItemSelector | null\n}\n\n// Accordion configuration\ntype AccordionConfig = {\n title: string\n fields: string[]\n defaultExpanded?: boolean\n}\n\n// Tab configuration - can have direct accordion or nested accordions\ntype TabConfig = {\n title: string\n accordions: AccordionConfig | Record<string, AccordionConfig>\n}\n\n// Tabs configuration\ntype TabsConfig = Record<string, TabConfig>\n\n// Helper to check if accordions is a single accordion (has fields property)\nconst isSingleAccordion = (\n accordions: AccordionConfig | Record<string, AccordionConfig>\n): accordions is AccordionConfig => {\n return \"fields\" in accordions && Array.isArray(accordions.fields)\n}\n\nconst FieldGroups = ({ children }: FieldGroupsProps) => {\n // Use selectors to only subscribe to the specific data we need\n const config = usePuck((s) => s.config)\n const selectedItem = usePuck((s) => s.selectedItem)\n\n // Get the component config and tabs configuration\n const componentConfig = useMemo(() => {\n if (!selectedItem?.type) return null\n return config.components?.[selectedItem.type] || null\n }, [config, selectedItem])\n\n const tabsConfig = useMemo(() => {\n if (!componentConfig) return null\n const configWithTabs = componentConfig as any\n if (!configWithTabs.tabs) return null\n return configWithTabs.tabs as TabsConfig\n }, [componentConfig])\n\n // Create a map of field names to their location (tab and accordion)\n const fieldToLocationMap = useMemo(() => {\n const map = new Map<string, { tab: string; accordion: string }>()\n\n if (!tabsConfig) return map\n\n Object.entries(tabsConfig).forEach(([tabKey, tabConfig]) => {\n const { accordions } = tabConfig\n\n if (isSingleAccordion(accordions)) {\n // Single accordion case - use tab key as accordion key\n accordions.fields.forEach((fieldName) => {\n map.set(fieldName, {\n tab: tabKey,\n accordion: tabKey, // Use tab key for single accordion\n })\n })\n } else {\n // Multiple accordions case\n Object.entries(accordions).forEach(\n ([accordionKey, accordionConfig]) => {\n if (accordionConfig?.fields) {\n accordionConfig.fields.forEach((fieldName) => {\n map.set(fieldName, {\n tab: tabKey,\n accordion: accordionKey,\n })\n })\n }\n }\n )\n }\n })\n\n return map\n }, [tabsConfig])\n\n // Organize children by tabs and accordions\n const organizedChildren = useMemo(() => {\n const childArray = Children.toArray(children)\n type OrganizedStructure = Record<\n string,\n Record<string, React.ReactNode[]>\n >\n const result: OrganizedStructure = {}\n\n if (!tabsConfig) {\n return {\n __ungrouped: { default: childArray },\n } as OrganizedStructure\n }\n\n // Initialize structure for tabs and accordions\n Object.entries(tabsConfig).forEach(([tabKey, tabConfig]) => {\n result[tabKey] = {}\n const { accordions } = tabConfig\n\n if (isSingleAccordion(accordions)) {\n // Single accordion - use tab key as accordion key\n result[tabKey][tabKey] = []\n } else {\n // Multiple accordions\n Object.keys(accordions).forEach((accordionKey) => {\n result[tabKey][accordionKey] = []\n })\n }\n })\n\n const ungrouped: React.ReactNode[] = []\n\n // Organize children into their respective locations\n childArray.forEach((child) => {\n if (!isValidElement(child)) {\n ungrouped.push(child)\n return\n }\n\n // Try to extract field name from various sources\n const props = child.props as any\n let fieldName: string | null = null\n\n // Check different possible locations for field name\n if (props?.field) fieldName = props.field\n else if (props?.name) fieldName = props.name\n else if (props?.id) fieldName = props.id\n else if (child.key && typeof child.key === \"string\") {\n fieldName = child.key.replace(/^\\.\\$?/, \"\")\n }\n\n // If we found a field name, try to match it to a location\n if (fieldName) {\n const location = fieldToLocationMap.get(fieldName)\n if (location) {\n const newProps = {\n ...(child.props || {}),\n \"data-field-name\": fieldName,\n \"data-tab\": location.tab,\n \"data-accordion\": location.accordion,\n }\n const enhancedChild = cloneElement(child, newProps as any)\n\n if (!result[location.tab]) result[location.tab] = {}\n if (!result[location.tab][location.accordion])\n result[location.tab][location.accordion] = []\n result[location.tab][location.accordion].push(enhancedChild)\n return\n }\n }\n\n // If not matched to any location, add to ungrouped\n ungrouped.push(child)\n })\n\n return {\n ...result,\n __ungrouped: { default: ungrouped },\n } as OrganizedStructure\n }, [children, tabsConfig, fieldToLocationMap])\n\n // Get the first tab as default\n const defaultTab = useMemo(() => {\n if (!tabsConfig) return \"ungrouped\"\n return Object.keys(tabsConfig)[0] || \"ungrouped\"\n }, [tabsConfig])\n\n // Check if we have organized content\n const hasOrganizedFields = useMemo(() => {\n if (!tabsConfig) return false\n\n return Object.keys(tabsConfig).some((tabKey) => {\n const tabContent = organizedChildren[tabKey]\n if (!tabContent || typeof tabContent !== \"object\") return false\n return Object.keys(tabContent).some(\n (accordionKey) =>\n Array.isArray(tabContent[accordionKey]) &&\n tabContent[accordionKey].length > 0\n )\n })\n }, [tabsConfig, organizedChildren])\n\n // If no tabs configuration, render children as-is\n if (!tabsConfig) {\n return <div className=\"space-y-4\">{children}</div>\n }\n\n // If no fields were matched to tabs, render children as-is\n if (!hasOrganizedFields) {\n return <div className=\"space-y-4\">{children}</div>\n }\n\n // Render tabs with accordions\n return (\n <div className=\"puck-field-groups\">\n <Tabs defaultValue={defaultTab}>\n <div className=\"px-2 pt-2\">\n <TabsList className=\"bg-muted w-full justify-center p-1.5\">\n {Object.entries(tabsConfig).map(\n ([tabKey, tabConfig]) => {\n const tabContent = organizedChildren[tabKey]\n if (\n !tabContent ||\n typeof tabContent !== \"object\"\n )\n return null\n\n // Check if tab has any fields\n const hasFields = Object.keys(tabContent).some(\n (accordionKey) =>\n Array.isArray(\n tabContent[accordionKey]\n ) && tabContent[accordionKey].length > 0\n )\n if (!hasFields) return null\n\n return (\n <TabsTrigger\n key={tabKey}\n value={tabKey}\n className=\"flex-1\"\n >\n {tabConfig.title}\n </TabsTrigger>\n )\n }\n )}\n </TabsList>\n </div>\n <TabsPanelsWrapper>\n {Object.entries(tabsConfig).map(([tabKey, tabConfig]) => {\n const tabContent = organizedChildren[tabKey]\n if (!tabContent || typeof tabContent !== \"object\")\n return null\n\n const { accordions } = tabConfig\n\n // Handle single accordion case\n if (isSingleAccordion(accordions)) {\n const fields = tabContent[tabKey]\n if (\n !fields ||\n !Array.isArray(fields) ||\n fields.length === 0\n )\n return null\n\n return (\n <TabsPanel key={tabKey} value={tabKey}>\n <Accordion\n defaultValue={\n accordions.defaultExpanded\n ? [tabKey]\n : []\n }\n className=\"rounded-none border-none\"\n >\n <AccordionItem value={tabKey}>\n <AccordionTrigger>\n {accordions.title}\n </AccordionTrigger>\n <AccordionPanel className=\"p-0\">\n <div className=\"space-y-4\">\n {fields}\n </div>\n </AccordionPanel>\n </AccordionItem>\n </Accordion>\n </TabsPanel>\n )\n }\n\n // Handle multiple accordions case\n const accordionsRecord = accordions as Record<\n string,\n AccordionConfig\n >\n\n // Get default expanded accordions\n const defaultExpandedAccordions = Object.entries(\n accordionsRecord\n )\n .filter(\n ([, accordionConfig]) =>\n accordionConfig?.defaultExpanded\n )\n .map(([accordionKey]) => accordionKey)\n\n return (\n <TabsPanel key={tabKey} value={tabKey}>\n <Accordion\n multiple\n defaultValue={defaultExpandedAccordions}\n className=\"rounded-none border-none\"\n >\n {Object.entries(accordionsRecord).map(\n ([accordionKey, accordionConfig]) => {\n const fields =\n tabContent[accordionKey]\n if (\n !fields ||\n !Array.isArray(fields) ||\n fields.length === 0\n )\n return null\n\n return (\n <AccordionItem\n key={accordionKey}\n value={accordionKey}\n >\n <AccordionTrigger>\n {accordionConfig.title}\n </AccordionTrigger>\n <AccordionPanel className=\"p-0\">\n <div className=\"space-y-4\">\n {fields}\n </div>\n </AccordionPanel>\n </AccordionItem>\n )\n }\n )}\n </Accordion>\n </TabsPanel>\n )\n })}\n </TabsPanelsWrapper>\n </Tabs>\n\n {/* Render ungrouped fields below tabs */}\n {organizedChildren[\"__ungrouped\"]?.default &&\n Array.isArray(organizedChildren[\"__ungrouped\"].default) &&\n organizedChildren[\"__ungrouped\"].default.length > 0 && (\n <div className=\"mt-4 space-y-4 border-t pt-4\">\n {organizedChildren[\"__ungrouped\"].default}\n </div>\n )}\n </div>\n )\n}\n\nexport default FieldGroups\n","\"use client\"\n\nimport { useMemo } from \"react\"\nimport { Tooltip as TooltipPrimitive } from \"@base-ui/react/tooltip\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst cssAnimationPresets = {\n none: \"transition-none\",\n scale: [\n `[transition-property:scale,opacity]`,\n `data-starting-style:scale-80 data-starting-style:opacity-0 data-ending-style:opacity-0 data-ending-style:scale-80`,\n ],\n fade: [\n `[transition-property:opacity,scale]`,\n `data-starting-style:scale-98 data-starting-style:opacity-0 data-ending-style:opacity-0 data-ending-style:scale-98`,\n ],\n slideOutside: [\n `[transition-property:translate,opacity]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:translate-y-[10px] data-[side=bottom]:data-ending-style:translate-y-[10px] data-[side=bottom]:data-ending-style:opacity-0`,\n // side=top\n `data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:translate-y-[-10px] data-[side=top]:data-ending-style:translate-y-[-10px] data-[side=top]:data-ending-style:opacity-0`,\n // side=left\n `data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:translate-x-[-10px] data-[side=left]:data-ending-style:translate-x-[-10px] data-[side=left]:data-ending-style:opacity-0`,\n // side=right\n `data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:translate-x-[10px] data-[side=right]:data-ending-style:translate-x-[10px] data-[side=right]:data-ending-style:opacity-0`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:translate-x-[-10px] data-[side=inline-start]:data-ending-style:translate-x-[-10px] data-[side=inline-start]:data-ending-style:opacity-0`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:translate-x-[10px] data-[side=inline-end]:data-ending-style:translate-x-[10px] data-[side=inline-end]:data-ending-style:opacity-0`,\n ],\n slideInside: [\n `[transition-property:translate,opacity]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:translate-y-[-10px] data-[side=bottom]:data-ending-style:translate-y-[-10px] data-[side=bottom]:data-ending-style:opacity-0`,\n // side=top\n `data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:translate-y-[10px] data-[side=top]:data-ending-style:translate-y-[10px] data-[side=top]:data-ending-style:opacity-0`,\n // side=left\n `data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:translate-x-[10px] data-[side=left]:data-ending-style:translate-x-[10px] data-[side=left]:data-ending-style:opacity-0`,\n // side=right\n `data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:translate-x-[-10px] data-[side=right]:data-ending-style:translate-x-[-10px] data-[side=right]:data-ending-style:opacity-0`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:translate-x-[10px] data-[side=inline-start]:data-ending-style:translate-x-[10px] data-[side=inline-start]:data-ending-style:opacity-0`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:translate-x-[-10px] data-[side=inline-end]:data-ending-style:translate-x-[-10px] data-[side=inline-end]:data-ending-style:opacity-0`,\n ],\n wipe: [\n `[transition-property:clip-path] [will-change:clip-path]`,\n `[clip-path:inset(0_0_0_0_round_var(--radius))] [-webkit-clip-path:inset(0_0_0_0_round_var(--radius))]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:[clip-path:inset(0_0_100%_0_round_var(--radius))] data-[side=bottom]:data-ending-style:[clip-path:inset(0_0_100%_0_round_var(--radius))]`,\n // side=top\n `data-[side=top]:data-starting-style:[clip-path:inset(100%_0_0_0_round_var(--radius))] data-[side=top]:data-ending-style:[clip-path:inset(100%_0_0_0_round_var(--radius))]`,\n // side=left\n `data-[side=left]:data-starting-style:[clip-path:inset(0_0_0_100%_round_var(--radius))] data-[side=left]:data-ending-style:[clip-path:inset(0_0_0_100%_round_var(--radius))]`,\n // side=right\n `data-[side=right]:data-starting-style:[clip-path:inset(0_100%_0_0_round_var(--radius))] data-[side=right]:data-ending-style:[clip-path:inset(0_100%_0_0_round_var(--radius))]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:[clip-path:inset(0_0_0_100%_round_var(--radius))] data-[side=inline-start]:data-ending-style:[clip-path:inset(0_0_0_100%_round_var(--radius))]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:[clip-path:inset(0_100%_0_0_round_var(--radius))] data-[side=inline-end]:data-ending-style:[clip-path:inset(0_100%_0_0_round_var(--radius))]`,\n ],\n wipeScale: [\n `[transition-property:clip-path,scale] [will-change:clip-path,scale]`,\n `[clip-path:inset(0_0_0_0_round_var(--radius))] [-webkit-clip-path:inset(0_0_0_0_round_var(--radius))]`,\n `data-starting-style:scale-80 data-ending-style:scale-80`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:[clip-path:inset(0_0_100%_0_round_var(--radius))] data-[side=bottom]:data-ending-style:[clip-path:inset(0_0_100%_0_round_var(--radius))]`,\n // side=top\n `data-[side=top]:data-starting-style:[clip-path:inset(100%_0_0_0_round_var(--radius))] data-[side=top]:data-ending-style:[clip-path:inset(100%_0_0_0_round_var(--radius))]`,\n // side=left\n `data-[side=left]:data-starting-style:[clip-path:inset(0_0_0_100%_round_var(--radius))] data-[side=left]:data-ending-style:[clip-path:inset(0_0_0_100%_round_var(--radius))]`,\n // side=right\n `data-[side=right]:data-starting-style:[clip-path:inset(0_100%_0_0_round_var(--radius))] data-[side=right]:data-ending-style:[clip-path:inset(0_100%_0_0_round_var(--radius))]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:[clip-path:inset(0_0_0_100%_round_var(--radius))] data-[side=inline-start]:data-ending-style:[clip-path:inset(0_0_0_100%_round_var(--radius))]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:[clip-path:inset(0_100%_0_0_round_var(--radius))] data-[side=inline-end]:data-ending-style:[clip-path:inset(0_100%_0_0_round_var(--radius))]`,\n ],\n motion: [\n `[transition-property:translate,scale,opacity,rotateX,rotateY,transform] [will-change:translate,scale,opacity,rotateX,rotateY,transform]`,\n `[transform:perspective(1000px)]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:translate-y-[7px] data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:scale-[0.26] data-[side=bottom]:data-starting-style:rotate-x-[70deg] data-[side=bottom]:data-ending-style:translate-y-[7px] data-[side=bottom]:data-ending-style:opacity-0 data-[side=bottom]:data-ending-style:scale-[0.26] data-[side=bottom]:data-ending-style:rotate-x-[70deg]`,\n // side=top\n `data-[side=top]:data-starting-style:translate-y-[7px] data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:scale-[0.26] data-[side=top]:data-starting-style:rotate-x-[70deg] data-[side=top]:data-ending-style:translate-y-[7px] data-[side=top]:data-ending-style:opacity-0 data-[side=top]:data-ending-style:scale-[0.26] data-[side=top]:data-ending-style:rotate-x-[70deg]`,\n // side=left\n `data-[side=left]:data-starting-style:translate-x-[-7px] data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:scale-[0.26] data-[side=left]:data-starting-style:rotate-y-[-40deg] data-[side=left]:data-ending-style:translate-x-[-7px] data-[side=left]:data-ending-style:opacity-0 data-[side=left]:data-ending-style:scale-[0.26] data-[side=left]:data-ending-style:rotate-y-[-40deg]`,\n // side=right\n `data-[side=right]:data-starting-style:translate-x-[7px] data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:scale-[0.26] data-[side=right]:data-starting-style:rotate-y-[40deg] data-[side=right]:data-ending-style:translate-x-[7px] data-[side=right]:data-ending-style:opacity-0 data-[side=right]:data-ending-style:scale-[0.26] data-[side=right]:data-ending-style:rotate-y-[40deg]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:translate-x-[-7px] data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:scale-[0.26] data-[side=inline-start]:data-starting-style:rotate-y-[-40deg] data-[side=inline-start]:data-ending-style:translate-x-[-7px] data-[side=inline-start]:data-ending-style:opacity-0 data-[side=inline-start]:data-ending-style:scale-[0.26] data-[side=inline-start]:data-ending-style:rotate-y-[-40deg]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:translate-x-[7px] data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:scale-[0.26] data-[side=inline-end]:data-starting-style:rotate-y-[40deg] data-[side=inline-end]:data-ending-style:translate-x-[7px] data-[side=inline-end]:data-ending-style:opacity-0 data-[side=inline-end]:data-ending-style:scale-[0.26] data-[side=inline-end]:data-ending-style:rotate-y-[40deg]`,\n ],\n motionBlur: [\n `[transition-property:translate,scale,opacity,rotateX,rotateY,transform,filter] [will-change:translate,scale,opacity,rotateX,rotateY,transform,filter]`,\n `[transform:perspective(1000px)]`,\n `data-starting-style:blur-[9px] data-ending-style:blur-[9px]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:translate-y-[7px] data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:scale-[0.26] data-[side=bottom]:data-starting-style:rotate-x-[70deg] data-[side=bottom]:data-ending-style:translate-y-[7px] data-[side=bottom]:data-ending-style:opacity-0 data-[side=bottom]:data-ending-style:scale-[0.26] data-[side=bottom]:data-ending-style:rotate-x-[70deg]`,\n // side=top\n `data-[side=top]:data-starting-style:translate-y-[7px] data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:scale-[0.26] data-[side=top]:data-starting-style:rotate-x-[70deg] data-[side=top]:data-ending-style:translate-y-[7px] data-[side=top]:data-ending-style:opacity-0 data-[side=top]:data-ending-style:scale-[0.26] data-[side=top]:data-ending-style:rotate-x-[70deg]`,\n // side=left\n `data-[side=left]:data-starting-style:translate-x-[-7px] data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:scale-[0.26] data-[side=left]:data-starting-style:rotate-y-[-40deg] data-[side=left]:data-ending-style:translate-x-[-7px] data-[side=left]:data-ending-style:opacity-0 data-[side=left]:data-ending-style:scale-[0.26] data-[side=left]:data-ending-style:rotate-y-[-40deg]`,\n // side=right\n `data-[side=right]:data-starting-style:translate-x-[7px] data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:scale-[0.26] data-[side=right]:data-starting-style:rotate-y-[40deg] data-[side=right]:data-ending-style:translate-x-[7px] data-[side=right]:data-ending-style:opacity-0 data-[side=right]:data-ending-style:scale-[0.26] data-[side=right]:data-ending-style:rotate-y-[40deg]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:translate-x-[-7px] data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:scale-[0.26] data-[side=inline-start]:data-starting-style:rotate-y-[-40deg] data-[side=inline-start]:data-ending-style:translate-x-[-7px] data-[side=inline-start]:data-ending-style:opacity-0 data-[side=inline-start]:data-ending-style:scale-[0.26] data-[side=inline-start]:data-ending-style:rotate-y-[-40deg]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:translate-x-[7px] data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:scale-[0.26] data-[side=inline-end]:data-starting-style:rotate-y-[40deg] data-[side=inline-end]:data-ending-style:translate-x-[7px] data-[side=inline-end]:data-ending-style:opacity-0 data-[side=inline-end]:data-ending-style:scale-[0.26] data-[side=inline-end]:data-ending-style:rotate-y-[40deg]`,\n ],\n}\n\nconst cssTransitionPresets = {\n inExpo: `duration-[0.25s] ease-[cubic-bezier(0.95,0.05,0.795,0.035)]`,\n outExpo: `duration-[0.25s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n inOutExpo: `duration-[0.25s] ease-[cubic-bezier(1,0,0,1)]`,\n anticipate: `duration-[0.25s] ease-[cubic-bezier(1,-0.4,0.35,0.95)]`,\n quickOut: `duration-[0.25s] ease-out`,\n overshootOut: `duration-[0.25s] ease-[cubic-bezier(0.175,0.885,0.32,1.275)]`,\n swiftOut: `duration-[0.25s] ease-[cubic-bezier(0.175,0.885,0.32,1.1)]`,\n snappyOut: `duration-[0.25s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n in: `duration-[0.25s] ease-[cubic-bezier(0.42,0,1,1)]`,\n out: `duration-[0.25s] ease-[cubic-bezier(0,0,0.58,1)]`,\n inOut: `duration-[0.25s] ease-[cubic-bezier(0.42,0,0.58,1)]`,\n outIn: `duration-[0.25s] ease-[cubic-bezier(0.1,0.7,0.9,0.5)]`,\n inQuad: `duration-[0.25s] ease-[cubic-bezier(0.55,0.085,0.68,0.53)]`,\n outQuad: `duration-[0.25s] ease-[cubic-bezier(0.25,0.46,0.45,0.94)]`,\n inOutQuad: `duration-[0.32s] ease-[cubic-bezier(0.455,0.03,0.515,0.955)]`,\n inCubic: `duration-[0.25s] ease-[cubic-bezier(0.55,0.055,0.675,0.19)]`,\n outCubic: `duration-[0.25s] ease-[cubic-bezier(0.215,0.61,0.355,1)]`,\n inOutCubic: `duration-[0.25s] ease-[cubic-bezier(0.645,0.045,0.355,1)]`,\n inQuart: `duration-[0.25s] ease-[cubic-bezier(0.895,0.03,0.685,0.22)]`,\n outQuart: `duration-[0.25s] ease-[cubic-bezier(0.165,0.84,0.44,1)]`,\n inOutQuart: `duration-[0.25s] ease-[cubic-bezier(0.77,0,0.175,1)]`,\n inQuint: `duration-[0.25s] ease-[cubic-bezier(0.755,0.05,0.855,0.06)]`,\n outQuint: `duration-[0.25s] ease-[cubic-bezier(0.23,1,0.32,1)]`,\n inOutQuint: `duration-[0.25s] ease-[cubic-bezier(0.86,0,0.07,1)]`,\n inCirc: `duration-[0.25s] ease-[cubic-bezier(0.6,0.04,0.98,0.335)]`,\n outCirc: `duration-[0.25s] ease-[cubic-bezier(0.075,0.82,0.165,1)]`,\n inOutCirc: `duration-[0.25s] ease-[cubic-bezier(0.785,0.135,0.15,0.86)]`,\n inOutBase: `duration-[0.25s] ease-[cubic-bezier(0.25,0.1,0.25,1)]`,\n none: `duration-0 ease-none`,\n}\n\ntype CSSAnimationPresets = keyof typeof cssAnimationPresets\ntype CSSTransitionPresets = keyof typeof cssTransitionPresets\n\ninterface TooltipProviderProps extends TooltipPrimitive.Provider.Props {}\n\nfunction TooltipProvider({ delay = 300, ...props }: TooltipProviderProps) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delay={delay}\n {...props}\n />\n )\n}\n\ninterface TooltipProps extends TooltipPrimitive.Root.Props {}\n\nfunction Tooltip({ ...props }: TooltipProps) {\n return <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n}\n\ninterface TooltipTriggerProps extends TooltipPrimitive.Trigger.Props {}\n\nfunction TooltipTrigger(props: TooltipTriggerProps) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />\n}\n\ninterface TooltipPortalProps extends TooltipPrimitive.Portal.Props {}\n\nfunction TooltipPortal(props: TooltipPortalProps) {\n return <TooltipPrimitive.Portal data-slot=\"tooltip-portal\" {...props} />\n}\n\ninterface TooltipPositionerProps extends TooltipPrimitive.Positioner.Props {}\n\nfunction TooltipPositioner({\n className,\n side = \"top\",\n ...rest\n}: TooltipPositionerProps) {\n return (\n <TooltipPortal>\n <TooltipPrimitive.Positioner\n side={side}\n data-slot=\"tooltip-positioner\"\n className={cn(\n \"z-100\",\n (side === \"inline-end\" || side === \"inline-start\") &&\n \"**:data-[slot=tooltip-arrow]:hidden\",\n className\n )}\n {...rest}\n />\n </TooltipPortal>\n )\n}\n\ninterface TooltipPopupProps\n extends\n TooltipPrimitive.Popup.Props,\n Pick<\n TooltipPositionerProps,\n \"side\" | \"sideOffset\" | \"align\" | \"alignOffset\"\n > {\n animationPreset?: CSSAnimationPresets\n transitionPreset?: CSSTransitionPresets\n reduceMotion?: boolean\n showArrow?: boolean\n}\n\nfunction TooltipPopup({\n className,\n animationPreset = \"scale\",\n transitionPreset = \"outQuint\",\n reduceMotion = false,\n showArrow = false,\n side = \"top\",\n sideOffset = 4,\n align = \"center\",\n alignOffset = 0,\n ...rest\n}: TooltipPopupProps) {\n const cssAnimationConfig = useMemo(() => {\n if (reduceMotion) return \"none\"\n\n if (animationPreset) {\n return cssAnimationPresets[animationPreset]\n }\n\n return cssAnimationPresets.scale\n }, [animationPreset, reduceMotion, side])\n\n const cssTransitionConfig = useMemo(() => {\n if (reduceMotion) return \"none\"\n\n if (transitionPreset) {\n return cssTransitionPresets[transitionPreset]\n }\n\n return cssTransitionPresets.snappyOut\n }, [transitionPreset, reduceMotion, side])\n\n return (\n <TooltipPositioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n >\n <TooltipPrimitive.Popup\n data-slot=\"tooltip-popup\"\n className={cn(\n \"[--radius:10px]\",\n \"bg-popover border-border pointer-events-auto w-fit origin-(--transform-origin) rounded-(--radius) border px-2 py-1 text-[13px] text-balance shadow-xs data-instant:duration-0!\",\n className,\n cssAnimationConfig,\n cssTransitionConfig,\n showArrow && [\n `before: before:bg-popover z-[-1] before:absolute before:h-2 before:w-2 before:rotate-45 before:content-['']`,\n side === \"top\" &&\n `before:border-border before:-bottom-[4.7px] before:left-1/2 before:-translate-x-1/2 before:border-r before:border-b`,\n side === \"right\" &&\n `before:border-border before:top-1/2 before:-left-[4.07px] before:-translate-y-1/2 before:border-b before:border-l`,\n side === \"bottom\" &&\n `before:border-border before:-top-[4.7px] before:left-1/2 before:-translate-x-1/2 before:border-t before:border-l`,\n side === \"left\" &&\n `before:border-border before:top-1/2 before:-right-[4.07px] before:-translate-y-1/2 before:border-t before:border-r`,\n side === \"inline-start\" &&\n `before:border-border before:top-1/2 before:-right-[4.07px] before:-translate-y-1/2 before:border-t before:border-r`,\n side === \"inline-end\" &&\n `before:border-border before:top-1/2 before:-left-[4.07px] before:-translate-y-1/2 before:border-b before:border-l`,\n ]\n )}\n {...rest}\n />\n </TooltipPositioner>\n )\n}\n\nexport { Tooltip, TooltipTrigger, TooltipPopup, TooltipProvider }\n","import { createUsePuck, type Config } from \"@measured/puck\"\nimport { useCallback } from \"react\"\nimport { GripVerticalIcon, BoxIcon } from \"lucide-react\"\n\nimport {\n Tooltip as TooltipBaseUI,\n TooltipTrigger,\n TooltipPopup,\n TooltipProvider,\n} from \"../ui/tooltip\"\n\nconst usePuck = createUsePuck()\n\nconst DrawerItem = ({\n name,\n icon,\n}: {\n name: string\n icon?: React.ReactNode\n}) => {\n const configSelector = useCallback(\n (state: { config: Config }) => state.config,\n []\n )\n const config = usePuck(configSelector)\n\n const componentConfig = Object.values(config.components || {}).find(\n (c) => c.label === name\n )\n\n const iconOrImage = icon || componentConfig?.metadata?.icon\n const imageUrl = componentConfig?.metadata?.image\n const description = componentConfig?.metadata?.description\n\n const displayIcon = iconOrImage || <BoxIcon size={16} />\n\n const hasTooltipContent = imageUrl || description\n\n const drawerContent = (\n <div className=\"rounded-md border border-dashed border-red-500 bg-red-500/10 p-3\">\n <div className=\"hover:bg-muted group flex cursor-grab items-center justify-between gap-2 rounded-md bg-white p-0.5 transition-colors\">\n <div className=\"flex items-center gap-2 truncate\">\n <div className=\"border-border group-hover:border-muted rounded-sm border bg-white p-3\">\n {displayIcon}\n </div>\n <span className=\"truncate text-sm font-medium\">{name}</span>\n </div>\n <div className=\"text-foreground h-full flex-none rounded-sm bg-white px-1 py-3\">\n <GripVerticalIcon size={16} />\n </div>\n </div>\n </div>\n )\n\n if (!hasTooltipContent) {\n return drawerContent\n }\n\n return (\n <TooltipProvider delay={200}>\n <TooltipBaseUI>\n <TooltipTrigger className=\"w-full\">\n {drawerContent}\n </TooltipTrigger>\n <TooltipPopup side=\"right\" sideOffset={8} className=\"w-64 p-2\">\n {imageUrl && (\n <img\n src={imageUrl}\n alt={name}\n className=\"h-auto w-full rounded-sm object-contain\"\n />\n )}\n {description && (\n <p className=\"text-muted-foreground mt-2 text-sm\">\n {description}\n </p>\n )}\n </TooltipPopup>\n </TooltipBaseUI>\n </TooltipProvider>\n )\n}\n\nexport default DrawerItem\n","import Checkbox from \"../components/Fields/Checkbox\"\nimport Input from \"../components/Fields/Input\"\nimport NumberUnit from \"../components/Fields/NumberUnit\"\nimport Label from \"../components/Fields/Label\"\nimport Select from \"../components/Fields/Select\"\nimport Radio from \"../components/Fields/Radio\"\nimport Textarea from \"../components/Fields/Textarea\"\nimport ActionBar from \"../components/ActionBar\"\nimport FieldGroups from \"../components/FieldGroups\"\nimport DrawerItem from \"../components/DrawerItem\"\n\nconst createPuckOverridesPlugin = () => {\n return {\n overrides: {\n actionBar: ActionBar,\n drawer: ({ children }: { children: React.ReactNode }) => (\n <div className=\"rounded-md border border-dashed border-green-500 bg-green-500/10 p-3\">\n {children}\n </div>\n ),\n drawerItem: DrawerItem,\n fields: FieldGroups,\n fieldLabel: ({\n children,\n label,\n }: {\n children: React.ReactNode\n label: string\n }) => (\n <div className=\"rounded-md border border-dashed border-blue-500 bg-blue-500/10 p-3\">\n <Label label={label} />\n {children}\n </div>\n ),\n fieldTypes: {\n checkbox: Checkbox,\n numberUnit: NumberUnit,\n radio: Radio,\n select: Select,\n text: Input,\n textarea: Textarea,\n },\n },\n }\n}\n\nexport default createPuckOverridesPlugin\n","\"use client\"\n\nimport { tv, type VariantProps } from \"tailwind-variants\"\nimport {\n Button as BaseButton,\n type ButtonProps as BaseButtonProps,\n} from \"@base-ui/react/button\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst buttonVariants = tv({\n base: [\n `group inline-flex relative isolate shrink-0 items-center gap-1.5 text-sm justify-center w-fit touch-none whitespace-nowrap cursor-pointer outline-hidden transform-gpu motion-reduce:transform-none overflow-hidden`,\n `focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-secondary-foreground`,\n `disabled:cursor-not-allowed disabled:scale-100 disabled:opacity-60 disabled:bg-secondary`,\n `[transition:scale_0.1s,box-shadow_0.2s,background_0.20s,width_0.2s] [transition-timing-function:cubic-bezier(.6,.04,.98,.335)] will-change-transform`,\n `[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none active:scale-98`,\n ],\n variants: {\n variant: {\n default: `bg-linear-to-b from-primary/80 dark:from-primary to-primary text-primary-foreground hover:from-primary/75 dark:hover:from-primary/95`,\n secondary:\n \"border-secondary bg-secondary text-secondary-foreground hover:bg-secondary/90 data-pressed:bg-secondary/90\",\n outline: `border bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50`,\n ghost: `text-primary hover:bg-primary/10 focus-vislbe:bg-primary/10 focus-visible:border-primary/25`,\n link: `text-primary hover:underline hover:underline-offset-4 hover:decoration-1 focus-visible:underline focus-visible:underline-offset-4 focus-visible:decoration-1`,\n destructive:\n \"bg-destructive text-white hover:bg-destructive/90 focus-visible:border-destructive focus-visible:bg-destructive/90 focus-visible:ring-destructive bg-linear-to-t from-destructive/90 to-destructive\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n xs: \"h-6 gap-1 rounded-md px-[calc(--spacing(2)-1px)] py-[calc(--spacing(1)-1px)] text-xs [&_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 xl: \"h-12 px-[calc(--spacing(4)-1px)] py-[calc(--spacing(2)-1px)] text-base [&_svg:not([class*='size-'])]:size-4.5\",\n \"icon-sm\": \"size-8 [&_svg:not([class*='size-'])]:size-3.5\",\n icon: \"size-9 [&_svg:not([class*='size-'])]:size-4\",\n \"icon-lg\": \"size-10 [&_svg:not([class*='size-'])]:size-4.5\",\n \"icon-xl\": \"size-12 [&_svg:not([class*='size-'])]:size-4.5\",\n },\n radius: {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n default: \"rounded-md\",\n lg: \"rounded-lg\",\n xl: \"rounded-xl\",\n full: \"rounded-full\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n radius: \"default\",\n },\n})\n\ntype ButtonProps = BaseButtonProps & {\n variant?: VariantProps<typeof buttonVariants>[\"variant\"]\n size?: VariantProps<typeof buttonVariants>[\"size\"]\n radius?: VariantProps<typeof buttonVariants>[\"radius\"]\n}\n\nfunction Button({\n className,\n variant = \"default\",\n size = \"default\",\n radius = \"default\",\n ...props\n}: ButtonProps) {\n return (\n <BaseButton\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, radius }), className)}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n","\"use client\"\n\nimport { createContext, useContext, useMemo } from \"react\"\nimport { Dialog as DialogPrimitive } from \"@base-ui/react/dialog\"\nimport { XIcon } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst cssAnimationPresets = {\n none: \"transition-none\",\n scale: [\n `[transition-property:scale,opacity,translate] [will-change:scale,opacity,translate]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 max-sm:opacity-[calc(1-min(var(--nested-dialogs),1))] max-sm:data-starting-style:translate-y-4 max-sm:data-ending-style:translate-y-4 max-sm:data-starting-style:scale-98 max-sm:data-ending-style:scale-98 max-sm:origin-bottom`,\n `sm:-translate-y-[calc(2rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))] sm:data-starting-style:scale-98 sm:data-ending-style:scale-98 sm:data-nested:data-ending-style:translate-y-8 sm:data-nested:data-starting-style:translate-y-8`,\n ],\n fade: [\n `[transition-property:opacity,translate,scale] [will-change:opacity,translate,scale]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 max-sm:opacity-[calc(1-min(var(--nested-dialogs),1))] max-sm:data-starting-style:translate-y-4 max-sm:data-ending-style:translate-y-4`,\n `sm:-translate-y-[calc(2rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n topFlip: [\n `[transition-property:opacity,filter,transform,translate,scale] [will-change:opacity,filter,transform,translate,scale]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 data-starting-style:blur-[4px] data-ending-style:blur-[4px] data-starting-style:transform-[perspective(1000px)_rotateX(50deg)_scale(0.8)] data-ending-style:transform-[perspective(1000px)_rotateX(50deg)_scale(0.8)]`,\n `sm:translate-y-[calc(3.5rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n bottomFlip: [\n `[transition-property:opacity,filter,transform,translate,scale] [will-change:opacity,filter,transform,translate,scale]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 data-starting-style:blur-[4px] data-ending-style:blur-[4px] data-starting-style:transform-[perspective(1000px)_rotateX(-50deg)_scale(0.8)] data-ending-style:transform-[perspective(1000px)_rotateX(-50deg)_scale(0.8)]`,\n `sm:-translate-y-[calc(2rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n rightFlip: [\n `[transition-property:opacity,filter,transform,translate,scale] [will-change:opacity,filter,transform,translate,scale]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 data-starting-style:blur-[4px] data-ending-style:blur-[4px] data-starting-style:transform-[perspective(1000px)_rotateY(50deg)_scale(0.8)] data-ending-style:transform-[perspective(1000px)_rotateY(50deg)_scale(0.8)]`,\n `sm:-translate-x-[calc(2.5rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n leftFlip: [\n `[transition-property:opacity,filter,transform,translate,scale] [will-change:opacity,filter,transform,translate,scale]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 data-starting-style:blur-[4px] data-ending-style:blur-[4px] data-starting-style:transform-[perspective(1000px)_rotateY(-50deg)_scale(0.8)] data-ending-style:transform-[perspective(1000px)_rotateY(-50deg)_scale(0.8)]`,\n `sm:translate-x-[calc(2.5rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n topSlide: [\n `[transition-property:opacity,transform,translate,scale] [will-change:opacity,transform,translate,scale]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 data-starting-style:translate-y-[-20px] data-ending-style:translate-y-[-20px] max-sm:data-starting-style:-translate-y-4 max-sm:data-ending-style:-translate-y-4`,\n `sm:translate-y-[calc(3.5rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n bottomSlide: [\n `[transition-property:opacity,transform,translate,scale] [will-change:opacity,transform,translate,scale]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 data-starting-style:translate-y-[20px] data-ending-style:translate-y-[20px] max-sm:data-starting-style:translate-y-4 max-sm:data-ending-style:translate-y-4`,\n `sm:-translate-y-[calc(2rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n leftSlide: [\n `[transition-property:opacity,transform,translate,scale] [will-change:opacity,transform,translate,scale]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 data-starting-style:translate-x-[-20px] data-ending-style:translate-x-[-20px] max-sm:data-starting-style:-translate-x-4 max-sm:data-ending-style:-translate-x-4`,\n `sm:translate-x-[calc(2.5rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n rightSlide: [\n `[transition-property:opacity,transform,translate,scale] [will-change:opacity,transform,translate,scale]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 data-starting-style:translate-x-[20px] data-ending-style:translate-x-[20px] max-sm:data-starting-style:translate-x-4 max-sm:data-ending-style:translate-x-4`,\n `sm:-translate-x-[calc(2.5rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n wipe: [\n `[transition-property:clip-path,translate,scale] [will-change:clip-path,translate,scale] [clip-path:inset(0_0_0_0_round_12px)] [-webkit-clip-path:inset(0_0_0_0_round_12px)]`,\n `data-starting-style:[clip-path:inset(0_0_100%_0_round_12px)] data-ending-style:[clip-path:inset(0_0_100%_0_round_12px)]`,\n `sm:-translate-y-[calc(2rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n}\n\nconst cssTransitionPresets = {\n inExpo: `duration-[0.35s] ease-[cubic-bezier(0.95,0.05,0.795,0.035)]`,\n outExpo: `duration-[0.35s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n inOutExpo: `duration-[0.35s] ease-[cubic-bezier(1,0,0,1)]`,\n anticipate: `duration-[0.35s] ease-[cubic-bezier(1,-0.4,0.35,0.95)]`,\n quickOut: `duration-[0.35s] ease-out`,\n overshootOut: `duration-[0.35s] ease-[cubic-bezier(0.175,0.885,0.32,1.275)]`,\n swiftOut: `duration-[0.35s] ease-[cubic-bezier(0.175,0.885,0.32,1.1)]`,\n snappyOut: `duration-[0.35s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n in: `duration-[0.35s] ease-[cubic-bezier(0.42,0,1,1)]`,\n out: `duration-[0.35s] ease-[cubic-bezier(0,0,0.58,1)]`,\n inOut: `duration-[0.25s] ease-[cubic-bezier(0.42,0,0.58,1)]`,\n outIn: `duration-[0.35s] ease-[cubic-bezier(0.1,0.7,0.9,0.5)]`,\n inQuad: `duration-[0.35s] ease-[cubic-bezier(0.55,0.085,0.68,0.53)]`,\n outQuad: `duration-[0.25s] ease-[cubic-bezier(0.25,0.46,0.45,0.94)]`,\n inOutQuad: `duration-[0.32s] ease-[cubic-bezier(0.455,0.03,0.515,0.955)]`,\n inCubic: `duration-[0.35s] ease-[cubic-bezier(0.55,0.055,0.675,0.19)]`,\n outCubic: `duration-[0.35s] ease-[cubic-bezier(0.215,0.61,0.355,1)]`,\n inOutCubic: `duration-[0.35s] ease-[cubic-bezier(0.645,0.045,0.355,1)]`,\n inQuart: `duration-[0.35s] ease-[cubic-bezier(0.895,0.03,0.685,0.22)]`,\n outQuart: `duration-[0.35s] ease-[cubic-bezier(0.165,0.84,0.44,1)]`,\n inOutQuart: `duration-[0.35s] ease-[cubic-bezier(0.77,0,0.175,1)]`,\n inQuint: `duration-[0.35s] ease-[cubic-bezier(0.755,0.05,0.855,0.06)]`,\n outQuint: `duration-[0.35s] ease-[cubic-bezier(0.23,1,0.32,1)]`,\n inOutQuint: `duration-[0.35s] ease-[cubic-bezier(0.86,0,0.07,1)]`,\n inCirc: `duration-[0.35s] ease-[cubic-bezier(0.6,0.04,0.98,0.335)]`,\n outCirc: `duration-[0.35s] ease-[cubic-bezier(0.075,0.82,0.165,1)]`,\n inOutCirc: `duration-[0.35s] ease-[cubic-bezier(0.785,0.135,0.15,0.86)]`,\n inOutBase: `duration-[0.35s] ease-[cubic-bezier(0.25,0.1,0.25,1)]`,\n}\n\ntype CSSAnimationPresets = keyof typeof cssAnimationPresets\ntype CSSTransitionPresets = keyof typeof cssTransitionPresets\n\ninterface DialogContextType {\n modal: DialogProps<unknown>[\"modal\"]\n}\n\nconst DialogContext = createContext<DialogContextType | undefined>(undefined)\n\nfunction useDialog() {\n const context = useContext(DialogContext)\n if (!context) {\n throw new Error(\"useDialog must be used within a DialogProvider\")\n }\n return context\n}\n\ninterface DialogProps<TPayload = unknown> extends DialogPrimitive.Root\n .Props<TPayload> {}\n\nfunction Dialog<TPayload = unknown>({\n modal = true,\n ...props\n}: DialogProps<TPayload>) {\n return (\n <DialogContext.Provider value={{ modal }}>\n <DialogPrimitive.Root data-slot=\"dialog\" modal={modal} {...props} />\n </DialogContext.Provider>\n )\n}\n\ninterface DialogTriggerProps extends DialogPrimitive.Trigger.Props {}\n\nfunction DialogTrigger({ ...props }: DialogTriggerProps) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\ninterface DialogViewportProps extends DialogPrimitive.Viewport.Props {}\n\nfunction DialogViewport({ ...props }: DialogViewportProps) {\n return <DialogPrimitive.Viewport data-slot=\"dialog-viewport\" {...props} />\n}\n\ninterface DialogPortalProps extends DialogPrimitive.Portal.Props {}\n\nfunction DialogPortal(props: DialogPortalProps) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\ninterface DialogBackdropProps extends DialogPrimitive.Backdrop.Props {}\n\nfunction DialogBackdrop({ className, ...props }: DialogBackdropProps) {\n return (\n <DialogPrimitive.Backdrop\n data-slot=\"dialog-backdrop\"\n render={\n <div\n key=\"dialog-backdrop\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/32 backdrop-blur-sm transition-all duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-[-webkit-touch-callout:none]:absolute\",\n className\n )}\n />\n }\n {...props}\n />\n )\n}\n\ninterface DialogPopupProps extends DialogPrimitive.Popup.Props {\n animationPreset?: CSSAnimationPresets\n transitionPreset?: CSSTransitionPresets\n reduceMotion?: boolean\n showCloseButton?: boolean\n}\n\nfunction DialogPopup({\n className,\n animationPreset = \"scale\",\n transitionPreset = \"outCubic\",\n children,\n reduceMotion = false,\n showCloseButton = true,\n ...rest\n}: DialogPopupProps) {\n const { modal } = useDialog()\n\n const cssAnimationConfig = useMemo(() => {\n if (reduceMotion) return \"none\"\n\n if (animationPreset) {\n return cssAnimationPresets[animationPreset]\n }\n\n return cssAnimationPresets.scale\n }, [animationPreset, reduceMotion])\n\n const cssTransitionConfig = useMemo(() => {\n if (reduceMotion) return \"none\"\n\n if (transitionPreset) {\n return cssTransitionPresets[transitionPreset]\n }\n\n return cssTransitionPresets.snappyOut\n }, [transitionPreset, reduceMotion])\n\n return (\n <DialogPortal>\n {modal && <DialogBackdrop />}\n <div className=\"fixed inset-0 top-1/2 left-1/2 z-50 h-max w-full -translate-x-1/2 -translate-y-1/2 transform\">\n <div className=\"flex flex-col items-center overflow-hidden p-4 sm:overflow-y-auto\">\n <DialogPrimitive.Popup\n data-slot=\"dialog-popup\"\n render={\n <div\n key=\"dialog-popup\"\n className={cn(\n \"bg-popover text-popover-foreground border-border relative row-start-2 grid max-h-[calc(100vh-2rem)] w-full min-w-0 gap-4 rounded-2xl border p-6 shadow-lg max-sm:overflow-y-auto\",\n cssTransitionConfig,\n cssAnimationConfig,\n className\n )}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring data-open:bg-accent data-open:text-muted-foreground absolute top-4 right-4 rounded-full opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </div>\n }\n {...rest}\n />\n </div>\n </div>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\n \"flex flex-col gap-2 text-center sm:text-left\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"sm:border-border/60 sm:bg-muted/50 flex flex-col-reverse gap-2 sm:-mx-6 sm:mt-2 sm:-mb-6 sm:flex-row sm:justify-end sm:rounded-b-xl sm:border-t sm:px-6 sm:py-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: DialogPrimitive.Description.Props) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\ninterface DialogCloseProps extends DialogPrimitive.Close.Props {}\n\nfunction DialogClose(props: DialogCloseProps) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogPopup,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogBackdrop,\n DialogViewport,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n}\n","\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"../../lib/utils\"\n\nfunction Table({ className, ...props }: React.ComponentProps<\"table\">) {\n return (\n <div\n data-slot=\"table-container\"\n className=\"relative w-full overflow-x-auto\"\n >\n <table\n data-slot=\"table\"\n className={cn(\"w-full caption-bottom text-sm\", className)}\n {...props}\n />\n </div>\n )\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\n return (\n <thead\n data-slot=\"table-header\"\n className={cn(\"[&_tr]:border-b\", className)}\n {...props}\n />\n )\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\n return (\n <tbody\n data-slot=\"table-body\"\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n )\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn(\n \"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<\"tr\">) {\n return (\n <tr\n data-slot=\"table-row\"\n className={cn(\n \"hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TableHead({ className, ...props }: React.ComponentProps<\"th\">) {\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\n \"text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TableCell({ className, ...props }: React.ComponentProps<\"td\">) {\n return (\n <td\n data-slot=\"table-cell\"\n className={cn(\n \"p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TableCaption({\n className,\n ...props\n}: React.ComponentProps<\"caption\">) {\n return (\n <caption\n data-slot=\"table-caption\"\n className={cn(\"text-muted-foreground mt-4 text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n}\n","import * as React from \"react\"\n\nimport { cn } from \"../../lib/utils\"\nimport { Button } from \"./button\"\nimport {\n ChevronLeftIcon,\n ChevronRightIcon,\n MoreHorizontalIcon,\n} from \"lucide-react\"\n\nfunction Pagination({ className, ...props }: React.ComponentProps<\"nav\">) {\n return (\n <nav\n role=\"navigation\"\n aria-label=\"pagination\"\n data-slot=\"pagination\"\n className={cn(\n \"cn-pagination mx-auto flex w-full justify-center\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction PaginationContent({\n className,\n ...props\n}: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"pagination-content\"\n className={cn(\n \"cn-pagination-content bg-background divide-border border-border flex items-center divide-x overflow-hidden rounded-md border\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction PaginationItem({ ...props }: React.ComponentProps<\"li\">) {\n return <li data-slot=\"pagination-item\" className=\"h-full\" {...props} />\n}\n\ntype PaginationLinkProps = {\n isActive?: boolean\n} & Pick<React.ComponentProps<typeof Button>, \"size\"> &\n React.ComponentProps<\"a\">\n\nfunction PaginationLink({\n className,\n isActive,\n size = \"icon\",\n ...props\n}: PaginationLinkProps) {\n return (\n <Button\n variant=\"ghost\"\n size={size}\n className={cn(\n \"cn-pagination-link hover:bg-muted rounded-none\",\n isActive && \"text-primary-500\",\n className\n )}\n nativeButton={false}\n render={\n <a\n aria-current={isActive ? \"page\" : undefined}\n data-slot=\"pagination-link\"\n data-active={isActive}\n {...props}\n />\n }\n />\n )\n}\n\nfunction PaginationPrevious({\n className,\n ...props\n}: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to previous page\"\n size=\"default\"\n className={cn(\"cn-pagination-previous\", className)}\n {...props}\n >\n <ChevronLeftIcon />\n <span className=\"cn-pagination-previous-text hidden\">Previous</span>\n </PaginationLink>\n )\n}\n\nfunction PaginationNext({\n className,\n ...props\n}: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to next page\"\n size=\"default\"\n className={cn(\"cn-pagination-next\", className)}\n {...props}\n >\n <span className=\"cn-pagination-next-text hidden\">Next</span>\n <ChevronRightIcon />\n </PaginationLink>\n )\n}\n\nfunction PaginationEllipsis({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n aria-hidden\n data-slot=\"pagination-ellipsis\"\n className={cn(\n \"cn-pagination-ellipsis flex h-full w-auto items-end justify-center px-2 py-1.5\",\n className\n )}\n {...props}\n >\n <MoreHorizontalIcon className=\"size-4\" />\n <span className=\"sr-only\">More pages</span>\n </span>\n )\n}\n\nexport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n}\n","\"use client\"\n\nimport React, { useCallback } from \"react\"\nimport {\n Pagination as PaginationUI,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n} from \"../ui/pagination\"\nimport {\n Select,\n SelectTrigger,\n SelectValue,\n SelectIcon,\n SelectPopup,\n SelectList,\n SelectItem,\n SelectItemText,\n} from \"../ui/select\"\nimport { cn } from \"../../lib/utils\"\nimport { ChevronDownIcon } from \"lucide-react\"\n\nexport type PaginationProps = {\n currentPage: number\n totalPages: number\n totalItems: number\n itemsPerPage: number\n onPageChange: (page: number) => void\n onItemsPerPageChange: (itemsPerPage: number) => void\n pageSizeOptions?: number[]\n maxVisiblePages?: number\n showInfo?: boolean\n showPageSizeSelect?: boolean\n className?: string\n}\n\nexport const TablePagination = ({\n currentPage,\n totalPages,\n totalItems,\n itemsPerPage,\n onPageChange,\n onItemsPerPageChange,\n pageSizeOptions = [5, 10, 20, 50, 100],\n maxVisiblePages = 4,\n showInfo = true,\n showPageSizeSelect = true,\n className,\n}: PaginationProps) => {\n const handleItemsPerPageChange = useCallback(\n (value: unknown) => {\n const newLimit = Number(value)\n onItemsPerPageChange(newLimit)\n },\n [onItemsPerPageChange]\n )\n\n const renderPaginationItems = useCallback(() => {\n const items = []\n let startPage = Math.max(\n 1,\n currentPage - Math.floor(maxVisiblePages / 2)\n )\n let endPage = Math.min(totalPages, startPage + maxVisiblePages - 1)\n\n if (endPage - startPage + 1 < maxVisiblePages) {\n startPage = Math.max(1, endPage - maxVisiblePages + 1)\n }\n\n if (startPage > 1) {\n items.push(\n <PaginationItem key=\"1\">\n <PaginationLink\n size=\"icon\"\n onClick={(e) => {\n e.preventDefault()\n onPageChange(1)\n }}\n >\n 1\n </PaginationLink>\n </PaginationItem>\n )\n if (startPage > 2) {\n items.push(\n <PaginationItem key=\"ellipsis-start\">\n <PaginationEllipsis />\n </PaginationItem>\n )\n }\n }\n\n for (let i = startPage; i <= endPage; i++) {\n items.push(\n <PaginationItem key={i}>\n <PaginationLink\n size=\"icon\"\n isActive={currentPage === i}\n onClick={(e) => {\n e.preventDefault()\n onPageChange(i)\n }}\n >\n {i}\n </PaginationLink>\n </PaginationItem>\n )\n }\n\n if (endPage < totalPages) {\n if (endPage < totalPages - 1) {\n items.push(\n <PaginationItem key=\"ellipsis-end\">\n <PaginationEllipsis />\n </PaginationItem>\n )\n }\n items.push(\n <PaginationItem key={totalPages}>\n <PaginationLink\n size=\"icon\"\n onClick={(e) => {\n e.preventDefault()\n onPageChange(totalPages)\n }}\n >\n {totalPages}\n </PaginationLink>\n </PaginationItem>\n )\n }\n\n return items\n }, [currentPage, totalPages, maxVisiblePages, onPageChange])\n\n const startItem =\n totalItems === 0 ? 0 : (currentPage - 1) * itemsPerPage + 1\n const endItem = Math.min(currentPage * itemsPerPage, totalItems)\n\n return (\n <div\n className={cn(\n \"grid grid-cols-[1fr_auto_1fr] items-center gap-x-4\",\n className\n )}\n >\n {showInfo && (\n <div className=\"justify-self-start\">\n <div className=\"text-muted-foreground text-sm\">\n Showing {startItem} to {endItem} of {totalItems} results\n </div>\n </div>\n )}\n\n {showPageSizeSelect && (\n <div className=\"flex items-center gap-2 justify-self-center\">\n <span className=\"text-muted-foreground text-sm\">\n Per page\n </span>\n <Select\n value={itemsPerPage.toString()}\n onValueChange={handleItemsPerPageChange}\n >\n <SelectTrigger className=\"h-8 w-fit\">\n <SelectValue />\n <SelectIcon>\n <ChevronDownIcon className=\"size-4\" />\n </SelectIcon>\n </SelectTrigger>\n <SelectPopup>\n <SelectList>\n {pageSizeOptions.map((size) => (\n <SelectItem\n key={size}\n value={size.toString()}\n >\n <SelectItemText>{size}</SelectItemText>\n </SelectItem>\n ))}\n </SelectList>\n </SelectPopup>\n </Select>\n </div>\n )}\n\n {totalPages > 1 && (\n <div className=\"justify-self-end\">\n <PaginationUI>\n <PaginationContent>\n <PaginationItem>\n <PaginationPrevious\n size=\"default\"\n onClick={(e) => {\n e.preventDefault()\n if (currentPage > 1) {\n onPageChange(currentPage - 1)\n }\n }}\n aria-disabled={currentPage === 1}\n className={cn(\n currentPage === 1 &&\n \"pointer-events-none opacity-50\"\n )}\n />\n </PaginationItem>\n {renderPaginationItems()}\n <PaginationItem>\n <PaginationNext\n size=\"default\"\n onClick={(e) => {\n e.preventDefault()\n if (currentPage < totalPages) {\n onPageChange(currentPage + 1)\n }\n }}\n aria-disabled={currentPage === totalPages}\n className={cn(\n currentPage === totalPages &&\n \"pointer-events-none opacity-50\"\n )}\n />\n </PaginationItem>\n </PaginationContent>\n </PaginationUI>\n </div>\n )}\n </div>\n )\n}\n\nexport default TablePagination\n","\"use client\"\n\nimport * as React from \"react\"\nimport { tv, type VariantProps } from \"tailwind-variants\"\n\nimport { cn } from \"../../lib/utils\"\nimport { Input, type InputProps } from \"./input\"\nimport { Textarea, type TextareaProps } from \"./textarea\"\nimport { Button } from \"./button\"\n\nfunction InputGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(\n \"group/input-group iteems-center border-border bg-background dark:bg-input/32 relative inline-flex min-w-0 rounded-lg border text-base/5 shadow-xs outline-none\",\n \"[transition:box-shadow_150ms_ease-out]\",\n\n // Variants based on alignment.\n \"has-[>[data-align=inline-start]]:[&>input]:pl-2\",\n \"has-[>[data-align=inline-end]]:[&>input]:pr-2\",\n \"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3\",\n \"has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:h-auto has-[>[data-align=block-end]]:[&>textarea]:pt-3\",\n\n // Focus State\n \"has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[1px]\",\n\n // Error State\n \"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40\",\n\n className\n )}\n {...props}\n />\n )\n}\n\nconst inputGroupAddonVariants = tv({\n base: `flex h-auto cursor-text text-muted-foreground items-center justify-center text-sm gap-2 py-1.5 font-medium select-none not-has-[button]:**:[svg]:opacity-72 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 group-data-[disabled=true]/input-group:opacity-50`,\n variants: {\n align: {\n \"inline-start\":\n \"order-first ps-[calc(--spacing(3)-1px)] has-[>[data-slot=badge]]:-ms-1.5 has-[>button]:-ms-2 has-[>kbd]:ms-[-0.35rem] [[data-size=sm]+&]:ps-[calc(--spacing(2.5)-1px)]\",\n \"inline-end\":\n \"order-last pe-[calc(--spacing(3)-1px)] has-[>[data-slot=badge]]:-me-1.5 has-[>button]:-me-2 has-[>kbd]:me-[-0.35rem] [[data-size=sm]+&]:pe-[calc(--spacing(2.5)-1px)]\",\n \"block-start\":\n \"order-first w-full justify-start px-[calc(--spacing(3)-1px)] pt-[calc(--spacing(3)-1px)] [.border-b]:pb-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]\",\n \"block-end\":\n \"order-last w-full justify-start px-[calc(--spacing(3)-1px)] pb-[calc(--spacing(3)-1px)] [.border-t]:pt-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]\",\n },\n },\n defaultVariants: {\n align: \"inline-start\",\n },\n})\n\nfunction InputGroupAddon({\n className,\n align = \"inline-start\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n <div\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align }), className)}\n onMouseDown={(e) => {\n const target = e.target as HTMLElement\n const isInteractive = target.closest(\"button, a\")\n if (isInteractive) return\n e.preventDefault()\n const parent = e.currentTarget.parentElement\n const input = parent?.querySelector<\n HTMLInputElement | HTMLTextAreaElement\n >(\"input, textarea\")\n if (\n input &&\n !parent?.querySelector(\"input:focus, textarea:focus\")\n ) {\n input.focus()\n }\n }}\n {...props}\n />\n )\n}\n\nconst inputGroupButtonVariants = tv({\n base: \"text-sm shadow-none flex gap-2 items-center\",\n\n variants: {\n size: {\n xs: \"h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2\",\n sm: \"h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5\",\n \"icon-xs\":\n \"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0\",\n \"icon-sm\": \"size-8 p-0 has-[>svg]:p-0\",\n },\n },\n defaultVariants: {\n size: \"xs\",\n },\n})\n\nfunction InputGroupButton({\n className,\n type = \"button\",\n variant = \"ghost\",\n size = \"xs\",\n ...props\n}: Omit<React.ComponentProps<typeof Button>, \"size\"> &\n VariantProps<typeof inputGroupButtonVariants> & {\n type?: \"submit\" | \"reset\" | \"button\"\n }) {\n return (\n <Button\n type={type}\n data-size={size}\n variant={variant}\n className={cn(inputGroupButtonVariants({ size }), className)}\n {...props}\n />\n )\n}\n\nfunction InputGroupText({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"input-group-text\"\n className={cn(\n \"text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction InputGroupInput({ className, ...props }: InputProps) {\n return (\n <Input\n data-slot=\"input-group-control\"\n className={cn(\n \"flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:border-0 focus-visible:ring-0 dark:bg-transparent\",\n className\n )}\n {...props}\n />\n )\n}\nfunction InputGroupTextarea({ className, ...props }: TextareaProps) {\n return (\n <Textarea\n data-slot=\"input-group-control\"\n className={cn(\n \"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupText,\n InputGroupInput,\n InputGroupTextarea,\n}\n","\"use client\"\n\nimport React, { useState, useEffect, useCallback } from \"react\"\nimport { Input } from \"../ui/input\"\nimport { Button } from \"../ui/button\"\nimport { RadioGroup, RadioGroupItem } from \"../ui/radio\"\nimport {\n Dialog,\n DialogTrigger,\n DialogPopup,\n DialogHeader,\n DialogTitle,\n DialogFooter,\n} from \"../ui/dialog\"\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from \"../ui/table\"\nimport { TablePagination } from \"../Pagination\"\nimport { InputGroup, InputGroupAddon, InputGroupInput } from \"../ui/input-group\"\nimport { cn } from \"../../lib/utils\"\nimport { UploadIcon, Loader2Icon, ImageIcon, SearchIcon } from \"lucide-react\"\n\nexport type MediaItem = {\n id: number\n name: string\n url: string\n thumbnail: string\n type: string\n}\n\nexport type MediaPickerValue = {\n type?: \"url\" | \"media\"\n url?: string\n media?: MediaItem | null\n}\n\ntype MediaPickerConfig = {\n mediasUrl: string\n uploadUrl: string\n langId?: string\n}\n\nconst getEditorConfig = (): MediaPickerConfig => {\n const editorEl = document.getElementById(\"editor\")\n return {\n mediasUrl: editorEl?.dataset.mediasUrl || \"/admin/pages/puck/medias\",\n uploadUrl:\n editorEl?.dataset.uploadUrl || \"/admin/pages/puck/medias/upload\",\n langId: editorEl?.dataset.langId || \"\",\n }\n}\n\nconst fetchMedias = async ({\n query,\n filters,\n page = 1,\n limit = 10,\n}: {\n query?: string\n filters?: Record<string, string>\n page?: number\n limit?: number\n}) => {\n const { mediasUrl, langId } = getEditorConfig()\n\n const params = new URLSearchParams()\n if (query) params.append(\"search\", query)\n if (langId) params.append(\"lang_id\", langId)\n params.append(\"page\", page.toString())\n params.append(\"limit\", limit.toString())\n\n if (filters) {\n Object.entries(filters).forEach(([key, value]) => {\n params.append(key, value)\n })\n }\n\n const response = await fetch(`${mediasUrl}?${params.toString()}`, {\n credentials: \"same-origin\",\n })\n const data = await response.json()\n\n if (data.success && data.medias) {\n return {\n items: data.medias as MediaItem[],\n total: data.total || data.medias.length,\n }\n }\n\n return { items: [], total: 0 }\n}\n\ntype MediaUploadZoneProps = {\n onUploadSuccess?: (media: MediaItem) => void\n}\n\nconst MediaUploadZone = ({ onUploadSuccess }: MediaUploadZoneProps) => {\n const [uploading, setUploading] = useState(false)\n const [uploadProgress, setUploadProgress] = useState(0)\n const [dragActive, setDragActive] = useState(false)\n\n const handleUpload = useCallback(\n async (file: File) => {\n setUploading(true)\n setUploadProgress(0)\n\n try {\n const { uploadUrl, langId } = getEditorConfig()\n const csrfToken = document.querySelector(\n 'meta[name=\"csrf-token\"]'\n ) as HTMLMetaElement\n\n const formData = new FormData()\n formData.append(\"file\", file)\n if (langId) formData.append(\"lang_id\", langId)\n\n const xhr = new XMLHttpRequest()\n\n xhr.upload.addEventListener(\"progress\", (e) => {\n if (e.lengthComputable) {\n setUploadProgress((e.loaded / e.total) * 100)\n }\n })\n\n xhr.addEventListener(\"load\", () => {\n if (xhr.status === 200) {\n const response = JSON.parse(xhr.responseText)\n if (response.success && response.media) {\n onUploadSuccess?.(response.media)\n }\n } else {\n alert(\"Error during upload\")\n }\n setUploading(false)\n setUploadProgress(0)\n })\n\n xhr.addEventListener(\"error\", () => {\n alert(\"Error during upload\")\n setUploading(false)\n setUploadProgress(0)\n })\n\n xhr.open(\"POST\", uploadUrl)\n if (csrfToken) {\n xhr.setRequestHeader(\"X-CSRF-TOKEN\", csrfToken.content)\n }\n xhr.send(formData)\n } catch (error) {\n console.error(\"Error during upload:\", error)\n alert(\"Error during upload\")\n setUploading(false)\n setUploadProgress(0)\n }\n },\n [onUploadSuccess]\n )\n\n const handleDrag = useCallback((e: React.DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n if (e.type === \"dragenter\" || e.type === \"dragover\") {\n setDragActive(true)\n } else if (e.type === \"dragleave\") {\n setDragActive(false)\n }\n }, [])\n\n const handleDrop = useCallback(\n (e: React.DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n setDragActive(false)\n\n if (e.dataTransfer.files?.[0]) {\n handleUpload(e.dataTransfer.files[0])\n }\n },\n [handleUpload]\n )\n\n const handleFileInput = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (e.target.files?.[0]) {\n handleUpload(e.target.files[0])\n }\n },\n [handleUpload]\n )\n\n const handleClick = useCallback(() => {\n if (!uploading) {\n document.getElementById(\"media-upload-input\")?.click()\n }\n }, [uploading])\n\n return (\n <div className=\"w-full\">\n <div\n onDragEnter={handleDrag}\n onDragLeave={handleDrag}\n onDragOver={handleDrag}\n onDrop={handleDrop}\n className={cn(\n \"border-border hover:border-primary/50 flex cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed bg-white p-6 transition-colors\",\n dragActive && \"border-primary bg-primary/5\",\n uploading && \"pointer-events-none opacity-60\"\n )}\n onClick={handleClick}\n >\n {uploading ? (\n <div className=\"flex flex-col items-center gap-2\">\n <Loader2Icon className=\"text-primary size-6 animate-spin\" />\n <div className=\"text-sm font-medium\">Uploading...</div>\n <div className=\"bg-muted h-1.5 w-full overflow-hidden rounded-full\">\n <div\n className=\"bg-primary h-full transition-all duration-300\"\n style={{ width: `${uploadProgress}%` }}\n />\n </div>\n <div className=\"text-muted-foreground text-xs\">\n {Math.round(uploadProgress)}%\n </div>\n </div>\n ) : (\n <div className=\"flex flex-col items-center gap-2\">\n <UploadIcon className=\"text-muted-foreground size-8\" />\n <div className=\"text-sm font-medium\">\n Drop files or click to upload\n </div>\n <div className=\"text-muted-foreground text-xs\">\n PNG, JPG, GIF, WebP up to 10MB\n </div>\n </div>\n )}\n </div>\n <input\n id=\"media-upload-input\"\n type=\"file\"\n accept=\"image/*\"\n onChange={handleFileInput}\n className=\"hidden\"\n disabled={uploading}\n />\n </div>\n )\n}\n\nconst SOURCE_TYPE_OPTIONS = [\n { label: \"Medias\", value: \"media\" },\n { label: \"URL\", value: \"url\" },\n] as const\n\nconst DEFAULT_VALUE: MediaPickerValue = { type: \"media\", media: null }\n\ntype UrlFieldProps = {\n value: string\n onChange: (url: string) => void\n}\n\nconst UrlField = ({ value, onChange }: UrlFieldProps) => {\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(e.target.value)\n },\n [onChange]\n )\n\n return (\n <Input\n type=\"text\"\n value={value}\n onChange={handleChange}\n placeholder=\"https://example.com/image.jpg\"\n />\n )\n}\n\ntype MediaLibraryModalProps = {\n value: MediaItem | null\n onChange: (media: MediaItem | null) => void\n mediaType?: string\n open: boolean\n onOpenChange: (open: boolean) => void\n}\n\nconst MediaLibraryModal = ({\n value,\n onChange,\n mediaType,\n open,\n onOpenChange,\n}: MediaLibraryModalProps) => {\n const [medias, setMedias] = useState<MediaItem[]>([])\n const [loading, setLoading] = useState(false)\n const [selectedMedia, setSelectedMedia] = useState<MediaItem | null>(value)\n const [currentPage, setCurrentPage] = useState(1)\n const [totalPages, setTotalPages] = useState(1)\n const [totalItems, setTotalItems] = useState(0)\n const [searchQuery, setSearchQuery] = useState(\"\")\n const [itemsPerPage, setItemsPerPage] = useState(10)\n\n const loadMedias = useCallback(\n async (page: number, limit: number, query?: string) => {\n setLoading(true)\n try {\n const result = await fetchMedias({\n page,\n limit,\n query,\n filters: mediaType ? { type: mediaType } : undefined,\n })\n setMedias(result.items)\n setTotalItems(result.total)\n setTotalPages(Math.ceil(result.total / limit))\n } catch (error) {\n console.error(\"Error loading medias:\", error)\n } finally {\n setLoading(false)\n }\n },\n [mediaType]\n )\n\n useEffect(() => {\n if (open) {\n loadMedias(currentPage, itemsPerPage, searchQuery)\n }\n }, [open, currentPage, itemsPerPage, loadMedias, searchQuery])\n\n const handleSearch = useCallback((query: string) => {\n setSearchQuery(query)\n setCurrentPage(1)\n }, [])\n\n const handleItemsPerPageChange = useCallback((newLimit: number) => {\n setItemsPerPage(newLimit)\n setCurrentPage(1)\n }, [])\n\n const handleMediaSelectAndConfirm = useCallback(\n (media: MediaItem) => {\n setSelectedMedia(media)\n onChange(media)\n onOpenChange(false)\n },\n [onChange, onOpenChange]\n )\n\n const handleUploadSuccess = useCallback(\n async (media: MediaItem) => {\n await loadMedias(1, itemsPerPage)\n setCurrentPage(1)\n setSelectedMedia(media)\n },\n [loadMedias, itemsPerPage]\n )\n\n return (\n <DialogPopup className=\"max-w-4xl\">\n <DialogHeader>\n <DialogTitle>Select Media</DialogTitle>\n </DialogHeader>\n\n <div className=\"flex flex-col gap-4\">\n <InputGroup>\n <InputGroupInput\n placeholder=\"Search...\"\n value={searchQuery}\n onChange={(e) => handleSearch(e.target.value)}\n />\n <InputGroupAddon>\n <SearchIcon className=\"size-4\" />\n </InputGroupAddon>\n </InputGroup>\n\n {loading ? (\n <div className=\"flex items-center justify-center py-12\">\n <Loader2Icon className=\"text-muted-foreground size-8 animate-spin\" />\n </div>\n ) : medias.length > 0 ? (\n <>\n <div className=\"border-border overflow-hidden rounded-lg border\">\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead className=\"w-20\">\n Preview\n </TableHead>\n <TableHead>Name</TableHead>\n <TableHead>Type</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {medias.map((media) => (\n <TableRow\n key={media.id}\n className={cn(\n \"hover:bg-muted/50 cursor-pointer transition-colors\",\n selectedMedia?.id ===\n media.id && \"bg-primary/5\"\n )}\n onClick={() =>\n handleMediaSelectAndConfirm(\n media\n )\n }\n >\n <TableCell>\n <img\n src={media.thumbnail}\n alt={media.name}\n className=\"size-12 rounded object-cover\"\n />\n </TableCell>\n <TableCell className=\"font-medium\">\n {media.name}\n </TableCell>\n <TableCell className=\"text-muted-foreground text-sm\">\n {media.type}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n\n <TablePagination\n currentPage={currentPage}\n totalPages={totalPages}\n totalItems={totalItems}\n itemsPerPage={itemsPerPage}\n onPageChange={setCurrentPage}\n onItemsPerPageChange={handleItemsPerPageChange}\n pageSizeOptions={[5, 10, 20, 50]}\n />\n </>\n ) : (\n <div className=\"text-muted-foreground flex flex-col items-center justify-center py-12 text-sm\">\n <ImageIcon className=\"mb-2 size-12 opacity-20\" />\n <p>No media found</p>\n </div>\n )}\n </div>\n\n <DialogFooter>\n <MediaUploadZone onUploadSuccess={handleUploadSuccess} />\n </DialogFooter>\n </DialogPopup>\n )\n}\n\ntype MediaLibraryFieldProps = {\n value: MediaItem | null\n onChange: (media: MediaItem | null) => void\n mediaType?: string\n}\n\nconst MediaLibraryField = ({\n value,\n onChange,\n mediaType,\n}: MediaLibraryFieldProps) => {\n const [open, setOpen] = useState(false)\n const [selectedMedia, setSelectedMedia] = useState<MediaItem | null>(value)\n\n useEffect(() => {\n setSelectedMedia(value)\n }, [value])\n\n const handleChange = useCallback(\n (media: MediaItem | null) => {\n setSelectedMedia(media)\n onChange(media)\n },\n [onChange]\n )\n\n const handleClear = useCallback(() => {\n handleChange(null)\n }, [handleChange])\n\n return (\n <div className=\"flex flex-col gap-3\">\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger\n render={\n <Button variant=\"outline\" className=\"w-full\">\n {selectedMedia ? \"Change Media\" : \"Select Media\"}\n </Button>\n }\n />\n <MediaLibraryModal\n value={selectedMedia}\n onChange={handleChange}\n mediaType={mediaType}\n open={open}\n onOpenChange={setOpen}\n />\n </Dialog>\n\n {selectedMedia && (\n <div className=\"border-border bg-background flex items-center gap-3 rounded-lg border p-3\">\n <img\n src={selectedMedia.thumbnail}\n alt={selectedMedia.name}\n className=\"size-16 rounded object-cover\"\n />\n <div className=\"flex-1\">\n <p className=\"text-sm font-medium\">\n {selectedMedia.name}\n </p>\n <p className=\"text-muted-foreground text-xs\">\n {selectedMedia.type}\n </p>\n </div>\n <Button variant=\"ghost\" size=\"sm\" onClick={handleClear}>\n Clear\n </Button>\n </div>\n )}\n </div>\n )\n}\n\nconst useMediaPicker = (\n initialValue: MediaPickerValue | undefined,\n onChange: (val: MediaPickerValue) => void\n) => {\n const currentValue = initialValue || DEFAULT_VALUE\n const selectedType = currentValue.type || \"media\"\n\n const handleTypeChange = useCallback(\n (newType: unknown) => {\n onChange({\n ...currentValue,\n type: newType as \"url\" | \"media\",\n })\n },\n [currentValue, onChange]\n )\n\n const handleUrlChange = useCallback(\n (url: string) => {\n onChange({ ...currentValue, url })\n },\n [currentValue, onChange]\n )\n\n const handleMediaChange = useCallback(\n (media: MediaItem | null) => {\n onChange({ ...currentValue, media })\n },\n [currentValue, onChange]\n )\n\n return {\n currentValue,\n selectedType,\n handleTypeChange,\n handleUrlChange,\n handleMediaChange,\n }\n}\n\nexport type MediaPickerProps = {\n value?: MediaPickerValue\n onChange: (value: MediaPickerValue) => void\n mediaType?: string\n}\n\nexport const MediaPicker = ({\n value,\n onChange,\n mediaType,\n}: MediaPickerProps) => {\n const {\n currentValue,\n selectedType,\n handleTypeChange,\n handleUrlChange,\n handleMediaChange,\n } = useMediaPicker(value, onChange)\n\n return (\n <div className=\"rounded-md border border-dashed border-yellow-500 bg-yellow-500/10 p-3\">\n <div className=\"flex flex-col gap-y-3\">\n <RadioGroup\n value={selectedType}\n onValueChange={handleTypeChange}\n className=\"border-input flex w-fit flex-wrap divide-x divide-stone-200 overflow-hidden rounded-md border\"\n >\n {SOURCE_TYPE_OPTIONS.map((option) => (\n <label key={option.value} className=\"flex-1\">\n <RadioGroupItem\n layout=\"horizontal\"\n value={option.value}\n >\n {option.label}\n </RadioGroupItem>\n </label>\n ))}\n </RadioGroup>\n\n {selectedType === \"url\" && (\n <UrlField\n value={currentValue.url || \"\"}\n onChange={handleUrlChange}\n />\n )}\n\n {selectedType === \"media\" && (\n <MediaLibraryField\n value={currentValue.media || null}\n onChange={handleMediaChange}\n mediaType={mediaType}\n />\n )}\n </div>\n </div>\n )\n}\n\nexport const getMediaUrl = (value?: MediaPickerValue): string | undefined => {\n if (!value) return undefined\n if (value.type === \"media\" && value.media) {\n return value.media.url\n }\n return value.url\n}\n\nexport default MediaPicker\n","import { Fields } from '@measured/puck'\n\nexport type DisplayTraitProps = {\n display?: 'hidden' | 'inline' | 'inline-block' | 'block' | 'flex' | 'inline-flex'\n}\n\nexport const displayField: Fields = {\n display: {\n type: 'select',\n label: 'Display',\n options: [\n { label: 'None (hidden)', value: 'hidden' },\n { label: 'Inline', value: 'inline' },\n { label: 'Inline Block', value: 'inline-block' },\n { label: 'Block', value: 'block' },\n { label: 'Flex', value: 'flex' },\n { label: 'Inline Flex', value: 'inline-flex' },\n ],\n },\n}\n\nexport function displayToClasses(\n display?: 'hidden' | 'inline' | 'inline-block' | 'block' | 'flex' | 'inline-flex'\n): string {\n const classes: string[] = []\n\n if (display) {\n classes.push(display)\n }\n\n return classes.join(' ')\n}\n\nexport const displayDefaultProps: DisplayTraitProps = {\n display: 'block',\n}\n\n","import React from 'react'\nimport { Fields } from '@measured/puck'\nimport { Minus } from 'lucide-react'\n\nexport type FontWeightTraitProps = {\n fontWeight?:\n | ''\n | 'thin'\n | 'extralight'\n | 'light'\n | 'normal'\n | 'medium'\n | 'semibold'\n | 'bold'\n | 'extrabold'\n | 'black'\n}\n\nexport const fontWeightField: Fields = {\n fontWeight: {\n type: 'select',\n label: 'Font weight',\n\n options: [\n { label: <Minus size={16} />, value: '' },\n { label: 'Thin (100)', value: 'thin' },\n { label: 'Extra Light (200)', value: 'extralight' },\n { label: 'Light (300)', value: 'light' },\n { label: 'Normal (400)', value: 'normal' },\n { label: 'Medium (500)', value: 'medium' },\n { label: 'Semibold (600)', value: 'semibold' },\n { label: 'Bold (700)', value: 'bold' },\n { label: 'Extra Bold (800)', value: 'extrabold' },\n { label: 'Black (900)', value: 'black' },\n ],\n },\n}\n\nexport function fontWeightToClasses(fontWeight?: string): string {\n if (!fontWeight) return ''\n return `font-${fontWeight}`\n}\n\nexport const fontWeightDefaultProps = {\n fontWeight: '' as const,\n}\n\n","import React from \"react\"\nimport { Fields } from \"@measured/puck\"\nimport { MinusIcon } from \"lucide-react\"\n\nexport type LineHeightTraitProps = {\n lineHeight?: \"\" | \"1\" | \"1.25\" | \"1.5\" | \"2\"\n}\n\nexport const lineHeightField: Fields = {\n lineHeight: {\n type: \"select\",\n label: \"Line height\",\n\n options: [\n { label: <MinusIcon size={16} />, value: \"\" },\n { label: \"1\", value: \"none\" },\n { label: \"1.25\", value: \"1.25\" },\n { label: \"1.5\", value: \"1.5\" },\n { label: \"2\", value: \"2\" },\n ],\n },\n}\n\nexport function lineHeightToClasses(lineHeight?: string): string {\n if (!lineHeight) return \"\"\n return `leading-[${lineHeight}]`\n}\n\nexport const lineHeightDefaultProps = {\n lineHeight: \"\" as const,\n}\n","import { Fields } from \"@measured/puck\"\n\nexport type MarginValue = { value: string; unit: string }\n\nexport type MarginItem = {\n breakpoint?: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\"\n direction: \"all\" | \"top\" | \"right\" | \"bottom\" | \"left\" | \"x\" | \"y\"\n margin: MarginValue\n}\n\nexport type MarginsTraitProps = {\n margins?: Array<MarginItem>\n}\n\nconst MARGIN_UNITS = [\n { label: \"px\", value: \"px\" },\n { label: \"rem\", value: \"rem\" },\n { label: \"em\", value: \"em\" },\n { label: \"%\", value: \"%\" },\n { label: \"auto\", value: \"auto\" },\n]\n\nfunction getMarginSummary(item: MarginItem): string {\n if (!item || !item.direction) return \"Margin\"\n\n const bp = item.breakpoint ? `${item.breakpoint.toUpperCase()} - ` : \"\"\n const dir =\n item.direction === \"all\"\n ? \"All 4 directions\"\n : item.direction === \"x\"\n ? \"Horizontal\"\n : item.direction === \"y\"\n ? \"Vertical\"\n : item.direction.charAt(0).toUpperCase() +\n item.direction.slice(1)\n const value = item.margin?.value || \"0\"\n const unit = item.margin?.unit || \"px\"\n return `${bp}${dir}: ${value}${unit}`\n}\n\nexport const marginsField: Fields = {\n margins: {\n type: \"array\",\n label: \"Margins\",\n arrayFields: {\n breakpoint: {\n type: \"select\",\n label: \"Breakpoint\",\n options: [\n { label: \"Base\", value: \"\" },\n { label: \"XS\", value: \"xs\" },\n { label: \"SM\", value: \"sm\" },\n { label: \"MD\", value: \"md\" },\n { label: \"LG\", value: \"lg\" },\n { label: \"XL\", value: \"xl\" },\n { label: \"2XL\", value: \"2xl\" },\n ],\n },\n direction: {\n type: \"select\",\n label: \"Direction\",\n options: [\n { label: \"All 4 directions\", value: \"all\" },\n { label: \"Top\", value: \"top\" },\n { label: \"Right\", value: \"right\" },\n { label: \"Bottom\", value: \"bottom\" },\n { label: \"Left\", value: \"left\" },\n { label: \"Horizontal (X)\", value: \"x\" },\n { label: \"Vertical (Y)\", value: \"y\" },\n ],\n },\n margin: {\n type: \"numberUnit\" as any,\n label: \"Margin\",\n options: MARGIN_UNITS,\n },\n },\n defaultItemProps: {\n breakpoint: \"md\",\n direction: \"all\",\n margin: { value: \"0\", unit: \"px\" },\n },\n getItemSummary: (item: MarginItem) => getMarginSummary(item),\n },\n}\n\nexport function marginsToClasses(margins?: Array<MarginItem>): string {\n if (!margins || margins.length === 0) return \"\"\n\n const classes: string[] = []\n\n margins.forEach((item) => {\n if (!item || !item.direction || !item.margin) return\n\n const prefix = item.breakpoint ? `${item.breakpoint}:` : \"\"\n const value = item.margin.value || \"0\"\n const unit = item.margin.unit || \"px\"\n\n // Skip if value is empty\n if (!value.trim()) return\n\n let marginClass = \"\"\n switch (item.direction) {\n case \"all\":\n marginClass = `${prefix}m-[${value}${unit}]`\n break\n case \"x\":\n marginClass = `${prefix}mx-[${value}${unit}]`\n break\n case \"y\":\n marginClass = `${prefix}my-[${value}${unit}]`\n break\n case \"top\":\n marginClass = `${prefix}mt-[${value}${unit}]`\n break\n case \"right\":\n marginClass = `${prefix}mr-[${value}${unit}]`\n break\n case \"bottom\":\n marginClass = `${prefix}mb-[${value}${unit}]`\n break\n case \"left\":\n marginClass = `${prefix}ml-[${value}${unit}]`\n break\n }\n\n if (marginClass) {\n classes.push(marginClass)\n }\n })\n\n return classes.join(\" \")\n}\n\nexport const marginsDefaultProps = {\n margins: [] as Array<MarginItem>,\n}\n","import { Fields } from '@measured/puck'\n\nexport type PaddingValue = { value: string; unit: string }\n\nexport type PaddingItem = {\n breakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'\n direction: 'all' | 'top' | 'right' | 'bottom' | 'left' | 'x' | 'y'\n padding: PaddingValue\n}\n\nexport type PaddingsTraitProps = {\n paddings?: Array<PaddingItem>\n}\n\nconst PADDING_UNITS = [\n { label: 'px', value: 'px' },\n { label: 'rem', value: 'rem' },\n { label: 'em', value: 'em' },\n { label: '%', value: '%' },\n]\n\nfunction getPaddingSummary(item: PaddingItem): string {\n if (!item || !item.direction) return 'Padding'\n\n const bp = item.breakpoint ? `${item.breakpoint.toUpperCase()} - ` : ''\n const dir =\n item.direction === 'all'\n ? 'All 4 directions'\n : item.direction === 'x'\n ? 'Horizontal'\n : item.direction === 'y'\n ? 'Vertical'\n : item.direction.charAt(0).toUpperCase() + item.direction.slice(1)\n const value = item.padding?.value || '0'\n const unit = item.padding?.unit || 'px'\n return `${bp}${dir}: ${value}${unit}`\n}\n\nexport const paddingsField: Fields = {\n paddings: {\n type: 'array',\n label: 'Paddings',\n arrayFields: {\n breakpoint: {\n type: 'select',\n label: 'Breakpoint',\n options: [\n { label: 'Base', value: '' },\n { label: 'XS', value: 'xs' },\n { label: 'SM', value: 'sm' },\n { label: 'MD', value: 'md' },\n { label: 'LG', value: 'lg' },\n { label: 'XL', value: 'xl' },\n { label: '2XL', value: '2xl' },\n ],\n },\n direction: {\n type: 'select',\n label: 'Direction',\n options: [\n { label: 'All 4 directions', value: 'all' },\n { label: 'Top', value: 'top' },\n { label: 'Right', value: 'right' },\n { label: 'Bottom', value: 'bottom' },\n { label: 'Left', value: 'left' },\n { label: 'Horizontal (X)', value: 'x' },\n { label: 'Vertical (Y)', value: 'y' },\n ],\n },\n padding: {\n type: 'numberUnit' as any,\n label: 'Padding',\n options: PADDING_UNITS,\n },\n },\n defaultItemProps: {\n breakpoint: 'md',\n direction: 'all',\n padding: { value: '0', unit: 'px' },\n },\n getItemSummary: (item: PaddingItem) => getPaddingSummary(item),\n },\n}\n\nexport function paddingsToClasses(paddings?: Array<PaddingItem>): string {\n if (!paddings || paddings.length === 0) return ''\n\n const classes: string[] = []\n\n paddings.forEach((item) => {\n if (!item || !item.direction || !item.padding) return\n\n const prefix = item.breakpoint ? `${item.breakpoint}:` : ''\n const value = item.padding.value || '0'\n const unit = item.padding.unit || 'px'\n\n // Skip if value is empty\n if (!value.trim()) return\n\n let paddingClass = ''\n switch (item.direction) {\n case 'all':\n paddingClass = `${prefix}p-[${value}${unit}]`\n break\n case 'x':\n paddingClass = `${prefix}px-[${value}${unit}]`\n break\n case 'y':\n paddingClass = `${prefix}py-[${value}${unit}]`\n break\n case 'top':\n paddingClass = `${prefix}pt-[${value}${unit}]`\n break\n case 'right':\n paddingClass = `${prefix}pr-[${value}${unit}]`\n break\n case 'bottom':\n paddingClass = `${prefix}pb-[${value}${unit}]`\n break\n case 'left':\n paddingClass = `${prefix}pl-[${value}${unit}]`\n break\n }\n\n if (paddingClass) {\n classes.push(paddingClass)\n }\n })\n\n return classes.join(' ')\n}\n\nexport const paddingsDefaultProps = {\n paddings: [] as Array<PaddingItem>,\n}\n\n","import { Fields } from '@measured/puck'\n\nexport type PositionTraitProps = {\n position?: 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky'\n top?: string\n right?: string\n bottom?: string\n left?: string\n zIndex?: number\n}\n\nexport const positionField: Fields = {\n position: {\n type: 'select',\n label: 'Position',\n options: [\n { label: 'Static', value: 'static' },\n { label: 'Relative', value: 'relative' },\n { label: 'Absolute', value: 'absolute' },\n { label: 'Fixed', value: 'fixed' },\n { label: 'Sticky', value: 'sticky' },\n ],\n },\n top: {\n type: 'text',\n label: 'Top',\n },\n right: {\n type: 'text',\n label: 'Right',\n },\n bottom: {\n type: 'text',\n label: 'Bottom',\n },\n left: {\n type: 'text',\n label: 'Left',\n },\n zIndex: {\n type: 'number',\n label: 'Z-Index',\n },\n}\n\nexport function positionToClasses(\n position?: 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky',\n top?: string,\n right?: string,\n bottom?: string,\n left?: string,\n zIndex?: number\n): string {\n const classes: string[] = []\n\n if (position) {\n classes.push(position)\n }\n\n if (top && top.trim()) {\n classes.push(`top-[${top}]`)\n }\n\n if (right && right.trim()) {\n classes.push(`right-[${right}]`)\n }\n\n if (bottom && bottom.trim()) {\n classes.push(`bottom-[${bottom}]`)\n }\n\n if (left && left.trim()) {\n classes.push(`left-[${left}]`)\n }\n\n if (zIndex !== undefined && zIndex !== null) {\n classes.push(`z-[${zIndex}]`)\n }\n\n return classes.join(' ')\n}\n\nexport const positionDefaultProps: PositionTraitProps = {\n position: 'static',\n top: '',\n right: '',\n bottom: '',\n left: '',\n zIndex: 0,\n}\n\n","import { Fields } from \"@measured/puck\"\n\nexport type SizeValue = { value: string; unit: string }\n\nexport type SizeTraitProps = {\n width?: SizeValue\n minWidth?: SizeValue\n maxWidth?: SizeValue\n height?: SizeValue\n minHeight?: SizeValue\n maxHeight?: SizeValue\n}\n\nconst WIDTH_UNITS = [\n { label: \"px\", value: \"px\" },\n { label: \"%\", value: \"%\" },\n { label: \"em\", value: \"em\" },\n { label: \"rem\", value: \"rem\" },\n { label: \"vw\", value: \"vw\" },\n]\n\nconst HEIGHT_UNITS = [\n { label: \"px\", value: \"px\" },\n { label: \"%\", value: \"%\" },\n { label: \"em\", value: \"em\" },\n { label: \"rem\", value: \"rem\" },\n { label: \"vh\", value: \"vh\" },\n]\n\nexport const sizeField: Fields = {\n width: {\n type: \"numberUnit\" as any,\n label: \"Width\",\n options: WIDTH_UNITS,\n },\n minWidth: {\n type: \"numberUnit\" as any,\n label: \"Min Width\",\n options: WIDTH_UNITS,\n },\n maxWidth: {\n type: \"numberUnit\" as any,\n label: \"Max Width\",\n options: WIDTH_UNITS,\n },\n height: {\n type: \"numberUnit\" as any,\n label: \"Height\",\n options: HEIGHT_UNITS,\n },\n minHeight: {\n type: \"numberUnit\" as any,\n label: \"Min Height\",\n options: HEIGHT_UNITS,\n },\n maxHeight: {\n type: \"numberUnit\" as any,\n label: \"Max Height\",\n options: HEIGHT_UNITS,\n },\n}\n\nconst addSizeClass = (\n classes: string[],\n size: SizeValue | undefined,\n prefix: string\n): void => {\n if (size && size.value && size.value.trim()) {\n classes.push(`${prefix}-[${size.value}${size.unit}]`)\n }\n}\n\nexport function sizeToClasses(\n width?: SizeValue,\n minWidth?: SizeValue,\n maxWidth?: SizeValue,\n height?: SizeValue,\n minHeight?: SizeValue,\n maxHeight?: SizeValue\n): string {\n const classes: string[] = []\n\n addSizeClass(classes, width, \"w\")\n addSizeClass(classes, minWidth, \"min-w\")\n addSizeClass(classes, maxWidth, \"max-w\")\n addSizeClass(classes, height, \"h\")\n addSizeClass(classes, minHeight, \"min-h\")\n addSizeClass(classes, maxHeight, \"max-h\")\n\n return classes.join(\" \")\n}\n\nexport const sizeDefaultProps: SizeTraitProps = {\n width: { value: \"\", unit: \"px\" },\n minWidth: { value: \"\", unit: \"px\" },\n maxWidth: { value: \"\", unit: \"px\" },\n height: { value: \"\", unit: \"px\" },\n minHeight: { value: \"\", unit: \"px\" },\n maxHeight: { value: \"\", unit: \"px\" },\n}\n","export * from './margins'\nexport * from './paddings'\n\nimport { MarginsTraitProps, marginsField, marginsDefaultProps, marginsToClasses } from './margins'\nimport { PaddingsTraitProps, paddingsField, paddingsDefaultProps, paddingsToClasses } from './paddings'\n\nexport type SpacingTraitProps = MarginsTraitProps & PaddingsTraitProps\n\nexport const spacingFields = {\n ...marginsField,\n ...paddingsField,\n}\n\nexport const spacingDefaultProps = {\n ...marginsDefaultProps,\n ...paddingsDefaultProps,\n}\n\nexport function spacingToClasses(props: Partial<SpacingTraitProps>): string {\n const classes = [marginsToClasses(props.margins), paddingsToClasses(props.paddings)].filter(Boolean)\n\n return classes.join(' ')\n}\n\nexport const spacingFieldNames = ['margins', 'paddings'] as const\n\n","export const spacingOptions = [\n { label: \"0 rem\", value: \"0px\" },\n { label: \"0.25 rem\", value: \"4px\" },\n { label: \"0.5 rem\", value: \"8px\" },\n { label: \"0.75 rem\", value: \"12px\" },\n { label: \"1 rem\", value: \"16px\" },\n { label: \"1.25 rem\", value: \"20px\" },\n { label: \"1.5 rem\", value: \"24px\" },\n { label: \"1.75 rem\", value: \"28px\" },\n { label: \"2 rem\", value: \"32px\" },\n { label: \"2.25 rem\", value: \"36px\" },\n { label: \"2.5 rem\", value: \"40px\" },\n { label: \"2.75 rem\", value: \"44px\" },\n { label: \"3 rem\", value: \"48px\" },\n { label: \"3.25 rem\", value: \"52px\" },\n { label: \"3.5 rem\", value: \"56px\" },\n { label: \"3.75 rem\", value: \"60px\" },\n { label: \"4 rem\", value: \"64px\" },\n { label: \"4.25 rem\", value: \"68px\" },\n { label: \"4.5 rem\", value: \"72px\" },\n { label: \"4.75 rem\", value: \"76px\" },\n { label: \"5 rem\", value: \"80px\" },\n]\n","import React from \"react\"\nimport { Fields } from \"@measured/puck\"\nimport { AlignLeftIcon, AlignCenterIcon, AlignRightIcon, AlignJustifyIcon } from \"lucide-react\"\n\nexport type TextAlignTraitProps = {\n textAlign?: \"left\" | \"center\" | \"right\" | \"justify\"\n}\n\nexport const textAlignField: Fields = {\n textAlign: {\n type: \"radio\",\n label: \"Text align\",\n\n options: [\n { label: <AlignLeftIcon size={16} />, value: \"left\" },\n { label: <AlignCenterIcon size={16} />, value: \"center\" },\n { label: <AlignRightIcon size={16} />, value: \"right\" },\n { label: <AlignJustifyIcon size={16} />, value: \"justify\" },\n ],\n },\n}\n\nexport function textAlignToClasses(textAlign?: string): string {\n if (!textAlign) return \"\"\n return `text-${textAlign}`\n}\n\nexport const textAlignDefaultProps = {\n textAlign: \"left\" as const,\n}\n","\"use client\"\n\nimport { createContext, useContext, useMemo } from \"react\"\nimport { Menu as MenuPrimitive } from \"@base-ui/react/menu\"\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst cssAnimationPresets = {\n none: \"transition-none\",\n scale: [\n `[transition-property:scale,opacity] [will-change:scale,opacity]`,\n `data-starting-style:scale-80 data-starting-style:opacity-0 data-ending-style:opacity-0 data-ending-style:scale-80`,\n ],\n fade: [\n `[transition-property:opacity] [will-change:opacity]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0`,\n ],\n slideOutside: [\n `[transition-property:translate,opacity] [will-change:translate,opacity]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:translate-y-[10px] data-[side=bottom]:data-ending-style:translate-y-[10px] data-[side=bottom]:data-ending-style:opacity-0`,\n // side=top\n `data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:translate-y-[-10px] data-[side=top]:data-ending-style:translate-y-[-10px] data-[side=top]:data-ending-style:opacity-0`,\n // side=left\n `data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:translate-x-[-10px] data-[side=left]:data-ending-style:translate-x-[-10px] data-[side=left]:data-ending-style:opacity-0`,\n // side=right\n `data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:translate-x-[10px] data-[side=right]:data-ending-style:translate-x-[10px] data-[side=right]:data-ending-style:opacity-0`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:translate-x-[-10px] data-[side=inline-start]:data-ending-style:translate-x-[-10px] data-[side=inline-start]:data-ending-style:opacity-0`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:translate-x-[10px] data-[side=inline-end]:data-ending-style:translate-x-[10px] data-[side=inline-end]:data-ending-style:opacity-0`,\n ],\n slideInside: [\n `[transition-property:translate,opacity] [will-change:translate,opacity]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:translate-y-[-10px] data-[side=bottom]:data-ending-style:translate-y-[-10px] data-[side=bottom]:data-ending-style:opacity-0`,\n // side=top\n `data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:translate-y-[10px] data-[side=top]:data-ending-style:translate-y-[10px] data-[side=top]:data-ending-style:opacity-0`,\n // side=left\n `data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:translate-x-[10px] data-[side=left]:data-ending-style:translate-x-[10px] data-[side=left]:data-ending-style:opacity-0`,\n // side=right\n `data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:translate-x-[-10px] data-[side=right]:data-ending-style:translate-x-[-10px] data-[side=right]:data-ending-style:opacity-0`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:translate-x-[10px] data-[side=inline-start]:data-ending-style:translate-x-[10px] data-[side=inline-start]:data-ending-style:opacity-0`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:translate-x-[-10px] data-[side=inline-end]:data-ending-style:translate-x-[-10px] data-[side=inline-end]:data-ending-style:opacity-0`,\n ],\n wipe: [\n `[transition-property:clip-path] [will-change:clip-path]`,\n `[clip-path:inset(0_0_0_0_round_12px)] [-webkit-clip-path:inset(0_0_0_0_round_12px)]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:[clip-path:inset(0_0_100%_0_round_12px)] data-[side=bottom]:data-ending-style:[clip-path:inset(0_0_100%_0_round_12px)]`,\n // side=top\n `data-[side=top]:data-starting-style:[clip-path:inset(100%_0_0_0_round_12px)] data-[side=top]:data-ending-style:[clip-path:inset(100%_0_0_0_round_12px)]`,\n // side=left\n `data-[side=left]:data-starting-style:[clip-path:inset(0_0_0_100%_round_12px)] data-[side=left]:data-ending-style:[clip-path:inset(0_0_0_100%_round_12px)]`,\n // side=right\n `data-[side=right]:data-starting-style:[clip-path:inset(0_100%_0_0_round_12px)] data-[side=right]:data-ending-style:[clip-path:inset(0_100%_0_0_round_12px)]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:[clip-path:inset(0_0_0_100%_round_12px)] data-[side=inline-start]:data-ending-style:[clip-path:inset(0_0_0_100%_round_12px)]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:[clip-path:inset(0_100%_0_0_round_12px)] data-[side=inline-end]:data-ending-style:[clip-path:inset(0_100%_0_0_round_12px)]`,\n ],\n wipeScale: [\n `[transition-property:clip-path,scale] [will-change:clip-path,scale]`,\n `[clip-path:inset(0_0_0_0_round_12px)] [-webkit-clip-path:inset(0_0_0_0_round_12px)]`,\n `data-starting-style:scale-80 data-ending-style:scale-80`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:[clip-path:inset(0_0_100%_0_round_12px)] data-[side=bottom]:data-ending-style:[clip-path:inset(0_0_100%_0_round_12px)]`,\n // side=top\n `data-[side=top]:data-starting-style:[clip-path:inset(100%_0_0_0_round_12px)] data-[side=top]:data-ending-style:[clip-path:inset(100%_0_0_0_round_12px)]`,\n // side=left\n `data-[side=left]:data-starting-style:[clip-path:inset(0_0_0_100%_round_12px)] data-[side=left]:data-ending-style:[clip-path:inset(0_0_0_100%_round_12px)]`,\n // side=right\n `data-[side=right]:data-starting-style:[clip-path:inset(0_100%_0_0_round_12px)] data-[side=right]:data-ending-style:[clip-path:inset(0_100%_0_0_round_12px)]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:[clip-path:inset(0_0_0_100%_round_12px)] data-[side=inline-start]:data-ending-style:[clip-path:inset(0_0_0_100%_round_12px)]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:[clip-path:inset(0_100%_0_0_round_12px)] data-[side=inline-end]:data-ending-style:[clip-path:inset(0_100%_0_0_round_12px)]`,\n ],\n motion: [\n `[transition-property:translate,scale,opacity,rotateX,rotateY,transform] [will-change:translate,scale,opacity,rotateX,rotateY,transform]`,\n `[transform:perspective(1000px)]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:translate-y-[7px] data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:scale-[0.26] data-[side=bottom]:data-starting-style:rotate-x-[70deg] data-[side=bottom]:data-ending-style:translate-y-[7px] data-[side=bottom]:data-ending-style:opacity-0 data-[side=bottom]:data-ending-style:scale-[0.26] data-[side=bottom]:data-ending-style:rotate-x-[70deg]`,\n // side=top\n `data-[side=top]:data-starting-style:translate-y-[7px] data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:scale-[0.26] data-[side=top]:data-starting-style:rotate-x-[70deg] data-[side=top]:data-ending-style:translate-y-[7px] data-[side=top]:data-ending-style:opacity-0 data-[side=top]:data-ending-style:scale-[0.26] data-[side=top]:data-ending-style:rotate-x-[70deg]`,\n // side=left\n `data-[side=left]:data-starting-style:translate-x-[-7px] data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:scale-[0.26] data-[side=left]:data-starting-style:rotate-y-[-40deg] data-[side=left]:data-ending-style:translate-x-[-7px] data-[side=left]:data-ending-style:opacity-0 data-[side=left]:data-ending-style:scale-[0.26] data-[side=left]:data-ending-style:rotate-y-[-40deg]`,\n // side=right\n `data-[side=right]:data-starting-style:translate-x-[7px] data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:scale-[0.26] data-[side=right]:data-starting-style:rotate-y-[40deg] data-[side=right]:data-ending-style:translate-x-[7px] data-[side=right]:data-ending-style:opacity-0 data-[side=right]:data-ending-style:scale-[0.26] data-[side=right]:data-ending-style:rotate-y-[40deg]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:translate-x-[-7px] data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:scale-[0.26] data-[side=inline-start]:data-starting-style:rotate-y-[-40deg] data-[side=inline-start]:data-ending-style:translate-x-[-7px] data-[side=inline-start]:data-ending-style:opacity-0 data-[side=inline-start]:data-ending-style:scale-[0.26] data-[side=inline-start]:data-ending-style:rotate-y-[-40deg]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:translate-x-[7px] data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:scale-[0.26] data-[side=inline-end]:data-starting-style:rotate-y-[40deg] data-[side=inline-end]:data-ending-style:translate-x-[7px] data-[side=inline-end]:data-ending-style:opacity-0 data-[side=inline-end]:data-ending-style:scale-[0.26] data-[side=inline-end]:data-ending-style:rotate-y-[40deg]`,\n ],\n motionBlur: [\n `[transition-property:translate,scale,opacity,rotateX,rotateY,transform,filter] [will-change:translate,scale,opacity,rotateX,rotateY,transform,filter]`,\n `[transform:perspective(1000px)]`,\n `data-starting-style:blur-[9px] data-ending-style:blur-[9px]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:translate-y-[7px] data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:scale-[0.26] data-[side=bottom]:data-starting-style:rotate-x-[70deg] data-[side=bottom]:data-ending-style:translate-y-[7px] data-[side=bottom]:data-ending-style:opacity-0 data-[side=bottom]:data-ending-style:scale-[0.26] data-[side=bottom]:data-ending-style:rotate-x-[70deg]`,\n // side=top\n `data-[side=top]:data-starting-style:translate-y-[7px] data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:scale-[0.26] data-[side=top]:data-starting-style:rotate-x-[70deg] data-[side=top]:data-ending-style:translate-y-[7px] data-[side=top]:data-ending-style:opacity-0 data-[side=top]:data-ending-style:scale-[0.26] data-[side=top]:data-ending-style:rotate-x-[70deg]`,\n // side=left\n `data-[side=left]:data-starting-style:translate-x-[-7px] data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:scale-[0.26] data-[side=left]:data-starting-style:rotate-y-[-40deg] data-[side=left]:data-ending-style:translate-x-[-7px] data-[side=left]:data-ending-style:opacity-0 data-[side=left]:data-ending-style:scale-[0.26] data-[side=left]:data-ending-style:rotate-y-[-40deg]`,\n // side=right\n `data-[side=right]:data-starting-style:translate-x-[7px] data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:scale-[0.26] data-[side=right]:data-starting-style:rotate-y-[40deg] data-[side=right]:data-ending-style:translate-x-[7px] data-[side=right]:data-ending-style:opacity-0 data-[side=right]:data-ending-style:scale-[0.26] data-[side=right]:data-ending-style:rotate-y-[40deg]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:translate-x-[-7px] data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:scale-[0.26] data-[side=inline-start]:data-starting-style:rotate-y-[-40deg] data-[side=inline-start]:data-ending-style:translate-x-[-7px] data-[side=inline-start]:data-ending-style:opacity-0 data-[side=inline-start]:data-ending-style:scale-[0.26] data-[side=inline-start]:data-ending-style:rotate-y-[-40deg]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:translate-x-[7px] data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:scale-[0.26] data-[side=inline-end]:data-starting-style:rotate-y-[40deg] data-[side=inline-end]:data-ending-style:translate-x-[7px] data-[side=inline-end]:data-ending-style:opacity-0 data-[side=inline-end]:data-ending-style:scale-[0.26] data-[side=inline-end]:data-ending-style:rotate-y-[40deg]`,\n ],\n}\n\nconst cssTransitionPresets = {\n inExpo: `duration-[0.35s] ease-[cubic-bezier(0.95,0.05,0.795,0.035)]`,\n outExpo: `duration-[0.35s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n inOutExpo: `duration-[0.35s] ease-[cubic-bezier(1,0,0,1)]`,\n anticipate: `duration-[0.35s] ease-[cubic-bezier(1,-0.4,0.35,0.95)]`,\n quickOut: `duration-[0.35s] ease-out`,\n overshootOut: `duration-[0.35s] ease-[cubic-bezier(0.175,0.885,0.32,1.275)]`,\n swiftOut: `duration-[0.35s] ease-[cubic-bezier(0.175,0.885,0.32,1.1)]`,\n snappyOut: `duration-[0.35s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n in: `duration-[0.35s] ease-[cubic-bezier(0.42,0,1,1)]`,\n out: `duration-[0.35s] ease-[cubic-bezier(0,0,0.58,1)]`,\n inOut: `duration-[0.25s] ease-[cubic-bezier(0.42,0,0.58,1)]`,\n outIn: `duration-[0.35s] ease-[cubic-bezier(0.1,0.7,0.9,0.5)]`,\n inQuad: `duration-[0.35s] ease-[cubic-bezier(0.55,0.085,0.68,0.53)]`,\n outQuad: `duration-[0.25s] ease-[cubic-bezier(0.25,0.46,0.45,0.94)]`,\n inOutQuad: `duration-[0.32s] ease-[cubic-bezier(0.455,0.03,0.515,0.955)]`,\n inCubic: `duration-[0.35s] ease-[cubic-bezier(0.55,0.055,0.675,0.19)]`,\n outCubic: `duration-[0.35s] ease-[cubic-bezier(0.215,0.61,0.355,1)]`,\n inOutCubic: `duration-[0.35s] ease-[cubic-bezier(0.645,0.045,0.355,1)]`,\n inQuart: `duration-[0.35s] ease-[cubic-bezier(0.895,0.03,0.685,0.22)]`,\n outQuart: `duration-[0.35s] ease-[cubic-bezier(0.165,0.84,0.44,1)]`,\n inOutQuart: `duration-[0.35s] ease-[cubic-bezier(0.77,0,0.175,1)]`,\n inQuint: `duration-[0.35s] ease-[cubic-bezier(0.755,0.05,0.855,0.06)]`,\n outQuint: `duration-[0.35s] ease-[cubic-bezier(0.23,1,0.32,1)]`,\n inOutQuint: `duration-[0.35s] ease-[cubic-bezier(0.86,0,0.07,1)]`,\n inCirc: `duration-[0.35s] ease-[cubic-bezier(0.6,0.04,0.98,0.335)]`,\n outCirc: `duration-[0.35s] ease-[cubic-bezier(0.075,0.82,0.165,1)]`,\n inOutCirc: `duration-[0.35s] ease-[cubic-bezier(0.785,0.135,0.15,0.86)]`,\n inOutBase: `duration-[0.35s] ease-[cubic-bezier(0.25,0.1,0.25,1)]`,\n}\n\ntype CSSAnimationPresets = keyof typeof cssAnimationPresets\ntype CSSTransitionPresets = keyof typeof cssTransitionPresets\n\ntype Backdrop = \"opaque\" | \"blur\" | \"transparent\"\n\ninterface MenuContextType {\n backdrop?: Backdrop\n}\n\nconst MenuContext = createContext<MenuContextType | undefined>(undefined)\n\nfunction useMenu() {\n const context = useContext(MenuContext)\n if (!context) {\n throw new Error(\"useMenu must be used within a MenuProvider\")\n }\n return context\n}\n\ninterface MenuProps extends MenuPrimitive.Root.Props {\n backdrop?: Backdrop\n}\n\nfunction Menu({ backdrop = \"transparent\", ...props }: MenuProps) {\n return (\n <MenuContext.Provider value={{ backdrop }}>\n <MenuPrimitive.Root data-slot=\"menu\" {...props} />\n </MenuContext.Provider>\n )\n}\n\ninterface MenuTriggerProps extends MenuPrimitive.Trigger.Props {}\n\nfunction MenuTrigger({ ...props }: MenuTriggerProps) {\n return <MenuPrimitive.Trigger data-slot=\"menu-trigger\" {...props} />\n}\n\ninterface MenuPortalProps extends MenuPrimitive.Portal.Props {}\n\nfunction MenuPortal(props: MenuPortalProps) {\n return <MenuPrimitive.Portal data-slot=\"menu-portal\" {...props} />\n}\n\ninterface MenuBackdropProps extends MenuPrimitive.Backdrop.Props {}\n\nfunction MenuBackdrop({ className, ...props }: MenuBackdropProps) {\n const { backdrop = \"transparent\" } = useMenu()\n\n return (\n <MenuPrimitive.Backdrop\n data-slot=\"menu-backdrop\"\n className={cn(\n backdrop === \"opaque\" &&\n \"fixed inset-0 z-100 bg-black opacity-40 transition-all duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:opacity-60\",\n backdrop === \"blur\" &&\n \"fixed inset-0 z-100 backdrop-blur-sm transition-all duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0\",\n backdrop === \"transparent\" && \"hidden\",\n className\n )}\n {...props}\n />\n )\n}\n\ninterface MenuPositionerProps extends MenuPrimitive.Positioner.Props {}\n\nfunction MenuPositioner({\n sideOffset = 4,\n side = \"bottom\",\n className,\n ...rest\n}: MenuPositionerProps) {\n return (\n <MenuPortal>\n <MenuBackdrop />\n <MenuPrimitive.Positioner\n sideOffset={sideOffset}\n side={side}\n data-slot=\"menu-positioner\"\n className={cn(\n \"z-100 [--item-block-padding:6px] [--item-inline-padding:8px]\",\n (side === \"inline-end\" || side === \"inline-start\") &&\n \"**:data-[slot=menu-arrow]:hidden\",\n className\n )}\n {...rest}\n />\n </MenuPortal>\n )\n}\n\ninterface MenuArrowProps extends MenuPrimitive.Arrow.Props {}\n\nfunction MenuArrow({ className, ...rest }: MenuArrowProps) {\n return (\n <MenuPrimitive.Arrow\n data-slot=\"menu-arrow\"\n className={cn(\n \"data-[side=bottom]:top-[-9px] data-[side=left]:right-[-14px] data-[side=left]:rotate-90 data-[side=right]:left-[-14px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-9px] data-[side=top]:rotate-180\",\n className\n )}\n {...rest}\n />\n )\n}\n\nfunction ArrowSvg(props: React.ComponentProps<\"svg\">) {\n return (\n <svg width=\"20\" height=\"10\" viewBox=\"0 0 20 10\" fill=\"none\" {...props}>\n <path\n d=\"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\"\n className=\"fill-popover\"\n />\n <path\n d=\"M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z\"\n className=\"fill-border/60\"\n />\n </svg>\n )\n}\n\ninterface MenuPopupProps\n extends\n MenuPrimitive.Popup.Props,\n Pick<\n MenuPositionerProps,\n \"side\" | \"sideOffset\" | \"align\" | \"alignOffset\"\n > {\n animationPreset?: CSSAnimationPresets\n transitionPreset?: CSSTransitionPresets\n reduceMotion?: boolean\n showArrow?: boolean\n}\n\nfunction MenuPopup({\n className,\n animationPreset = \"scale\",\n transitionPreset = \"snappyOut\",\n reduceMotion = false,\n showArrow = false,\n side = \"bottom\",\n sideOffset = 4,\n align = \"center\",\n alignOffset = 0,\n children,\n ...rest\n}: MenuPopupProps) {\n const cssAnimationConfig = useMemo(() => {\n if (reduceMotion) return \"none\"\n\n if (animationPreset) {\n return cssAnimationPresets[animationPreset]\n }\n\n return cssAnimationPresets.scale\n }, [animationPreset, reduceMotion, side])\n\n const cssTransitionConfig = useMemo(() => {\n if (reduceMotion) return \"none\"\n\n if (transitionPreset) {\n return cssTransitionPresets[transitionPreset]\n }\n\n return cssTransitionPresets.snappyOut\n }, [transitionPreset, reduceMotion, side])\n\n return (\n <MenuPositioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n >\n <MenuPrimitive.Popup\n data-slot=\"menu-popup\"\n render={\n <div\n key=\"menu-popup\"\n className={cn(\n \"bg-popover text-popover-foreground border-border/60 pointer-events-auto w-[max(var(--anchor-width),226px)] origin-(--transform-origin) rounded-[12px] border p-1 shadow-xs\",\n className,\n cssTransitionConfig,\n cssAnimationConfig\n )}\n >\n {showArrow && (\n <MenuArrow>\n <ArrowSvg />\n </MenuArrow>\n )}\n {children}\n </div>\n }\n {...rest}\n />\n </MenuPositioner>\n )\n}\n\ninterface MenuGroupProps extends MenuPrimitive.Group.Props {}\n\nfunction MenuGroup(props: MenuGroupProps) {\n return <MenuPrimitive.Group data-slot=\"menu-group\" {...props} />\n}\n\ninterface MenuGroupLabelProps extends MenuPrimitive.GroupLabel.Props {}\n\nfunction MenuGroupLabel({ className, ...rest }: MenuGroupLabelProps) {\n return (\n <MenuPrimitive.GroupLabel\n data-slot=\"menu-group-label\"\n className={cn(\n \"text-muted-foreground px-2 py-1.5 text-xs font-medium\",\n className\n )}\n {...rest}\n />\n )\n}\n\nfunction MenuLabel({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"menu-label\"\n className={cn(\n \"text-muted-foreground px-2 py-1.5 text-xs font-medium\",\n className\n )}\n {...props}\n />\n )\n}\n\ninterface MenuItemProps extends MenuPrimitive.Item.Props {}\n\nfunction MenuItem({ className, ...rest }: MenuItemProps) {\n return (\n <MenuPrimitive.Item\n data-slot=\"menu-item\"\n className={cn(\n `relative flex cursor-default items-center gap-2 rounded-[10px] border-[0.5px] border-transparent px-(--item-inline-padding) py-(--item-block-padding) text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,\n `data-highlighted:before:bg-accent/70 dark:data-highlighted:before:bg-accent data-highlighted:text-accent-foreground data-highlighted:before:border-border/30 data-highlighted:z-0 data-highlighted:before:absolute data-highlighted:before:-inset-px data-highlighted:before:z-[-1] data-highlighted:before:rounded-[10px] data-highlighted:before:border`,\n className\n )}\n {...rest}\n />\n )\n}\n\nfunction MenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props) {\n return (\n <MenuPrimitive.Separator\n data-slot=\"menu-separator\"\n className={cn(\"bg-border/30 -mx-1 my-1 h-[0.5px]\", className)}\n {...props}\n />\n )\n}\n\ninterface MenuCheckboxItemProps extends MenuPrimitive.CheckboxItem.Props {}\n\nfunction MenuCheckboxItem({\n className,\n children,\n ...rest\n}: MenuCheckboxItemProps) {\n return (\n <MenuPrimitive.CheckboxItem\n data-slot=\"menu-checkbox-item\"\n className={cn(\n `text-foreground relative flex cursor-default items-center gap-2 rounded-[10px] border-[0.5px] border-transparent px-2 py-1.5 text-sm`,\n `hover:bg-accent/70 focus-visible:bg-accent/70 dark:hover:bg-accent dark:focus-visible:bg-accent hover:text-accent-foreground hover:border-border/30 outline-hidden`,\n className\n )}\n {...rest}\n >\n <span className=\"pointer-events-none absolute right-2 flex size-3.5 items-center justify-center\">\n <MenuPrimitive.CheckboxItemIndicator>\n <CheckIcon className=\"size-4\" />\n </MenuPrimitive.CheckboxItemIndicator>\n </span>\n {children}\n </MenuPrimitive.CheckboxItem>\n )\n}\n\ninterface MenuRadioGroupContextType {\n activeIcon?: React.ReactNode\n}\n\nconst MenuRadioGroupContext = createContext<MenuRadioGroupContextType>({})\n\ninterface MenuRadioGroupProps extends MenuPrimitive.RadioGroup.Props {\n activeIcon?: React.ReactNode\n}\n\nfunction MenuRadioGroup({ activeIcon, ...props }: MenuRadioGroupProps) {\n return (\n <MenuRadioGroupContext.Provider value={{ activeIcon }}>\n <MenuPrimitive.RadioGroup data-slot=\"menu-radio-group\" {...props} />\n </MenuRadioGroupContext.Provider>\n )\n}\n\nfunction MenuRadioItem({\n className,\n children,\n value,\n ...props\n}: MenuPrimitive.RadioItem.Props) {\n const { activeIcon } = useContext(MenuRadioGroupContext)\n\n return (\n <MenuPrimitive.RadioItem\n data-slot=\"menu-radio-item\"\n className={cn(\n `text-foreground relative flex cursor-default items-center gap-2 rounded-[10px] border-[0.5px] border-transparent px-2 py-1.5 text-sm`,\n `hover:bg-accent/70 focus-visible:bg-accent/70 dark:hover:bg-accent dark:focus-visible:bg-accent hover:text-accent-foreground hover:border-border/30 outline-hidden`,\n className\n )}\n value={value}\n {...props}\n >\n {children}\n <span\n className=\"pointer-events-none absolute right-2 flex size-3.5 items-center justify-center\"\n style={{\n willChange: \"transform\",\n }}\n >\n <MenuPrimitive.RadioItemIndicator>\n {activeIcon ?? (\n <CircleIcon className=\"size-2 fill-current\" />\n )}\n </MenuPrimitive.RadioItemIndicator>\n </span>\n </MenuPrimitive.RadioItem>\n )\n}\n\nfunction MenuShortcut({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"menu-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className\n )}\n {...props}\n />\n )\n}\n\ninterface MenuSubProps extends MenuPrimitive.SubmenuRoot.Props {}\n\nfunction MenuSub(props: MenuSubProps) {\n return <MenuPrimitive.SubmenuRoot data-slot=\"menu-submenu\" {...props} />\n}\n\ninterface MenuSubTriggerProps extends MenuPrimitive.SubmenuTrigger.Props {}\n\nfunction MenuSubTrigger({ className, children, ...rest }: MenuSubTriggerProps) {\n return (\n <MenuPrimitive.SubmenuTrigger\n data-slot=\"menu-submenu-trigger\"\n className={cn(\n `text-foreground relative flex cursor-default items-center gap-2 rounded-[10px] border-[0.5px] border-transparent px-(--item-inline-padding) py-(--item-block-padding) text-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,\n `hover:bg-accent/70 focus-visible:bg-accent/70 dark:hover:bg-accent dark:focus-visible:bg-accent hover:text-accent-foreground hover:border-border/30 data-popup-open:bg-accent/70 data-popup-open:text-accent-foreground data-popup-open:border-border/30 outline-hidden`,\n className\n )}\n {...rest}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </MenuPrimitive.SubmenuTrigger>\n )\n}\n\ninterface MenuSubmenuPortalProps extends MenuPrimitive.Portal.Props {}\n\nfunction MenuSubmenuPortal(props: MenuSubmenuPortalProps) {\n return <MenuPrimitive.Portal data-slot=\"menu-submenu-portal\" {...props} />\n}\n\ninterface MenuSubPositionerProps extends MenuPrimitive.Positioner.Props {}\n\nfunction MenuSubPositioner({\n sideOffset = 4,\n side = \"right\",\n className,\n ...rest\n}: MenuSubPositionerProps) {\n return (\n <MenuSubmenuPortal>\n <MenuPrimitive.Positioner\n sideOffset={sideOffset}\n side={side}\n data-slot=\"menu-sub-positioner \"\n className={cn(\n \"-top-[calc(var(--item-block-padding)-1.8px)]! z-100 [--item-block-padding:6px] [--item-inline-padding:8px]\",\n (side === \"inline-end\" || side === \"inline-start\") &&\n \"**:data-[slot=menu-arrow]:hidden\",\n className\n )}\n {...rest}\n />\n </MenuSubmenuPortal>\n )\n}\n\ninterface MenuSubPopupProps\n extends\n MenuPrimitive.Popup.Props,\n Pick<\n MenuPositionerProps,\n \"side\" | \"sideOffset\" | \"align\" | \"alignOffset\"\n > {}\n\nfunction MenuSubPopup({\n className,\n children,\n side = \"right\",\n sideOffset = 4,\n align = \"start\",\n alignOffset = 0,\n ...rest\n}: MenuSubPopupProps) {\n return (\n <MenuSubPositioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n >\n <MenuPrimitive.Popup\n data-slot=\"menu-sub-content\"\n render={\n <div\n key=\"menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground border-border/60 pointer-events-auto min-w-[max(8rem,calc(var(--anchor-width)-1rem))]! origin-(--transform-origin) rounded-[12px] border p-1 shadow-sm\",\n cssAnimationPresets.scale,\n cssTransitionPresets.snappyOut,\n className\n )}\n >\n {children}\n </div>\n }\n {...rest}\n />\n </MenuSubPositioner>\n )\n}\n\nexport {\n Menu,\n MenuTrigger,\n MenuPopup,\n MenuGroup,\n MenuGroupLabel,\n MenuItem,\n MenuSeparator,\n MenuCheckboxItem,\n MenuRadioGroup,\n MenuRadioItem,\n MenuSub,\n MenuSubTrigger,\n MenuSubPopup,\n MenuShortcut,\n MenuLabel,\n}\n","\"use client\"\n\nimport React from \"react\"\nimport { HexColorPicker } from \"react-colorful\"\nimport { Menu as MenuBaseUI, MenuTrigger, MenuPopup } from \"../ui/menu\"\nimport { Input } from \"../ui/input\"\nimport { ChevronDownIcon } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils\"\n\nexport type ColorPickerProps = {\n value?: string\n onChange: (value: string) => void\n}\n\nconst PREDEFINED_COLORS = [\n { name: \"Blue\", value: \"#3B82F6\" },\n { name: \"Purple\", value: \"#8B5CF6\" },\n { name: \"Pink\", value: \"#EC4899\" },\n { name: \"Rose\", value: \"#F43F5E\" },\n { name: \"Red\", value: \"#EF4444\" },\n { name: \"Orange\", value: \"#F97316\" },\n { name: \"Amber\", value: \"#F59E0B\" },\n { name: \"Green\", value: \"#10B981\" },\n]\n\nconst GRAY_COLORS = [\n { name: \"Black\", value: \"#000000\" },\n { name: \"Gray 900\", value: \"#18181B\" },\n { name: \"Gray 600\", value: \"#52525B\" },\n { name: \"Gray 300\", value: \"#D4D4D8\" },\n { name: \"Gray 200\", value: \"#E4E4E7\" },\n { name: \"Gray 100\", value: \"#F4F4F5\" },\n { name: \"White\", value: \"#FFFFFF\" },\n]\n\nexport const ColorPicker: React.FC<ColorPickerProps> = ({\n value,\n onChange,\n}) => {\n const handleColorSelect = (color: string) => {\n onChange(color)\n }\n\n const handleClearColor = () => {\n onChange(\"\")\n }\n\n return (\n <MenuBaseUI>\n <MenuTrigger\n className={cn(\n \"border-input text-foreground focus-visible:border-primary hover:bg-accent w-full justify-between gap-2 rounded-md border bg-white px-3 py-2 text-sm transition-colors\",\n \"flex items-center\"\n )}\n >\n {value ? (\n <>\n <div\n className=\"border-border size-5 rounded-md border\"\n style={{ backgroundColor: value }}\n />\n <span className=\"flex-1 text-left\">{value}</span>\n </>\n ) : (\n <div className=\"flex items-center justify-start gap-2\">\n <div className=\"border-border after:bg-destructive relative size-5 rounded-md border bg-white after:absolute after:inset-0 after:top-1/2 after:left-1/2 after:z-1 after:flex after:h-0.5 after:w-7 after:-translate-x-1/2 after:-translate-y-1/2 after:-rotate-45 after:rounded-full after:content-['']\"></div>\n <span>No color</span>\n </div>\n )}\n <ChevronDownIcon className=\"size-4\" />\n </MenuTrigger>\n <MenuPopup align=\"start\" side=\"bottom\">\n <div className=\"flex flex-col gap-3 p-2\">\n <div className=\"flex flex-col gap-3\">\n <button\n type=\"button\"\n onClick={handleClearColor}\n className=\"border-border after:bg-destructive relative size-5 cursor-pointer rounded-md border bg-white after:absolute after:inset-0 after:top-1/2 after:left-1/2 after:z-1 after:flex after:h-0.5 after:w-7 after:-translate-x-1/2 after:-translate-y-1/2 after:-rotate-45 after:rounded-full after:content-['']\"\n title=\"Clear color\"\n aria-label=\"Clear color\"\n ></button>\n <div className=\"flex flex-wrap gap-1\">\n {PREDEFINED_COLORS.map((color) => (\n <button\n key={color.value}\n type=\"button\"\n className={cn(\n \"border-primary/20 size-5 cursor-pointer rounded-md border transition-all hover:scale-105\"\n )}\n style={{ backgroundColor: color.value }}\n onClick={() =>\n handleColorSelect(color.value)\n }\n title={color.name}\n aria-label={color.name}\n />\n ))}\n {GRAY_COLORS.map((color) => (\n <button\n key={color.value}\n type=\"button\"\n className={cn(\n \"border-primary/20 size-5 cursor-pointer rounded-md border transition-all hover:scale-105\"\n )}\n style={{ backgroundColor: color.value }}\n onClick={() =>\n handleColorSelect(color.value)\n }\n title={color.name}\n aria-label={color.name}\n />\n ))}\n </div>\n </div>\n\n <div className=\"flex flex-col gap-1.5\">\n <div className=\"text-xs font-medium\">Custom Color</div>\n <div className=\"flex flex-col gap-2\">\n <HexColorPicker\n color={value || \"#000000\"}\n onChange={handleColorSelect}\n className=\"!w-full\"\n />\n <Input\n type=\"text\"\n value={value || \"\"}\n onChange={(e) =>\n handleColorSelect(e.target.value)\n }\n placeholder=\"Select a color\"\n />\n </div>\n </div>\n </div>\n </MenuPopup>\n </MenuBaseUI>\n )\n}\n\nexport default ColorPicker\n","import { Fields } from \"@measured/puck\"\nimport ColorPicker from \"../components/ColorPicker\"\nimport Label from \"../components/Fields/Label\"\n\nexport type TextColorTraitProps = {\n textColor?: string\n}\n\nexport const textColorField: Fields = {\n textColor: {\n type: \"custom\",\n label: \"Text color\",\n render: ({ value, onChange, field }) => (\n <>\n <Label label={field.label} />\n <div className=\"rounded-md border border-dashed border-lime-500 bg-lime-500/10 p-3\">\n <ColorPicker value={value} onChange={onChange} />\n </div>\n </>\n ),\n },\n}\n\nexport function textColorToClasses(textColor?: string): string {\n if (!textColor) return \"\"\n return `text-[${textColor}]`\n}\n\nexport const textColorDefaultProps = {\n textColor: undefined as string | undefined,\n}\n","import React from \"react\"\nimport { Fields } from \"@measured/puck\"\nimport {\n BoldIcon,\n ItalicIcon,\n UnderlineIcon,\n StrikethroughIcon,\n LightbulbIcon,\n} from \"lucide-react\"\n\nexport type TextDecorationTraitProps = {\n textDecoration?: Array<\n \"bold\" | \"light\" | \"italic\" | \"underline\" | \"line-through\"\n >\n}\n\nexport const textDecorationField: Fields = {\n textDecoration: {\n type: \"checkbox\",\n label: \"Text decoration\",\n layout: \"horizontal\",\n options: [\n { label: <BoldIcon size={16} />, value: \"bold\" },\n { label: <LightbulbIcon size={16} />, value: \"light\" },\n { label: <ItalicIcon size={16} />, value: \"italic\" },\n { label: <UnderlineIcon size={16} />, value: \"underline\" },\n { label: <StrikethroughIcon size={16} />, value: \"line-through\" },\n ],\n },\n}\n\nexport function textDecorationToClasses(\n textDecoration?: Array<\n \"bold\" | \"light\" | \"italic\" | \"underline\" | \"line-through\"\n >\n): string {\n if (!textDecoration || textDecoration.length === 0) {\n return \"\"\n }\n\n const classes: string[] = []\n\n if (textDecoration.includes(\"bold\")) {\n classes.push(\"font-bold\")\n }\n if (textDecoration.includes(\"light\")) {\n classes.push(\"font-light\")\n }\n if (textDecoration.includes(\"italic\")) {\n classes.push(\"italic\")\n }\n if (textDecoration.includes(\"underline\")) {\n classes.push(\"underline\")\n }\n if (textDecoration.includes(\"line-through\")) {\n classes.push(\"line-through\")\n }\n\n return classes.join(\" \")\n}\n\nexport const textDecorationDefaultProps: TextDecorationTraitProps = {\n textDecoration: [],\n}\n","import React from \"react\"\nimport { Fields } from \"@measured/puck\"\nimport { MinusIcon } from \"lucide-react\"\n\nexport type TextSizeTraitProps = {\n textSize?:\n | \"\"\n | \"xs\"\n | \"sm\"\n | \"base\"\n | \"lg\"\n | \"xl\"\n | \"2xl\"\n | \"3xl\"\n | \"4xl\"\n | \"5xl\"\n | \"6xl\"\n | \"7xl\"\n | \"8xl\"\n | \"9xl\"\n}\n\nexport const textSizeField: Fields = {\n textSize: {\n type: \"select\",\n placeholder: <MinusIcon size={16} />,\n label: \"Text size\",\n\n options: [\n { label: <MinusIcon size={16} />, value: \"\" },\n { label: \"XS (12px)\", value: \"xs\" },\n { label: \"SM (14px)\", value: \"sm\" },\n { label: \"Base (16px)\", value: \"base\" },\n { label: \"LG (18px)\", value: \"lg\" },\n { label: \"XL (20px)\", value: \"xl\" },\n { label: \"2XL (24px)\", value: \"2xl\" },\n { label: \"3XL (30px)\", value: \"3xl\" },\n { label: \"4XL (36px)\", value: \"4xl\" },\n { label: \"5XL (48px)\", value: \"5xl\" },\n { label: \"6XL (60px)\", value: \"6xl\" },\n { label: \"7XL (72px)\", value: \"7xl\" },\n { label: \"8XL (96px)\", value: \"8xl\" },\n { label: \"9XL (128px)\", value: \"9xl\" },\n ],\n },\n}\n\nexport function textSizeToClasses(textSize?: string): string {\n if (!textSize) return \"\"\n return `text-${textSize}`\n}\n\nexport const textSizeDefaultProps = {\n textSize: \"\" as const,\n}\n","import React from \"react\"\nimport { Fields } from \"@measured/puck\"\nimport {\n CaseUpperIcon,\n CaseLowerIcon,\n CaseSensitiveIcon,\n MinusIcon,\n} from \"lucide-react\"\n\nexport type TextTransformTraitProps = {\n textTransform?: \"none\" | \"uppercase\" | \"lowercase\" | \"capitalize\"\n}\n\nexport const textTransformField: Fields = {\n textTransform: {\n type: \"radio\",\n label: \"Text transform\",\n options: [\n { label: <MinusIcon size={16} />, value: \"none\" },\n { label: <CaseUpperIcon size={16} />, value: \"uppercase\" },\n { label: <CaseLowerIcon size={16} />, value: \"lowercase\" },\n { label: <CaseSensitiveIcon size={16} />, value: \"capitalize\" },\n ],\n },\n}\n\nexport function textTransformToClasses(textTransform?: string): string {\n if (!textTransform || textTransform === \"none\") return \"\"\n return textTransform\n}\n\nexport const textTransformDefaultProps = {\n textTransform: \"none\" as const,\n}\n","export * from './textAlign'\nexport * from './textTransform'\nexport * from './textDecoration'\nexport * from './textSize'\nexport * from './textColor'\nexport * from './lineHeight'\nexport * from './fontWeight'\n\nimport { TextAlignTraitProps, textAlignField, textAlignDefaultProps, textAlignToClasses } from './textAlign'\nimport {\n TextTransformTraitProps,\n textTransformField,\n textTransformDefaultProps,\n textTransformToClasses,\n} from './textTransform'\nimport {\n TextDecorationTraitProps,\n textDecorationField,\n textDecorationDefaultProps,\n textDecorationToClasses,\n} from './textDecoration'\nimport { TextSizeTraitProps, textSizeField, textSizeDefaultProps, textSizeToClasses } from './textSize'\nimport { TextColorTraitProps, textColorField, textColorDefaultProps, textColorToClasses } from './textColor'\nimport { LineHeightTraitProps, lineHeightField, lineHeightDefaultProps, lineHeightToClasses } from './lineHeight'\nimport { FontWeightTraitProps, fontWeightField, fontWeightDefaultProps, fontWeightToClasses } from './fontWeight'\n\nexport type TypographyTraitProps = TextAlignTraitProps &\n TextTransformTraitProps &\n TextDecorationTraitProps &\n TextSizeTraitProps &\n TextColorTraitProps &\n LineHeightTraitProps &\n FontWeightTraitProps\n\nexport const typographyFields = {\n ...textAlignField,\n ...textTransformField,\n ...textDecorationField,\n ...textSizeField,\n ...textColorField,\n ...lineHeightField,\n ...fontWeightField,\n}\n\nexport const typographyDefaultProps = {\n ...textAlignDefaultProps,\n ...textTransformDefaultProps,\n ...textDecorationDefaultProps,\n ...textSizeDefaultProps,\n ...textColorDefaultProps,\n ...lineHeightDefaultProps,\n ...fontWeightDefaultProps,\n}\n\nexport function typographyToClasses(props: Partial<TypographyTraitProps>): string {\n const classes = [\n textAlignToClasses(props.textAlign),\n textTransformToClasses(props.textTransform),\n textDecorationToClasses(props.textDecoration),\n textSizeToClasses(props.textSize),\n textColorToClasses(props.textColor),\n lineHeightToClasses(props.lineHeight),\n fontWeightToClasses(props.fontWeight),\n ].filter(Boolean)\n\n return classes.join(' ')\n}\n\nexport const typographyFieldNames = [\n 'textAlign',\n 'textTransform',\n 'textDecoration',\n 'textSize',\n 'textColor',\n 'lineHeight',\n 'fontWeight',\n] as const\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAGA,SAAgB,GAAG,GAAG,QAAsB;AACxC,QAAO,QAAQ,KAAK,OAAO,CAAC;;;;;ACChC,SAASA,QAAM,EACX,WACA,UACA,UACA,GAAG,SACoD;AACvD,QACI,qBAAC;EACG,aAAU;EACV,iBAAe,WAAW,KAAK;EAC/B,WAAW,GACP,4PACA,UACH;EACD,GAAI;aAEH,UACA,YAAY,oBAAC,YAAS,WAAU,WAAW;GACxC;;;;;ACrBhB,MAAMC,WAAS,EAAE,OAAO,eACpB,oBAACC;CACa;CACV,WAAU;WAET;EACS;AAG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UC;GACb;EACJ,EACJ;;AAGL,qBAAe;;;;ACpCf,MAAM,iBAAiB,GAAG;CACtB,MAAM;EACF;EACA;EACA;EACA;EACA;EACH;CACD,UAAU;EACN,SAAS;GACL,SAAS;GACT,WACI;GACJ,SAAS;GACT,OAAO;GACP,MAAM;GACN,aACI;GACP;EACD,MAAM;GACF,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,WAAW;GACX,MAAM;GACN,WAAW;GACX,WAAW;GACd;EACD,QAAQ;GACJ,MAAM;GACN,IAAI;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,MAAM;GACT;EACJ;CACD,iBAAiB;EACb,SAAS;EACT,MAAM;EACN,QAAQ;EACX;CACJ,CAAC;AAQF,SAASC,SAAO,EACZ,WACA,UAAU,WACV,OAAO,WACP,SAAS,WACT,GAAG,SACS;AACZ,QACI,oBAACC;EACG,aAAU;EACV,WAAW,GAAG,eAAe;GAAE;GAAS;GAAM;GAAQ,CAAC,EAAE,UAAU;EACnE,GAAI;GACN;;;;;AClEV,MAAMC,wBAAsB;CACxB,MAAM;CACN,OAAO;EACH;EACA;EACA;EACH;CACD,MAAM;EACF;EACA;EACA;EACH;CACD,SAAS;EACL;EACA;EACA;EACH;CACD,YAAY;EACR;EACA;EACA;EACH;CACD,WAAW;EACP;EACA;EACA;EACH;CACD,UAAU;EACN;EACA;EACA;EACH;CACD,UAAU;EACN;EACA;EACA;EACH;CACD,aAAa;EACT;EACA;EACA;EACH;CACD,WAAW;EACP;EACA;EACA;EACH;CACD,YAAY;EACR;EACA;EACA;EACH;CACD,MAAM;EACF;EACA;EACA;EACH;CACJ;AAED,MAAMC,yBAAuB;CACzB,QAAQ;CACR,SAAS;CACT,WAAW;CACX,YAAY;CACZ,UAAU;CACV,cAAc;CACd,UAAU;CACV,WAAW;CACX,IAAI;CACJ,KAAK;CACL,OAAO;CACP,OAAO;CACP,QAAQ;CACR,SAAS;CACT,WAAW;CACX,SAAS;C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ckboxPrimitive","Checkbox","newValues: any[]","Label","CheckboxBaseUI","Input","InputPrimitive","Input","Label","InputBaseUI","cssAnimationPresets","cssTransitionPresets","Select","SelectPrimitive","ArrowSvg","Label","InputBaseUI","SelectBaseUI","Select","Label","SelectBaseUI","RadioGroup","RadioGroupPrimitive","RadioPrimitive","Radio","Label","RadioGroup","Textarea","FieldPrimitive","Label","TextareaBaseUI","Tabs","TabsPrimitive","cssAnimationPresets","cssTransitionPresets","Accordion","handleValueChange: AccordionProps[\"onValueChange\"]","value","AccordionPrimitive","handleItemOpenChange: AccordionItemProps[\"onOpenChange\"]","usePuck","result: OrganizedStructure","ungrouped: React.ReactNode[]","fieldName: string | null","Tabs","Accordion","cssAnimationPresets","cssTransitionPresets","TooltipPrimitive","Tooltip","TooltipBaseUI","ActionBar","DrawerItem","FieldGroups","Label","Checkbox","NumberUnit","Radio","Select","Input","Textarea","Button","BaseButton","cssAnimationPresets","cssTransitionPresets","Dialog","DialogPrimitive","Button","Select","PaginationUI","Input","DEFAULT_VALUE: MediaPickerValue","Input","Dialog","Button","RadioGroup","displayField: Fields","classes: string[]","displayDefaultProps: DisplayTraitProps","fontWeightField: Fields","lineHeightField: Fields","marginsField: Fields","classes: string[]","paddingsField: Fields","classes: string[]","positionField: Fields","classes: string[]","positionDefaultProps: PositionTraitProps","sizeField: Fields","classes: string[]","sizeDefaultProps: SizeTraitProps","textAlignField: Fields","Menu","MenuPrimitive","ColorPicker: React.FC<ColorPickerProps>","MenuBaseUI","Input","textColorField: Fields","Label","ColorPicker","textDecorationField: Fields","classes: string[]","textDecorationDefaultProps: TextDecorationTraitProps","textSizeField: Fields","textTransformField: Fields"],"sources":["../src/lib/utils.ts","../src/components/ui/label.tsx","../src/components/Fields/Label/index.tsx","../src/components/ui/checkbox.tsx","../src/components/Fields/Checkbox/index.tsx","../src/components/ui/input.tsx","../src/components/Fields/Input/index.tsx","../src/components/ui/select.tsx","../src/components/Fields/NumberUnit/index.tsx","../src/components/Fields/Select/index.tsx","../src/components/ui/radio.tsx","../src/components/Fields/Radio/index.tsx","../src/components/ui/textarea.tsx","../src/components/Fields/Textarea/index.tsx","../src/components/ActionBar/index.tsx","../src/components/ui/tabs.tsx","../src/components/ui/accordion.tsx","../src/components/FieldGroups/index.tsx","../src/components/ui/tooltip.tsx","../src/components/DrawerItem/index.tsx","../src/overrides/plugin.tsx","../src/components/ui/button.tsx","../src/components/ui/dialog.tsx","../src/components/ui/table.tsx","../src/components/ui/pagination.tsx","../src/components/Pagination/index.tsx","../src/components/ui/input-group.tsx","../src/components/MediaPicker/index.tsx","../src/utils/display.tsx","../src/utils/fontWeight.tsx","../src/utils/lineHeight.tsx","../src/utils/margins.tsx","../src/utils/paddings.tsx","../src/utils/position.tsx","../src/utils/size.tsx","../src/utils/spacing.tsx","../src/utils/spacingOptions.ts","../src/utils/textAlign.tsx","../src/components/ui/menu.tsx","../src/components/ColorPicker/index.tsx","../src/utils/textColor.tsx","../src/utils/textDecoration.tsx","../src/utils/textSize.tsx","../src/utils/textTransform.tsx","../src/utils/typography.tsx"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\n\nimport { cn } from \"../../lib/utils\"\nimport { LockIcon } from \"lucide-react\"\n\nfunction Label({\n className,\n readOnly,\n children,\n ...props\n}: React.ComponentProps<\"label\"> & { readOnly?: boolean }) {\n return (\n <label\n data-slot=\"label\"\n data-readonly={readOnly ? \"\" : undefined}\n className={cn(\n \"text-foreground mb-3 flex items-center justify-between 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 {children}\n {readOnly && <LockIcon className=\"size-4\" />}\n </label>\n )\n}\n\nexport { Label }\n","import { Label as LabelBaseUI } from \"../../ui/label\"\n\nconst Label = ({ label, readOnly }: { label?: string; readOnly?: boolean }) => (\n <LabelBaseUI\n readOnly={readOnly}\n >\n {label}\n </LabelBaseUI>\n)\n\nexport default Label\n","\"use client\"\n\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\"\n\nimport { cn } from \"../../lib/utils\"\nimport { CheckIcon } from \"lucide-react\"\n\ntype CheckboxLayout = \"horizontal\" | \"inline\"\n\ninterface CheckboxProps extends CheckboxPrimitive.Root.Props {\n layout?: CheckboxLayout\n}\n\nfunction Checkbox({\n className,\n layout = \"horizontal\",\n ...props\n}: CheckboxProps) {\n const isHorizontal = layout === \"horizontal\"\n\n if (isHorizontal) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[checked]:text-primary-500 border-input relative block flex shrink-0 cursor-pointer items-center justify-center rounded-md border bg-white p-2 transition-shadow outline-none hover:bg-stone-50 focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[checked]:bg-stone-50 data-[checked]:font-semibold\",\n className\n )}\n {...props}\n />\n )\n }\n\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive border-input size-5 shrink-0 rounded-sm border bg-white transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"cn-checkbox-indicator grid h-full place-content-center text-current transition-none\"\n >\n <CheckIcon className=\"size-4\" strokeWidth={3} />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n}\n\nexport { Checkbox }\nexport type { CheckboxLayout }\n","import React from \"react\"\nimport { Field, FieldProps } from \"@puckeditor/core\"\nimport Label from \"../Label\"\nimport { Checkbox as CheckboxBaseUI, CheckboxLayout } from \"../../ui/checkbox\"\n\ntype CheckboxProps = FieldProps<Field<any>> & {\n name: string\n field: Field<any> & {\n options?: ReadonlyArray<{ label: React.ReactNode; value: any }>\n layout?: CheckboxLayout\n }\n}\n\nconst Checkbox = ({\n onChange,\n value,\n readOnly,\n field,\n label,\n}: CheckboxProps & { label: string }) => {\n if (!field.options || !Array.isArray(field.options)) {\n return null\n }\n\n const selectedValues = Array.isArray(value) ? value : []\n const layout = field.layout || \"horizontal\"\n\n const handleChange = (optionValue: any, checked: unknown) => {\n if (!readOnly && typeof checked === \"boolean\") {\n let newValues: any[]\n if (checked) {\n newValues = [...selectedValues, optionValue]\n } else {\n newValues = selectedValues.filter((v) => v !== optionValue)\n }\n onChange(newValues)\n }\n }\n\n const containerClassName =\n layout === \"horizontal\"\n ? \"flex w-fit flex-wrap gap-1.5\"\n : \"flex flex-col gap-3\"\n\n return (\n <>\n <Label label={label} readOnly={readOnly} />\n <div className={containerClassName}>\n {field.options.map((option, index) => {\n const optionValue = option.value\n const key = `${String(optionValue)}-${index}`\n const isChecked = selectedValues.includes(optionValue)\n\n if (layout === \"horizontal\") {\n return (\n <label key={key} className=\"flex-1\">\n <CheckboxBaseUI\n layout=\"horizontal\"\n checked={isChecked}\n onCheckedChange={(checked) =>\n handleChange(optionValue, checked)\n }\n disabled={readOnly}\n >\n {option.label || option.value?.toString()}\n </CheckboxBaseUI>\n </label>\n )\n }\n\n return (\n <label\n key={key}\n className=\"flex cursor-pointer items-center gap-3\"\n >\n <CheckboxBaseUI\n layout=\"inline\"\n checked={isChecked}\n onCheckedChange={(checked) =>\n handleChange(optionValue, checked)\n }\n disabled={readOnly}\n />\n <span className=\"text-sm\">\n {option.label || option.value?.toString()}\n </span>\n </label>\n )\n })}\n </div>\n </>\n )\n}\n\nexport default Checkbox\n","\"use client\"\n\nimport { Input as InputPrimitive } from \"@base-ui/react/input\"\nimport { cn } from \"../../lib/utils\"\n\nexport interface InputProps extends Omit<InputPrimitive.Props, \"size\"> {\n size?: \"sm\" | \"default\" | \"lg\" | number\n}\n\nfunction Input({ className, size = \"default\", ...props }: InputProps) {\n return (\n <InputPrimitive\n data-slot=\"input\"\n className={cn(\n \"border-border bg-background dark:bg-input/32 placeholder:text-muted-foreground/80 relative h-9 w-full min-w-0 rounded-lg border px-3 py-2 text-base/5 outline-none [transition:box-shadow_150ms_ease-out] sm:text-sm\",\n // Focus State\n \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[2px]\",\n \"aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/16 dark:aria-invalid:ring-destructive/24 disabled:opacity-64 [disabled,focus-visible,aria-invalid]:shadow-none\",\n size === \"sm\" && \"h-8 px-3\",\n size === \"lg\" && \"h-10 px-6\",\n props.type === \"search\" &&\n \"[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none\",\n props.type === \"file\" &&\n \"text-muted-foreground file:text-foreground file:me-3 file:bg-transparent file:text-sm file:font-medium\",\n className\n )}\n size={typeof size === \"number\" ? size : undefined}\n {...props}\n />\n )\n}\n\nexport { Input }\n","import { Input as InputBaseUI } from \"../../ui/input\"\nimport Label from \"../Label\"\n\nconst Input = ({\n onChange,\n label,\n field,\n readOnly,\n}: {\n onChange: (value: any) => void\n label: string\n field: any\n readOnly?: boolean\n}) => (\n <>\n <Label label={label} readOnly={field.readOnly || readOnly} />\n <InputBaseUI\n type=\"text\"\n placeholder={field.placeholder}\n onChange={(e) => onChange(e.currentTarget.value)}\n readOnly={field.readOnly || readOnly}\n />\n </>\n)\n\nexport default Input\n","\"use client\"\n\nimport { createContext, useContext, useMemo } from \"react\"\nimport { Select as SelectPrimitive } from \"@base-ui/react/select\"\nimport { ChevronDownIcon, ChevronUpIcon } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst cssAnimationPresets = {\n none: \"transition-none\",\n scale: [\n `[transition-property:scale,opacity] [will-change:scale,opacity]`,\n `data-starting-style:scale-80 data-starting-style:opacity-0 data-ending-style:opacity-0 data-ending-style:scale-80`,\n ],\n fade: [\n `[transition-property:opacity] [will-change:opacity]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0`,\n ],\n slideOutside: [\n `[transition-property:translate,opacity] [will-change:translate,opacity]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:translate-y-[10px] data-[side=bottom]:data-ending-style:translate-y-[10px] data-[side=bottom]:data-ending-style:opacity-0`,\n // side=top\n `data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:translate-y-[-10px] data-[side=top]:data-ending-style:translate-y-[-10px] data-[side=top]:data-ending-style:opacity-0`,\n // side=left\n `data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:translate-x-[-10px] data-[side=left]:data-ending-style:translate-x-[-10px] data-[side=left]:data-ending-style:opacity-0`,\n // side=right\n `data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:translate-x-[10px] data-[side=right]:data-ending-style:translate-x-[10px] data-[side=right]:data-ending-style:opacity-0`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:translate-x-[-10px] data-[side=inline-start]:data-ending-style:translate-x-[-10px] data-[side=inline-start]:data-ending-style:opacity-0`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:translate-x-[10px] data-[side=inline-end]:data-ending-style:translate-x-[10px] data-[side=inline-end]:data-ending-style:opacity-0`,\n ],\n slideInside: [\n `[transition-property:translate,opacity] [will-change:translate,opacity]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:translate-y-[-10px] data-[side=bottom]:data-ending-style:translate-y-[-10px] data-[side=bottom]:data-ending-style:opacity-0`,\n // side=top\n `data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:translate-y-[10px] data-[side=top]:data-ending-style:translate-y-[10px] data-[side=top]:data-ending-style:opacity-0`,\n // side=left\n `data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:translate-x-[10px] data-[side=left]:data-ending-style:translate-x-[10px] data-[side=left]:data-ending-style:opacity-0`,\n // side=right\n `data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:translate-x-[-10px] data-[side=right]:data-ending-style:translate-x-[-10px] data-[side=right]:data-ending-style:opacity-0`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:translate-x-[10px] data-[side=inline-start]:data-ending-style:translate-x-[10px] data-[side=inline-start]:data-ending-style:opacity-0`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:translate-x-[-10px] data-[side=inline-end]:data-ending-style:translate-x-[-10px] data-[side=inline-end]:data-ending-style:opacity-0`,\n ],\n wipe: [\n `[transition-property:clip-path] [will-change:clip-path]`,\n `[clip-path:inset(0_0_0_0_round_12px)] [-webkit-clip-path:inset(0_0_0_0_round_12px)]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:[clip-path:inset(0_0_100%_0_round_12px)] data-[side=bottom]:data-ending-style:[clip-path:inset(0_0_100%_0_round_12px)]`,\n // side=top\n `data-[side=top]:data-starting-style:[clip-path:inset(100%_0_0_0_round_12px)] data-[side=top]:data-ending-style:[clip-path:inset(100%_0_0_0_round_12px)]`,\n // side=left\n `data-[side=left]:data-starting-style:[clip-path:inset(0_0_0_100%_round_12px)] data-[side=left]:data-ending-style:[clip-path:inset(0_0_0_100%_round_12px)]`,\n // side=right\n `data-[side=right]:data-starting-style:[clip-path:inset(0_100%_0_0_round_12px)] data-[side=right]:data-ending-style:[clip-path:inset(0_100%_0_0_round_12px)]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:[clip-path:inset(0_0_0_100%_round_12px)] data-[side=inline-start]:data-ending-style:[clip-path:inset(0_0_0_100%_round_12px)]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:[clip-path:inset(0_100%_0_0_round_12px)] data-[side=inline-end]:data-ending-style:[clip-path:inset(0_100%_0_0_round_12px)]`,\n ],\n wipeScale: [\n `[transition-property:clip-path,scale] [will-change:clip-path,scale]`,\n `[clip-path:inset(0_0_0_0_round_12px)] [-webkit-clip-path:inset(0_0_0_0_round_12px)]`,\n `data-starting-style:scale-80 data-ending-style:scale-80`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:[clip-path:inset(0_0_100%_0_round_12px)] data-[side=bottom]:data-ending-style:[clip-path:inset(0_0_100%_0_round_12px)]`,\n // side=top\n `data-[side=top]:data-starting-style:[clip-path:inset(100%_0_0_0_round_12px)] data-[side=top]:data-ending-style:[clip-path:inset(100%_0_0_0_round_12px)]`,\n // side=left\n `data-[side=left]:data-starting-style:[clip-path:inset(0_0_0_100%_round_12px)] data-[side=left]:data-ending-style:[clip-path:inset(0_0_0_100%_round_12px)]`,\n // side=right\n `data-[side=right]:data-starting-style:[clip-path:inset(0_100%_0_0_round_12px)] data-[side=right]:data-ending-style:[clip-path:inset(0_100%_0_0_round_12px)]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:[clip-path:inset(0_0_0_100%_round_12px)] data-[side=inline-start]:data-ending-style:[clip-path:inset(0_0_0_100%_round_12px)]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:[clip-path:inset(0_100%_0_0_round_12px)] data-[side=inline-end]:data-ending-style:[clip-path:inset(0_100%_0_0_round_12px)]`,\n ],\n motion: [\n `[transition-property:translate,scale,opacity,rotateX,rotateY,transform] [will-change:translate,scale,opacity,rotateX,rotateY,transform]`,\n `[transform:perspective(1000px)]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:translate-y-[7px] data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:scale-[0.26] data-[side=bottom]:data-starting-style:rotate-x-[70deg] data-[side=bottom]:data-ending-style:translate-y-[7px] data-[side=bottom]:data-ending-style:opacity-0 data-[side=bottom]:data-ending-style:scale-[0.26] data-[side=bottom]:data-ending-style:rotate-x-[70deg]`,\n // side=top\n `data-[side=top]:data-starting-style:translate-y-[7px] data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:scale-[0.26] data-[side=top]:data-starting-style:rotate-x-[70deg] data-[side=top]:data-ending-style:translate-y-[7px] data-[side=top]:data-ending-style:opacity-0 data-[side=top]:data-ending-style:scale-[0.26] data-[side=top]:data-ending-style:rotate-x-[70deg]`,\n // side=left\n `data-[side=left]:data-starting-style:translate-x-[-7px] data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:scale-[0.26] data-[side=left]:data-starting-style:rotate-y-[-40deg] data-[side=left]:data-ending-style:translate-x-[-7px] data-[side=left]:data-ending-style:opacity-0 data-[side=left]:data-ending-style:scale-[0.26] data-[side=left]:data-ending-style:rotate-y-[-40deg]`,\n // side=right\n `data-[side=right]:data-starting-style:translate-x-[7px] data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:scale-[0.26] data-[side=right]:data-starting-style:rotate-y-[40deg] data-[side=right]:data-ending-style:translate-x-[7px] data-[side=right]:data-ending-style:opacity-0 data-[side=right]:data-ending-style:scale-[0.26] data-[side=right]:data-ending-style:rotate-y-[40deg]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:translate-x-[-7px] data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:scale-[0.26] data-[side=inline-start]:data-starting-style:rotate-y-[-40deg] data-[side=inline-start]:data-ending-style:translate-x-[-7px] data-[side=inline-start]:data-ending-style:opacity-0 data-[side=inline-start]:data-ending-style:scale-[0.26] data-[side=inline-start]:data-ending-style:rotate-y-[-40deg]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:translate-x-[7px] data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:scale-[0.26] data-[side=inline-end]:data-starting-style:rotate-y-[40deg] data-[side=inline-end]:data-ending-style:translate-x-[7px] data-[side=inline-end]:data-ending-style:opacity-0 data-[side=inline-end]:data-ending-style:scale-[0.26] data-[side=inline-end]:data-ending-style:rotate-y-[40deg]`,\n ],\n motionBlur: [\n `[transition-property:translate,scale,opacity,rotateX,rotateY,transform,filter] [will-change:translate,scale,opacity,rotateX,rotateY,transform,filter]`,\n `[transform:perspective(1000px)]`,\n `data-starting-style:blur-[9px] data-ending-style:blur-[9px]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:translate-y-[7px] data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:scale-[0.26] data-[side=bottom]:data-starting-style:rotate-x-[70deg] data-[side=bottom]:data-ending-style:translate-y-[7px] data-[side=bottom]:data-ending-style:opacity-0 data-[side=bottom]:data-ending-style:scale-[0.26] data-[side=bottom]:data-ending-style:rotate-x-[70deg]`,\n // side=top\n `data-[side=top]:data-starting-style:translate-y-[7px] data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:scale-[0.26] data-[side=top]:data-starting-style:rotate-x-[70deg] data-[side=top]:data-ending-style:translate-y-[7px] data-[side=top]:data-ending-style:opacity-0 data-[side=top]:data-ending-style:scale-[0.26] data-[side=top]:data-ending-style:rotate-x-[70deg]`,\n // side=left\n `data-[side=left]:data-starting-style:translate-x-[-7px] data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:scale-[0.26] data-[side=left]:data-starting-style:rotate-y-[-40deg] data-[side=left]:data-ending-style:translate-x-[-7px] data-[side=left]:data-ending-style:opacity-0 data-[side=left]:data-ending-style:scale-[0.26] data-[side=left]:data-ending-style:rotate-y-[-40deg]`,\n // side=right\n `data-[side=right]:data-starting-style:translate-x-[7px] data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:scale-[0.26] data-[side=right]:data-starting-style:rotate-y-[40deg] data-[side=right]:data-ending-style:translate-x-[7px] data-[side=right]:data-ending-style:opacity-0 data-[side=right]:data-ending-style:scale-[0.26] data-[side=right]:data-ending-style:rotate-y-[40deg]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:translate-x-[-7px] data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:scale-[0.26] data-[side=inline-start]:data-starting-style:rotate-y-[-40deg] data-[side=inline-start]:data-ending-style:translate-x-[-7px] data-[side=inline-start]:data-ending-style:opacity-0 data-[side=inline-start]:data-ending-style:scale-[0.26] data-[side=inline-start]:data-ending-style:rotate-y-[-40deg]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:translate-x-[7px] data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:scale-[0.26] data-[side=inline-end]:data-starting-style:rotate-y-[40deg] data-[side=inline-end]:data-ending-style:translate-x-[7px] data-[side=inline-end]:data-ending-style:opacity-0 data-[side=inline-end]:data-ending-style:scale-[0.26] data-[side=inline-end]:data-ending-style:rotate-y-[40deg]`,\n ],\n}\n\nconst cssTransitionPresets = {\n inExpo: `duration-[0.35s] ease-[cubic-bezier(0.95,0.05,0.795,0.035)]`,\n outExpo: `duration-[0.35s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n inOutExpo: `duration-[0.35s] ease-[cubic-bezier(1,0,0,1)]`,\n anticipate: `duration-[0.35s] ease-[cubic-bezier(1,-0.4,0.35,0.95)]`,\n quickOut: `duration-[0.35s] ease-out`,\n overshootOut: `duration-[0.35s] ease-[cubic-bezier(0.175,0.885,0.32,1.275)]`,\n swiftOut: `duration-[0.35s] ease-[cubic-bezier(0.175,0.885,0.32,1.1)]`,\n snappyOut: `duration-[0.35s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n in: `duration-[0.35s] ease-[cubic-bezier(0.42,0,1,1)]`,\n out: `duration-[0.35s] ease-[cubic-bezier(0,0,0.58,1)]`,\n inOut: `duration-[0.25s] ease-[cubic-bezier(0.42,0,0.58,1)]`,\n outIn: `duration-[0.35s] ease-[cubic-bezier(0.1,0.7,0.9,0.5)]`,\n inQuad: `duration-[0.35s] ease-[cubic-bezier(0.55,0.085,0.68,0.53)]`,\n outQuad: `duration-[0.25s] ease-[cubic-bezier(0.25,0.46,0.45,0.94)]`,\n inOutQuad: `duration-[0.32s] ease-[cubic-bezier(0.455,0.03,0.515,0.955)]`,\n inCubic: `duration-[0.35s] ease-[cubic-bezier(0.55,0.055,0.675,0.19)]`,\n outCubic: `duration-[0.35s] ease-[cubic-bezier(0.215,0.61,0.355,1)]`,\n inOutCubic: `duration-[0.35s] ease-[cubic-bezier(0.645,0.045,0.355,1)]`,\n inQuart: `duration-[0.35s] ease-[cubic-bezier(0.895,0.03,0.685,0.22)]`,\n outQuart: `duration-[0.35s] ease-[cubic-bezier(0.165,0.84,0.44,1)]`,\n inOutQuart: `duration-[0.35s] ease-[cubic-bezier(0.77,0,0.175,1)]`,\n inQuint: `duration-[0.35s] ease-[cubic-bezier(0.755,0.05,0.855,0.06)]`,\n outQuint: `duration-[0.35s] ease-[cubic-bezier(0.23,1,0.32,1)]`,\n inOutQuint: `duration-[0.35s] ease-[cubic-bezier(0.86,0,0.07,1)]`,\n inCirc: `duration-[0.35s] ease-[cubic-bezier(0.6,0.04,0.98,0.335)]`,\n outCirc: `duration-[0.35s] ease-[cubic-bezier(0.075,0.82,0.165,1)]`,\n inOutCirc: `duration-[0.35s] ease-[cubic-bezier(0.785,0.135,0.15,0.86)]`,\n inOutBase: `duration-[0.35s] ease-[cubic-bezier(0.25,0.1,0.25,1)]`,\n}\n\ntype CSSAnimationPresets = keyof typeof cssAnimationPresets\ntype CSSTransitionPresets = keyof typeof cssTransitionPresets\n\ntype Backdrop = \"opaque\" | \"blur\" | \"transparent\"\n\ninterface SelectContextType {\n backdrop?: Backdrop\n}\n\nconst SelectContext = createContext<SelectContextType | undefined>(undefined)\n\nfunction useSelect() {\n const context = useContext(SelectContext)\n if (!context) {\n throw new Error(\"useSelect must be used within a SelectProvider\")\n }\n return context\n}\n\ninterface SelectRootProps extends React.ComponentProps<\n typeof SelectPrimitive.Root\n> {\n backdrop?: Backdrop\n}\n\nfunction Select({ backdrop = \"transparent\", ...props }: SelectRootProps) {\n return (\n <SelectContext.Provider value={{ backdrop }}>\n <SelectPrimitive.Root data-slot=\"select\" {...props} />\n </SelectContext.Provider>\n )\n}\n\ninterface SelectTriggerProps extends React.ComponentProps<\n typeof SelectPrimitive.Trigger\n> {}\n\nfunction SelectTrigger({ className, ...props }: SelectTriggerProps) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n className={cn(\n \"group/select-trigger border-input text-foreground focus-visible:border-primary bg-background dark:bg-input/40 inline-flex h-fit w-full touch-none items-center justify-between gap-3 rounded-lg border px-[calc(--spacing(2.5)-1px)] py-[calc(--spacing(2)-1px)] text-sm transition-colors ease-out select-none focus-visible:outline-none\",\n className\n )}\n {...props}\n />\n )\n}\n\ninterface SelectValueProps extends React.ComponentProps<\n typeof SelectPrimitive.Value\n> {\n placeholder?: string\n}\n\nfunction SelectValue({\n className,\n placeholder = \"Select...\",\n ...props\n}: SelectValueProps) {\n return (\n <SelectPrimitive.Value\n data-slot=\"select-value\"\n {...props}\n render={(renderProps, state) => {\n const newValue = state.value\n const isNull = !newValue && !renderProps.children\n\n if (isNull) {\n return (\n <span\n {...renderProps}\n className={cn(\n \"text-foreground/60 w-full text-left\",\n className\n )}\n >\n {placeholder}\n </span>\n )\n }\n\n return (\n <span\n key={newValue}\n {...renderProps}\n className={cn(\n \"fadeIn w-full truncate text-left\",\n className\n )}\n />\n )\n }}\n />\n )\n}\n\ninterface SelectIconProps extends React.ComponentProps<\n typeof SelectPrimitive.Icon\n> {}\n\nfunction SelectIcon({ className, ...props }: SelectIconProps) {\n return (\n <SelectPrimitive.Icon\n data-slot=\"select-icon\"\n className={cn(\"text-foreground/72 size-3.5 shrink-0\", className)}\n {...props}\n />\n )\n}\n\ninterface SelectPortalProps extends React.ComponentProps<\n typeof SelectPrimitive.Portal\n> {}\n\nfunction SelectPortal(props: SelectPortalProps) {\n return <SelectPrimitive.Portal data-slot=\"select-portal\" {...props} />\n}\n\ninterface SelectBackdropProps extends React.ComponentProps<\n typeof SelectPrimitive.Backdrop\n> {}\n\nfunction SelectBackdrop({ className, ...props }: SelectBackdropProps) {\n const { backdrop = \"transparent\" } = useSelect()\n\n return (\n <SelectPrimitive.Backdrop\n data-slot=\"select-backdrop\"\n className={cn(\n backdrop === \"opaque\" &&\n \"fixed inset-0 z-100 bg-black opacity-40 transition-all duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:opacity-60\",\n backdrop === \"blur\" &&\n \"fixed inset-0 z-100 backdrop-blur-sm transition-all duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0\",\n backdrop === \"transparent\" && \"hidden\",\n className\n )}\n {...props}\n />\n )\n}\n\ninterface SelectPositionerProps extends React.ComponentProps<\n typeof SelectPrimitive.Positioner\n> {}\n\nfunction SelectPositioner({\n sideOffset = 4,\n side = \"bottom\",\n className,\n alignItemWithTrigger = true,\n ...props\n}: SelectPositionerProps) {\n return (\n <SelectPortal>\n <SelectBackdrop />\n <SelectPrimitive.Positioner\n sideOffset={sideOffset}\n side={side}\n alignItemWithTrigger={alignItemWithTrigger}\n data-slot=\"select-positioner\"\n className={cn(\"z-100 outline-none select-none\", className)}\n {...props}\n />\n </SelectPortal>\n )\n}\n\ninterface SelectArrowProps extends React.ComponentProps<\n typeof SelectPrimitive.Arrow\n> {}\n\nfunction SelectArrow({ className, ...rest }: SelectArrowProps) {\n return (\n <SelectPrimitive.Arrow\n data-slot=\"select-arrow\"\n className={cn(\n \"data-[side=bottom]:top-[-9px] data-[side=left]:right-[-14px] data-[side=left]:rotate-90 data-[side=right]:left-[-14px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-9px] data-[side=top]:rotate-180\",\n className\n )}\n {...rest}\n />\n )\n}\n\nfunction ArrowSvg(props: React.ComponentProps<\"svg\">) {\n return (\n <svg width=\"20\" height=\"10\" viewBox=\"0 0 20 10\" fill=\"none\" {...props}>\n <path\n d=\"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\"\n className=\"fill-popover\"\n />\n <path\n d=\"M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z\"\n className=\"fill-border/60\"\n />\n </svg>\n )\n}\n\ninterface SelectPopupProps\n extends\n React.ComponentProps<typeof SelectPrimitive.Popup>,\n Pick<\n SelectPositionerProps,\n | \"side\"\n | \"sideOffset\"\n | \"align\"\n | \"alignOffset\"\n | \"alignItemWithTrigger\"\n > {\n animationPreset?: CSSAnimationPresets\n transitionPreset?: CSSTransitionPresets\n reduceMotion?: boolean\n showArrow?: boolean\n}\n\nfunction SelectPopup({\n className,\n animationPreset = \"scale\",\n transitionPreset = \"outQuint\",\n reduceMotion = false,\n showArrow = false,\n side = \"bottom\",\n sideOffset = 4,\n align = \"center\",\n alignOffset = 0,\n alignItemWithTrigger = false,\n children,\n ...rest\n}: SelectPopupProps) {\n const cssAnimationConfig = useMemo(() => {\n if (reduceMotion) return \"\"\n\n if (animationPreset) {\n return cssAnimationPresets[animationPreset]\n }\n\n return cssAnimationPresets.scale\n }, [animationPreset, reduceMotion, side])\n\n const cssTransitionConfig = useMemo(() => {\n if (reduceMotion) return \"\"\n\n if (transitionPreset) {\n return cssTransitionPresets[transitionPreset]\n }\n\n return cssTransitionPresets.snappyOut\n }, [transitionPreset, reduceMotion, side])\n\n return (\n <SelectPositioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n alignItemWithTrigger={alignItemWithTrigger}\n className=\"\"\n >\n <SelectPrimitive.Popup\n data-slot=\"select-popup\"\n render={(renderProps) => {\n if (alignItemWithTrigger) {\n return (\n <div\n key=\"select-popup\"\n {...renderProps}\n className={cn(\n \"pointer-events-auto origin-(--transform-origin)\",\n className\n )}\n style={{\n ...renderProps.style,\n }}\n >\n {showArrow && (\n <SelectArrow>\n <ArrowSvg />\n </SelectArrow>\n )}\n <SelectPrimitive.ScrollUpArrow\n className={cn(\n \"top-0 z-50 flex h-6 w-full cursor-default items-center justify-center\",\n \"before:from-popover before:pointer-events-none before:absolute before:inset-x-px before:top-px before:h-[140%] before:rounded-t-[calc(var(--radius-lg)-1px)] before:bg-linear-to-b before:from-50%\"\n )}\n data-slot=\"select-scroll-up-arrow\"\n >\n <ChevronUpIcon className=\"relative size-4\" />\n </SelectPrimitive.ScrollUpArrow>\n {children}\n <SelectPrimitive.ScrollDownArrow\n className={cn(\n \"bottom-0 z-50 flex h-6 w-full cursor-default items-center justify-center\",\n \"before:from-popover before:pointer-events-none before:absolute before:inset-x-px before:bottom-px before:h-[140%] before:rounded-b-[calc(var(--radius-lg)-1px)] before:bg-linear-to-t before:from-50%\"\n )}\n data-slot=\"select-scroll-down-arrow\"\n >\n <ChevronDownIcon className=\"relative size-4\" />\n </SelectPrimitive.ScrollDownArrow>\n </div>\n )\n }\n\n return (\n <div\n key=\"select-popup\"\n {...renderProps}\n className={cn(\n \"pointer-events-auto origin-(--transform-origin)\",\n className,\n renderProps.className,\n cssTransitionConfig,\n cssAnimationConfig\n )}\n >\n {showArrow && (\n <SelectArrow>\n <ArrowSvg />\n </SelectArrow>\n )}\n <SelectPrimitive.ScrollUpArrow\n className={cn(\n \"top-0 z-50 flex h-6 w-full cursor-default items-center justify-center\",\n \"before:from-popover before:pointer-events-none before:absolute before:inset-x-px before:top-px before:h-[140%] before:rounded-t-[calc(var(--radius-lg)-1px)] before:bg-linear-to-b before:from-50%\"\n )}\n data-slot=\"select-scroll-up-arrow\"\n >\n <ChevronUpIcon className=\"relative size-4\" />\n </SelectPrimitive.ScrollUpArrow>\n {children}\n <SelectPrimitive.ScrollDownArrow\n className={cn(\n \"bottom-0 z-50 flex h-6 w-full cursor-default items-center justify-center\",\n \"before:from-popover before:pointer-events-none before:absolute before:inset-x-px before:bottom-px before:h-[140%] before:rounded-b-[calc(var(--radius-lg)-1px)] before:bg-linear-to-t before:from-50%\"\n )}\n data-slot=\"select-scroll-down-arrow\"\n >\n <ChevronDownIcon className=\"relative size-4\" />\n </SelectPrimitive.ScrollDownArrow>\n </div>\n )\n }}\n {...rest}\n />\n </SelectPositioner>\n )\n}\n\ninterface SelectListProps extends React.ComponentProps<\n typeof SelectPrimitive.List\n> {}\n\nfunction SelectList({ className, ...props }: SelectListProps) {\n return (\n <SelectPrimitive.List\n data-slot=\"select-list\"\n className={cn(\n \"bg-popover relative block h-full max-h-[min(var(--available-height),260px)] min-w-(--anchor-width) overflow-y-auto rounded-lg border p-1 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\",\n className\n )}\n {...props}\n />\n )\n}\n\ninterface SelectItemProps extends React.ComponentProps<\n typeof SelectPrimitive.Item\n> {}\n\nfunction SelectItem({ className, ...props }: SelectItemProps) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n \"relative flex min-w-(--anchor-width) cursor-default items-center gap-2 px-3 py-1.5 text-sm outline-none select-none group-data-[side=none]:min-w-[calc(var(--anchor-width))]\",\n `data-highlighted:before:bg-accent/70 dark:data-highlighted:before:bg-accent data-highlighted:text-accent-foreground data-highlighted:before:border-border/30 data-highlighted:z-0 data-highlighted:before:absolute data-highlighted:before:inset-x-0 data-highlighted:before:inset-y-0 data-highlighted:before:z-[-1] data-highlighted:before:rounded-md data-highlighted:before:border`,\n className\n )}\n {...props}\n />\n )\n}\n\ninterface SelectItemTextProps extends React.ComponentProps<\n typeof SelectPrimitive.ItemText\n> {}\n\nfunction SelectItemText({ className, ...props }: SelectItemTextProps) {\n return (\n <SelectPrimitive.ItemText\n data-slot=\"select-item-text\"\n className={cn(\"flex-1\", className)}\n {...props}\n />\n )\n}\n\ninterface SelectItemIndicatorProps extends React.ComponentProps<\n typeof SelectPrimitive.ItemIndicator\n> {}\n\nfunction SelectItemIndicator({\n className,\n ...props\n}: SelectItemIndicatorProps) {\n return (\n <SelectPrimitive.ItemIndicator\n data-slot=\"select-item-indicator\"\n className={cn(\"ml-auto min-w-fit\", className)}\n {...props}\n />\n )\n}\n\ninterface SelectGroupProps extends React.ComponentProps<\n typeof SelectPrimitive.Group\n> {}\n\nfunction SelectGroup({ ...props }: SelectGroupProps) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />\n}\n\ninterface SelectGroupLabelProps extends React.ComponentProps<\n typeof SelectPrimitive.GroupLabel\n> {}\n\nfunction SelectGroupLabel({ ...props }: SelectGroupLabelProps) {\n return (\n <SelectPrimitive.GroupLabel data-slot=\"select-group-label\" {...props} />\n )\n}\n\nfunction SelectScrollUpArrow(\n props: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>\n) {\n return (\n <SelectPrimitive.ScrollUpArrow\n data-slot=\"select-scroll-up-arrow\"\n {...props}\n />\n )\n}\n\nfunction SelectScrollDownArrow(\n props: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>\n) {\n return (\n <SelectPrimitive.ScrollDownArrow\n data-slot=\"select-scroll-down-arrow\"\n {...props}\n />\n )\n}\n\ninterface SelectSeparatorProps extends React.ComponentProps<\n typeof SelectPrimitive.Separator\n> {}\n\nfunction SelectSeparator({ ...props }: SelectSeparatorProps) {\n return <SelectPrimitive.Separator data-slot=\"select-separator\" {...props} />\n}\n\nexport {\n Select,\n SelectTrigger,\n SelectValue,\n SelectIcon,\n SelectPopup,\n SelectList,\n SelectItem,\n SelectItemText,\n SelectItemIndicator,\n SelectGroup,\n SelectGroupLabel,\n SelectScrollUpArrow,\n SelectScrollDownArrow,\n SelectSeparator,\n}\n","import { Input as InputBaseUI } from \"../../ui/input\"\nimport {\n Select as SelectBaseUI,\n SelectList,\n SelectIcon,\n SelectItem,\n SelectItemIndicator,\n SelectPopup,\n SelectTrigger,\n SelectValue,\n} from \"../../ui/select\"\nimport Label from \"../Label\"\nimport { ChevronDownIcon, CheckIcon } from \"lucide-react\"\n\nexport type NumberUnitValue = {\n value: string\n unit: string\n}\n\nconst NumberUnit = ({\n onChange,\n value,\n label,\n field,\n readOnly,\n}: {\n onChange: (value: NumberUnitValue) => void\n value: NumberUnitValue\n label: string\n field: any\n readOnly?: boolean\n}) => {\n const currentValue = value || {\n value: \"\",\n unit: field.options?.[0]?.value || \"\",\n }\n\n const handleInputChange = (newValue: string) => {\n if (!readOnly) {\n onChange({\n ...currentValue,\n value: newValue,\n })\n }\n }\n\n const handleUnitChange = (newUnit: string) => {\n if (!readOnly) {\n onChange({\n ...currentValue,\n unit: newUnit,\n })\n }\n }\n\n return (\n <>\n <Label label={label} readOnly={field.readOnly || readOnly} />\n <div className=\"flex\">\n <div className=\"flex-1\">\n <InputBaseUI\n className=\"rounded-r-none\"\n type=\"text\"\n placeholder={field.placeholder || \"Value\"}\n value={currentValue.value}\n onChange={(e) =>\n handleInputChange(e.currentTarget.value)\n }\n readOnly={field.readOnly || readOnly}\n />\n </div>\n <div className=\"w-18\">\n <SelectBaseUI\n items={field.options || []}\n value={currentValue.unit}\n onValueChange={handleUnitChange}\n disabled={field.readOnly || readOnly}\n >\n <SelectTrigger className=\"rounded-l-none border-l-0\">\n <SelectValue />\n <SelectIcon>\n <ChevronDownIcon className=\"size-3.5\" />\n </SelectIcon>\n </SelectTrigger>\n <SelectPopup align=\"end\" side=\"bottom\">\n <SelectList>\n {(field.options || []).map((option: any) => (\n <SelectItem\n key={option.value}\n value={option.value}\n >\n {option.label}\n <SelectItemIndicator>\n <CheckIcon className=\"size-3.5\" />\n </SelectItemIndicator>\n </SelectItem>\n ))}\n </SelectList>\n </SelectPopup>\n </SelectBaseUI>\n </div>\n </div>\n </>\n )\n}\n\nexport default NumberUnit\n","import {\n Select as SelectBaseUI,\n SelectItem,\n SelectItemIndicator,\n SelectTrigger,\n SelectValue,\n SelectIcon,\n SelectPopup,\n SelectList,\n} from \"../../ui/select\"\nimport Label from \"../Label\"\nimport { ChevronDownIcon, CheckIcon } from \"lucide-react\"\n\nconst Select = ({\n onChange,\n value,\n label,\n field,\n readOnly,\n}: {\n onChange: (value: any) => void\n value: any\n label: string\n field: any\n readOnly?: boolean\n}) => {\n const placeholder = field.placeholder || \"Select an option\"\n\n const itemsWithPlaceholder = [\n { label: placeholder, value: null },\n ...field.options.map((option: any) => ({\n label: option.label,\n value: option.value,\n })),\n ]\n\n const handleValueChange = (newValue: string | null) => {\n if (!readOnly && newValue !== null) {\n onChange(newValue)\n }\n }\n\n return (\n <>\n <Label label={label} readOnly={field.readOnly || readOnly} />\n <SelectBaseUI\n items={itemsWithPlaceholder}\n value={value || null}\n onValueChange={handleValueChange}\n disabled={field.readOnly || readOnly}\n >\n <SelectTrigger className=\"min-w-46\">\n <SelectValue />\n <SelectIcon>\n <ChevronDownIcon className=\"size-3.5\" />\n </SelectIcon>\n </SelectTrigger>\n <SelectPopup align=\"center\" side=\"bottom\">\n <SelectList>\n {field.options.map((option: any) => (\n <SelectItem\n key={\n typeof option.label === \"string\"\n ? option.label\n : JSON.stringify(option.value)\n }\n value={option.value}\n >\n {option.label}\n <SelectItemIndicator>\n <CheckIcon className=\"size-3\" />\n </SelectItemIndicator>\n </SelectItem>\n ))}\n </SelectList>\n </SelectPopup>\n </SelectBaseUI>\n </>\n )\n}\n\nexport default Select\n","\"use client\"\n\nimport { Radio as RadioPrimitive } from \"@base-ui/react/radio\"\nimport { RadioGroup as RadioGroupPrimitive } from \"@base-ui/react/radio-group\"\n\nimport { cn } from \"../../lib/utils\"\n\ntype RadioLayout = \"horizontal\" | \"inline\"\n\ninterface RadioGroupProps extends RadioGroupPrimitive.Props {\n layout?: RadioLayout\n}\n\ninterface RadioGroupItemProps extends RadioPrimitive.Root.Props {\n layout?: RadioLayout\n}\n\nfunction RadioGroup({\n className,\n layout = \"horizontal\",\n ...props\n}: RadioGroupProps) {\n return (\n <RadioGroupPrimitive\n data-slot=\"radio-group\"\n className={cn(\"cn-radio-group w-full\", className)}\n {...props}\n />\n )\n}\n\nfunction RadioGroupItem({\n className,\n layout = \"horizontal\",\n ...props\n}: RadioGroupItemProps) {\n const isHorizontal = layout === \"horizontal\"\n\n if (isHorizontal) {\n return (\n <RadioPrimitive.Root\n data-slot=\"radio-group-item\"\n className={cn(\n \"text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 group/radio-group-item peer data-[checked]:text-primary-500 relative block flex h-full shrink-0 cursor-pointer items-center justify-center border border-transparent bg-white p-2 text-xs transition-[color,box-shadow] outline-none hover:bg-stone-50 focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[checked]:bg-stone-50 data-[checked]:font-semibold\",\n className\n )}\n {...props}\n />\n )\n }\n\n return (\n <RadioPrimitive.Root\n data-slot=\"radio-group-item\"\n className={cn(\n \"text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 group/radio-group-item peer border-input relative aspect-square size-4 shrink-0 rounded-full border bg-white transition-[color,box-shadow] outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <RadioPrimitive.Indicator\n data-slot=\"radio-group-indicator\"\n className=\"cn-radio-group-indicator\"\n >\n <span className=\"bg-foreground m-1 block size-1.5 rounded-full\"></span>\n </RadioPrimitive.Indicator>\n </RadioPrimitive.Root>\n )\n}\n\nexport { RadioGroup, RadioGroupItem }\nexport type { RadioLayout }\n","import React from \"react\"\nimport { Field, FieldProps } from \"@puckeditor/core\"\nimport Label from \"../Label\"\nimport { RadioGroup, RadioGroupItem, RadioLayout } from \"../../ui/radio\"\n\ntype RadioProps = FieldProps<Field<any>> & {\n name: string\n field: Field<any> & {\n options?: ReadonlyArray<{ label: React.ReactNode; value: any }>\n layout?: RadioLayout\n }\n}\n\nconst Radio = ({\n onChange,\n value,\n readOnly,\n field,\n label,\n}: RadioProps & { label: string }) => {\n if (!field.options || !Array.isArray(field.options)) {\n return null\n }\n\n const layout = field.layout || \"horizontal\"\n\n const handleChange = (newValue: unknown) => {\n if (!readOnly && newValue != null) {\n onChange(newValue)\n }\n }\n\n const groupClassName =\n layout === \"horizontal\"\n ? \"border-input flex w-fit flex-wrap divide-x divide-stone-200 overflow-hidden rounded-md border\"\n : \"flex flex-col gap-3\"\n\n return (\n <>\n <Label label={label} readOnly={readOnly} />\n <RadioGroup\n layout={layout}\n value={value?.toString() || \"\"}\n onValueChange={handleChange}\n disabled={readOnly}\n className={groupClassName}\n >\n {field.options.map((option, index) => {\n const optionValue = String(option.value ?? \"\")\n const key = `${optionValue}-${index}`\n\n if (layout === \"horizontal\") {\n return (\n <label key={key} className=\"flex-1\">\n <RadioGroupItem\n layout=\"horizontal\"\n value={optionValue}\n disabled={readOnly}\n >\n {option.label || option.value?.toString()}\n </RadioGroupItem>\n </label>\n )\n }\n\n return (\n <label\n key={key}\n className=\"flex cursor-pointer items-center gap-3\"\n >\n <RadioGroupItem\n layout=\"inline\"\n value={optionValue}\n disabled={readOnly}\n />\n <span className=\"text-sm\">\n {option.label || option.value?.toString()}\n </span>\n </label>\n )\n })}\n </RadioGroup>\n </>\n )\n}\n\nexport default Radio\n","\"use client\"\n\nimport * as React from \"react\"\nimport { Field as FieldPrimitive } from \"@base-ui/react/field\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\n\nimport { cn } from \"../../lib/utils\"\n\nexport interface TextareaProps extends React.ComponentProps<\"textarea\"> {\n size?: \"sm\" | \"default\" | \"lg\" | number\n}\n\nfunction Textarea({ className, size = \"default\", ...props }: TextareaProps) {\n return (\n <FieldPrimitive.Control\n render={(defaultProps) => (\n <textarea\n data-slot=\"textarea\"\n className={cn(\n \"border-border bg-background dark:bg-input/32 placeholder:text-muted-foreground/80 relative field-sizing-content min-h-17.5 w-full rounded-lg border px-3 py-2 text-base/5 outline-none [transition:box-shadow_150ms_ease-out] max-sm:min-h-20.5 sm:text-sm\",\n // Focus State\n \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n \"focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/16 dark:aria-invalid:ring-destructive/24 disabled:opacity-64 [disabled,focus-visible,aria-invalid]:shadow-none\",\n size === \"sm\" &&\n \"min-h-16.5 px-[calc(--spacing(2.5)-1px)] py-[calc(--spacing(1)-1px)] max-sm:min-h-19.5\",\n size === \"lg\" &&\n \"min-h-18.5 py-[calc(--spacing(2)-1px)] max-sm:min-h-21.5\",\n className\n )}\n {...mergeProps(defaultProps, props)}\n />\n )}\n />\n )\n}\n\nexport { Textarea }\n","import { Textarea as TextareaBaseUI } from \"../../ui/textarea\"\nimport Label from \"../Label\"\n\nconst Textarea = ({\n onChange,\n label,\n field,\n readOnly,\n}: {\n onChange: (value: any) => void\n label: string\n field: any\n readOnly?: boolean\n}) => (\n <>\n <Label label={label} readOnly={field.readOnly || readOnly} />\n <TextareaBaseUI\n placeholder={field.placeholder}\n onChange={(e) => onChange(e.currentTarget.value)}\n readOnly={field.readOnly || readOnly}\n />\n </>\n)\n\nexport default Textarea\n","import { ReactNode, SyntheticEvent } from \"react\"\n\nconst Action = ({\n children,\n label,\n onClick,\n}: {\n children: ReactNode\n label?: string\n onClick: (e: SyntheticEvent) => void\n}) => (\n <button\n type=\"button\"\n className=\"hover:text-primary-500 mx-1 flex cursor-pointer items-center justify-center rounded border-none bg-transparent p-1.5 text-stone-700 transition-colors duration-50 hover:bg-stone-50\"\n onClick={onClick}\n title={label}\n >\n {children}\n </button>\n)\n\nconst Group = ({ children }: { children: ReactNode }) => (\n <div className=\"mx-2 flex h-full items-center first:ml-0 last:mr-0 empty:hidden [&>*]:m-0\">\n {children}\n </div>\n)\n\nconst Label = ({ label }: { label: string }) => (\n <div className=\"text-sm font-[var(--puck-font-family)] font-medium overflow-ellipsis whitespace-nowrap text-stone-700\">\n {label}\n </div>\n)\n\nconst Separator = () => <div className=\"h-full w-px bg-stone-300\" />\n\nconst ActionBar = ({\n label,\n parentAction,\n children,\n}: {\n label?: string\n parentAction?: ReactNode\n children?: ReactNode\n}) => (\n <div\n className=\"border-input flex w-auto items-center rounded-lg border bg-white p-2\"\n onClick={(e) => {\n e.stopPropagation()\n }}\n >\n {parentAction && (\n <>\n <ActionBar.Group>{parentAction}</ActionBar.Group>\n <ActionBar.Separator />\n </>\n )}\n {label && (\n <>\n <ActionBar.Group>\n <ActionBar.Label label={label} />\n </ActionBar.Group>\n <ActionBar.Separator />\n </>\n )}\n <ActionBar.Group>{children}</ActionBar.Group>\n </div>\n)\n\nActionBar.Action = Action\nActionBar.Label = Label\nActionBar.Group = Group\nActionBar.Separator = Separator\n\nexport default ActionBar\n","\"use client\"\n\nimport { createContext, useContext, useEffect, useRef, useState } from \"react\"\nimport { Tabs as TabsPrimitive } from \"@base-ui/react/tabs\"\n\nimport { cn } from \"../../lib/utils\"\n\ntype TabsVariant = \"segmented\" | \"underline\" | \"card\"\n\nfunction isValidVariant(variant: TabsVariant): variant is TabsVariant {\n return (\n variant === \"segmented\" || variant === \"underline\" || variant === \"card\"\n )\n}\n\ninterface TabsContextType {\n variant?: TabsVariant\n}\n\nconst TabsContext = createContext<TabsContextType>({\n variant: \"segmented\",\n})\n\nfunction useTabs() {\n const context = useContext(TabsContext)\n if (!context) {\n throw new Error(\"useTabs must be used within a Tabs component\")\n }\n return context\n}\n\ninterface TabsProps extends TabsPrimitive.Root.Props {\n variant?: TabsVariant\n}\n\nfunction Tabs({ className, variant = \"segmented\", ...props }: TabsProps) {\n const finalVariant = isValidVariant(variant) ? variant : \"segmented\"\n\n return (\n <TabsContext.Provider value={{ variant: finalVariant }}>\n <TabsPrimitive.Root\n data-slot=\"tabs\"\n className={cn(\n \"flex gap-2 data-[orientation=horizontal]:flex-col data-[orientation=vertical]:flex-row\",\n className\n )}\n {...props}\n />\n </TabsContext.Provider>\n )\n}\n\ninterface TabsListProps extends TabsPrimitive.List.Props {}\n\nfunction TabsList({ className, children, ...props }: TabsListProps) {\n const { variant } = useTabs()\n\n return (\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n className={cn(\n \"text-muted-foreground relative z-0 flex w-fit max-w-full items-center justify-start gap-x-0.5 data-[orientation=vertical]:flex-col max-sm:data-[orientation=horizontal]:overflow-x-auto max-sm:data-[orientation=horizontal]:overflow-y-hidden\",\n variant === \"segmented\" && \"bg-muted rounded-md p-1\",\n variant === \"underline\" &&\n \"data-[orientation=horizontal]:py-1 data-[orientation=vertical]:px-1\",\n variant === \"card\" && \"p-1\",\n className\n )}\n {...props}\n >\n {children}\n <TabsPrimitive.Indicator\n data-slot=\"tabs-indicator\"\n className={cn(\n \"absolute bottom-0 left-0 h-(--active-tab-height) w-(--active-tab-width) translate-x-(--active-tab-left) -translate-y-(--active-tab-bottom) transform-gpu transition-[translate,width] duration-200 ease-[cubic-bezier(.25,.46,.45,.94)] will-change-[translate,width]\",\n variant === \"segmented\" &&\n \"bg-card dark:bg-secondary border-border/10 -z-1 h-(--active-tab-height) rounded-sm border shadow-sm\",\n variant === \"underline\" &&\n \"bg-primary z-10 data-[orientation=horizontal]:h-0.5 data-[orientation=horizontal]:translate-y-[1.3px] data-[orientation=vertical]:w-0.5 data-[orientation=vertical]:-translate-x-px\",\n variant === \"card\" &&\n \"bg-secondary border-border/10 -z-1 rounded-sm border\"\n )}\n />\n </TabsPrimitive.List>\n )\n}\n\ninterface TabsTriggerProps extends TabsPrimitive.Tab.Props {}\n\nfunction TabsTrigger({ className, ...props }: TabsTriggerProps) {\n const { variant } = useTabs()\n\n return (\n <TabsPrimitive.Tab\n data-slot=\"tabs-trigger\"\n className={cn(\n \"text-secondary-foreground/66 data-active:text-foreground hover:text-foreground flex shrink-0 cursor-pointer items-center justify-center gap-2 px-3 py-1 text-sm font-medium break-keep whitespace-nowrap [transition-property:color] duration-200 ease-[cubic-bezier(.25,.46,.45,.94)] outline-none data-[orientation=vertical]:w-full [&_svg]:size-4 [&_svg]:shrink-0\",\n variant === \"segmented\" && \"rounded-md\",\n variant === \"underline\" &&\n \"data-[orientation=horizontal]:py-1.5 data-[orientation=vertical]:items-start data-[orientation=vertical]:justify-start data-[orientation=vertical]:px-2\",\n variant === \"card\" && \"rounded-md\",\n className\n )}\n {...props}\n />\n )\n}\n\ninterface TabsPanelWrapperProps {\n children: React.ReactNode\n}\n\nfunction TabsPanelsWrapper({ children }: TabsPanelWrapperProps) {\n const contentContainerRef = useRef<HTMLDivElement>(null)\n const [height, setHeight] = useState(0)\n\n useEffect(() => {\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const rect = entry.target.getBoundingClientRect()\n\n setHeight(rect.height)\n }\n })\n\n if (contentContainerRef.current) {\n resizeObserver.observe(contentContainerRef.current)\n }\n\n return () => {\n if (contentContainerRef.current) {\n resizeObserver.disconnect()\n }\n }\n }, [])\n\n return (\n <div\n className=\"relative overflow-hidden [transition-property:height] duration-200 ease-[cubic-bezier(.25,.46,.45,.94)]\"\n style={{ height: height ?? null }}\n >\n <div data-slot=\"tabs-panel-wrapper\" ref={contentContainerRef}>\n {children}\n </div>\n </div>\n )\n}\n\ninterface TabsPanelProps extends TabsPrimitive.Panel.Props {}\n\nfunction TabsPanel({ className, ...props }: TabsPanelProps) {\n return (\n <TabsPrimitive.Panel\n data-slot=\"tabs-panel\"\n className={cn(className)}\n {...props}\n />\n )\n}\n\nexport { Tabs, TabsList, TabsTrigger, TabsPanelsWrapper, TabsPanel }\n","\"use client\"\n\nimport React, {\n createContext,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\"\nimport { Accordion as AccordionPrimitive } from \"@base-ui/react/accordion\"\n\nimport { cn } from \"../../lib/utils\"\nimport { ChevronDownIcon } from \"lucide-react\"\n\nconst cssAnimationPresets = {\n none: \"transition-none\",\n fade: [\n `[transition-property:opacity,height] [will-change:opacity,height]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 data-starting-style:h-0 data-ending-style:h-0`,\n ],\n scale: [\n `[transition-property:scale,opacity,height] [will-change:scale,opacity,height] origin-left`,\n `data-starting-style:scale-85 data-starting-style:opacity-0 data-starting-style:h-0 data-ending-style:opacity-0 data-ending-style:h-0 data-ending-style:scale-85`,\n ],\n slide: [\n `[transition-property:translate,opacity,height] [will-change:translate,opacity,height]`,\n `data-starting-style:opacity-0 data-starting-style:translate-y-[10px] data-ending-style:translate-y-[10px] data-ending-style:opacity-0 data-ending-style:h-0 data-starting-style:h-0`,\n ],\n perspective: [\n `[transition-property:opacity,rotateX,rotateY,transform,height] [will-change:opacity,rotateX,rotateY,transform,height]`,\n `[transform:perspective(1000px)] origin-top`,\n `data-starting-style:h-0 data-ending-style:h-0`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0`,\n `data-starting-style:-rotate-x-[90deg] data-ending-style:-rotate-x-[90deg]`,\n ],\n perspectiveBlur: [\n `[transition-property:opacity,rotateX,rotateY,transform,height,filter] [will-change:opacity,rotateX,rotateY,transform,height,filter]`,\n `[transform:perspective(1000px)] origin-top`,\n `data-starting-style:h-0 data-ending-style:h-0`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0`,\n `data-starting-style:-rotate-x-[90deg] data-ending-style:-rotate-x-[90deg]`,\n `data-starting-style:blur-[9px] data-ending-style:blur-[9px]`,\n ],\n}\n\nconst cssTransitionPresets = {\n inExpo: `duration-[0.35s] ease-[cubic-bezier(0.95,0.05,0.795,0.035)]`,\n outExpo: `duration-[0.35s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n inOutExpo: `duration-[0.35s] ease-[cubic-bezier(1,0,0,1)]`,\n anticipate: `duration-[0.35s] ease-[cubic-bezier(1,-0.4,0.35,0.95)]`,\n quickOut: `duration-[0.35s] ease-out`,\n overshootOut: `duration-[0.35s] ease-[cubic-bezier(0.175,0.885,0.32,1.275)]`,\n swiftOut: `duration-[0.35s] ease-[cubic-bezier(0.175,0.885,0.32,1.1)]`,\n snappyOut: `duration-[0.35s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n in: `duration-[0.35s] ease-[cubic-bezier(0.42,0,1,1)]`,\n out: `duration-[0.35s] ease-[cubic-bezier(0,0,0.58,1)]`,\n inOut: `duration-[0.25s] ease-[cubic-bezier(0.42,0,0.58,1)]`,\n outIn: `duration-[0.35s] ease-[cubic-bezier(0.1,0.7,0.9,0.5)]`,\n inQuad: `duration-[0.35s] ease-[cubic-bezier(0.55,0.085,0.68,0.53)]`,\n outQuad: `duration-[0.25s] ease-[cubic-bezier(0.25,0.46,0.45,0.94)]`,\n inOutQuad: `duration-[0.32s] ease-[cubic-bezier(0.455,0.03,0.515,0.955)]`,\n inCubic: `duration-[0.35s] ease-[cubic-bezier(0.55,0.055,0.675,0.19)]`,\n outCubic: `duration-[0.35s] ease-[cubic-bezier(0.215,0.61,0.355,1)]`,\n inOutCubic: `duration-[0.35s] ease-[cubic-bezier(0.645,0.045,0.355,1)]`,\n inQuart: `duration-[0.35s] ease-[cubic-bezier(0.895,0.03,0.685,0.22)]`,\n outQuart: `duration-[0.35s] ease-[cubic-bezier(0.165,0.84,0.44,1)]`,\n inOutQuart: `duration-[0.35s] ease-[cubic-bezier(0.77,0,0.175,1)]`,\n inQuint: `duration-[0.35s] ease-[cubic-bezier(0.755,0.05,0.855,0.06)]`,\n outQuint: `duration-[0.35s] ease-[cubic-bezier(0.23,1,0.32,1)]`,\n inOutQuint: `duration-[0.35s] ease-[cubic-bezier(0.86,0,0.07,1)]`,\n inCirc: `duration-[0.35s] ease-[cubic-bezier(0.6,0.04,0.98,0.335)]`,\n outCirc: `duration-[0.35s] ease-[cubic-bezier(0.075,0.82,0.165,1)]`,\n inOutCirc: `duration-[0.35s] ease-[cubic-bezier(0.785,0.135,0.15,0.86)]`,\n inOutBase: `duration-[0.35s] ease-[cubic-bezier(0.25,0.1,0.25,1)]`,\n}\n\ntype CSSAnimationPreset = keyof typeof cssAnimationPresets\ntype CSSTransitionPreset = keyof typeof cssTransitionPresets\n\ntype AccordionVariant = \"default\" | \"card\" | \"swiss\"\n\ninterface AccordionContextType {\n animationPreset?: CSSAnimationPreset\n transitionPreset?: CSSTransitionPreset\n reduceMotion?: boolean\n value: AccordionProps[\"value\"]\n onValueChange: AccordionProps[\"onValueChange\"]\n variant?: AccordionVariant\n}\n\nconst AccordionContext = createContext<AccordionContextType | undefined>(\n undefined\n)\n\nfunction useAccordion() {\n const context = useContext(AccordionContext)\n if (!context) {\n throw new Error(\"useAccordion must be used within a AccordionProvider\")\n }\n return context\n}\n\ninterface AccordionProps extends AccordionPrimitive.Root.Props {\n animationPreset?: CSSAnimationPreset\n transitionPreset?: CSSTransitionPreset\n reduceMotion?: boolean\n variant?: AccordionVariant\n}\n\nfunction Accordion({\n value,\n defaultValue,\n onValueChange,\n animationPreset = \"fade\",\n transitionPreset = \"outQuad\",\n reduceMotion,\n variant = \"default\",\n className,\n multiple = false,\n ...props\n}: AccordionProps) {\n const [accordionValue, setAccordionValue] = useState(\n value ?? defaultValue ?? []\n )\n\n const handleValueChange: AccordionProps[\"onValueChange\"] = (\n value,\n eventDetails\n ) => {\n setAccordionValue(value)\n onValueChange?.(value, eventDetails)\n }\n\n return (\n <AccordionContext.Provider\n value={{\n value: accordionValue,\n onValueChange: handleValueChange,\n animationPreset,\n transitionPreset,\n reduceMotion,\n variant,\n }}\n >\n <AccordionPrimitive.Root\n data-slot=\"accordion\"\n value={accordionValue}\n onValueChange={handleValueChange}\n multiple={multiple}\n className={cn(\n \"w-full\",\n variant === \"default\" &&\n \"flex flex-col rounded-2xl border outline-hidden\",\n variant === \"card\" && \"flex flex-col gap-1.5\",\n variant === \"swiss\" && \"rounded-2xl\",\n className\n )}\n {...props}\n />\n </AccordionContext.Provider>\n )\n}\n\ninterface AccordionItemContextType {\n open: boolean\n onOpenChange: AccordionItemProps[\"onOpenChange\"]\n variant?: AccordionVariant\n}\n\nconst AccordionItemContext = createContext<\n AccordionItemContextType | undefined\n>(undefined)\n\nfunction useAccordionItem() {\n const context = useContext(AccordionItemContext)\n if (!context) {\n throw new Error(\n \"useAccordionItem must be used within a AccordionItemProvider\"\n )\n }\n return context\n}\n\ninterface AccordionItemProps extends AccordionPrimitive.Item.Props {}\n\nfunction AccordionItem({\n value: itemValue,\n onOpenChange,\n className,\n ...rest\n}: AccordionItemProps) {\n const { value, variant = \"default\" } = useAccordion()\n\n const [isOpen, setIsOpen] = useState(value?.includes(itemValue) ?? false)\n\n useEffect(() => {\n setIsOpen(value?.includes(itemValue) ?? false)\n }, [value, itemValue])\n\n const handleItemOpenChange: AccordionItemProps[\"onOpenChange\"] = (\n open,\n eventDetails\n ) => {\n setIsOpen(open)\n onOpenChange?.(open, eventDetails)\n }\n\n return (\n <AccordionItemContext.Provider\n value={{\n open: isOpen,\n onOpenChange: handleItemOpenChange,\n variant,\n }}\n >\n <AccordionPrimitive.Item\n data-slot=\"accordion-item\"\n value={itemValue}\n onOpenChange={handleItemOpenChange}\n className={cn(\n \"w-full outline-hidden contain-layout\",\n // Base transitions - smooth all property changes\n `[transition-property:border-radius,margin,border] duration-260 ease-[cubic-bezier(0.215,0.61,0.355,1)] will-change-[border-radius,margin,border]`,\n \"focus-within:relative focus-within:z-2\",\n variant === \"default\" &&\n \"border-border bg-card border-b first:rounded-t-2xl last:rounded-b-2xl last:border-b-0\",\n variant === \"card\" && \"rounded-[14px] border p-1\",\n variant === \"swiss\" && [\n \"bg-popover border-border/60 relative overflow-hidden border-x\",\n\n // Base state - closed items\n \"data-closed:border-border/60 data-closed:border-b\",\n\n // First and last items\n \"first:border-border/60 first:rounded-t-2xl first:border-t\",\n \"last:border-border/60 last:rounded-b-2xl last:border-b\",\n\n // Open state - full rounded with margins\n \"data-open:border-primary/70 data-open:z-2 data-open:rounded-2xl data-open:border\",\n \"data-open:my-6 data-open:first:mt-0 data-open:last:mb-0\",\n\n // Item before open item - gets bottom rounded corners\n \"has-[+_[data-slot='accordion-item'][data-open]]:rounded-b-2xl\",\n \"has-[+_[data-slot='accordion-item'][data-open]]:border-b!\",\n \"has-[+_[data-slot='accordion-item'][data-open]]:border-border/60\",\n\n // Item after open item - gets top rounded corners\n \"data-open:[&+[data-slot='accordion-item']]:rounded-t-2xl\",\n \"data-open:[&+[data-slot='accordion-item'][data-closed]]:border-t\",\n \"data-open:[&+[data-slot='accordion-item']]:border-border/60\",\n\n // Remove middle borders between closed items\n \"data-closed:first:border-t\",\n \"data-closed:last:border-b\",\n ],\n className\n )}\n {...rest}\n />\n </AccordionItemContext.Provider>\n )\n}\n\ninterface AccordionHeaderProps extends AccordionPrimitive.Header.Props {}\n\nfunction AccordionHeader({ className, ...props }: AccordionHeaderProps) {\n return (\n <AccordionPrimitive.Header\n data-slot=\"accordion-header\"\n className={cn(className)}\n {...props}\n />\n )\n}\n\ninterface AccordionTriggerProps extends AccordionPrimitive.Trigger.Props {\n icon?: (props: { open: boolean }) => React.ReactNode\n}\n\nfunction AccordionTrigger({\n className,\n icon,\n children,\n ...props\n}: AccordionTriggerProps) {\n const { open, variant = \"default\" } = useAccordionItem()\n\n return (\n <AccordionHeader className=\"flex\">\n <AccordionPrimitive.Trigger\n data-slot=\"accordion-trigger\"\n className={cn(\n \"flex w-full cursor-pointer items-center px-4 py-3 text-left text-sm\",\n \"[transition-property:background-color,border-radius] duration-200 ease-[cubic-bezier(0.215,0.61,0.355,1)] will-change-[background-color,border-radius]\",\n `focus-visible:bg-accent not-data-panel-open:dark:hover:bg-accent dark:focus-visible:bg-accent focus-visible:outline-ring focus-visible:outline-2 data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50`,\n variant === \"card\" && [\n `not-data-panel-open:bg-secondary/80 data-panel-open:bg-secondary/80 rounded-lg data-panel-open:rounded-b-none`,\n ],\n className\n )}\n {...props}\n >\n {children}\n\n <span className=\"ml-auto\">\n <ChevronDownIcon\n className={cn(\n \"h-4 w-4 transition-transform duration-200\",\n open ? \"rotate-180\" : \"\"\n )}\n />\n </span>\n </AccordionPrimitive.Trigger>\n </AccordionHeader>\n )\n}\n\ninterface AccordionPanelProps extends AccordionPrimitive.Panel.Props {}\n\nfunction AccordionPanel({\n className,\n children,\n style,\n ...props\n}: AccordionPanelProps) {\n const {\n variant = \"default\",\n animationPreset = \"fade\",\n transitionPreset = \"snappyOut\",\n reduceMotion = false,\n } = useAccordion()\n\n const cssAnimationConfig = useMemo(() => {\n if (reduceMotion) return cssAnimationPresets.none\n\n if (animationPreset) {\n return cssAnimationPresets[animationPreset]\n }\n\n return cssAnimationPresets.fade\n }, [animationPreset, reduceMotion])\n\n const cssTransitionConfig = useMemo(() => {\n if (reduceMotion) return \"\"\n\n if (transitionPreset) {\n return cssTransitionPresets[transitionPreset]\n }\n\n return cssTransitionPresets.inOutExpo\n }, [transitionPreset, reduceMotion])\n\n return (\n <AccordionPrimitive.Panel\n data-slot=\"accordion-panel\"\n className={cn(\n \"h-(--accordion-panel-height) overflow-hidden text-sm\",\n cssAnimationConfig,\n cssTransitionConfig,\n className\n )}\n style={{\n willChange: \"height, opacity, transform\",\n ...style,\n }}\n {...props}\n >\n <div\n data-slot=\"accordion-panel-content\"\n className={cn(variant === \"default\" ? \"p-0\" : \"p-3 pl-4\")}\n >\n {children}\n </div>\n </AccordionPrimitive.Panel>\n )\n}\n\nexport {\n Accordion,\n AccordionItem,\n AccordionHeader,\n AccordionTrigger,\n AccordionPanel,\n}\n","import React, { useMemo, Children, isValidElement, cloneElement } from \"react\"\nimport { createUsePuck } from \"@puckeditor/core\"\nimport {\n Tabs,\n TabsList,\n TabsTrigger,\n TabsPanel,\n TabsPanelsWrapper,\n} from \"../ui/tabs\"\nimport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionPanel,\n} from \"../ui/accordion\"\n\n// Create typed usePuck hook with selector support\nconst usePuck = createUsePuck()\n\ntype ItemSelector = {\n path?: string\n index?: number\n}\n\ntype FieldGroupsProps = {\n children: React.ReactNode\n isLoading: boolean\n itemSelector?: ItemSelector | null\n}\n\n// Accordion configuration\ntype AccordionConfig = {\n title: string\n fields: string[]\n defaultExpanded?: boolean\n}\n\n// Tab configuration - can have direct accordion or nested accordions\ntype TabConfig = {\n title: string\n accordions: AccordionConfig | Record<string, AccordionConfig>\n}\n\n// Tabs configuration\ntype TabsConfig = Record<string, TabConfig>\n\n// Helper to check if accordions is a single accordion (has fields property)\nconst isSingleAccordion = (\n accordions: AccordionConfig | Record<string, AccordionConfig>\n): accordions is AccordionConfig => {\n return \"fields\" in accordions && Array.isArray(accordions.fields)\n}\n\nconst FieldGroups = ({ children }: FieldGroupsProps) => {\n // Use selectors to only subscribe to the specific data we need\n const config = usePuck((s) => s.config)\n const selectedItem = usePuck((s) => s.selectedItem)\n\n // Get the component config and tabs configuration\n const componentConfig = useMemo(() => {\n if (!selectedItem?.type) return null\n return config.components?.[selectedItem.type] || null\n }, [config, selectedItem])\n\n const tabsConfig = useMemo(() => {\n if (!componentConfig) return null\n const configWithTabs = componentConfig as any\n if (!configWithTabs.tabs) return null\n return configWithTabs.tabs as TabsConfig\n }, [componentConfig])\n\n // Create a map of field names to their location (tab and accordion)\n const fieldToLocationMap = useMemo(() => {\n const map = new Map<string, { tab: string; accordion: string }>()\n\n if (!tabsConfig) return map\n\n Object.entries(tabsConfig).forEach(([tabKey, tabConfig]) => {\n const { accordions } = tabConfig\n\n if (isSingleAccordion(accordions)) {\n // Single accordion case - use tab key as accordion key\n accordions.fields.forEach((fieldName) => {\n map.set(fieldName, {\n tab: tabKey,\n accordion: tabKey, // Use tab key for single accordion\n })\n })\n } else {\n // Multiple accordions case\n Object.entries(accordions).forEach(\n ([accordionKey, accordionConfig]) => {\n if (accordionConfig?.fields) {\n accordionConfig.fields.forEach((fieldName) => {\n map.set(fieldName, {\n tab: tabKey,\n accordion: accordionKey,\n })\n })\n }\n }\n )\n }\n })\n\n return map\n }, [tabsConfig])\n\n // Organize children by tabs and accordions\n const organizedChildren = useMemo(() => {\n const childArray = Children.toArray(children)\n type OrganizedStructure = Record<\n string,\n Record<string, React.ReactNode[]>\n >\n const result: OrganizedStructure = {}\n\n if (!tabsConfig) {\n return {\n __ungrouped: { default: childArray },\n } as OrganizedStructure\n }\n\n // Initialize structure for tabs and accordions\n Object.entries(tabsConfig).forEach(([tabKey, tabConfig]) => {\n result[tabKey] = {}\n const { accordions } = tabConfig\n\n if (isSingleAccordion(accordions)) {\n // Single accordion - use tab key as accordion key\n result[tabKey][tabKey] = []\n } else {\n // Multiple accordions\n Object.keys(accordions).forEach((accordionKey) => {\n result[tabKey][accordionKey] = []\n })\n }\n })\n\n const ungrouped: React.ReactNode[] = []\n\n // Organize children into their respective locations\n childArray.forEach((child) => {\n if (!isValidElement(child)) {\n ungrouped.push(child)\n return\n }\n\n // Try to extract field name from various sources\n const props = child.props as any\n let fieldName: string | null = null\n\n // Check different possible locations for field name\n if (props?.field) fieldName = props.field\n else if (props?.name) fieldName = props.name\n else if (props?.id) fieldName = props.id\n else if (child.key && typeof child.key === \"string\") {\n fieldName = child.key.replace(/^\\.\\$?/, \"\")\n }\n\n // If we found a field name, try to match it to a location\n if (fieldName) {\n const location = fieldToLocationMap.get(fieldName)\n if (location) {\n const newProps = {\n ...(child.props || {}),\n \"data-field-name\": fieldName,\n \"data-tab\": location.tab,\n \"data-accordion\": location.accordion,\n }\n const enhancedChild = cloneElement(child, newProps as any)\n\n if (!result[location.tab]) result[location.tab] = {}\n if (!result[location.tab][location.accordion])\n result[location.tab][location.accordion] = []\n result[location.tab][location.accordion].push(enhancedChild)\n return\n }\n }\n\n // If not matched to any location, add to ungrouped\n ungrouped.push(child)\n })\n\n return {\n ...result,\n __ungrouped: { default: ungrouped },\n } as OrganizedStructure\n }, [children, tabsConfig, fieldToLocationMap])\n\n // Get the first tab as default\n const defaultTab = useMemo(() => {\n if (!tabsConfig) return \"ungrouped\"\n return Object.keys(tabsConfig)[0] || \"ungrouped\"\n }, [tabsConfig])\n\n // Check if we have organized content\n const hasOrganizedFields = useMemo(() => {\n if (!tabsConfig) return false\n\n return Object.keys(tabsConfig).some((tabKey) => {\n const tabContent = organizedChildren[tabKey]\n if (!tabContent || typeof tabContent !== \"object\") return false\n return Object.keys(tabContent).some(\n (accordionKey) =>\n Array.isArray(tabContent[accordionKey]) &&\n tabContent[accordionKey].length > 0\n )\n })\n }, [tabsConfig, organizedChildren])\n\n // If no tabs configuration, render children as-is\n if (!tabsConfig) {\n return <div className=\"space-y-4\">{children}</div>\n }\n\n // If no fields were matched to tabs, render children as-is\n if (!hasOrganizedFields) {\n return <div className=\"space-y-4\">{children}</div>\n }\n\n // Render tabs with accordions\n return (\n <div className=\"puck-field-groups\">\n <Tabs defaultValue={defaultTab}>\n <div className=\"px-2 pt-2\">\n <TabsList className=\"bg-muted w-full justify-center p-1.5\">\n {Object.entries(tabsConfig).map(\n ([tabKey, tabConfig]) => {\n const tabContent = organizedChildren[tabKey]\n if (\n !tabContent ||\n typeof tabContent !== \"object\"\n )\n return null\n\n // Check if tab has any fields\n const hasFields = Object.keys(tabContent).some(\n (accordionKey) =>\n Array.isArray(\n tabContent[accordionKey]\n ) && tabContent[accordionKey].length > 0\n )\n if (!hasFields) return null\n\n return (\n <TabsTrigger\n key={tabKey}\n value={tabKey}\n className=\"flex-1\"\n >\n {tabConfig.title}\n </TabsTrigger>\n )\n }\n )}\n </TabsList>\n </div>\n <TabsPanelsWrapper>\n {Object.entries(tabsConfig).map(([tabKey, tabConfig]) => {\n const tabContent = organizedChildren[tabKey]\n if (!tabContent || typeof tabContent !== \"object\")\n return null\n\n const { accordions } = tabConfig\n\n // Handle single accordion case\n if (isSingleAccordion(accordions)) {\n const fields = tabContent[tabKey]\n if (\n !fields ||\n !Array.isArray(fields) ||\n fields.length === 0\n )\n return null\n\n return (\n <TabsPanel key={tabKey} value={tabKey}>\n <Accordion\n defaultValue={\n accordions.defaultExpanded\n ? [tabKey]\n : []\n }\n className=\"rounded-none border-none\"\n >\n <AccordionItem value={tabKey}>\n <AccordionTrigger>\n {accordions.title}\n </AccordionTrigger>\n <AccordionPanel className=\"p-0\">\n <div className=\"space-y-4\">\n {fields}\n </div>\n </AccordionPanel>\n </AccordionItem>\n </Accordion>\n </TabsPanel>\n )\n }\n\n // Handle multiple accordions case\n const accordionsRecord = accordions as Record<\n string,\n AccordionConfig\n >\n\n // Get default expanded accordions\n const defaultExpandedAccordions = Object.entries(\n accordionsRecord\n )\n .filter(\n ([, accordionConfig]) =>\n accordionConfig?.defaultExpanded\n )\n .map(([accordionKey]) => accordionKey)\n\n return (\n <TabsPanel key={tabKey} value={tabKey}>\n <Accordion\n multiple\n defaultValue={defaultExpandedAccordions}\n className=\"rounded-none border-none\"\n >\n {Object.entries(accordionsRecord).map(\n ([accordionKey, accordionConfig]) => {\n const fields =\n tabContent[accordionKey]\n if (\n !fields ||\n !Array.isArray(fields) ||\n fields.length === 0\n )\n return null\n\n return (\n <AccordionItem\n key={accordionKey}\n value={accordionKey}\n >\n <AccordionTrigger>\n {accordionConfig.title}\n </AccordionTrigger>\n <AccordionPanel className=\"p-0\">\n <div className=\"space-y-4\">\n {fields}\n </div>\n </AccordionPanel>\n </AccordionItem>\n )\n }\n )}\n </Accordion>\n </TabsPanel>\n )\n })}\n </TabsPanelsWrapper>\n </Tabs>\n\n {/* Render ungrouped fields below tabs */}\n {organizedChildren[\"__ungrouped\"]?.default &&\n Array.isArray(organizedChildren[\"__ungrouped\"].default) &&\n organizedChildren[\"__ungrouped\"].default.length > 0 && (\n <div className=\"mt-4 space-y-4 border-t pt-4\">\n {organizedChildren[\"__ungrouped\"].default}\n </div>\n )}\n </div>\n )\n}\n\nexport default FieldGroups\n","\"use client\"\n\nimport { useMemo } from \"react\"\nimport { Tooltip as TooltipPrimitive } from \"@base-ui/react/tooltip\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst cssAnimationPresets = {\n none: \"transition-none\",\n scale: [\n `[transition-property:scale,opacity]`,\n `data-starting-style:scale-80 data-starting-style:opacity-0 data-ending-style:opacity-0 data-ending-style:scale-80`,\n ],\n fade: [\n `[transition-property:opacity,scale]`,\n `data-starting-style:scale-98 data-starting-style:opacity-0 data-ending-style:opacity-0 data-ending-style:scale-98`,\n ],\n slideOutside: [\n `[transition-property:translate,opacity]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:translate-y-[10px] data-[side=bottom]:data-ending-style:translate-y-[10px] data-[side=bottom]:data-ending-style:opacity-0`,\n // side=top\n `data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:translate-y-[-10px] data-[side=top]:data-ending-style:translate-y-[-10px] data-[side=top]:data-ending-style:opacity-0`,\n // side=left\n `data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:translate-x-[-10px] data-[side=left]:data-ending-style:translate-x-[-10px] data-[side=left]:data-ending-style:opacity-0`,\n // side=right\n `data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:translate-x-[10px] data-[side=right]:data-ending-style:translate-x-[10px] data-[side=right]:data-ending-style:opacity-0`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:translate-x-[-10px] data-[side=inline-start]:data-ending-style:translate-x-[-10px] data-[side=inline-start]:data-ending-style:opacity-0`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:translate-x-[10px] data-[side=inline-end]:data-ending-style:translate-x-[10px] data-[side=inline-end]:data-ending-style:opacity-0`,\n ],\n slideInside: [\n `[transition-property:translate,opacity]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:translate-y-[-10px] data-[side=bottom]:data-ending-style:translate-y-[-10px] data-[side=bottom]:data-ending-style:opacity-0`,\n // side=top\n `data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:translate-y-[10px] data-[side=top]:data-ending-style:translate-y-[10px] data-[side=top]:data-ending-style:opacity-0`,\n // side=left\n `data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:translate-x-[10px] data-[side=left]:data-ending-style:translate-x-[10px] data-[side=left]:data-ending-style:opacity-0`,\n // side=right\n `data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:translate-x-[-10px] data-[side=right]:data-ending-style:translate-x-[-10px] data-[side=right]:data-ending-style:opacity-0`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:translate-x-[10px] data-[side=inline-start]:data-ending-style:translate-x-[10px] data-[side=inline-start]:data-ending-style:opacity-0`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:translate-x-[-10px] data-[side=inline-end]:data-ending-style:translate-x-[-10px] data-[side=inline-end]:data-ending-style:opacity-0`,\n ],\n wipe: [\n `[transition-property:clip-path] [will-change:clip-path]`,\n `[clip-path:inset(0_0_0_0_round_var(--radius))] [-webkit-clip-path:inset(0_0_0_0_round_var(--radius))]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:[clip-path:inset(0_0_100%_0_round_var(--radius))] data-[side=bottom]:data-ending-style:[clip-path:inset(0_0_100%_0_round_var(--radius))]`,\n // side=top\n `data-[side=top]:data-starting-style:[clip-path:inset(100%_0_0_0_round_var(--radius))] data-[side=top]:data-ending-style:[clip-path:inset(100%_0_0_0_round_var(--radius))]`,\n // side=left\n `data-[side=left]:data-starting-style:[clip-path:inset(0_0_0_100%_round_var(--radius))] data-[side=left]:data-ending-style:[clip-path:inset(0_0_0_100%_round_var(--radius))]`,\n // side=right\n `data-[side=right]:data-starting-style:[clip-path:inset(0_100%_0_0_round_var(--radius))] data-[side=right]:data-ending-style:[clip-path:inset(0_100%_0_0_round_var(--radius))]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:[clip-path:inset(0_0_0_100%_round_var(--radius))] data-[side=inline-start]:data-ending-style:[clip-path:inset(0_0_0_100%_round_var(--radius))]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:[clip-path:inset(0_100%_0_0_round_var(--radius))] data-[side=inline-end]:data-ending-style:[clip-path:inset(0_100%_0_0_round_var(--radius))]`,\n ],\n wipeScale: [\n `[transition-property:clip-path,scale] [will-change:clip-path,scale]`,\n `[clip-path:inset(0_0_0_0_round_var(--radius))] [-webkit-clip-path:inset(0_0_0_0_round_var(--radius))]`,\n `data-starting-style:scale-80 data-ending-style:scale-80`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:[clip-path:inset(0_0_100%_0_round_var(--radius))] data-[side=bottom]:data-ending-style:[clip-path:inset(0_0_100%_0_round_var(--radius))]`,\n // side=top\n `data-[side=top]:data-starting-style:[clip-path:inset(100%_0_0_0_round_var(--radius))] data-[side=top]:data-ending-style:[clip-path:inset(100%_0_0_0_round_var(--radius))]`,\n // side=left\n `data-[side=left]:data-starting-style:[clip-path:inset(0_0_0_100%_round_var(--radius))] data-[side=left]:data-ending-style:[clip-path:inset(0_0_0_100%_round_var(--radius))]`,\n // side=right\n `data-[side=right]:data-starting-style:[clip-path:inset(0_100%_0_0_round_var(--radius))] data-[side=right]:data-ending-style:[clip-path:inset(0_100%_0_0_round_var(--radius))]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:[clip-path:inset(0_0_0_100%_round_var(--radius))] data-[side=inline-start]:data-ending-style:[clip-path:inset(0_0_0_100%_round_var(--radius))]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:[clip-path:inset(0_100%_0_0_round_var(--radius))] data-[side=inline-end]:data-ending-style:[clip-path:inset(0_100%_0_0_round_var(--radius))]`,\n ],\n motion: [\n `[transition-property:translate,scale,opacity,rotateX,rotateY,transform] [will-change:translate,scale,opacity,rotateX,rotateY,transform]`,\n `[transform:perspective(1000px)]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:translate-y-[7px] data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:scale-[0.26] data-[side=bottom]:data-starting-style:rotate-x-[70deg] data-[side=bottom]:data-ending-style:translate-y-[7px] data-[side=bottom]:data-ending-style:opacity-0 data-[side=bottom]:data-ending-style:scale-[0.26] data-[side=bottom]:data-ending-style:rotate-x-[70deg]`,\n // side=top\n `data-[side=top]:data-starting-style:translate-y-[7px] data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:scale-[0.26] data-[side=top]:data-starting-style:rotate-x-[70deg] data-[side=top]:data-ending-style:translate-y-[7px] data-[side=top]:data-ending-style:opacity-0 data-[side=top]:data-ending-style:scale-[0.26] data-[side=top]:data-ending-style:rotate-x-[70deg]`,\n // side=left\n `data-[side=left]:data-starting-style:translate-x-[-7px] data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:scale-[0.26] data-[side=left]:data-starting-style:rotate-y-[-40deg] data-[side=left]:data-ending-style:translate-x-[-7px] data-[side=left]:data-ending-style:opacity-0 data-[side=left]:data-ending-style:scale-[0.26] data-[side=left]:data-ending-style:rotate-y-[-40deg]`,\n // side=right\n `data-[side=right]:data-starting-style:translate-x-[7px] data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:scale-[0.26] data-[side=right]:data-starting-style:rotate-y-[40deg] data-[side=right]:data-ending-style:translate-x-[7px] data-[side=right]:data-ending-style:opacity-0 data-[side=right]:data-ending-style:scale-[0.26] data-[side=right]:data-ending-style:rotate-y-[40deg]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:translate-x-[-7px] data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:scale-[0.26] data-[side=inline-start]:data-starting-style:rotate-y-[-40deg] data-[side=inline-start]:data-ending-style:translate-x-[-7px] data-[side=inline-start]:data-ending-style:opacity-0 data-[side=inline-start]:data-ending-style:scale-[0.26] data-[side=inline-start]:data-ending-style:rotate-y-[-40deg]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:translate-x-[7px] data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:scale-[0.26] data-[side=inline-end]:data-starting-style:rotate-y-[40deg] data-[side=inline-end]:data-ending-style:translate-x-[7px] data-[side=inline-end]:data-ending-style:opacity-0 data-[side=inline-end]:data-ending-style:scale-[0.26] data-[side=inline-end]:data-ending-style:rotate-y-[40deg]`,\n ],\n motionBlur: [\n `[transition-property:translate,scale,opacity,rotateX,rotateY,transform,filter] [will-change:translate,scale,opacity,rotateX,rotateY,transform,filter]`,\n `[transform:perspective(1000px)]`,\n `data-starting-style:blur-[9px] data-ending-style:blur-[9px]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:translate-y-[7px] data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:scale-[0.26] data-[side=bottom]:data-starting-style:rotate-x-[70deg] data-[side=bottom]:data-ending-style:translate-y-[7px] data-[side=bottom]:data-ending-style:opacity-0 data-[side=bottom]:data-ending-style:scale-[0.26] data-[side=bottom]:data-ending-style:rotate-x-[70deg]`,\n // side=top\n `data-[side=top]:data-starting-style:translate-y-[7px] data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:scale-[0.26] data-[side=top]:data-starting-style:rotate-x-[70deg] data-[side=top]:data-ending-style:translate-y-[7px] data-[side=top]:data-ending-style:opacity-0 data-[side=top]:data-ending-style:scale-[0.26] data-[side=top]:data-ending-style:rotate-x-[70deg]`,\n // side=left\n `data-[side=left]:data-starting-style:translate-x-[-7px] data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:scale-[0.26] data-[side=left]:data-starting-style:rotate-y-[-40deg] data-[side=left]:data-ending-style:translate-x-[-7px] data-[side=left]:data-ending-style:opacity-0 data-[side=left]:data-ending-style:scale-[0.26] data-[side=left]:data-ending-style:rotate-y-[-40deg]`,\n // side=right\n `data-[side=right]:data-starting-style:translate-x-[7px] data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:scale-[0.26] data-[side=right]:data-starting-style:rotate-y-[40deg] data-[side=right]:data-ending-style:translate-x-[7px] data-[side=right]:data-ending-style:opacity-0 data-[side=right]:data-ending-style:scale-[0.26] data-[side=right]:data-ending-style:rotate-y-[40deg]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:translate-x-[-7px] data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:scale-[0.26] data-[side=inline-start]:data-starting-style:rotate-y-[-40deg] data-[side=inline-start]:data-ending-style:translate-x-[-7px] data-[side=inline-start]:data-ending-style:opacity-0 data-[side=inline-start]:data-ending-style:scale-[0.26] data-[side=inline-start]:data-ending-style:rotate-y-[-40deg]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:translate-x-[7px] data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:scale-[0.26] data-[side=inline-end]:data-starting-style:rotate-y-[40deg] data-[side=inline-end]:data-ending-style:translate-x-[7px] data-[side=inline-end]:data-ending-style:opacity-0 data-[side=inline-end]:data-ending-style:scale-[0.26] data-[side=inline-end]:data-ending-style:rotate-y-[40deg]`,\n ],\n}\n\nconst cssTransitionPresets = {\n inExpo: `duration-[0.25s] ease-[cubic-bezier(0.95,0.05,0.795,0.035)]`,\n outExpo: `duration-[0.25s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n inOutExpo: `duration-[0.25s] ease-[cubic-bezier(1,0,0,1)]`,\n anticipate: `duration-[0.25s] ease-[cubic-bezier(1,-0.4,0.35,0.95)]`,\n quickOut: `duration-[0.25s] ease-out`,\n overshootOut: `duration-[0.25s] ease-[cubic-bezier(0.175,0.885,0.32,1.275)]`,\n swiftOut: `duration-[0.25s] ease-[cubic-bezier(0.175,0.885,0.32,1.1)]`,\n snappyOut: `duration-[0.25s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n in: `duration-[0.25s] ease-[cubic-bezier(0.42,0,1,1)]`,\n out: `duration-[0.25s] ease-[cubic-bezier(0,0,0.58,1)]`,\n inOut: `duration-[0.25s] ease-[cubic-bezier(0.42,0,0.58,1)]`,\n outIn: `duration-[0.25s] ease-[cubic-bezier(0.1,0.7,0.9,0.5)]`,\n inQuad: `duration-[0.25s] ease-[cubic-bezier(0.55,0.085,0.68,0.53)]`,\n outQuad: `duration-[0.25s] ease-[cubic-bezier(0.25,0.46,0.45,0.94)]`,\n inOutQuad: `duration-[0.32s] ease-[cubic-bezier(0.455,0.03,0.515,0.955)]`,\n inCubic: `duration-[0.25s] ease-[cubic-bezier(0.55,0.055,0.675,0.19)]`,\n outCubic: `duration-[0.25s] ease-[cubic-bezier(0.215,0.61,0.355,1)]`,\n inOutCubic: `duration-[0.25s] ease-[cubic-bezier(0.645,0.045,0.355,1)]`,\n inQuart: `duration-[0.25s] ease-[cubic-bezier(0.895,0.03,0.685,0.22)]`,\n outQuart: `duration-[0.25s] ease-[cubic-bezier(0.165,0.84,0.44,1)]`,\n inOutQuart: `duration-[0.25s] ease-[cubic-bezier(0.77,0,0.175,1)]`,\n inQuint: `duration-[0.25s] ease-[cubic-bezier(0.755,0.05,0.855,0.06)]`,\n outQuint: `duration-[0.25s] ease-[cubic-bezier(0.23,1,0.32,1)]`,\n inOutQuint: `duration-[0.25s] ease-[cubic-bezier(0.86,0,0.07,1)]`,\n inCirc: `duration-[0.25s] ease-[cubic-bezier(0.6,0.04,0.98,0.335)]`,\n outCirc: `duration-[0.25s] ease-[cubic-bezier(0.075,0.82,0.165,1)]`,\n inOutCirc: `duration-[0.25s] ease-[cubic-bezier(0.785,0.135,0.15,0.86)]`,\n inOutBase: `duration-[0.25s] ease-[cubic-bezier(0.25,0.1,0.25,1)]`,\n none: `duration-0 ease-none`,\n}\n\ntype CSSAnimationPresets = keyof typeof cssAnimationPresets\ntype CSSTransitionPresets = keyof typeof cssTransitionPresets\n\ninterface TooltipProviderProps extends TooltipPrimitive.Provider.Props {}\n\nfunction TooltipProvider({ delay = 300, ...props }: TooltipProviderProps) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delay={delay}\n {...props}\n />\n )\n}\n\ninterface TooltipProps extends TooltipPrimitive.Root.Props {}\n\nfunction Tooltip({ ...props }: TooltipProps) {\n return <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n}\n\ninterface TooltipTriggerProps extends TooltipPrimitive.Trigger.Props {}\n\nfunction TooltipTrigger(props: TooltipTriggerProps) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />\n}\n\ninterface TooltipPortalProps extends TooltipPrimitive.Portal.Props {}\n\nfunction TooltipPortal(props: TooltipPortalProps) {\n return <TooltipPrimitive.Portal data-slot=\"tooltip-portal\" {...props} />\n}\n\ninterface TooltipPositionerProps extends TooltipPrimitive.Positioner.Props {}\n\nfunction TooltipPositioner({\n className,\n side = \"top\",\n ...rest\n}: TooltipPositionerProps) {\n return (\n <TooltipPortal>\n <TooltipPrimitive.Positioner\n side={side}\n data-slot=\"tooltip-positioner\"\n className={cn(\n \"z-100\",\n (side === \"inline-end\" || side === \"inline-start\") &&\n \"**:data-[slot=tooltip-arrow]:hidden\",\n className\n )}\n {...rest}\n />\n </TooltipPortal>\n )\n}\n\ninterface TooltipPopupProps\n extends\n TooltipPrimitive.Popup.Props,\n Pick<\n TooltipPositionerProps,\n \"side\" | \"sideOffset\" | \"align\" | \"alignOffset\"\n > {\n animationPreset?: CSSAnimationPresets\n transitionPreset?: CSSTransitionPresets\n reduceMotion?: boolean\n showArrow?: boolean\n}\n\nfunction TooltipPopup({\n className,\n animationPreset = \"scale\",\n transitionPreset = \"outQuint\",\n reduceMotion = false,\n showArrow = false,\n side = \"top\",\n sideOffset = 4,\n align = \"center\",\n alignOffset = 0,\n ...rest\n}: TooltipPopupProps) {\n const cssAnimationConfig = useMemo(() => {\n if (reduceMotion) return \"none\"\n\n if (animationPreset) {\n return cssAnimationPresets[animationPreset]\n }\n\n return cssAnimationPresets.scale\n }, [animationPreset, reduceMotion, side])\n\n const cssTransitionConfig = useMemo(() => {\n if (reduceMotion) return \"none\"\n\n if (transitionPreset) {\n return cssTransitionPresets[transitionPreset]\n }\n\n return cssTransitionPresets.snappyOut\n }, [transitionPreset, reduceMotion, side])\n\n return (\n <TooltipPositioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n >\n <TooltipPrimitive.Popup\n data-slot=\"tooltip-popup\"\n className={cn(\n \"[--radius:10px]\",\n \"bg-popover border-border pointer-events-auto w-fit origin-(--transform-origin) rounded-(--radius) border px-2 py-1 text-[13px] text-balance shadow-xs data-instant:duration-0!\",\n className,\n cssAnimationConfig,\n cssTransitionConfig,\n showArrow && [\n `before: before:bg-popover z-[-1] before:absolute before:h-2 before:w-2 before:rotate-45 before:content-['']`,\n side === \"top\" &&\n `before:border-border before:-bottom-[4.7px] before:left-1/2 before:-translate-x-1/2 before:border-r before:border-b`,\n side === \"right\" &&\n `before:border-border before:top-1/2 before:-left-[4.07px] before:-translate-y-1/2 before:border-b before:border-l`,\n side === \"bottom\" &&\n `before:border-border before:-top-[4.7px] before:left-1/2 before:-translate-x-1/2 before:border-t before:border-l`,\n side === \"left\" &&\n `before:border-border before:top-1/2 before:-right-[4.07px] before:-translate-y-1/2 before:border-t before:border-r`,\n side === \"inline-start\" &&\n `before:border-border before:top-1/2 before:-right-[4.07px] before:-translate-y-1/2 before:border-t before:border-r`,\n side === \"inline-end\" &&\n `before:border-border before:top-1/2 before:-left-[4.07px] before:-translate-y-1/2 before:border-b before:border-l`,\n ]\n )}\n {...rest}\n />\n </TooltipPositioner>\n )\n}\n\nexport { Tooltip, TooltipTrigger, TooltipPopup, TooltipProvider }\n","import { createUsePuck, type Config } from \"@puckeditor/core\"\nimport { useCallback } from \"react\"\nimport { GripVerticalIcon, BoxIcon } from \"lucide-react\"\n\nimport {\n Tooltip as TooltipBaseUI,\n TooltipTrigger,\n TooltipPopup,\n TooltipProvider,\n} from \"../ui/tooltip\"\n\nconst usePuck = createUsePuck()\n\nconst DrawerItem = ({\n name,\n icon,\n}: {\n name: string\n icon?: React.ReactNode\n}) => {\n const configSelector = useCallback(\n (state: { config: Config }) => state.config,\n []\n )\n const config = usePuck(configSelector)\n\n const componentConfig = Object.values(config.components || {}).find(\n (c) => c.label === name\n )\n\n const iconOrImage = icon || componentConfig?.metadata?.icon\n const imageUrl = componentConfig?.metadata?.image\n const description = componentConfig?.metadata?.description\n\n const displayIcon = iconOrImage || <BoxIcon size={16} />\n\n const hasTooltipContent = imageUrl || description\n\n const drawerContent = (\n <div className=\"hover:bg-muted group flex cursor-grab items-center justify-between gap-2 rounded-md bg-white p-0.5 transition-colors\">\n <div className=\"flex items-center gap-2 truncate\">\n <div className=\"border-border group-hover:border-muted rounded-sm border bg-white p-3\">\n {displayIcon}\n </div>\n <span className=\"truncate text-sm font-medium\">{name}</span>\n </div>\n <div className=\"text-foreground h-full flex-none rounded-sm bg-white px-1 py-3\">\n <GripVerticalIcon size={16} />\n </div>\n </div>\n )\n\n if (!hasTooltipContent) {\n return drawerContent\n }\n\n return (\n <TooltipProvider delay={200}>\n <TooltipBaseUI>\n <TooltipTrigger className=\"w-full\">\n {drawerContent}\n </TooltipTrigger>\n <TooltipPopup side=\"right\" sideOffset={8} className=\"w-64 p-2\">\n {imageUrl && (\n <img\n src={imageUrl}\n alt={name}\n className=\"h-auto w-full rounded-sm object-contain\"\n />\n )}\n {description && (\n <p className=\"text-muted-foreground mt-2 text-sm\">\n {description}\n </p>\n )}\n </TooltipPopup>\n </TooltipBaseUI>\n </TooltipProvider>\n )\n}\n\nexport default DrawerItem\n","import Checkbox from \"../components/Fields/Checkbox\"\nimport Input from \"../components/Fields/Input\"\nimport NumberUnit from \"../components/Fields/NumberUnit\"\nimport Label from \"../components/Fields/Label\"\nimport Select from \"../components/Fields/Select\"\nimport Radio from \"../components/Fields/Radio\"\nimport Textarea from \"../components/Fields/Textarea\"\nimport ActionBar from \"../components/ActionBar\"\nimport FieldGroups from \"../components/FieldGroups\"\nimport DrawerItem from \"../components/DrawerItem\"\n\nconst createPuckOverridesPlugin = () => {\n return {\n overrides: {\n actionBar: ActionBar,\n drawer: ({ children }: { children: React.ReactNode }) => (\n <>{children}</>\n ),\n drawerItem: DrawerItem,\n fields: FieldGroups,\n fieldLabel: ({\n children,\n label,\n }: {\n children: React.ReactNode\n label: string\n }) => (\n <>\n <Label label={label} />\n {children}\n </>\n ),\n fieldTypes: {\n checkbox: Checkbox,\n numberUnit: NumberUnit,\n radio: Radio,\n select: Select,\n text: Input,\n textarea: Textarea,\n },\n },\n }\n}\n\nexport default createPuckOverridesPlugin\n","\"use client\"\n\nimport { tv, type VariantProps } from \"tailwind-variants\"\nimport {\n Button as BaseButton,\n type ButtonProps as BaseButtonProps,\n} from \"@base-ui/react/button\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst buttonVariants = tv({\n base: [\n `group inline-flex relative isolate shrink-0 items-center gap-1.5 text-sm justify-center w-fit touch-none whitespace-nowrap cursor-pointer outline-hidden transform-gpu motion-reduce:transform-none overflow-hidden`,\n `focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-secondary-foreground`,\n `disabled:cursor-not-allowed disabled:scale-100 disabled:opacity-60 disabled:bg-secondary`,\n `[transition:scale_0.1s,box-shadow_0.2s,background_0.20s,width_0.2s] [transition-timing-function:cubic-bezier(.6,.04,.98,.335)] will-change-transform`,\n `[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none active:scale-98`,\n ],\n variants: {\n variant: {\n default: `bg-linear-to-b from-primary/80 dark:from-primary to-primary text-primary-foreground hover:from-primary/75 dark:hover:from-primary/95`,\n secondary:\n \"border-secondary bg-secondary text-secondary-foreground hover:bg-secondary/90 data-pressed:bg-secondary/90\",\n outline: `border bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50`,\n ghost: `text-primary hover:bg-primary/10 focus-vislbe:bg-primary/10 focus-visible:border-primary/25`,\n link: `text-primary hover:underline hover:underline-offset-4 hover:decoration-1 focus-visible:underline focus-visible:underline-offset-4 focus-visible:decoration-1`,\n destructive:\n \"bg-destructive text-white hover:bg-destructive/90 focus-visible:border-destructive focus-visible:bg-destructive/90 focus-visible:ring-destructive bg-linear-to-t from-destructive/90 to-destructive\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n xs: \"h-6 gap-1 rounded-md px-[calc(--spacing(2)-1px)] py-[calc(--spacing(1)-1px)] text-xs [&_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 xl: \"h-12 px-[calc(--spacing(4)-1px)] py-[calc(--spacing(2)-1px)] text-base [&_svg:not([class*='size-'])]:size-4.5\",\n \"icon-sm\": \"size-8 [&_svg:not([class*='size-'])]:size-3.5\",\n icon: \"size-9 [&_svg:not([class*='size-'])]:size-4\",\n \"icon-lg\": \"size-10 [&_svg:not([class*='size-'])]:size-4.5\",\n \"icon-xl\": \"size-12 [&_svg:not([class*='size-'])]:size-4.5\",\n },\n radius: {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n default: \"rounded-md\",\n lg: \"rounded-lg\",\n xl: \"rounded-xl\",\n full: \"rounded-full\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n radius: \"default\",\n },\n})\n\ntype ButtonProps = BaseButtonProps & {\n variant?: VariantProps<typeof buttonVariants>[\"variant\"]\n size?: VariantProps<typeof buttonVariants>[\"size\"]\n radius?: VariantProps<typeof buttonVariants>[\"radius\"]\n}\n\nfunction Button({\n className,\n variant = \"default\",\n size = \"default\",\n radius = \"default\",\n ...props\n}: ButtonProps) {\n return (\n <BaseButton\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, radius }), className)}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n","\"use client\"\n\nimport { createContext, useContext, useMemo } from \"react\"\nimport { Dialog as DialogPrimitive } from \"@base-ui/react/dialog\"\nimport { XIcon } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst cssAnimationPresets = {\n none: \"transition-none\",\n scale: [\n `[transition-property:scale,opacity,translate] [will-change:scale,opacity,translate]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 max-sm:opacity-[calc(1-min(var(--nested-dialogs),1))] max-sm:data-starting-style:translate-y-4 max-sm:data-ending-style:translate-y-4 max-sm:data-starting-style:scale-98 max-sm:data-ending-style:scale-98 max-sm:origin-bottom`,\n `sm:-translate-y-[calc(2rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))] sm:data-starting-style:scale-98 sm:data-ending-style:scale-98 sm:data-nested:data-ending-style:translate-y-8 sm:data-nested:data-starting-style:translate-y-8`,\n ],\n fade: [\n `[transition-property:opacity,translate,scale] [will-change:opacity,translate,scale]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 max-sm:opacity-[calc(1-min(var(--nested-dialogs),1))] max-sm:data-starting-style:translate-y-4 max-sm:data-ending-style:translate-y-4`,\n `sm:-translate-y-[calc(2rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n topFlip: [\n `[transition-property:opacity,filter,transform,translate,scale] [will-change:opacity,filter,transform,translate,scale]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 data-starting-style:blur-[4px] data-ending-style:blur-[4px] data-starting-style:transform-[perspective(1000px)_rotateX(50deg)_scale(0.8)] data-ending-style:transform-[perspective(1000px)_rotateX(50deg)_scale(0.8)]`,\n `sm:translate-y-[calc(3.5rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n bottomFlip: [\n `[transition-property:opacity,filter,transform,translate,scale] [will-change:opacity,filter,transform,translate,scale]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 data-starting-style:blur-[4px] data-ending-style:blur-[4px] data-starting-style:transform-[perspective(1000px)_rotateX(-50deg)_scale(0.8)] data-ending-style:transform-[perspective(1000px)_rotateX(-50deg)_scale(0.8)]`,\n `sm:-translate-y-[calc(2rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n rightFlip: [\n `[transition-property:opacity,filter,transform,translate,scale] [will-change:opacity,filter,transform,translate,scale]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 data-starting-style:blur-[4px] data-ending-style:blur-[4px] data-starting-style:transform-[perspective(1000px)_rotateY(50deg)_scale(0.8)] data-ending-style:transform-[perspective(1000px)_rotateY(50deg)_scale(0.8)]`,\n `sm:-translate-x-[calc(2.5rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n leftFlip: [\n `[transition-property:opacity,filter,transform,translate,scale] [will-change:opacity,filter,transform,translate,scale]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 data-starting-style:blur-[4px] data-ending-style:blur-[4px] data-starting-style:transform-[perspective(1000px)_rotateY(-50deg)_scale(0.8)] data-ending-style:transform-[perspective(1000px)_rotateY(-50deg)_scale(0.8)]`,\n `sm:translate-x-[calc(2.5rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n topSlide: [\n `[transition-property:opacity,transform,translate,scale] [will-change:opacity,transform,translate,scale]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 data-starting-style:translate-y-[-20px] data-ending-style:translate-y-[-20px] max-sm:data-starting-style:-translate-y-4 max-sm:data-ending-style:-translate-y-4`,\n `sm:translate-y-[calc(3.5rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n bottomSlide: [\n `[transition-property:opacity,transform,translate,scale] [will-change:opacity,transform,translate,scale]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 data-starting-style:translate-y-[20px] data-ending-style:translate-y-[20px] max-sm:data-starting-style:translate-y-4 max-sm:data-ending-style:translate-y-4`,\n `sm:-translate-y-[calc(2rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n leftSlide: [\n `[transition-property:opacity,transform,translate,scale] [will-change:opacity,transform,translate,scale]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 data-starting-style:translate-x-[-20px] data-ending-style:translate-x-[-20px] max-sm:data-starting-style:-translate-x-4 max-sm:data-ending-style:-translate-x-4`,\n `sm:translate-x-[calc(2.5rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n rightSlide: [\n `[transition-property:opacity,transform,translate,scale] [will-change:opacity,transform,translate,scale]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0 data-starting-style:translate-x-[20px] data-ending-style:translate-x-[20px] max-sm:data-starting-style:translate-x-4 max-sm:data-ending-style:translate-x-4`,\n `sm:-translate-x-[calc(2.5rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n wipe: [\n `[transition-property:clip-path,translate,scale] [will-change:clip-path,translate,scale] [clip-path:inset(0_0_0_0_round_12px)] [-webkit-clip-path:inset(0_0_0_0_round_12px)]`,\n `data-starting-style:[clip-path:inset(0_0_100%_0_round_12px)] data-ending-style:[clip-path:inset(0_0_100%_0_round_12px)]`,\n `sm:-translate-y-[calc(2rem*var(--nested-dialogs))] sm:scale-[calc(1-0.1*var(--nested-dialogs))]`,\n ],\n}\n\nconst cssTransitionPresets = {\n inExpo: `duration-[0.35s] ease-[cubic-bezier(0.95,0.05,0.795,0.035)]`,\n outExpo: `duration-[0.35s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n inOutExpo: `duration-[0.35s] ease-[cubic-bezier(1,0,0,1)]`,\n anticipate: `duration-[0.35s] ease-[cubic-bezier(1,-0.4,0.35,0.95)]`,\n quickOut: `duration-[0.35s] ease-out`,\n overshootOut: `duration-[0.35s] ease-[cubic-bezier(0.175,0.885,0.32,1.275)]`,\n swiftOut: `duration-[0.35s] ease-[cubic-bezier(0.175,0.885,0.32,1.1)]`,\n snappyOut: `duration-[0.35s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n in: `duration-[0.35s] ease-[cubic-bezier(0.42,0,1,1)]`,\n out: `duration-[0.35s] ease-[cubic-bezier(0,0,0.58,1)]`,\n inOut: `duration-[0.25s] ease-[cubic-bezier(0.42,0,0.58,1)]`,\n outIn: `duration-[0.35s] ease-[cubic-bezier(0.1,0.7,0.9,0.5)]`,\n inQuad: `duration-[0.35s] ease-[cubic-bezier(0.55,0.085,0.68,0.53)]`,\n outQuad: `duration-[0.25s] ease-[cubic-bezier(0.25,0.46,0.45,0.94)]`,\n inOutQuad: `duration-[0.32s] ease-[cubic-bezier(0.455,0.03,0.515,0.955)]`,\n inCubic: `duration-[0.35s] ease-[cubic-bezier(0.55,0.055,0.675,0.19)]`,\n outCubic: `duration-[0.35s] ease-[cubic-bezier(0.215,0.61,0.355,1)]`,\n inOutCubic: `duration-[0.35s] ease-[cubic-bezier(0.645,0.045,0.355,1)]`,\n inQuart: `duration-[0.35s] ease-[cubic-bezier(0.895,0.03,0.685,0.22)]`,\n outQuart: `duration-[0.35s] ease-[cubic-bezier(0.165,0.84,0.44,1)]`,\n inOutQuart: `duration-[0.35s] ease-[cubic-bezier(0.77,0,0.175,1)]`,\n inQuint: `duration-[0.35s] ease-[cubic-bezier(0.755,0.05,0.855,0.06)]`,\n outQuint: `duration-[0.35s] ease-[cubic-bezier(0.23,1,0.32,1)]`,\n inOutQuint: `duration-[0.35s] ease-[cubic-bezier(0.86,0,0.07,1)]`,\n inCirc: `duration-[0.35s] ease-[cubic-bezier(0.6,0.04,0.98,0.335)]`,\n outCirc: `duration-[0.35s] ease-[cubic-bezier(0.075,0.82,0.165,1)]`,\n inOutCirc: `duration-[0.35s] ease-[cubic-bezier(0.785,0.135,0.15,0.86)]`,\n inOutBase: `duration-[0.35s] ease-[cubic-bezier(0.25,0.1,0.25,1)]`,\n}\n\ntype CSSAnimationPresets = keyof typeof cssAnimationPresets\ntype CSSTransitionPresets = keyof typeof cssTransitionPresets\n\ninterface DialogContextType {\n modal: DialogProps<unknown>[\"modal\"]\n}\n\nconst DialogContext = createContext<DialogContextType | undefined>(undefined)\n\nfunction useDialog() {\n const context = useContext(DialogContext)\n if (!context) {\n throw new Error(\"useDialog must be used within a DialogProvider\")\n }\n return context\n}\n\ninterface DialogProps<TPayload = unknown> extends DialogPrimitive.Root\n .Props<TPayload> {}\n\nfunction Dialog<TPayload = unknown>({\n modal = true,\n ...props\n}: DialogProps<TPayload>) {\n return (\n <DialogContext.Provider value={{ modal }}>\n <DialogPrimitive.Root data-slot=\"dialog\" modal={modal} {...props} />\n </DialogContext.Provider>\n )\n}\n\ninterface DialogTriggerProps extends DialogPrimitive.Trigger.Props {}\n\nfunction DialogTrigger({ ...props }: DialogTriggerProps) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\ninterface DialogViewportProps extends DialogPrimitive.Viewport.Props {}\n\nfunction DialogViewport({ ...props }: DialogViewportProps) {\n return <DialogPrimitive.Viewport data-slot=\"dialog-viewport\" {...props} />\n}\n\ninterface DialogPortalProps extends DialogPrimitive.Portal.Props {}\n\nfunction DialogPortal(props: DialogPortalProps) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\ninterface DialogBackdropProps extends DialogPrimitive.Backdrop.Props {}\n\nfunction DialogBackdrop({ className, ...props }: DialogBackdropProps) {\n return (\n <DialogPrimitive.Backdrop\n data-slot=\"dialog-backdrop\"\n render={\n <div\n key=\"dialog-backdrop\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/32 backdrop-blur-sm transition-all duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-[-webkit-touch-callout:none]:absolute\",\n className\n )}\n />\n }\n {...props}\n />\n )\n}\n\ninterface DialogPopupProps extends DialogPrimitive.Popup.Props {\n animationPreset?: CSSAnimationPresets\n transitionPreset?: CSSTransitionPresets\n reduceMotion?: boolean\n showCloseButton?: boolean\n}\n\nfunction DialogPopup({\n className,\n animationPreset = \"scale\",\n transitionPreset = \"outCubic\",\n children,\n reduceMotion = false,\n showCloseButton = true,\n ...rest\n}: DialogPopupProps) {\n const { modal } = useDialog()\n\n const cssAnimationConfig = useMemo(() => {\n if (reduceMotion) return \"none\"\n\n if (animationPreset) {\n return cssAnimationPresets[animationPreset]\n }\n\n return cssAnimationPresets.scale\n }, [animationPreset, reduceMotion])\n\n const cssTransitionConfig = useMemo(() => {\n if (reduceMotion) return \"none\"\n\n if (transitionPreset) {\n return cssTransitionPresets[transitionPreset]\n }\n\n return cssTransitionPresets.snappyOut\n }, [transitionPreset, reduceMotion])\n\n return (\n <DialogPortal>\n {modal && <DialogBackdrop />}\n <div className=\"fixed inset-0 top-1/2 left-1/2 z-50 h-max w-full -translate-x-1/2 -translate-y-1/2 transform\">\n <div className=\"flex flex-col items-center overflow-hidden p-4 sm:overflow-y-auto\">\n <DialogPrimitive.Popup\n data-slot=\"dialog-popup\"\n render={\n <div\n key=\"dialog-popup\"\n className={cn(\n \"bg-popover text-popover-foreground border-border relative row-start-2 grid max-h-[calc(100vh-2rem)] w-full min-w-0 gap-4 rounded-2xl border p-6 shadow-lg max-sm:overflow-y-auto\",\n cssTransitionConfig,\n cssAnimationConfig,\n className\n )}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring data-open:bg-accent data-open:text-muted-foreground absolute top-4 right-4 rounded-full opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </div>\n }\n {...rest}\n />\n </div>\n </div>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\n \"flex flex-col gap-2 text-center sm:text-left\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"sm:border-border/60 sm:bg-muted/50 flex flex-col-reverse gap-2 sm:-mx-6 sm:mt-2 sm:-mb-6 sm:flex-row sm:justify-end sm:rounded-b-xl sm:border-t sm:px-6 sm:py-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: DialogPrimitive.Description.Props) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\ninterface DialogCloseProps extends DialogPrimitive.Close.Props {}\n\nfunction DialogClose(props: DialogCloseProps) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogPopup,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogBackdrop,\n DialogViewport,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n}\n","\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"../../lib/utils\"\n\nfunction Table({ className, ...props }: React.ComponentProps<\"table\">) {\n return (\n <div\n data-slot=\"table-container\"\n className=\"relative w-full overflow-x-auto\"\n >\n <table\n data-slot=\"table\"\n className={cn(\"w-full caption-bottom text-sm\", className)}\n {...props}\n />\n </div>\n )\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\n return (\n <thead\n data-slot=\"table-header\"\n className={cn(\"[&_tr]:border-b\", className)}\n {...props}\n />\n )\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\n return (\n <tbody\n data-slot=\"table-body\"\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n )\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn(\n \"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<\"tr\">) {\n return (\n <tr\n data-slot=\"table-row\"\n className={cn(\n \"hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TableHead({ className, ...props }: React.ComponentProps<\"th\">) {\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\n \"text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TableCell({ className, ...props }: React.ComponentProps<\"td\">) {\n return (\n <td\n data-slot=\"table-cell\"\n className={cn(\n \"p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TableCaption({\n className,\n ...props\n}: React.ComponentProps<\"caption\">) {\n return (\n <caption\n data-slot=\"table-caption\"\n className={cn(\"text-muted-foreground mt-4 text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n}\n","import * as React from \"react\"\n\nimport { cn } from \"../../lib/utils\"\nimport { Button } from \"./button\"\nimport {\n ChevronLeftIcon,\n ChevronRightIcon,\n MoreHorizontalIcon,\n} from \"lucide-react\"\n\nfunction Pagination({ className, ...props }: React.ComponentProps<\"nav\">) {\n return (\n <nav\n role=\"navigation\"\n aria-label=\"pagination\"\n data-slot=\"pagination\"\n className={cn(\n \"cn-pagination mx-auto flex w-full justify-center\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction PaginationContent({\n className,\n ...props\n}: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"pagination-content\"\n className={cn(\n \"cn-pagination-content bg-background divide-border border-border flex items-center divide-x overflow-hidden rounded-md border\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction PaginationItem({ ...props }: React.ComponentProps<\"li\">) {\n return <li data-slot=\"pagination-item\" className=\"h-full\" {...props} />\n}\n\ntype PaginationLinkProps = {\n isActive?: boolean\n} & Pick<React.ComponentProps<typeof Button>, \"size\"> &\n React.ComponentProps<\"a\">\n\nfunction PaginationLink({\n className,\n isActive,\n size = \"icon\",\n ...props\n}: PaginationLinkProps) {\n return (\n <Button\n variant=\"ghost\"\n size={size}\n className={cn(\n \"cn-pagination-link hover:bg-muted rounded-none\",\n isActive && \"text-primary-500\",\n className\n )}\n nativeButton={false}\n render={\n <a\n aria-current={isActive ? \"page\" : undefined}\n data-slot=\"pagination-link\"\n data-active={isActive}\n {...props}\n />\n }\n />\n )\n}\n\nfunction PaginationPrevious({\n className,\n ...props\n}: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to previous page\"\n size=\"default\"\n className={cn(\"cn-pagination-previous\", className)}\n {...props}\n >\n <ChevronLeftIcon />\n <span className=\"cn-pagination-previous-text hidden\">Previous</span>\n </PaginationLink>\n )\n}\n\nfunction PaginationNext({\n className,\n ...props\n}: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to next page\"\n size=\"default\"\n className={cn(\"cn-pagination-next\", className)}\n {...props}\n >\n <span className=\"cn-pagination-next-text hidden\">Next</span>\n <ChevronRightIcon />\n </PaginationLink>\n )\n}\n\nfunction PaginationEllipsis({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n aria-hidden\n data-slot=\"pagination-ellipsis\"\n className={cn(\n \"cn-pagination-ellipsis flex h-full w-auto items-end justify-center px-2 py-1.5\",\n className\n )}\n {...props}\n >\n <MoreHorizontalIcon className=\"size-4\" />\n <span className=\"sr-only\">More pages</span>\n </span>\n )\n}\n\nexport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n}\n","\"use client\"\n\nimport React, { useCallback } from \"react\"\nimport {\n Pagination as PaginationUI,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n} from \"../ui/pagination\"\nimport {\n Select,\n SelectTrigger,\n SelectValue,\n SelectIcon,\n SelectPopup,\n SelectList,\n SelectItem,\n SelectItemText,\n} from \"../ui/select\"\nimport { cn } from \"../../lib/utils\"\nimport { ChevronDownIcon } from \"lucide-react\"\n\nexport type PaginationProps = {\n currentPage: number\n totalPages: number\n totalItems: number\n itemsPerPage: number\n onPageChange: (page: number) => void\n onItemsPerPageChange: (itemsPerPage: number) => void\n pageSizeOptions?: number[]\n maxVisiblePages?: number\n showInfo?: boolean\n showPageSizeSelect?: boolean\n className?: string\n}\n\nexport const TablePagination = ({\n currentPage,\n totalPages,\n totalItems,\n itemsPerPage,\n onPageChange,\n onItemsPerPageChange,\n pageSizeOptions = [5, 10, 20, 50, 100],\n maxVisiblePages = 4,\n showInfo = true,\n showPageSizeSelect = true,\n className,\n}: PaginationProps) => {\n const handleItemsPerPageChange = useCallback(\n (value: unknown) => {\n const newLimit = Number(value)\n onItemsPerPageChange(newLimit)\n },\n [onItemsPerPageChange]\n )\n\n const renderPaginationItems = useCallback(() => {\n const items = []\n let startPage = Math.max(\n 1,\n currentPage - Math.floor(maxVisiblePages / 2)\n )\n let endPage = Math.min(totalPages, startPage + maxVisiblePages - 1)\n\n if (endPage - startPage + 1 < maxVisiblePages) {\n startPage = Math.max(1, endPage - maxVisiblePages + 1)\n }\n\n if (startPage > 1) {\n items.push(\n <PaginationItem key=\"1\">\n <PaginationLink\n size=\"icon\"\n onClick={(e) => {\n e.preventDefault()\n onPageChange(1)\n }}\n >\n 1\n </PaginationLink>\n </PaginationItem>\n )\n if (startPage > 2) {\n items.push(\n <PaginationItem key=\"ellipsis-start\">\n <PaginationEllipsis />\n </PaginationItem>\n )\n }\n }\n\n for (let i = startPage; i <= endPage; i++) {\n items.push(\n <PaginationItem key={i}>\n <PaginationLink\n size=\"icon\"\n isActive={currentPage === i}\n onClick={(e) => {\n e.preventDefault()\n onPageChange(i)\n }}\n >\n {i}\n </PaginationLink>\n </PaginationItem>\n )\n }\n\n if (endPage < totalPages) {\n if (endPage < totalPages - 1) {\n items.push(\n <PaginationItem key=\"ellipsis-end\">\n <PaginationEllipsis />\n </PaginationItem>\n )\n }\n items.push(\n <PaginationItem key={totalPages}>\n <PaginationLink\n size=\"icon\"\n onClick={(e) => {\n e.preventDefault()\n onPageChange(totalPages)\n }}\n >\n {totalPages}\n </PaginationLink>\n </PaginationItem>\n )\n }\n\n return items\n }, [currentPage, totalPages, maxVisiblePages, onPageChange])\n\n const startItem =\n totalItems === 0 ? 0 : (currentPage - 1) * itemsPerPage + 1\n const endItem = Math.min(currentPage * itemsPerPage, totalItems)\n\n return (\n <div\n className={cn(\n \"grid grid-cols-[1fr_auto_1fr] items-center gap-x-4\",\n className\n )}\n >\n {showInfo && (\n <div className=\"justify-self-start\">\n <div className=\"text-muted-foreground text-sm\">\n Showing {startItem} to {endItem} of {totalItems} results\n </div>\n </div>\n )}\n\n {showPageSizeSelect && (\n <div className=\"flex items-center gap-2 justify-self-center\">\n <span className=\"text-muted-foreground text-sm\">\n Per page\n </span>\n <Select\n value={itemsPerPage.toString()}\n onValueChange={handleItemsPerPageChange}\n >\n <SelectTrigger className=\"h-8 w-fit\">\n <SelectValue />\n <SelectIcon>\n <ChevronDownIcon className=\"size-4\" />\n </SelectIcon>\n </SelectTrigger>\n <SelectPopup>\n <SelectList>\n {pageSizeOptions.map((size) => (\n <SelectItem\n key={size}\n value={size.toString()}\n >\n <SelectItemText>{size}</SelectItemText>\n </SelectItem>\n ))}\n </SelectList>\n </SelectPopup>\n </Select>\n </div>\n )}\n\n {totalPages > 1 && (\n <div className=\"justify-self-end\">\n <PaginationUI>\n <PaginationContent>\n <PaginationItem>\n <PaginationPrevious\n size=\"default\"\n onClick={(e) => {\n e.preventDefault()\n if (currentPage > 1) {\n onPageChange(currentPage - 1)\n }\n }}\n aria-disabled={currentPage === 1}\n className={cn(\n currentPage === 1 &&\n \"pointer-events-none opacity-50\"\n )}\n />\n </PaginationItem>\n {renderPaginationItems()}\n <PaginationItem>\n <PaginationNext\n size=\"default\"\n onClick={(e) => {\n e.preventDefault()\n if (currentPage < totalPages) {\n onPageChange(currentPage + 1)\n }\n }}\n aria-disabled={currentPage === totalPages}\n className={cn(\n currentPage === totalPages &&\n \"pointer-events-none opacity-50\"\n )}\n />\n </PaginationItem>\n </PaginationContent>\n </PaginationUI>\n </div>\n )}\n </div>\n )\n}\n\nexport default TablePagination\n","\"use client\"\n\nimport * as React from \"react\"\nimport { tv, type VariantProps } from \"tailwind-variants\"\n\nimport { cn } from \"../../lib/utils\"\nimport { Input, type InputProps } from \"./input\"\nimport { Textarea, type TextareaProps } from \"./textarea\"\nimport { Button } from \"./button\"\n\nfunction InputGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(\n \"group/input-group iteems-center border-border bg-background dark:bg-input/32 relative inline-flex min-w-0 rounded-lg border text-base/5 shadow-xs outline-none\",\n \"[transition:box-shadow_150ms_ease-out]\",\n\n // Variants based on alignment.\n \"has-[>[data-align=inline-start]]:[&>input]:pl-2\",\n \"has-[>[data-align=inline-end]]:[&>input]:pr-2\",\n \"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3\",\n \"has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:h-auto has-[>[data-align=block-end]]:[&>textarea]:pt-3\",\n\n // Focus State\n \"has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[1px]\",\n\n // Error State\n \"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40\",\n\n className\n )}\n {...props}\n />\n )\n}\n\nconst inputGroupAddonVariants = tv({\n base: `flex h-auto cursor-text text-muted-foreground items-center justify-center text-sm gap-2 py-1.5 font-medium select-none not-has-[button]:**:[svg]:opacity-72 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 group-data-[disabled=true]/input-group:opacity-50`,\n variants: {\n align: {\n \"inline-start\":\n \"order-first ps-[calc(--spacing(3)-1px)] has-[>[data-slot=badge]]:-ms-1.5 has-[>button]:-ms-2 has-[>kbd]:ms-[-0.35rem] [[data-size=sm]+&]:ps-[calc(--spacing(2.5)-1px)]\",\n \"inline-end\":\n \"order-last pe-[calc(--spacing(3)-1px)] has-[>[data-slot=badge]]:-me-1.5 has-[>button]:-me-2 has-[>kbd]:me-[-0.35rem] [[data-size=sm]+&]:pe-[calc(--spacing(2.5)-1px)]\",\n \"block-start\":\n \"order-first w-full justify-start px-[calc(--spacing(3)-1px)] pt-[calc(--spacing(3)-1px)] [.border-b]:pb-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]\",\n \"block-end\":\n \"order-last w-full justify-start px-[calc(--spacing(3)-1px)] pb-[calc(--spacing(3)-1px)] [.border-t]:pt-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]\",\n },\n },\n defaultVariants: {\n align: \"inline-start\",\n },\n})\n\nfunction InputGroupAddon({\n className,\n align = \"inline-start\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n <div\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align }), className)}\n onMouseDown={(e) => {\n const target = e.target as HTMLElement\n const isInteractive = target.closest(\"button, a\")\n if (isInteractive) return\n e.preventDefault()\n const parent = e.currentTarget.parentElement\n const input = parent?.querySelector<\n HTMLInputElement | HTMLTextAreaElement\n >(\"input, textarea\")\n if (\n input &&\n !parent?.querySelector(\"input:focus, textarea:focus\")\n ) {\n input.focus()\n }\n }}\n {...props}\n />\n )\n}\n\nconst inputGroupButtonVariants = tv({\n base: \"text-sm shadow-none flex gap-2 items-center\",\n\n variants: {\n size: {\n xs: \"h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2\",\n sm: \"h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5\",\n \"icon-xs\":\n \"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0\",\n \"icon-sm\": \"size-8 p-0 has-[>svg]:p-0\",\n },\n },\n defaultVariants: {\n size: \"xs\",\n },\n})\n\nfunction InputGroupButton({\n className,\n type = \"button\",\n variant = \"ghost\",\n size = \"xs\",\n ...props\n}: Omit<React.ComponentProps<typeof Button>, \"size\"> &\n VariantProps<typeof inputGroupButtonVariants> & {\n type?: \"submit\" | \"reset\" | \"button\"\n }) {\n return (\n <Button\n type={type}\n data-size={size}\n variant={variant}\n className={cn(inputGroupButtonVariants({ size }), className)}\n {...props}\n />\n )\n}\n\nfunction InputGroupText({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"input-group-text\"\n className={cn(\n \"text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction InputGroupInput({ className, ...props }: InputProps) {\n return (\n <Input\n data-slot=\"input-group-control\"\n className={cn(\n \"flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:border-0 focus-visible:ring-0 dark:bg-transparent\",\n className\n )}\n {...props}\n />\n )\n}\nfunction InputGroupTextarea({ className, ...props }: TextareaProps) {\n return (\n <Textarea\n data-slot=\"input-group-control\"\n className={cn(\n \"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupText,\n InputGroupInput,\n InputGroupTextarea,\n}\n","\"use client\"\n\nimport React, { useState, useEffect, useCallback } from \"react\"\nimport { Input } from \"../ui/input\"\nimport { Button } from \"../ui/button\"\nimport { RadioGroup, RadioGroupItem } from \"../ui/radio\"\nimport {\n Dialog,\n DialogTrigger,\n DialogPopup,\n DialogHeader,\n DialogTitle,\n DialogFooter,\n} from \"../ui/dialog\"\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from \"../ui/table\"\nimport { TablePagination } from \"../Pagination\"\nimport { InputGroup, InputGroupAddon, InputGroupInput } from \"../ui/input-group\"\nimport { cn } from \"../../lib/utils\"\nimport { UploadIcon, Loader2Icon, ImageIcon, SearchIcon } from \"lucide-react\"\n\nexport type MediaItem = {\n id: number\n name: string\n url: string\n thumbnail: string\n type: string\n}\n\nexport type MediaPickerValue = {\n type?: \"url\" | \"media\"\n url?: string\n media?: MediaItem | null\n}\n\ntype MediaPickerConfig = {\n mediasUrl: string\n uploadUrl: string\n langId?: string\n}\n\nconst getEditorConfig = (): MediaPickerConfig => {\n const editorEl = document.getElementById(\"editor\")\n return {\n mediasUrl: editorEl?.dataset.mediasUrl || \"/admin/pages/puck/medias\",\n uploadUrl:\n editorEl?.dataset.uploadUrl || \"/admin/pages/puck/medias/upload\",\n langId: editorEl?.dataset.langId || \"\",\n }\n}\n\nconst fetchMedias = async ({\n query,\n filters,\n page = 1,\n limit = 10,\n}: {\n query?: string\n filters?: Record<string, string>\n page?: number\n limit?: number\n}) => {\n const { mediasUrl, langId } = getEditorConfig()\n\n const params = new URLSearchParams()\n if (query) params.append(\"search\", query)\n if (langId) params.append(\"lang_id\", langId)\n params.append(\"page\", page.toString())\n params.append(\"limit\", limit.toString())\n\n if (filters) {\n Object.entries(filters).forEach(([key, value]) => {\n params.append(key, value)\n })\n }\n\n const response = await fetch(`${mediasUrl}?${params.toString()}`, {\n credentials: \"same-origin\",\n })\n const data = await response.json()\n\n if (data.success && data.medias) {\n return {\n items: data.medias as MediaItem[],\n total: data.total || data.medias.length,\n }\n }\n\n return { items: [], total: 0 }\n}\n\ntype MediaUploadZoneProps = {\n onUploadSuccess?: (media: MediaItem) => void\n}\n\nconst MediaUploadZone = ({ onUploadSuccess }: MediaUploadZoneProps) => {\n const [uploading, setUploading] = useState(false)\n const [uploadProgress, setUploadProgress] = useState(0)\n const [dragActive, setDragActive] = useState(false)\n\n const handleUpload = useCallback(\n async (file: File) => {\n setUploading(true)\n setUploadProgress(0)\n\n try {\n const { uploadUrl, langId } = getEditorConfig()\n const csrfToken = document.querySelector(\n 'meta[name=\"csrf-token\"]'\n ) as HTMLMetaElement\n\n const formData = new FormData()\n formData.append(\"file\", file)\n if (langId) formData.append(\"lang_id\", langId)\n\n const xhr = new XMLHttpRequest()\n\n xhr.upload.addEventListener(\"progress\", (e) => {\n if (e.lengthComputable) {\n setUploadProgress((e.loaded / e.total) * 100)\n }\n })\n\n xhr.addEventListener(\"load\", () => {\n if (xhr.status === 200) {\n const response = JSON.parse(xhr.responseText)\n if (response.success && response.media) {\n onUploadSuccess?.(response.media)\n }\n } else {\n alert(\"Error during upload\")\n }\n setUploading(false)\n setUploadProgress(0)\n })\n\n xhr.addEventListener(\"error\", () => {\n alert(\"Error during upload\")\n setUploading(false)\n setUploadProgress(0)\n })\n\n xhr.open(\"POST\", uploadUrl)\n if (csrfToken) {\n xhr.setRequestHeader(\"X-CSRF-TOKEN\", csrfToken.content)\n }\n xhr.send(formData)\n } catch (error) {\n console.error(\"Error during upload:\", error)\n alert(\"Error during upload\")\n setUploading(false)\n setUploadProgress(0)\n }\n },\n [onUploadSuccess]\n )\n\n const handleDrag = useCallback((e: React.DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n if (e.type === \"dragenter\" || e.type === \"dragover\") {\n setDragActive(true)\n } else if (e.type === \"dragleave\") {\n setDragActive(false)\n }\n }, [])\n\n const handleDrop = useCallback(\n (e: React.DragEvent) => {\n e.preventDefault()\n e.stopPropagation()\n setDragActive(false)\n\n if (e.dataTransfer.files?.[0]) {\n handleUpload(e.dataTransfer.files[0])\n }\n },\n [handleUpload]\n )\n\n const handleFileInput = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (e.target.files?.[0]) {\n handleUpload(e.target.files[0])\n }\n },\n [handleUpload]\n )\n\n const handleClick = useCallback(() => {\n if (!uploading) {\n document.getElementById(\"media-upload-input\")?.click()\n }\n }, [uploading])\n\n return (\n <div className=\"w-full\">\n <div\n onDragEnter={handleDrag}\n onDragLeave={handleDrag}\n onDragOver={handleDrag}\n onDrop={handleDrop}\n className={cn(\n \"border-border hover:border-primary/50 flex cursor-pointer flex-col items-center justify-center rounded-lg border-2 border-dashed bg-white p-6 transition-colors\",\n dragActive && \"border-primary bg-primary/5\",\n uploading && \"pointer-events-none opacity-60\"\n )}\n onClick={handleClick}\n >\n {uploading ? (\n <div className=\"flex flex-col items-center gap-2\">\n <Loader2Icon className=\"text-primary size-6 animate-spin\" />\n <div className=\"text-sm font-medium\">Uploading...</div>\n <div className=\"bg-muted h-1.5 w-full overflow-hidden rounded-full\">\n <div\n className=\"bg-primary h-full transition-all duration-300\"\n style={{ width: `${uploadProgress}%` }}\n />\n </div>\n <div className=\"text-muted-foreground text-xs\">\n {Math.round(uploadProgress)}%\n </div>\n </div>\n ) : (\n <div className=\"flex flex-col items-center gap-2\">\n <UploadIcon className=\"text-muted-foreground size-8\" />\n <div className=\"text-sm font-medium\">\n Drop files or click to upload\n </div>\n <div className=\"text-muted-foreground text-xs\">\n PNG, JPG, GIF, WebP up to 10MB\n </div>\n </div>\n )}\n </div>\n <input\n id=\"media-upload-input\"\n type=\"file\"\n accept=\"image/*\"\n onChange={handleFileInput}\n className=\"hidden\"\n disabled={uploading}\n />\n </div>\n )\n}\n\nconst SOURCE_TYPE_OPTIONS = [\n { label: \"Medias\", value: \"media\" },\n { label: \"URL\", value: \"url\" },\n] as const\n\nconst DEFAULT_VALUE: MediaPickerValue = { type: \"media\", media: null }\n\ntype UrlFieldProps = {\n value: string\n onChange: (url: string) => void\n}\n\nconst UrlField = ({ value, onChange }: UrlFieldProps) => {\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(e.target.value)\n },\n [onChange]\n )\n\n return (\n <Input\n type=\"text\"\n value={value}\n onChange={handleChange}\n placeholder=\"https://example.com/image.jpg\"\n />\n )\n}\n\ntype MediaLibraryModalProps = {\n value: MediaItem | null\n onChange: (media: MediaItem | null) => void\n mediaType?: string\n open: boolean\n onOpenChange: (open: boolean) => void\n}\n\nconst MediaLibraryModal = ({\n value,\n onChange,\n mediaType,\n open,\n onOpenChange,\n}: MediaLibraryModalProps) => {\n const [medias, setMedias] = useState<MediaItem[]>([])\n const [loading, setLoading] = useState(false)\n const [selectedMedia, setSelectedMedia] = useState<MediaItem | null>(value)\n const [currentPage, setCurrentPage] = useState(1)\n const [totalPages, setTotalPages] = useState(1)\n const [totalItems, setTotalItems] = useState(0)\n const [searchQuery, setSearchQuery] = useState(\"\")\n const [itemsPerPage, setItemsPerPage] = useState(10)\n\n const loadMedias = useCallback(\n async (page: number, limit: number, query?: string) => {\n setLoading(true)\n try {\n const result = await fetchMedias({\n page,\n limit,\n query,\n filters: mediaType ? { type: mediaType } : undefined,\n })\n setMedias(result.items)\n setTotalItems(result.total)\n setTotalPages(Math.ceil(result.total / limit))\n } catch (error) {\n console.error(\"Error loading medias:\", error)\n } finally {\n setLoading(false)\n }\n },\n [mediaType]\n )\n\n useEffect(() => {\n if (open) {\n loadMedias(currentPage, itemsPerPage, searchQuery)\n }\n }, [open, currentPage, itemsPerPage, loadMedias, searchQuery])\n\n const handleSearch = useCallback((query: string) => {\n setSearchQuery(query)\n setCurrentPage(1)\n }, [])\n\n const handleItemsPerPageChange = useCallback((newLimit: number) => {\n setItemsPerPage(newLimit)\n setCurrentPage(1)\n }, [])\n\n const handleMediaSelectAndConfirm = useCallback(\n (media: MediaItem) => {\n setSelectedMedia(media)\n onChange(media)\n onOpenChange(false)\n },\n [onChange, onOpenChange]\n )\n\n const handleUploadSuccess = useCallback(\n async (media: MediaItem) => {\n await loadMedias(1, itemsPerPage)\n setCurrentPage(1)\n setSelectedMedia(media)\n },\n [loadMedias, itemsPerPage]\n )\n\n return (\n <DialogPopup className=\"max-w-4xl\">\n <DialogHeader>\n <DialogTitle>Select Media</DialogTitle>\n </DialogHeader>\n\n <div className=\"flex flex-col gap-4\">\n <InputGroup>\n <InputGroupInput\n placeholder=\"Search...\"\n value={searchQuery}\n onChange={(e) => handleSearch(e.target.value)}\n />\n <InputGroupAddon>\n <SearchIcon className=\"size-4\" />\n </InputGroupAddon>\n </InputGroup>\n\n {loading ? (\n <div className=\"flex items-center justify-center py-12\">\n <Loader2Icon className=\"text-muted-foreground size-8 animate-spin\" />\n </div>\n ) : medias.length > 0 ? (\n <>\n <div className=\"border-border overflow-hidden rounded-lg border\">\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead className=\"w-20\">\n Preview\n </TableHead>\n <TableHead>Name</TableHead>\n <TableHead>Type</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {medias.map((media) => (\n <TableRow\n key={media.id}\n className={cn(\n \"hover:bg-muted/50 cursor-pointer transition-colors\",\n selectedMedia?.id ===\n media.id && \"bg-primary/5\"\n )}\n onClick={() =>\n handleMediaSelectAndConfirm(\n media\n )\n }\n >\n <TableCell>\n <img\n src={media.thumbnail}\n alt={media.name}\n className=\"size-12 rounded object-cover\"\n />\n </TableCell>\n <TableCell className=\"font-medium\">\n {media.name}\n </TableCell>\n <TableCell className=\"text-muted-foreground text-sm\">\n {media.type}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n\n <TablePagination\n currentPage={currentPage}\n totalPages={totalPages}\n totalItems={totalItems}\n itemsPerPage={itemsPerPage}\n onPageChange={setCurrentPage}\n onItemsPerPageChange={handleItemsPerPageChange}\n pageSizeOptions={[5, 10, 20, 50]}\n />\n </>\n ) : (\n <div className=\"text-muted-foreground flex flex-col items-center justify-center py-12 text-sm\">\n <ImageIcon className=\"mb-2 size-12 opacity-20\" />\n <p>No media found</p>\n </div>\n )}\n </div>\n\n <DialogFooter>\n <MediaUploadZone onUploadSuccess={handleUploadSuccess} />\n </DialogFooter>\n </DialogPopup>\n )\n}\n\ntype MediaLibraryFieldProps = {\n value: MediaItem | null\n onChange: (media: MediaItem | null) => void\n mediaType?: string\n}\n\nconst MediaLibraryField = ({\n value,\n onChange,\n mediaType,\n}: MediaLibraryFieldProps) => {\n const [open, setOpen] = useState(false)\n const [selectedMedia, setSelectedMedia] = useState<MediaItem | null>(value)\n\n useEffect(() => {\n setSelectedMedia(value)\n }, [value])\n\n const handleChange = useCallback(\n (media: MediaItem | null) => {\n setSelectedMedia(media)\n onChange(media)\n },\n [onChange]\n )\n\n const handleClear = useCallback(() => {\n handleChange(null)\n }, [handleChange])\n\n return (\n <div className=\"flex flex-col gap-3\">\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger\n render={\n <Button variant=\"outline\" className=\"w-full\">\n {selectedMedia ? \"Change Media\" : \"Select Media\"}\n </Button>\n }\n />\n <MediaLibraryModal\n value={selectedMedia}\n onChange={handleChange}\n mediaType={mediaType}\n open={open}\n onOpenChange={setOpen}\n />\n </Dialog>\n\n {selectedMedia && (\n <div className=\"border-border bg-background flex items-center gap-3 rounded-lg border p-3\">\n <img\n src={selectedMedia.thumbnail}\n alt={selectedMedia.name}\n className=\"size-16 rounded object-cover\"\n />\n <div className=\"flex-1\">\n <p className=\"text-sm font-medium\">\n {selectedMedia.name}\n </p>\n <p className=\"text-muted-foreground text-xs\">\n {selectedMedia.type}\n </p>\n </div>\n <Button variant=\"ghost\" size=\"sm\" onClick={handleClear}>\n Clear\n </Button>\n </div>\n )}\n </div>\n )\n}\n\nconst useMediaPicker = (\n initialValue: MediaPickerValue | undefined,\n onChange: (val: MediaPickerValue) => void\n) => {\n const currentValue = initialValue || DEFAULT_VALUE\n const selectedType = currentValue.type || \"media\"\n\n const handleTypeChange = useCallback(\n (newType: unknown) => {\n onChange({\n ...currentValue,\n type: newType as \"url\" | \"media\",\n })\n },\n [currentValue, onChange]\n )\n\n const handleUrlChange = useCallback(\n (url: string) => {\n onChange({ ...currentValue, url })\n },\n [currentValue, onChange]\n )\n\n const handleMediaChange = useCallback(\n (media: MediaItem | null) => {\n onChange({ ...currentValue, media })\n },\n [currentValue, onChange]\n )\n\n return {\n currentValue,\n selectedType,\n handleTypeChange,\n handleUrlChange,\n handleMediaChange,\n }\n}\n\nexport type MediaPickerProps = {\n value?: MediaPickerValue\n onChange: (value: MediaPickerValue) => void\n mediaType?: string\n}\n\nexport const MediaPicker = ({\n value,\n onChange,\n mediaType,\n}: MediaPickerProps) => {\n const {\n currentValue,\n selectedType,\n handleTypeChange,\n handleUrlChange,\n handleMediaChange,\n } = useMediaPicker(value, onChange)\n\n return (\n <div className=\"flex flex-col gap-y-3\">\n <RadioGroup\n value={selectedType}\n onValueChange={handleTypeChange}\n className=\"border-input flex w-fit flex-wrap divide-x divide-stone-200 overflow-hidden rounded-md border\"\n >\n {SOURCE_TYPE_OPTIONS.map((option) => (\n <label key={option.value} className=\"flex-1\">\n <RadioGroupItem\n layout=\"horizontal\"\n value={option.value}\n >\n {option.label}\n </RadioGroupItem>\n </label>\n ))}\n </RadioGroup>\n\n {selectedType === \"url\" && (\n <UrlField\n value={currentValue.url || \"\"}\n onChange={handleUrlChange}\n />\n )}\n\n {selectedType === \"media\" && (\n <MediaLibraryField\n value={currentValue.media || null}\n onChange={handleMediaChange}\n mediaType={mediaType}\n />\n )}\n </div>\n )\n}\n\nexport const getMediaUrl = (value?: MediaPickerValue): string | undefined => {\n if (!value) return undefined\n if (value.type === \"media\" && value.media) {\n return value.media.url\n }\n return value.url\n}\n\nexport default MediaPicker\n","import { Fields } from \"@puckeditor/core\"\n\nexport type DisplayTraitProps = {\n display?:\n | \"hidden\"\n | \"inline\"\n | \"inline-block\"\n | \"block\"\n | \"flex\"\n | \"inline-flex\"\n}\n\nexport const displayField: Fields = {\n display: {\n type: \"select\",\n label: \"Display\",\n options: [\n { label: \"None (hidden)\", value: \"hidden\" },\n { label: \"Inline\", value: \"inline\" },\n { label: \"Inline Block\", value: \"inline-block\" },\n { label: \"Block\", value: \"block\" },\n { label: \"Flex\", value: \"flex\" },\n { label: \"Inline Flex\", value: \"inline-flex\" },\n ],\n },\n}\n\nexport function displayToClasses(\n display?:\n | \"hidden\"\n | \"inline\"\n | \"inline-block\"\n | \"block\"\n | \"flex\"\n | \"inline-flex\"\n): string {\n const classes: string[] = []\n\n if (display) {\n classes.push(display)\n }\n\n return classes.join(\" \")\n}\n\nexport const displayDefaultProps: DisplayTraitProps = {\n display: \"block\",\n}\n","import React from \"react\"\nimport { Fields } from \"@puckeditor/core\"\nimport { Minus } from \"lucide-react\"\n\nexport type FontWeightTraitProps = {\n fontWeight?:\n | \"\"\n | \"thin\"\n | \"extralight\"\n | \"light\"\n | \"normal\"\n | \"medium\"\n | \"semibold\"\n | \"bold\"\n | \"extrabold\"\n | \"black\"\n}\n\nexport const fontWeightField: Fields = {\n fontWeight: {\n type: \"select\",\n label: \"Font weight\",\n\n options: [\n { label: <Minus size={16} />, value: \"\" },\n { label: \"Thin (100)\", value: \"thin\" },\n { label: \"Extra Light (200)\", value: \"extralight\" },\n { label: \"Light (300)\", value: \"light\" },\n { label: \"Normal (400)\", value: \"normal\" },\n { label: \"Medium (500)\", value: \"medium\" },\n { label: \"Semibold (600)\", value: \"semibold\" },\n { label: \"Bold (700)\", value: \"bold\" },\n { label: \"Extra Bold (800)\", value: \"extrabold\" },\n { label: \"Black (900)\", value: \"black\" },\n ],\n },\n}\n\nexport function fontWeightToClasses(fontWeight?: string): string {\n if (!fontWeight) return \"\"\n return `font-${fontWeight}`\n}\n\nexport const fontWeightDefaultProps = {\n fontWeight: \"\" as const,\n}\n","import React from \"react\"\nimport { Fields } from \"@puckeditor/core\"\nimport { MinusIcon } from \"lucide-react\"\n\nexport type LineHeightTraitProps = {\n lineHeight?: \"\" | \"1\" | \"1.25\" | \"1.5\" | \"2\"\n}\n\nexport const lineHeightField: Fields = {\n lineHeight: {\n type: \"select\",\n label: \"Line height\",\n\n options: [\n { label: <MinusIcon size={16} />, value: \"\" },\n { label: \"1\", value: \"none\" },\n { label: \"1.25\", value: \"1.25\" },\n { label: \"1.5\", value: \"1.5\" },\n { label: \"2\", value: \"2\" },\n ],\n },\n}\n\nexport function lineHeightToClasses(lineHeight?: string): string {\n if (!lineHeight) return \"\"\n return `leading-[${lineHeight}]`\n}\n\nexport const lineHeightDefaultProps = {\n lineHeight: \"\" as const,\n}\n","import { Fields } from \"@puckeditor/core\"\n\nexport type MarginValue = { value: string; unit: string }\n\nexport type MarginItem = {\n breakpoint?: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\"\n direction: \"all\" | \"top\" | \"right\" | \"bottom\" | \"left\" | \"x\" | \"y\"\n margin: MarginValue\n}\n\nexport type MarginsTraitProps = {\n margins?: Array<MarginItem>\n}\n\nconst MARGIN_UNITS = [\n { label: \"px\", value: \"px\" },\n { label: \"rem\", value: \"rem\" },\n { label: \"em\", value: \"em\" },\n { label: \"%\", value: \"%\" },\n { label: \"auto\", value: \"auto\" },\n]\n\nfunction getMarginSummary(item: MarginItem): string {\n if (!item || !item.direction) return \"Margin\"\n\n const bp = item.breakpoint ? `${item.breakpoint.toUpperCase()} - ` : \"\"\n const dir =\n item.direction === \"all\"\n ? \"All 4 directions\"\n : item.direction === \"x\"\n ? \"Horizontal\"\n : item.direction === \"y\"\n ? \"Vertical\"\n : item.direction.charAt(0).toUpperCase() +\n item.direction.slice(1)\n const value = item.margin?.value || \"0\"\n const unit = item.margin?.unit || \"px\"\n return `${bp}${dir}: ${value}${unit}`\n}\n\nexport const marginsField: Fields = {\n margins: {\n type: \"array\",\n label: \"Margins\",\n arrayFields: {\n breakpoint: {\n type: \"select\",\n label: \"Breakpoint\",\n options: [\n { label: \"Base\", value: \"\" },\n { label: \"XS\", value: \"xs\" },\n { label: \"SM\", value: \"sm\" },\n { label: \"MD\", value: \"md\" },\n { label: \"LG\", value: \"lg\" },\n { label: \"XL\", value: \"xl\" },\n { label: \"2XL\", value: \"2xl\" },\n ],\n },\n direction: {\n type: \"select\",\n label: \"Direction\",\n options: [\n { label: \"All 4 directions\", value: \"all\" },\n { label: \"Top\", value: \"top\" },\n { label: \"Right\", value: \"right\" },\n { label: \"Bottom\", value: \"bottom\" },\n { label: \"Left\", value: \"left\" },\n { label: \"Horizontal (X)\", value: \"x\" },\n { label: \"Vertical (Y)\", value: \"y\" },\n ],\n },\n margin: {\n type: \"numberUnit\" as any,\n label: \"Margin\",\n options: MARGIN_UNITS,\n },\n },\n defaultItemProps: {\n breakpoint: \"md\",\n direction: \"all\",\n margin: { value: \"0\", unit: \"px\" },\n },\n getItemSummary: (item: MarginItem) => getMarginSummary(item),\n },\n}\n\nexport function marginsToClasses(margins?: Array<MarginItem>): string {\n if (!margins || margins.length === 0) return \"\"\n\n const classes: string[] = []\n\n margins.forEach((item) => {\n if (!item || !item.direction || !item.margin) return\n\n const prefix = item.breakpoint ? `${item.breakpoint}:` : \"\"\n const value = item.margin.value || \"0\"\n const unit = item.margin.unit || \"px\"\n\n // Skip if value is empty\n if (!value.trim()) return\n\n let marginClass = \"\"\n switch (item.direction) {\n case \"all\":\n marginClass = `${prefix}m-[${value}${unit}]`\n break\n case \"x\":\n marginClass = `${prefix}mx-[${value}${unit}]`\n break\n case \"y\":\n marginClass = `${prefix}my-[${value}${unit}]`\n break\n case \"top\":\n marginClass = `${prefix}mt-[${value}${unit}]`\n break\n case \"right\":\n marginClass = `${prefix}mr-[${value}${unit}]`\n break\n case \"bottom\":\n marginClass = `${prefix}mb-[${value}${unit}]`\n break\n case \"left\":\n marginClass = `${prefix}ml-[${value}${unit}]`\n break\n }\n\n if (marginClass) {\n classes.push(marginClass)\n }\n })\n\n return classes.join(\" \")\n}\n\nexport const marginsDefaultProps = {\n margins: [] as Array<MarginItem>,\n}\n","import { Fields } from \"@puckeditor/core\"\n\nexport type PaddingValue = { value: string; unit: string }\n\nexport type PaddingItem = {\n breakpoint?: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\"\n direction: \"all\" | \"top\" | \"right\" | \"bottom\" | \"left\" | \"x\" | \"y\"\n padding: PaddingValue\n}\n\nexport type PaddingsTraitProps = {\n paddings?: Array<PaddingItem>\n}\n\nconst PADDING_UNITS = [\n { label: \"px\", value: \"px\" },\n { label: \"rem\", value: \"rem\" },\n { label: \"em\", value: \"em\" },\n { label: \"%\", value: \"%\" },\n]\n\nfunction getPaddingSummary(item: PaddingItem): string {\n if (!item || !item.direction) return \"Padding\"\n\n const bp = item.breakpoint ? `${item.breakpoint.toUpperCase()} - ` : \"\"\n const dir =\n item.direction === \"all\"\n ? \"All 4 directions\"\n : item.direction === \"x\"\n ? \"Horizontal\"\n : item.direction === \"y\"\n ? \"Vertical\"\n : item.direction.charAt(0).toUpperCase() +\n item.direction.slice(1)\n const value = item.padding?.value || \"0\"\n const unit = item.padding?.unit || \"px\"\n return `${bp}${dir}: ${value}${unit}`\n}\n\nexport const paddingsField: Fields = {\n paddings: {\n type: \"array\",\n label: \"Paddings\",\n arrayFields: {\n breakpoint: {\n type: \"select\",\n label: \"Breakpoint\",\n options: [\n { label: \"Base\", value: \"\" },\n { label: \"XS\", value: \"xs\" },\n { label: \"SM\", value: \"sm\" },\n { label: \"MD\", value: \"md\" },\n { label: \"LG\", value: \"lg\" },\n { label: \"XL\", value: \"xl\" },\n { label: \"2XL\", value: \"2xl\" },\n ],\n },\n direction: {\n type: \"select\",\n label: \"Direction\",\n options: [\n { label: \"All 4 directions\", value: \"all\" },\n { label: \"Top\", value: \"top\" },\n { label: \"Right\", value: \"right\" },\n { label: \"Bottom\", value: \"bottom\" },\n { label: \"Left\", value: \"left\" },\n { label: \"Horizontal (X)\", value: \"x\" },\n { label: \"Vertical (Y)\", value: \"y\" },\n ],\n },\n padding: {\n type: \"numberUnit\" as any,\n label: \"Padding\",\n options: PADDING_UNITS,\n },\n },\n defaultItemProps: {\n breakpoint: \"md\",\n direction: \"all\",\n padding: { value: \"0\", unit: \"px\" },\n },\n getItemSummary: (item: PaddingItem) => getPaddingSummary(item),\n },\n}\n\nexport function paddingsToClasses(paddings?: Array<PaddingItem>): string {\n if (!paddings || paddings.length === 0) return \"\"\n\n const classes: string[] = []\n\n paddings.forEach((item) => {\n if (!item || !item.direction || !item.padding) return\n\n const prefix = item.breakpoint ? `${item.breakpoint}:` : \"\"\n const value = item.padding.value || \"0\"\n const unit = item.padding.unit || \"px\"\n\n // Skip if value is empty\n if (!value.trim()) return\n\n let paddingClass = \"\"\n switch (item.direction) {\n case \"all\":\n paddingClass = `${prefix}p-[${value}${unit}]`\n break\n case \"x\":\n paddingClass = `${prefix}px-[${value}${unit}]`\n break\n case \"y\":\n paddingClass = `${prefix}py-[${value}${unit}]`\n break\n case \"top\":\n paddingClass = `${prefix}pt-[${value}${unit}]`\n break\n case \"right\":\n paddingClass = `${prefix}pr-[${value}${unit}]`\n break\n case \"bottom\":\n paddingClass = `${prefix}pb-[${value}${unit}]`\n break\n case \"left\":\n paddingClass = `${prefix}pl-[${value}${unit}]`\n break\n }\n\n if (paddingClass) {\n classes.push(paddingClass)\n }\n })\n\n return classes.join(\" \")\n}\n\nexport const paddingsDefaultProps = {\n paddings: [] as Array<PaddingItem>,\n}\n","import { Fields } from \"@puckeditor/core\"\n\nexport type PositionTraitProps = {\n position?: \"static\" | \"relative\" | \"absolute\" | \"fixed\" | \"sticky\"\n top?: string\n right?: string\n bottom?: string\n left?: string\n zIndex?: number\n}\n\nexport const positionField: Fields = {\n position: {\n type: \"select\",\n label: \"Position\",\n options: [\n { label: \"Static\", value: \"static\" },\n { label: \"Relative\", value: \"relative\" },\n { label: \"Absolute\", value: \"absolute\" },\n { label: \"Fixed\", value: \"fixed\" },\n { label: \"Sticky\", value: \"sticky\" },\n ],\n },\n top: {\n type: \"text\",\n label: \"Top\",\n },\n right: {\n type: \"text\",\n label: \"Right\",\n },\n bottom: {\n type: \"text\",\n label: \"Bottom\",\n },\n left: {\n type: \"text\",\n label: \"Left\",\n },\n zIndex: {\n type: \"number\",\n label: \"Z-Index\",\n },\n}\n\nexport function positionToClasses(\n position?: \"static\" | \"relative\" | \"absolute\" | \"fixed\" | \"sticky\",\n top?: string,\n right?: string,\n bottom?: string,\n left?: string,\n zIndex?: number\n): string {\n const classes: string[] = []\n\n if (position) {\n classes.push(position)\n }\n\n if (top && top.trim()) {\n classes.push(`top-[${top}]`)\n }\n\n if (right && right.trim()) {\n classes.push(`right-[${right}]`)\n }\n\n if (bottom && bottom.trim()) {\n classes.push(`bottom-[${bottom}]`)\n }\n\n if (left && left.trim()) {\n classes.push(`left-[${left}]`)\n }\n\n if (zIndex !== undefined && zIndex !== null) {\n classes.push(`z-[${zIndex}]`)\n }\n\n return classes.join(\" \")\n}\n\nexport const positionDefaultProps: PositionTraitProps = {\n position: \"static\",\n top: \"\",\n right: \"\",\n bottom: \"\",\n left: \"\",\n zIndex: 0,\n}\n","import { Fields } from \"@puckeditor/core\"\n\nexport type SizeValue = { value: string; unit: string }\n\nexport type SizeTraitProps = {\n width?: SizeValue\n minWidth?: SizeValue\n maxWidth?: SizeValue\n height?: SizeValue\n minHeight?: SizeValue\n maxHeight?: SizeValue\n}\n\nconst WIDTH_UNITS = [\n { label: \"px\", value: \"px\" },\n { label: \"%\", value: \"%\" },\n { label: \"em\", value: \"em\" },\n { label: \"rem\", value: \"rem\" },\n { label: \"vw\", value: \"vw\" },\n]\n\nconst HEIGHT_UNITS = [\n { label: \"px\", value: \"px\" },\n { label: \"%\", value: \"%\" },\n { label: \"em\", value: \"em\" },\n { label: \"rem\", value: \"rem\" },\n { label: \"vh\", value: \"vh\" },\n]\n\nexport const sizeField: Fields = {\n width: {\n type: \"numberUnit\" as any,\n label: \"Width\",\n options: WIDTH_UNITS,\n },\n minWidth: {\n type: \"numberUnit\" as any,\n label: \"Min Width\",\n options: WIDTH_UNITS,\n },\n maxWidth: {\n type: \"numberUnit\" as any,\n label: \"Max Width\",\n options: WIDTH_UNITS,\n },\n height: {\n type: \"numberUnit\" as any,\n label: \"Height\",\n options: HEIGHT_UNITS,\n },\n minHeight: {\n type: \"numberUnit\" as any,\n label: \"Min Height\",\n options: HEIGHT_UNITS,\n },\n maxHeight: {\n type: \"numberUnit\" as any,\n label: \"Max Height\",\n options: HEIGHT_UNITS,\n },\n}\n\nconst addSizeClass = (\n classes: string[],\n size: SizeValue | undefined,\n prefix: string\n): void => {\n if (size && size.value && size.value.trim()) {\n classes.push(`${prefix}-[${size.value}${size.unit}]`)\n }\n}\n\nexport function sizeToClasses(\n width?: SizeValue,\n minWidth?: SizeValue,\n maxWidth?: SizeValue,\n height?: SizeValue,\n minHeight?: SizeValue,\n maxHeight?: SizeValue\n): string {\n const classes: string[] = []\n\n addSizeClass(classes, width, \"w\")\n addSizeClass(classes, minWidth, \"min-w\")\n addSizeClass(classes, maxWidth, \"max-w\")\n addSizeClass(classes, height, \"h\")\n addSizeClass(classes, minHeight, \"min-h\")\n addSizeClass(classes, maxHeight, \"max-h\")\n\n return classes.join(\" \")\n}\n\nexport const sizeDefaultProps: SizeTraitProps = {\n width: { value: \"\", unit: \"px\" },\n minWidth: { value: \"\", unit: \"px\" },\n maxWidth: { value: \"\", unit: \"px\" },\n height: { value: \"\", unit: \"px\" },\n minHeight: { value: \"\", unit: \"px\" },\n maxHeight: { value: \"\", unit: \"px\" },\n}\n","export * from \"./margins\"\nexport * from \"./paddings\"\n\nimport {\n MarginsTraitProps,\n marginsField,\n marginsDefaultProps,\n marginsToClasses,\n} from \"./margins\"\nimport {\n PaddingsTraitProps,\n paddingsField,\n paddingsDefaultProps,\n paddingsToClasses,\n} from \"./paddings\"\n\nexport type SpacingTraitProps = MarginsTraitProps & PaddingsTraitProps\n\nexport const spacingFields = {\n ...marginsField,\n ...paddingsField,\n}\n\nexport const spacingDefaultProps = {\n ...marginsDefaultProps,\n ...paddingsDefaultProps,\n}\n\nexport function spacingToClasses(props: Partial<SpacingTraitProps>): string {\n const classes = [\n marginsToClasses(props.margins),\n paddingsToClasses(props.paddings),\n ].filter(Boolean)\n\n return classes.join(\" \")\n}\n\nexport const spacingFieldNames = [\"margins\", \"paddings\"] as const\n","export const spacingOptions = [\n { label: \"0 rem\", value: \"0px\" },\n { label: \"0.25 rem\", value: \"4px\" },\n { label: \"0.5 rem\", value: \"8px\" },\n { label: \"0.75 rem\", value: \"12px\" },\n { label: \"1 rem\", value: \"16px\" },\n { label: \"1.25 rem\", value: \"20px\" },\n { label: \"1.5 rem\", value: \"24px\" },\n { label: \"1.75 rem\", value: \"28px\" },\n { label: \"2 rem\", value: \"32px\" },\n { label: \"2.25 rem\", value: \"36px\" },\n { label: \"2.5 rem\", value: \"40px\" },\n { label: \"2.75 rem\", value: \"44px\" },\n { label: \"3 rem\", value: \"48px\" },\n { label: \"3.25 rem\", value: \"52px\" },\n { label: \"3.5 rem\", value: \"56px\" },\n { label: \"3.75 rem\", value: \"60px\" },\n { label: \"4 rem\", value: \"64px\" },\n { label: \"4.25 rem\", value: \"68px\" },\n { label: \"4.5 rem\", value: \"72px\" },\n { label: \"4.75 rem\", value: \"76px\" },\n { label: \"5 rem\", value: \"80px\" },\n]\n","import React from \"react\"\nimport { Fields } from \"@puckeditor/core\"\nimport {\n AlignLeftIcon,\n AlignCenterIcon,\n AlignRightIcon,\n AlignJustifyIcon,\n} from \"lucide-react\"\n\nexport type TextAlignTraitProps = {\n textAlign?: \"left\" | \"center\" | \"right\" | \"justify\"\n}\n\nexport const textAlignField: Fields = {\n textAlign: {\n type: \"radio\",\n label: \"Text align\",\n\n options: [\n { label: <AlignLeftIcon size={16} />, value: \"left\" },\n { label: <AlignCenterIcon size={16} />, value: \"center\" },\n { label: <AlignRightIcon size={16} />, value: \"right\" },\n { label: <AlignJustifyIcon size={16} />, value: \"justify\" },\n ],\n },\n}\n\nexport function textAlignToClasses(textAlign?: string): string {\n if (!textAlign) return \"\"\n return `text-${textAlign}`\n}\n\nexport const textAlignDefaultProps = {\n textAlign: \"left\" as const,\n}\n","\"use client\"\n\nimport { createContext, useContext, useMemo } from \"react\"\nimport { Menu as MenuPrimitive } from \"@base-ui/react/menu\"\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst cssAnimationPresets = {\n none: \"transition-none\",\n scale: [\n `[transition-property:scale,opacity] [will-change:scale,opacity]`,\n `data-starting-style:scale-80 data-starting-style:opacity-0 data-ending-style:opacity-0 data-ending-style:scale-80`,\n ],\n fade: [\n `[transition-property:opacity] [will-change:opacity]`,\n `data-starting-style:opacity-0 data-ending-style:opacity-0`,\n ],\n slideOutside: [\n `[transition-property:translate,opacity] [will-change:translate,opacity]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:translate-y-[10px] data-[side=bottom]:data-ending-style:translate-y-[10px] data-[side=bottom]:data-ending-style:opacity-0`,\n // side=top\n `data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:translate-y-[-10px] data-[side=top]:data-ending-style:translate-y-[-10px] data-[side=top]:data-ending-style:opacity-0`,\n // side=left\n `data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:translate-x-[-10px] data-[side=left]:data-ending-style:translate-x-[-10px] data-[side=left]:data-ending-style:opacity-0`,\n // side=right\n `data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:translate-x-[10px] data-[side=right]:data-ending-style:translate-x-[10px] data-[side=right]:data-ending-style:opacity-0`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:translate-x-[-10px] data-[side=inline-start]:data-ending-style:translate-x-[-10px] data-[side=inline-start]:data-ending-style:opacity-0`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:translate-x-[10px] data-[side=inline-end]:data-ending-style:translate-x-[10px] data-[side=inline-end]:data-ending-style:opacity-0`,\n ],\n slideInside: [\n `[transition-property:translate,opacity] [will-change:translate,opacity]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:translate-y-[-10px] data-[side=bottom]:data-ending-style:translate-y-[-10px] data-[side=bottom]:data-ending-style:opacity-0`,\n // side=top\n `data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:translate-y-[10px] data-[side=top]:data-ending-style:translate-y-[10px] data-[side=top]:data-ending-style:opacity-0`,\n // side=left\n `data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:translate-x-[10px] data-[side=left]:data-ending-style:translate-x-[10px] data-[side=left]:data-ending-style:opacity-0`,\n // side=right\n `data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:translate-x-[-10px] data-[side=right]:data-ending-style:translate-x-[-10px] data-[side=right]:data-ending-style:opacity-0`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:translate-x-[10px] data-[side=inline-start]:data-ending-style:translate-x-[10px] data-[side=inline-start]:data-ending-style:opacity-0`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:translate-x-[-10px] data-[side=inline-end]:data-ending-style:translate-x-[-10px] data-[side=inline-end]:data-ending-style:opacity-0`,\n ],\n wipe: [\n `[transition-property:clip-path] [will-change:clip-path]`,\n `[clip-path:inset(0_0_0_0_round_12px)] [-webkit-clip-path:inset(0_0_0_0_round_12px)]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:[clip-path:inset(0_0_100%_0_round_12px)] data-[side=bottom]:data-ending-style:[clip-path:inset(0_0_100%_0_round_12px)]`,\n // side=top\n `data-[side=top]:data-starting-style:[clip-path:inset(100%_0_0_0_round_12px)] data-[side=top]:data-ending-style:[clip-path:inset(100%_0_0_0_round_12px)]`,\n // side=left\n `data-[side=left]:data-starting-style:[clip-path:inset(0_0_0_100%_round_12px)] data-[side=left]:data-ending-style:[clip-path:inset(0_0_0_100%_round_12px)]`,\n // side=right\n `data-[side=right]:data-starting-style:[clip-path:inset(0_100%_0_0_round_12px)] data-[side=right]:data-ending-style:[clip-path:inset(0_100%_0_0_round_12px)]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:[clip-path:inset(0_0_0_100%_round_12px)] data-[side=inline-start]:data-ending-style:[clip-path:inset(0_0_0_100%_round_12px)]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:[clip-path:inset(0_100%_0_0_round_12px)] data-[side=inline-end]:data-ending-style:[clip-path:inset(0_100%_0_0_round_12px)]`,\n ],\n wipeScale: [\n `[transition-property:clip-path,scale] [will-change:clip-path,scale]`,\n `[clip-path:inset(0_0_0_0_round_12px)] [-webkit-clip-path:inset(0_0_0_0_round_12px)]`,\n `data-starting-style:scale-80 data-ending-style:scale-80`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:[clip-path:inset(0_0_100%_0_round_12px)] data-[side=bottom]:data-ending-style:[clip-path:inset(0_0_100%_0_round_12px)]`,\n // side=top\n `data-[side=top]:data-starting-style:[clip-path:inset(100%_0_0_0_round_12px)] data-[side=top]:data-ending-style:[clip-path:inset(100%_0_0_0_round_12px)]`,\n // side=left\n `data-[side=left]:data-starting-style:[clip-path:inset(0_0_0_100%_round_12px)] data-[side=left]:data-ending-style:[clip-path:inset(0_0_0_100%_round_12px)]`,\n // side=right\n `data-[side=right]:data-starting-style:[clip-path:inset(0_100%_0_0_round_12px)] data-[side=right]:data-ending-style:[clip-path:inset(0_100%_0_0_round_12px)]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:[clip-path:inset(0_0_0_100%_round_12px)] data-[side=inline-start]:data-ending-style:[clip-path:inset(0_0_0_100%_round_12px)]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:[clip-path:inset(0_100%_0_0_round_12px)] data-[side=inline-end]:data-ending-style:[clip-path:inset(0_100%_0_0_round_12px)]`,\n ],\n motion: [\n `[transition-property:translate,scale,opacity,rotateX,rotateY,transform] [will-change:translate,scale,opacity,rotateX,rotateY,transform]`,\n `[transform:perspective(1000px)]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:translate-y-[7px] data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:scale-[0.26] data-[side=bottom]:data-starting-style:rotate-x-[70deg] data-[side=bottom]:data-ending-style:translate-y-[7px] data-[side=bottom]:data-ending-style:opacity-0 data-[side=bottom]:data-ending-style:scale-[0.26] data-[side=bottom]:data-ending-style:rotate-x-[70deg]`,\n // side=top\n `data-[side=top]:data-starting-style:translate-y-[7px] data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:scale-[0.26] data-[side=top]:data-starting-style:rotate-x-[70deg] data-[side=top]:data-ending-style:translate-y-[7px] data-[side=top]:data-ending-style:opacity-0 data-[side=top]:data-ending-style:scale-[0.26] data-[side=top]:data-ending-style:rotate-x-[70deg]`,\n // side=left\n `data-[side=left]:data-starting-style:translate-x-[-7px] data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:scale-[0.26] data-[side=left]:data-starting-style:rotate-y-[-40deg] data-[side=left]:data-ending-style:translate-x-[-7px] data-[side=left]:data-ending-style:opacity-0 data-[side=left]:data-ending-style:scale-[0.26] data-[side=left]:data-ending-style:rotate-y-[-40deg]`,\n // side=right\n `data-[side=right]:data-starting-style:translate-x-[7px] data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:scale-[0.26] data-[side=right]:data-starting-style:rotate-y-[40deg] data-[side=right]:data-ending-style:translate-x-[7px] data-[side=right]:data-ending-style:opacity-0 data-[side=right]:data-ending-style:scale-[0.26] data-[side=right]:data-ending-style:rotate-y-[40deg]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:translate-x-[-7px] data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:scale-[0.26] data-[side=inline-start]:data-starting-style:rotate-y-[-40deg] data-[side=inline-start]:data-ending-style:translate-x-[-7px] data-[side=inline-start]:data-ending-style:opacity-0 data-[side=inline-start]:data-ending-style:scale-[0.26] data-[side=inline-start]:data-ending-style:rotate-y-[-40deg]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:translate-x-[7px] data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:scale-[0.26] data-[side=inline-end]:data-starting-style:rotate-y-[40deg] data-[side=inline-end]:data-ending-style:translate-x-[7px] data-[side=inline-end]:data-ending-style:opacity-0 data-[side=inline-end]:data-ending-style:scale-[0.26] data-[side=inline-end]:data-ending-style:rotate-y-[40deg]`,\n ],\n motionBlur: [\n `[transition-property:translate,scale,opacity,rotateX,rotateY,transform,filter] [will-change:translate,scale,opacity,rotateX,rotateY,transform,filter]`,\n `[transform:perspective(1000px)]`,\n `data-starting-style:blur-[9px] data-ending-style:blur-[9px]`,\n // side=bottom\n `data-[side=bottom]:data-starting-style:translate-y-[7px] data-[side=bottom]:data-starting-style:opacity-0 data-[side=bottom]:data-starting-style:scale-[0.26] data-[side=bottom]:data-starting-style:rotate-x-[70deg] data-[side=bottom]:data-ending-style:translate-y-[7px] data-[side=bottom]:data-ending-style:opacity-0 data-[side=bottom]:data-ending-style:scale-[0.26] data-[side=bottom]:data-ending-style:rotate-x-[70deg]`,\n // side=top\n `data-[side=top]:data-starting-style:translate-y-[7px] data-[side=top]:data-starting-style:opacity-0 data-[side=top]:data-starting-style:scale-[0.26] data-[side=top]:data-starting-style:rotate-x-[70deg] data-[side=top]:data-ending-style:translate-y-[7px] data-[side=top]:data-ending-style:opacity-0 data-[side=top]:data-ending-style:scale-[0.26] data-[side=top]:data-ending-style:rotate-x-[70deg]`,\n // side=left\n `data-[side=left]:data-starting-style:translate-x-[-7px] data-[side=left]:data-starting-style:opacity-0 data-[side=left]:data-starting-style:scale-[0.26] data-[side=left]:data-starting-style:rotate-y-[-40deg] data-[side=left]:data-ending-style:translate-x-[-7px] data-[side=left]:data-ending-style:opacity-0 data-[side=left]:data-ending-style:scale-[0.26] data-[side=left]:data-ending-style:rotate-y-[-40deg]`,\n // side=right\n `data-[side=right]:data-starting-style:translate-x-[7px] data-[side=right]:data-starting-style:opacity-0 data-[side=right]:data-starting-style:scale-[0.26] data-[side=right]:data-starting-style:rotate-y-[40deg] data-[side=right]:data-ending-style:translate-x-[7px] data-[side=right]:data-ending-style:opacity-0 data-[side=right]:data-ending-style:scale-[0.26] data-[side=right]:data-ending-style:rotate-y-[40deg]`,\n // side=inline-start\n `data-[side=inline-start]:data-starting-style:translate-x-[-7px] data-[side=inline-start]:data-starting-style:opacity-0 data-[side=inline-start]:data-starting-style:scale-[0.26] data-[side=inline-start]:data-starting-style:rotate-y-[-40deg] data-[side=inline-start]:data-ending-style:translate-x-[-7px] data-[side=inline-start]:data-ending-style:opacity-0 data-[side=inline-start]:data-ending-style:scale-[0.26] data-[side=inline-start]:data-ending-style:rotate-y-[-40deg]`,\n // side=inline-end\n `data-[side=inline-end]:data-starting-style:translate-x-[7px] data-[side=inline-end]:data-starting-style:opacity-0 data-[side=inline-end]:data-starting-style:scale-[0.26] data-[side=inline-end]:data-starting-style:rotate-y-[40deg] data-[side=inline-end]:data-ending-style:translate-x-[7px] data-[side=inline-end]:data-ending-style:opacity-0 data-[side=inline-end]:data-ending-style:scale-[0.26] data-[side=inline-end]:data-ending-style:rotate-y-[40deg]`,\n ],\n}\n\nconst cssTransitionPresets = {\n inExpo: `duration-[0.35s] ease-[cubic-bezier(0.95,0.05,0.795,0.035)]`,\n outExpo: `duration-[0.35s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n inOutExpo: `duration-[0.35s] ease-[cubic-bezier(1,0,0,1)]`,\n anticipate: `duration-[0.35s] ease-[cubic-bezier(1,-0.4,0.35,0.95)]`,\n quickOut: `duration-[0.35s] ease-out`,\n overshootOut: `duration-[0.35s] ease-[cubic-bezier(0.175,0.885,0.32,1.275)]`,\n swiftOut: `duration-[0.35s] ease-[cubic-bezier(0.175,0.885,0.32,1.1)]`,\n snappyOut: `duration-[0.35s] ease-[cubic-bezier(0.19,1,0.22,1)]`,\n in: `duration-[0.35s] ease-[cubic-bezier(0.42,0,1,1)]`,\n out: `duration-[0.35s] ease-[cubic-bezier(0,0,0.58,1)]`,\n inOut: `duration-[0.25s] ease-[cubic-bezier(0.42,0,0.58,1)]`,\n outIn: `duration-[0.35s] ease-[cubic-bezier(0.1,0.7,0.9,0.5)]`,\n inQuad: `duration-[0.35s] ease-[cubic-bezier(0.55,0.085,0.68,0.53)]`,\n outQuad: `duration-[0.25s] ease-[cubic-bezier(0.25,0.46,0.45,0.94)]`,\n inOutQuad: `duration-[0.32s] ease-[cubic-bezier(0.455,0.03,0.515,0.955)]`,\n inCubic: `duration-[0.35s] ease-[cubic-bezier(0.55,0.055,0.675,0.19)]`,\n outCubic: `duration-[0.35s] ease-[cubic-bezier(0.215,0.61,0.355,1)]`,\n inOutCubic: `duration-[0.35s] ease-[cubic-bezier(0.645,0.045,0.355,1)]`,\n inQuart: `duration-[0.35s] ease-[cubic-bezier(0.895,0.03,0.685,0.22)]`,\n outQuart: `duration-[0.35s] ease-[cubic-bezier(0.165,0.84,0.44,1)]`,\n inOutQuart: `duration-[0.35s] ease-[cubic-bezier(0.77,0,0.175,1)]`,\n inQuint: `duration-[0.35s] ease-[cubic-bezier(0.755,0.05,0.855,0.06)]`,\n outQuint: `duration-[0.35s] ease-[cubic-bezier(0.23,1,0.32,1)]`,\n inOutQuint: `duration-[0.35s] ease-[cubic-bezier(0.86,0,0.07,1)]`,\n inCirc: `duration-[0.35s] ease-[cubic-bezier(0.6,0.04,0.98,0.335)]`,\n outCirc: `duration-[0.35s] ease-[cubic-bezier(0.075,0.82,0.165,1)]`,\n inOutCirc: `duration-[0.35s] ease-[cubic-bezier(0.785,0.135,0.15,0.86)]`,\n inOutBase: `duration-[0.35s] ease-[cubic-bezier(0.25,0.1,0.25,1)]`,\n}\n\ntype CSSAnimationPresets = keyof typeof cssAnimationPresets\ntype CSSTransitionPresets = keyof typeof cssTransitionPresets\n\ntype Backdrop = \"opaque\" | \"blur\" | \"transparent\"\n\ninterface MenuContextType {\n backdrop?: Backdrop\n}\n\nconst MenuContext = createContext<MenuContextType | undefined>(undefined)\n\nfunction useMenu() {\n const context = useContext(MenuContext)\n if (!context) {\n throw new Error(\"useMenu must be used within a MenuProvider\")\n }\n return context\n}\n\ninterface MenuProps extends MenuPrimitive.Root.Props {\n backdrop?: Backdrop\n}\n\nfunction Menu({ backdrop = \"transparent\", ...props }: MenuProps) {\n return (\n <MenuContext.Provider value={{ backdrop }}>\n <MenuPrimitive.Root data-slot=\"menu\" {...props} />\n </MenuContext.Provider>\n )\n}\n\ninterface MenuTriggerProps extends MenuPrimitive.Trigger.Props {}\n\nfunction MenuTrigger({ ...props }: MenuTriggerProps) {\n return <MenuPrimitive.Trigger data-slot=\"menu-trigger\" {...props} />\n}\n\ninterface MenuPortalProps extends MenuPrimitive.Portal.Props {}\n\nfunction MenuPortal(props: MenuPortalProps) {\n return <MenuPrimitive.Portal data-slot=\"menu-portal\" {...props} />\n}\n\ninterface MenuBackdropProps extends MenuPrimitive.Backdrop.Props {}\n\nfunction MenuBackdrop({ className, ...props }: MenuBackdropProps) {\n const { backdrop = \"transparent\" } = useMenu()\n\n return (\n <MenuPrimitive.Backdrop\n data-slot=\"menu-backdrop\"\n className={cn(\n backdrop === \"opaque\" &&\n \"fixed inset-0 z-100 bg-black opacity-40 transition-all duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0 dark:opacity-60\",\n backdrop === \"blur\" &&\n \"fixed inset-0 z-100 backdrop-blur-sm transition-all duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0\",\n backdrop === \"transparent\" && \"hidden\",\n className\n )}\n {...props}\n />\n )\n}\n\ninterface MenuPositionerProps extends MenuPrimitive.Positioner.Props {}\n\nfunction MenuPositioner({\n sideOffset = 4,\n side = \"bottom\",\n className,\n ...rest\n}: MenuPositionerProps) {\n return (\n <MenuPortal>\n <MenuBackdrop />\n <MenuPrimitive.Positioner\n sideOffset={sideOffset}\n side={side}\n data-slot=\"menu-positioner\"\n className={cn(\n \"z-100 [--item-block-padding:6px] [--item-inline-padding:8px]\",\n (side === \"inline-end\" || side === \"inline-start\") &&\n \"**:data-[slot=menu-arrow]:hidden\",\n className\n )}\n {...rest}\n />\n </MenuPortal>\n )\n}\n\ninterface MenuArrowProps extends MenuPrimitive.Arrow.Props {}\n\nfunction MenuArrow({ className, ...rest }: MenuArrowProps) {\n return (\n <MenuPrimitive.Arrow\n data-slot=\"menu-arrow\"\n className={cn(\n \"data-[side=bottom]:top-[-9px] data-[side=left]:right-[-14px] data-[side=left]:rotate-90 data-[side=right]:left-[-14px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-9px] data-[side=top]:rotate-180\",\n className\n )}\n {...rest}\n />\n )\n}\n\nfunction ArrowSvg(props: React.ComponentProps<\"svg\">) {\n return (\n <svg width=\"20\" height=\"10\" viewBox=\"0 0 20 10\" fill=\"none\" {...props}>\n <path\n d=\"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\"\n className=\"fill-popover\"\n />\n <path\n d=\"M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z\"\n className=\"fill-border/60\"\n />\n </svg>\n )\n}\n\ninterface MenuPopupProps\n extends\n MenuPrimitive.Popup.Props,\n Pick<\n MenuPositionerProps,\n \"side\" | \"sideOffset\" | \"align\" | \"alignOffset\"\n > {\n animationPreset?: CSSAnimationPresets\n transitionPreset?: CSSTransitionPresets\n reduceMotion?: boolean\n showArrow?: boolean\n}\n\nfunction MenuPopup({\n className,\n animationPreset = \"scale\",\n transitionPreset = \"snappyOut\",\n reduceMotion = false,\n showArrow = false,\n side = \"bottom\",\n sideOffset = 4,\n align = \"center\",\n alignOffset = 0,\n children,\n ...rest\n}: MenuPopupProps) {\n const cssAnimationConfig = useMemo(() => {\n if (reduceMotion) return \"none\"\n\n if (animationPreset) {\n return cssAnimationPresets[animationPreset]\n }\n\n return cssAnimationPresets.scale\n }, [animationPreset, reduceMotion, side])\n\n const cssTransitionConfig = useMemo(() => {\n if (reduceMotion) return \"none\"\n\n if (transitionPreset) {\n return cssTransitionPresets[transitionPreset]\n }\n\n return cssTransitionPresets.snappyOut\n }, [transitionPreset, reduceMotion, side])\n\n return (\n <MenuPositioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n >\n <MenuPrimitive.Popup\n data-slot=\"menu-popup\"\n render={\n <div\n key=\"menu-popup\"\n className={cn(\n \"bg-popover text-popover-foreground border-border/60 pointer-events-auto w-[max(var(--anchor-width),226px)] origin-(--transform-origin) rounded-[12px] border p-1 shadow-xs\",\n className,\n cssTransitionConfig,\n cssAnimationConfig\n )}\n >\n {showArrow && (\n <MenuArrow>\n <ArrowSvg />\n </MenuArrow>\n )}\n {children}\n </div>\n }\n {...rest}\n />\n </MenuPositioner>\n )\n}\n\ninterface MenuGroupProps extends MenuPrimitive.Group.Props {}\n\nfunction MenuGroup(props: MenuGroupProps) {\n return <MenuPrimitive.Group data-slot=\"menu-group\" {...props} />\n}\n\ninterface MenuGroupLabelProps extends MenuPrimitive.GroupLabel.Props {}\n\nfunction MenuGroupLabel({ className, ...rest }: MenuGroupLabelProps) {\n return (\n <MenuPrimitive.GroupLabel\n data-slot=\"menu-group-label\"\n className={cn(\n \"text-muted-foreground px-2 py-1.5 text-xs font-medium\",\n className\n )}\n {...rest}\n />\n )\n}\n\nfunction MenuLabel({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"menu-label\"\n className={cn(\n \"text-muted-foreground px-2 py-1.5 text-xs font-medium\",\n className\n )}\n {...props}\n />\n )\n}\n\ninterface MenuItemProps extends MenuPrimitive.Item.Props {}\n\nfunction MenuItem({ className, ...rest }: MenuItemProps) {\n return (\n <MenuPrimitive.Item\n data-slot=\"menu-item\"\n className={cn(\n `relative flex cursor-default items-center gap-2 rounded-[10px] border-[0.5px] border-transparent px-(--item-inline-padding) py-(--item-block-padding) text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,\n `data-highlighted:before:bg-accent/70 dark:data-highlighted:before:bg-accent data-highlighted:text-accent-foreground data-highlighted:before:border-border/30 data-highlighted:z-0 data-highlighted:before:absolute data-highlighted:before:-inset-px data-highlighted:before:z-[-1] data-highlighted:before:rounded-[10px] data-highlighted:before:border`,\n className\n )}\n {...rest}\n />\n )\n}\n\nfunction MenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props) {\n return (\n <MenuPrimitive.Separator\n data-slot=\"menu-separator\"\n className={cn(\"bg-border/30 -mx-1 my-1 h-[0.5px]\", className)}\n {...props}\n />\n )\n}\n\ninterface MenuCheckboxItemProps extends MenuPrimitive.CheckboxItem.Props {}\n\nfunction MenuCheckboxItem({\n className,\n children,\n ...rest\n}: MenuCheckboxItemProps) {\n return (\n <MenuPrimitive.CheckboxItem\n data-slot=\"menu-checkbox-item\"\n className={cn(\n `text-foreground relative flex cursor-default items-center gap-2 rounded-[10px] border-[0.5px] border-transparent px-2 py-1.5 text-sm`,\n `hover:bg-accent/70 focus-visible:bg-accent/70 dark:hover:bg-accent dark:focus-visible:bg-accent hover:text-accent-foreground hover:border-border/30 outline-hidden`,\n className\n )}\n {...rest}\n >\n <span className=\"pointer-events-none absolute right-2 flex size-3.5 items-center justify-center\">\n <MenuPrimitive.CheckboxItemIndicator>\n <CheckIcon className=\"size-4\" />\n </MenuPrimitive.CheckboxItemIndicator>\n </span>\n {children}\n </MenuPrimitive.CheckboxItem>\n )\n}\n\ninterface MenuRadioGroupContextType {\n activeIcon?: React.ReactNode\n}\n\nconst MenuRadioGroupContext = createContext<MenuRadioGroupContextType>({})\n\ninterface MenuRadioGroupProps extends MenuPrimitive.RadioGroup.Props {\n activeIcon?: React.ReactNode\n}\n\nfunction MenuRadioGroup({ activeIcon, ...props }: MenuRadioGroupProps) {\n return (\n <MenuRadioGroupContext.Provider value={{ activeIcon }}>\n <MenuPrimitive.RadioGroup data-slot=\"menu-radio-group\" {...props} />\n </MenuRadioGroupContext.Provider>\n )\n}\n\nfunction MenuRadioItem({\n className,\n children,\n value,\n ...props\n}: MenuPrimitive.RadioItem.Props) {\n const { activeIcon } = useContext(MenuRadioGroupContext)\n\n return (\n <MenuPrimitive.RadioItem\n data-slot=\"menu-radio-item\"\n className={cn(\n `text-foreground relative flex cursor-default items-center gap-2 rounded-[10px] border-[0.5px] border-transparent px-2 py-1.5 text-sm`,\n `hover:bg-accent/70 focus-visible:bg-accent/70 dark:hover:bg-accent dark:focus-visible:bg-accent hover:text-accent-foreground hover:border-border/30 outline-hidden`,\n className\n )}\n value={value}\n {...props}\n >\n {children}\n <span\n className=\"pointer-events-none absolute right-2 flex size-3.5 items-center justify-center\"\n style={{\n willChange: \"transform\",\n }}\n >\n <MenuPrimitive.RadioItemIndicator>\n {activeIcon ?? (\n <CircleIcon className=\"size-2 fill-current\" />\n )}\n </MenuPrimitive.RadioItemIndicator>\n </span>\n </MenuPrimitive.RadioItem>\n )\n}\n\nfunction MenuShortcut({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"menu-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className\n )}\n {...props}\n />\n )\n}\n\ninterface MenuSubProps extends MenuPrimitive.SubmenuRoot.Props {}\n\nfunction MenuSub(props: MenuSubProps) {\n return <MenuPrimitive.SubmenuRoot data-slot=\"menu-submenu\" {...props} />\n}\n\ninterface MenuSubTriggerProps extends MenuPrimitive.SubmenuTrigger.Props {}\n\nfunction MenuSubTrigger({ className, children, ...rest }: MenuSubTriggerProps) {\n return (\n <MenuPrimitive.SubmenuTrigger\n data-slot=\"menu-submenu-trigger\"\n className={cn(\n `text-foreground relative flex cursor-default items-center gap-2 rounded-[10px] border-[0.5px] border-transparent px-(--item-inline-padding) py-(--item-block-padding) text-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,\n `hover:bg-accent/70 focus-visible:bg-accent/70 dark:hover:bg-accent dark:focus-visible:bg-accent hover:text-accent-foreground hover:border-border/30 data-popup-open:bg-accent/70 data-popup-open:text-accent-foreground data-popup-open:border-border/30 outline-hidden`,\n className\n )}\n {...rest}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </MenuPrimitive.SubmenuTrigger>\n )\n}\n\ninterface MenuSubmenuPortalProps extends MenuPrimitive.Portal.Props {}\n\nfunction MenuSubmenuPortal(props: MenuSubmenuPortalProps) {\n return <MenuPrimitive.Portal data-slot=\"menu-submenu-portal\" {...props} />\n}\n\ninterface MenuSubPositionerProps extends MenuPrimitive.Positioner.Props {}\n\nfunction MenuSubPositioner({\n sideOffset = 4,\n side = \"right\",\n className,\n ...rest\n}: MenuSubPositionerProps) {\n return (\n <MenuSubmenuPortal>\n <MenuPrimitive.Positioner\n sideOffset={sideOffset}\n side={side}\n data-slot=\"menu-sub-positioner \"\n className={cn(\n \"-top-[calc(var(--item-block-padding)-1.8px)]! z-100 [--item-block-padding:6px] [--item-inline-padding:8px]\",\n (side === \"inline-end\" || side === \"inline-start\") &&\n \"**:data-[slot=menu-arrow]:hidden\",\n className\n )}\n {...rest}\n />\n </MenuSubmenuPortal>\n )\n}\n\ninterface MenuSubPopupProps\n extends\n MenuPrimitive.Popup.Props,\n Pick<\n MenuPositionerProps,\n \"side\" | \"sideOffset\" | \"align\" | \"alignOffset\"\n > {}\n\nfunction MenuSubPopup({\n className,\n children,\n side = \"right\",\n sideOffset = 4,\n align = \"start\",\n alignOffset = 0,\n ...rest\n}: MenuSubPopupProps) {\n return (\n <MenuSubPositioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n >\n <MenuPrimitive.Popup\n data-slot=\"menu-sub-content\"\n render={\n <div\n key=\"menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground border-border/60 pointer-events-auto min-w-[max(8rem,calc(var(--anchor-width)-1rem))]! origin-(--transform-origin) rounded-[12px] border p-1 shadow-sm\",\n cssAnimationPresets.scale,\n cssTransitionPresets.snappyOut,\n className\n )}\n >\n {children}\n </div>\n }\n {...rest}\n />\n </MenuSubPositioner>\n )\n}\n\nexport {\n Menu,\n MenuTrigger,\n MenuPopup,\n MenuGroup,\n MenuGroupLabel,\n MenuItem,\n MenuSeparator,\n MenuCheckboxItem,\n MenuRadioGroup,\n MenuRadioItem,\n MenuSub,\n MenuSubTrigger,\n MenuSubPopup,\n MenuShortcut,\n MenuLabel,\n}\n","\"use client\"\n\nimport React from \"react\"\nimport { HexColorPicker } from \"react-colorful\"\nimport { Menu as MenuBaseUI, MenuTrigger, MenuPopup } from \"../ui/menu\"\nimport { Input } from \"../ui/input\"\nimport { ChevronDownIcon } from \"lucide-react\"\n\nimport { cn } from \"../../lib/utils\"\n\nexport type ColorPickerProps = {\n value?: string\n onChange: (value: string) => void\n}\n\nconst PREDEFINED_COLORS = [\n { name: \"Blue\", value: \"#3B82F6\" },\n { name: \"Purple\", value: \"#8B5CF6\" },\n { name: \"Pink\", value: \"#EC4899\" },\n { name: \"Rose\", value: \"#F43F5E\" },\n { name: \"Red\", value: \"#EF4444\" },\n { name: \"Orange\", value: \"#F97316\" },\n { name: \"Amber\", value: \"#F59E0B\" },\n { name: \"Green\", value: \"#10B981\" },\n]\n\nconst GRAY_COLORS = [\n { name: \"Black\", value: \"#000000\" },\n { name: \"Gray 900\", value: \"#18181B\" },\n { name: \"Gray 600\", value: \"#52525B\" },\n { name: \"Gray 300\", value: \"#D4D4D8\" },\n { name: \"Gray 200\", value: \"#E4E4E7\" },\n { name: \"Gray 100\", value: \"#F4F4F5\" },\n { name: \"White\", value: \"#FFFFFF\" },\n]\n\nexport const ColorPicker: React.FC<ColorPickerProps> = ({\n value,\n onChange,\n}) => {\n const handleColorSelect = (color: string) => {\n onChange(color)\n }\n\n const handleClearColor = () => {\n onChange(\"\")\n }\n\n return (\n <MenuBaseUI>\n <MenuTrigger\n className={cn(\n \"border-input text-foreground focus-visible:border-primary hover:bg-accent w-full justify-between gap-2 rounded-md border bg-white px-3 py-2 text-sm transition-colors\",\n \"flex items-center\"\n )}\n >\n {value ? (\n <>\n <div\n className=\"border-border size-5 rounded-md border\"\n style={{ backgroundColor: value }}\n />\n <span className=\"flex-1 text-left\">{value}</span>\n </>\n ) : (\n <div className=\"flex items-center justify-start gap-2\">\n <div className=\"border-border after:bg-destructive relative size-5 rounded-md border bg-white after:absolute after:inset-0 after:top-1/2 after:left-1/2 after:z-1 after:flex after:h-0.5 after:w-7 after:-translate-x-1/2 after:-translate-y-1/2 after:-rotate-45 after:rounded-full after:content-['']\"></div>\n <span>No color</span>\n </div>\n )}\n <ChevronDownIcon className=\"size-4\" />\n </MenuTrigger>\n <MenuPopup align=\"start\" side=\"bottom\">\n <div className=\"flex flex-col gap-3 p-2\">\n <div className=\"flex flex-col gap-3\">\n <button\n type=\"button\"\n onClick={handleClearColor}\n className=\"border-border after:bg-destructive relative size-5 cursor-pointer rounded-md border bg-white after:absolute after:inset-0 after:top-1/2 after:left-1/2 after:z-1 after:flex after:h-0.5 after:w-7 after:-translate-x-1/2 after:-translate-y-1/2 after:-rotate-45 after:rounded-full after:content-['']\"\n title=\"Clear color\"\n aria-label=\"Clear color\"\n ></button>\n <div className=\"flex flex-wrap gap-1\">\n {PREDEFINED_COLORS.map((color) => (\n <button\n key={color.value}\n type=\"button\"\n className={cn(\n \"border-primary/20 size-5 cursor-pointer rounded-md border transition-all hover:scale-105\"\n )}\n style={{ backgroundColor: color.value }}\n onClick={() =>\n handleColorSelect(color.value)\n }\n title={color.name}\n aria-label={color.name}\n />\n ))}\n {GRAY_COLORS.map((color) => (\n <button\n key={color.value}\n type=\"button\"\n className={cn(\n \"border-primary/20 size-5 cursor-pointer rounded-md border transition-all hover:scale-105\"\n )}\n style={{ backgroundColor: color.value }}\n onClick={() =>\n handleColorSelect(color.value)\n }\n title={color.name}\n aria-label={color.name}\n />\n ))}\n </div>\n </div>\n\n <div className=\"flex flex-col gap-1.5\">\n <div className=\"text-xs font-medium\">Custom Color</div>\n <div className=\"flex flex-col gap-2\">\n <HexColorPicker\n color={value || \"#000000\"}\n onChange={handleColorSelect}\n className=\"!w-full\"\n />\n <Input\n type=\"text\"\n value={value || \"\"}\n onChange={(e) =>\n handleColorSelect(e.target.value)\n }\n placeholder=\"Select a color\"\n />\n </div>\n </div>\n </div>\n </MenuPopup>\n </MenuBaseUI>\n )\n}\n\nexport default ColorPicker\n","import { Fields } from \"@puckeditor/core\"\nimport ColorPicker from \"../components/ColorPicker\"\nimport Label from \"../components/Fields/Label\"\n\nexport type TextColorTraitProps = {\n textColor?: string\n}\n\nexport const textColorField: Fields = {\n textColor: {\n type: \"custom\",\n label: \"Text color\",\n render: ({ value, onChange, field }) => (\n <>\n <Label label={field.label} />\n <ColorPicker value={value} onChange={onChange} />\n </>\n ),\n },\n}\n\nexport function textColorToClasses(textColor?: string): string {\n if (!textColor) return \"\"\n return `text-[${textColor}]`\n}\n\nexport const textColorDefaultProps = {\n textColor: undefined as string | undefined,\n}\n","import React from \"react\"\nimport { Fields } from \"@puckeditor/core\"\nimport {\n BoldIcon,\n ItalicIcon,\n UnderlineIcon,\n StrikethroughIcon,\n LightbulbIcon,\n} from \"lucide-react\"\n\nexport type TextDecorationTraitProps = {\n textDecoration?: Array<\n \"bold\" | \"light\" | \"italic\" | \"underline\" | \"line-through\"\n >\n}\n\nexport const textDecorationField: Fields = {\n textDecoration: {\n type: \"checkbox\",\n label: \"Text decoration\",\n layout: \"horizontal\",\n options: [\n { label: <BoldIcon size={16} />, value: \"bold\" },\n { label: <LightbulbIcon size={16} />, value: \"light\" },\n { label: <ItalicIcon size={16} />, value: \"italic\" },\n { label: <UnderlineIcon size={16} />, value: \"underline\" },\n { label: <StrikethroughIcon size={16} />, value: \"line-through\" },\n ],\n },\n}\n\nexport function textDecorationToClasses(\n textDecoration?: Array<\n \"bold\" | \"light\" | \"italic\" | \"underline\" | \"line-through\"\n >\n): string {\n if (!textDecoration || textDecoration.length === 0) {\n return \"\"\n }\n\n const classes: string[] = []\n\n if (textDecoration.includes(\"bold\")) {\n classes.push(\"font-bold\")\n }\n if (textDecoration.includes(\"light\")) {\n classes.push(\"font-light\")\n }\n if (textDecoration.includes(\"italic\")) {\n classes.push(\"italic\")\n }\n if (textDecoration.includes(\"underline\")) {\n classes.push(\"underline\")\n }\n if (textDecoration.includes(\"line-through\")) {\n classes.push(\"line-through\")\n }\n\n return classes.join(\" \")\n}\n\nexport const textDecorationDefaultProps: TextDecorationTraitProps = {\n textDecoration: [],\n}\n","import React from \"react\"\nimport { Fields } from \"@puckeditor/core\"\nimport { MinusIcon } from \"lucide-react\"\n\nexport type TextSizeTraitProps = {\n textSize?:\n | \"\"\n | \"xs\"\n | \"sm\"\n | \"base\"\n | \"lg\"\n | \"xl\"\n | \"2xl\"\n | \"3xl\"\n | \"4xl\"\n | \"5xl\"\n | \"6xl\"\n | \"7xl\"\n | \"8xl\"\n | \"9xl\"\n}\n\nexport const textSizeField: Fields = {\n textSize: {\n type: \"select\",\n placeholder: <MinusIcon size={16} />,\n label: \"Text size\",\n\n options: [\n { label: <MinusIcon size={16} />, value: \"\" },\n { label: \"XS (12px)\", value: \"xs\" },\n { label: \"SM (14px)\", value: \"sm\" },\n { label: \"Base (16px)\", value: \"base\" },\n { label: \"LG (18px)\", value: \"lg\" },\n { label: \"XL (20px)\", value: \"xl\" },\n { label: \"2XL (24px)\", value: \"2xl\" },\n { label: \"3XL (30px)\", value: \"3xl\" },\n { label: \"4XL (36px)\", value: \"4xl\" },\n { label: \"5XL (48px)\", value: \"5xl\" },\n { label: \"6XL (60px)\", value: \"6xl\" },\n { label: \"7XL (72px)\", value: \"7xl\" },\n { label: \"8XL (96px)\", value: \"8xl\" },\n { label: \"9XL (128px)\", value: \"9xl\" },\n ],\n },\n}\n\nexport function textSizeToClasses(textSize?: string): string {\n if (!textSize) return \"\"\n return `text-${textSize}`\n}\n\nexport const textSizeDefaultProps = {\n textSize: \"\" as const,\n}\n","import React from \"react\"\nimport { Fields } from \"@puckeditor/core\"\nimport {\n CaseUpperIcon,\n CaseLowerIcon,\n CaseSensitiveIcon,\n MinusIcon,\n} from \"lucide-react\"\n\nexport type TextTransformTraitProps = {\n textTransform?: \"none\" | \"uppercase\" | \"lowercase\" | \"capitalize\"\n}\n\nexport const textTransformField: Fields = {\n textTransform: {\n type: \"radio\",\n label: \"Text transform\",\n options: [\n { label: <MinusIcon size={16} />, value: \"none\" },\n { label: <CaseUpperIcon size={16} />, value: \"uppercase\" },\n { label: <CaseLowerIcon size={16} />, value: \"lowercase\" },\n { label: <CaseSensitiveIcon size={16} />, value: \"capitalize\" },\n ],\n },\n}\n\nexport function textTransformToClasses(textTransform?: string): string {\n if (!textTransform || textTransform === \"none\") return \"\"\n return textTransform\n}\n\nexport const textTransformDefaultProps = {\n textTransform: \"none\" as const,\n}\n","export * from \"./textAlign\"\nexport * from \"./textTransform\"\nexport * from \"./textDecoration\"\nexport * from \"./textSize\"\nexport * from \"./textColor\"\nexport * from \"./lineHeight\"\nexport * from \"./fontWeight\"\n\nimport {\n TextAlignTraitProps,\n textAlignField,\n textAlignDefaultProps,\n textAlignToClasses,\n} from \"./textAlign\"\nimport {\n TextTransformTraitProps,\n textTransformField,\n textTransformDefaultProps,\n textTransformToClasses,\n} from \"./textTransform\"\nimport {\n TextDecorationTraitProps,\n textDecorationField,\n textDecorationDefaultProps,\n textDecorationToClasses,\n} from \"./textDecoration\"\nimport {\n TextSizeTraitProps,\n textSizeField,\n textSizeDefaultProps,\n textSizeToClasses,\n} from \"./textSize\"\nimport {\n TextColorTraitProps,\n textColorField,\n textColorDefaultProps,\n textColorToClasses,\n} from \"./textColor\"\nimport {\n LineHeightTraitProps,\n lineHeightField,\n lineHeightDefaultProps,\n lineHeightToClasses,\n} from \"./lineHeight\"\nimport {\n FontWeightTraitProps,\n fontWeightField,\n fontWeightDefaultProps,\n fontWeightToClasses,\n} from \"./fontWeight\"\n\nexport type TypographyTraitProps = TextAlignTraitProps &\n TextTransformTraitProps &\n TextDecorationTraitProps &\n TextSizeTraitProps &\n TextColorTraitProps &\n LineHeightTraitProps &\n FontWeightTraitProps\n\nexport const typographyFields = {\n ...textAlignField,\n ...textTransformField,\n ...textDecorationField,\n ...textSizeField,\n ...textColorField,\n ...lineHeightField,\n ...fontWeightField,\n}\n\nexport const typographyDefaultProps = {\n ...textAlignDefaultProps,\n ...textTransformDefaultProps,\n ...textDecorationDefaultProps,\n ...textSizeDefaultProps,\n ...textColorDefaultProps,\n ...lineHeightDefaultProps,\n ...fontWeightDefaultProps,\n}\n\nexport function typographyToClasses(\n props: Partial<TypographyTraitProps>\n): string {\n const classes = [\n textAlignToClasses(props.textAlign),\n textTransformToClasses(props.textTransform),\n textDecorationToClasses(props.textDecoration),\n textSizeToClasses(props.textSize),\n textColorToClasses(props.textColor),\n lineHeightToClasses(props.lineHeight),\n fontWeightToClasses(props.fontWeight),\n ].filter(Boolean)\n\n return classes.join(\" \")\n}\n\nexport const typographyFieldNames = [\n \"textAlign\",\n \"textTransform\",\n \"textDecoration\",\n \"textSize\",\n \"textColor\",\n \"lineHeight\",\n \"fontWeight\",\n] as const\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAGA,SAAgB,GAAG,GAAG,QAAsB;AACxC,QAAO,QAAQ,KAAK,OAAO,CAAC;;;;;ACChC,SAASA,QAAM,EACX,WACA,UACA,UACA,GAAG,SACoD;AACvD,QACI,qBAAC;EACG,aAAU;EACV,iBAAe,WAAW,KAAK;EAC/B,WAAW,GACP,4PACA,UACH;EACD,GAAI;aAEH,UACA,YAAY,oBAAC,YAAS,WAAU,WAAW;GACxC;;;;;ACrBhB,MAAMC,WAAS,EAAE,OAAO,eACpB,oBAACC;CACa;WAET;EACS;AAGlB,oBAAeD;;;;ACGf,SAASE,WAAS,EACd,WACA,SAAS,cACT,GAAG,SACW;AAGd,KAFqB,WAAW,aAG5B,QACI,oBAACC,SAAkB;EACf,aAAU;EACV,WAAW,GACP,2fACA,UACH;EACD,GAAI;GACN;AAIV,QACI,oBAACA,SAAkB;EACf,aAAU;EACV,WAAW,GACP,2eACA,UACH;EACD,GAAI;YAEJ,oBAACA,SAAkB;GACf,aAAU;GACV,WAAU;aAEV,oBAAC;IAAU,WAAU;IAAS,aAAa;KAAK;IACtB;GACT;;;;;ACnCjC,MAAMC,cAAY,EACd,UACA,OACA,UACA,OACA,YACqC;AACrC,KAAI,CAAC,MAAM,WAAW,CAAC,MAAM,QAAQ,MAAM,QAAQ,CAC/C,QAAO;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