react-shadcn-kit 0.2.1 → 0.2.3

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 (206) hide show
  1. package/dist/assets/global.css +1 -1
  2. package/dist/components/composites/ComponentSearch.js +1 -0
  3. package/dist/components/composites/ComponentSearch.js.map +1 -1
  4. package/dist/components/composites/action-button.js +1 -0
  5. package/dist/components/composites/action-button.js.map +1 -1
  6. package/dist/components/composites/theme-toggle.js +1 -0
  7. package/dist/components/composites/theme-toggle.js.map +1 -1
  8. package/dist/components/composites/user-menu.js +1 -0
  9. package/dist/components/composites/user-menu.js.map +1 -1
  10. package/dist/components/data-table/data-table-column-header.js +37 -0
  11. package/dist/components/data-table/data-table-column-header.js.map +1 -0
  12. package/dist/components/data-table/data-table-faceted-filter.js +87 -0
  13. package/dist/components/data-table/data-table-faceted-filter.js.map +1 -0
  14. package/dist/components/data-table/data-table-pagination.js +97 -0
  15. package/dist/components/data-table/data-table-pagination.js.map +1 -0
  16. package/dist/components/data-table/data-table-toolbar.js +65 -0
  17. package/dist/components/data-table/data-table-toolbar.js.map +1 -0
  18. package/dist/components/data-table/data-table-view-options.js +32 -0
  19. package/dist/components/data-table/data-table-view-options.js.map +1 -0
  20. package/dist/components/data-table/data-table.js +143 -0
  21. package/dist/components/data-table/data-table.js.map +1 -0
  22. package/dist/components/kanban/kanban.js +293 -0
  23. package/dist/components/kanban/kanban.js.map +1 -0
  24. package/dist/components/marketing/hero.js +1 -0
  25. package/dist/components/marketing/hero.js.map +1 -1
  26. package/dist/components/marketing/social-proof.js +1 -0
  27. package/dist/components/marketing/social-proof.js.map +1 -1
  28. package/dist/components/marketing/value-props.js +1 -0
  29. package/dist/components/marketing/value-props.js.map +1 -1
  30. package/dist/components/primitives/aspect-ratio.js +1 -0
  31. package/dist/components/primitives/aspect-ratio.js.map +1 -1
  32. package/dist/components/primitives/badge.js +1 -0
  33. package/dist/components/primitives/badge.js.map +1 -1
  34. package/dist/components/primitives/button-group.js +1 -0
  35. package/dist/components/primitives/button-group.js.map +1 -1
  36. package/dist/components/primitives/button.js +1 -0
  37. package/dist/components/primitives/button.js.map +1 -1
  38. package/dist/components/primitives/calendar.js +1 -0
  39. package/dist/components/primitives/calendar.js.map +1 -1
  40. package/dist/components/primitives/carousel.js +1 -0
  41. package/dist/components/primitives/carousel.js.map +1 -1
  42. package/dist/components/primitives/chart.js +1 -0
  43. package/dist/components/primitives/chart.js.map +1 -1
  44. package/dist/components/primitives/checkbox.js +1 -0
  45. package/dist/components/primitives/checkbox.js.map +1 -1
  46. package/dist/components/primitives/context-menu.js +1 -0
  47. package/dist/components/primitives/context-menu.js.map +1 -1
  48. package/dist/components/primitives/custom-button.js +1 -0
  49. package/dist/components/primitives/custom-button.js.map +1 -1
  50. package/dist/components/primitives/drawer.js +1 -0
  51. package/dist/components/primitives/drawer.js.map +1 -1
  52. package/dist/components/primitives/dropdown-menu.js +3 -0
  53. package/dist/components/primitives/dropdown-menu.js.map +1 -1
  54. package/dist/components/primitives/field.js +1 -0
  55. package/dist/components/primitives/field.js.map +1 -1
  56. package/dist/components/primitives/form-context.js +1 -0
  57. package/dist/components/primitives/form-context.js.map +1 -1
  58. package/dist/components/primitives/form.js +1 -0
  59. package/dist/components/primitives/form.js.map +1 -1
  60. package/dist/components/primitives/hover-card.js +1 -0
  61. package/dist/components/primitives/hover-card.js.map +1 -1
  62. package/dist/components/primitives/input-group.js +1 -0
  63. package/dist/components/primitives/input-group.js.map +1 -1
  64. package/dist/components/primitives/input-otp.js +1 -0
  65. package/dist/components/primitives/input-otp.js.map +1 -1
  66. package/dist/components/primitives/label.js +1 -0
  67. package/dist/components/primitives/label.js.map +1 -1
  68. package/dist/components/primitives/loading-swap.js +1 -0
  69. package/dist/components/primitives/loading-swap.js.map +1 -1
  70. package/dist/components/primitives/navigation-menu.js +1 -0
  71. package/dist/components/primitives/navigation-menu.js.map +1 -1
  72. package/dist/components/primitives/popover.js +1 -0
  73. package/dist/components/primitives/popover.js.map +1 -1
  74. package/dist/components/primitives/radio-group.js +1 -0
  75. package/dist/components/primitives/radio-group.js.map +1 -1
  76. package/dist/components/primitives/scroll-area.js +1 -0
  77. package/dist/components/primitives/scroll-area.js.map +1 -1
  78. package/dist/components/primitives/separator.js +1 -0
  79. package/dist/components/primitives/separator.js.map +1 -1
  80. package/dist/components/primitives/sidebar-context.js +1 -0
  81. package/dist/components/primitives/sidebar-context.js.map +1 -1
  82. package/dist/components/primitives/sidebar.js +1 -0
  83. package/dist/components/primitives/sidebar.js.map +1 -1
  84. package/dist/components/primitives/slider.js +1 -0
  85. package/dist/components/primitives/slider.js.map +1 -1
  86. package/dist/components/primitives/sonner.js +1 -0
  87. package/dist/components/primitives/sonner.js.map +1 -1
  88. package/dist/components/primitives/switch.js +1 -0
  89. package/dist/components/primitives/switch.js.map +1 -1
  90. package/dist/components/primitives/tabs.js +1 -0
  91. package/dist/components/primitives/tabs.js.map +1 -1
  92. package/dist/components/primitives/theme-provider.js +1 -0
  93. package/dist/components/primitives/theme-provider.js.map +1 -1
  94. package/dist/components/primitives/toggle-group.js +1 -0
  95. package/dist/components/primitives/toggle-group.js.map +1 -1
  96. package/dist/components/primitives/toggle.js +1 -0
  97. package/dist/components/primitives/toggle.js.map +1 -1
  98. package/dist/components/primitives/tooltip.js +1 -0
  99. package/dist/components/primitives/tooltip.js.map +1 -1
  100. package/dist/hooks/use-aria-live.js +1 -0
  101. package/dist/hooks/use-aria-live.js.map +1 -1
  102. package/dist/hooks/use-focus-visible.js +1 -0
  103. package/dist/hooks/use-focus-visible.js.map +1 -1
  104. package/dist/hooks/use-mobile.js +1 -0
  105. package/dist/hooks/use-mobile.js.map +1 -1
  106. package/dist/hooks/use-screen-reader-only.js +1 -0
  107. package/dist/hooks/use-screen-reader-only.js.map +1 -1
  108. package/dist/index.d.ts +1267 -10
  109. package/dist/index.js +391 -370
  110. package/dist/index.js.map +1 -1
  111. package/package.json +25 -17
  112. package/dist/components/composites/ComponentSearch.d.ts +0 -43
  113. package/dist/components/composites/action-button.d.ts +0 -16
  114. package/dist/components/composites/index.d.ts +0 -9
  115. package/dist/components/composites/sidebar-wrapper.d.ts +0 -27
  116. package/dist/components/composites/theme-toggle.d.ts +0 -9
  117. package/dist/components/composites/user-menu.d.ts +0 -18
  118. package/dist/components/marketing/hero.d.ts +0 -12
  119. package/dist/components/marketing/index.d.ts +0 -6
  120. package/dist/components/marketing/social-proof.d.ts +0 -10
  121. package/dist/components/marketing/value-props.d.ts +0 -14
  122. package/dist/components/primitives/accordion.d.ts +0 -7
  123. package/dist/components/primitives/alert-dialog.d.ts +0 -14
  124. package/dist/components/primitives/alert.d.ts +0 -9
  125. package/dist/components/primitives/aspect-ratio.d.ts +0 -3
  126. package/dist/components/primitives/avatar.d.ts +0 -6
  127. package/dist/components/primitives/badge-variants.d.ts +0 -3
  128. package/dist/components/primitives/badge.d.ts +0 -9
  129. package/dist/components/primitives/breadcrumb.d.ts +0 -11
  130. package/dist/components/primitives/button-group-variants.d.ts +0 -3
  131. package/dist/components/primitives/button-group.d.ts +0 -13
  132. package/dist/components/primitives/button-variants.d.ts +0 -4
  133. package/dist/components/primitives/button.d.ts +0 -9
  134. package/dist/components/primitives/calendar.d.ts +0 -8
  135. package/dist/components/primitives/card.d.ts +0 -9
  136. package/dist/components/primitives/carousel.d.ts +0 -19
  137. package/dist/components/primitives/chart.d.ts +0 -53
  138. package/dist/components/primitives/checkbox.d.ts +0 -4
  139. package/dist/components/primitives/collapsible.d.ts +0 -5
  140. package/dist/components/primitives/command.d.ts +0 -18
  141. package/dist/components/primitives/context-menu.d.ts +0 -25
  142. package/dist/components/primitives/custom-button-variants.d.ts +0 -5
  143. package/dist/components/primitives/custom-button.d.ts +0 -22
  144. package/dist/components/primitives/dialog.d.ts +0 -15
  145. package/dist/components/primitives/drawer.d.ts +0 -13
  146. package/dist/components/primitives/dropdown-menu.d.ts +0 -25
  147. package/dist/components/primitives/empty.d.ts +0 -11
  148. package/dist/components/primitives/field.d.ts +0 -24
  149. package/dist/components/primitives/form-context.d.ts +0 -23
  150. package/dist/components/primitives/form.d.ts +0 -11
  151. package/dist/components/primitives/hover-card.d.ts +0 -6
  152. package/dist/components/primitives/index.d.ts +0 -116
  153. package/dist/components/primitives/input-group.d.ts +0 -16
  154. package/dist/components/primitives/input-otp.d.ts +0 -11
  155. package/dist/components/primitives/input.d.ts +0 -3
  156. package/dist/components/primitives/item.d.ts +0 -23
  157. package/dist/components/primitives/kbd.d.ts +0 -3
  158. package/dist/components/primitives/label.d.ts +0 -4
  159. package/dist/components/primitives/loading-swap.d.ts +0 -8
  160. package/dist/components/primitives/menubar.d.ts +0 -26
  161. package/dist/components/primitives/navigation-menu-variants.d.ts +0 -1
  162. package/dist/components/primitives/navigation-menu.d.ts +0 -13
  163. package/dist/components/primitives/pagination.d.ts +0 -13
  164. package/dist/components/primitives/popover.d.ts +0 -7
  165. package/dist/components/primitives/progress.d.ts +0 -4
  166. package/dist/components/primitives/radio-group.d.ts +0 -5
  167. package/dist/components/primitives/resizable.d.ts +0 -8
  168. package/dist/components/primitives/scroll-area.d.ts +0 -5
  169. package/dist/components/primitives/select.d.ts +0 -15
  170. package/dist/components/primitives/separator.d.ts +0 -4
  171. package/dist/components/primitives/sheet.d.ts +0 -13
  172. package/dist/components/primitives/sidebar-context.d.ts +0 -12
  173. package/dist/components/primitives/sidebar-variants.d.ts +0 -4
  174. package/dist/components/primitives/sidebar.d.ts +0 -56
  175. package/dist/components/primitives/skeleton.d.ts +0 -2
  176. package/dist/components/primitives/slider.d.ts +0 -4
  177. package/dist/components/primitives/sonner.d.ts +0 -3
  178. package/dist/components/primitives/spinner.d.ts +0 -2
  179. package/dist/components/primitives/switch.d.ts +0 -4
  180. package/dist/components/primitives/table.d.ts +0 -10
  181. package/dist/components/primitives/tabs.d.ts +0 -7
  182. package/dist/components/primitives/textarea.d.ts +0 -3
  183. package/dist/components/primitives/theme-provider.d.ts +0 -3
  184. package/dist/components/primitives/toggle-group.d.ts +0 -9
  185. package/dist/components/primitives/toggle-variants.d.ts +0 -4
  186. package/dist/components/primitives/toggle.d.ts +0 -9
  187. package/dist/components/primitives/tooltip.d.ts +0 -7
  188. package/dist/composites/index.js +0 -13
  189. package/dist/composites/index.js.map +0 -1
  190. package/dist/hooks/index.d.ts +0 -8
  191. package/dist/hooks/index.js +0 -11
  192. package/dist/hooks/index.js.map +0 -1
  193. package/dist/hooks/use-aria-live.d.ts +0 -22
  194. package/dist/hooks/use-focus-visible.d.ts +0 -15
  195. package/dist/hooks/use-mobile.d.ts +0 -1
  196. package/dist/hooks/use-screen-reader-only.d.ts +0 -14
  197. package/dist/lib/index.d.ts +0 -4
  198. package/dist/lib/index.js +0 -11
  199. package/dist/lib/index.js.map +0 -1
  200. package/dist/lib/utils-enhanced.d.ts +0 -27
  201. package/dist/lib/utils-enhanced.test.d.ts +0 -1
  202. package/dist/lib/utils.d.ts +0 -2
  203. package/dist/marketing/index.js +0 -9
  204. package/dist/marketing/index.js.map +0 -1
  205. package/dist/primitives/index.js +0 -345
  206. package/dist/primitives/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","sources":["../../../src/components/primitives/button.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"@/lib/utils\";\nimport { buttonVariants } from \"./button-variants\";\n\ninterface ButtonProps extends React.ComponentProps<\"button\">, VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n\n return (\n <Comp\n ref={ref}\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n );\n },\n);\n\nButton.displayName = \"Button\";\n\nexport { Button };\nexport type { ButtonProps };\n"],"names":["jsx","React","Slot","cn","buttonVariants","Button","className","variant","size","asChild","props","ref"],"mappings":"AAYA,SAAA,OAAAA,SAAA;AAAA,YAAAC,OAAA;AAAA,SAAA,QAAAC,SAAA;AAAA,SAAA,MAAAC,SAAA;AAAA,SAAA,kBAAAC,SAAA;AAAA,MAAMC,IAASJ,EAAM;AAAA,EACnB,CAAC,EAAE,WAAAK,GAAW,SAAAC,GAAS,MAAAC,GAAM,SAAAC,IAAU,IAAO,GAAGC,EAAA,GAASC,MAItD,gBAAAX;AAAA,IAHWS,IAAUP,IAAO;AAAA,IAG3B;AAAA,MACC,KAAAS;AAAA,MACA,aAAU;AAAA,MACV,WAAWR,EAAGC,EAAe,EAAE,SAAAG,GAAS,MAAAC,GAAM,WAAAF,EAAA,CAAW,CAAC;AAAA,MACzD,GAAGI;AAAA,IAAA;AAAA,EAAA;AAIZ;AAEAL,EAAO,cAAc;"}
