@uselets/ui 1.1.0 → 1.2.1

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.
Files changed (84) hide show
  1. package/README.md +15 -6
  2. package/dist/components/badge.d.ts +1 -1
  3. package/dist/components/button-group.d.ts +1 -1
  4. package/dist/components/button.d.ts +1 -1
  5. package/dist/components/center.d.ts +1 -1
  6. package/dist/components/checkbox.js +1 -1
  7. package/dist/components/checkbox.js.map +1 -1
  8. package/dist/components/combobox.d.ts +4 -1
  9. package/dist/components/combobox.js +1 -1
  10. package/dist/components/combobox.js.map +1 -1
  11. package/dist/components/command.d.ts +1 -0
  12. package/dist/components/command.js +1 -1
  13. package/dist/components/command.js.map +1 -1
  14. package/dist/components/dialog.d.ts +6 -12
  15. package/dist/components/dialog.js +1 -1
  16. package/dist/components/dialog.js.map +1 -1
  17. package/dist/components/drawer.d.ts +4 -1
  18. package/dist/components/drawer.js +1 -1
  19. package/dist/components/drawer.js.map +1 -1
  20. package/dist/components/dropdown-menu.js +1 -1
  21. package/dist/components/dropdown-menu.js.map +1 -1
  22. package/dist/components/field.d.ts +4 -2
  23. package/dist/components/field.js +1 -1
  24. package/dist/components/field.js.map +1 -1
  25. package/dist/components/field.spec.d.ts +1 -0
  26. package/dist/components/field.spec.js +2 -0
  27. package/dist/components/field.spec.js.map +1 -0
  28. package/dist/components/input-otp.d.ts +1 -0
  29. package/dist/components/input-otp.js +1 -1
  30. package/dist/components/input-otp.js.map +1 -1
  31. package/dist/components/input.d.ts +1 -0
  32. package/dist/components/input.js +1 -1
  33. package/dist/components/input.js.map +1 -1
  34. package/dist/components/native-select.d.ts +1 -0
  35. package/dist/components/native-select.js +1 -1
  36. package/dist/components/native-select.js.map +1 -1
  37. package/dist/components/radio-group.js +1 -1
  38. package/dist/components/radio-group.js.map +1 -1
  39. package/dist/components/select.d.ts +1 -0
  40. package/dist/components/select.js +1 -1
  41. package/dist/components/select.js.map +1 -1
  42. package/dist/components/sidebar.js +1 -1
  43. package/dist/components/sidebar.js.map +1 -1
  44. package/dist/components/skeleton.d.ts +5 -1
  45. package/dist/components/skeleton.js +1 -1
  46. package/dist/components/skeleton.js.map +1 -1
  47. package/dist/components/skeleton.spec.d.ts +1 -0
  48. package/dist/components/skeleton.spec.js +2 -0
  49. package/dist/components/skeleton.spec.js.map +1 -0
  50. package/dist/components/slider.d.ts +1 -0
  51. package/dist/components/slider.js +1 -1
  52. package/dist/components/slider.js.map +1 -1
  53. package/dist/components/switch.js +1 -1
  54. package/dist/components/switch.js.map +1 -1
  55. package/dist/components/textarea.d.ts +1 -0
  56. package/dist/components/textarea.js +1 -1
  57. package/dist/components/textarea.js.map +1 -1
  58. package/dist/components/timeline.d.ts +2 -2
  59. package/dist/components/tooltip.d.ts +20 -4
  60. package/dist/components/tooltip.js +1 -1
  61. package/dist/components/tooltip.js.map +1 -1
  62. package/dist/components/unstyled-button.d.ts +17 -0
  63. package/dist/components/unstyled-button.js +2 -0
  64. package/dist/components/unstyled-button.js.map +1 -0
  65. package/dist/hooks/use-breakpoint-value.spec.js +1 -1
  66. package/dist/hooks/use-breakpoint.spec.js +1 -1
  67. package/dist/hooks/use-disclosure.spec.js +1 -1
  68. package/dist/hooks/use-document-visibility.spec.js +1 -1
  69. package/dist/hooks/use-idle.spec.js +1 -1
  70. package/dist/hooks/use-interval.spec.js +1 -1
  71. package/dist/hooks/use-local-storage.spec.js +1 -1
  72. package/dist/hooks/use-mobile.spec.js +1 -1
  73. package/dist/index.d.ts +4 -3
  74. package/dist/index.js +1 -1
  75. package/dist/{react.esm-BuxkFT_p.js → react.esm-B3a5z6DL.js} +2 -2
  76. package/dist/{react.esm-BuxkFT_p.js.map → react.esm-B3a5z6DL.js.map} +1 -1
  77. package/dist/skills/uselets-ui/SKILL.md +4 -2
  78. package/dist/skills/uselets-ui/references/component-catalog.md +11 -4
  79. package/dist/skills/uselets-ui/references/package-guide.md +20 -2
  80. package/dist/styles/base.css +1 -1
  81. package/package.json +1 -1
  82. package/skills/uselets-ui/SKILL.md +4 -2
  83. package/skills/uselets-ui/references/component-catalog.md +11 -4
  84. package/skills/uselets-ui/references/package-guide.md +20 -2
@@ -1,2 +1,2 @@
1
- import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{IconCheck as t,IconChevronRight as n}from"@tabler/icons-react";import{DropdownMenu as r}from"radix-ui";import{jsx as i,jsxs as a}from"react/jsx-runtime";function DropdownMenu({...e}){return i(r.Root,{"data-slot":`dropdown-menu`,...e})}function DropdownMenuPortal({...e}){return i(r.Portal,{"data-slot":`dropdown-menu-portal`,...e})}function DropdownMenuTrigger({...e}){return i(r.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function DropdownMenuContent({className:t,align:n=`start`,sideOffset:a=4,...o}){return i(DropdownMenuPortal,{children:i(r.Content,{"data-slot":`dropdown-menu-content`,align:n,sideOffset:a,className:e(`relative z-50 w-(--radix-dropdown-menu-trigger-width) min-w-32 max-h-(--radix-dropdown-menu-content-available-height)`,`origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-1`,`bg-popover/70 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100`,`data-[state=closed]:overflow-hidden`,`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95`,`data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,`before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit]`,`before:backdrop-blur-2xl before:backdrop-saturate-150`,`**:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10`,`**:data-[slot$=-separator]:bg-foreground/5`,`**:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10!`,`**:data-[variant=destructive]:focus:bg-foreground/10!`,`**:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!`,`animate-none!`,t),...o})})}function DropdownMenuGroup({...e}){return i(r.Group,{"data-slot":`dropdown-menu-group`,...e})}function DropdownMenuItem({className:t,inset:n,variant:a=`default`,...o}){return i(r.Item,{"data-slot":`dropdown-menu-item`,"data-inset":n,"data-variant":a,className:e(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm`,`select-none outline-hidden`,`focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground`,`data-inset:pl-7`,`data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive`,`dark:data-[variant=destructive]:focus:bg-destructive/20`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`data-[variant=destructive]:*:[svg]:text-destructive`,t),...o})}function DropdownMenuCheckboxItem({className:n,children:o,inset:s,...c}){return a(r.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":s,className:e(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm`,`select-none outline-hidden`,`focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground`,`data-inset:pl-7`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,n),...c,children:[i(`span`,{"data-slot":`dropdown-menu-checkbox-item-indicator`,className:`pointer-events-none absolute right-2 flex items-center justify-center`,children:i(r.ItemIndicator,{children:i(t,{})})}),o]})}function DropdownMenuRadioGroup({...e}){return i(r.RadioGroup,{"data-slot":`dropdown-menu-radio-group`,...e})}function DropdownMenuRadioItem({className:n,children:o,inset:s,...c}){return a(r.RadioItem,{"data-slot":`dropdown-menu-radio-item`,"data-inset":s,className:e(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm`,`select-none outline-hidden`,`focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground`,`data-inset:pl-7`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,n),...c,children:[i(`span`,{"data-slot":`dropdown-menu-radio-item-indicator`,className:`pointer-events-none absolute right-2 flex items-center justify-center`,children:i(r.ItemIndicator,{children:i(t,{})})}),o]})}function DropdownMenuLabel({className:t,inset:n,...a}){return i(r.Label,{"data-slot":`dropdown-menu-label`,"data-inset":n,className:e(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,t),...a})}function DropdownMenuSeparator({className:t,...n}){return i(r.Separator,{"data-slot":`dropdown-menu-separator`,className:e(`bg-border -mx-1 my-1 h-px`,t),...n})}function DropdownMenuShortcut({className:t,...n}){return i(`span`,{"data-slot":`dropdown-menu-shortcut`,className:e(`ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground`,t),...n})}function DropdownMenuSub({...e}){return i(r.Sub,{"data-slot":`dropdown-menu-sub`,...e})}function DropdownMenuSubTrigger({className:t,inset:o,children:s,...c}){return a(r.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":o,className:e(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm`,`select-none outline-hidden`,`focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground`,`data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,t),...c,children:[s,i(n,{className:`ml-auto`})]})}function DropdownMenuSubContent({className:t,...n}){return i(r.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:e(`relative z-50 min-w-24 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg p-1`,`bg-popover/70 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100`,`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95`,`data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,`before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit]`,`before:backdrop-blur-2xl before:backdrop-saturate-150`,`**:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10`,`**:data-[slot$=-separator]:bg-foreground/5`,`**:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10!`,`**:data-[variant=destructive]:focus:bg-foreground/10!`,`**:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!`,`animate-none!`,t),...n})}export{DropdownMenu,DropdownMenuCheckboxItem,DropdownMenuContent,DropdownMenuGroup,DropdownMenuItem,DropdownMenuLabel,DropdownMenuPortal,DropdownMenuRadioGroup,DropdownMenuRadioItem,DropdownMenuSeparator,DropdownMenuShortcut,DropdownMenuSub,DropdownMenuSubContent,DropdownMenuSubTrigger,DropdownMenuTrigger};
1
+ import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{IconCheck as t,IconChevronRight as n}from"@tabler/icons-react";import{DropdownMenu as r}from"radix-ui";import{jsx as i,jsxs as a}from"react/jsx-runtime";function DropdownMenu({...e}){return i(r.Root,{"data-slot":`dropdown-menu`,...e})}function DropdownMenuPortal({...e}){return i(r.Portal,{"data-slot":`dropdown-menu-portal`,...e})}function DropdownMenuTrigger({...e}){return i(r.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function DropdownMenuContent({className:t,align:n=`start`,sideOffset:a=4,...o}){return i(DropdownMenuPortal,{children:i(r.Content,{"data-slot":`dropdown-menu-content`,align:n,sideOffset:a,className:e(`relative z-50 w-(--radix-dropdown-menu-trigger-width) min-w-32 max-h-(--radix-dropdown-menu-content-available-height)`,`origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-1`,`bg-popover/70 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100`,`data-[state=closed]:overflow-hidden`,`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95`,`data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,`before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit]`,`before:backdrop-blur-2xl before:backdrop-saturate-150`,`**:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10`,`**:data-[slot$=-separator]:bg-foreground/5`,`**:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10!`,`**:data-[variant=destructive]:focus:bg-destructive/10! dark:**:data-[variant=destructive]:focus:bg-destructive/20!`,`**:data-[variant=destructive]:text-destructive! **:data-[variant=destructive]:**:text-destructive!`,`animate-none!`,t),...o})})}function DropdownMenuGroup({...e}){return i(r.Group,{"data-slot":`dropdown-menu-group`,...e})}function DropdownMenuItem({className:t,inset:n,variant:a=`default`,...o}){return i(r.Item,{"data-slot":`dropdown-menu-item`,"data-inset":n,"data-variant":a,className:e(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm`,`select-none outline-hidden`,`focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground`,`data-inset:pl-7`,`data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive`,`dark:data-[variant=destructive]:focus:bg-destructive/20`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`data-[variant=destructive]:*:[svg]:text-destructive`,t),...o})}function DropdownMenuCheckboxItem({className:n,children:o,inset:s,...c}){return a(r.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":s,className:e(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm`,`select-none outline-hidden`,`focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground`,`data-inset:pl-7`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,n),...c,children:[i(`span`,{"data-slot":`dropdown-menu-checkbox-item-indicator`,className:`pointer-events-none absolute right-2 flex items-center justify-center`,children:i(r.ItemIndicator,{children:i(t,{})})}),o]})}function DropdownMenuRadioGroup({...e}){return i(r.RadioGroup,{"data-slot":`dropdown-menu-radio-group`,...e})}function DropdownMenuRadioItem({className:n,children:o,inset:s,...c}){return a(r.RadioItem,{"data-slot":`dropdown-menu-radio-item`,"data-inset":s,className:e(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm`,`select-none outline-hidden`,`focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground`,`data-inset:pl-7`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,n),...c,children:[i(`span`,{"data-slot":`dropdown-menu-radio-item-indicator`,className:`pointer-events-none absolute right-2 flex items-center justify-center`,children:i(r.ItemIndicator,{children:i(t,{})})}),o]})}function DropdownMenuLabel({className:t,inset:n,...a}){return i(r.Label,{"data-slot":`dropdown-menu-label`,"data-inset":n,className:e(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,t),...a})}function DropdownMenuSeparator({className:t,...n}){return i(r.Separator,{"data-slot":`dropdown-menu-separator`,className:e(`bg-border -mx-1 my-1 h-px`,t),...n})}function DropdownMenuShortcut({className:t,...n}){return i(`span`,{"data-slot":`dropdown-menu-shortcut`,className:e(`ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground`,t),...n})}function DropdownMenuSub({...e}){return i(r.Sub,{"data-slot":`dropdown-menu-sub`,...e})}function DropdownMenuSubTrigger({className:t,inset:o,children:s,...c}){return a(r.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":o,className:e(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm`,`select-none outline-hidden`,`focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground`,`data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,t),...c,children:[s,i(n,{className:`ml-auto`})]})}function DropdownMenuSubContent({className:t,...n}){return i(r.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:e(`relative z-50 min-w-24 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg p-1`,`bg-popover/70 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100`,`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95`,`data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,`before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit]`,`before:backdrop-blur-2xl before:backdrop-saturate-150`,`**:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10`,`**:data-[slot$=-separator]:bg-foreground/5`,`**:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10!`,`**:data-[variant=destructive]:focus:bg-destructive/10! dark:**:data-[variant=destructive]:focus:bg-destructive/20!`,`**:data-[variant=destructive]:text-destructive! **:data-[variant=destructive]:**:text-destructive!`,`animate-none!`,t),...n})}export{DropdownMenu,DropdownMenuCheckboxItem,DropdownMenuContent,DropdownMenuGroup,DropdownMenuItem,DropdownMenuLabel,DropdownMenuPortal,DropdownMenuRadioGroup,DropdownMenuRadioItem,DropdownMenuSeparator,DropdownMenuShortcut,DropdownMenuSub,DropdownMenuSubContent,DropdownMenuSubTrigger,DropdownMenuTrigger};
2
2
  //# sourceMappingURL=dropdown-menu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.js","names":["DropdownMenuPrimitive"],"sources":["../../src/components/dropdown-menu.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { IconCheck, IconChevronRight } from '@tabler/icons-react'\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nexport type DropdownMenuProps = React.ComponentProps<typeof DropdownMenuPrimitive.Root>\n\nexport type DropdownMenuPortalProps = React.ComponentProps<typeof DropdownMenuPrimitive.Portal>\n\nexport type DropdownMenuTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>\n\nexport type DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.Content>\n\nexport type DropdownMenuGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.Group>\n\nexport type DropdownMenuItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n variant?: 'default' | 'destructive'\n}\n\nexport type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {\n inset?: boolean\n}\n\nexport type DropdownMenuRadioGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>\n\nexport type DropdownMenuRadioItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {\n inset?: boolean\n}\n\nexport type DropdownMenuLabelProps = React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n}\n\nexport type DropdownMenuSeparatorProps = React.ComponentProps<typeof DropdownMenuPrimitive.Separator>\n\nexport type DropdownMenuShortcutProps = React.ComponentProps<'span'>\n\nexport type DropdownMenuSubProps = React.ComponentProps<typeof DropdownMenuPrimitive.Sub>\n\nexport type DropdownMenuSubTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n}\n\nexport type DropdownMenuSubContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>\n\nfunction DropdownMenu({ ...props }: DropdownMenuProps) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />\n}\n\nfunction DropdownMenuPortal({ ...props }: DropdownMenuPortalProps) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />\n}\n\nfunction DropdownMenuTrigger({ ...props }: DropdownMenuTriggerProps) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />\n}\n\nfunction DropdownMenuContent({ className, align = 'start', sideOffset = 4, ...props }: DropdownMenuContentProps) {\n return (\n <DropdownMenuPortal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'relative z-50 w-(--radix-dropdown-menu-trigger-width) min-w-32 max-h-(--radix-dropdown-menu-content-available-height)',\n 'origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-1',\n 'bg-popover/70 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100',\n 'data-[state=closed]:overflow-hidden',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n 'before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit]',\n 'before:backdrop-blur-2xl before:backdrop-saturate-150',\n '**:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10',\n '**:data-[slot$=-separator]:bg-foreground/5',\n '**:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10!',\n '**:data-[variant=destructive]:focus:bg-foreground/10!',\n '**:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!',\n 'animate-none!',\n className\n )}\n {...props}\n />\n </DropdownMenuPortal>\n )\n}\n\nfunction DropdownMenuGroup({ ...props }: DropdownMenuGroupProps) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />\n}\n\nfunction DropdownMenuItem({ className, inset, variant = 'default', ...props }: DropdownMenuItemProps) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n 'group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground',\n 'data-inset:pl-7',\n 'data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive',\n 'dark:data-[variant=destructive]:focus:bg-destructive/20',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n 'data-[variant=destructive]:*:[svg]:text-destructive',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuCheckboxItem({ className, children, inset, ...props }: DropdownMenuCheckboxItemProps) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n data-inset={inset}\n className={cn(\n 'relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground',\n 'data-inset:pl-7',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span\n data-slot=\"dropdown-menu-checkbox-item-indicator\"\n className=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n >\n <DropdownMenuPrimitive.ItemIndicator>\n <IconCheck />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n )\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: DropdownMenuRadioGroupProps) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />\n}\n\nfunction DropdownMenuRadioItem({ className, children, inset, ...props }: DropdownMenuRadioItemProps) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n data-inset={inset}\n className={cn(\n 'relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground',\n 'data-inset:pl-7',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span\n data-slot=\"dropdown-menu-radio-item-indicator\"\n className=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n >\n <DropdownMenuPrimitive.ItemIndicator>\n <IconCheck />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n )\n}\n\nfunction DropdownMenuLabel({ className, inset, ...props }: DropdownMenuLabelProps) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn('px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7', className)}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn('bg-border -mx-1 my-1 h-px', className)}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n 'ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSub({ ...props }: DropdownMenuSubProps) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />\n}\n\nfunction DropdownMenuSubTrigger({ className, inset, children, ...props }: DropdownMenuSubTriggerProps) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n 'flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground',\n 'data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <IconChevronRight className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n )\n}\n\nfunction DropdownMenuSubContent({ className, ...props }: DropdownMenuSubContentProps) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n 'relative z-50 min-w-24 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg p-1',\n 'bg-popover/70 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n 'before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit]',\n 'before:backdrop-blur-2xl before:backdrop-saturate-150',\n '**:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10',\n '**:data-[slot$=-separator]:bg-foreground/5',\n '**:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10!',\n '**:data-[variant=destructive]:focus:bg-foreground/10!',\n '**:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!',\n 'animate-none!',\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"dropdown-menu.js","names":["DropdownMenuPrimitive"],"sources":["../../src/components/dropdown-menu.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { IconCheck, IconChevronRight } from '@tabler/icons-react'\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nexport type DropdownMenuProps = React.ComponentProps<typeof DropdownMenuPrimitive.Root>\n\nexport type DropdownMenuPortalProps = React.ComponentProps<typeof DropdownMenuPrimitive.Portal>\n\nexport type DropdownMenuTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>\n\nexport type DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.Content>\n\nexport type DropdownMenuGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.Group>\n\nexport type DropdownMenuItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n variant?: 'default' | 'destructive'\n}\n\nexport type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {\n inset?: boolean\n}\n\nexport type DropdownMenuRadioGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>\n\nexport type DropdownMenuRadioItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {\n inset?: boolean\n}\n\nexport type DropdownMenuLabelProps = React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n}\n\nexport type DropdownMenuSeparatorProps = React.ComponentProps<typeof DropdownMenuPrimitive.Separator>\n\nexport type DropdownMenuShortcutProps = React.ComponentProps<'span'>\n\nexport type DropdownMenuSubProps = React.ComponentProps<typeof DropdownMenuPrimitive.Sub>\n\nexport type DropdownMenuSubTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n}\n\nexport type DropdownMenuSubContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>\n\nfunction DropdownMenu({ ...props }: DropdownMenuProps) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />\n}\n\nfunction DropdownMenuPortal({ ...props }: DropdownMenuPortalProps) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />\n}\n\nfunction DropdownMenuTrigger({ ...props }: DropdownMenuTriggerProps) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />\n}\n\nfunction DropdownMenuContent({ className, align = 'start', sideOffset = 4, ...props }: DropdownMenuContentProps) {\n return (\n <DropdownMenuPortal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'relative z-50 w-(--radix-dropdown-menu-trigger-width) min-w-32 max-h-(--radix-dropdown-menu-content-available-height)',\n 'origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-1',\n 'bg-popover/70 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100',\n 'data-[state=closed]:overflow-hidden',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n 'before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit]',\n 'before:backdrop-blur-2xl before:backdrop-saturate-150',\n '**:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10',\n '**:data-[slot$=-separator]:bg-foreground/5',\n '**:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10!',\n '**:data-[variant=destructive]:focus:bg-destructive/10! dark:**:data-[variant=destructive]:focus:bg-destructive/20!',\n '**:data-[variant=destructive]:text-destructive! **:data-[variant=destructive]:**:text-destructive!',\n 'animate-none!',\n className\n )}\n {...props}\n />\n </DropdownMenuPortal>\n )\n}\n\nfunction DropdownMenuGroup({ ...props }: DropdownMenuGroupProps) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />\n}\n\nfunction DropdownMenuItem({ className, inset, variant = 'default', ...props }: DropdownMenuItemProps) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n 'group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground',\n 'data-inset:pl-7',\n 'data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive',\n 'dark:data-[variant=destructive]:focus:bg-destructive/20',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n 'data-[variant=destructive]:*:[svg]:text-destructive',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuCheckboxItem({ className, children, inset, ...props }: DropdownMenuCheckboxItemProps) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n data-inset={inset}\n className={cn(\n 'relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground',\n 'data-inset:pl-7',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span\n data-slot=\"dropdown-menu-checkbox-item-indicator\"\n className=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n >\n <DropdownMenuPrimitive.ItemIndicator>\n <IconCheck />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n )\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: DropdownMenuRadioGroupProps) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />\n}\n\nfunction DropdownMenuRadioItem({ className, children, inset, ...props }: DropdownMenuRadioItemProps) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n data-inset={inset}\n className={cn(\n 'relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground',\n 'data-inset:pl-7',\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span\n data-slot=\"dropdown-menu-radio-item-indicator\"\n className=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n >\n <DropdownMenuPrimitive.ItemIndicator>\n <IconCheck />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n )\n}\n\nfunction DropdownMenuLabel({ className, inset, ...props }: DropdownMenuLabelProps) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn('px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7', className)}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn('bg-border -mx-1 my-1 h-px', className)}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n 'ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSub({ ...props }: DropdownMenuSubProps) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />\n}\n\nfunction DropdownMenuSubTrigger({ className, inset, children, ...props }: DropdownMenuSubTriggerProps) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n 'flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm',\n 'select-none outline-hidden',\n 'focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground',\n 'data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <IconChevronRight className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n )\n}\n\nfunction DropdownMenuSubContent({ className, ...props }: DropdownMenuSubContentProps) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n 'relative z-50 min-w-24 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg p-1',\n 'bg-popover/70 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n 'before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit]',\n 'before:backdrop-blur-2xl before:backdrop-saturate-150',\n '**:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10',\n '**:data-[slot$=-separator]:bg-foreground/5',\n '**:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10!',\n '**:data-[variant=destructive]:focus:bg-destructive/10! dark:**:data-[variant=destructive]:focus:bg-destructive/20!',\n '**:data-[variant=destructive]:text-destructive! **:data-[variant=destructive]:**:text-destructive!',\n 'animate-none!',\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger\n}\n"],"mappings":"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"}