1
+ {"version":3,"file":"button.js","sources":["../../../src/components/primitives/button.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"@/lib/utils\";\nimport { buttonVariants } from \"./button-variants\";\n\ninterface ButtonProps extends React.ComponentProps<\"button\">, VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n\n return (\n <Comp\n ref={ref}\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n );\n },\n);\n\nButton.displayName = \"Button\";\n\nexport { Button };\nexport type { ButtonProps };\n"],"names":["Button"],"mappings":";AAYA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAqB;AAKf;AAH4B;AAG3B;AACC;AACU;AACgD;AACtD;AAAA;AAIZ;AAEAA;;;;"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as n } from "react/jsx-runtime";
2
3
  import * as m from "react";
3
4
  import { ChevronLeftIcon as b, ChevronRightIcon as h, ChevronDownIcon as w } from "lucide-react";
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.js","sources":["../../../src/components/primitives/calendar.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\nimport { DayButton, DayPicker, getDefaultClassNames } from \"react-day-picker\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"../primitives/button\";\nimport { buttonVariants } from \"../primitives/button-variants\";\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"label\",\n buttonVariant = \"ghost\",\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>[\"variant\"];\n}) {\n const defaultClassNames = getDefaultClassNames();\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n \"bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent\",\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className,\n )}\n captionLayout={captionLayout}\n formatters={{\n formatMonthDropdown: (date) => date.toLocaleString(\"default\", { month: \"short\" }),\n ...formatters,\n }}\n classNames={{\n root: cn(\"w-fit\", defaultClassNames.root),\n months: cn(\"flex gap-4 flex-col md:flex-row relative\", defaultClassNames.months),\n month: cn(\"flex flex-col w-full gap-4\", defaultClassNames.month),\n nav: cn(\n \"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between\",\n defaultClassNames.nav,\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_previous,\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_next,\n ),\n month_caption: cn(\n \"flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)\",\n defaultClassNames.month_caption,\n ),\n dropdowns: cn(\n \"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5\",\n defaultClassNames.dropdowns,\n ),\n dropdown_root: cn(\n \"relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md\",\n defaultClassNames.dropdown_root,\n ),\n dropdown: cn(\"absolute bg-popover inset-0 opacity-0\", defaultClassNames.dropdown),\n caption_label: cn(\n \"select-none font-medium\",\n captionLayout === \"label\"\n ? \"text-sm\"\n : \"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5\",\n defaultClassNames.caption_label,\n ),\n table: \"w-full border-collapse\",\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\n weekday: cn(\n \"text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none\",\n defaultClassNames.weekday,\n ),\n week: cn(\"flex w-full mt-2\", defaultClassNames.week),\n week_number_header: cn(\"select-none w-(--cell-size)\", defaultClassNames.week_number_header),\n week_number: cn(\n \"text-[0.8rem] select-none text-muted-foreground\",\n defaultClassNames.week_number,\n ),\n day: cn(\n \"relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none\",\n props.showWeekNumber\n ? \"[&:nth-child(2)[data-selected=true]_button]:rounded-l-md\"\n : \"[&:first-child[data-selected=true]_button]:rounded-l-md\",\n defaultClassNames.day,\n ),\n range_start: cn(\"rounded-l-md bg-accent\", defaultClassNames.range_start),\n range_middle: cn(\"rounded-none\", defaultClassNames.range_middle),\n range_end: cn(\"rounded-r-md bg-accent\", defaultClassNames.range_end),\n today: cn(\n \"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none\",\n defaultClassNames.today,\n ),\n outside: cn(\n \"text-muted-foreground aria-selected:text-muted-foreground\",\n defaultClassNames.outside,\n ),\n disabled: cn(\"text-muted-foreground opacity-50\", defaultClassNames.disabled),\n hidden: cn(\"invisible\", defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return <div data-slot=\"calendar\" ref={rootRef} className={cn(className)} {...props} />;\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === \"left\") {\n return <ChevronLeftIcon className={cn(\"size-4\", className)} {...props} />;\n }\n\n if (orientation === \"right\") {\n return <ChevronRightIcon className={cn(\"size-4\", className)} {...props} />;\n }\n\n return <ChevronDownIcon className={cn(\"size-4\", className)} {...props} />;\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">\n {children}\n </div>\n </td>\n );\n },\n ...components,\n }}\n {...props}\n />\n );\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames();\n\n const ref = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus();\n }, [modifiers.focused]);\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n \"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70\",\n defaultClassNames.day,\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Calendar, CalendarDayButton };\n"],"names":["jsx","React","ChevronLeftIcon","ChevronRightIcon","ChevronDownIcon","getDefaultClassNames","DayPicker","cn","Button","buttonVariants","Calendar","className","classNames","showOutsideDays","captionLayout","buttonVariant","formatters","components","props","defaultClassNames","date","rootRef","orientation","CalendarDayButton","children","day","modifiers","ref"],"mappings":"AAUA,SAAA,OAAAA,SAAA;AAAA,YAAAC,OAAA;AAAA,SAAA,mBAAAC,GAAA,oBAAAC,GAAA,mBAAAC,SAAA;AAAA,SAAA,wBAAAC,GAAA,aAAAC,SAAA;AAAA,SAAA,MAAAC,SAAA;AAAA,SAAA,UAAAC,SAAA;AAAA,SAAA,kBAAAC,SAAA;AAAA,SAASC,EAAS;AAAA,EAChB,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,eAAAC,IAAgB;AAAA,EAChB,eAAAC,IAAgB;AAAA,EAChB,YAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACL,GAEG;AACD,QAAMC,IAAoBd,EAAA;AAE1B,SACE,gBAAAL;AAAA,IAACM;AAAA,IAAA;AAAA,MACC,iBAAAO;AAAA,MACA,WAAWN;AAAA,QACT;AAAA,QACA,OAAO;AAAA,QACP,OAAO;AAAA,QACPI;AAAA,MAAA;AAAA,MAEF,eAAAG;AAAA,MACA,YAAY;AAAA,QACV,qBAAqB,CAACM,MAASA,EAAK,eAAe,WAAW,EAAE,OAAO,SAAS;AAAA,QAChF,GAAGJ;AAAA,MAAA;AAAA,MAEL,YAAY;AA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0B,IAAI;AAChD,SAAAA,EAAM,UAAU,MAAM;AACpB,IAAIyB,EAAU,WAASC,EAAI,SAAS,MAAA;AAAA,EACtC,GAAG,CAACD,EAAU,OAAO,CAAC,GAGpB,gBAAA1B;AAAA,IAACQ;AAAA,IAAA;AAAA,MACC,KAAAmB;AAAA,MACA,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,YAAUF,EAAI,KAAK,mBAAA;AAAA,MACnB,wBACEC,EAAU,YACV,CAACA,EAAU,eACX,CAACA,EAAU,aACX,CAACA,EAAU;AAAA,MAEb,oBAAkBA,EAAU;AAAA,MAC5B,kBAAgBA,EAAU;AAAA,MAC1B,qBAAmBA,EAAU;AAAA,MAC7B,WAAWnB;AAAA,QACT;AAAA,QACAY,EAAkB;AAAA,QAClBR;AAAA,MAAA;AAAA,MAED,GAAGO;AAAA,IAAA;AAAA,EAAA;AAGV;"}
1
+ {"version":3,"file":"calendar.js","sources":["../../../src/components/primitives/calendar.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from \"lucide-react\";\nimport { DayButton, DayPicker, getDefaultClassNames } from \"react-day-picker\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"../primitives/button\";\nimport { buttonVariants } from \"../primitives/button-variants\";\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"label\",\n buttonVariant = \"ghost\",\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>[\"variant\"];\n}) {\n const defaultClassNames = getDefaultClassNames();\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n \"bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent\",\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className,\n )}\n captionLayout={captionLayout}\n formatters={{\n formatMonthDropdown: (date) => date.toLocaleString(\"default\", { month: \"short\" }),\n ...formatters,\n }}\n classNames={{\n root: cn(\"w-fit\", defaultClassNames.root),\n months: cn(\"flex gap-4 flex-col md:flex-row relative\", defaultClassNames.months),\n month: cn(\"flex flex-col w-full gap-4\", defaultClassNames.month),\n nav: cn(\n \"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between\",\n defaultClassNames.nav,\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_previous,\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_next,\n ),\n month_caption: cn(\n \"flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)\",\n defaultClassNames.month_caption,\n ),\n dropdowns: cn(\n \"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5\",\n defaultClassNames.dropdowns,\n ),\n dropdown_root: cn(\n \"relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md\",\n defaultClassNames.dropdown_root,\n ),\n dropdown: cn(\"absolute bg-popover inset-0 opacity-0\", defaultClassNames.dropdown),\n caption_label: cn(\n \"select-none font-medium\",\n captionLayout === \"label\"\n ? \"text-sm\"\n : \"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5\",\n defaultClassNames.caption_label,\n ),\n table: \"w-full border-collapse\",\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\n weekday: cn(\n \"text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none\",\n defaultClassNames.weekday,\n ),\n week: cn(\"flex w-full mt-2\", defaultClassNames.week),\n week_number_header: cn(\"select-none w-(--cell-size)\", defaultClassNames.week_number_header),\n week_number: cn(\n \"text-[0.8rem] select-none text-muted-foreground\",\n defaultClassNames.week_number,\n ),\n day: cn(\n \"relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none\",\n props.showWeekNumber\n ? \"[&:nth-child(2)[data-selected=true]_button]:rounded-l-md\"\n : \"[&:first-child[data-selected=true]_button]:rounded-l-md\",\n defaultClassNames.day,\n ),\n range_start: cn(\"rounded-l-md bg-accent\", defaultClassNames.range_start),\n range_middle: cn(\"rounded-none\", defaultClassNames.range_middle),\n range_end: cn(\"rounded-r-md bg-accent\", defaultClassNames.range_end),\n today: cn(\n \"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none\",\n defaultClassNames.today,\n ),\n outside: cn(\n \"text-muted-foreground aria-selected:text-muted-foreground\",\n defaultClassNames.outside,\n ),\n disabled: cn(\"text-muted-foreground opacity-50\", defaultClassNames.disabled),\n hidden: cn(\"invisible\", defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return <div data-slot=\"calendar\" ref={rootRef} className={cn(className)} {...props} />;\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === \"left\") {\n return <ChevronLeftIcon className={cn(\"size-4\", className)} {...props} />;\n }\n\n if (orientation === \"right\") {\n return <ChevronRightIcon className={cn(\"size-4\", className)} {...props} />;\n }\n\n return <ChevronDownIcon className={cn(\"size-4\", className)} {...props} />;\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">\n {children}\n </div>\n </td>\n );\n },\n ...components,\n }}\n {...props}\n />\n );\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames();\n\n const ref = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus();\n }, [modifiers.focused]);\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n \"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70\",\n defaultClassNames.day,\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Calendar, CalendarDayButton };\n"],"names":[],"mappings":";AAUA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAkB;AAChB;AACA;AACkB;AACF;AACA;AAChB;AACA;AAEF;AAGE;AAEA;AACE;AAAC;AAAA;AACC;AACW;AACT;AACO;AACA;AACP;AAAA;AAEF;AACY;AACsE;AAC7E;AAAA;AAEO;AAC8B;AACuC;AAChB;AAC1D;AACH;AACkB;AAAA;AAEH;AAC0B;AACzC;AACkB;AAAA;AAEP;AAC8B;AACzC;AACkB;AAAA;AAEL;AACb;AACkB;AAAA;AAET;AACT;AACkB;AAAA;AAEL;AACb;AACkB;AAAA;AAE4D;AACjE;AACb;AAGI;AACc;AAAA;AAEb;AACwC;AACtC;AACP;AACkB;AAAA;AAE+B;AACuC;AAC7E;AACX;AACkB;AAAA;AAEf;AACH;AAGI;AACc;AAAA;AAEmD;AACR;AACI;AAC5D;AACL;AACkB;AAAA;AAEX;AACP;AACkB;AAAA;AAEuD;AAC3B;AAC7C;AAAA;AAEO;AAE4E;AAWb;AAE9D;AAOP;AAGD;AAAA;AAED;AAAA;AAGV;AAEA;AAA2B;AACzB;AACA;AACA;AAEF;AACE;AAGA;AACE;AAAoC;AAIpC;AAAC;AAAA;AACC;AACQ;AACH;AACc;AAKN;AAEe;AACF;AACG;AAClB;AACT;AACkB;AAClB;AAAA;AAEE;AAAA;AAGV;;;;;"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as a, jsxs as h } from "react/jsx-runtime";
2
3
  import * as l from "react";
3
4
  import k from "embla-carousel-react";
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.js","sources":["../../../src/components/primitives/carousel.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport useEmblaCarousel, { type UseEmblaCarouselType } from \"embla-carousel-react\";\nimport { ArrowLeft, ArrowRight } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"../primitives/button\";\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: \"horizontal\" | \"vertical\";\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\");\n }\n\n return context;\n}\n\nfunction Carousel({\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) return;\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) return;\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) return;\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n\n return () => {\n api?.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn(\"relative\", className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n}\n\nfunction CarouselContent({ className, ...props }: React.ComponentProps<\"div\">) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div\n className={cn(\"flex\", orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\", className)}\n {...props}\n />\n </div>\n );\n}\n\nfunction CarouselItem({ className, ...props }: React.ComponentProps<\"div\">) {\n const { orientation } = useCarousel();\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CarouselPrevious({\n className,\n variant = \"outline\",\n size = \"icon\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute size-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"top-1/2 -left-12 -translate-y-1/2\"\n : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ArrowLeft />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\nfunction CarouselNext({\n className,\n variant = \"outline\",\n size = \"icon\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute size-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"top-1/2 -right-12 -translate-y-1/2\"\n : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ArrowRight />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n}\n\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n};\n"],"names":["jsx","jsxs","React","useEmblaCarousel","ArrowLeft","ArrowRight","cn","Button","CarouselContext","useCarousel","context","Carousel","orientation","opts","setApi","plugins","className","children","props","carouselRef","api","canScrollPrev","setCanScrollPrev","canScrollNext","setCanScrollNext","onSelect","scrollPrev","scrollNext","handleKeyDown","event","CarouselContent","CarouselItem","CarouselPrevious","variant","size","CarouselNext"],"mappings":"AA8BA,SAAA,OAAAA,GAAA,QAAAC,SAAA;AAAA,YAAAC,OAAA;AAAA,OAAAC,OAAA;AAAA,SAAA,aAAAC,GAAA,cAAAC,SAAA;AAAA,SAAA,MAAAC,SAAA;AAAA,SAAA,UAAAC,SAAA;AAAA,MAAMC,IAAkBN,EAAM,cAA2C,IAAI;AAE7E,SAASO,IAAc;AACrB,QAAMC,IAAUR,EAAM,WAAWM,CAAe;AAEhD,MAAI,CAACE;AACH,UAAM,IAAI,MAAM,gDAAgD;AAGlE,SAAOA;AACT;AAEA,SAASC,EAAS;AAAA,EAChB,aAAAC,IAAc;AAAA,EACd,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,GAAgD;AAC9C,QAAM,CAACC,GAAaC,CAAG,IAAIjB;AAAA,IACzB;AAAA,MACE,GAAGU;AAAA,MACH,MAAMD,MAAgB,eAAe,MAAM;AAAA,IAAA;AAAA,IAE7CG;AAAA,EAAA,GAEI,CAACM,GAAeC,CAAgB,IAAIpB,EAAM,SAAS,EAAK,GACxD,CAACqB,GAAeC,CAAgB,IAAItB,EAAM,SAAS,EAAK,GAExDuB,IAAWvB,EAAM,YAAY,CAACkB,MAAqB;AACvD,IAAKA,MACLE,EAAiBF,EAAI,eAAe,GACpCI,EAAiBJ,EAAI,eAAe;AAAA,EACtC,GAAG,CAAA,CAAE,GAECM,IAAaxB,EAAM,YAAY,MAAM;AACzC,IAAAkB,GAAK,WAAA;AAAA,EACP,GAAG,CAACA,CAAG,CAA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,EAAA;AAG9C;AAEA,SAASmC,EAAa;AAAA,EACpB,WAAAnB;AAAA,EACA,SAAAiB,IAAU;AAAA,EACV,MAAAC,IAAO;AAAA,EACP,GAAGhB;AACL,GAAwC;AACtC,QAAM,EAAE,aAAAN,GAAa,YAAAe,GAAY,eAAAJ,EAAA,IAAkBd,EAAA;AAEnD,SACE,gBAAAR;AAAA,IAACM;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,SAAA0B;AAAA,MACA,MAAAC;AAAA,MACA,WAAW5B;AAAA,QACT;AAAA,QACAM,MAAgB,eACZ,uCACA;AAAA,QACJI;AAAA,MAAA;AAAA,MAEF,UAAU,CAACO;AAAA,MACX,SAASI;AAAA,MACR,GAAGT;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAlB,EAACK,GAAA,EAAW;AAAA,QACZ,gBAAAL,EAAC,QAAA,EAAK,WAAU,WAAU,UAAA,aAAA,CAAU;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG1C;"}
1
+ {"version":3,"file":"carousel.js","sources":["../../../src/components/primitives/carousel.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport useEmblaCarousel, { type UseEmblaCarouselType } from \"embla-carousel-react\";\nimport { ArrowLeft, ArrowRight } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Button } from \"../primitives/button\";\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: \"horizontal\" | \"vertical\";\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\");\n }\n\n return context;\n}\n\nfunction Carousel({\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === \"horizontal\" ? \"x\" : \"y\",\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) return;\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) return;\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) return;\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n\n return () => {\n api?.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === \"y\" ? \"vertical\" : \"horizontal\"),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn(\"relative\", className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n}\n\nfunction CarouselContent({ className, ...props }: React.ComponentProps<\"div\">) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div\n className={cn(\"flex\", orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\", className)}\n {...props}\n />\n </div>\n );\n}\n\nfunction CarouselItem({ className, ...props }: React.ComponentProps<\"div\">) {\n const { orientation } = useCarousel();\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CarouselPrevious({\n className,\n variant = \"outline\",\n size = \"icon\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute size-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"top-1/2 -left-12 -translate-y-1/2\"\n : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ArrowLeft />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\nfunction CarouselNext({\n className,\n variant = \"outline\",\n size = \"icon\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n \"absolute size-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"top-1/2 -right-12 -translate-y-1/2\"\n : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ArrowRight />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n}\n\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n};\n"],"names":[],"mappings":";AA8BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA;AACE;AAEA;AACE;AAGF;AACF;AAEA;AAAkB;AACF;AACd;AACA;AACA;AACA;AACA;AAEF;AACE;AAA2B;AACzB;AACK;AACwC;AAAA;AAE7C;AAMA;AAEoC;AAIpC;AAAK;AAIL;AAAK;AAGqB;AAExB;AAKE;AAEJ;AACuB;AAGzB;AACE;AACU;AAIV;AACA;AAKE;AAA2B;AAC7B;AAIA;AAAiB;AAAhB;AACQ;AACL;AACA;AACA;AAC+D;AAC/D;AACA;AACA;AACA;AAAA;AAGF;AAAC;AAAA;AACmB;AACiB;AAC9B;AACgB;AACX;AACN;AAEH;AAAA;AAAA;AACH;AAGN;AAEA;AACE;AAEA;AAEI;AAAC;AAAA;AAC2F;AACtF;AAAA;AAIZ;AAEA;AACE;AAEA;AACE;AAAC;AAAA;AACM;AACgB;AACX;AACC;AACT;AACwC;AACxC;AAAA;AAEE;AAAA;AAGV;AAEA;AAA0B;AACxB;AACU;AACH;AAET;AACE;AAEA;AACE;AAAC;AAAA;AACW;AACV;AACA;AACW;AACT;AAGI;AACJ;AAAA;AAES;AACF;AACL;AAEJ;AAAW;AAC6B;AAAA;AAAA;AAG9C;AAEA;AAAsB;AACpB;AACU;AACH;AAET;AACE;AAEA;AACE;AAAC;AAAA;AACW;AACV;AACA;AACW;AACT;AAGI;AACJ;AAAA;AAES;AACF;AACL;AAEJ;AAAY;AACwB;AAAA;AAAA;AAG1C;;;;;;;;"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as s, jsxs as f, Fragment as P } from "react/jsx-runtime";
2
3
  import * as v from "react";
3
4
  import * as _ from "recharts";