@@ -22,6 +22,7 @@ type FieldErrorProps = React.ComponentProps<'div'> & {
22
22
  message?: string;
23
23
  } | undefined>;
24
24
  };
25
+ declare function useFieldControlId(id?: string): string | undefined;
25
26
  declare function FieldSet({
26
27
  className,
27
28
  ...props
@@ -36,7 +37,7 @@ declare function FieldGroup({
36
37
  ...props
37
38
  }: FieldGroupProps): _$react_jsx_runtime0.JSX.Element;
38
39
  declare const fieldVariants: (props?: ({
39
- orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
40
+ orientation?: "vertical" | "horizontal" | "responsive" | null | undefined;
40
41
  } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
41
42
  type FieldProps = React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>;
42
43
  declare function Field({
@@ -50,6 +51,7 @@ declare function FieldContent({
50
51
  }: FieldContentProps): _$react_jsx_runtime0.JSX.Element;
51
52
  declare function FieldLabel({
52
53
  className,
54
+ htmlFor,
53
55
  ...props
54
56
  }: FieldLabelProps): _$react_jsx_runtime0.JSX.Element;
55
57
  declare function FieldTitle({
@@ -72,5 +74,5 @@ declare function FieldError({
72
74
  ...props
73
75
  }: FieldErrorProps): _$react_jsx_runtime0.JSX.Element | null;
74
76
  //#endregion
75
- export { Field, FieldContent, FieldContentProps, FieldDescription, FieldDescriptionProps, FieldError, FieldErrorProps, FieldGroup, FieldGroupProps, FieldLabel, FieldLabelProps, FieldLegend, FieldLegendProps, FieldProps, FieldSeparator, FieldSeparatorProps, FieldSet, FieldSetProps, FieldTitle, FieldTitleProps };
77
+ export { Field, FieldContent, FieldContentProps, FieldDescription, FieldDescriptionProps, FieldError, FieldErrorProps, FieldGroup, FieldGroupProps, FieldLabel, FieldLabelProps, FieldLegend, FieldLegendProps, FieldProps, FieldSeparator, FieldSeparatorProps, FieldSet, FieldSetProps, FieldTitle, FieldTitleProps, useFieldControlId };
76
78
  //# sourceMappingURL=field.d.ts.map
@@ -1,2 +1,2 @@
1
- import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Separator as t}from"./separator.js";import{Label as n}from"./label.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{cva as a}from"class-variance-authority";import{useMemo as o}from"react";function FieldSet({className:t,...n}){return r(`fieldset`,{"data-slot":`field-set`,className:e(`flex flex-col gap-4`,`has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,t),...n})}function FieldLegend({className:t,variant:n=`legend`,...i}){return r(`legend`,{"data-slot":`field-legend`,"data-variant":n,className:e(`mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,t),...i})}function FieldGroup({className:t,...n}){return r(`div`,{"data-slot":`field-group`,className:e(`group/field-group @container/field-group flex w-full flex-col gap-5`,`data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,t),...n})}const s=a(`data-[invalid=true]:text-destructive gap-2 group/field flex w-full`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function Field({className:t,orientation:n=`vertical`,...i}){return r(`div`,{"data-slot":`field`,"data-orientation":n,className:e(s({orientation:n}),t),...i})}function FieldContent({className:t,...n}){return r(`div`,{"data-slot":`field-content`,className:e(`gap-0.5 group/field-content flex flex-1 flex-col leading-snug`,t),...n})}function FieldLabel({className:t,...i}){return r(n,{"data-slot":`field-label`,className:e(`group/field-label peer/field-label flex w-fit gap-2 leading-snug`,`has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5`,`group-data-[disabled=true]/field:opacity-50`,t),...i})}function FieldTitle({className:t,...n}){return r(`div`,{"data-slot":`field-label`,className:e(`gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug`,t),...n})}function FieldDescription({className:t,...n}){return r(`p`,{"data-slot":`field-description`,className:e(`text-muted-foreground text-left text-sm leading-normal font-normal`,`[[data-variant=legend]+&]:-mt-1.5 group-has-data-horizontal/field:text-balance last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,t),...n})}function FieldSeparator({children:n,className:a,...o}){return i(`div`,{"data-slot":`field-separator`,"data-content":!!n,className:e(`-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative`,a),...o,children:[r(t,{className:`absolute inset-0 top-1/2`}),n&&r(`span`,{className:`text-muted-foreground px-2 bg-background relative mx-auto block w-fit`,"data-slot":`field-separator-content`,children:n})]})}function FieldError({className:t,children:n,errors:i,...a}){let s=o(()=>{if(n)return n;if(!i?.length)return null;let e=[...new Map(i.map(e=>[e?.message,e])).values()];return e?.length===1?e[0]?.message:r(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:e.map(e=>e?.message&&r(`li`,{children:e.message},e.message))})},[n,i]);return s?r(`div`,{role:`alert`,"data-slot":`field-error`,className:e(`text-destructive text-sm font-normal`,t),...a,children:s}):null}export{Field,FieldContent,FieldDescription,FieldError,FieldGroup,FieldLabel,FieldLegend,FieldSeparator,FieldSet,FieldTitle};
1
+ import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Separator as t}from"./separator.js";import{Label as n}from"./label.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{cva as a}from"class-variance-authority";import{createContext as o,useContext as s,useId as c,useMemo as l}from"react";const u=o(null);function useFieldControlId(e){let t=s(u);return e??t?.controlId}function FieldSet({className:t,...n}){return r(`fieldset`,{"data-slot":`field-set`,className:e(`flex flex-col gap-4`,`has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,t),...n})}function FieldLegend({className:t,variant:n=`legend`,...i}){return r(`legend`,{"data-slot":`field-legend`,"data-variant":n,className:e(`mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,t),...i})}function FieldGroup({className:t,...n}){return r(`div`,{"data-slot":`field-group`,className:e(`group/field-group @container/field-group flex w-full flex-col gap-5`,`data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,t),...n})}const d=a(`data-[invalid=true]:text-destructive gap-1 group/field flex w-full`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function Field({className:t,orientation:n=`vertical`,...i}){let a=c(),o=l(()=>({controlId:a}),[a]);return r(u.Provider,{value:o,children:r(`div`,{"data-slot":`field`,"data-orientation":n,className:e(d({orientation:n}),t),...i})})}function FieldContent({className:t,...n}){return r(`div`,{"data-slot":`field-content`,className:e(`gap-0.5 group/field-content flex flex-1 flex-col leading-snug`,t),...n})}function FieldLabel({className:t,htmlFor:i,...a}){return r(n,{"data-slot":`field-label`,htmlFor:useFieldControlId(i),className:e(`group/field-label peer/field-label flex w-fit gap-2 leading-snug`,`has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5`,`group-data-[disabled=true]/field:opacity-50`,t),...a})}function FieldTitle({className:t,...n}){return r(`div`,{"data-slot":`field-label`,className:e(`gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug`,t),...n})}function FieldDescription({className:t,...n}){return r(`p`,{"data-slot":`field-description`,className:e(`text-muted-foreground text-left text-sm leading-normal font-normal`,`[[data-variant=legend]+&]:-mt-1.5 group-has-data-horizontal/field:text-balance last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,t),...n})}function FieldSeparator({children:n,className:a,...o}){return i(`div`,{"data-slot":`field-separator`,"data-content":!!n,className:e(`-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative`,a),...o,children:[r(t,{className:`absolute inset-0 top-1/2`}),n&&r(`span`,{className:`text-muted-foreground px-2 bg-background relative mx-auto block w-fit`,"data-slot":`field-separator-content`,children:n})]})}function FieldError({className:t,children:n,errors:i,...a}){let o=l(()=>{if(n)return n;if(!i?.length)return null;let e=[...new Map(i.map(e=>[e?.message,e])).values()];return e?.length===1?e[0]?.message:r(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:e.map(e=>e?.message&&r(`li`,{children:e.message},e.message))})},[n,i]);return o?r(`div`,{role:`alert`,"data-slot":`field-error`,className:e(`text-destructive text-sm font-normal`,t),...a,children:o}):null}export{Field,FieldContent,FieldDescription,FieldError,FieldGroup,FieldLabel,FieldLegend,FieldSeparator,FieldSet,FieldTitle,useFieldControlId};
2
2
  //# sourceMappingURL=field.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"field.js","names":[],"sources":["../../src/components/field.tsx"],"sourcesContent":["import { useMemo } from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/utils'\nimport { Label } from './label'\nimport { Separator } from './separator'\n\nexport type FieldSetProps = React.ComponentProps<'fieldset'>\n\nexport type FieldLegendProps = React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }\n\nexport type FieldGroupProps = React.ComponentProps<'div'>\n\nexport type FieldContentProps = React.ComponentProps<'div'>\n\nexport type FieldLabelProps = React.ComponentProps<typeof Label>\n\nexport type FieldTitleProps = React.ComponentProps<'div'>\n\nexport type FieldDescriptionProps = React.ComponentProps<'p'>\n\nexport type FieldSeparatorProps = React.ComponentProps<'div'> & {\n children?: React.ReactNode\n}\n\nexport type FieldErrorProps = React.ComponentProps<'div'> & {\n errors?: Array<{ message?: string } | undefined>\n}\n\nfunction FieldSet({ className, ...props }: FieldSetProps) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n 'flex flex-col gap-4',\n 'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldLegend({ className, variant = 'legend', ...props }: FieldLegendProps) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn('mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base', className)}\n {...props}\n />\n )\n}\n\nfunction FieldGroup({ className, ...props }: FieldGroupProps) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n 'group/field-group @container/field-group flex w-full flex-col gap-5',\n 'data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4',\n className\n )}\n {...props}\n />\n )\n}\n\nconst fieldVariants = cva('data-[invalid=true]:text-destructive gap-2 group/field flex w-full', {\n variants: {\n orientation: {\n vertical: 'flex-col *:w-full [&>.sr-only]:w-auto',\n horizontal:\n 'flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n responsive:\n 'flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px'\n }\n },\n defaultVariants: {\n orientation: 'vertical'\n }\n})\n\nexport type FieldProps = React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>\n\nfunction Field({ className, orientation = 'vertical', ...props }: FieldProps) {\n return (\n <div\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n )\n}\n\nfunction FieldContent({ className, ...props }: FieldContentProps) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn('gap-0.5 group/field-content flex flex-1 flex-col leading-snug', className)}\n {...props}\n />\n )\n}\n\nfunction FieldLabel({ className, ...props }: FieldLabelProps) {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n 'group/field-label peer/field-label flex w-fit gap-2 leading-snug',\n 'has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10',\n 'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5',\n 'group-data-[disabled=true]/field:opacity-50',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldTitle({ className, ...props }: FieldTitleProps) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n 'gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldDescription({ className, ...props }: FieldDescriptionProps) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n 'text-muted-foreground text-left text-sm leading-normal font-normal',\n '[[data-variant=legend]+&]:-mt-1.5 group-has-data-horizontal/field:text-balance last:mt-0 nth-last-2:-mt-1',\n '[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldSeparator({ children, className, ...props }: FieldSeparatorProps) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn('-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative', className)}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span\n className=\"text-muted-foreground px-2 bg-background relative mx-auto block w-fit\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n )\n}\n\nfunction FieldError({ className, children, errors, ...props }: FieldErrorProps) {\n const content = useMemo(() => {\n if (children) {\n return children\n }\n\n if (!errors?.length) {\n return null\n }\n\n const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()]\n\n if (uniqueErrors?.length === 1) {\n return uniqueErrors[0]?.message\n }\n\n return (\n <ul className=\"ml-4 flex list-disc flex-col gap-1\">\n {uniqueErrors.map((error) => error?.message && <li key={error.message}>{error.message}</li>)}\n </ul>\n )\n }, [children, errors])\n\n if (!content) {\n return null\n }\n\n return (\n <div\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn('text-destructive text-sm font-normal', className)}\n {...props}\n >\n {content}\n </div>\n )\n}\n\nexport {\n Field,\n FieldContent,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLabel,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldTitle\n}\n"],"mappings":"iRA8BA,SAAS,SAAS,CAAE,YAAW,GAAG,GAAwB,CACxD,OACE,EAAC,WAAD,CACE,YAAU,YACV,UAAW,EACT,sBACA,+EACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,YAAY,CAAE,YAAW,UAAU,SAAU,GAAG,GAA2B,CAClF,OACE,EAAC,SAAD,CACE,YAAU,eACV,eAAc,EACd,UAAW,EAAG,kFAAmF,EAAU,CAC3G,GAAI,EACJ,CAAA,CAIN,SAAS,WAAW,CAAE,YAAW,GAAG,GAA0B,CAC5D,OACE,EAAC,MAAD,CACE,YAAU,cACV,UAAW,EACT,sEACA,mEACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,MAAM,EAAgB,EAAI,qEAAsE,CAC9F,SAAU,CACR,YAAa,CACX,SAAU,wCACV,WACE,iLACF,WACE,gUACH,CACF,CACD,gBAAiB,CACf,YAAa,WACd,CACF,CAAC,CAIF,SAAS,MAAM,CAAE,YAAW,cAAc,WAAY,GAAG,GAAqB,CAC5E,OACE,EAAC,MAAD,CACE,YAAU,QACV,mBAAkB,EAClB,UAAW,EAAG,EAAc,CAAE,cAAa,CAAC,CAAE,EAAU,CACxD,GAAI,EACJ,CAAA,CAIN,SAAS,aAAa,CAAE,YAAW,GAAG,GAA4B,CAChE,OACE,EAAC,MAAD,CACE,YAAU,gBACV,UAAW,EAAG,gEAAiE,EAAU,CACzF,GAAI,EACJ,CAAA,CAIN,SAAS,WAAW,CAAE,YAAW,GAAG,GAA0B,CAC5D,OACE,EAAC,EAAD,CACE,YAAU,cACV,UAAW,EACT,mEACA,+IACA,kKACA,8CACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,WAAW,CAAE,YAAW,GAAG,GAA0B,CAC5D,OACE,EAAC,MAAD,CACE,YAAU,cACV,UAAW,EACT,6GACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,iBAAiB,CAAE,YAAW,GAAG,GAAgC,CACxE,OACE,EAAC,IAAD,CACE,YAAU,oBACV,UAAW,EACT,qEACA,4GACA,oEACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,eAAe,CAAE,WAAU,YAAW,GAAG,GAA8B,CAC9E,OACE,EAAC,MAAD,CACE,YAAU,kBACV,eAAc,CAAC,CAAC,EAChB,UAAW,EAAG,4EAA6E,EAAU,CACrG,GAAI,WAJN,CAME,EAAC,EAAD,CAAW,UAAU,2BAA6B,CAAA,CACjD,GACC,EAAC,OAAD,CACE,UAAU,wEACV,YAAU,0BAET,WACI,CAAA,CAEL,GAIV,SAAS,WAAW,CAAE,YAAW,WAAU,SAAQ,GAAG,GAA0B,CAC9E,IAAM,EAAU,MAAc,CAC5B,GAAI,EACF,OAAO,EAGT,GAAI,CAAC,GAAQ,OACX,OAAO,KAGT,IAAM,EAAe,CAAC,GAAG,IAAI,IAAI,EAAO,IAAK,GAAU,CAAC,GAAO,QAAS,EAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAM1F,OAJI,GAAc,SAAW,EACpB,EAAa,IAAI,QAIxB,EAAC,KAAD,CAAI,UAAU,8CACX,EAAa,IAAK,GAAU,GAAO,SAAW,EAAC,KAAD,CAAA,SAAyB,EAAM,QAAa,CAAnC,EAAM,QAA6B,CAAC,CACzF,CAAA,EAEN,CAAC,EAAU,EAAO,CAAC,CAMtB,OAJK,EAKH,EAAC,MAAD,CACE,KAAK,QACL,YAAU,cACV,UAAW,EAAG,uCAAwC,EAAU,CAChE,GAAI,WAEH,EACG,CAAA,CAXC"}
1
+ {"version":3,"file":"field.js","names":[],"sources":["../../src/components/field.tsx"],"sourcesContent":["import { createContext, useContext, useId, useMemo } from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/utils'\nimport { Label } from './label'\nimport { Separator } from './separator'\n\nexport type FieldSetProps = React.ComponentProps<'fieldset'>\n\nexport type FieldLegendProps = React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }\n\nexport type FieldGroupProps = React.ComponentProps<'div'>\n\nexport type FieldContentProps = React.ComponentProps<'div'>\n\nexport type FieldLabelProps = React.ComponentProps<typeof Label>\n\nexport type FieldTitleProps = React.ComponentProps<'div'>\n\nexport type FieldDescriptionProps = React.ComponentProps<'p'>\n\nexport type FieldSeparatorProps = React.ComponentProps<'div'> & {\n children?: React.ReactNode\n}\n\nexport type FieldErrorProps = React.ComponentProps<'div'> & {\n errors?: Array<{ message?: string } | undefined>\n}\n\ntype FieldContextValue = {\n controlId: string\n}\n\nconst FieldContext = createContext<FieldContextValue | null>(null)\n\nfunction useFieldControlId(id?: string) {\n const context = useContext(FieldContext)\n\n return id ?? context?.controlId\n}\n\nfunction FieldSet({ className, ...props }: FieldSetProps) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n 'flex flex-col gap-4',\n 'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldLegend({ className, variant = 'legend', ...props }: FieldLegendProps) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn('mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base', className)}\n {...props}\n />\n )\n}\n\nfunction FieldGroup({ className, ...props }: FieldGroupProps) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n 'group/field-group @container/field-group flex w-full flex-col gap-5',\n 'data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4',\n className\n )}\n {...props}\n />\n )\n}\n\nconst fieldVariants = cva('data-[invalid=true]:text-destructive gap-1 group/field flex w-full', {\n variants: {\n orientation: {\n vertical: 'flex-col *:w-full [&>.sr-only]:w-auto',\n horizontal:\n 'flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n responsive:\n 'flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px'\n }\n },\n defaultVariants: {\n orientation: 'vertical'\n }\n})\n\nexport type FieldProps = React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>\n\nfunction Field({ className, orientation = 'vertical', ...props }: FieldProps) {\n const controlId = useId()\n const contextValue = useMemo(() => ({ controlId }), [controlId])\n\n return (\n <FieldContext.Provider value={contextValue}>\n <div\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n </FieldContext.Provider>\n )\n}\n\nfunction FieldContent({ className, ...props }: FieldContentProps) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn('gap-0.5 group/field-content flex flex-1 flex-col leading-snug', className)}\n {...props}\n />\n )\n}\n\nfunction FieldLabel({ className, htmlFor, ...props }: FieldLabelProps) {\n const fieldControlId = useFieldControlId(htmlFor)\n\n return (\n <Label\n data-slot=\"field-label\"\n htmlFor={fieldControlId}\n className={cn(\n 'group/field-label peer/field-label flex w-fit gap-2 leading-snug',\n 'has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10',\n 'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5',\n 'group-data-[disabled=true]/field:opacity-50',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldTitle({ className, ...props }: FieldTitleProps) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n 'gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldDescription({ className, ...props }: FieldDescriptionProps) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n 'text-muted-foreground text-left text-sm leading-normal font-normal',\n '[[data-variant=legend]+&]:-mt-1.5 group-has-data-horizontal/field:text-balance last:mt-0 nth-last-2:-mt-1',\n '[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldSeparator({ children, className, ...props }: FieldSeparatorProps) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn('-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative', className)}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span\n className=\"text-muted-foreground px-2 bg-background relative mx-auto block w-fit\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n )\n}\n\nfunction FieldError({ className, children, errors, ...props }: FieldErrorProps) {\n const content = useMemo(() => {\n if (children) {\n return children\n }\n\n if (!errors?.length) {\n return null\n }\n\n const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()]\n\n if (uniqueErrors?.length === 1) {\n return uniqueErrors[0]?.message\n }\n\n return (\n <ul className=\"ml-4 flex list-disc flex-col gap-1\">\n {uniqueErrors.map((error) => error?.message && <li key={error.message}>{error.message}</li>)}\n </ul>\n )\n }, [children, errors])\n\n if (!content) {\n return null\n }\n\n return (\n <div\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn('text-destructive text-sm font-normal', className)}\n {...props}\n >\n {content}\n </div>\n )\n}\n\nexport {\n Field,\n FieldContent,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLabel,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldTitle,\n useFieldControlId\n}\n"],"mappings":"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"}
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,2 @@
1
+ import"../chunk-CHh1Zzun.js";import{Field as e,FieldLabel as t}from"./field.js";import{Checkbox as n}from"./checkbox.js";import{Input as r}from"./input.js";import{Textarea as i}from"./textarea.js";import{NativeSelect as a,NativeSelectOption as o}from"./native-select.js";import{Select as s,SelectTrigger as c,SelectValue as l}from"./select.js";import{i as u,n as d}from"../react.esm-B3a5z6DL.js";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";describe(`Field automatic control ids`,()=>{it(`wires FieldLabel and Input with a generated id when ids are omitted`,()=>{d(m(e,{children:[p(t,{children:`Email`}),p(r,{})]}));let n=u.getByLabelText(`Email`),i=u.getByText(`Email`);expect(n.getAttribute(`id`)).toBeTruthy(),expect(i.getAttribute(`for`)).toBe(n.getAttribute(`id`))}),it(`preserves explicit input ids and label htmlFor values`,()=>{d(m(e,{children:[p(t,{htmlFor:`explicit-label-target`,children:`Email`}),p(r,{id:`explicit-input`})]})),expect(u.getByText(`Email`).getAttribute(`for`)).toBe(`explicit-label-target`),expect(document.getElementById(`explicit-input`)).not.toBeNull()}),it(`does not assign ids or throw outside Field`,()=>{let{container:e}=d(m(f,{children:[p(t,{children:`Email`}),p(r,{})]}));expect(e.querySelector(`[data-slot="field-label"]`)?.getAttribute(`for`)).toBeNull(),expect(e.querySelector(`[data-slot="input"]`)?.getAttribute(`id`)).toBeNull()}),it(`wires representative controls to the generated Field id`,()=>{d(m(f,{children:[m(e,{children:[p(t,{children:`Message`}),p(i,{})]}),m(e,{children:[p(t,{children:`Framework`}),p(a,{children:p(o,{value:`react`,children:`React`})})]}),m(e,{children:[p(t,{children:`Category`}),p(s,{children:p(c,{children:p(l,{placeholder:`Select a category`})})})]}),m(e,{children:[p(t,{children:`Terms`}),p(n,{})]})]}));for(let e of[`Message`,`Framework`,`Category`,`Terms`]){let t=u.getByText(e).getAttribute(`for`);expect(t).toBeTruthy(),expect(document.getElementById(t??``)).not.toBeNull()}})});
2
+ //# sourceMappingURL=field.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field.spec.js","names":[],"sources":["../../src/components/field.spec.tsx"],"sourcesContent":["import { render, screen } from '@testing-library/react'\n\nimport { Checkbox } from './checkbox'\nimport { Field, FieldLabel } from './field'\nimport { Input } from './input'\nimport { NativeSelect, NativeSelectOption } from './native-select'\nimport { Select, SelectTrigger, SelectValue } from './select'\nimport { Textarea } from './textarea'\n\ndescribe('Field automatic control ids', () => {\n it('wires FieldLabel and Input with a generated id when ids are omitted', () => {\n render(\n <Field>\n <FieldLabel>Email</FieldLabel>\n <Input />\n </Field>\n )\n\n const input = screen.getByLabelText('Email')\n const label = screen.getByText('Email')\n\n expect(input.getAttribute('id')).toBeTruthy()\n expect(label.getAttribute('for')).toBe(input.getAttribute('id'))\n })\n\n it('preserves explicit input ids and label htmlFor values', () => {\n render(\n <Field>\n <FieldLabel htmlFor=\"explicit-label-target\">Email</FieldLabel>\n <Input id=\"explicit-input\" />\n </Field>\n )\n\n expect(screen.getByText('Email').getAttribute('for')).toBe('explicit-label-target')\n expect(document.getElementById('explicit-input')).not.toBeNull()\n })\n\n it('does not assign ids or throw outside Field', () => {\n const { container } = render(\n <>\n <FieldLabel>Email</FieldLabel>\n <Input />\n </>\n )\n\n expect(container.querySelector('[data-slot=\"field-label\"]')?.getAttribute('for')).toBeNull()\n expect(container.querySelector('[data-slot=\"input\"]')?.getAttribute('id')).toBeNull()\n })\n\n it('wires representative controls to the generated Field id', () => {\n render(\n <>\n <Field>\n <FieldLabel>Message</FieldLabel>\n <Textarea />\n </Field>\n\n <Field>\n <FieldLabel>Framework</FieldLabel>\n <NativeSelect>\n <NativeSelectOption value=\"react\">React</NativeSelectOption>\n </NativeSelect>\n </Field>\n\n <Field>\n <FieldLabel>Category</FieldLabel>\n <Select>\n <SelectTrigger>\n <SelectValue placeholder=\"Select a category\" />\n </SelectTrigger>\n </Select>\n </Field>\n\n <Field>\n <FieldLabel>Terms</FieldLabel>\n <Checkbox />\n </Field>\n </>\n )\n\n for (const label of ['Message', 'Framework', 'Category', 'Terms']) {\n const labelElement = screen.getByText(label)\n const controlId = labelElement.getAttribute('for')\n\n expect(controlId).toBeTruthy()\n expect(document.getElementById(controlId ?? '')).not.toBeNull()\n }\n })\n})\n"],"mappings":"4cASA,SAAS,kCAAqC,CAC5C,GAAG,0EAA6E,CAC9E,EACE,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAA,SAAY,QAAkB,CAAA,CAC9B,EAAC,EAAD,EAAS,CAAA,CACH,CAAA,CAAA,CACT,CAED,IAAM,EAAQ,EAAO,eAAe,QAAQ,CACtC,EAAQ,EAAO,UAAU,QAAQ,CAEvC,OAAO,EAAM,aAAa,KAAK,CAAC,CAAC,YAAY,CAC7C,OAAO,EAAM,aAAa,MAAM,CAAC,CAAC,KAAK,EAAM,aAAa,KAAK,CAAC,EAChE,CAEF,GAAG,4DAA+D,CAChE,EACE,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAY,QAAQ,iCAAwB,QAAkB,CAAA,CAC9D,EAAC,EAAD,CAAO,GAAG,iBAAmB,CAAA,CACvB,CAAA,CAAA,CACT,CAED,OAAO,EAAO,UAAU,QAAQ,CAAC,aAAa,MAAM,CAAC,CAAC,KAAK,wBAAwB,CACnF,OAAO,SAAS,eAAe,iBAAiB,CAAC,CAAC,IAAI,UAAU,EAChE,CAEF,GAAG,iDAAoD,CACrD,GAAM,CAAE,aAAc,EACpB,EAAA,EAAA,CAAA,SAAA,CACE,EAAC,EAAD,CAAA,SAAY,QAAkB,CAAA,CAC9B,EAAC,EAAD,EAAS,CAAA,CACR,CAAA,CAAA,CACJ,CAED,OAAO,EAAU,cAAc,4BAA4B,EAAE,aAAa,MAAM,CAAC,CAAC,UAAU,CAC5F,OAAO,EAAU,cAAc,sBAAsB,EAAE,aAAa,KAAK,CAAC,CAAC,UAAU,EACrF,CAEF,GAAG,8DAAiE,CAClE,EACE,EAAA,EAAA,CAAA,SAAA,CACE,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAA,SAAY,UAAoB,CAAA,CAChC,EAAC,EAAD,EAAY,CAAA,CACN,CAAA,CAAA,CAER,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAA,SAAY,YAAsB,CAAA,CAClC,EAAC,EAAD,CAAA,SACE,EAAC,EAAD,CAAoB,MAAM,iBAAQ,QAA0B,CAAA,CAC/C,CAAA,CACT,CAAA,CAAA,CAER,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAA,SAAY,WAAqB,CAAA,CACjC,EAAC,EAAD,CAAA,SACE,EAAC,EAAD,CAAA,SACE,EAAC,EAAD,CAAa,YAAY,oBAAsB,CAAA,CACjC,CAAA,CACT,CAAA,CACH,CAAA,CAAA,CAER,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAA,SAAY,QAAkB,CAAA,CAC9B,EAAC,EAAD,EAAY,CAAA,CACN,CAAA,CAAA,CACP,CAAA,CAAA,CACJ,CAED,IAAK,IAAM,IAAS,CAAC,UAAW,YAAa,WAAY,QAAQ,CAAE,CAEjE,IAAM,EADe,EAAO,UAAU,EACR,CAAC,aAAa,MAAM,CAElD,OAAO,EAAU,CAAC,YAAY,CAC9B,OAAO,SAAS,eAAe,GAAa,GAAG,CAAC,CAAC,IAAI,UAAU,GAEjE,EACF"}
@@ -15,6 +15,7 @@ type InputOTPSeparatorProps = React.ComponentProps<'div'>;
15
15
  declare function InputOTP({
16
16
  className,
17
17
  containerClassName,
18
+ id,
18
19
  ...props
19
20
  }: InputOTPProps): _$react_jsx_runtime0.JSX.Element;
20
21
  declare function InputOTPGroup({
@@ -1,2 +1,2 @@
1
- import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{IconMinus as t}from"@tabler/icons-react";import{jsx as n,jsxs as r}from"react/jsx-runtime";import*as i from"react";import{OTPInput as a,OTPInputContext as o,REGEXP_ONLY_CHARS as s,REGEXP_ONLY_DIGITS as c,REGEXP_ONLY_DIGITS_AND_CHARS as l}from"input-otp";function InputOTP({className:t,containerClassName:r,...i}){return n(a,{"data-slot":`input-otp`,containerClassName:e(`cn-input-otp flex items-center has-disabled:opacity-50`,r),spellCheck:!1,className:e(`disabled:cursor-not-allowed`,t),...i})}function InputOTPGroup({className:t,...r}){return n(`div`,{"data-slot":`input-otp-group`,className:e(`flex items-center rounded-lg`,`has-aria-invalid:border-destructive has-aria-invalid:ring-destructive/20 has-aria-invalid:ring-3 dark:has-aria-invalid:ring-destructive/40`,t),...r})}function InputOTPSlot({index:t,className:a,...s}){let{char:c,hasFakeCaret:l,isActive:u}=i.useContext(o)?.slots[t]??{};return r(`div`,{"data-slot":`input-otp-slot`,"data-active":u,className:e(`dark:bg-input/30 border-input relative flex size-8 items-center justify-center border-y border-r text-sm transition-all outline-none`,`first:rounded-l-lg first:border-l last:rounded-r-lg`,`aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive`,`data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:ring-3 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40`,a),...s,children:[c,l&&n(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:n(`div`,{className:`animate-caret-blink bg-foreground h-4 w-px duration-1000`})})]})}function InputOTPSeparator({...e}){return n(`div`,{"data-slot":`input-otp-separator`,className:`[&_svg:not([class*='size-'])]:size-4 flex items-center`,...e,children:n(t,{})})}export{InputOTP,InputOTPGroup,InputOTPSeparator,InputOTPSlot,s as REGEXP_ONLY_CHARS,c as REGEXP_ONLY_DIGITS,l as REGEXP_ONLY_DIGITS_AND_CHARS};
1
+ import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{useFieldControlId as t}from"./field.js";import{IconMinus as n}from"@tabler/icons-react";import{jsx as r,jsxs as i}from"react/jsx-runtime";import*as a from"react";import{OTPInput as o,OTPInputContext as s,REGEXP_ONLY_CHARS as c,REGEXP_ONLY_DIGITS as l,REGEXP_ONLY_DIGITS_AND_CHARS as u}from"input-otp";function InputOTP({className:n,containerClassName:i,id:a,...s}){return r(o,{id:t(a),"data-slot":`input-otp`,containerClassName:e(`cn-input-otp flex items-center has-disabled:opacity-50`,i),spellCheck:!1,className:e(`disabled:cursor-not-allowed`,n),...s})}function InputOTPGroup({className:t,...n}){return r(`div`,{"data-slot":`input-otp-group`,className:e(`flex items-center rounded-lg`,`has-aria-invalid:border-destructive has-aria-invalid:ring-destructive/20 has-aria-invalid:ring-3 dark:has-aria-invalid:ring-destructive/40`,t),...n})}function InputOTPSlot({index:t,className:n,...o}){let{char:c,hasFakeCaret:l,isActive:u}=a.useContext(s)?.slots[t]??{};return i(`div`,{"data-slot":`input-otp-slot`,"data-active":u,className:e(`dark:bg-input/30 border-input relative flex size-8 items-center justify-center border-y border-r text-sm transition-all outline-none`,`first:rounded-l-lg first:border-l last:rounded-r-lg`,`aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive`,`data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:ring-3 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40`,n),...o,children:[c,l&&r(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:r(`div`,{className:`animate-caret-blink bg-foreground h-4 w-px duration-1000`})})]})}function InputOTPSeparator({...e}){return r(`div`,{"data-slot":`input-otp-separator`,className:`[&_svg:not([class*='size-'])]:size-4 flex items-center`,...e,children:r(n,{})})}export{InputOTP,InputOTPGroup,InputOTPSeparator,InputOTPSlot,c as REGEXP_ONLY_CHARS,l as REGEXP_ONLY_DIGITS,u as REGEXP_ONLY_DIGITS_AND_CHARS};
2
2
  //# sourceMappingURL=input-otp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-otp.js","names":[],"sources":["../../src/components/input-otp.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { IconMinus } from '@tabler/icons-react'\nimport {\n OTPInput,\n OTPInputContext,\n REGEXP_ONLY_CHARS,\n REGEXP_ONLY_DIGITS,\n REGEXP_ONLY_DIGITS_AND_CHARS\n} from 'input-otp'\n\nimport { cn } from '../lib/utils'\n\nexport type InputOTPProps = React.ComponentProps<typeof OTPInput> & {\n containerClassName?: string\n}\n\nexport type InputOTPGroupProps = React.ComponentProps<'div'>\n\nexport type InputOTPSlotProps = React.ComponentProps<'div'> & {\n index: number\n}\n\nexport type InputOTPSeparatorProps = React.ComponentProps<'div'>\n\nfunction InputOTP({ className, containerClassName, ...props }: InputOTPProps) {\n return (\n <OTPInput\n data-slot=\"input-otp\"\n containerClassName={cn('cn-input-otp flex items-center has-disabled:opacity-50', containerClassName)}\n spellCheck={false}\n className={cn('disabled:cursor-not-allowed', className)}\n {...props}\n />\n )\n}\n\nfunction InputOTPGroup({ className, ...props }: InputOTPGroupProps) {\n return (\n <div\n data-slot=\"input-otp-group\"\n className={cn(\n 'flex items-center rounded-lg',\n 'has-aria-invalid:border-destructive has-aria-invalid:ring-destructive/20 has-aria-invalid:ring-3 dark:has-aria-invalid:ring-destructive/40',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction InputOTPSlot({ index, className, ...props }: InputOTPSlotProps) {\n const inputOTPContext = React.useContext(OTPInputContext)\n const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {}\n\n return (\n <div\n data-slot=\"input-otp-slot\"\n data-active={isActive}\n className={cn(\n 'dark:bg-input/30 border-input relative flex size-8 items-center justify-center border-y border-r text-sm transition-all outline-none',\n 'first:rounded-l-lg first:border-l last:rounded-r-lg',\n 'aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive',\n 'data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:ring-3 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40',\n className\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"animate-caret-blink bg-foreground h-4 w-px duration-1000\" />\n </div>\n )}\n </div>\n )\n}\n\nfunction InputOTPSeparator({ ...props }: InputOTPSeparatorProps) {\n return (\n <div data-slot=\"input-otp-separator\" className=\"[&_svg:not([class*='size-'])]:size-4 flex items-center\" {...props}>\n <IconMinus />\n </div>\n )\n}\n\nexport {\n InputOTP,\n InputOTPGroup,\n InputOTPSeparator,\n InputOTPSlot,\n REGEXP_ONLY_CHARS,\n REGEXP_ONLY_DIGITS,\n REGEXP_ONLY_DIGITS_AND_CHARS\n}\n"],"mappings":"uUAyBA,SAAS,SAAS,CAAE,YAAW,qBAAoB,GAAG,GAAwB,CAC5E,OACE,EAAC,EAAD,CACE,YAAU,YACV,mBAAoB,EAAG,yDAA0D,EAAmB,CACpG,WAAY,GACZ,UAAW,EAAG,8BAA+B,EAAU,CACvD,GAAI,EACJ,CAAA,CAIN,SAAS,cAAc,CAAE,YAAW,GAAG,GAA6B,CAClE,OACE,EAAC,MAAD,CACE,YAAU,kBACV,UAAW,EACT,+BACA,6IACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,aAAa,CAAE,QAAO,YAAW,GAAG,GAA4B,CAEvE,GAAM,CAAE,OAAM,eAAc,YADJ,EAAM,WAAW,EACe,EAAE,MAAM,IAAU,EAAE,CAE5E,OACE,EAAC,MAAD,CACE,YAAU,iBACV,cAAa,EACb,UAAW,EACT,uIACA,sDACA,qFACA,gOACA,EACD,CACD,GAAI,WAVN,CAYG,EACA,GACC,EAAC,MAAD,CAAK,UAAU,iFACb,EAAC,MAAD,CAAK,UAAU,2DAA6D,CAAA,CACxE,CAAA,CAEJ,GAIV,SAAS,kBAAkB,CAAE,GAAG,GAAiC,CAC/D,OACE,EAAC,MAAD,CAAK,YAAU,sBAAsB,UAAU,yDAAyD,GAAI,WAC1G,EAAC,EAAD,EAAa,CAAA,CACT,CAAA"}
1
+ {"version":3,"file":"input-otp.js","names":[],"sources":["../../src/components/input-otp.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { IconMinus } from '@tabler/icons-react'\nimport {\n OTPInput,\n OTPInputContext,\n REGEXP_ONLY_CHARS,\n REGEXP_ONLY_DIGITS,\n REGEXP_ONLY_DIGITS_AND_CHARS\n} from 'input-otp'\n\nimport { cn } from '../lib/utils'\nimport { useFieldControlId } from './field'\n\nexport type InputOTPProps = React.ComponentProps<typeof OTPInput> & {\n containerClassName?: string\n}\n\nexport type InputOTPGroupProps = React.ComponentProps<'div'>\n\nexport type InputOTPSlotProps = React.ComponentProps<'div'> & {\n index: number\n}\n\nexport type InputOTPSeparatorProps = React.ComponentProps<'div'>\n\nfunction InputOTP({ className, containerClassName, id, ...props }: InputOTPProps) {\n const fieldControlId = useFieldControlId(id)\n\n return (\n <OTPInput\n id={fieldControlId}\n data-slot=\"input-otp\"\n containerClassName={cn('cn-input-otp flex items-center has-disabled:opacity-50', containerClassName)}\n spellCheck={false}\n className={cn('disabled:cursor-not-allowed', className)}\n {...props}\n />\n )\n}\n\nfunction InputOTPGroup({ className, ...props }: InputOTPGroupProps) {\n return (\n <div\n data-slot=\"input-otp-group\"\n className={cn(\n 'flex items-center rounded-lg',\n 'has-aria-invalid:border-destructive has-aria-invalid:ring-destructive/20 has-aria-invalid:ring-3 dark:has-aria-invalid:ring-destructive/40',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction InputOTPSlot({ index, className, ...props }: InputOTPSlotProps) {\n const inputOTPContext = React.useContext(OTPInputContext)\n const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {}\n\n return (\n <div\n data-slot=\"input-otp-slot\"\n data-active={isActive}\n className={cn(\n 'dark:bg-input/30 border-input relative flex size-8 items-center justify-center border-y border-r text-sm transition-all outline-none',\n 'first:rounded-l-lg first:border-l last:rounded-r-lg',\n 'aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive',\n 'data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:ring-3 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40',\n className\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"animate-caret-blink bg-foreground h-4 w-px duration-1000\" />\n </div>\n )}\n </div>\n )\n}\n\nfunction InputOTPSeparator({ ...props }: InputOTPSeparatorProps) {\n return (\n <div data-slot=\"input-otp-separator\" className=\"[&_svg:not([class*='size-'])]:size-4 flex items-center\" {...props}>\n <IconMinus />\n </div>\n )\n}\n\nexport {\n InputOTP,\n InputOTPGroup,\n InputOTPSeparator,\n InputOTPSlot,\n REGEXP_ONLY_CHARS,\n REGEXP_ONLY_DIGITS,\n REGEXP_ONLY_DIGITS_AND_CHARS\n}\n"],"mappings":"sXA0BA,SAAS,SAAS,CAAE,YAAW,qBAAoB,KAAI,GAAG,GAAwB,CAGhF,OACE,EAAC,EAAD,CACE,GAJmB,EAAkB,EAInB,CAClB,YAAU,YACV,mBAAoB,EAAG,yDAA0D,EAAmB,CACpG,WAAY,GACZ,UAAW,EAAG,8BAA+B,EAAU,CACvD,GAAI,EACJ,CAAA,CAIN,SAAS,cAAc,CAAE,YAAW,GAAG,GAA6B,CAClE,OACE,EAAC,MAAD,CACE,YAAU,kBACV,UAAW,EACT,+BACA,6IACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,aAAa,CAAE,QAAO,YAAW,GAAG,GAA4B,CAEvE,GAAM,CAAE,OAAM,eAAc,YADJ,EAAM,WAAW,EACe,EAAE,MAAM,IAAU,EAAE,CAE5E,OACE,EAAC,MAAD,CACE,YAAU,iBACV,cAAa,EACb,UAAW,EACT,uIACA,sDACA,qFACA,gOACA,EACD,CACD,GAAI,WAVN,CAYG,EACA,GACC,EAAC,MAAD,CAAK,UAAU,iFACb,EAAC,MAAD,CAAK,UAAU,2DAA6D,CAAA,CACxE,CAAA,CAEJ,GAIV,SAAS,kBAAkB,CAAE,GAAG,GAAiC,CAC/D,OACE,EAAC,MAAD,CAAK,YAAU,sBAAsB,UAAU,yDAAyD,GAAI,WAC1G,EAAC,EAAD,EAAa,CAAA,CACT,CAAA"}
@@ -6,6 +6,7 @@ import * as React from "react";
6
6
  type InputProps = React.ComponentProps<'input'>;
7
7
  declare function Input({
8
8
  className,
9
+ id,
9
10
  type,
10
11
  ...props
11
12
  }: InputProps): _$react_jsx_runtime0.JSX.Element;
@@ -1,2 +1,2 @@
1
- import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{jsx as t}from"react/jsx-runtime";function Input({className:n,type:r,...i}){return t(`input`,{type:r,"data-slot":`input`,className:e(`border-input dark:bg-input/30 h-8 w-full min-w-0 rounded-lg border bg-transparent px-2.5 py-1 text-base md:text-sm transition-colors`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-3 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,`placeholder:text-muted-foreground`,`file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground`,`outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-input/50 dark:disabled:bg-input/80`,n),...i})}export{Input};
1
+ import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{useFieldControlId as t}from"./field.js";import{jsx as n}from"react/jsx-runtime";function Input({className:r,id:i,type:a,...o}){return n(`input`,{id:t(i),type:a,"data-slot":`input`,className:e(`border-input dark:bg-input/30 h-8 w-full min-w-0 rounded-lg border bg-transparent px-2.5 py-1 text-base md:text-sm transition-colors`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-3 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,`placeholder:text-muted-foreground`,`file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground`,`outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-input/50 dark:disabled:bg-input/80`,r),...o})}export{Input};
2
2
  //# sourceMappingURL=input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","names":[],"sources":["../../src/components/input.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cn } from '../lib/utils'\n\nexport type InputProps = React.ComponentProps<'input'>\n\nfunction Input({ className, type, ...props }: InputProps) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n 'border-input dark:bg-input/30 h-8 w-full min-w-0 rounded-lg border bg-transparent px-2.5 py-1 text-base md:text-sm transition-colors',\n 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3',\n 'aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-3 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40',\n 'placeholder:text-muted-foreground',\n 'file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground',\n 'outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-input/50 dark:disabled:bg-input/80',\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Input }\n"],"mappings":"0GAMA,SAAS,MAAM,CAAE,YAAW,OAAM,GAAG,GAAqB,CACxD,OACE,EAAC,QAAD,CACQ,OACN,YAAU,QACV,UAAW,EACT,uIACA,4EACA,qKACA,oCACA,iHACA,2IACA,EACD,CACD,GAAI,EACJ,CAAA"}
1
+ {"version":3,"file":"input.js","names":[],"sources":["../../src/components/input.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cn } from '../lib/utils'\nimport { useFieldControlId } from './field'\n\nexport type InputProps = React.ComponentProps<'input'>\n\nfunction Input({ className, id, type, ...props }: InputProps) {\n const fieldControlId = useFieldControlId(id)\n\n return (\n <input\n id={fieldControlId}\n type={type}\n data-slot=\"input\"\n className={cn(\n 'border-input dark:bg-input/30 h-8 w-full min-w-0 rounded-lg border bg-transparent px-2.5 py-1 text-base md:text-sm transition-colors',\n 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3',\n 'aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-3 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40',\n 'placeholder:text-muted-foreground',\n 'file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground',\n 'outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-input/50 dark:disabled:bg-input/80',\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Input }\n"],"mappings":"yJAOA,SAAS,MAAM,CAAE,YAAW,KAAI,OAAM,GAAG,GAAqB,CAG5D,OACE,EAAC,QAAD,CACE,GAJmB,EAAkB,EAInB,CACZ,OACN,YAAU,QACV,UAAW,EACT,uIACA,4EACA,qKACA,oCACA,iHACA,2IACA,EACD,CACD,GAAI,EACJ,CAAA"}
@@ -10,6 +10,7 @@ type NativeSelectOptionProps = React.ComponentProps<'option'>;
10
10
  type NativeSelectOptGroupProps = React.ComponentProps<'optgroup'>;
11
11
  declare function NativeSelect({
12
12
  className,
13
+ id,
13
14
  size,
14
15
  ...props
15
16
  }: NativeSelectProps): _$react_jsx_runtime0.JSX.Element;
@@ -1,2 +1,2 @@
1
- import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{IconSelector as t}from"@tabler/icons-react";import{jsx as n,jsxs as r}from"react/jsx-runtime";function NativeSelect({className:i,size:a=`md`,...o}){return r(`div`,{className:e(`group/native-select relative w-fit has-[select:disabled]:opacity-50`,i),"data-slot":`native-select-wrapper`,"data-size":a,children:[n(`select`,{"data-slot":`native-select`,"data-size":a,className:e(`border-input dark:bg-input/30 dark:hover:bg-input/50 h-8 w-full min-w-0 appearance-none rounded-lg border bg-transparent py-1 pr-8 pl-2.5 text-sm transition-colors select-none outline-none`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-3 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,`placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground`,`data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=sm]:py-0.5`,`disabled:pointer-events-none disabled:cursor-not-allowed`),...o}),n(t,{className:`text-muted-foreground top-1/2 right-2.5 size-4 -translate-y-1/2 pointer-events-none absolute select-none`,"aria-hidden":`true`,"data-slot":`native-select-icon`})]})}function NativeSelectOption({...e}){return n(`option`,{"data-slot":`native-select-option`,...e})}function NativeSelectOptGroup({className:t,...r}){return n(`optgroup`,{"data-slot":`native-select-optgroup`,className:e(t),...r})}export{NativeSelect,NativeSelectOptGroup,NativeSelectOption};
1
+ import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{useFieldControlId as t}from"./field.js";import{IconSelector as n}from"@tabler/icons-react";import{jsx as r,jsxs as i}from"react/jsx-runtime";function NativeSelect({className:a,id:o,size:s=`md`,...c}){let l=t(o);return i(`div`,{className:e(`group/native-select relative w-fit has-[select:disabled]:opacity-50`,a),"data-slot":`native-select-wrapper`,"data-size":s,children:[r(`select`,{id:l,"data-slot":`native-select`,"data-size":s,className:e(`border-input dark:bg-input/30 dark:hover:bg-input/50 h-8 w-full min-w-0 appearance-none rounded-lg border bg-transparent py-1 pr-8 pl-2.5 text-sm transition-colors select-none outline-none`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-3 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,`placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground`,`data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=sm]:py-0.5`,`disabled:pointer-events-none disabled:cursor-not-allowed`),...c}),r(n,{className:`text-muted-foreground top-1/2 right-2.5 size-4 -translate-y-1/2 pointer-events-none absolute select-none`,"aria-hidden":`true`,"data-slot":`native-select-icon`})]})}function NativeSelectOption({...e}){return r(`option`,{"data-slot":`native-select-option`,...e})}function NativeSelectOptGroup({className:t,...n}){return r(`optgroup`,{"data-slot":`native-select-optgroup`,className:e(t),...n})}export{NativeSelect,NativeSelectOptGroup,NativeSelectOption};
2
2
  //# sourceMappingURL=native-select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"native-select.js","names":[],"sources":["../../src/components/native-select.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { IconSelector } from '@tabler/icons-react'\n\nimport { cn } from '../lib/utils'\n\nexport type NativeSelectProps = Omit<React.ComponentProps<'select'>, 'size'> & {\n size?: 'sm' | 'md'\n}\n\nexport type NativeSelectOptionProps = React.ComponentProps<'option'>\n\nexport type NativeSelectOptGroupProps = React.ComponentProps<'optgroup'>\n\nfunction NativeSelect({ className, size = 'md', ...props }: NativeSelectProps) {\n return (\n <div\n className={cn('group/native-select relative w-fit has-[select:disabled]:opacity-50', className)}\n data-slot=\"native-select-wrapper\"\n data-size={size}\n >\n <select\n data-slot=\"native-select\"\n data-size={size}\n className={cn(\n 'border-input dark:bg-input/30 dark:hover:bg-input/50 h-8 w-full min-w-0 appearance-none rounded-lg border bg-transparent py-1 pr-8 pl-2.5 text-sm transition-colors select-none outline-none',\n 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3',\n 'aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-3 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40',\n 'placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground',\n 'data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=sm]:py-0.5',\n 'disabled:pointer-events-none disabled:cursor-not-allowed'\n )}\n {...props}\n />\n <IconSelector\n className=\"text-muted-foreground top-1/2 right-2.5 size-4 -translate-y-1/2 pointer-events-none absolute select-none\"\n aria-hidden=\"true\"\n data-slot=\"native-select-icon\"\n />\n </div>\n )\n}\n\nfunction NativeSelectOption({ ...props }: NativeSelectOptionProps) {\n return <option data-slot=\"native-select-option\" {...props} />\n}\n\nfunction NativeSelectOptGroup({ className, ...props }: NativeSelectOptGroupProps) {\n return <optgroup data-slot=\"native-select-optgroup\" className={cn(className)} {...props} />\n}\n\nexport { NativeSelect, NativeSelectOptGroup, NativeSelectOption }\n"],"mappings":"uKAcA,SAAS,aAAa,CAAE,YAAW,OAAO,KAAM,GAAG,GAA4B,CAC7E,OACE,EAAC,MAAD,CACE,UAAW,EAAG,sEAAuE,EAAU,CAC/F,YAAU,wBACV,YAAW,WAHb,CAKE,EAAC,SAAD,CACE,YAAU,gBACV,YAAW,EACX,UAAW,EACT,+LACA,4EACA,qKACA,2FACA,+FACA,2DACD,CACD,GAAI,EACJ,CAAA,CACF,EAAC,EAAD,CACE,UAAU,2GACV,cAAY,OACZ,YAAU,qBACV,CAAA,CACE,GAIV,SAAS,mBAAmB,CAAE,GAAG,GAAkC,CACjE,OAAO,EAAC,SAAD,CAAQ,YAAU,uBAAuB,GAAI,EAAS,CAAA,CAG/D,SAAS,qBAAqB,CAAE,YAAW,GAAG,GAAoC,CAChF,OAAO,EAAC,WAAD,CAAU,YAAU,yBAAyB,UAAW,EAAG,EAAU,CAAE,GAAI,EAAS,CAAA"}
1
+ {"version":3,"file":"native-select.js","names":[],"sources":["../../src/components/native-select.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { IconSelector } from '@tabler/icons-react'\n\nimport { cn } from '../lib/utils'\nimport { useFieldControlId } from './field'\n\nexport type NativeSelectProps = Omit<React.ComponentProps<'select'>, 'size'> & {\n size?: 'sm' | 'md'\n}\n\nexport type NativeSelectOptionProps = React.ComponentProps<'option'>\n\nexport type NativeSelectOptGroupProps = React.ComponentProps<'optgroup'>\n\nfunction NativeSelect({ className, id, size = 'md', ...props }: NativeSelectProps) {\n const fieldControlId = useFieldControlId(id)\n\n return (\n <div\n className={cn('group/native-select relative w-fit has-[select:disabled]:opacity-50', className)}\n data-slot=\"native-select-wrapper\"\n data-size={size}\n >\n <select\n id={fieldControlId}\n data-slot=\"native-select\"\n data-size={size}\n className={cn(\n 'border-input dark:bg-input/30 dark:hover:bg-input/50 h-8 w-full min-w-0 appearance-none rounded-lg border bg-transparent py-1 pr-8 pl-2.5 text-sm transition-colors select-none outline-none',\n 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3',\n 'aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-3 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40',\n 'placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground',\n 'data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=sm]:py-0.5',\n 'disabled:pointer-events-none disabled:cursor-not-allowed'\n )}\n {...props}\n />\n <IconSelector\n className=\"text-muted-foreground top-1/2 right-2.5 size-4 -translate-y-1/2 pointer-events-none absolute select-none\"\n aria-hidden=\"true\"\n data-slot=\"native-select-icon\"\n />\n </div>\n )\n}\n\nfunction NativeSelectOption({ ...props }: NativeSelectOptionProps) {\n return <option data-slot=\"native-select-option\" {...props} />\n}\n\nfunction NativeSelectOptGroup({ className, ...props }: NativeSelectOptGroupProps) {\n return <optgroup data-slot=\"native-select-optgroup\" className={cn(className)} {...props} />\n}\n\nexport { NativeSelect, NativeSelectOptGroup, NativeSelectOption }\n"],"mappings":"sNAeA,SAAS,aAAa,CAAE,YAAW,KAAI,OAAO,KAAM,GAAG,GAA4B,CACjF,IAAM,EAAiB,EAAkB,EAAG,CAE5C,OACE,EAAC,MAAD,CACE,UAAW,EAAG,sEAAuE,EAAU,CAC/F,YAAU,wBACV,YAAW,WAHb,CAKE,EAAC,SAAD,CACE,GAAI,EACJ,YAAU,gBACV,YAAW,EACX,UAAW,EACT,+LACA,4EACA,qKACA,2FACA,+FACA,2DACD,CACD,GAAI,EACJ,CAAA,CACF,EAAC,EAAD,CACE,UAAU,2GACV,cAAY,OACZ,YAAU,qBACV,CAAA,CACE,GAIV,SAAS,mBAAmB,CAAE,GAAG,GAAkC,CACjE,OAAO,EAAC,SAAD,CAAQ,YAAU,uBAAuB,GAAI,EAAS,CAAA,CAG/D,SAAS,qBAAqB,CAAE,YAAW,GAAG,GAAoC,CAChF,OAAO,EAAC,WAAD,CAAU,YAAU,yBAAyB,UAAW,EAAG,EAAU,CAAE,GAAI,EAAS,CAAA"}
@@ -1,2 +1,2 @@
1
- import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{selectionControlColorVariants as t}from"../lib/color.js";import{Label as n}from"./label.js";import{RadioGroup as r}from"radix-ui";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{cva as o}from"class-variance-authority";import{useId as s}from"react";const c=o([`group/radio-group-item peer relative flex aspect-square shrink-0 rounded-full border border-input outline-none`,`after:absolute after:-inset-x-3 after:-inset-y-2`,`focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`disabled:cursor-not-allowed disabled:opacity-50`,`aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20`,`aria-invalid:aria-checked:border-(--selection-control) dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,`dark:bg-input/30`,`data-checked:border-(--selection-control) data-checked:bg-(--selection-control) data-checked:text-(--selection-control-foreground)`],{variants:{color:t,size:{sm:`size-4`,md:`size-4.5`,lg:`size-5.5`}},defaultVariants:{size:`md`}}),l=o(`flex items-center justify-center`,{variants:{size:{sm:`size-4`,md:`size-4.5`,lg:`size-5.5`}},defaultVariants:{size:`md`}}),u=o(`absolute top-1/2 left-1/2 rounded-full bg-primary-foreground`,{variants:{size:{sm:`size-1.5`,md:`size-2`,lg:`size-2.5`}},defaultVariants:{size:`md`}}),d=o(``,{variants:{size:{sm:`text-xs`,md:`text-sm`,lg:`text-xl`}},defaultVariants:{size:`md`}});function RadioGroup({className:n,color:a=`primary`,...o}){return i(r.Root,{"data-slot":`radio-group`,"data-color":a,className:e(`grid w-full gap-2`,t[a],n),...o})}function RadioGroupItem({className:t,color:o,id:f,label:p,labelProps:m,size:h=`md`,...g}){let _=s(),v=p!==void 0,y=f??_,{className:b,...x}=m??{},S=i(r.Item,{"data-slot":`radio-group-item`,"data-color":o,"data-size":h,id:v?y:f,className:e(c({color:o,size:h}),t),...g,children:i(r.Indicator,{"data-slot":`radio-group-indicator`,className:e(l({size:h})),children:i(`span`,{className:e(u({size:h}),`-translate-x-1/2 -translate-y-1/2`)})})});return v?a(`div`,{"data-slot":`radio-group-item-field`,className:`flex items-center gap-2`,children:[S,i(n,{...x,htmlFor:y,className:e(d({size:h}),b),children:p})]}):S}export{RadioGroup,RadioGroupItem};
1
+ import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{selectionControlColorVariants as t}from"../lib/color.js";import{Label as n}from"./label.js";import{useFieldControlId as r}from"./field.js";import{RadioGroup as i}from"radix-ui";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{cva as s}from"class-variance-authority";import{useId as c}from"react";const l=s([`group/radio-group-item peer relative flex aspect-square shrink-0 rounded-full border border-input outline-none`,`after:absolute after:-inset-x-3 after:-inset-y-2`,`focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`disabled:cursor-not-allowed disabled:opacity-50`,`aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20`,`aria-invalid:aria-checked:border-(--selection-control) dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,`dark:bg-input/30`,`data-checked:border-(--selection-control) data-checked:bg-(--selection-control) data-checked:text-(--selection-control-foreground)`],{variants:{color:t,size:{sm:`size-4`,md:`size-4.5`,lg:`size-5.5`}},defaultVariants:{size:`md`}}),u=s(`flex items-center justify-center`,{variants:{size:{sm:`size-4`,md:`size-4.5`,lg:`size-5.5`}},defaultVariants:{size:`md`}}),d=s(`absolute top-1/2 left-1/2 rounded-full bg-primary-foreground`,{variants:{size:{sm:`size-1.5`,md:`size-2`,lg:`size-2.5`}},defaultVariants:{size:`md`}}),f=s(``,{variants:{size:{sm:`text-xs`,md:`text-sm`,lg:`text-xl`}},defaultVariants:{size:`md`}});function RadioGroup({className:n,color:r=`primary`,...o}){return a(i.Root,{"data-slot":`radio-group`,"data-color":r,className:e(`grid w-full gap-2`,t[r],n),...o})}function RadioGroupItem({className:t,color:s,id:p,label:m,labelProps:h,size:g=`md`,..._}){let v=c(),y=r(p),b=m!==void 0,x=y??(b?v:void 0),{className:S,...C}=h??{},w=a(i.Item,{"data-slot":`radio-group-item`,"data-color":s,"data-size":g,id:x,className:e(l({color:s,size:g}),t),..._,children:a(i.Indicator,{"data-slot":`radio-group-indicator`,className:e(u({size:g})),children:a(`span`,{className:e(d({size:g}),`-translate-x-1/2 -translate-y-1/2`)})})});return b?o(`div`,{"data-slot":`radio-group-item-field`,className:`flex items-center gap-2`,children:[w,a(n,{...C,htmlFor:x,className:e(f({size:g}),S),children:m})]}):w}export{RadioGroup,RadioGroupItem};
2
2
  //# sourceMappingURL=radio-group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group.js","names":["RadioGroupPrimitive","Label"],"sources":["../../src/components/radio-group.tsx"],"sourcesContent":["import type * as React from 'react'\nimport { type ReactNode, useId } from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { RadioGroup as RadioGroupPrimitive } from 'radix-ui'\n\nimport type { UIColor } from '../lib/color'\nimport { selectionControlColorVariants } from '../lib/color'\nimport { cn } from '../lib/utils'\nimport { Label, type LabelProps } from './label'\n\nexport type RadioGroupProps = React.ComponentProps<typeof RadioGroupPrimitive.Root> & {\n color?: UIColor\n}\n\nconst radioGroupItemVariants = cva(\n [\n 'group/radio-group-item peer relative flex aspect-square shrink-0 rounded-full border border-input outline-none',\n 'after:absolute after:-inset-x-3 after:-inset-y-2',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20',\n 'aria-invalid:aria-checked:border-(--selection-control) dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40',\n 'dark:bg-input/30',\n 'data-checked:border-(--selection-control) data-checked:bg-(--selection-control) data-checked:text-(--selection-control-foreground)'\n ],\n {\n variants: {\n color: selectionControlColorVariants,\n size: {\n sm: 'size-4',\n md: 'size-4.5',\n lg: 'size-5.5'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n }\n)\n\nconst radioGroupIndicatorVariants = cva('flex items-center justify-center', {\n variants: {\n size: {\n sm: 'size-4',\n md: 'size-4.5',\n lg: 'size-5.5'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n})\n\nconst radioGroupIndicatorDotVariants = cva('absolute top-1/2 left-1/2 rounded-full bg-primary-foreground', {\n variants: {\n size: {\n sm: 'size-1.5',\n md: 'size-2',\n lg: 'size-2.5'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n})\n\nconst radioGroupItemLabelVariants = cva('', {\n variants: {\n size: {\n sm: 'text-xs',\n md: 'text-sm',\n lg: 'text-xl'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n})\n\nexport type RadioGroupItemProps = React.ComponentProps<typeof RadioGroupPrimitive.Item> &\n VariantProps<typeof radioGroupItemVariants> & {\n color?: UIColor\n label?: ReactNode\n labelProps?: Omit<LabelProps, 'children' | 'htmlFor'>\n }\n\nfunction RadioGroup({ className, color = 'primary', ...props }: RadioGroupProps) {\n return (\n <RadioGroupPrimitive.Root\n data-slot=\"radio-group\"\n data-color={color}\n className={cn('grid w-full gap-2', selectionControlColorVariants[color], className)}\n {...props}\n />\n )\n}\n\nfunction RadioGroupItem({ className, color, id, label, labelProps, size = 'md', ...props }: RadioGroupItemProps) {\n const generatedId = useId()\n const hasLabel = label !== undefined\n const resolvedId = id ?? generatedId\n const { className: labelClassName, ...labelRootProps } = labelProps ?? {}\n\n const item = (\n <RadioGroupPrimitive.Item\n data-slot=\"radio-group-item\"\n data-color={color}\n data-size={size}\n id={hasLabel ? resolvedId : id}\n className={cn(radioGroupItemVariants({ color, size }), className)}\n {...props}\n >\n <RadioGroupPrimitive.Indicator\n data-slot=\"radio-group-indicator\"\n className={cn(radioGroupIndicatorVariants({ size }))}\n >\n <span className={cn(radioGroupIndicatorDotVariants({ size }), '-translate-x-1/2 -translate-y-1/2')} />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n )\n\n if (!hasLabel) {\n return item\n }\n\n return (\n <div data-slot=\"radio-group-item-field\" className=\"flex items-center gap-2\">\n {item}\n <Label\n {...labelRootProps}\n htmlFor={resolvedId}\n className={cn(radioGroupItemLabelVariants({ size }), labelClassName)}\n >\n {label}\n </Label>\n </div>\n )\n}\n\nexport { RadioGroup, RadioGroupItem }\n"],"mappings":"0UAeA,MAAM,EAAyB,EAC7B,CACE,iHACA,mDACA,4EACA,kDACA,uFACA,uIACA,mBACA,qIACD,CACD,CACE,SAAU,CACR,MAAO,EACP,KAAM,CACJ,GAAI,SACJ,GAAI,WACJ,GAAI,WACL,CACF,CACD,gBAAiB,CACf,KAAM,KACP,CACF,CACF,CAEK,EAA8B,EAAI,mCAAoC,CAC1E,SAAU,CACR,KAAM,CACJ,GAAI,SACJ,GAAI,WACJ,GAAI,WACL,CACF,CACD,gBAAiB,CACf,KAAM,KACP,CACF,CAAC,CAEI,EAAiC,EAAI,+DAAgE,CACzG,SAAU,CACR,KAAM,CACJ,GAAI,WACJ,GAAI,SACJ,GAAI,WACL,CACF,CACD,gBAAiB,CACf,KAAM,KACP,CACF,CAAC,CAEI,EAA8B,EAAI,GAAI,CAC1C,SAAU,CACR,KAAM,CACJ,GAAI,UACJ,GAAI,UACJ,GAAI,UACL,CACF,CACD,gBAAiB,CACf,KAAM,KACP,CACF,CAAC,CASF,SAAS,WAAW,CAAE,YAAW,QAAQ,UAAW,GAAG,GAA0B,CAC/E,OACE,EAACA,EAAoB,KAArB,CACE,YAAU,cACV,aAAY,EACZ,UAAW,EAAG,oBAAqB,EAA8B,GAAQ,EAAU,CACnF,GAAI,EACJ,CAAA,CAIN,SAAS,eAAe,CAAE,YAAW,QAAO,KAAI,QAAO,aAAY,OAAO,KAAM,GAAG,GAA8B,CAC/G,IAAM,EAAc,GAAO,CACrB,EAAW,IAAU,IAAA,GACrB,EAAa,GAAM,EACnB,CAAE,UAAW,EAAgB,GAAG,GAAmB,GAAc,EAAE,CAEnE,EACJ,EAACA,EAAoB,KAArB,CACE,YAAU,mBACV,aAAY,EACZ,YAAW,EACX,GAAI,EAAW,EAAa,EAC5B,UAAW,EAAG,EAAuB,CAAE,QAAO,OAAM,CAAC,CAAE,EAAU,CACjE,GAAI,WAEJ,EAACA,EAAoB,UAArB,CACE,YAAU,wBACV,UAAW,EAAG,EAA4B,CAAE,OAAM,CAAC,CAAC,UAEpD,EAAC,OAAD,CAAM,UAAW,EAAG,EAA+B,CAAE,OAAM,CAAC,CAAE,oCAAoC,CAAI,CAAA,CACxE,CAAA,CACP,CAAA,CAO7B,OAJK,EAKH,EAAC,MAAD,CAAK,YAAU,yBAAyB,UAAU,mCAAlD,CACG,EACD,EAACC,EAAD,CACE,GAAI,EACJ,QAAS,EACT,UAAW,EAAG,EAA4B,CAAE,OAAM,CAAC,CAAE,EAAe,UAEnE,EACK,CAAA,CACJ,GAbC"}
1
+ {"version":3,"file":"radio-group.js","names":["RadioGroupPrimitive","Label"],"sources":["../../src/components/radio-group.tsx"],"sourcesContent":["import type * as React from 'react'\nimport { type ReactNode, useId } from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { RadioGroup as RadioGroupPrimitive } from 'radix-ui'\n\nimport type { UIColor } from '../lib/color'\nimport { selectionControlColorVariants } from '../lib/color'\nimport { cn } from '../lib/utils'\nimport { useFieldControlId } from './field'\nimport { Label, type LabelProps } from './label'\n\nexport type RadioGroupProps = React.ComponentProps<typeof RadioGroupPrimitive.Root> & {\n color?: UIColor\n}\n\nconst radioGroupItemVariants = cva(\n [\n 'group/radio-group-item peer relative flex aspect-square shrink-0 rounded-full border border-input outline-none',\n 'after:absolute after:-inset-x-3 after:-inset-y-2',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20',\n 'aria-invalid:aria-checked:border-(--selection-control) dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40',\n 'dark:bg-input/30',\n 'data-checked:border-(--selection-control) data-checked:bg-(--selection-control) data-checked:text-(--selection-control-foreground)'\n ],\n {\n variants: {\n color: selectionControlColorVariants,\n size: {\n sm: 'size-4',\n md: 'size-4.5',\n lg: 'size-5.5'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n }\n)\n\nconst radioGroupIndicatorVariants = cva('flex items-center justify-center', {\n variants: {\n size: {\n sm: 'size-4',\n md: 'size-4.5',\n lg: 'size-5.5'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n})\n\nconst radioGroupIndicatorDotVariants = cva('absolute top-1/2 left-1/2 rounded-full bg-primary-foreground', {\n variants: {\n size: {\n sm: 'size-1.5',\n md: 'size-2',\n lg: 'size-2.5'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n})\n\nconst radioGroupItemLabelVariants = cva('', {\n variants: {\n size: {\n sm: 'text-xs',\n md: 'text-sm',\n lg: 'text-xl'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n})\n\nexport type RadioGroupItemProps = React.ComponentProps<typeof RadioGroupPrimitive.Item> &\n VariantProps<typeof radioGroupItemVariants> & {\n color?: UIColor\n label?: ReactNode\n labelProps?: Omit<LabelProps, 'children' | 'htmlFor'>\n }\n\nfunction RadioGroup({ className, color = 'primary', ...props }: RadioGroupProps) {\n return (\n <RadioGroupPrimitive.Root\n data-slot=\"radio-group\"\n data-color={color}\n className={cn('grid w-full gap-2', selectionControlColorVariants[color], className)}\n {...props}\n />\n )\n}\n\nfunction RadioGroupItem({ className, color, id, label, labelProps, size = 'md', ...props }: RadioGroupItemProps) {\n const generatedId = useId()\n const fieldControlId = useFieldControlId(id)\n const hasLabel = label !== undefined\n const resolvedId = fieldControlId ?? (hasLabel ? generatedId : undefined)\n const { className: labelClassName, ...labelRootProps } = labelProps ?? {}\n\n const item = (\n <RadioGroupPrimitive.Item\n data-slot=\"radio-group-item\"\n data-color={color}\n data-size={size}\n id={resolvedId}\n className={cn(radioGroupItemVariants({ color, size }), className)}\n {...props}\n >\n <RadioGroupPrimitive.Indicator\n data-slot=\"radio-group-indicator\"\n className={cn(radioGroupIndicatorVariants({ size }))}\n >\n <span className={cn(radioGroupIndicatorDotVariants({ size }), '-translate-x-1/2 -translate-y-1/2')} />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n )\n\n if (!hasLabel) {\n return item\n }\n\n return (\n <div data-slot=\"radio-group-item-field\" className=\"flex items-center gap-2\">\n {item}\n <Label\n {...labelRootProps}\n htmlFor={resolvedId}\n className={cn(radioGroupItemLabelVariants({ size }), labelClassName)}\n >\n {label}\n </Label>\n </div>\n )\n}\n\nexport { RadioGroup, RadioGroupItem }\n"],"mappings":"yXAgBA,MAAM,EAAyB,EAC7B,CACE,iHACA,mDACA,4EACA,kDACA,uFACA,uIACA,mBACA,qIACD,CACD,CACE,SAAU,CACR,MAAO,EACP,KAAM,CACJ,GAAI,SACJ,GAAI,WACJ,GAAI,WACL,CACF,CACD,gBAAiB,CACf,KAAM,KACP,CACF,CACF,CAEK,EAA8B,EAAI,mCAAoC,CAC1E,SAAU,CACR,KAAM,CACJ,GAAI,SACJ,GAAI,WACJ,GAAI,WACL,CACF,CACD,gBAAiB,CACf,KAAM,KACP,CACF,CAAC,CAEI,EAAiC,EAAI,+DAAgE,CACzG,SAAU,CACR,KAAM,CACJ,GAAI,WACJ,GAAI,SACJ,GAAI,WACL,CACF,CACD,gBAAiB,CACf,KAAM,KACP,CACF,CAAC,CAEI,EAA8B,EAAI,GAAI,CAC1C,SAAU,CACR,KAAM,CACJ,GAAI,UACJ,GAAI,UACJ,GAAI,UACL,CACF,CACD,gBAAiB,CACf,KAAM,KACP,CACF,CAAC,CASF,SAAS,WAAW,CAAE,YAAW,QAAQ,UAAW,GAAG,GAA0B,CAC/E,OACE,EAACA,EAAoB,KAArB,CACE,YAAU,cACV,aAAY,EACZ,UAAW,EAAG,oBAAqB,EAA8B,GAAQ,EAAU,CACnF,GAAI,EACJ,CAAA,CAIN,SAAS,eAAe,CAAE,YAAW,QAAO,KAAI,QAAO,aAAY,OAAO,KAAM,GAAG,GAA8B,CAC/G,IAAM,EAAc,GAAO,CACrB,EAAiB,EAAkB,EAAG,CACtC,EAAW,IAAU,IAAA,GACrB,EAAa,IAAmB,EAAW,EAAc,IAAA,IACzD,CAAE,UAAW,EAAgB,GAAG,GAAmB,GAAc,EAAE,CAEnE,EACJ,EAACA,EAAoB,KAArB,CACE,YAAU,mBACV,aAAY,EACZ,YAAW,EACX,GAAI,EACJ,UAAW,EAAG,EAAuB,CAAE,QAAO,OAAM,CAAC,CAAE,EAAU,CACjE,GAAI,WAEJ,EAACA,EAAoB,UAArB,CACE,YAAU,wBACV,UAAW,EAAG,EAA4B,CAAE,OAAM,CAAC,CAAC,UAEpD,EAAC,OAAD,CAAM,UAAW,EAAG,EAA+B,CAAE,OAAM,CAAC,CAAE,oCAAoC,CAAI,CAAA,CACxE,CAAA,CACP,CAAA,CAO7B,OAJK,EAKH,EAAC,MAAD,CAAK,YAAU,yBAAyB,UAAU,mCAAlD,CACG,EACD,EAACC,EAAD,CACE,GAAI,EACJ,QAAS,EACT,UAAW,EAAG,EAA4B,CAAE,OAAM,CAAC,CAAE,EAAe,UAEnE,EACK,CAAA,CACJ,GAbC"}
@@ -28,6 +28,7 @@ declare function SelectValue({
28
28
  }: SelectValueProps): _$react_jsx_runtime0.JSX.Element;
29
29
  declare function SelectTrigger({
30
30
  className,
31
+ id,
31
32
  size,
32
33
  children,
33
34
  ...props
@@ -1,2 +1,2 @@
1
- import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{IconCheck as t,IconChevronDown as n,IconChevronUp as r,IconSelector as i}from"@tabler/icons-react";import{Select as a}from"radix-ui";import{jsx as o,jsxs as s}from"react/jsx-runtime";function Select({...e}){return o(a.Root,{"data-slot":`select`,...e})}function SelectGroup({className:t,...n}){return o(a.Group,{"data-slot":`select-group`,className:e(`scroll-my-1 p-1`,t),...n})}function SelectValue({...e}){return o(a.Value,{"data-slot":`select-value`,...e})}function SelectTrigger({className:t,size:n=`md`,children:r,...c}){return s(a.Trigger,{"data-slot":`select-trigger`,"data-size":n,className:e(`border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-1.5 whitespace-nowrap rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm transition-colors select-none outline-none`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-3 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,`data-[size=md]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)]`,`*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5`,`[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`disabled:cursor-not-allowed disabled:opacity-50`,t),...c,children:[r,o(a.Icon,{asChild:!0,children:o(i,{className:`text-muted-foreground size-4 pointer-events-none`})})]})}function SelectContent({className:t,children:n,position:r=`item-aligned`,align:i=`center`,...c}){return o(a.Portal,{children:s(a.Content,{"data-slot":`select-content`,"data-align-trigger":r===`item-aligned`,className:e(`bg-popover text-popover-foreground ring-foreground/10 relative z-50 min-w-36 max-h-(--radix-select-content-available-height) rounded-lg shadow-md ring-1 duration-100 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto`,`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95`,`data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,`data-[align-trigger=true]:animate-none`,r===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,t),position:r,align:i,...c,children:[o(SelectScrollUpButton,{}),o(a.Viewport,{"data-position":r,className:e(`data-[position=popper]:h-(--radix-select-trigger-height)`,`data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)`),children:n}),o(SelectScrollDownButton,{})]})})}function SelectLabel({className:t,...n}){return o(a.Label,{"data-slot":`select-label`,className:e(`text-muted-foreground px-1.5 py-1 text-xs`,t),...n})}function SelectItem({className:n,children:r,...i}){return s(a.Item,{"data-slot":`select-item`,className:e(`focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground`,`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none`,`*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,`[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`data-disabled:pointer-events-none data-disabled:opacity-50`,n),...i,children:[o(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`,children:o(a.ItemIndicator,{children:o(t,{className:`pointer-events-none`})})}),o(a.ItemText,{children:r})]})}function SelectSeparator({className:t,...n}){return o(a.Separator,{"data-slot":`select-separator`,className:e(`bg-border -mx-1 my-1 h-px pointer-events-none`,t),...n})}function SelectScrollUpButton({className:t,...n}){return o(a.ScrollUpButton,{"data-slot":`select-scroll-up-button`,className:e(`bg-popover z-10 flex cursor-default items-center justify-center py-1`,`[&_svg:not([class*='size-'])]:size-4`,t),...n,children:o(r,{})})}function SelectScrollDownButton({className:t,...r}){return o(a.ScrollDownButton,{"data-slot":`select-scroll-down-button`,className:e(`bg-popover z-10 flex cursor-default items-center justify-center py-1`,`[&_svg:not([class*='size-'])]:size-4`,t),...r,children:o(n,{})})}export{Select,SelectContent,SelectGroup,SelectItem,SelectLabel,SelectScrollDownButton,SelectScrollUpButton,SelectSeparator,SelectTrigger,SelectValue};
1
+ import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{useFieldControlId as t}from"./field.js";import{IconCheck as n,IconChevronDown as r,IconChevronUp as i,IconSelector as a}from"@tabler/icons-react";import{Select as o}from"radix-ui";import{jsx as s,jsxs as c}from"react/jsx-runtime";function Select({...e}){return s(o.Root,{"data-slot":`select`,...e})}function SelectGroup({className:t,...n}){return s(o.Group,{"data-slot":`select-group`,className:e(`scroll-my-1 p-1`,t),...n})}function SelectValue({...e}){return s(o.Value,{"data-slot":`select-value`,...e})}function SelectTrigger({className:n,id:r,size:i=`md`,children:l,...u}){let d=t(r);return c(o.Trigger,{id:d,"data-slot":`select-trigger`,"data-size":i,className:e(`border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-1.5 whitespace-nowrap rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm transition-colors select-none outline-none`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-3 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,`data-[size=md]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)]`,`*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5`,`[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`disabled:cursor-not-allowed disabled:opacity-50`,n),...u,children:[l,s(o.Icon,{asChild:!0,children:s(a,{className:`text-muted-foreground size-4 pointer-events-none`})})]})}function SelectContent({className:t,children:n,position:r=`item-aligned`,align:i=`center`,...a}){return s(o.Portal,{children:c(o.Content,{"data-slot":`select-content`,"data-align-trigger":r===`item-aligned`,className:e(`bg-popover text-popover-foreground ring-foreground/10 relative z-50 min-w-36 max-h-(--radix-select-content-available-height) rounded-lg shadow-md ring-1 duration-100 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto`,`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95`,`data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,`data-[align-trigger=true]:animate-none`,r===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,t),position:r,align:i,...a,children:[s(SelectScrollUpButton,{}),s(o.Viewport,{"data-position":r,className:e(`data-[position=popper]:h-(--radix-select-trigger-height)`,`data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)`),children:n}),s(SelectScrollDownButton,{})]})})}function SelectLabel({className:t,...n}){return s(o.Label,{"data-slot":`select-label`,className:e(`text-muted-foreground px-1.5 py-1 text-xs`,t),...n})}function SelectItem({className:t,children:r,...i}){return c(o.Item,{"data-slot":`select-item`,className:e(`focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground`,`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none`,`*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,`[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`data-disabled:pointer-events-none data-disabled:opacity-50`,t),...i,children:[s(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`,children:s(o.ItemIndicator,{children:s(n,{className:`pointer-events-none`})})}),s(o.ItemText,{children:r})]})}function SelectSeparator({className:t,...n}){return s(o.Separator,{"data-slot":`select-separator`,className:e(`bg-border -mx-1 my-1 h-px pointer-events-none`,t),...n})}function SelectScrollUpButton({className:t,...n}){return s(o.ScrollUpButton,{"data-slot":`select-scroll-up-button`,className:e(`bg-popover z-10 flex cursor-default items-center justify-center py-1`,`[&_svg:not([class*='size-'])]:size-4`,t),...n,children:s(i,{})})}function SelectScrollDownButton({className:t,...n}){return s(o.ScrollDownButton,{"data-slot":`select-scroll-down-button`,className:e(`bg-popover z-10 flex cursor-default items-center justify-center py-1`,`[&_svg:not([class*='size-'])]:size-4`,t),...n,children:s(r,{})})}export{Select,SelectContent,SelectGroup,SelectItem,SelectLabel,SelectScrollDownButton,SelectScrollUpButton,SelectSeparator,SelectTrigger,SelectValue};
2
2
  //# sourceMappingURL=select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","names":["SelectPrimitive"],"sources":["../../src/components/select.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { IconCheck, IconChevronDown, IconChevronUp, IconSelector } from '@tabler/icons-react'\nimport { Select as SelectPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nexport type SelectProps = React.ComponentProps<typeof SelectPrimitive.Root>\n\nexport type SelectGroupProps = React.ComponentProps<typeof SelectPrimitive.Group>\n\nexport type SelectValueProps = React.ComponentProps<typeof SelectPrimitive.Value>\n\nexport type SelectTriggerProps = React.ComponentProps<typeof SelectPrimitive.Trigger> & {\n size?: 'sm' | 'md'\n}\n\nexport type SelectContentProps = React.ComponentProps<typeof SelectPrimitive.Content>\n\nexport type SelectLabelProps = React.ComponentProps<typeof SelectPrimitive.Label>\n\nexport type SelectItemProps = React.ComponentProps<typeof SelectPrimitive.Item>\n\nexport type SelectSeparatorProps = React.ComponentProps<typeof SelectPrimitive.Separator>\n\nexport type SelectScrollUpButtonProps = React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>\n\nexport type SelectScrollDownButtonProps = React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>\n\nfunction Select({ ...props }: SelectProps) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />\n}\n\nfunction SelectGroup({ className, ...props }: SelectGroupProps) {\n return <SelectPrimitive.Group data-slot=\"select-group\" className={cn('scroll-my-1 p-1', className)} {...props} />\n}\n\nfunction SelectValue({ ...props }: SelectValueProps) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />\n}\n\nfunction SelectTrigger({ className, size = 'md', children, ...props }: SelectTriggerProps) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n 'border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-1.5 whitespace-nowrap rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm transition-colors select-none outline-none',\n 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3',\n 'aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-3 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40',\n 'data-[size=md]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)]',\n '*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5',\n \"[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n 'disabled:cursor-not-allowed disabled:opacity-50',\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <IconSelector className=\"text-muted-foreground size-4 pointer-events-none\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n}\n\nfunction SelectContent({\n className,\n children,\n position = 'item-aligned',\n align = 'center',\n ...props\n}: SelectContentProps) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n data-align-trigger={position === 'item-aligned'}\n className={cn(\n 'bg-popover text-popover-foreground ring-foreground/10 relative z-50 min-w-36 max-h-(--radix-select-content-available-height) rounded-lg shadow-md ring-1 duration-100 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n 'data-[align-trigger=true]:animate-none',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className\n )}\n position={position}\n align={align}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n data-position={position}\n className={cn(\n 'data-[position=popper]:h-(--radix-select-trigger-height)',\n 'data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)'\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n )\n}\n\nfunction SelectLabel({ className, ...props }: SelectLabelProps) {\n return (\n <SelectPrimitive.Label\n data-slot=\"select-label\"\n className={cn('text-muted-foreground px-1.5 py-1 text-xs', className)}\n {...props}\n />\n )\n}\n\nfunction SelectItem({ className, children, ...props }: SelectItemProps) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground',\n 'relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none',\n '*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2',\n \"[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <IconCheck className=\"pointer-events-none\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n )\n}\n\nfunction SelectSeparator({ className, ...props }: SelectSeparatorProps) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn('bg-border -mx-1 my-1 h-px pointer-events-none', className)}\n {...props}\n />\n )\n}\n\nfunction SelectScrollUpButton({ className, ...props }: SelectScrollUpButtonProps) {\n return (\n <SelectPrimitive.ScrollUpButton\n data-slot=\"select-scroll-up-button\"\n className={cn(\n 'bg-popover z-10 flex cursor-default items-center justify-center py-1',\n \"[&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <IconChevronUp />\n </SelectPrimitive.ScrollUpButton>\n )\n}\n\nfunction SelectScrollDownButton({ className, ...props }: SelectScrollDownButtonProps) {\n return (\n <SelectPrimitive.ScrollDownButton\n data-slot=\"select-scroll-down-button\"\n className={cn(\n 'bg-popover z-10 flex cursor-default items-center justify-center py-1',\n \"[&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <IconChevronDown />\n </SelectPrimitive.ScrollDownButton>\n )\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue\n}\n"],"mappings":"gQA6BA,SAAS,OAAO,CAAE,GAAG,GAAsB,CACzC,OAAO,EAACA,EAAgB,KAAjB,CAAsB,YAAU,SAAS,GAAI,EAAS,CAAA,CAG/D,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OAAO,EAACA,EAAgB,MAAjB,CAAuB,YAAU,eAAe,UAAW,EAAG,kBAAmB,EAAU,CAAE,GAAI,EAAS,CAAA,CAGnH,SAAS,YAAY,CAAE,GAAG,GAA2B,CACnD,OAAO,EAACA,EAAgB,MAAjB,CAAuB,YAAU,eAAe,GAAI,EAAS,CAAA,CAGtE,SAAS,cAAc,CAAE,YAAW,OAAO,KAAM,WAAU,GAAG,GAA6B,CACzF,OACE,EAACA,EAAgB,QAAjB,CACE,YAAU,iBACV,YAAW,EACX,UAAW,EACT,qQACA,4EACA,qKACA,4FACA,qJACA,oFACA,kDACA,EACD,CACD,GAAI,WAbN,CAeG,EACD,EAACA,EAAgB,KAAjB,CAAsB,QAAA,YACpB,EAAC,EAAD,CAAc,UAAU,mDAAqD,CAAA,CACxD,CAAA,CACC,GAI9B,SAAS,cAAc,CACrB,YACA,WACA,WAAW,eACX,QAAQ,SACR,GAAG,GACkB,CACrB,OACE,EAACA,EAAgB,OAAjB,CAAA,SACE,EAACA,EAAgB,QAAjB,CACE,YAAU,iBACV,qBAAoB,IAAa,eACjC,UAAW,EACT,2PACA,uIACA,8JACA,yCACA,IAAa,UACX,kIACF,EACD,CACS,WACH,QACP,GAAI,WAdN,CAgBE,EAAC,qBAAD,EAAwB,CAAA,CACxB,EAACA,EAAgB,SAAjB,CACE,gBAAe,EACf,UAAW,EACT,2DACA,4FACD,CAEA,WACwB,CAAA,CAC3B,EAAC,uBAAD,EAA0B,CAAA,CACF,GACH,CAAA,CAI7B,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OACE,EAACA,EAAgB,MAAjB,CACE,YAAU,eACV,UAAW,EAAG,4CAA6C,EAAU,CACrE,GAAI,EACJ,CAAA,CAIN,SAAS,WAAW,CAAE,YAAW,WAAU,GAAG,GAA0B,CACtE,OACE,EAACA,EAAgB,KAAjB,CACE,YAAU,cACV,UAAW,EACT,8GACA,0HACA,oEACA,oFACA,6DACA,EACD,CACD,GAAI,WAVN,CAYE,EAAC,OAAD,CAAM,UAAU,wFACd,EAACA,EAAgB,cAAjB,CAAA,SACE,EAAC,EAAD,CAAW,UAAU,sBAAwB,CAAA,CACf,CAAA,CAC3B,CAAA,CACP,EAACA,EAAgB,SAAjB,CAA2B,WAAoC,CAAA,CAC1C,GAI3B,SAAS,gBAAgB,CAAE,YAAW,GAAG,GAA+B,CACtE,OACE,EAACA,EAAgB,UAAjB,CACE,YAAU,mBACV,UAAW,EAAG,gDAAiD,EAAU,CACzE,GAAI,EACJ,CAAA,CAIN,SAAS,qBAAqB,CAAE,YAAW,GAAG,GAAoC,CAChF,OACE,EAACA,EAAgB,eAAjB,CACE,YAAU,0BACV,UAAW,EACT,uEACA,uCACA,EACD,CACD,GAAI,WAEJ,EAAC,EAAD,EAAiB,CAAA,CACc,CAAA,CAIrC,SAAS,uBAAuB,CAAE,YAAW,GAAG,GAAsC,CACpF,OACE,EAACA,EAAgB,iBAAjB,CACE,YAAU,4BACV,UAAW,EACT,uEACA,uCACA,EACD,CACD,GAAI,WAEJ,EAAC,EAAD,EAAmB,CAAA,CACc,CAAA"}
1
+ {"version":3,"file":"select.js","names":["SelectPrimitive"],"sources":["../../src/components/select.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { IconCheck, IconChevronDown, IconChevronUp, IconSelector } from '@tabler/icons-react'\nimport { Select as SelectPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\nimport { useFieldControlId } from './field'\n\nexport type SelectProps = React.ComponentProps<typeof SelectPrimitive.Root>\n\nexport type SelectGroupProps = React.ComponentProps<typeof SelectPrimitive.Group>\n\nexport type SelectValueProps = React.ComponentProps<typeof SelectPrimitive.Value>\n\nexport type SelectTriggerProps = React.ComponentProps<typeof SelectPrimitive.Trigger> & {\n size?: 'sm' | 'md'\n}\n\nexport type SelectContentProps = React.ComponentProps<typeof SelectPrimitive.Content>\n\nexport type SelectLabelProps = React.ComponentProps<typeof SelectPrimitive.Label>\n\nexport type SelectItemProps = React.ComponentProps<typeof SelectPrimitive.Item>\n\nexport type SelectSeparatorProps = React.ComponentProps<typeof SelectPrimitive.Separator>\n\nexport type SelectScrollUpButtonProps = React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>\n\nexport type SelectScrollDownButtonProps = React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>\n\nfunction Select({ ...props }: SelectProps) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />\n}\n\nfunction SelectGroup({ className, ...props }: SelectGroupProps) {\n return <SelectPrimitive.Group data-slot=\"select-group\" className={cn('scroll-my-1 p-1', className)} {...props} />\n}\n\nfunction SelectValue({ ...props }: SelectValueProps) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />\n}\n\nfunction SelectTrigger({ className, id, size = 'md', children, ...props }: SelectTriggerProps) {\n const fieldControlId = useFieldControlId(id)\n\n return (\n <SelectPrimitive.Trigger\n id={fieldControlId}\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n 'border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-1.5 whitespace-nowrap rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm transition-colors select-none outline-none',\n 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3',\n 'aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-3 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40',\n 'data-[size=md]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)]',\n '*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5',\n \"[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n 'disabled:cursor-not-allowed disabled:opacity-50',\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <IconSelector className=\"text-muted-foreground size-4 pointer-events-none\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n}\n\nfunction SelectContent({\n className,\n children,\n position = 'item-aligned',\n align = 'center',\n ...props\n}: SelectContentProps) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n data-align-trigger={position === 'item-aligned'}\n className={cn(\n 'bg-popover text-popover-foreground ring-foreground/10 relative z-50 min-w-36 max-h-(--radix-select-content-available-height) rounded-lg shadow-md ring-1 duration-100 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n 'data-[align-trigger=true]:animate-none',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className\n )}\n position={position}\n align={align}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n data-position={position}\n className={cn(\n 'data-[position=popper]:h-(--radix-select-trigger-height)',\n 'data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)'\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n )\n}\n\nfunction SelectLabel({ className, ...props }: SelectLabelProps) {\n return (\n <SelectPrimitive.Label\n data-slot=\"select-label\"\n className={cn('text-muted-foreground px-1.5 py-1 text-xs', className)}\n {...props}\n />\n )\n}\n\nfunction SelectItem({ className, children, ...props }: SelectItemProps) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground',\n 'relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none',\n '*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2',\n \"[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <IconCheck className=\"pointer-events-none\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n )\n}\n\nfunction SelectSeparator({ className, ...props }: SelectSeparatorProps) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn('bg-border -mx-1 my-1 h-px pointer-events-none', className)}\n {...props}\n />\n )\n}\n\nfunction SelectScrollUpButton({ className, ...props }: SelectScrollUpButtonProps) {\n return (\n <SelectPrimitive.ScrollUpButton\n data-slot=\"select-scroll-up-button\"\n className={cn(\n 'bg-popover z-10 flex cursor-default items-center justify-center py-1',\n \"[&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <IconChevronUp />\n </SelectPrimitive.ScrollUpButton>\n )\n}\n\nfunction SelectScrollDownButton({ className, ...props }: SelectScrollDownButtonProps) {\n return (\n <SelectPrimitive.ScrollDownButton\n data-slot=\"select-scroll-down-button\"\n className={cn(\n 'bg-popover z-10 flex cursor-default items-center justify-center py-1',\n \"[&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <IconChevronDown />\n </SelectPrimitive.ScrollDownButton>\n )\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue\n}\n"],"mappings":"+SA8BA,SAAS,OAAO,CAAE,GAAG,GAAsB,CACzC,OAAO,EAACA,EAAgB,KAAjB,CAAsB,YAAU,SAAS,GAAI,EAAS,CAAA,CAG/D,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OAAO,EAACA,EAAgB,MAAjB,CAAuB,YAAU,eAAe,UAAW,EAAG,kBAAmB,EAAU,CAAE,GAAI,EAAS,CAAA,CAGnH,SAAS,YAAY,CAAE,GAAG,GAA2B,CACnD,OAAO,EAACA,EAAgB,MAAjB,CAAuB,YAAU,eAAe,GAAI,EAAS,CAAA,CAGtE,SAAS,cAAc,CAAE,YAAW,KAAI,OAAO,KAAM,WAAU,GAAG,GAA6B,CAC7F,IAAM,EAAiB,EAAkB,EAAG,CAE5C,OACE,EAACA,EAAgB,QAAjB,CACE,GAAI,EACJ,YAAU,iBACV,YAAW,EACX,UAAW,EACT,qQACA,4EACA,qKACA,4FACA,qJACA,oFACA,kDACA,EACD,CACD,GAAI,WAdN,CAgBG,EACD,EAACA,EAAgB,KAAjB,CAAsB,QAAA,YACpB,EAAC,EAAD,CAAc,UAAU,mDAAqD,CAAA,CACxD,CAAA,CACC,GAI9B,SAAS,cAAc,CACrB,YACA,WACA,WAAW,eACX,QAAQ,SACR,GAAG,GACkB,CACrB,OACE,EAACA,EAAgB,OAAjB,CAAA,SACE,EAACA,EAAgB,QAAjB,CACE,YAAU,iBACV,qBAAoB,IAAa,eACjC,UAAW,EACT,2PACA,uIACA,8JACA,yCACA,IAAa,UACX,kIACF,EACD,CACS,WACH,QACP,GAAI,WAdN,CAgBE,EAAC,qBAAD,EAAwB,CAAA,CACxB,EAACA,EAAgB,SAAjB,CACE,gBAAe,EACf,UAAW,EACT,2DACA,4FACD,CAEA,WACwB,CAAA,CAC3B,EAAC,uBAAD,EAA0B,CAAA,CACF,GACH,CAAA,CAI7B,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OACE,EAACA,EAAgB,MAAjB,CACE,YAAU,eACV,UAAW,EAAG,4CAA6C,EAAU,CACrE,GAAI,EACJ,CAAA,CAIN,SAAS,WAAW,CAAE,YAAW,WAAU,GAAG,GAA0B,CACtE,OACE,EAACA,EAAgB,KAAjB,CACE,YAAU,cACV,UAAW,EACT,8GACA,0HACA,oEACA,oFACA,6DACA,EACD,CACD,GAAI,WAVN,CAYE,EAAC,OAAD,CAAM,UAAU,wFACd,EAACA,EAAgB,cAAjB,CAAA,SACE,EAAC,EAAD,CAAW,UAAU,sBAAwB,CAAA,CACf,CAAA,CAC3B,CAAA,CACP,EAACA,EAAgB,SAAjB,CAA2B,WAAoC,CAAA,CAC1C,GAI3B,SAAS,gBAAgB,CAAE,YAAW,GAAG,GAA+B,CACtE,OACE,EAACA,EAAgB,UAAjB,CACE,YAAU,mBACV,UAAW,EAAG,gDAAiD,EAAU,CACzE,GAAI,EACJ,CAAA,CAIN,SAAS,qBAAqB,CAAE,YAAW,GAAG,GAAoC,CAChF,OACE,EAACA,EAAgB,eAAjB,CACE,YAAU,0BACV,UAAW,EACT,uEACA,uCACA,EACD,CACD,GAAI,WAEJ,EAAC,EAAD,EAAiB,CAAA,CACc,CAAA,CAIrC,SAAS,uBAAuB,CAAE,YAAW,GAAG,GAAsC,CACpF,OACE,EAACA,EAAgB,iBAAjB,CACE,YAAU,4BACV,UAAW,EACT,uEACA,uCACA,EACD,CACD,GAAI,WAEJ,EAAC,EAAD,EAAmB,CAAA,CACc,CAAA"}