@@ -1 +1 @@
1
- {"version":3,"file":"chart.js","sources":["../../../src/components/primitives/chart.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as RechartsPrimitive from \"recharts\";\n\nimport { cn } from \"@/lib/utils\";\n\n// Format: { THEME_NAME: CSS_SELECTOR }\nconst THEMES = { light: \"\", dark: \".dark\" } as const;\n\nexport type ChartConfig = {\n [k in string]: {\n label?: React.ReactNode;\n icon?: React.ComponentType;\n } & (\n | { color?: string; theme?: never }\n | { color?: never; theme: Record<keyof typeof THEMES, string> }\n );\n};\n\ntype ChartContextProps = {\n config: ChartConfig;\n};\n\n// Type for chart payload items\ninterface ChartPayloadItem {\n type?: \"none\";\n dataKey?: string;\n name?: string;\n value?: number | string;\n color?: string;\n payload?: Record<string, unknown>;\n fill?: string;\n [key: string]: unknown;\n}\n\nconst ChartContext = React.createContext<ChartContextProps | null>(null);\n\nfunction useChart() {\n const context = React.useContext(ChartContext);\n\n if (!context) {\n throw new Error(\"useChart must be used within a <ChartContainer />\");\n }\n\n return context;\n}\n\nfunction ChartContainer({\n id,\n className,\n children,\n config,\n ...props\n}: React.ComponentProps<\"div\"> & {\n config: ChartConfig;\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>[\"children\"];\n}) {\n const uniqueId = React.useId();\n const chartId = `chart-${id || uniqueId.replace(/:/g, \"\")}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n \"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className,\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n}\n\nconst ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {\n const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color);\n\n if (!colorConfig.length) {\n return null;\n }\n\n return (\n <style\n dangerouslySetInnerHTML={{\n __html: Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] || itemConfig.color;\n return color ? ` --color-${key}: ${color};` : null;\n })\n .join(\"\\n\")}\n}\n`,\n )\n .join(\"\\n\"),\n }}\n />\n );\n};\n\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\nfunction ChartTooltipContent({\n active,\n payload,\n className,\n indicator = \"dot\",\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey,\n}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<\"div\"> & {\n hideLabel?: boolean;\n hideIndicator?: boolean;\n indicator?: \"line\" | \"dot\" | \"dashed\";\n nameKey?: string;\n labelKey?: string;\n payload?: ChartPayloadItem[];\n label?: string;\n }) {\n const { config } = useChart();\n\n const tooltipLabel = React.useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n const key = `${labelKey || item?.dataKey || item?.name || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value =\n !labelKey && typeof label === \"string\"\n ? config[label as keyof typeof config]?.label || label\n : itemConfig?.label;\n\n if (labelFormatter) {\n return (\n <div className={cn(\"font-medium\", labelClassName)}>{labelFormatter(value, payload)}</div>\n );\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn(\"font-medium\", labelClassName)}>{value}</div>;\n }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== \"dot\";\n\n return (\n <div\n className={cn(\n \"border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl\",\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload\n .filter((item: ChartPayloadItem) => item.type !== \"none\")\n .map((item: ChartPayloadItem, index: number) => {\n const key = `${nameKey || item.name || item.dataKey || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color || item.payload?.fill || item.color;\n\n return (\n <div\n key={item.dataKey}\n className={cn(\n \"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5\",\n indicator === \"dot\" && \"items-center\",\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn(\n \"shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)\",\n {\n \"h-2.5 w-2.5\": indicator === \"dot\",\n \"w-1\": indicator === \"line\",\n \"w-0 border-[1.5px] border-dashed bg-transparent\":\n indicator === \"dashed\",\n \"my-0.5\": nestLabel && indicator === \"dashed\",\n },\n )}\n style={\n {\n \"--color-bg\": indicatorColor,\n \"--color-border\": indicatorColor,\n } as React.CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n \"flex flex-1 justify-between leading-none\",\n nestLabel ? \"items-end\" : \"items-center\",\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">\n {itemConfig?.label || item.name}\n </span>\n </div>\n {item.value && (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {typeof item.value === \"number\"\n ? item.value.toLocaleString()\n : item.value}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = \"bottom\",\n nameKey,\n}: React.ComponentProps<\"div\"> &\n Pick<RechartsPrimitive.LegendProps, \"verticalAlign\"> & {\n hideIcon?: boolean;\n nameKey?: string;\n payload?: ChartPayloadItem[];\n }) {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div\n className={cn(\n \"flex items-center justify-center gap-4\",\n verticalAlign === \"top\" ? \"pb-3\" : \"pt-3\",\n className,\n )}\n >\n {payload\n .filter((item: ChartPayloadItem) => item.type !== \"none\")\n .map((item: ChartPayloadItem) => {\n const key = `${nameKey || item.dataKey || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={item.value}\n className={cn(\n \"[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3\",\n )}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n}\n\n// Helper to extract item config from a payload.\nfunction getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {\n if (typeof payload !== \"object\" || payload === null) {\n return undefined;\n }\n\n const payloadPayload =\n \"payload\" in payload && typeof payload.payload === \"object\" && payload.payload !== null\n ? payload.payload\n : undefined;\n\n let configLabelKey: string = key;\n\n if (key in payload && typeof payload[key as keyof typeof payload] === \"string\") {\n configLabelKey = payload[key as keyof typeof payload] as string;\n } else if (\n payloadPayload &&\n key in payloadPayload &&\n typeof payloadPayload[key as keyof typeof payloadPayload] === \"string\"\n ) {\n configLabelKey = payloadPayload[key as keyof typeof payloadPayload] as string;\n }\n\n return configLabelKey in config ? config[configLabelKey] : config[key as keyof typeof config];\n}\n\nexport {\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n};\n"],"names":["THEMES","ChartContext","React","useChart","context","ChartContainer","id","className","children","config","props","uniqueId","chartId","jsxs","cn","jsx","ChartStyle","RechartsPrimitive","colorConfig","theme","prefix","key","itemConfig","color","ChartTooltip","ChartTooltipContent","active","payload","indicator","hideLabel","hideIndicator","label","labelFormatter","labelClassName","formatter","nameKey","labelKey","tooltipLabel","item","getPayloadConfigFromPayload","value","nestLabel","index","indicatorColor","Fragment","ChartLegend","ChartLegendContent","hideIcon","verticalAlign","payloadPayload","configLabelKey"],"mappings":";;;;AAQA,MAAMA,IAAS,EAAE,OAAO,IAAI,MAAM,QAAA,GA4B5BC,IAAeC,EAAM,cAAwC,IAAI;AAEvE,SAASC,IAAW;AAClB,QAAMC,IAAUF,EAAM,WAAWD,CAAY;AAE7C,MAAI,CAACG;AACH,UAAM,IAAI,MAAM,mDAAmD;AAGrE,SAAOA;AACT;AAEA,SAASC,EAAe;AAAA,EACtB,IAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,GAAGC;AACL,GAGG;AACD,QAAMC,IAAWT,EAAM,MAAA,GACjBU,IAAU,SAASN,KAAMK,EAAS,QAAQ,MAAM,EAAE,CAAC;AAEzD,2BACGV,EAAa,UAAb,EAAsB,OAAO,EAAE,QAAAQ,KAC9B,UAAA,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,cAAYD;AAAA,MACZ,WAAWE;AAAA,QACT;AAAA,QACAP;AAAA,MAAA;AAAA,MAED,GAAGG;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAK,EAAC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EAAQN,CAA2B,KAAM,WACpE6B,IAAiBvB,EAAQN,CAA2B,IAEpD4B,KACA5B,KAAO4B,KACP,OAAOA,EAAe5B,CAAkC,KAAM,aAE9D6B,IAAiBD,EAAe5B,CAAkC,IAG7D6B,KAAkBzC,IAASA,EAAOyC,CAAc,IAAIzC,EAAOY,CAA0B;AAC9F;"}
1
+ {"version":3,"file":"chart.js","sources":["../../../src/components/primitives/chart.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as RechartsPrimitive from \"recharts\";\n\nimport { cn } from \"@/lib/utils\";\n\n// Format: { THEME_NAME: CSS_SELECTOR }\nconst THEMES = { light: \"\", dark: \".dark\" } as const;\n\nexport type ChartConfig = {\n [k in string]: {\n label?: React.ReactNode;\n icon?: React.ComponentType;\n } & (\n | { color?: string; theme?: never }\n | { color?: never; theme: Record<keyof typeof THEMES, string> }\n );\n};\n\ntype ChartContextProps = {\n config: ChartConfig;\n};\n\n// Type for chart payload items\ninterface ChartPayloadItem {\n type?: \"none\";\n dataKey?: string;\n name?: string;\n value?: number | string;\n color?: string;\n payload?: Record<string, unknown>;\n fill?: string;\n [key: string]: unknown;\n}\n\nconst ChartContext = React.createContext<ChartContextProps | null>(null);\n\nfunction useChart() {\n const context = React.useContext(ChartContext);\n\n if (!context) {\n throw new Error(\"useChart must be used within a <ChartContainer />\");\n }\n\n return context;\n}\n\nfunction ChartContainer({\n id,\n className,\n children,\n config,\n ...props\n}: React.ComponentProps<\"div\"> & {\n config: ChartConfig;\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>[\"children\"];\n}) {\n const uniqueId = React.useId();\n const chartId = `chart-${id || uniqueId.replace(/:/g, \"\")}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n \"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className,\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n}\n\nconst ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {\n const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color);\n\n if (!colorConfig.length) {\n return null;\n }\n\n return (\n <style\n dangerouslySetInnerHTML={{\n __html: Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] || itemConfig.color;\n return color ? ` --color-${key}: ${color};` : null;\n })\n .join(\"\\n\")}\n}\n`,\n )\n .join(\"\\n\"),\n }}\n />\n );\n};\n\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\nfunction ChartTooltipContent({\n active,\n payload,\n className,\n indicator = \"dot\",\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey,\n}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<\"div\"> & {\n hideLabel?: boolean;\n hideIndicator?: boolean;\n indicator?: \"line\" | \"dot\" | \"dashed\";\n nameKey?: string;\n labelKey?: string;\n payload?: ChartPayloadItem[];\n label?: string;\n }) {\n const { config } = useChart();\n\n const tooltipLabel = React.useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n const key = `${labelKey || item?.dataKey || item?.name || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value =\n !labelKey && typeof label === \"string\"\n ? config[label as keyof typeof config]?.label || label\n : itemConfig?.label;\n\n if (labelFormatter) {\n return (\n <div className={cn(\"font-medium\", labelClassName)}>{labelFormatter(value, payload)}</div>\n );\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn(\"font-medium\", labelClassName)}>{value}</div>;\n }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== \"dot\";\n\n return (\n <div\n className={cn(\n \"border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl\",\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload\n .filter((item: ChartPayloadItem) => item.type !== \"none\")\n .map((item: ChartPayloadItem, index: number) => {\n const key = `${nameKey || item.name || item.dataKey || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color || item.payload?.fill || item.color;\n\n return (\n <div\n key={item.dataKey}\n className={cn(\n \"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5\",\n indicator === \"dot\" && \"items-center\",\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn(\n \"shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)\",\n {\n \"h-2.5 w-2.5\": indicator === \"dot\",\n \"w-1\": indicator === \"line\",\n \"w-0 border-[1.5px] border-dashed bg-transparent\":\n indicator === \"dashed\",\n \"my-0.5\": nestLabel && indicator === \"dashed\",\n },\n )}\n style={\n {\n \"--color-bg\": indicatorColor,\n \"--color-border\": indicatorColor,\n } as React.CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n \"flex flex-1 justify-between leading-none\",\n nestLabel ? \"items-end\" : \"items-center\",\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">\n {itemConfig?.label || item.name}\n </span>\n </div>\n {item.value && (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {typeof item.value === \"number\"\n ? item.value.toLocaleString()\n : item.value}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = \"bottom\",\n nameKey,\n}: React.ComponentProps<\"div\"> &\n Pick<RechartsPrimitive.LegendProps, \"verticalAlign\"> & {\n hideIcon?: boolean;\n nameKey?: string;\n payload?: ChartPayloadItem[];\n }) {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div\n className={cn(\n \"flex items-center justify-center gap-4\",\n verticalAlign === \"top\" ? \"pb-3\" : \"pt-3\",\n className,\n )}\n >\n {payload\n .filter((item: ChartPayloadItem) => item.type !== \"none\")\n .map((item: ChartPayloadItem) => {\n const key = `${nameKey || item.dataKey || \"value\"}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={item.value}\n className={cn(\n \"[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3\",\n )}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n}\n\n// Helper to extract item config from a payload.\nfunction getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {\n if (typeof payload !== \"object\" || payload === null) {\n return undefined;\n }\n\n const payloadPayload =\n \"payload\" in payload && typeof payload.payload === \"object\" && payload.payload !== null\n ? payload.payload\n : undefined;\n\n let configLabelKey: string = key;\n\n if (key in payload && typeof payload[key as keyof typeof payload] === \"string\") {\n configLabelKey = payload[key as keyof typeof payload] as string;\n } else if (\n payloadPayload &&\n key in payloadPayload &&\n typeof payloadPayload[key as keyof typeof payloadPayload] === \"string\"\n ) {\n configLabelKey = payloadPayload[key as keyof typeof payloadPayload] as string;\n }\n\n return configLabelKey in config ? config[configLabelKey] : config[key as keyof typeof config];\n}\n\nexport {\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n};\n"],"names":[],"mappings":";;;;;AAQA;AA8BA;AACE;AAEA;AACE;AAGF;AACF;AAEA;AAAwB;AACtB;AACA;AACA;AACA;AAEF;AAIE;AAGA;AAEI;AAAC;AAAA;AACW;AACE;AACD;AACT;AACA;AAAA;AAEE;AAEJ;AAAyC;AACQ;AAAA;AAAA;AAIzD;AAEA;AACE;AAEA;AAKE;AAAC;AAAA;AAC0B;AAEpB;AACsB;AACP;AAGtB;AACA;AAA+C;AAE3C;AAAK;AAAA;AAAA;AAIG;AAAI;AAAA;AACd;AAGN;AAIA;AAA6B;AAC3B;AACA;AACA;AACY;AACA;AACI;AAChB;AACA;AACA;AACA;AACA;AACA;AAEF;AAUE;AAGE;AACE;AAGF;AAQA;AAOS;AAMX;AACE;AAGF;AAEA;AACE;AAAC;AAAA;AACY;AACT;AACA;AAAA;AAGD;AAAa;AAKR;AAIA;AACE;AAAC;AAAA;AAEY;AACT;AACuB;AAAA;AAOpB;AAIG;AAAC;AAAA;AACY;AACT;AACA;AAC+B;AACR;AAEL;AACqB;AAAA;AACvC;AAGA;AACgB;AACI;AAAA;AACpB;AAAA;AAKR;AAAC;AAAA;AACY;AACT;AAC0B;AAAA;AAG5B;AACG;AAA2B;AAG5B;AACF;AAME;AAAA;AAAA;AAAA;AAGN;AAAA;AAtDQ;AAAA;AA2DpB;AAAA;AAAA;AAGN;AAEA;AAEA;AAA4B;AAC1B;AACW;AACX;AACgB;AAElB;AAME;AAEA;AAKE;AAAC;AAAA;AACY;AACT;AACmC;AACnC;AAAA;AAME;AAGA;AACE;AAAC;AAAA;AAEY;AACT;AAAA;AAGD;AAGC;AAAC;AAAA;AACW;AACH;AACiB;AAAA;AACxB;AAAA;AAGS;AAAA;AAAA;AAfH;AAAA;AAkBf;AAAA;AAGT;AAGA;AACE;AACE;AAGF;AAKA;AAEA;AAWF;;;;;;;;;"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as r } from "react/jsx-runtime";
2
3
  import * as e from "@radix-ui/react-checkbox";
3
4
  import { CheckIcon as t } from "lucide-react";
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","sources":["../../../src/components/primitives/checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { CheckIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n"],"names":["Checkbox","className","props","jsx","CheckboxPrimitive","cn","CheckIcon"],"mappings":";;;;AAQA,SAASA,EAAS,EAAE,WAAAC,GAAW,GAAGC,KAA8D;AAC9F,SACE,gBAAAC;AAAA,IAACC,EAAkB;AAAA,IAAlB;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAJ;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,MAEJ,UAAA,gBAAAC;AAAA,QAACC,EAAkB;AAAA,QAAlB;AAAA,UACC,aAAU;AAAA,UACV,WAAU;AAAA,UAEV,UAAA,gBAAAD,EAACG,GAAA,EAAU,WAAU,WAAA,CAAW;AAAA,QAAA;AAAA,MAAA;AAAA,IAClC;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"checkbox.js","sources":["../../../src/components/primitives/checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { CheckIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n"],"names":[],"mappings":";;;;;AAQA;AACE;AACE;AAAmB;AAAlB;AACW;AACC;AACT;AACA;AAAA;AAEE;AAEJ;AAAmB;AAAlB;AACW;AACA;AAEsB;AAAA;AAAA;AAClC;AAGN;;;;"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
3
  import * as o from "@radix-ui/react-context-menu";
3
4
  import { CheckIcon as d, CircleIcon as u, ChevronRightIcon as c } from "lucide-react";
@@ -1 +1 @@
1
- {"version":3,"file":"context-menu.js","sources":["../../../src/components/primitives/context-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {\n return <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />;\n}\n\nfunction ContextMenuTrigger({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {\n return <ContextMenuPrimitive.Trigger data-slot=\"context-menu-trigger\" {...props} />;\n}\n\nfunction ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {\n return <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />;\n}\n\nfunction ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {\n return <ContextMenuPrimitive.Portal data-slot=\"context-menu-portal\" {...props} />;\n}\n\nfunction ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {\n return <ContextMenuPrimitive.Sub data-slot=\"context-menu-sub\" {...props} />;\n}\n\nfunction ContextMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {\n return <ContextMenuPrimitive.RadioGroup data-slot=\"context-menu-radio-group\" {...props} />;\n}\n\nfunction ContextMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.SubTrigger\n data-slot=\"context-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto\" />\n </ContextMenuPrimitive.SubTrigger>\n );\n}\n\nfunction ContextMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {\n return (\n <ContextMenuPrimitive.SubContent\n data-slot=\"context-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuContent({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n data-slot=\"context-menu-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n );\n}\n\nfunction ContextMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n}) {\n return (\n <ContextMenuPrimitive.Item\n data-slot=\"context-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>) {\n return (\n <ContextMenuPrimitive.CheckboxItem\n data-slot=\"context-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction ContextMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>) {\n return (\n <ContextMenuPrimitive.RadioItem\n data-slot=\"context-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n );\n}\n\nfunction ContextMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.Label\n data-slot=\"context-menu-label\"\n data-inset={inset}\n className={cn(\"text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\", className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {\n return (\n <ContextMenuPrimitive.Separator\n data-slot=\"context-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuShortcut({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"context-menu-shortcut\"\n className={cn(\"text-muted-foreground ml-auto text-xs tracking-widest\", className)}\n {...props}\n />\n );\n}\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n};\n"],"names":["jsx","jsxs","ContextMenuPrimitive","CheckIcon","CircleIcon","ChevronRightIcon","cn","ContextMenu","props","ContextMenuTrigger","ContextMenuGroup","ContextMenuPortal","ContextMenuSub","ContextMenuRadioGroup","ContextMenuSubTrigger","className","inset","children","ContextMenuSubContent","ContextMenuContent","ContextMenuItem","variant","ContextMenuCheckboxItem","checked","ContextMenuRadioItem","ContextMenuLabel","ContextMenuSeparator","ContextMenuShortcut"],"mappings":"AAQA,SAAA,OAAAA,GAAA,QAAAC,SAAA;AAAA,YAAAC,OAAA;AAAA,SAAA,aAAAC,GAAA,cAAAC,GAAA,oBAAAC,SAAA;AAAA,SAAA,MAAAC,SAAA;AAAA,SAASC,EAAY,EAAE,GAAGC,KAAiE;AACzF,2BAAQN,EAAqB,MAArB,EAA0B,aAAU,gBAAgB,GAAGM,GAAO;AACxE;AAEA,SAASC,EAAmB;AAAA,EAC1B,GAAGD;AACL,GAA8D;AAC5D,2BAAQN,EAAqB,SAArB,EAA6B,aAAU,wBAAwB,GAAGM,GAAO;AACnF;AAEA,SAASE,EAAiB,EAAE,GAAGF,KAAkE;AAC/F,2BAAQN,EAAqB,OAArB,EAA2B,aAAU,sBAAsB,GAAGM,GAAO;AAC/E;AAEA,SAASG,EAAkB,EAAE,GAAGH,KAAmE;AACjG,2BAAQN,EAAqB,QAArB,EAA4B,aAAU,uBAAuB,GAAGM,GAAO;AACjF;AAEA,SAASI,EAAe,EAAE,GAAGJ,KAAgE;AAC3F,2BAAQN,EAAqB,KAArB,EAAyB,aAAU,oBAAoB,GAAGM,GA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MACC,aAAU;AAAA,MACV,cAAYc;AAAA,MACZ,WAAWV,EAAG,qEAAqES,CAAS;AAAA,MAC3F,GAAGP;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASkB,EAAqB;AAAA,EAC5B,WAAAX;AAAA,EACA,GAAGP;AACL,GAAgE;AAC9D,SACE,gBAAAR;AAAA,IAACE,EAAqB;AAAA,IAArB;AAAA,MACC,aAAU;AAAA,MACV,WAAWI,EAAG,6BAA6BS,CAAS;AAAA,MACnD,GAAGP;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASmB,EAAoB,EAAE,WAAAZ,GAAW,GAAGP,KAAuC;AAClF,SACE,gBAAAR;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWM,EAAG,yDAAyDS,CAAS;AAAA,MAC/E,GAAGP;AAAA,IAAA;AAAA,EAAA;AAGV;"}
1
+ {"version":3,"file":"context-menu.js","sources":["../../../src/components/primitives/context-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {\n return <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />;\n}\n\nfunction ContextMenuTrigger({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {\n return <ContextMenuPrimitive.Trigger data-slot=\"context-menu-trigger\" {...props} />;\n}\n\nfunction ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {\n return <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />;\n}\n\nfunction ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {\n return <ContextMenuPrimitive.Portal data-slot=\"context-menu-portal\" {...props} />;\n}\n\nfunction ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {\n return <ContextMenuPrimitive.Sub data-slot=\"context-menu-sub\" {...props} />;\n}\n\nfunction ContextMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {\n return <ContextMenuPrimitive.RadioGroup data-slot=\"context-menu-radio-group\" {...props} />;\n}\n\nfunction ContextMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.SubTrigger\n data-slot=\"context-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto\" />\n </ContextMenuPrimitive.SubTrigger>\n );\n}\n\nfunction ContextMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {\n return (\n <ContextMenuPrimitive.SubContent\n data-slot=\"context-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuContent({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n data-slot=\"context-menu-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n );\n}\n\nfunction ContextMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n}) {\n return (\n <ContextMenuPrimitive.Item\n data-slot=\"context-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>) {\n return (\n <ContextMenuPrimitive.CheckboxItem\n data-slot=\"context-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction ContextMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>) {\n return (\n <ContextMenuPrimitive.RadioItem\n data-slot=\"context-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n );\n}\n\nfunction ContextMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.Label\n data-slot=\"context-menu-label\"\n data-inset={inset}\n className={cn(\"text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\", className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {\n return (\n <ContextMenuPrimitive.Separator\n data-slot=\"context-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuShortcut({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"context-menu-shortcut\"\n className={cn(\"text-muted-foreground ml-auto text-xs tracking-widest\", className)}\n {...props}\n />\n );\n}\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n};\n"],"names":[],"mappings":";AAQA;AAAA;AAAA;AAAA;AAAA;AACE;AACF;AAEA;AAA4B;AAE5B;AACE;AACF;AAEA;AACE;AACF;AAEA;AACE;AACF;AAEA;AACE;AACF;AAEA;AAA+B;AAE/B;AACE;AACF;AAEA;AAA+B;AAC7B;AACA;AACA;AAEF;AAGE;AACE;AAAsB;AAArB;AACW;AACE;AACD;AACT;AACA;AAAA;AAEE;AAEH;AAAA;AACqC;AAAA;AAAA;AAG5C;AAEA;AAA+B;AAC7B;AAEF;AACE;AACE;AAAsB;AAArB;AACW;AACC;AACT;AACA;AAAA;AAEE;AAAA;AAGV;AAEA;AAA4B;AAC1B;AAEF;AACE;AAEI;AAAsB;AAArB;AACW;AACC;AACT;AACA;AAAA;AAEE;AAAA;AAIZ;AAEA;AAAyB;AACvB;AACA;AACU;AAEZ;AAIE;AACE;AAAsB;AAArB;AACW;AACE;AACE;AACH;AACT;AACA;AAAA;AAEE;AAAA;AAGV;AAEA;AAAiC;AAC/B;AACA;AACA;AAEF;AACE;AACE;AAAsB;AAArB;AACW;AACC;AACT;AACA;AAAA;AAEF;AACI;AAEJ;AAIA;AACC;AAAA;AAAA;AAGP;AAEA;AAA8B;AAC5B;AACA;AAEF;AACE;AACE;AAAsB;AAArB;AACW;AACC;AACT;AACA;AAAA;AAEE;AAEJ;AAIA;AACC;AAAA;AAAA;AAGP;AAEA;AAA0B;AACxB;AACA;AAEF;AAGE;AACE;AAAsB;AAArB;AACW;AACE;AACgF;AACxF;AAAA;AAGV;AAEA;AAA8B;AAC5B;AAEF;AACE;AACE;AAAsB;AAArB;AACW;AAC0C;AAChD;AAAA;AAGV;AAEA;AACE;AACE;AAAC;AAAA;AACW;AACsE;AAC5E;AAAA;AAGV;;;;;;;;;;;;;;;;;;"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs as S, jsx as t } from "react/jsx-runtime";
2
3
  import * as x from "react";
3
4
  import { Slot as A, Slottable as L } from "@radix-ui/react-slot";
@@ -1 +1 @@
1
- {"version":3,"file":"custom-button.js","sources":["../../../src/components/primitives/custom-button.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport { Spinner } from \"./spinner\";\nimport { cn } from \"@/lib/utils\";\nimport { customButtonVariants } from \"./custom-button-variants\";\n\ninterface CustomButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof customButtonVariants> {\n asChild?: boolean;\n loading?: boolean;\n loadingText?: string;\n loadingIcon?: React.ElementType;\n loadingIconPlacement?: \"left\" | \"right\";\n icon?: React.ElementType;\n iconPlacement?: \"left\" | \"right\";\n}\n\n/**\n * CustomButton\n *\n * An enhanced button component with premium animations, loading states,\n * and accessibility baked in. Supports icons with flexible placement\n * and various visual effects like expansion and ring hovers.\n */\nconst CustomButton = React.forwardRef<HTMLButtonElement, CustomButtonProps>(\n (\n {\n className,\n variant,\n effect,\n size,\n asChild = false,\n loading,\n loadingText,\n loadingIcon: LoadingIcon = Spinner,\n loadingIconPlacement = \"left\",\n icon: Icon,\n iconPlacement = \"left\",\n children,\n disabled,\n \"aria-label\": ariaLabel,\n ...props\n },\n ref,\n ) => {\n const Comp = asChild ? Slot : \"button\";\n const isDisabled = loading || disabled;\n\n // Accessibility: Automatic label if children is empty (icon-only button)\n const effectiveAriaLabel =\n ariaLabel || (typeof children === \"string\" ? undefined : loading ? loadingText : undefined);\n\n const renderIcon = (placement: \"left\" | \"right\") => {\n const ActiveIcon = loading ? LoadingIcon : Icon;\n if (!ActiveIcon) return null;\n\n // Logic to determine if this icon should be displayed based on placement\n if (loading && loadingIconPlacement !== placement) return null;\n if (!loading && iconPlacement !== placement) return null;\n\n const iconContent = (\n <ActiveIcon aria-hidden=\"true\" className={cn(loading && !loadingText && \"animate-spin\")} />\n );\n\n if (effect === \"expandIcon\") {\n return (\n <span\n className={cn(\n \"transition-all duration-200 opacity-0 w-0 overflow-hidden inline-flex items-center justify-center\",\n placement === \"left\"\n ? \"group-hover:opacity-100 group-hover:w-5 group-hover:pr-1\"\n : \"group-hover:opacity-100 group-hover:w-5 group-hover:pl-1\",\n )}\n >\n {iconContent}\n </span>\n );\n }\n\n return iconContent;\n };\n\n return (\n <Comp\n ref={ref}\n className={cn(customButtonVariants({ variant, effect, size, className }))}\n disabled={isDisabled}\n aria-busy={loading || undefined}\n aria-disabled={isDisabled || undefined}\n aria-label={effectiveAriaLabel}\n {...props}\n >\n {renderIcon(\"left\")}\n <Slottable>\n {loading && loadingText ? (\n <span className=\"inline-flex items-center gap-2\">{loadingText}</span>\n ) : (\n children\n )}\n </Slottable>\n {renderIcon(\"right\")}\n\n {/* Screen Reader Announcements */}\n {loading && (\n <span className=\"sr-only\" aria-live=\"polite\">\n {loadingText || \"Loading...\"}\n </span>\n )}\n </Comp>\n );\n },\n);\n\nCustomButton.displayName = \"CustomButton\";\n\nexport { CustomButton };\nexport type { CustomButtonProps };\n"],"names":["jsxs","jsx","React","Slot","Slottable","Spinner","cn","customButtonVariants","CustomButton","className","variant","effect","size","asChild","loading","loadingText","LoadingIcon","loadingIconPlacement","Icon","iconPlacement","children","disabled","ariaLabel","props","ref","Comp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AAD;AAAA,QACA,WAAWlB,EAAGC,EAAqB,EAAE,SAAAG,GAAS,QAAAC,GAAQ,MAAAC,GAAM,WAAAH,EAAA,CAAW,CAAC;AAAA,QACxE,UAAUiB;AAAA,QACV,aAAWZ,KAAW;AAAA,QACtB,iBAAeY,KAAc;AAAA,QAC7B,cAAYC;AAAA,QACX,GAAGJ;AAAA,QAEH,UAAA;AAAA,UAAAK,EAAW,MAAM;AAAA,UAClB,gBAAA3B,EAACG,GAAA,EACE,UAAAU,KAAWC,IACV,gBAAAd,EAAC,UAAK,WAAU,kCAAkC,UAAAc,EAAA,CAAY,IAE9DK,EAAA,CAEJ;AAAA,UACCQ,EAAW,OAAO;AAAA,UAGlBd,uBACE,QAAA,EAAK,WAAU,WAAU,aAAU,UACjC,eAAe,aAAA,CAClB;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAN,EAAa,cAAc;"}
1
+ {"version":3,"file":"custom-button.js","sources":["../../../src/components/primitives/custom-button.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport { Spinner } from \"./spinner\";\nimport { cn } from \"@/lib/utils\";\nimport { customButtonVariants } from \"./custom-button-variants\";\n\ninterface CustomButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof customButtonVariants> {\n asChild?: boolean;\n loading?: boolean;\n loadingText?: string;\n loadingIcon?: React.ElementType;\n loadingIconPlacement?: \"left\" | \"right\";\n icon?: React.ElementType;\n iconPlacement?: \"left\" | \"right\";\n}\n\n/**\n * CustomButton\n *\n * An enhanced button component with premium animations, loading states,\n * and accessibility baked in. Supports icons with flexible placement\n * and various visual effects like expansion and ring hovers.\n */\nconst CustomButton = React.forwardRef<HTMLButtonElement, CustomButtonProps>(\n (\n {\n className,\n variant,\n effect,\n size,\n asChild = false,\n loading,\n loadingText,\n loadingIcon: LoadingIcon = Spinner,\n loadingIconPlacement = \"left\",\n icon: Icon,\n iconPlacement = \"left\",\n children,\n disabled,\n \"aria-label\": ariaLabel,\n ...props\n },\n ref,\n ) => {\n const Comp = asChild ? Slot : \"button\";\n const isDisabled = loading || disabled;\n\n // Accessibility: Automatic label if children is empty (icon-only button)\n const effectiveAriaLabel =\n ariaLabel || (typeof children === \"string\" ? undefined : loading ? loadingText : undefined);\n\n const renderIcon = (placement: \"left\" | \"right\") => {\n const ActiveIcon = loading ? LoadingIcon : Icon;\n if (!ActiveIcon) return null;\n\n // Logic to determine if this icon should be displayed based on placement\n if (loading && loadingIconPlacement !== placement) return null;\n if (!loading && iconPlacement !== placement) return null;\n\n const iconContent = (\n <ActiveIcon aria-hidden=\"true\" className={cn(loading && !loadingText && \"animate-spin\")} />\n );\n\n if (effect === \"expandIcon\") {\n return (\n <span\n className={cn(\n \"transition-all duration-200 opacity-0 w-0 overflow-hidden inline-flex items-center justify-center\",\n placement === \"left\"\n ? \"group-hover:opacity-100 group-hover:w-5 group-hover:pr-1\"\n : \"group-hover:opacity-100 group-hover:w-5 group-hover:pl-1\",\n )}\n >\n {iconContent}\n </span>\n );\n }\n\n return iconContent;\n };\n\n return (\n <Comp\n ref={ref}\n className={cn(customButtonVariants({ variant, effect, size, className }))}\n disabled={isDisabled}\n aria-busy={loading || undefined}\n aria-disabled={isDisabled || undefined}\n aria-label={effectiveAriaLabel}\n {...props}\n >\n {renderIcon(\"left\")}\n <Slottable>\n {loading && loadingText ? (\n <span className=\"inline-flex items-center gap-2\">{loadingText}</span>\n ) : (\n children\n )}\n </Slottable>\n {renderIcon(\"right\")}\n\n {/* Screen Reader Announcements */}\n {loading && (\n <span className=\"sr-only\" aria-live=\"polite\">\n {loadingText || \"Loading...\"}\n </span>\n )}\n </Comp>\n );\n },\n);\n\nCustomButton.displayName = \"CustomButton\";\n\nexport { CustomButton };\nexport type { CustomButtonProps };\n"],"names":["CustomButton"],"mappings":";AA4BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA2B;AAEvB;AACE;AACA;AACA;AACA;AACU;AACV;AACA;AAC2B;AACJ;AACjB;AACU;AAChB;AACA;AACc;AACX;AAIL;AAQE;AAKA;AAEA;AAIA;AAEI;AAAC;AAAA;AACY;AACT;AAGI;AAAA;AAGL;AAAA;AAKA;AAGT;AACE;AAAC;AAAA;AACC;AACwE;AAC9D;AACY;AACO;AACjB;AACR;AAEH;AAAiB;AAOlB;AACmB;AAMjB;AAAA;AAAA;AAAA;AAKV;AAEAA;;;;"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
2
3
  import { Drawer as e } from "vaul";
3
4
  import { cn as d } from "../../lib/utils.js";
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","sources":["../../../src/components/primitives/drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />;\n}\n\nfunction DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\nfunction DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n}\n\nfunction DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n \"group/drawer-content bg-background fixed z-50 flex h-auto flex-col\",\n \"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b\",\n \"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t\",\n \"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm\",\n \"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n );\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\nfunction DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn(\"text-foreground font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n"],"names":["jsx","jsxs","Drawer$1","cn","Drawer","props","DrawerPrimitive","DrawerTrigger","DrawerPortal","DrawerClose","DrawerOverlay","className","DrawerContent","children","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription"],"mappings":"AAOA,SAAA,OAAAA,GAAA,QAAAC,SAAA;AAAA,SAAA,UAAAC,SAAA;AAAA,SAAA,MAAAC,SAAA;AAAA,SAASC,EAAO,EAAE,GAAGC,KAA4D;AAC/E,2BAAQC,EAAgB,MAAhB,EAAqB,aAAU,UAAU,GAAGD,GAAO;AAC7D;AAEA,SAASE,EAAc,EAAE,GAAGF,KAA+D;AACzF,2BAAQC,EAAgB,SAAhB,EAAwB,aAAU,kBAAkB,GAAGD,GAAO;AACxE;AAEA,SAASG,EAAa,EAAE,GAAGH,KAA8D;AACvF,2BAAQC,EAAgB,QAAhB,EAAuB,aAAU,iBAAiB,GAAGD,GAAO;AACtE;AAEA,SAASI,EAAY,EA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;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASW,EAAY,EAAE,WAAAL,GAAW,GAAGN,KAA6D;AAChG,SACE,gBAAAL;AAAA,IAACM,EAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAWH,EAAG,iCAAiCQ,CAAS;AAAA,MACvD,GAAGN;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASY,EAAkB;AAAA,EACzB,WAAAN;AAAA,EACA,GAAGN;AACL,GAA6D;AAC3D,SACE,gBAAAL;AAAA,IAACM,EAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAWH,EAAG,iCAAiCQ,CAAS;AAAA,MACvD,GAAGN;AAAA,IAAA;AAAA,EAAA;AAGV;"}
1
+ {"version":3,"file":"drawer.js","sources":["../../../src/components/primitives/drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />;\n}\n\nfunction DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\nfunction DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n}\n\nfunction DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n \"group/drawer-content bg-background fixed z-50 flex h-auto flex-col\",\n \"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b\",\n \"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t\",\n \"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm\",\n \"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n );\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\nfunction DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn(\"text-foreground font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n"],"names":[],"mappings":";AAOA;AAAA;AAAA;AAAA;AACE;AACF;AAEA;AACE;AACF;AAEA;AACE;AACF;AAEA;AACE;AACF;AAEA;AAAuB;AACrB;AAEF;AACE;AACE;AAAiB;AAAhB;AACW;AACC;AACT;AACA;AAAA;AAEE;AAAA;AAGV;AAEA;AAAuB;AACrB;AACA;AAEF;AACE;AAEI;AAAe;AACf;AAAiB;AAAhB;AACW;AACC;AACT;AACA;AACA;AACA;AACA;AACA;AAAA;AAEE;AAEJ;AAAiJ;AAChJ;AAAA;AAAA;AAAA;AAIT;AAEA;AACE;AACE;AAAC;AAAA;AACW;AACC;AACT;AACA;AAAA;AAEE;AAAA;AAGV;AAEA;AACE;AACE;AAAC;AAAA;AACW;AACgD;AACtD;AAAA;AAGV;AAEA;AACE;AACE;AAAiB;AAAhB;AACW;AAC8C;AACpD;AAAA;AAGV;AAEA;AAA2B;AACzB;AAEF;AACE;AACE;AAAiB;AAAhB;AACW;AAC8C;AACpD;AAAA;AAGV;;;;;;;;;;;;;"}
@@ -25,6 +25,9 @@ function x({
25
25
  {
26
26
  "data-slot": "dropdown-menu-content",
27
27
  sideOffset: o,
28
+ onCloseAutoFocus: (d) => {
29
+ document.activeElement?.closest('[role="dialog"]') && d.preventDefault();
30
+ },
28
31
  className: r(
29
32
  "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
30
33
  e
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.js","sources":["../../../src/components/primitives/dropdown-menu.tsx"],"sourcesContent":["import * as React from \"react\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\nfunction DropdownMenuTrigger({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction DropdownMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\", className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\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 }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\"text-muted-foreground ml-auto text-xs tracking-widest\", className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n"],"names":["jsx","jsxs","DropdownMenuPrimitive","CheckIcon","CircleIcon","ChevronRightIcon","cn","DropdownMenu","props","DropdownMenuPortal","DropdownMenuTrigger","DropdownMenuContent","className","sideOffset","DropdownMenuGroup","DropdownMenuItem","inset","variant","DropdownMenuCheckboxItem","children","checked","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuSub","DropdownMenuSubTrigger","DropdownMenuSubContent"],"mappings":"AAMA,SAAA,OAAAA,GAAA,QAAAC,SAAA;AAAA,YAAAC,OAAA;AAAA,SAAA,aAAAC,GAAA,cAAAC,GAAA,oBAAAC,SAAA;AAAA,SAAA,MAAAC,SAAA;AAAA,SAASC,EAAa,EAAE,GAAGC,KAAkE;AAC3F,2BAAQN,EAAsB,MAAtB,EAA2B,aAAU,iBAAiB,GAAGM,GAAO;AAC1E;AAEA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A,IAAtB;AAAA,MACC,aAAU;AAAA,MACV,WAAWI,EAAG,6BAA6BM,CAAS;AAAA,MACnD,GAAGJ;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASiB,EAAqB,EAAE,WAAAb,GAAW,GAAGJ,KAAuC;AACnF,SACE,gBAAAR;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWM,EAAG,yDAAyDM,CAAS;AAAA,MAC/E,GAAGJ;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASkB,EAAgB,EAAE,GAAGlB,KAAiE;AAC7F,2BAAQN,EAAsB,KAAtB,EAA0B,aAAU,qBAAqB,GAAGM,GAAO;AAC7E;AAEA,SAASmB,EAAuB;AAAA,EAC9B,WAAAf;AAAA,EACA,OAAAI;AAAA,EACA,UAAAG;AAAA,EACA,GAAGX;AACL,GAEG;AACD,SACE,gBAAAP;AAAA,IAACC,EAAsB;AAAA,IAAtB;AAAA,MACC,aAAU;AAAA,MACV,cAAYc;AAAA,MACZ,WAAWV;AAAA,QACT;AAAA,QACAM;AAAA,MAAA;AAAA,MAED,GAAGJ;AAAA,MAEH,UAAA;AAAA,QAAAW;AAAA,QACD,gBAAAnB,EAACK,GAAA,EAAiB,WAAU,iBAAA,CAAiB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGnD;AAEA,SAASuB,EAAuB;AAAA,EAC9B,WAAAhB;AAAA,EACA,GAAGJ;AACL,GAAkE;AAChE,SACE,gBAAAR;AAAA,IAACE,EAAsB;AAAA,IAAtB;AAAA,MACC,aAAU;AAAA,MACV,WAAWI;AAAA,QACT;AAAA,QACAM;AAAA,MAAA;AAAA,MAED,GAAGJ;AAAA,IAAA;AAAA,EAAA;AAGV;"}
1
+ {"version":3,"file":"dropdown-menu.js","sources":["../../../src/components/primitives/dropdown-menu.tsx"],"sourcesContent":["import * as React from \"react\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\nfunction DropdownMenuTrigger({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n onCloseAutoFocus={(event: Event) => {\n if (document.activeElement?.closest('[role=\"dialog\"]')) {\n event.preventDefault();\n }\n }}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction DropdownMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\", className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\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 }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\"text-muted-foreground ml-auto text-xs tracking-widest\", className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n"],"names":["jsx","jsxs","DropdownMenuPrimitive","CheckIcon","CircleIcon","ChevronRightIcon","cn","DropdownMenu","props","DropdownMenuPortal","DropdownMenuTrigger","DropdownMenuContent","className","sideOffset","event","DropdownMenuGroup","DropdownMenuItem","inset","variant","DropdownMenuCheckboxItem","children","checked","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuSub","DropdownMenuSubTrigger","DropdownMenuSubContent"],"mappings":"AAMA,SAAA,OAAAA,GAAA,QAAAC,SAAA;AAAA,YAAAC,OAAA;AAAA,SAAA,aAAAC,GAAA,cAAAC,GAAA,oBAAAC,SAAA;AAAA,SAAA,MAAAC,SAAA;AAAA,SAASC,EAAa,EAAE,GAAGC,KAAkE;AAC3F,2BAAQN,EAAsB,MAAtB,EAA2B,aAAU,iBAAiB,GAAGM,GAAO;AAC1E;AAEA,SAASC,EAAmB;AAAA,EAC1B,GAAGD;AACL,GAA8D;AAC5D,2BAAQN,EAAsB,QAAtB,EAA6B,aAAU,wBAAwB,GAAGM,GAAO;AACnF;AAEA,SAASE,EAAoB;AAAA,EAC3B,GAAGF;AACL,GAA+D;AAC7D,2BAAQN,EAAsB,SAAtB,EAA8B,aAAU,yBAAyB,GAAGM,GAAO;AACrF;AAEA,SAASG,EAAoB;AAAA,EAC3B,WAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,GAAGL;AACL,GAA+D;AAC7D,SACE,gBAAAR,EAACE,EAAsB,QAAtB,EACC,UAAA,gBAAAF;AAAA,IAACE,EAAsB;AAAA,IAAtB;AAAA,MACC,aAAU;AAAA,MACV,YAAAW;AAAA,MACA,kBAAkB,CAACC,MAAiB;AAClC,QAAI,SAAS,eAAe,QAAQ,iBAAiB,KACnDA,EAAM,eAAA;AAAA,MAEV;AAAA,MACA,WAAWR;AAAA,QACT;AAAA,QACAM;AAAA,MAAA;AAAA,MAED,GAAGJ;AAA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;AACL,GAEG;AACD,SACE,gBAAAP;AAAA,IAACC,EAAsB;AAAA,IAAtB;AAAA,MACC,aAAU;AAAA,MACV,cAAYe;AAAA,MACZ,WAAWX;AAAA,QACT;AAAA,QACAM;AAAA,MAAA;AAAA,MAED,GAAGJ;AAAA,MAEH,UAAA;AAAA,QAAAY;AAAA,QACD,gBAAApB,EAACK,GAAA,EAAiB,WAAU,iBAAA,CAAiB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGnD;AAEA,SAASwB,EAAuB;AAAA,EAC9B,WAAAjB;AAAA,EACA,GAAGJ;AACL,GAAkE;AAChE,SACE,gBAAAR;AAAA,IAACE,EAAsB;AAAA,IAAtB;AAAA,MACC,aAAU;AAAA,MACV,WAAWI;AAAA,QACT;AAAA,QACAM;AAAA,MAAA;AAAA,MAED,GAAGJ;AAAA,IAAA;AAAA,EAAA;AAGV;"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as a, jsxs as f } from "react/jsx-runtime";
2
3
  import { useMemo as u } from "react";
3
4
  import { cva as c } from "class-variance-authority";
@@ -1 +1 @@
1
- {"version":3,"file":"field.js","sources":["../../../src/components/primitives/field.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Label } from \"../primitives/label\";\nimport { Separator } from \"../primitives/separator\";\n\nfunction FieldSet({ className, ...props }: React.ComponentProps<\"fieldset\">) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n \"flex flex-col gap-6\",\n \"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldLegend({\n className,\n variant = \"legend\",\n ...props\n}: React.ComponentProps<\"legend\"> & { variant?: \"legend\" | \"label\" }) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn(\n \"mb-3 font-medium\",\n \"data-[variant=legend]:text-base\",\n \"data-[variant=label]:text-sm\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n \"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nconst fieldVariants = cva(\"group/field flex w-full gap-3 data-[invalid=true]:text-destructive\", {\n variants: {\n orientation: {\n vertical: [\"flex-col [&>*]:w-full [&>.sr-only]:w-auto\"],\n horizontal: [\n \"flex-row items-center\",\n \"[&>[data-slot=field-label]]:flex-auto\",\n \"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n responsive: [\n \"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto\",\n \"@md/field-group:[&>[data-slot=field-label]]:flex-auto\",\n \"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n});\n\nfunction Field({\n className,\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof fieldVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n );\n}\n\nfunction FieldContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn(\"group/field-content flex flex-1 flex-col gap-1.5 leading-snug\", className)}\n {...props}\n />\n );\n}\n\nfunction FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {\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 group-data-[disabled=true]/field:opacity-50\",\n \"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4\",\n \"has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n \"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n \"text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance\",\n \"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5\",\n \"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n children?: React.ReactNode;\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn(\n \"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2\",\n className,\n )}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span\n className=\"bg-background text-muted-foreground relative mx-auto block w-fit px-2\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n );\n}\n\nfunction FieldError({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<\"div\"> & {\n errors?: Array<{ message?: string } | undefined>;\n}) {\n const content = useMemo(() => {\n if (children) {\n return children;\n }\n\n if (!errors?.length) {\n return null;\n }\n\n const uniqueErrors = [...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, index) => error?.message && <li key={index}>{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 FieldLabel,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldContent,\n FieldTitle,\n};\n"],"names":["FieldSet","className","props","jsx","cn","FieldLegend","variant","FieldGroup","fieldVariants","cva","Field","orientation","FieldContent","FieldLabel","Label","FieldTitle","FieldDescription","FieldSeparator","children","jsxs","Separator","FieldError","errors","content","useMemo","uniqueErrors","error","index"],"mappings":";;;;;;AAOA,SAASA,EAAS,EAAE,WAAAC,GAAW,GAAGC,KAA2C;AAC3E,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACA;AAAA,QACAH;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASG,EAAY;AAAA,EACnB,WAAAJ;AAAA,EACA,SAAAK,IAAU;AAAA,EACV,GAAGJ;AACL,GAAsE;AACpE,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,gBAAcG;AAAA,MACd,WAAWF;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACAH;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASK,EAAW,EAAE,WAAAN,GAAW,GAAGC,KAAsC;AACxE,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAA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WAAU,sCACX,UAAAA,EAAa,IAAI,CAACC,GAAOC,MAAUD,GAAO,WAAW,gBAAAvB,EAAC,MAAA,EAAgB,YAAM,QAAA,GAAdwB,CAAsB,CAAK,GAC5F;AAAA,EAEJ,GAAG,CAACT,GAAUI,CAAM,CAAC;AAErB,SAAKC,IAKH,gBAAApB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,aAAU;AAAA,MACV,WAAWC,EAAG,wCAAwCH,CAAS;AAAA,MAC9D,GAAGC;AAAA,MAEH,UAAAqB;AAAA,IAAA;AAAA,EAAA,IAVI;AAaX;"}
1
+ {"version":3,"file":"field.js","sources":["../../../src/components/primitives/field.tsx"],"sourcesContent":["\"use client\";\n\nimport { useMemo } from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Label } from \"../primitives/label\";\nimport { Separator } from \"../primitives/separator\";\n\nfunction FieldSet({ className, ...props }: React.ComponentProps<\"fieldset\">) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n \"flex flex-col gap-6\",\n \"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldLegend({\n className,\n variant = \"legend\",\n ...props\n}: React.ComponentProps<\"legend\"> & { variant?: \"legend\" | \"label\" }) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn(\n \"mb-3 font-medium\",\n \"data-[variant=legend]:text-base\",\n \"data-[variant=label]:text-sm\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n \"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nconst fieldVariants = cva(\"group/field flex w-full gap-3 data-[invalid=true]:text-destructive\", {\n variants: {\n orientation: {\n vertical: [\"flex-col [&>*]:w-full [&>.sr-only]:w-auto\"],\n horizontal: [\n \"flex-row items-center\",\n \"[&>[data-slot=field-label]]:flex-auto\",\n \"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n responsive: [\n \"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto\",\n \"@md/field-group:[&>[data-slot=field-label]]:flex-auto\",\n \"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n});\n\nfunction Field({\n className,\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof fieldVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n );\n}\n\nfunction FieldContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn(\"group/field-content flex flex-1 flex-col gap-1.5 leading-snug\", className)}\n {...props}\n />\n );\n}\n\nfunction FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {\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 group-data-[disabled=true]/field:opacity-50\",\n \"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4\",\n \"has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n \"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n \"text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance\",\n \"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5\",\n \"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n children?: React.ReactNode;\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn(\n \"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2\",\n className,\n )}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span\n className=\"bg-background text-muted-foreground relative mx-auto block w-fit px-2\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n );\n}\n\nfunction FieldError({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<\"div\"> & {\n errors?: Array<{ message?: string } | undefined>;\n}) {\n const content = useMemo(() => {\n if (children) {\n return children;\n }\n\n if (!errors?.length) {\n return null;\n }\n\n const uniqueErrors = [...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, index) => error?.message && <li key={index}>{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 FieldLabel,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldContent,\n FieldTitle,\n};\n"],"names":[],"mappings":";;;;;;;AASA;AACE;AACE;AAAC;AAAA;AACW;AACC;AACT;AACA;AACA;AAAA;AAEE;AAAA;AAGV;AAEA;AAAqB;AACnB;AACU;AAEZ;AACE;AACE;AAAC;AAAA;AACW;AACI;AACH;AACT;AACA;AACA;AACA;AAAA;AAEE;AAAA;AAGV;AAEA;AACE;AACE;AAAC;AAAA;AACW;AACC;AACT;AACA;AAAA;AAEE;AAAA;AAGV;AAEA;AAAgG;AACpF;AACK;AAC2C;AAC1C;AACV;AACA;AACA;AAAA;AAEU;AACV;AACA;AACA;AAAA;AACF;AACF;AAEe;AACF;AAEjB;AAEA;AAAe;AACb;AACc;AAEhB;AACE;AACE;AAAC;AAAA;AACM;AACK;AACQ;AACqC;AACnD;AAAA;AAGV;AAEA;AACE;AACE;AAAC;AAAA;AACW;AAC8E;AACpF;AAAA;AAGV;AAEA;AACE;AACE;AAAC;AAAA;AACW;AACC;AACT;AACA;AACA;AACA;AAAA;AAEE;AAAA;AAGV;AAEA;AACE;AACE;AAAC;AAAA;AACW;AACC;AACT;AACA;AAAA;AAEE;AAAA;AAGV;AAEA;AACE;AACE;AAAC;AAAA;AACW;AACC;AACT;AACA;AACA;AACA;AAAA;AAEE;AAAA;AAGV;AAEA;AAAwB;AACtB;AACA;AAEF;AAGE;AACE;AAAC;AAAA;AACW;AACM;AACL;AACT;AACA;AAAA;AAEE;AAEJ;AAAgD;AAE9C;AAAC;AAAA;AACW;AACA;AAET;AAAA;AAAA;AACH;AAAA;AAIR;AAEA;AAAoB;AAClB;AACA;AACA;AAEF;AAGE;AACE;AACE;AAGF;AACE;AAGF;AAEA;AAOE;AAIJ;AAKE;AAAC;AAAA;AACM;AACK;AACqD;AAC3D;AAEH;AAAA;AAGP;;;;;;;;;;;;;"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import * as o from "react";
2
3
  import { useFormContext as i, useFormState as a } from "react-hook-form";
3
4
  const c = o.createContext(
@@ -1 +1 @@
1
- {"version":3,"file":"form-context.js","sources":["../../../src/components/primitives/form-context.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { useFormContext, useFormState, type FieldPath, type FieldValues } from \"react-hook-form\";\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n name: TName;\n};\n\nexport const FormFieldContext = React.createContext<FormFieldContextValue>(\n {} as FormFieldContextValue,\n);\n\ntype FormItemContextValue = {\n id: string;\n};\n\nexport const FormItemContext = React.createContext<FormItemContextValue>(\n {} as FormItemContextValue,\n);\n\nexport const useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState } = useFormContext();\n const formState = useFormState({ name: fieldContext?.name });\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n"],"names":["React","useFormContext","useFormState","FormFieldContext","FormItemContext","useFormField","fieldContext","itemContext","getFieldState","formState","fieldState","id"],"mappings":"AAYO,YAAAA,OAAA;AAAA,SAAA,kBAAAC,GAAA,gBAAAC,SAAA;AAAA,MAAMC,IAAmBH,EAAM;AAAA,EACpC,CAAA;AACF,GAMaI,IAAkBJ,EAAM;AAAA,EACnC,CAAA;AACF,GAEaK,IAAe,MAAM;AAChC,QAAMC,IAAeN,EAAM,WAAWG,CAAgB,GAChDI,IAAcP,EAAM,WAAWI,CAAe,GAC9C,EAAE,eAAAI,EAAA,IAAkBP,EAAA,GACpBQ,IAAYP,EAAa,EAAE,MAAMI,GAAc,MAAM;AAE3D,MAAI,CAACA;AACH,UAAM,IAAI,MAAM,gDAAgD;AAGlE,QAAMI,IAAaF,EAAcF,EAAa,MAAMG,CAAS,GAEvD,EAAE,IAAAE,MAAOJ;AAEf,SAAO;AAAA,IACL,IAAAI;AAAA,IACA,MAAML,EAAa;AAAA,IACnB,YAAY,GAAGK,CAAE;AAAA,IACjB,mBAAmB,GAAGA,CAAE;AAAA,IACxB,eAAe,GAAGA,CAAE;AAAA,IACpB,GAAGD;AAAA,EAAA;AAEP;"}
1
+ {"version":3,"file":"form-context.js","sources":["../../../src/components/primitives/form-context.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { useFormContext, useFormState, type FieldPath, type FieldValues } from \"react-hook-form\";\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n name: TName;\n};\n\nexport const FormFieldContext = React.createContext<FormFieldContextValue>(\n {} as FormFieldContextValue,\n);\n\ntype FormItemContextValue = {\n id: string;\n};\n\nexport const FormItemContext = React.createContext<FormItemContextValue>(\n {} as FormItemContextValue,\n);\n\nexport const useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState } = useFormContext();\n const formState = useFormState({ name: fieldContext?.name });\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n"],"names":[],"mappings":";AAYO;AAAA;AAAA;AAA+B;AAEtC;AAMqC;AAErC;AAGE;AAKA;AACE;AAGF;AAIA;AAAO;AACL;AACmB;AACF;AACO;AACJ;AACjB;AAEP;;;;;;"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as m } from "react/jsx-runtime";
2
3
  import * as s from "react";
3
4
  import { Slot as l } from "@radix-ui/react-slot";
@@ -1 +1 @@
1
- {"version":3,"file":"form.js","sources":["../../../src/components/primitives/form.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n Controller,\n FormProvider,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n} from \"react-hook-form\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Label } from \"../primitives/label\";\nimport { FormFieldContext, FormItemContext, useFormField } from \"./form-context\";\n\nconst Form = FormProvider;\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(\n ({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} data-slot=\"form-item\" className={cn(\"grid gap-2\", className)} {...props} />\n </FormItemContext.Provider>\n );\n },\n);\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n ref={ref}\n data-slot=\"form-label\"\n data-error={!!error}\n className={cn(\"data-[error=true]:text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n );\n});\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n ref={ref}\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n});\n\nconst FormDescription = React.forwardRef<HTMLParagraphElement, React.ComponentProps<\"p\">>(\n ({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p\n ref={ref}\n data-slot=\"form-description\"\n id={formDescriptionId}\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n },\n);\n\nconst FormMessage = React.forwardRef<HTMLParagraphElement, React.ComponentProps<\"p\">>(\n ({ className, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message ?? \"\") : props.children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p\n ref={ref}\n data-slot=\"form-message\"\n id={formMessageId}\n className={cn(\"text-destructive text-sm\", className)}\n {...props}\n >\n {body}\n </p>\n );\n },\n);\n\nFormItem.displayName = \"FormItem\";\nFormLabel.displayName = \"FormLabel\";\nFormControl.displayName = \"FormControl\";\nFormDescription.displayName = \"FormDescription\";\nFormMessage.displayName = \"FormMessage\";\n\nexport { Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField };\n"],"names":["jsx","React","Slot","FormProvider","Controller","cn","Label","FormItemContext","useFormField","FormFieldContext","Form","FormField","props","FormItem","className","ref","id","FormLabel","error","formItemId","FormControl","formDescriptionId","formMessageId","FormDescription","FormMessage","body"],"mappings":"AAiBA,SAAA,OAAAA,SAAA;AAAA,YAAAC,OAAA;AAAA,SAAA,QAAAC,SAAA;AAAA,SAAA,gBAAAC,GAAA,cAAAC,SAAA;AAAA,SAAA,MAAAC,SAAA;AAAA,SAAA,SAAAC,SAAA;AAAA,SAAA,mBAAAC,GAAA,gBAAAC,GAAA,oBAAAC,SAAA;AAAA,MAAMC,IAAOP,GAEPQ,IAAY,CAGhB;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAZ,EAACS,EAAiB,UAAjB,EAA0B,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,CAAC,EAAE,WAAAa,GAAW,GAAGF,EAAA,GAASG,MAAQ;AAChC,UAAM,EAAE,mBAAAM,EAAA,IAAsBb,EAAA;AAE9B,WACE,gBAAAR;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAe;AAAA,QACA,aAAU;AAAA,QACV,IAAIM;AAAA,QACJ,WAAWhB,EAAG,iCAAiCS,CAAS;AAAA,QACvD,GAAGF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF,GAEMY,IAAcvB,EAAM;AAAA,EACxB,CAAC,EAAE,WAAAa,GAAW,GAAGF,EAAA,GAASG,MAAQ;AAChC,UAAM,EAAE,OAAAG,GAAO,eAAAI,EAAA,IAAkBd,EAAA,GAC3BiB,IAAOP,IAAQ,OAAOA,GAAO,WAAW,EAAE,IAAIN,EAAM;AAE1D,WAAKa,IAKH,gBAAAzB;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAe;AAAA,QACA,aAAU;AAAA,QACV,IAAIO;AAAA,QACJ,WAAWjB,EAAG,4BAA4BS,CAAS;AAAA,QAClD,GAAGF;AAAA,QAEH,UAAAa;AAAA,MAAA;AAAA,IAAA,IAXI;AAAA,EAcX;AACF;AAEAZ,EAAS,cAAc;AACvBI,EAAU,cAAc;AACxBG,EAAY,cAAc;AAC1BG,EAAgB,cAAc;AAC9BC,EAAY,cAAc;"}
1
+ {"version":3,"file":"form.js","sources":["../../../src/components/primitives/form.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n Controller,\n FormProvider,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n} from \"react-hook-form\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Label } from \"../primitives/label\";\nimport { FormFieldContext, FormItemContext, useFormField } from \"./form-context\";\n\nconst Form = FormProvider;\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst FormItem = React.forwardRef<HTMLDivElement, React.ComponentProps<\"div\">>(\n ({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} data-slot=\"form-item\" className={cn(\"grid gap-2\", className)} {...props} />\n </FormItemContext.Provider>\n );\n },\n);\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n ref={ref}\n data-slot=\"form-label\"\n data-error={!!error}\n className={cn(\"data-[error=true]:text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n );\n});\n\nconst FormControl = React.forwardRef<\n React.ElementRef<typeof Slot>,\n React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n ref={ref}\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n});\n\nconst FormDescription = React.forwardRef<HTMLParagraphElement, React.ComponentProps<\"p\">>(\n ({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p\n ref={ref}\n data-slot=\"form-description\"\n id={formDescriptionId}\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n },\n);\n\nconst FormMessage = React.forwardRef<HTMLParagraphElement, React.ComponentProps<\"p\">>(\n ({ className, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message ?? \"\") : props.children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p\n ref={ref}\n data-slot=\"form-message\"\n id={formMessageId}\n className={cn(\"text-destructive text-sm\", className)}\n {...props}\n >\n {body}\n </p>\n );\n },\n);\n\nFormItem.displayName = \"FormItem\";\nFormLabel.displayName = \"FormLabel\";\nFormControl.displayName = \"FormControl\";\nFormDescription.displayName = \"FormDescription\";\nFormMessage.displayName = \"FormMessage\";\n\nexport { Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField };\n"],"names":["FormItem","FormLabel","FormControl","FormDescription","FormMessage"],"mappings":";AAiBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKE;AAEF;AAQuB;AAEnB;AAEA;AAGE;AAGN;AAME;AAEA;AACE;AAAC;AAAA;AACC;AACU;AACI;AAC+C;AACpD;AACL;AAAA;AAGV;AAME;AAEA;AACE;AAAC;AAAA;AACC;AACU;AACN;AAC2C;AAC/B;AACZ;AAAA;AAGV;AAE8B;AAE1B;AAEA;AACE;AAAC;AAAA;AACC;AACU;AACN;AACoD;AACpD;AAAA;AAAA;AAIZ;AAE0B;AAEtB;AAGA;AAKE;AAAC;AAAA;AACC;AACU;AACN;AAC+C;AAC/C;AAEH;AAAA;AAXI;AAeb;AAEAA;AACAC;AACAC;AACAC;AACAC;;;;;;;;;;"}