@uselets/ui 2.0.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/README.md +8 -0
  2. package/dist/{as-child-Dxg3Xo1G.d.ts → as-child-T9W73ZYU.d.ts} +1 -3
  3. package/dist/{chart-B_6nC_ih.d.ts → chart-8rgtsk95.d.ts} +1 -3
  4. package/dist/checkbox-group-context-HDVxTNPi.js +2 -0
  5. package/dist/checkbox-group-context-HDVxTNPi.js.map +1 -0
  6. package/dist/cli/uselets.mjs.map +1 -1
  7. package/dist/combobox-styles-CZ0aJayc.js +2 -0
  8. package/dist/combobox-styles-CZ0aJayc.js.map +1 -0
  9. package/dist/components/accordion.d.ts +1 -3
  10. package/dist/components/accordion.js.map +1 -1
  11. package/dist/components/alert-dialog.d.ts +1 -3
  12. package/dist/components/alert-dialog.js.map +1 -1
  13. package/dist/components/alert.d.ts +0 -2
  14. package/dist/components/alert.js.map +1 -1
  15. package/dist/components/anchor.d.ts +1 -3
  16. package/dist/components/anchor.js.map +1 -1
  17. package/dist/components/area-chart.d.ts +1 -3
  18. package/dist/components/area-chart.js.map +1 -1
  19. package/dist/components/autocomplete.d.ts +46 -0
  20. package/dist/components/autocomplete.js +2 -0
  21. package/dist/components/autocomplete.js.map +1 -0
  22. package/dist/components/avatar.d.ts +1 -3
  23. package/dist/components/avatar.js.map +1 -1
  24. package/dist/components/badge.d.ts +1 -3
  25. package/dist/components/badge.js +1 -1
  26. package/dist/components/badge.js.map +1 -1
  27. package/dist/components/bar-chart.d.ts +1 -3
  28. package/dist/components/bar-chart.js.map +1 -1
  29. package/dist/components/bottom-nav.d.ts +1 -3
  30. package/dist/components/bottom-nav.js.map +1 -1
  31. package/dist/components/breadcrumb.d.ts +1 -3
  32. package/dist/components/breadcrumb.js.map +1 -1
  33. package/dist/components/button-group.d.ts +1 -3
  34. package/dist/components/button-group.js.map +1 -1
  35. package/dist/components/button.d.ts +1 -3
  36. package/dist/components/button.js +1 -1
  37. package/dist/components/button.js.map +1 -1
  38. package/dist/components/calendar.d.ts +0 -2
  39. package/dist/components/calendar.js +1 -1
  40. package/dist/components/calendar.js.map +1 -1
  41. package/dist/components/card.d.ts +0 -2
  42. package/dist/components/card.js.map +1 -1
  43. package/dist/components/carousel.d.ts +0 -2
  44. package/dist/components/carousel.js.map +1 -1
  45. package/dist/components/center.d.ts +0 -2
  46. package/dist/components/center.js.map +1 -1
  47. package/dist/components/chart.d.ts +1 -1
  48. package/dist/components/chart.js.map +1 -1
  49. package/dist/components/checkbox-group.d.ts +19 -0
  50. package/dist/components/checkbox-group.js +2 -0
  51. package/dist/components/checkbox-group.js.map +1 -0
  52. package/dist/components/checkbox.d.ts +2 -4
  53. package/dist/components/checkbox.js +1 -1
  54. package/dist/components/checkbox.js.map +1 -1
  55. package/dist/components/code.d.ts +0 -2
  56. package/dist/components/code.js.map +1 -1
  57. package/dist/components/collapsible.d.ts +1 -3
  58. package/dist/components/collapsible.js.map +1 -1
  59. package/dist/components/combobox.d.ts +1 -3
  60. package/dist/components/combobox.js +1 -1
  61. package/dist/components/combobox.js.map +1 -1
  62. package/dist/components/command.d.ts +0 -2
  63. package/dist/components/command.js +1 -1
  64. package/dist/components/command.js.map +1 -1
  65. package/dist/components/container.d.ts +0 -2
  66. package/dist/components/container.js.map +1 -1
  67. package/dist/components/data-table.d.ts +0 -2
  68. package/dist/components/data-table.js +1 -1
  69. package/dist/components/data-table.js.map +1 -1
  70. package/dist/components/date-range-picker.d.ts +0 -2
  71. package/dist/components/date-range-picker.js.map +1 -1
  72. package/dist/components/dialog.d.ts +1 -3
  73. package/dist/components/dialog.js.map +1 -1
  74. package/dist/components/direction.d.ts +0 -2
  75. package/dist/components/donut-chart.d.ts +0 -2
  76. package/dist/components/donut-chart.js.map +1 -1
  77. package/dist/components/drawer.d.ts +1 -3
  78. package/dist/components/drawer.js.map +1 -1
  79. package/dist/components/dropdown-menu.d.ts +1 -3
  80. package/dist/components/dropdown-menu.js.map +1 -1
  81. package/dist/components/dropzone.d.ts +0 -2
  82. package/dist/components/dropzone.js +1 -1
  83. package/dist/components/dropzone.js.map +1 -1
  84. package/dist/components/empty.d.ts +0 -2
  85. package/dist/components/empty.js.map +1 -1
  86. package/dist/components/field.d.ts +0 -2
  87. package/dist/components/field.js +1 -1
  88. package/dist/components/field.js.map +1 -1
  89. package/dist/components/flex.d.ts +0 -2
  90. package/dist/components/flex.js.map +1 -1
  91. package/dist/components/grid.d.ts +0 -2
  92. package/dist/components/grid.js.map +1 -1
  93. package/dist/components/group.d.ts +0 -2
  94. package/dist/components/group.js.map +1 -1
  95. package/dist/components/heading.d.ts +1 -3
  96. package/dist/components/heading.js.map +1 -1
  97. package/dist/components/hover-card.d.ts +1 -3
  98. package/dist/components/hover-card.js.map +1 -1
  99. package/dist/components/input-group.d.ts +0 -2
  100. package/dist/components/input-group.js.map +1 -1
  101. package/dist/components/input-otp.d.ts +0 -2
  102. package/dist/components/input-otp.js.map +1 -1
  103. package/dist/components/input.d.ts +0 -2
  104. package/dist/components/input.js.map +1 -1
  105. package/dist/components/kbd.d.ts +0 -2
  106. package/dist/components/kbd.js.map +1 -1
  107. package/dist/components/label.d.ts +1 -3
  108. package/dist/components/label.js.map +1 -1
  109. package/dist/components/list.d.ts +1 -3
  110. package/dist/components/list.js.map +1 -1
  111. package/dist/components/logo.d.ts +0 -2
  112. package/dist/components/marker.d.ts +1 -3
  113. package/dist/components/marker.js.map +1 -1
  114. package/dist/components/mask-input.d.ts +1 -3
  115. package/dist/components/mask-input.js +1 -1
  116. package/dist/components/mask-input.js.map +1 -1
  117. package/dist/components/meter.d.ts +21 -0
  118. package/dist/components/meter.js +2 -0
  119. package/dist/components/meter.js.map +1 -0
  120. package/dist/components/native-select.d.ts +0 -2
  121. package/dist/components/native-select.js.map +1 -1
  122. package/dist/components/navigation-menu.d.ts +1 -3
  123. package/dist/components/navigation-menu.js.map +1 -1
  124. package/dist/components/number-field.d.ts +1 -3
  125. package/dist/components/number-field.js +1 -1
  126. package/dist/components/number-field.js.map +1 -1
  127. package/dist/components/pagination.d.ts +0 -2
  128. package/dist/components/pagination.js.map +1 -1
  129. package/dist/components/phone-input.d.ts +0 -2
  130. package/dist/components/phone-input.js +1 -1
  131. package/dist/components/phone-input.js.map +1 -1
  132. package/dist/components/pie-chart.d.ts +1 -3
  133. package/dist/components/pie-chart.js.map +1 -1
  134. package/dist/components/popover.d.ts +1 -3
  135. package/dist/components/popover.js.map +1 -1
  136. package/dist/components/progress.d.ts +0 -2
  137. package/dist/components/progress.js +1 -1
  138. package/dist/components/progress.js.map +1 -1
  139. package/dist/components/radio-group.d.ts +0 -2
  140. package/dist/components/radio-group.js +1 -1
  141. package/dist/components/radio-group.js.map +1 -1
  142. package/dist/components/resizable.d.ts +0 -2
  143. package/dist/components/resizable.js.map +1 -1
  144. package/dist/components/ring-progress.d.ts +0 -2
  145. package/dist/components/ring-progress.js +1 -1
  146. package/dist/components/ring-progress.js.map +1 -1
  147. package/dist/components/scroll-area.d.ts +0 -2
  148. package/dist/components/scroll-area.js.map +1 -1
  149. package/dist/components/select.d.ts +1 -3
  150. package/dist/components/select.js.map +1 -1
  151. package/dist/components/separator.d.ts +1 -3
  152. package/dist/components/separator.js.map +1 -1
  153. package/dist/components/sidebar.d.ts +2 -4
  154. package/dist/components/sidebar.js +1 -1
  155. package/dist/components/sidebar.js.map +1 -1
  156. package/dist/components/simple-grid.d.ts +0 -2
  157. package/dist/components/simple-grid.js.map +1 -1
  158. package/dist/components/skeleton.d.ts +0 -2
  159. package/dist/components/skeleton.js.map +1 -1
  160. package/dist/components/slider.d.ts +0 -2
  161. package/dist/components/slider.js.map +1 -1
  162. package/dist/components/sonner.d.ts +0 -2
  163. package/dist/components/sonner.js.map +1 -1
  164. package/dist/components/spinner.d.ts +0 -2
  165. package/dist/components/spinner.js.map +1 -1
  166. package/dist/components/stack.d.ts +0 -2
  167. package/dist/components/stack.js.map +1 -1
  168. package/dist/components/stepper.d.ts +1 -3
  169. package/dist/components/stepper.js +1 -1
  170. package/dist/components/stepper.js.map +1 -1
  171. package/dist/components/switch.d.ts +0 -2
  172. package/dist/components/switch.js +1 -1
  173. package/dist/components/switch.js.map +1 -1
  174. package/dist/components/table.d.ts +0 -2
  175. package/dist/components/table.js.map +1 -1
  176. package/dist/components/tabs.d.ts +1 -3
  177. package/dist/components/tabs.js.map +1 -1
  178. package/dist/components/text.d.ts +1 -3
  179. package/dist/components/text.js.map +1 -1
  180. package/dist/components/textarea.d.ts +0 -2
  181. package/dist/components/textarea.js.map +1 -1
  182. package/dist/components/theme.d.ts +0 -2
  183. package/dist/components/theme.js.map +1 -1
  184. package/dist/components/timeline.d.ts +0 -2
  185. package/dist/components/timeline.js.map +1 -1
  186. package/dist/components/toggle-group.d.ts +1 -3
  187. package/dist/components/toggle-group.js.map +1 -1
  188. package/dist/components/toggle.d.ts +1 -3
  189. package/dist/components/toggle.js +1 -1
  190. package/dist/components/toggle.js.map +1 -1
  191. package/dist/components/toolbar.d.ts +30 -0
  192. package/dist/components/toolbar.js +2 -0
  193. package/dist/components/toolbar.js.map +1 -0
  194. package/dist/components/tooltip.d.ts +1 -3
  195. package/dist/components/tooltip.js.map +1 -1
  196. package/dist/components/unstyled-button.d.ts +1 -3
  197. package/dist/components/unstyled-button.js.map +1 -1
  198. package/dist/components/visibility.d.ts +0 -2
  199. package/dist/components/visibility.js.map +1 -1
  200. package/dist/hooks/use-breakpoint-value.d.ts +0 -2
  201. package/dist/hooks/use-breakpoint-value.js.map +1 -1
  202. package/dist/hooks/use-breakpoint.d.ts +0 -2
  203. package/dist/hooks/use-breakpoint.js.map +1 -1
  204. package/dist/hooks/use-disclosure.d.ts +0 -2
  205. package/dist/hooks/use-disclosure.js.map +1 -1
  206. package/dist/hooks/use-document-visibility.d.ts +0 -2
  207. package/dist/hooks/use-document-visibility.js.map +1 -1
  208. package/dist/hooks/use-hotkeys.d.ts +1 -1
  209. package/dist/hooks/use-idle.d.ts +0 -2
  210. package/dist/hooks/use-idle.js.map +1 -1
  211. package/dist/hooks/use-interval.d.ts +0 -2
  212. package/dist/hooks/use-interval.js.map +1 -1
  213. package/dist/hooks/use-local-storage.d.ts +0 -2
  214. package/dist/hooks/use-local-storage.js.map +1 -1
  215. package/dist/hooks/use-mask.d.ts +0 -2
  216. package/dist/hooks/use-mask.js.map +1 -1
  217. package/dist/hooks/use-mobile.d.ts +0 -2
  218. package/dist/hooks/use-mobile.js.map +1 -1
  219. package/dist/index.d.ts +21 -17
  220. package/dist/index.js +1 -1
  221. package/dist/lib/as-child.d.ts +1 -1
  222. package/dist/lib/as-child.js.map +1 -1
  223. package/dist/lib/badge.d.ts +0 -2
  224. package/dist/lib/badge.js.map +1 -1
  225. package/dist/lib/button.d.ts +0 -2
  226. package/dist/lib/button.js.map +1 -1
  227. package/dist/lib/color.d.ts +0 -2
  228. package/dist/lib/color.js.map +1 -1
  229. package/dist/lib/compose-refs.d.ts +0 -2
  230. package/dist/lib/compose-refs.js.map +1 -1
  231. package/dist/lib/progress.d.ts +0 -2
  232. package/dist/lib/progress.js.map +1 -1
  233. package/dist/lib/utils.d.ts +0 -2
  234. package/dist/lib/utils.js.map +1 -1
  235. package/dist/logo--R3_XDgA.js.map +1 -1
  236. package/dist/postcss.config.js.map +1 -1
  237. package/dist/resolve-class-name-BurP8ngI.js.map +1 -1
  238. package/dist/skills/uselets-ui/SKILL.md +3 -3
  239. package/dist/skills/uselets-ui/references/component-catalog.md +14 -2
  240. package/dist/skills/uselets-ui/references/package-guide.md +3 -3
  241. package/dist/{use-hotkeys-D1_TEIwN.d.ts → use-hotkeys-BVm0IGb8.d.ts} +1 -5
  242. package/dist/use-hotkeys-YDJmGWX6.js.map +1 -1
  243. package/package.json +14 -14
  244. package/skills/uselets-ui/SKILL.md +3 -3
  245. package/skills/uselets-ui/references/component-catalog.md +14 -2
  246. package/skills/uselets-ui/references/package-guide.md +3 -3
@@ -2,7 +2,6 @@ import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
2
  import { Button } from "./button.js";
3
3
  import * as React from "react";
4
4
  import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
5
- //#region src/components/carousel.d.ts
6
5
  type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
7
6
  type CarouselOptions = UseCarouselParameters[0];
8
7
  type CarouselPlugin = UseCarouselParameters[1];
@@ -46,6 +45,5 @@ declare function CarouselItem({ className, ...props }: CarouselItemProps): React
46
45
  declare function CarouselPrevious({ className, variant, size, onClick, ...props }: CarouselPreviousProps): React.JSX.Element;
47
46
  declare function CarouselNext({ className, variant, size, onClick, ...props }: CarouselNextProps): React.JSX.Element;
48
47
  declare function CarouselIndicators({ className, getIndicatorProps, ...props }: CarouselIndicatorsProps): React.JSX.Element | null;
49
- //#endregion
50
48
  export { Carousel, CarouselContent, CarouselIndicators, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
51
49
  //# sourceMappingURL=carousel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.js","names":["React","useEmblaCarousel","CarouselContext","context","target","props","carouselRef","api","opts","orientation","plugins","canScrollPrev","setCanScrollPrev","canScrollNext","setCanScrollNext","selectedIndex","setSelectedIndex","scrollSnaps","setScrollSnaps","onSelect","scrollPrev","scrollNext","scrollTo","index","isRtl","handleKeyDown","onKeyDown","event","prevKey","nextKey","setApi","cn","className","Button","onClick","IconChevronLeft","IconChevronRight","indicatorClassName","indicatorProps","getIndicatorProps","snap"],"sources":["../../src/components/carousel.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { IconChevronLeft, IconChevronRight } from '@tabler/icons-react'\nimport useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\n\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>\ntype CarouselOptions = UseCarouselParameters[0]\ntype CarouselPlugin = UseCarouselParameters[1]\n\nexport type CarouselApi = UseEmblaCarouselType[1]\n\nexport type CarouselProps = React.ComponentProps<'div'> & {\n /** Embla Carousel options, such as `loop`, `align` and `slidesToScroll`. */\n opts?: CarouselOptions\n /** Embla Carousel plugins, such as autoplay. */\n plugins?: CarouselPlugin\n /**\n * Scroll direction.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical'\n /** Receives the Embla API once the carousel is ready. */\n setApi?: (api: CarouselApi) => void\n}\n\nexport type CarouselContentProps = React.ComponentProps<'div'>\n\nexport type CarouselItemProps = React.ComponentProps<'div'>\n\nexport type CarouselPreviousProps = React.ComponentProps<typeof Button>\n\nexport type CarouselNextProps = React.ComponentProps<typeof Button>\n\nexport type CarouselIndicatorsProps = React.ComponentProps<'div'> & {\n /** Returns extra props for the dot of each slide index. */\n getIndicatorProps?: (index: number) => React.ComponentProps<'button'>\n}\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0]\n api: ReturnType<typeof useEmblaCarousel>[1]\n scrollPrev: () => void\n scrollNext: () => void\n scrollTo: (index: number) => void\n canScrollPrev: boolean\n canScrollNext: boolean\n selectedIndex: number\n scrollSnaps: number[]\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\nconst EDITABLE_TARGET_SELECTOR = 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"])'\n\nfunction isEditableTarget(target: EventTarget) {\n return target instanceof Element && target.closest(EDITABLE_TARGET_SELECTOR) !== null\n}\n\nfunction Carousel({\n orientation = 'horizontal',\n opts,\n setApi,\n plugins,\n className,\n children,\n onKeyDown,\n ...props\n}: 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 const [selectedIndex, setSelectedIndex] = React.useState(0)\n const [scrollSnaps, setScrollSnaps] = React.useState<number[]>([])\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) return\n setCanScrollPrev(api.canScrollPrev())\n setCanScrollNext(api.canScrollNext())\n setSelectedIndex(api.selectedScrollSnap())\n setScrollSnaps(api.scrollSnapList())\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 scrollTo = React.useCallback(\n (index: number) => {\n api?.scrollTo(index)\n },\n [api]\n )\n\n const isRtl = opts?.direction === 'rtl'\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLElement>) => {\n onKeyDown?.(event as React.KeyboardEvent<HTMLDivElement>)\n // Leave arrows to text fields and to controls inside a slide (slider, radio group...) that handle them.\n if (event.defaultPrevented || isEditableTarget(event.target)) return\n\n const [prevKey, nextKey] =\n orientation === 'vertical'\n ? ['ArrowUp', 'ArrowDown']\n : isRtl\n ? ['ArrowRight', 'ArrowLeft']\n : ['ArrowLeft', 'ArrowRight']\n\n if (event.key === prevKey) {\n event.preventDefault()\n scrollPrev()\n } else if (event.key === nextKey) {\n event.preventDefault()\n scrollNext()\n }\n },\n [onKeyDown, orientation, isRtl, 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('reInit', onSelect)\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 scrollTo,\n canScrollPrev,\n canScrollNext,\n selectedIndex,\n scrollSnaps\n }}\n >\n <section\n role=\"region\"\n aria-roledescription=\"carousel\"\n onKeyDown={handleKeyDown}\n className={cn('relative', className)}\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </section>\n </CarouselContext.Provider>\n )\n}\n\nfunction CarouselContent({ className, ...props }: CarouselContentProps) {\n const { carouselRef, orientation } = useCarousel()\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div className={cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className)} {...props} />\n </div>\n )\n}\n\nfunction CarouselItem({ className, ...props }: CarouselItemProps) {\n const { orientation } = useCarousel()\n\n return (\n <div\n data-slot=\"carousel-item\"\n className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'pl-4' : 'pt-4', className)}\n {...props}\n />\n )\n}\n\nfunction CarouselPrevious({\n className,\n variant = 'secondary',\n size = 'icon-sm',\n onClick,\n ...props\n}: CarouselPreviousProps) {\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 touch-manipulation 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={(event) => {\n onClick?.(event)\n if (!event.defaultPrevented) scrollPrev()\n }}\n {...props}\n >\n <IconChevronLeft />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n )\n}\n\nfunction CarouselNext({ className, variant = 'secondary', size = 'icon-sm', onClick, ...props }: CarouselNextProps) {\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 touch-manipulation 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={(event) => {\n onClick?.(event)\n if (!event.defaultPrevented) scrollNext()\n }}\n {...props}\n >\n <IconChevronRight />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n )\n}\n\nfunction CarouselIndicators({ className, getIndicatorProps, ...props }: CarouselIndicatorsProps) {\n const { orientation, scrollSnaps, selectedIndex, scrollTo } = useCarousel()\n\n if (scrollSnaps.length === 0) {\n return null\n }\n\n return (\n <div\n data-slot=\"carousel-indicators\"\n className={cn(\n 'pointer-events-none absolute flex justify-center gap-2',\n orientation === 'horizontal' ? 'inset-x-0 bottom-4 flex-row' : 'inset-y-0 right-4 flex-col items-center',\n className\n )}\n {...props}\n >\n {scrollSnaps.map((snap, index) => {\n const { className: indicatorClassName, onClick, ...indicatorProps } = getIndicatorProps?.(index) ?? {}\n\n return (\n <button\n key={snap}\n aria-label={`Go to slide ${index + 1}`}\n {...indicatorProps}\n type=\"button\"\n data-slot=\"carousel-indicator\"\n data-active={selectedIndex === index ? true : undefined}\n className={cn(\n 'pointer-events-auto cursor-pointer size-2.5 touch-manipulation rounded-full bg-background opacity-60 shadow-sm ring-1 ring-border transition-opacity hover:opacity-100 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 focus-visible:outline-none data-[active=true]:opacity-100',\n indicatorClassName\n )}\n onClick={(event) => {\n scrollTo(index)\n onClick?.(event)\n }}\n />\n )\n })}\n </div>\n )\n}\n\nexport { Carousel, CarouselContent, CarouselIndicators, CarouselItem, CarouselNext, CarouselPrevious, useCarousel }\n"],"mappings":"4SAqDA,MAAME,EAAkBF,EAAM,cAA2C,IAAI,EAE7E,SAAS,aAAc,CACrB,IAAMG,EAAUH,EAAM,WAAWE,CAAe,EAEhD,GAAI,CAACC,EACH,MAAU,MAAM,gDAAgD,EAGlE,OAAOA,CACT,CAIA,SAAS,iBAAiB,EAAqB,CAC7C,OAAOC,aAAkB,SAAWA,EAAO,QAAQ,2EAAwB,IAAM,IACnF,CAEA,SAAS,SAAS,CAChB,cAAc,aACd,OACA,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AAK,SACL,YAAU,qBACV,cAAavB,IAAkBQ,GAAe,IAAA,GAC9C,UAAWQ,EACT,6SACAM,CACF,EACA,QAAU,GAAU,CAClBf,EAASC,CAAK,EACdW,IAAUP,CAAK,CACjB,CACD,EAdMa,CAcN,CAEL,CAAC,CACE,CAAA,CAET"}
1
+ {"version":3,"file":"carousel.js","names":["React","useEmblaCarousel","CarouselContext","context","target","props","carouselRef","api","opts","orientation","plugins","canScrollPrev","setCanScrollPrev","canScrollNext","setCanScrollNext","selectedIndex","setSelectedIndex","scrollSnaps","setScrollSnaps","onSelect","scrollPrev","scrollNext","scrollTo","index","isRtl","handleKeyDown","onKeyDown","event","prevKey","nextKey","setApi","cn","className","Button","onClick","IconChevronLeft","IconChevronRight","indicatorClassName","indicatorProps","getIndicatorProps","snap"],"sources":["../../src/components/carousel.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { IconChevronLeft, IconChevronRight } from '@tabler/icons-react'\nimport useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\n\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>\ntype CarouselOptions = UseCarouselParameters[0]\ntype CarouselPlugin = UseCarouselParameters[1]\n\nexport type CarouselApi = UseEmblaCarouselType[1]\n\nexport type CarouselProps = React.ComponentProps<'div'> & {\n /** Embla Carousel options, such as `loop`, `align` and `slidesToScroll`. */\n opts?: CarouselOptions\n /** Embla Carousel plugins, such as autoplay. */\n plugins?: CarouselPlugin\n /**\n * Scroll direction.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical'\n /** Receives the Embla API once the carousel is ready. */\n setApi?: (api: CarouselApi) => void\n}\n\nexport type CarouselContentProps = React.ComponentProps<'div'>\n\nexport type CarouselItemProps = React.ComponentProps<'div'>\n\nexport type CarouselPreviousProps = React.ComponentProps<typeof Button>\n\nexport type CarouselNextProps = React.ComponentProps<typeof Button>\n\nexport type CarouselIndicatorsProps = React.ComponentProps<'div'> & {\n /** Returns extra props for the dot of each slide index. */\n getIndicatorProps?: (index: number) => React.ComponentProps<'button'>\n}\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0]\n api: ReturnType<typeof useEmblaCarousel>[1]\n scrollPrev: () => void\n scrollNext: () => void\n scrollTo: (index: number) => void\n canScrollPrev: boolean\n canScrollNext: boolean\n selectedIndex: number\n scrollSnaps: number[]\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\nconst EDITABLE_TARGET_SELECTOR = 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"])'\n\nfunction isEditableTarget(target: EventTarget) {\n return target instanceof Element && target.closest(EDITABLE_TARGET_SELECTOR) !== null\n}\n\nfunction Carousel({\n orientation = 'horizontal',\n opts,\n setApi,\n plugins,\n className,\n children,\n onKeyDown,\n ...props\n}: 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 const [selectedIndex, setSelectedIndex] = React.useState(0)\n const [scrollSnaps, setScrollSnaps] = React.useState<number[]>([])\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) return\n setCanScrollPrev(api.canScrollPrev())\n setCanScrollNext(api.canScrollNext())\n setSelectedIndex(api.selectedScrollSnap())\n setScrollSnaps(api.scrollSnapList())\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 scrollTo = React.useCallback(\n (index: number) => {\n api?.scrollTo(index)\n },\n [api]\n )\n\n const isRtl = opts?.direction === 'rtl'\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLElement>) => {\n onKeyDown?.(event as React.KeyboardEvent<HTMLDivElement>)\n // Leave arrows to text fields and to controls inside a slide (slider, radio group...) that handle them.\n if (event.defaultPrevented || isEditableTarget(event.target)) return\n\n const [prevKey, nextKey] =\n orientation === 'vertical'\n ? ['ArrowUp', 'ArrowDown']\n : isRtl\n ? ['ArrowRight', 'ArrowLeft']\n : ['ArrowLeft', 'ArrowRight']\n\n if (event.key === prevKey) {\n event.preventDefault()\n scrollPrev()\n } else if (event.key === nextKey) {\n event.preventDefault()\n scrollNext()\n }\n },\n [onKeyDown, orientation, isRtl, 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('reInit', onSelect)\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 scrollTo,\n canScrollPrev,\n canScrollNext,\n selectedIndex,\n scrollSnaps\n }}\n >\n <section\n role=\"region\"\n aria-roledescription=\"carousel\"\n onKeyDown={handleKeyDown}\n className={cn('relative', className)}\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </section>\n </CarouselContext.Provider>\n )\n}\n\nfunction CarouselContent({ className, ...props }: CarouselContentProps) {\n const { carouselRef, orientation } = useCarousel()\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div className={cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className)} {...props} />\n </div>\n )\n}\n\nfunction CarouselItem({ className, ...props }: CarouselItemProps) {\n const { orientation } = useCarousel()\n\n return (\n <div\n data-slot=\"carousel-item\"\n className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'pl-4' : 'pt-4', className)}\n {...props}\n />\n )\n}\n\nfunction CarouselPrevious({\n className,\n variant = 'secondary',\n size = 'icon-sm',\n onClick,\n ...props\n}: CarouselPreviousProps) {\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 touch-manipulation 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={(event) => {\n onClick?.(event)\n if (!event.defaultPrevented) scrollPrev()\n }}\n {...props}\n >\n <IconChevronLeft />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n )\n}\n\nfunction CarouselNext({ className, variant = 'secondary', size = 'icon-sm', onClick, ...props }: CarouselNextProps) {\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 touch-manipulation 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={(event) => {\n onClick?.(event)\n if (!event.defaultPrevented) scrollNext()\n }}\n {...props}\n >\n <IconChevronRight />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n )\n}\n\nfunction CarouselIndicators({ className, getIndicatorProps, ...props }: CarouselIndicatorsProps) {\n const { orientation, scrollSnaps, selectedIndex, scrollTo } = useCarousel()\n\n if (scrollSnaps.length === 0) {\n return null\n }\n\n return (\n <div\n data-slot=\"carousel-indicators\"\n className={cn(\n 'pointer-events-none absolute flex justify-center gap-2',\n orientation === 'horizontal' ? 'inset-x-0 bottom-4 flex-row' : 'inset-y-0 right-4 flex-col items-center',\n className\n )}\n {...props}\n >\n {scrollSnaps.map((snap, index) => {\n const { className: indicatorClassName, onClick, ...indicatorProps } = getIndicatorProps?.(index) ?? {}\n\n return (\n <button\n key={snap}\n aria-label={`Go to slide ${index + 1}`}\n {...indicatorProps}\n type=\"button\"\n data-slot=\"carousel-indicator\"\n data-active={selectedIndex === index ? true : undefined}\n className={cn(\n 'pointer-events-auto cursor-pointer size-2.5 touch-manipulation rounded-full bg-background opacity-60 shadow-sm ring-1 ring-border transition-opacity hover:opacity-100 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3 focus-visible:outline-none data-[active=true]:opacity-100',\n indicatorClassName\n )}\n onClick={(event) => {\n scrollTo(index)\n onClick?.(event)\n }}\n />\n )\n })}\n </div>\n )\n}\n\nexport { Carousel, CarouselContent, CarouselIndicators, CarouselItem, CarouselNext, CarouselPrevious, useCarousel }\n"],"mappings":"A,4SAqDA,MAAME,EAAkBF,EAAM,cAA2C,IAAI,EAE7E,SAAS,aAAc,CACrB,IAAMG,EAAUH,EAAM,WAAWE,CAAe,EAEhD,GAAI,CAACC,EACH,MAAU,MAAM,gDAAgD,EAGlE,OAAOA,CACT,CAIA,SAAS,iBAAiB,EAAqB,CAC7C,OAAOC,aAAkB,SAAWA,EAAO,QAAQ,2EAAwB,IAAM,IACnF,CAEA,SAAS,SAAS,CAChB,cAAc,aACd,OACA,SACA,UACA,YACA,WACA,YACA,GAAGC,GACa,CAChB,GAAM,CAACC,EAAaC,GAAON,EACzB,CACE,GAAGO,EACH,KAAMC,IAAgB,aAAe,IAAM,GAC7C,EACAC,CACF,EACM,CAACC,EAAeC,GAAoBZ,EAAM,SAAS,EAAK,EACxD,CAACa,EAAeC,GAAoBd,EAAM,SAAS,EAAK,EACxD,CAACe,EAAeC,GAAoBhB,EAAM,SAAS,CAAC,EACpD,CAACiB,EAAaC,GAAkBlB,EAAM,SAAmB,CAAC,CAAC,EAE3DmB,EAAWnB,EAAM,YAAa,GAAqB,CAClDO,IACLK,EAAiBL,EAAI,cAAc,CAAC,EACpCO,EAAiBP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,CAClH,GAAM,CAAE,cAAa,aAAY,iBAAkB,YAAY,EAE/D,MACE,kBAAC4B,EAAD,CACE,YAAU,gBACD,UACH,OACN,UAAWF,EACT,2CACAtB,IAAgB,aACZ,qCACA,iDACJuB,CACF,EACA,SAAU,CAACnB,EACX,QAAU,GAAU,CAClBqB,IAAUP,CAAK,EACVA,EAAM,kBAAkBN,EAAW,CAC1C,EACA,GAAIhB,EAhBN,SAAA,CAkBE,kBAAC+B,EAAD,CAAmB,CAAA,EACnB,kBAAC,OAAD,CAAM,UAAU,UAAU,SAAA,YAAgB,CAAA,CACpC,C,EAEZ,CAEA,SAAS,mBAAmB,CAAE,YAAW,oBAAmB,GAAG/B,GAAkC,CAC/F,GAAM,CAAE,cAAa,cAAa,gBAAe,YAAa,YAAY,EAM1E,OAJIY,EAAY,SAAW,EAClB,KAIP,kBAAC,MAAD,CACE,YAAU,sBACV,UAAWc,EACT,yDACAtB,IAAgB,aAAe,8BAAgC,0CAC/DuB,CACF,EACA,GAAI3B,EAEH,SAAAY,EAAY,KAAK,EAAM,IAAU,CAChC,GAAM,CAAE,UAAWoB,EAAoB,UAAS,GAAGC,GAAmBC,IAAoBhB,CAAK,GAAK,CAAC,EAErG,MACE,kBAAC,SAAD,CAEE,aAAY,eAAeA,EAAQ,IACnC,GAAIe,EACJ,KAAK,SACL,YAAU,qBACV,cAAavB,IAAkBQ,GAAe,IAAA,GAC9C,UAAWQ,EACT,6SACAM,CACF,EACA,QAAU,GAAU,CAClBf,EAASC,CAAK,EACdW,IAAUP,CAAK,CACjB,CACD,EAdMa,CAcN,CAEL,CAAC,CACE,CAAA,CAET,C"}
@@ -1,13 +1,11 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
2
  import * as React from "react";
3
3
  import { VariantProps } from "class-variance-authority";
4
- //#region src/components/center.d.ts
5
4
  declare const centerVariants: (props?: ({
6
5
  direction?: "horizontal" | "vertical" | null | undefined;
7
6
  size?: "lg" | "md" | "sm" | "xl" | "xs" | null | undefined;
8
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
8
  export type CenterProps = React.ComponentProps<'div'> & VariantProps<typeof centerVariants>;
10
9
  declare function Center({ className, direction, size, ...props }: CenterProps): React.JSX.Element;
11
- //#endregion
12
10
  export { Center, centerVariants };
13
11
  //# sourceMappingURL=center.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"center.js","names":["centerVariants","cva","props","direction","size","cn","className"],"sources":["../../src/components/center.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/utils'\n\nconst centerVariants = cva('flex items-center justify-center', {\n variants: {\n direction: {\n horizontal: 'flex-row',\n vertical: 'flex-col'\n },\n size: {\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-3',\n lg: 'gap-4',\n xl: 'gap-6'\n }\n },\n defaultVariants: {\n direction: 'horizontal',\n size: 'md'\n }\n})\n\nexport type CenterProps = React.ComponentProps<'div'> & VariantProps<typeof centerVariants>\n\nfunction Center({ className, direction = 'horizontal', size = 'md', ...props }: CenterProps) {\n return (\n <div\n data-slot=\"center\"\n data-direction={direction}\n data-size={size}\n className={cn(centerVariants({ direction, size }), className)}\n {...props}\n />\n )\n}\n\nexport { Center, centerVariants }\n"],"mappings":"oKAMA,MAAMA,EAAiBC,EAAI,mCAAoC,CAC7D,SAAU,CACR,UAAW,CACT,WAAY,WACZ,SAAU,UACZ,EACA,KAAM,CACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,OACN,CACF,EACA,gBAAiB,CACf,UAAW,aACX,KAAM,IACR,CACF,CAAC,EAID,SAAS,OAAO,CAAE,YAAW,YAAY,aAAc,OAAO,KAAM,GAAGC,GAAsB,CAC3F,MACE,kBAAC,MAAD,CACE,YAAU,SACV,iBAAgBC,EAChB,YAAWC,EACX,UAAWC,EAAGL,EAAe,CAAE,YAAW,MAAK,CAAC,EAAGM,CAAS,EAC5D,GAAIJ,CACL,CAAA,CAEL"}
1
+ {"version":3,"file":"center.js","names":["centerVariants","cva","props","direction","size","cn","className"],"sources":["../../src/components/center.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/utils'\n\nconst centerVariants = cva('flex items-center justify-center', {\n variants: {\n direction: {\n horizontal: 'flex-row',\n vertical: 'flex-col'\n },\n size: {\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-3',\n lg: 'gap-4',\n xl: 'gap-6'\n }\n },\n defaultVariants: {\n direction: 'horizontal',\n size: 'md'\n }\n})\n\nexport type CenterProps = React.ComponentProps<'div'> & VariantProps<typeof centerVariants>\n\nfunction Center({ className, direction = 'horizontal', size = 'md', ...props }: CenterProps) {\n return (\n <div\n data-slot=\"center\"\n data-direction={direction}\n data-size={size}\n className={cn(centerVariants({ direction, size }), className)}\n {...props}\n />\n )\n}\n\nexport { Center, centerVariants }\n"],"mappings":"A,oKAMA,MAAMA,EAAiBC,EAAI,mCAAoC,CAC7D,SAAU,CACR,UAAW,CACT,WAAY,WACZ,SAAU,UACZ,EACA,KAAM,CACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,OACN,CACF,EACA,gBAAiB,CACf,UAAW,aACX,KAAM,IACR,CACF,CAAC,EAID,SAAS,OAAO,CAAE,YAAW,YAAY,aAAc,OAAO,KAAM,GAAGC,GAAsB,CAC3F,MACE,kBAAC,MAAD,CACE,YAAU,SACV,iBAAgBC,EAChB,YAAWC,EACX,UAAWC,EAAGL,EAAe,CAAE,YAAW,MAAK,CAAC,EAAGM,CAAS,EAC5D,GAAIJ,CACL,CAAA,CAEL,C"}
@@ -1,2 +1,2 @@
1
- import { _ as resolveChartColor, a as ChartContainerProps, c as ChartLegendContentProps, d as ChartStyleProps, f as ChartTooltip, g as DEFAULT_CHART_PALETTE, h as ChartTooltipProps, i as ChartContainer, l as ChartLegendProps, m as ChartTooltipContentProps, n as ChartColorKey, o as ChartLegend, p as ChartTooltipContent, r as ChartConfig, s as ChartLegendContent, t as CHART_COLOR_KEYS, u as ChartStyle } from "../chart-B_6nC_ih.js";
1
+ import { _ as resolveChartColor, a as ChartContainerProps, c as ChartLegendContentProps, d as ChartStyleProps, f as ChartTooltip, g as DEFAULT_CHART_PALETTE, h as ChartTooltipProps, i as ChartContainer, l as ChartLegendProps, m as ChartTooltipContentProps, n as ChartColorKey, o as ChartLegend, p as ChartTooltipContent, r as ChartConfig, s as ChartLegendContent, t as CHART_COLOR_KEYS, u as ChartStyle } from "../chart-8rgtsk95.js";
2
2
  export { CHART_COLOR_KEYS, ChartColorKey, ChartConfig, ChartContainer, ChartContainerProps, ChartLegend, ChartLegendContent, ChartLegendContentProps, ChartLegendProps, ChartStyle, ChartStyleProps, ChartTooltip, ChartTooltipContent, ChartTooltipContentProps, ChartTooltipProps, DEFAULT_CHART_PALETTE, resolveChartColor };
@@ -1 +1 @@
1
- {"version":3,"file":"chart.js","names":["React","RechartsPrimitive","THEMES","CHART_COLOR_KEYS","value","DEFAULT_CHART_PALETTE","ChartContext","context","props","uniqueId","chartId","id","cn","className","colorConfig","config","styles","theme","prefix","key","itemConfig","color","ChartTooltip","tooltipLabel","hideLabel","payload","item","labelKey","label","labelFormatter","labelClassName","active","nestLabel","indicator","nameKey","indicatorColor","formatter","index","Fragment","hideIndicator","ChartLegend","verticalAlign","hideIcon","payloadPayload","configLabelKey"],"sources":["../../src/components/chart.tsx"],"sourcesContent":["import * as React from 'react'\n\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 ChartColorKey =\n | 'primary'\n | 'brand'\n | 'gray'\n | 'zinc'\n | 'red'\n | 'yellow'\n | 'green'\n | 'blue'\n | 'indigo'\n | 'pink'\n\nconst CHART_COLOR_KEYS: readonly ChartColorKey[] = [\n 'primary',\n 'brand',\n 'gray',\n 'zinc',\n 'red',\n 'yellow',\n 'green',\n 'blue',\n 'indigo',\n 'pink'\n]\n\nexport function resolveChartColor(value: string | undefined): string | undefined {\n if (!value) return undefined\n if ((CHART_COLOR_KEYS as readonly string[]).includes(value)) {\n return `var(--${value})`\n }\n return value\n}\n\nexport const DEFAULT_CHART_PALETTE = [\n 'var(--chart-1)',\n 'var(--chart-2)',\n 'var(--chart-3)',\n 'var(--chart-4)',\n 'var(--chart-5)'\n] as const\n\nexport type ChartConfig = {\n [k in string]: {\n label?: React.ReactNode\n icon?: React.ComponentType\n } & ({ color?: string; theme?: never } | { color?: never; theme: Record<keyof typeof THEMES, string> })\n}\n\ntype ChartContextProps = {\n config: ChartConfig\n}\n\nexport type ChartContainerProps = React.ComponentProps<'div'> & {\n config: ChartConfig\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children']\n}\n\nexport type ChartStyleProps = {\n id: string\n config: ChartConfig\n}\n\nexport type ChartTooltipProps = React.ComponentProps<typeof RechartsPrimitive.Tooltip>\n\nexport type ChartTooltipContentProps = Partial<\n RechartsPrimitive.DefaultTooltipContentProps<number | string | Array<number | string>, number | string>\n> &\n Omit<React.ComponentProps<'div'>, 'formatter'> & {\n active?: boolean\n color?: string\n hideLabel?: boolean\n hideIndicator?: boolean\n indicator?: 'line' | 'dot' | 'dashed'\n nameKey?: string\n labelKey?: string\n }\n\nexport type ChartLegendProps = React.ComponentProps<typeof RechartsPrimitive.Legend>\n\nexport type ChartLegendContentProps = React.ComponentProps<'div'> &\n Pick<RechartsPrimitive.DefaultLegendContentProps, 'payload' | 'verticalAlign'> & {\n hideIcon?: boolean\n nameKey?: string\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({ id, className, children, config, ...props }: ChartContainerProps) {\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 \"flex aspect-video justify-center text-xs [&_.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-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.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 [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className\n )}\n {...props}\n >\n <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n )\n}\n\nconst ChartStyle = ({ id, config }: ChartStyleProps) => {\n const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color)\n\n if (!colorConfig.length) {\n return null\n }\n\n const styles = 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 return <style>{styles}</style>\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}: ChartTooltipContentProps) {\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' ? config[label as keyof typeof config]?.label || label : itemConfig?.label\n\n if (labelFormatter) {\n return <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>\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 'grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background 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) => item.type !== 'none')\n .map((item, index) => {\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={String(item.dataKey)}\n className={cn(\n 'flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground',\n indicator === 'dot' && 'items-center'\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn('shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)', {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed'\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\">{itemConfig?.label || item.name}</span>\n </div>\n {item.value && (\n <span className=\"font-mono font-medium text-foreground tabular-nums\">\n {item.value.toLocaleString()}\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}: ChartLegendContentProps) {\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 flex-wrap gap-2',\n verticalAlign === 'top' ? 'pb-3' : 'pt-3',\n className\n )}\n >\n {payload\n .filter((item) => item.type !== 'none')\n .map((item) => {\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('flex items-center gap-1 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-3 w-3 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\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 CHART_COLOR_KEYS,\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n ChartTooltip,\n ChartTooltipContent\n}\n"],"mappings":"gMAOA,MAAME,EAAS,CAAE,MAAO,GAAI,KAAM,OAAQ,EAcpCC,EAA6C,CACjD,UACA,QACA,OACA,OACA,MACA,SACA,QACA,OACA,SACA,MACF,EAEA,SAAgB,kBAAkB,EAA+C,CAC/E,GAAKC,EAIL,OAHKD,EAAuC,SAASC,CAAK,EACjD,SAASA,EAAM,GAEjBA,CACT,CAEA,MAAaC,EAAwB,CACnC,iBACA,iBACA,iBACA,iBACA,gBACF,EA8CMC,EAAeN,EAAM,cAAwC,IAAI,EAEvE,SAAS,UAAW,CAClB,IAAMO,EAAUP,EAAM,WAAWM,CAAY,EAE7C,GAAI,CAACC,EACH,MAAU,MAAM,mDAAmD,EAGrE,OAAOA,CACT,CAEA,SAAS,eAAe,CAAE,KAAI,YAAW,WAAU,SAAQ,GAAGC,GAA8B,CAC1F,IAAMC,EAAWT,EAAM,MAAM,EACvBU,EAAU,SAASC,GAAMF,EAAS,QAAQ,KAAM,EAAE,IAExD,MACE,kBAACH,EAAa,SAAd,CAAuB,MAAO,CAAE,QAAO,EACrC,SAAA,kBAAC,MAAD,CACE,YAAU,QACV,aAAYI,EACZ,UAAWE,EACT,8pBACAC,CACF,EACA,GAAIL,EAEJ,SAAA,kBAACP,EAAkB,oBAAnB,CAAwC,UAAgD,CAAA,CACrF,CAAA,CACgB,CAAA,CAE3B,CAEA,MAAM,YAAc,CAAE,KAAI,YAA8B,CACtD,IAAMa,EAAc,OAAO,QAAQC,CAAM,CAAC,CAAC,QAAQ,EAAGA,KAAYA,EAAO,OAASA,EAAO,KAAK,EAE9F,GAAI,CAACD,EAAY,OACf,OAAO,KAGT,IAAME,EAAS,OAAO,QAAQd,CAAM,CAAC,CAClC,KACE,CAAC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S,mBAAmB,CAC1B,YACA,WAAW,GACX,UACA,gBAAgB,SAChB,WAC0B,CAC1B,GAAM,CAAE,UAAW,SAAS,EAM5B,OAJKwB,GAAS,OAKZ,kBAAC,MAAD,CACE,UAAWb,EACT,mDACA6B,IAAkB,MAAQ,OAAS,OACnC5B,CACF,EAEC,SAAAY,EACE,OAAQ,GAASC,EAAK,OAAS,MAAM,CAAC,CACtC,IAAK,GAAS,CACb,IAAMP,EAAM,GAAGe,GAAWR,EAAK,SAAW,UACpCN,EAAa,4BAA4BL,EAAQW,EAAMP,CAAG,EAEhE,MACE,kBAAC,MAAD,CAEE,UAAWP,EAAG,+EAA+E,EAF/F,SAAA,CAIGQ,GAAY,MAAQ,CAACsB,EACpB,kBAACtB,EAAW,KAAZ,CAAkB,CAAA,EAElB,kBAAC,MAAD,CACE,UAAU,iCACV,MAAO,CACL,gBAAiBM,EAAK,KACxB,CACD,CAAA,EAEFN,GAAY,KACV,CAdE,EAAAM,EAAK,KAcP,CAET,CAAC,CACA,CAAA,EApCE,IAsCX,CAEA,SAAS,4BAA4B,EAAqB,EAAkB,EAAa,CACvF,GAAI,OAAOD,GAAY,WAAYA,EACjC,OAGF,IAAMkB,EACJ,YAAalB,GAAW,OAAOA,EAAQ,SAAY,UAAYA,EAAQ,UAAY,KAC/EA,EAAQ,QACR,IAAA,GAEFmB,EAAyBzB,EAY7B,OAVIA,KAAOM,GAAW,OAAOA,EAAQN,IAAiC,SACpE,EAAiBM,EAAQN,GAEzBwB,GACAxB,KAAOwB,GACP,OAAOA,EAAexB,IAAwC,WAE9D,EAAiBwB,EAAexB,IAG3ByB,KAAkB7B,EAASA,EAAO6B,GAAkB7B,EAAOI,EACpE"}
1
+ {"version":3,"file":"chart.js","names":["React","RechartsPrimitive","THEMES","CHART_COLOR_KEYS","value","DEFAULT_CHART_PALETTE","ChartContext","context","props","uniqueId","chartId","id","cn","className","colorConfig","config","styles","theme","prefix","key","itemConfig","color","ChartTooltip","tooltipLabel","hideLabel","payload","item","labelKey","label","labelFormatter","labelClassName","active","nestLabel","indicator","nameKey","indicatorColor","formatter","index","Fragment","hideIndicator","ChartLegend","verticalAlign","hideIcon","payloadPayload","configLabelKey"],"sources":["../../src/components/chart.tsx"],"sourcesContent":["import * as React from 'react'\n\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 ChartColorKey =\n | 'primary'\n | 'brand'\n | 'gray'\n | 'zinc'\n | 'red'\n | 'yellow'\n | 'green'\n | 'blue'\n | 'indigo'\n | 'pink'\n\nconst CHART_COLOR_KEYS: readonly ChartColorKey[] = [\n 'primary',\n 'brand',\n 'gray',\n 'zinc',\n 'red',\n 'yellow',\n 'green',\n 'blue',\n 'indigo',\n 'pink'\n]\n\nexport function resolveChartColor(value: string | undefined): string | undefined {\n if (!value) return undefined\n if ((CHART_COLOR_KEYS as readonly string[]).includes(value)) {\n return `var(--${value})`\n }\n return value\n}\n\nexport const DEFAULT_CHART_PALETTE = [\n 'var(--chart-1)',\n 'var(--chart-2)',\n 'var(--chart-3)',\n 'var(--chart-4)',\n 'var(--chart-5)'\n] as const\n\nexport type ChartConfig = {\n [k in string]: {\n label?: React.ReactNode\n icon?: React.ComponentType\n } & ({ color?: string; theme?: never } | { color?: never; theme: Record<keyof typeof THEMES, string> })\n}\n\ntype ChartContextProps = {\n config: ChartConfig\n}\n\nexport type ChartContainerProps = React.ComponentProps<'div'> & {\n config: ChartConfig\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children']\n}\n\nexport type ChartStyleProps = {\n id: string\n config: ChartConfig\n}\n\nexport type ChartTooltipProps = React.ComponentProps<typeof RechartsPrimitive.Tooltip>\n\nexport type ChartTooltipContentProps = Partial<\n RechartsPrimitive.DefaultTooltipContentProps<number | string | Array<number | string>, number | string>\n> &\n Omit<React.ComponentProps<'div'>, 'formatter'> & {\n active?: boolean\n color?: string\n hideLabel?: boolean\n hideIndicator?: boolean\n indicator?: 'line' | 'dot' | 'dashed'\n nameKey?: string\n labelKey?: string\n }\n\nexport type ChartLegendProps = React.ComponentProps<typeof RechartsPrimitive.Legend>\n\nexport type ChartLegendContentProps = React.ComponentProps<'div'> &\n Pick<RechartsPrimitive.DefaultLegendContentProps, 'payload' | 'verticalAlign'> & {\n hideIcon?: boolean\n nameKey?: string\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({ id, className, children, config, ...props }: ChartContainerProps) {\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 \"flex aspect-video justify-center text-xs [&_.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-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.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 [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className\n )}\n {...props}\n >\n <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n )\n}\n\nconst ChartStyle = ({ id, config }: ChartStyleProps) => {\n const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color)\n\n if (!colorConfig.length) {\n return null\n }\n\n const styles = 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 return <style>{styles}</style>\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}: ChartTooltipContentProps) {\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' ? config[label as keyof typeof config]?.label || label : itemConfig?.label\n\n if (labelFormatter) {\n return <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>\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 'grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background 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) => item.type !== 'none')\n .map((item, index) => {\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={String(item.dataKey)}\n className={cn(\n 'flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground',\n indicator === 'dot' && 'items-center'\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn('shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)', {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed'\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\">{itemConfig?.label || item.name}</span>\n </div>\n {item.value && (\n <span className=\"font-mono font-medium text-foreground tabular-nums\">\n {item.value.toLocaleString()}\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}: ChartLegendContentProps) {\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 flex-wrap gap-2',\n verticalAlign === 'top' ? 'pb-3' : 'pt-3',\n className\n )}\n >\n {payload\n .filter((item) => item.type !== 'none')\n .map((item) => {\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('flex items-center gap-1 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-3 w-3 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\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 CHART_COLOR_KEYS,\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n ChartTooltip,\n ChartTooltipContent\n}\n"],"mappings":"A,gMAOA,MAAME,EAAS,CAAE,MAAO,GAAI,KAAM,OAAQ,EAcpCC,EAA6C,CACjD,UACA,QACA,OACA,OACA,MACA,SACA,QACA,OACA,SACA,MACF,EAEA,SAAgB,kBAAkB,EAA+C,CAC/E,GAAKC,EAIL,OAHKD,EAAuC,SAASC,CAAK,EACjD,SAASA,EAAM,GAEjBA,CACT,CAEA,MAAaC,EAAwB,CACnC,iBACA,iBACA,iBACA,iBACA,gBACF,EA8CMC,EAAeN,EAAM,cAAwC,IAAI,EAEvE,SAAS,UAAW,CAClB,IAAMO,EAAUP,EAAM,WAAWM,CAAY,EAE7C,GAAI,CAACC,EACH,MAAU,MAAM,mDAAmD,EAGrE,OAAOA,CACT,CAEA,SAAS,eAAe,CAAE,KAAI,YAAW,WAAU,SAAQ,GAAGC,GAA8B,CAC1F,IAAMC,EAAWT,EAAM,MAAM,EACvBU,EAAU,SAASC,GAAMF,EAAS,QAAQ,KAAM,EAAE,IAExD,MACE,kBAACH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YA,EAAQ,UAAY,KAC/EA,EAAQ,QACR,IAAA,GAEFmB,EAAyBzB,EAY7B,OAVIA,KAAOM,GAAW,OAAOA,EAAQN,IAAiC,SACpE,EAAiBM,EAAQN,GAEzBwB,GACAxB,KAAOwB,GACP,OAAOA,EAAexB,IAAwC,WAE9D,EAAiBwB,EAAexB,IAG3ByB,KAAkB7B,EAASA,EAAO6B,GAAkB7B,EAAOI,EACpE,C"}
@@ -0,0 +1,19 @@
1
+ import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
+ import { t as AsChildPrimitiveProps } from "../as-child-T9W73ZYU.js";
3
+ import { UIColor } from "../lib/color.js";
4
+ import { CheckboxGroup as CheckboxGroup$1 } from "@base-ui/react/checkbox-group";
5
+ export type CheckboxGroupProps = AsChildPrimitiveProps<typeof CheckboxGroup$1> & {
6
+ /**
7
+ * Palette family for every checkbox in the group; `color` on a `Checkbox` overrides it.
8
+ * @default 'primary'
9
+ */
10
+ color?: UIColor;
11
+ /**
12
+ * Lays the checkboxes out in a column or in a wrapping row.
13
+ * @default 'vertical'
14
+ */
15
+ orientation?: 'vertical' | 'horizontal';
16
+ };
17
+ declare function CheckboxGroup({ className, color, orientation, asChild, children, 'aria-invalid': ariaInvalid, ...props }: CheckboxGroupProps): import("react").JSX.Element;
18
+ export { CheckboxGroup };
19
+ //# sourceMappingURL=checkbox-group.d.ts.map
@@ -0,0 +1,2 @@
1
+ import"../rolldown-runtime-BhWHdk3m.js";import{toAsChildRenderProps as e}from"../lib/as-child.js";import{cn as t}from"../lib/utils.js";import{t as n}from"../checkbox-group-context-HDVxTNPi.js";import{t as r}from"../resolve-class-name-BurP8ngI.js";import{useFieldControlId as i,useFieldInvalid as a,useFieldLabelId as o}from"./field.js";import{useMemo as s}from"react";import{jsx as c}from"react/jsx-runtime";import{cva as l}from"class-variance-authority";import{CheckboxGroup as u}from"@base-ui/react/checkbox-group";const d=l(`flex`,{variants:{orientation:{vertical:`flex-col gap-2`,horizontal:`flex-row flex-wrap gap-x-4 gap-y-2`}},defaultVariants:{orientation:`vertical`}});function CheckboxGroup({className:l,color:f=`primary`,orientation:p=`vertical`,asChild:m,children:h,"aria-invalid":g,..._}){let v=i(),y=o(),b=a(g),x=s(()=>({fieldControlId:v,color:f}),[v,f]);return/* @__PURE__ */ c(n.Provider,{value:x,children:/* @__PURE__ */ c(u,{"data-slot":`checkbox-group`,"data-color":f,"data-orientation":p,"aria-labelledby":y,"aria-invalid":b,className:e=>t(d({orientation:p}),r(l,e)),..._,...e(m,h)})})}export{CheckboxGroup};
2
+ //# sourceMappingURL=checkbox-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox-group.js","names":["CheckboxGroupPrimitive","CheckboxGroupContext","resolveClassName","CheckboxGroup$1","checkboxGroupVariants","cva","ariaInvalid","props","fieldControlId","useFieldControlId","fieldLabelId","useFieldLabelId","invalid","useFieldInvalid","contextValue","useMemo","color","orientation","cn","className","state","toAsChildRenderProps","asChild","children"],"sources":["../../src/components/checkbox-group.tsx"],"sourcesContent":["import { useMemo } from 'react'\n\nimport { CheckboxGroup as CheckboxGroupPrimitive } from '@base-ui/react/checkbox-group'\nimport { cva } from 'class-variance-authority'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport type { UIColor } from '../lib/color'\nimport { cn } from '../lib/utils'\nimport { CheckboxGroupContext } from '../utils/checkbox-group-context'\nimport { resolveClassName } from '../utils/resolve-class-name'\nimport { useFieldControlId, useFieldInvalid, useFieldLabelId } from './field'\n\nconst checkboxGroupVariants = cva('flex', {\n variants: {\n orientation: {\n vertical: 'flex-col gap-2',\n horizontal: 'flex-row flex-wrap gap-x-4 gap-y-2'\n }\n },\n defaultVariants: {\n orientation: 'vertical'\n }\n})\n\nexport type CheckboxGroupProps = AsChildPrimitiveProps<typeof CheckboxGroupPrimitive> & {\n /**\n * Palette family for every checkbox in the group; `color` on a `Checkbox` overrides it.\n * @default 'primary'\n */\n color?: UIColor\n /**\n * Lays the checkboxes out in a column or in a wrapping row.\n * @default 'vertical'\n */\n orientation?: 'vertical' | 'horizontal'\n}\n\nfunction CheckboxGroup({\n className,\n color = 'primary',\n orientation = 'vertical',\n asChild,\n children,\n 'aria-invalid': ariaInvalid,\n ...props\n}: CheckboxGroupProps) {\n const fieldControlId = useFieldControlId()\n const fieldLabelId = useFieldLabelId()\n const invalid = useFieldInvalid(ariaInvalid)\n const contextValue = useMemo(() => ({ fieldControlId, color }), [fieldControlId, color])\n\n return (\n <CheckboxGroupContext.Provider value={contextValue}>\n <CheckboxGroupPrimitive\n data-slot=\"checkbox-group\"\n data-color={color}\n data-orientation={orientation}\n aria-labelledby={fieldLabelId}\n aria-invalid={invalid}\n className={(state) => cn(checkboxGroupVariants({ orientation }), resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n </CheckboxGroupContext.Provider>\n )\n}\n\nexport { CheckboxGroup }\n"],"mappings":"A,qgBAYA,MAAMI,EAAwBC,EAAI,OAAQ,CACxC,SAAU,CACR,YAAa,CACX,SAAU,iBACV,WAAY,oCACd,CACF,EACA,gBAAiB,CACf,YAAa,UACf,CACF,CAAC,EAeD,SAAS,cAAc,CACrB,YACA,QAAQ,UACR,cAAc,WACd,UACA,WACA,eAAgBC,EAChB,GAAGC,GACkB,CACrB,IAAMC,EAAiBC,EAAkB,EACnCC,EAAeC,EAAgB,EAC/BC,EAAUC,EAAgBP,CAAW,EACrCQ,EAAeC,OAAe,CAAE,iBAAgB,OAAM,GAAI,CAACP,EAAgBQ,CAAK,CAAC,EAEvF,MACE,kBAACf,EAAqB,SAAtB,CAA+B,MAAOa,EACpC,SAAA,kBAACd,EAAD,CACE,YAAU,iBACV,aAAYgB,EACZ,mBAAkBC,EAClB,kBAAiBP,EACjB,eAAcE,EACd,UAAY,GAAUM,EAAGd,EAAsB,CAAE,aAAY,CAAC,EAAGF,EAAiBiB,EAAWC,CAAK,CAAC,EACnG,GAAIb,EACJ,GAAIc,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAC4B,CAAA,CAEnC,C"}
@@ -5,14 +5,13 @@ import * as React from "react";
5
5
  import { ReactNode } from "react";
6
6
  import { VariantProps } from "class-variance-authority";
7
7
  import { Checkbox as Checkbox$1 } from "@base-ui/react/checkbox";
8
- //#region src/components/checkbox.d.ts
9
8
  declare const checkboxVariants: (props?: ({
10
9
  color?: "blue" | "brand" | "gray" | "green" | "indigo" | "pink" | "primary" | "red" | "yellow" | "zinc" | null | undefined;
11
10
  size?: "lg" | "md" | "sm" | null | undefined;
12
11
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
13
12
  export type CheckboxProps = Omit<React.ComponentProps<typeof Checkbox$1.Root>, 'render'> & VariantProps<typeof checkboxVariants> & {
14
13
  /**
15
- * Palette family used when checked.
14
+ * Palette family used when checked. Inside a `CheckboxGroup`, the group's `color` is used instead of the default.
16
15
  * @default 'primary'
17
16
  */
18
17
  color?: UIColor;
@@ -25,7 +24,6 @@ export type CheckboxProps = Omit<React.ComponentProps<typeof Checkbox$1.Root>, '
25
24
  /** Props for the rendered description. */
26
25
  descriptionProps?: Omit<React.ComponentProps<'p'>, 'children'>;
27
26
  };
28
- declare function Checkbox({ className, color, id, label, labelProps, description, descriptionProps, size, 'aria-invalid': ariaInvalid, ...props }: CheckboxProps): React.JSX.Element;
29
- //#endregion
27
+ declare function Checkbox({ className, color: colorProp, id, label, labelProps, description, descriptionProps, size, 'aria-invalid': ariaInvalid, ...props }: CheckboxProps): React.JSX.Element;
30
28
  export { Checkbox };
31
29
  //# sourceMappingURL=checkbox.d.ts.map
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.js";import{t}from"../resolve-class-name-BurP8ngI.js";import{selectionControlColorVariants as n}from"../lib/color.js";import{Label as r}from"./label.js";import{useFieldControlId as i,useFieldInvalid as a}from"./field.js";import{IconCheck as o,IconMinus as s}from"@tabler/icons-react";import{useId as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{cva as d}from"class-variance-authority";import{Checkbox as f}from"@base-ui/react/checkbox";const p=d(`border-input dark:data-unchecked:bg-input/30 data-checked:bg-(--selection-control) data-checked:text-(--selection-control-foreground) data-checked:border-(--selection-control) focus-visible:border-ring focus-visible:ring-ring/50 flex items-center justify-center border transition-colors group-has-disabled/field:opacity-50 focus-visible:ring-3 peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50`,{variants:{color:n,size:{sm:`size-3.5 rounded-[3px] [&_[data-slot=checkbox-indicator]>svg]:size-3`,md:`size-4 rounded-[4px] [&_[data-slot=checkbox-indicator]>svg]:size-3.5`,lg:`size-5 rounded-[5px] [&_[data-slot=checkbox-indicator]>svg]:size-4`}},defaultVariants:{color:`primary`,size:`md`}}),m=d(``,{variants:{size:{sm:`text-xs`,md:`text-sm`,lg:`text-lg`}},defaultVariants:{size:`md`}}),h=d(`text-muted-foreground text-left leading-normal font-normal [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,{variants:{size:{sm:`text-xs`,md:`text-xs`,lg:`text-sm`}},defaultVariants:{size:`md`}});function Checkbox({className:n,color:d=`primary`,id:g,label:_,labelProps:v,description:y,descriptionProps:b,size:x=`md`,"aria-invalid":S,...C}){let w=c(),T=i(g),E=a(S),D=_!==void 0,O=T??(D?w:void 0),{className:k,...A}=v??{},j=c(),M=y!==void 0,{className:N,...P}=b??{},F=M?P.id??j:void 0,I=/* @__PURE__ */ l(f.Root,{"data-slot":`checkbox`,"data-color":d,"data-size":x,id:O,"aria-describedby":F,"aria-invalid":E,className:r=>e(p({color:d,size:x}),t(n,r)),...C,children:/* @__PURE__ */ u(f.Indicator,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none`,children:[/* @__PURE__ */ l(o,{className:`block in-data-indeterminate:hidden`}),/* @__PURE__ */ l(s,{className:`hidden in-data-indeterminate:block`})]})});return!D&&!M?I:/* @__PURE__ */ u(`div`,{"data-slot":`checkbox-field`,className:`grid grid-cols-[auto_1fr] items-center justify-items-start gap-x-2 gap-y-0.5`,children:[I,D&&/* @__PURE__ */ l(r,{...A,htmlFor:O,className:e(m({size:x}),k),children:_}),M&&/* @__PURE__ */ l(`p`,{"data-slot":`checkbox-description`,...P,id:F,className:e(`col-start-2`,h({size:x}),N),children:y})]})}export{Checkbox};
1
+ import"../rolldown-runtime-BhWHdk3m.js";import{selectionControlColorVariants as e}from"../lib/color.js";import{cn as t}from"../lib/utils.js";import{t as n}from"../checkbox-group-context-HDVxTNPi.js";import{t as r}from"../resolve-class-name-BurP8ngI.js";import{useFieldControlId as i,useFieldInvalid as a}from"./field.js";import{Label as o}from"./label.js";import{IconCheck as s,IconMinus as c}from"@tabler/icons-react";import{useContext as l,useId as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{cva as p}from"class-variance-authority";import{Checkbox as m}from"@base-ui/react/checkbox";const h=p(`border-input dark:data-unchecked:bg-input/30 data-checked:bg-(--selection-control) data-checked:text-(--selection-control-foreground) data-checked:border-(--selection-control) focus-visible:border-ring focus-visible:ring-ring/50 flex items-center justify-center border transition-colors group-has-disabled/field:opacity-50 focus-visible:ring-3 peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50`,{variants:{color:e,size:{sm:`size-3.5 rounded-[3px] [&_[data-slot=checkbox-indicator]>svg]:size-3`,md:`size-4 rounded-[4px] [&_[data-slot=checkbox-indicator]>svg]:size-3.5`,lg:`size-5 rounded-[5px] [&_[data-slot=checkbox-indicator]>svg]:size-4`}},defaultVariants:{color:`primary`,size:`md`}}),g=p(``,{variants:{size:{sm:`text-xs`,md:`text-sm`,lg:`text-lg`}},defaultVariants:{size:`md`}}),_=p(`text-muted-foreground text-left leading-normal font-normal [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,{variants:{size:{sm:`text-xs`,md:`text-xs`,lg:`text-sm`}},defaultVariants:{size:`md`}});function Checkbox({className:e,color:p,id:v,label:y,labelProps:b,description:x,descriptionProps:S,size:C=`md`,"aria-invalid":w,...T}){let E=u(),D=l(n),O=p??D?.color??`primary`,k=i(v),A=v===void 0&&D!==null&&k===D.fieldControlId?void 0:k,j=a(w),M=y!==void 0,N=A??(M?E:void 0),{className:P,...F}=b??{},I=u(),L=x!==void 0,{className:R,...z}=S??{},B=L?z.id??I:void 0,V=/* @__PURE__ */ d(m.Root,{"data-slot":`checkbox`,"data-color":O,"data-size":C,id:N,"aria-describedby":B,"aria-invalid":j,className:n=>t(h({color:O,size:C}),r(e,n)),...T,children:/* @__PURE__ */ f(m.Indicator,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none`,children:[/* @__PURE__ */ d(s,{className:`block in-data-indeterminate:hidden`}),/* @__PURE__ */ d(c,{className:`hidden in-data-indeterminate:block`})]})});return!M&&!L?V:/* @__PURE__ */ f(`div`,{"data-slot":`checkbox-field`,className:`grid grid-cols-[auto_1fr] items-center justify-items-start gap-x-2 gap-y-0.5`,children:[V,M&&/* @__PURE__ */ d(o,{...F,htmlFor:N,className:t(g({size:C}),P),children:y}),L&&/* @__PURE__ */ d(`p`,{"data-slot":`checkbox-description`,...z,id:B,className:t(`col-start-2`,_({size:C}),R),children:x})]})}export{Checkbox};
2
2
  //# sourceMappingURL=checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","names":["CheckboxPrimitive","Checkbox$1","checkboxVariants","cva","selectionControlColorVariants","checkboxLabelVariants","checkboxDescriptionVariants","ariaInvalid","props","generatedId","useId","fieldControlId","useFieldControlId","id","invalid","useFieldInvalid","hasLabel","label","resolvedId","labelClassName","labelRootProps","labelProps","descriptionId","hasDescription","description","descriptionClassName","descriptionRootProps","descriptionProps","resolvedDescriptionId","checkbox","color","size","cn","resolveClassName","className","state","IconCheck","IconMinus","Label"],"sources":["../../src/components/checkbox.tsx"],"sourcesContent":["import type * as React from 'react'\nimport { type ReactNode, useId } from 'react'\n\nimport { Checkbox as CheckboxPrimitive } from '@base-ui/react/checkbox'\nimport { IconCheck, IconMinus } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport type { UIColor } from '../lib/color'\nimport { selectionControlColorVariants } from '../lib/color'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\nimport { useFieldControlId, useFieldInvalid } from './field'\nimport { Label, type LabelProps } from './label'\n\nconst checkboxVariants = cva(\n 'border-input dark:data-unchecked:bg-input/30 data-checked:bg-(--selection-control) data-checked:text-(--selection-control-foreground) data-checked:border-(--selection-control) focus-visible:border-ring focus-visible:ring-ring/50 flex items-center justify-center border transition-colors group-has-disabled/field:opacity-50 focus-visible:ring-3 peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50',\n {\n variants: {\n color: selectionControlColorVariants,\n size: {\n sm: 'size-3.5 rounded-[3px] [&_[data-slot=checkbox-indicator]>svg]:size-3',\n md: 'size-4 rounded-[4px] [&_[data-slot=checkbox-indicator]>svg]:size-3.5',\n lg: 'size-5 rounded-[5px] [&_[data-slot=checkbox-indicator]>svg]:size-4'\n }\n },\n defaultVariants: {\n color: 'primary',\n size: 'md'\n }\n }\n)\n\nconst checkboxLabelVariants = cva('', {\n variants: {\n size: {\n sm: 'text-xs',\n md: 'text-sm',\n lg: 'text-lg'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n})\n\nconst checkboxDescriptionVariants = cva(\n 'text-muted-foreground text-left leading-normal font-normal [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',\n {\n variants: {\n size: {\n sm: 'text-xs',\n md: 'text-xs',\n lg: 'text-sm'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n }\n)\n\nexport type CheckboxProps = Omit<React.ComponentProps<typeof CheckboxPrimitive.Root>, 'render'> &\n VariantProps<typeof checkboxVariants> & {\n /**\n * Palette family used when checked.\n * @default 'primary'\n */\n color?: UIColor\n /** Label rendered next to the checkbox and linked to it. */\n label?: ReactNode\n /** Props for the rendered label. */\n labelProps?: Omit<LabelProps, 'children' | 'htmlFor'>\n /** Helper text rendered below the label. */\n description?: ReactNode\n /** Props for the rendered description. */\n descriptionProps?: Omit<React.ComponentProps<'p'>, 'children'>\n }\n\nfunction Checkbox({\n className,\n color = 'primary',\n id,\n label,\n labelProps,\n description,\n descriptionProps,\n size = 'md',\n 'aria-invalid': ariaInvalid,\n ...props\n}: CheckboxProps) {\n const generatedId = useId()\n const fieldControlId = useFieldControlId(id)\n const invalid = useFieldInvalid(ariaInvalid)\n const hasLabel = label !== undefined\n const resolvedId = fieldControlId ?? (hasLabel ? generatedId : undefined)\n const { className: labelClassName, ...labelRootProps } = labelProps ?? {}\n const descriptionId = useId()\n const hasDescription = description !== undefined\n const { className: descriptionClassName, ...descriptionRootProps } = descriptionProps ?? {}\n const resolvedDescriptionId = hasDescription ? (descriptionRootProps.id ?? descriptionId) : undefined\n\n const checkbox = (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n data-color={color}\n data-size={size}\n id={resolvedId}\n aria-describedby={resolvedDescriptionId}\n aria-invalid={invalid}\n className={(state) => cn(checkboxVariants({ color, size }), resolveClassName(className, state))}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none\"\n >\n <IconCheck className=\"block in-data-indeterminate:hidden\" />\n <IconMinus className=\"hidden in-data-indeterminate:block\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n\n if (!hasLabel && !hasDescription) {\n return checkbox\n }\n\n return (\n <div\n data-slot=\"checkbox-field\"\n className=\"grid grid-cols-[auto_1fr] items-center justify-items-start gap-x-2 gap-y-0.5\"\n >\n {checkbox}\n {hasLabel && (\n <Label {...labelRootProps} htmlFor={resolvedId} className={cn(checkboxLabelVariants({ size }), labelClassName)}>\n {label}\n </Label>\n )}\n {hasDescription && (\n <p\n data-slot=\"checkbox-description\"\n {...descriptionRootProps}\n id={resolvedDescriptionId}\n className={cn('col-start-2', checkboxDescriptionVariants({ size }), descriptionClassName)}\n >\n {description}\n </p>\n )}\n </div>\n )\n}\n\nexport { Checkbox }\n"],"mappings":"shBAcA,MAAME,EAAmBC,EACvB,yeACA,CACE,SAAU,CACR,MAAOC,EACP,KAAM,CACJ,GAAI,uEACJ,GAAI,uEACJ,GAAI,oEACN,CACF,EACA,gBAAiB,CACf,MAAO,UACP,KAAM,IACR,CACF,CACF,EAEMC,EAAwBF,EAAI,GAAI,CACpC,SAAU,CACR,KAAM,CACJ,GAAI,UACJ,GAAI,UACJ,GAAI,SACN,CACF,EACA,gBAAiB,CACf,KAAM,IACR,CACF,CAAC,EAEKG,EAA8BH,EAClC,+HACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,UACJ,GAAI,UACJ,GAAI,SACN,CACF,EACA,gBAAiB,CACf,KAAM,IACR,CACF,CACF,EAmBA,SAAS,SAAS,CAChB,YACA,QAAQ,UACR,KACA,QACA,aACA,cACA,mBACA,OAAO,KACP,eAAgBI,EAChB,GAAGC,GACa,CAChB,IAAMC,EAAcC,EAAM,EACpBC,EAAiBC,EAAkBC,CAAE,EACrCC,EAAUC,EAAgBR,CAAW,EACrCS,EAAWC,IAAU,IAAA,GACrBC,EAAaP,IAAmBK,EAAWP,EAAc,IAAA,IACzD,CAAE,UAAWU,EAAgB,GAAGC,GAAmBC,GAAc,CAAC,EAClEC,EAAgBZ,EAAM,EACtBa,EAAiBC,IAAgB,IAAA,GACjC,CAAE,UAAWC,EAAsB,GAAGC,GAAyBC,GAAoB,CAAC,EACpFC,EAAwBL,EAAkBG,EAAqB,IAAMJ,EAAiB,IAAA,GAEtFO,EACJ,kBAAC7B,EAAkB,KAAnB,CACE,YAAU,WACV,aAAY8B,EACZ,YAAWC,EACX,GAAIb,EACJ,mBAAkBU,EAClB,eAAcd,EACd,UAAY,GAAUkB,EAAG9B,EAAiB,CAAE,QAAO,MAAK,CAAC,EAAG+B,EAAiBC,EAAWC,CAAK,CAAC,EAC9F,GAAI3B,EAEJ,SAAA,kBAACR,EAAkB,UAAnB,CACE,YAAU,qBACV,UAAU,yDAFZ,SAAA,CAIE,kBAACoC,EAAD,CAAW,UAAU,oCAAsC,CAAA,EAC3D,kBAACC,EAAD,CAAW,UAAU,oCAAsC,CAAA,CAChC,GACP,CAAA,EAO1B,MAJI,CAACrB,GAAY,CAACO,EACTM,EAIP,kBAAC,MAAD,CACE,YAAU,iBACV,UAAU,+EAFZ,SAAA,CAIGA,EACAb,GACC,kBAACsB,EAAD,CAAO,GAAIlB,EAAgB,QAASF,EAAY,UAAWc,EAAG3B,EAAsB,CAAE,MAAK,CAAC,EAAGc,CAAc,EAC1G,SAAAF,CACI,CAAA,EAERM,GACC,kBAAC,IAAD,CACE,YAAU,uBACV,GAAIG,EACJ,GAAIE,EACJ,UAAWI,EAAG,cAAe1B,EAA4B,CAAE,MAAK,CAAC,EAAGmB,CAAoB,EAEvF,SAAAD,CACA,CAAA,CAEF,GAET"}
1
+ {"version":3,"file":"checkbox.js","names":["CheckboxPrimitive","CheckboxGroupContext","resolveClassName","Checkbox$1","checkboxVariants","cva","selectionControlColorVariants","checkboxLabelVariants","checkboxDescriptionVariants","colorProp","ariaInvalid","props","generatedId","useId","group","useContext","color","fieldControlId","useFieldControlId","id","ownFieldControlId","invalid","useFieldInvalid","hasLabel","label","resolvedId","labelClassName","labelRootProps","labelProps","descriptionId","hasDescription","description","descriptionClassName","descriptionRootProps","descriptionProps","resolvedDescriptionId","checkbox","size","cn","className","state","IconCheck","IconMinus","Label"],"sources":["../../src/components/checkbox.tsx"],"sourcesContent":["import type * as React from 'react'\nimport { type ReactNode, useContext, useId } from 'react'\n\nimport { Checkbox as CheckboxPrimitive } from '@base-ui/react/checkbox'\nimport { IconCheck, IconMinus } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport type { UIColor } from '../lib/color'\nimport { selectionControlColorVariants } from '../lib/color'\nimport { cn } from '../lib/utils'\nimport { CheckboxGroupContext } from '../utils/checkbox-group-context'\nimport { resolveClassName } from '../utils/resolve-class-name'\nimport { useFieldControlId, useFieldInvalid } from './field'\nimport { Label, type LabelProps } from './label'\n\nconst checkboxVariants = cva(\n 'border-input dark:data-unchecked:bg-input/30 data-checked:bg-(--selection-control) data-checked:text-(--selection-control-foreground) data-checked:border-(--selection-control) focus-visible:border-ring focus-visible:ring-ring/50 flex items-center justify-center border transition-colors group-has-disabled/field:opacity-50 focus-visible:ring-3 peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50',\n {\n variants: {\n color: selectionControlColorVariants,\n size: {\n sm: 'size-3.5 rounded-[3px] [&_[data-slot=checkbox-indicator]>svg]:size-3',\n md: 'size-4 rounded-[4px] [&_[data-slot=checkbox-indicator]>svg]:size-3.5',\n lg: 'size-5 rounded-[5px] [&_[data-slot=checkbox-indicator]>svg]:size-4'\n }\n },\n defaultVariants: {\n color: 'primary',\n size: 'md'\n }\n }\n)\n\nconst checkboxLabelVariants = cva('', {\n variants: {\n size: {\n sm: 'text-xs',\n md: 'text-sm',\n lg: 'text-lg'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n})\n\nconst checkboxDescriptionVariants = cva(\n 'text-muted-foreground text-left leading-normal font-normal [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',\n {\n variants: {\n size: {\n sm: 'text-xs',\n md: 'text-xs',\n lg: 'text-sm'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n }\n)\n\nexport type CheckboxProps = Omit<React.ComponentProps<typeof CheckboxPrimitive.Root>, 'render'> &\n VariantProps<typeof checkboxVariants> & {\n /**\n * Palette family used when checked. Inside a `CheckboxGroup`, the group's `color` is used instead of the default.\n * @default 'primary'\n */\n color?: UIColor\n /** Label rendered next to the checkbox and linked to it. */\n label?: ReactNode\n /** Props for the rendered label. */\n labelProps?: Omit<LabelProps, 'children' | 'htmlFor'>\n /** Helper text rendered below the label. */\n description?: ReactNode\n /** Props for the rendered description. */\n descriptionProps?: Omit<React.ComponentProps<'p'>, 'children'>\n }\n\nfunction Checkbox({\n className,\n color: colorProp,\n id,\n label,\n labelProps,\n description,\n descriptionProps,\n size = 'md',\n 'aria-invalid': ariaInvalid,\n ...props\n}: CheckboxProps) {\n const generatedId = useId()\n const group = useContext(CheckboxGroupContext)\n const color = colorProp ?? group?.color ?? 'primary'\n const fieldControlId = useFieldControlId(id)\n const ownFieldControlId =\n id === undefined && group !== null && fieldControlId === group.fieldControlId ? undefined : fieldControlId\n const invalid = useFieldInvalid(ariaInvalid)\n const hasLabel = label !== undefined\n const resolvedId = ownFieldControlId ?? (hasLabel ? generatedId : undefined)\n const { className: labelClassName, ...labelRootProps } = labelProps ?? {}\n const descriptionId = useId()\n const hasDescription = description !== undefined\n const { className: descriptionClassName, ...descriptionRootProps } = descriptionProps ?? {}\n const resolvedDescriptionId = hasDescription ? (descriptionRootProps.id ?? descriptionId) : undefined\n\n const checkbox = (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n data-color={color}\n data-size={size}\n id={resolvedId}\n aria-describedby={resolvedDescriptionId}\n aria-invalid={invalid}\n className={(state) => cn(checkboxVariants({ color, size }), resolveClassName(className, state))}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none\"\n >\n <IconCheck className=\"block in-data-indeterminate:hidden\" />\n <IconMinus className=\"hidden in-data-indeterminate:block\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n\n if (!hasLabel && !hasDescription) {\n return checkbox\n }\n\n return (\n <div\n data-slot=\"checkbox-field\"\n className=\"grid grid-cols-[auto_1fr] items-center justify-items-start gap-x-2 gap-y-0.5\"\n >\n {checkbox}\n {hasLabel && (\n <Label {...labelRootProps} htmlFor={resolvedId} className={cn(checkboxLabelVariants({ size }), labelClassName)}>\n {label}\n </Label>\n )}\n {hasDescription && (\n <p\n data-slot=\"checkbox-description\"\n {...descriptionRootProps}\n id={resolvedDescriptionId}\n className={cn('col-start-2', checkboxDescriptionVariants({ size }), descriptionClassName)}\n >\n {description}\n </p>\n )}\n </div>\n )\n}\n\nexport { Checkbox }\n"],"mappings":"A,qmBAeA,MAAMI,EAAmBC,EACvB,yeACA,CACE,SAAU,CACR,MAAOC,EACP,KAAM,CACJ,GAAI,uEACJ,GAAI,uEACJ,GAAI,oEACN,CACF,EACA,gBAAiB,CACf,MAAO,UACP,KAAM,IACR,CACF,CACF,EAEMC,EAAwBF,EAAI,GAAI,CACpC,SAAU,CACR,KAAM,CACJ,GAAI,UACJ,GAAI,UACJ,GAAI,SACN,CACF,EACA,gBAAiB,CACf,KAAM,IACR,CACF,CAAC,EAEKG,EAA8BH,EAClC,+HACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,UACJ,GAAI,UACJ,GAAI,SACN,CACF,EACA,gBAAiB,CACf,KAAM,IACR,CACF,CACF,EAmBA,SAAS,SAAS,CAChB,YACA,MAAOI,EACP,KACA,QACA,aACA,cACA,mBACA,OAAO,KACP,eAAgBC,EAChB,GAAGC,GACa,CAChB,IAAMC,EAAcC,EAAM,EACpBC,EAAQC,EAAWd,CAAoB,EACvCe,EAAQP,GAAaK,GAAO,OAAS,UACrCG,EAAiBC,EAAkBC,CAAE,EACrCC,EACJD,IAAO,IAAA,IAAaL,IAAU,MAAQG,IAAmBH,EAAM,eAAiB,IAAA,GAAYG,EACxFI,EAAUC,EAAgBZ,CAAW,EACrCa,EAAWC,IAAU,IAAA,GACrBC,EAAaL,IAAsBG,EAAWX,EAAc,IAAA,IAC5D,CAAE,UAAWc,EAAgB,GAAGC,GAAmBC,GAAc,CAAC,EAClEC,EAAgBhB,EAAM,EACtBiB,EAAiBC,IAAgB,IAAA,GACjC,CAAE,UAAWC,EAAsB,GAAGC,GAAyBC,GAAoB,CAAC,EACpFC,EAAwBL,EAAkBG,EAAqB,IAAMJ,EAAiB,IAAA,GAEtFO,EACJ,kBAACpC,EAAkB,KAAnB,CACE,YAAU,WACV,aAAYgB,EACZ,YAAWqB,EACX,GAAIZ,EACJ,mBAAkBU,EAClB,eAAcd,EACd,UAAY,GAAUiB,EAAGlC,EAAiB,CAAE,QAAO,MAAK,CAAC,EAAGF,EAAiBqC,EAAWC,CAAK,CAAC,EAC9F,GAAI7B,EAEJ,SAAA,kBAACX,EAAkB,UAAnB,CACE,YAAU,qBACV,UAAU,yDAFZ,SAAA,CAIE,kBAACyC,EAAD,CAAW,UAAU,oCAAsC,CAAA,EAC3D,kBAACC,EAAD,CAAW,UAAU,oCAAsC,CAAA,CAChC,C,EACP,CAAA,EAO1B,MAJI,CAACnB,GAAY,CAACO,EACTM,EAIP,kBAAC,MAAD,CACE,YAAU,iBACV,UAAU,+EAFZ,SAAA,CAIGA,EACAb,GACC,kBAACoB,EAAD,CAAO,GAAIhB,EAAgB,QAASF,EAAY,UAAWa,EAAG/B,EAAsB,CAAE,MAAK,CAAC,EAAGmB,CAAc,EAC1G,SAAAF,CACI,CAAA,EAERM,GACC,kBAAC,IAAD,CACE,YAAU,uBACV,GAAIG,EACJ,GAAIE,EACJ,UAAWG,EAAG,cAAe9B,EAA4B,CAAE,MAAK,CAAC,EAAGwB,CAAoB,EAEvF,SAAAD,CACA,CAAA,CAEF,C,EAET,C"}
@@ -1,8 +1,6 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
2
  import * as React from "react";
3
- //#region src/components/code.d.ts
4
3
  export type CodeProps = React.ComponentProps<'code'>;
5
4
  declare function Code({ className, ...props }: CodeProps): React.JSX.Element;
6
- //#endregion
7
5
  export { Code };
8
6
  //# sourceMappingURL=code.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"code.js","names":["props","cn","className"],"sources":["../../src/components/code.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cn } from '../lib/utils'\n\nexport type CodeProps = React.ComponentProps<'code'>\n\nfunction Code({ className, ...props }: CodeProps) {\n return (\n <code\n data-slot=\"code\"\n className={cn(\n 'bg-muted text-foreground inline-flex w-fit items-center rounded-md px-1.5 py-0.5 font-mono text-[0.875em] font-medium',\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Code }\n"],"mappings":"qHAMA,SAAS,KAAK,CAAE,YAAW,GAAGA,GAAoB,CAChD,MACE,kBAAC,OAAD,CACE,YAAU,OACV,UAAWC,EACT,wHACAC,CACF,EACA,GAAIF,CACL,CAAA,CAEL"}
1
+ {"version":3,"file":"code.js","names":["props","cn","className"],"sources":["../../src/components/code.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cn } from '../lib/utils'\n\nexport type CodeProps = React.ComponentProps<'code'>\n\nfunction Code({ className, ...props }: CodeProps) {\n return (\n <code\n data-slot=\"code\"\n className={cn(\n 'bg-muted text-foreground inline-flex w-fit items-center rounded-md px-1.5 py-0.5 font-mono text-[0.875em] font-medium',\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Code }\n"],"mappings":"A,qHAMA,SAAS,KAAK,CAAE,YAAW,GAAGA,GAAoB,CAChD,MACE,kBAAC,OAAD,CACE,YAAU,OACV,UAAWC,EACT,wHACAC,CACF,EACA,GAAIF,CACL,CAAA,CAEL,C"}
@@ -1,13 +1,11 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
- import { t as AsChildPrimitiveProps } from "../as-child-Dxg3Xo1G.js";
2
+ import { t as AsChildPrimitiveProps } from "../as-child-T9W73ZYU.js";
3
3
  import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
4
- //#region src/components/collapsible.d.ts
5
4
  export type CollapsibleProps = AsChildPrimitiveProps<typeof Collapsible$1.Root>;
6
5
  export type CollapsibleTriggerProps = AsChildPrimitiveProps<typeof Collapsible$1.Trigger>;
7
6
  export type CollapsibleContentProps = AsChildPrimitiveProps<typeof Collapsible$1.Panel>;
8
7
  declare function Collapsible({ asChild, children, ...props }: CollapsibleProps): import("react").JSX.Element;
9
8
  declare function CollapsibleTrigger({ asChild, children, ...props }: CollapsibleTriggerProps): import("react").JSX.Element;
10
9
  declare function CollapsibleContent({ asChild, children, ...props }: CollapsibleContentProps): import("react").JSX.Element;
11
- //#endregion
12
10
  export { Collapsible, CollapsibleContent, CollapsibleTrigger };
13
11
  //# sourceMappingURL=collapsible.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"collapsible.js","names":["CollapsiblePrimitive","Collapsible$1","props","toAsChildRenderProps","asChild","children"],"sources":["../../src/components/collapsible.tsx"],"sourcesContent":["import { Collapsible as CollapsiblePrimitive } from '@base-ui/react/collapsible'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\n\nexport type CollapsibleProps = AsChildPrimitiveProps<typeof CollapsiblePrimitive.Root>\n\nexport type CollapsibleTriggerProps = AsChildPrimitiveProps<typeof CollapsiblePrimitive.Trigger>\n\nexport type CollapsibleContentProps = AsChildPrimitiveProps<typeof CollapsiblePrimitive.Panel>\n\nfunction Collapsible({ asChild, children, ...props }: CollapsibleProps) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} {...toAsChildRenderProps(asChild, children)} />\n}\n\nfunction CollapsibleTrigger({ asChild, children, ...props }: CollapsibleTriggerProps) {\n return (\n <CollapsiblePrimitive.Trigger\n data-slot=\"collapsible-trigger\"\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction CollapsibleContent({ asChild, children, ...props }: CollapsibleContentProps) {\n return (\n <CollapsiblePrimitive.Panel\n data-slot=\"collapsible-content\"\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nexport { Collapsible, CollapsibleContent, CollapsibleTrigger }\n"],"mappings":"mMAUA,SAAS,YAAY,CAAE,UAAS,WAAU,GAAGE,GAA2B,CACtE,MAAO,kBAACF,EAAqB,KAAtB,CAA2B,YAAU,cAAc,GAAIE,EAAO,GAAIC,EAAqBC,EAASC,CAAQ,CAAI,CAAA,CACrH,CAEA,SAAS,mBAAmB,CAAE,UAAS,WAAU,GAAGH,GAAkC,CACpF,MACE,kBAACF,EAAqB,QAAtB,CACE,YAAU,sBACV,GAAIE,EACJ,GAAIC,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,mBAAmB,CAAE,UAAS,WAAU,GAAGH,GAAkC,CACpF,MACE,kBAACF,EAAqB,MAAtB,CACE,YAAU,sBACV,GAAIE,EACJ,GAAIC,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL"}
1
+ {"version":3,"file":"collapsible.js","names":["CollapsiblePrimitive","Collapsible$1","props","toAsChildRenderProps","asChild","children"],"sources":["../../src/components/collapsible.tsx"],"sourcesContent":["import { Collapsible as CollapsiblePrimitive } from '@base-ui/react/collapsible'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\n\nexport type CollapsibleProps = AsChildPrimitiveProps<typeof CollapsiblePrimitive.Root>\n\nexport type CollapsibleTriggerProps = AsChildPrimitiveProps<typeof CollapsiblePrimitive.Trigger>\n\nexport type CollapsibleContentProps = AsChildPrimitiveProps<typeof CollapsiblePrimitive.Panel>\n\nfunction Collapsible({ asChild, children, ...props }: CollapsibleProps) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} {...toAsChildRenderProps(asChild, children)} />\n}\n\nfunction CollapsibleTrigger({ asChild, children, ...props }: CollapsibleTriggerProps) {\n return (\n <CollapsiblePrimitive.Trigger\n data-slot=\"collapsible-trigger\"\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction CollapsibleContent({ asChild, children, ...props }: CollapsibleContentProps) {\n return (\n <CollapsiblePrimitive.Panel\n data-slot=\"collapsible-content\"\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nexport { Collapsible, CollapsibleContent, CollapsibleTrigger }\n"],"mappings":"A,mMAUA,SAAS,YAAY,CAAE,UAAS,WAAU,GAAGE,GAA2B,CACtE,MAAO,kBAACF,EAAqB,KAAtB,CAA2B,YAAU,cAAc,GAAIE,EAAO,GAAIC,EAAqBC,EAASC,CAAQ,CAAI,CAAA,CACrH,CAEA,SAAS,mBAAmB,CAAE,UAAS,WAAU,GAAGH,GAAkC,CACpF,MACE,kBAACF,EAAqB,QAAtB,CACE,YAAU,sBACV,GAAIE,EACJ,GAAIC,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,mBAAmB,CAAE,UAAS,WAAU,GAAGH,GAAkC,CACpF,MACE,kBAACF,EAAqB,MAAtB,CACE,YAAU,sBACV,GAAIE,EACJ,GAAIC,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,C"}
@@ -1,8 +1,7 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
- import { t as AsChildPrimitiveProps } from "../as-child-Dxg3Xo1G.js";
2
+ import { t as AsChildPrimitiveProps } from "../as-child-T9W73ZYU.js";
3
3
  import * as React from "react";
4
4
  import { Combobox as Combobox$1 } from "@base-ui/react/combobox";
5
- //#region src/components/combobox.d.ts
6
5
  export type ComboboxProps<Value = unknown, Multiple extends boolean | undefined = false> = Combobox$1.Root.Props<Value, Multiple>;
7
6
  export type ComboboxValueProps = Combobox$1.Value.Props;
8
7
  export type ComboboxTriggerProps = AsChildPrimitiveProps<typeof Combobox$1.Trigger> & {
@@ -68,6 +67,5 @@ declare function ComboboxChips({ className, children, showClear, asChild, ...pro
68
67
  declare function ComboboxChip({ className, children, showRemove, asChild, ...props }: ComboboxChipProps): React.JSX.Element;
69
68
  declare function ComboboxChipsInput({ className, id, 'aria-invalid': ariaInvalid, ...props }: ComboboxChipsInputProps): React.JSX.Element;
70
69
  declare function useComboboxAnchor(): React.RefObject<HTMLDivElement | null>;
71
- //#endregion
72
70
  export { Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxClear, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, useComboboxAnchor };
73
71
  //# sourceMappingURL=combobox.d.ts.map
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-BhWHdk3m.js";import{toAsChildRenderProps as e}from"../lib/as-child.js";import{cn as t}from"../lib/utils.js";import{t as n}from"../resolve-class-name-BurP8ngI.js";import{Button as r}from"./button.js";import{useFieldControlId as i,useFieldInvalid as a}from"./field.js";import{InputGroup as o,InputGroupAddon as s,InputGroupButton as c,InputGroupInput as l}from"./input-group.js";import{IconCheck as u,IconSelector as d,IconX as f}from"@tabler/icons-react";import*as p from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{Combobox as g}from"@base-ui/react/combobox";const _=g.Root;function ComboboxValue({...e}){return/* @__PURE__ */ m(g.Value,{"data-slot":`combobox-value`,...e})}function ComboboxTrigger({className:r,children:i,icon:a=/* @__PURE__ */ m(d,{className:`pointer-events-none size-4 text-muted-foreground`}),asChild:o,...s}){return/* @__PURE__ */ h(g.Trigger,{"data-slot":`combobox-trigger`,className:e=>t(`[&_svg:not([class*='size-'])]:size-4`,n(r,e)),...s,...e(o,i),children:[!o&&i,!o&&a]})}function ComboboxClear({className:e,...r}){return/* @__PURE__ */ m(g.Clear,{"data-slot":`combobox-clear`,render:/* @__PURE__ */ m(c,{variant:`ghost`,size:`icon-xs`}),className:r=>t(n(e,r)),...r,children:/* @__PURE__ */ m(f,{className:`pointer-events-none`})})}function ComboboxInput({className:e,children:n,disabled:r=!1,icon:a,id:u,showTrigger:d=!0,showClear:f=!1,triggerIcon:p,..._}){let v=i(u);return/* @__PURE__ */ h(o,{className:t(`w-auto`,e),children:[a&&/* @__PURE__ */ m(s,{align:`inline-start`,children:a}),/* @__PURE__ */ m(g.Input,{id:v,render:/* @__PURE__ */ m(l,{disabled:r}),..._}),/* @__PURE__ */ h(s,{align:`inline-end`,children:[d&&/* @__PURE__ */ m(c,{size:`icon-xs`,variant:`ghost`,asChild:!0,"data-slot":`input-group-button`,className:`group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent`,disabled:r,children:/* @__PURE__ */ m(ComboboxTrigger,{icon:p})}),f&&/* @__PURE__ */ m(ComboboxClear,{disabled:r})]}),n]})}function ComboboxContent({className:r,asChild:i,children:a,side:o=`bottom`,sideOffset:s=6,align:c=`start`,alignOffset:l=0,anchor:u,container:d,keepMounted:f,positionMethod:p=`absolute`,collisionBoundary:h,collisionPadding:_,sticky:v,arrowPadding:y,disableAnchorTracking:b,collisionAvoidance:x,...S}){return/* @__PURE__ */ m(g.Portal,{container:d,keepMounted:f,children:/* @__PURE__ */ m(g.Positioner,{side:o,sideOffset:s,align:c,alignOffset:l,anchor:u,positionMethod:p,collisionBoundary:h,collisionPadding:_,sticky:v,arrowPadding:y,disableAnchorTracking:b,collisionAvoidance:x,className:`isolate z-50`,children:/* @__PURE__ */ m(g.Popup,{"data-slot":`combobox-content`,"data-chips":!!u,className:e=>t(`group/combobox-content max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+(--spacing(7)))] origin-(--transform-origin) overflow-hidden rounded-lg text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!`,n(r,e)),...S,...e(i,a)})})})}function ComboboxList({className:r,asChild:i,children:a,...o}){return/* @__PURE__ */ m(g.List,{"data-slot":`combobox-list`,className:e=>t(`no-scrollbar max-h-[min(calc(--spacing(72)-(--spacing(9))),calc(var(--available-height)-(--spacing(9))))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0`,n(r,e)),...o,...e(i,a)})}function ComboboxItem({className:r,children:i,asChild:a,...o}){return/* @__PURE__ */ h(g.Item,{"data-slot":`combobox-item`,className:e=>t(`relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,n(r,e)),...o,...e(a,i),children:[!a&&i,!a&&/* @__PURE__ */ m(g.ItemIndicator,{render:/* @__PURE__ */ m(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:/* @__PURE__ */ m(u,{className:`pointer-events-none`})})]})}function ComboboxGroup({className:r,asChild:i,children:a,...o}){return/* @__PURE__ */ m(g.Group,{"data-slot":`combobox-group`,className:e=>t(n(r,e)),...o,...e(i,a)})}function ComboboxLabel({className:r,asChild:i,children:a,...o}){return/* @__PURE__ */ m(g.GroupLabel,{"data-slot":`combobox-label`,className:e=>t(`px-2 py-1.5 text-xs text-muted-foreground`,n(r,e)),...o,...e(i,a)})}function ComboboxCollection({...e}){return/* @__PURE__ */ m(g.Collection,{"data-slot":`combobox-collection`,...e})}function ComboboxEmpty({className:r,asChild:i,children:a,...o}){return/* @__PURE__ */ m(g.Empty,{"data-slot":`combobox-empty`,className:e=>t(`hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex`,n(r,e)),...o,...e(i,a)})}function ComboboxSeparator({className:r,asChild:i,children:a,...o}){return/* @__PURE__ */ m(g.Separator,{"data-slot":`combobox-separator`,className:e=>t(`-mx-1 my-1 h-px bg-border`,n(r,e)),...o,...e(i,a)})}function ComboboxChips({className:i,children:a,showClear:o=!1,asChild:s,...c}){return/* @__PURE__ */ h(g.Chips,{"data-slot":`combobox-chips`,className:e=>t(`flex min-h-8 overflow-hidden flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40`,n(i,e)),...c,...e(s,a),children:[!s&&a,o&&!s&&/* @__PURE__ */ m(g.Clear,{"data-slot":`combobox-chips-clear`,render:/* @__PURE__ */ m(r,{variant:`ghost`,color:`zinc`,size:`icon-xs`}),className:`shrink-0 self-center size-5`,children:/* @__PURE__ */ m(f,{className:`pointer-events-none`})})]})}function ComboboxChip({className:i,children:a,showRemove:o=!0,asChild:s,...c}){return/* @__PURE__ */ h(g.Chip,{"data-slot":`combobox-chip`,className:e=>t(`flex h-[calc(--spacing(5.25))] w-fit text-left max-w-full items-center justify-start gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0`,n(i,e)),...c,...e(s,a),children:[!s&&/* @__PURE__ */ m(`span`,{className:`flex-1 truncate`,children:a}),o&&!s&&/* @__PURE__ */ m(g.ChipRemove,{render:/* @__PURE__ */ m(r,{variant:`ghost`,color:`zinc`,size:`icon-xs`}),className:`-ml-1 opacity-50 shrink-0 hover:opacity-100`,"data-slot":`combobox-chip-remove`,children:/* @__PURE__ */ m(f,{className:`pointer-events-none`})})]})}function ComboboxChipsInput({className:e,id:r,"aria-invalid":o,...s}){let c=i(r),l=a(o);return/* @__PURE__ */ m(g.Input,{id:c,"aria-invalid":l,"data-slot":`combobox-chip-input`,className:r=>t(`min-w-16 flex-1 outline-none`,n(e,r)),...s})}function useComboboxAnchor(){return p.useRef(null)}export{_ as Combobox,ComboboxChip,ComboboxChips,ComboboxChipsInput,ComboboxClear,ComboboxCollection,ComboboxContent,ComboboxEmpty,ComboboxGroup,ComboboxInput,ComboboxItem,ComboboxLabel,ComboboxList,ComboboxSeparator,ComboboxTrigger,ComboboxValue,useComboboxAnchor};
1
+ import"../rolldown-runtime-BhWHdk3m.js";import{toAsChildRenderProps as e}from"../lib/as-child.js";import{cn as t}from"../lib/utils.js";import{a as n,i as r,n as i,o as a,r as o,t as s}from"../combobox-styles-CZ0aJayc.js";import{t as c}from"../resolve-class-name-BurP8ngI.js";import{Button as l}from"./button.js";import{useFieldControlId as u,useFieldInvalid as d}from"./field.js";import{InputGroup as f,InputGroupAddon as p,InputGroupButton as m,InputGroupInput as h}from"./input-group.js";import{IconCheck as g,IconSelector as _,IconX as v}from"@tabler/icons-react";import*as y from"react";import{jsx as b,jsxs as x}from"react/jsx-runtime";import{Combobox as S}from"@base-ui/react/combobox";const C=S.Root;function ComboboxValue({...e}){return/* @__PURE__ */ b(S.Value,{"data-slot":`combobox-value`,...e})}function ComboboxTrigger({className:n,children:r,icon:i=/* @__PURE__ */ b(_,{className:`pointer-events-none size-4 text-muted-foreground`}),asChild:a,...o}){return/* @__PURE__ */ x(S.Trigger,{"data-slot":`combobox-trigger`,className:e=>t(`[&_svg:not([class*='size-'])]:size-4`,c(n,e)),...o,...e(a,r),children:[!a&&r,!a&&i]})}function ComboboxClear({className:e,...n}){return/* @__PURE__ */ b(S.Clear,{"data-slot":`combobox-clear`,render:/* @__PURE__ */ b(m,{variant:`ghost`,size:`icon-xs`}),className:n=>t(c(e,n)),...n,children:/* @__PURE__ */ b(v,{className:`pointer-events-none`})})}function ComboboxInput({className:e,children:n,disabled:r=!1,icon:i,id:a,showTrigger:o=!0,showClear:s=!1,triggerIcon:c,...l}){let d=u(a);return/* @__PURE__ */ x(f,{className:t(`w-auto`,e),children:[i&&/* @__PURE__ */ b(p,{align:`inline-start`,children:i}),/* @__PURE__ */ b(S.Input,{id:d,render:/* @__PURE__ */ b(h,{disabled:r}),...l}),/* @__PURE__ */ x(p,{align:`inline-end`,children:[o&&/* @__PURE__ */ b(m,{size:`icon-xs`,variant:`ghost`,asChild:!0,"data-slot":`input-group-button`,className:`group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent`,disabled:r,children:/* @__PURE__ */ b(ComboboxTrigger,{icon:c})}),s&&/* @__PURE__ */ b(ComboboxClear,{disabled:r})]}),n]})}function ComboboxContent({className:r,asChild:i,children:a,side:o=`bottom`,sideOffset:s=6,align:l=`start`,alignOffset:u=0,anchor:d,container:f,keepMounted:p,positionMethod:m=`absolute`,collisionBoundary:h,collisionPadding:g,sticky:_,arrowPadding:v,disableAnchorTracking:y,collisionAvoidance:x,...C}){return/* @__PURE__ */ b(S.Portal,{container:f,keepMounted:p,children:/* @__PURE__ */ b(S.Positioner,{side:o,sideOffset:s,align:l,alignOffset:u,anchor:d,positionMethod:m,collisionBoundary:h,collisionPadding:g,sticky:_,arrowPadding:v,disableAnchorTracking:y,collisionAvoidance:x,className:`isolate z-50`,children:/* @__PURE__ */ b(S.Popup,{"data-slot":`combobox-content`,"data-chips":!!d,className:e=>t(n,c(r,e)),...C,...e(i,a)})})})}function ComboboxList({className:n,asChild:i,children:a,...o}){return/* @__PURE__ */ b(S.List,{"data-slot":`combobox-list`,className:e=>t(r,c(n,e)),...o,...e(i,a)})}function ComboboxItem({className:n,children:r,asChild:i,...a}){return/* @__PURE__ */ x(S.Item,{"data-slot":`combobox-item`,className:e=>t(o,`pr-8`,c(n,e)),...a,...e(i,r),children:[!i&&r,!i&&/* @__PURE__ */ b(S.ItemIndicator,{render:/* @__PURE__ */ b(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:/* @__PURE__ */ b(g,{className:`pointer-events-none`})})]})}function ComboboxGroup({className:n,asChild:r,children:i,...a}){return/* @__PURE__ */ b(S.Group,{"data-slot":`combobox-group`,className:e=>t(c(n,e)),...a,...e(r,i)})}function ComboboxLabel({className:n,asChild:r,children:a,...o}){return/* @__PURE__ */ b(S.GroupLabel,{"data-slot":`combobox-label`,className:e=>t(i,c(n,e)),...o,...e(r,a)})}function ComboboxCollection({...e}){return/* @__PURE__ */ b(S.Collection,{"data-slot":`combobox-collection`,...e})}function ComboboxEmpty({className:n,asChild:r,children:i,...a}){return/* @__PURE__ */ b(S.Empty,{"data-slot":`combobox-empty`,className:e=>t(s,c(n,e)),...a,...e(r,i)})}function ComboboxSeparator({className:n,asChild:r,children:i,...o}){return/* @__PURE__ */ b(S.Separator,{"data-slot":`combobox-separator`,className:e=>t(a,c(n,e)),...o,...e(r,i)})}function ComboboxChips({className:n,children:r,showClear:i=!1,asChild:a,...o}){return/* @__PURE__ */ x(S.Chips,{"data-slot":`combobox-chips`,className:e=>t(`flex min-h-8 overflow-hidden flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40`,c(n,e)),...o,...e(a,r),children:[!a&&r,i&&!a&&/* @__PURE__ */ b(S.Clear,{"data-slot":`combobox-chips-clear`,render:/* @__PURE__ */ b(l,{variant:`ghost`,color:`zinc`,size:`icon-xs`}),className:`shrink-0 self-center size-5`,children:/* @__PURE__ */ b(v,{className:`pointer-events-none`})})]})}function ComboboxChip({className:n,children:r,showRemove:i=!0,asChild:a,...o}){return/* @__PURE__ */ x(S.Chip,{"data-slot":`combobox-chip`,className:e=>t(`flex h-[calc(--spacing(5.25))] w-fit text-left max-w-full items-center justify-start gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0`,c(n,e)),...o,...e(a,r),children:[!a&&/* @__PURE__ */ b(`span`,{className:`flex-1 truncate`,children:r}),i&&!a&&/* @__PURE__ */ b(S.ChipRemove,{render:/* @__PURE__ */ b(l,{variant:`ghost`,color:`zinc`,size:`icon-xs`}),className:`-ml-1 opacity-50 shrink-0 hover:opacity-100`,"data-slot":`combobox-chip-remove`,children:/* @__PURE__ */ b(v,{className:`pointer-events-none`})})]})}function ComboboxChipsInput({className:e,id:n,"aria-invalid":r,...i}){let a=u(n),o=d(r);return/* @__PURE__ */ b(S.Input,{id:a,"aria-invalid":o,"data-slot":`combobox-chip-input`,className:n=>t(`min-w-16 flex-1 outline-none`,c(e,n)),...i})}function useComboboxAnchor(){return y.useRef(null)}export{C as Combobox,ComboboxChip,ComboboxChips,ComboboxChipsInput,ComboboxClear,ComboboxCollection,ComboboxContent,ComboboxEmpty,ComboboxGroup,ComboboxInput,ComboboxItem,ComboboxLabel,ComboboxList,ComboboxSeparator,ComboboxTrigger,ComboboxValue,useComboboxAnchor};
2
2
  //# sourceMappingURL=combobox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.js","names":["ComboboxPrimitive","resolveClassName","React","Combobox$1","Combobox","props","IconSelector","cn","className","state","toAsChildRenderProps","asChild","children","icon","InputGroupButton","IconX","fieldControlId","useFieldControlId","id","InputGroup","InputGroupAddon","InputGroupInput","showTrigger","triggerIcon","showClear","anchor","IconCheck","Button","showRemove","ariaInvalid","invalid","useFieldInvalid"],"sources":["../../src/components/combobox.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react/combobox'\nimport { IconCheck, IconSelector, IconX } from '@tabler/icons-react'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\nimport { Button } from './button'\nimport { useFieldControlId, useFieldInvalid } from './field'\nimport { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from './input-group'\n\nexport type ComboboxProps<Value = unknown, Multiple extends boolean | undefined = false> = ComboboxPrimitive.Root.Props<\n Value,\n Multiple\n>\n\nexport type ComboboxValueProps = ComboboxPrimitive.Value.Props\n\nexport type ComboboxTriggerProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.Trigger> & {\n /** Icon of the trigger button. Defaults to an up/down chevron. */\n icon?: React.ReactNode\n}\n\nexport type ComboboxClearProps = Omit<ComboboxPrimitive.Clear.Props, 'render'>\n\nexport type ComboboxInputProps = Omit<ComboboxPrimitive.Input.Props, 'render' | 'className'> & {\n /** Classes for the input group that wraps the input and its buttons. */\n className?: string\n /** Icon shown at the start of the input. */\n icon?: React.ReactNode\n /** Replaces the icon of the trigger button. */\n triggerIcon?: React.ReactNode\n /**\n * Shows the button that opens the list.\n * @default true\n */\n showTrigger?: boolean\n /**\n * Shows a button that clears the value.\n * @default false\n */\n showClear?: boolean\n}\n\nexport type ComboboxContentProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.Popup> &\n Pick<\n ComboboxPrimitive.Positioner.Props,\n | 'side'\n | 'align'\n | 'sideOffset'\n | 'alignOffset'\n | 'anchor'\n | 'positionMethod'\n | 'collisionBoundary'\n | 'collisionPadding'\n | 'sticky'\n | 'arrowPadding'\n | 'disableAnchorTracking'\n | 'collisionAvoidance'\n > &\n Pick<ComboboxPrimitive.Portal.Props, 'container' | 'keepMounted'>\n\nexport type ComboboxListProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.List>\n\nexport type ComboboxItemProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.Item>\n\nexport type ComboboxGroupProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.Group>\n\nexport type ComboboxLabelProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.GroupLabel>\n\nexport type ComboboxCollectionProps = ComboboxPrimitive.Collection.Props\n\nexport type ComboboxEmptyProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.Empty>\n\nexport type ComboboxSeparatorProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.Separator>\n\nexport type ComboboxChipsProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.Chips> & {\n /**\n * Shows a button that removes all chips.\n * @default false\n */\n showClear?: boolean\n}\n\nexport type ComboboxChipProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.Chip> & {\n /**\n * Shows the button that removes this chip.\n * @default true\n */\n showRemove?: boolean\n}\n\nexport type ComboboxChipsInputProps = Omit<ComboboxPrimitive.Input.Props, 'render'>\n\nconst Combobox = ComboboxPrimitive.Root\n\nfunction ComboboxValue({ ...props }: ComboboxValueProps) {\n return <ComboboxPrimitive.Value data-slot=\"combobox-value\" {...props} />\n}\n\nfunction ComboboxTrigger({\n className,\n children,\n icon = <IconSelector className=\"pointer-events-none size-4 text-muted-foreground\" />,\n asChild,\n ...props\n}: ComboboxTriggerProps) {\n return (\n <ComboboxPrimitive.Trigger\n data-slot=\"combobox-trigger\"\n className={(state) => cn(\"[&_svg:not([class*='size-'])]:size-4\", resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n {!asChild && children}\n {!asChild && icon}\n </ComboboxPrimitive.Trigger>\n )\n}\n\nfunction ComboboxClear({ className, ...props }: ComboboxClearProps) {\n return (\n <ComboboxPrimitive.Clear\n data-slot=\"combobox-clear\"\n render={<InputGroupButton variant=\"ghost\" size=\"icon-xs\" />}\n className={(state) => cn(resolveClassName(className, state))}\n {...props}\n >\n <IconX className=\"pointer-events-none\" />\n </ComboboxPrimitive.Clear>\n )\n}\n\nfunction ComboboxInput({\n className,\n children,\n disabled = false,\n icon,\n id,\n showTrigger = true,\n showClear = false,\n triggerIcon,\n ...props\n}: ComboboxInputProps) {\n const fieldControlId = useFieldControlId(id)\n\n return (\n <InputGroup className={cn('w-auto', className)}>\n {icon && <InputGroupAddon align=\"inline-start\">{icon}</InputGroupAddon>}\n <ComboboxPrimitive.Input id={fieldControlId} render={<InputGroupInput disabled={disabled} />} {...props} />\n <InputGroupAddon align=\"inline-end\">\n {showTrigger && (\n <InputGroupButton\n size=\"icon-xs\"\n variant=\"ghost\"\n asChild\n data-slot=\"input-group-button\"\n className=\"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent\"\n disabled={disabled}\n >\n <ComboboxTrigger icon={triggerIcon} />\n </InputGroupButton>\n )}\n {showClear && <ComboboxClear disabled={disabled} />}\n </InputGroupAddon>\n {children}\n </InputGroup>\n )\n}\n\nfunction ComboboxContent({\n className,\n asChild,\n children,\n side = 'bottom',\n sideOffset = 6,\n align = 'start',\n alignOffset = 0,\n anchor,\n container,\n keepMounted,\n positionMethod = 'absolute',\n collisionBoundary,\n collisionPadding,\n sticky,\n arrowPadding,\n disableAnchorTracking,\n collisionAvoidance,\n ...props\n}: ComboboxContentProps) {\n return (\n <ComboboxPrimitive.Portal container={container} keepMounted={keepMounted}>\n <ComboboxPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n positionMethod={positionMethod}\n collisionBoundary={collisionBoundary}\n collisionPadding={collisionPadding}\n sticky={sticky}\n arrowPadding={arrowPadding}\n disableAnchorTracking={disableAnchorTracking}\n collisionAvoidance={collisionAvoidance}\n className=\"isolate z-50\"\n >\n <ComboboxPrimitive.Popup\n data-slot=\"combobox-content\"\n data-chips={!!anchor}\n className={(state) =>\n cn(\n 'group/combobox-content max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+(--spacing(7)))] origin-(--transform-origin) overflow-hidden rounded-lg text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 animate-none! relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n )\n}\n\nfunction ComboboxList({ className, asChild, children, ...props }: ComboboxListProps) {\n return (\n <ComboboxPrimitive.List\n data-slot=\"combobox-list\"\n className={(state) =>\n cn(\n 'no-scrollbar max-h-[min(calc(--spacing(72)-(--spacing(9))),calc(var(--available-height)-(--spacing(9))))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction ComboboxItem({ className, children, asChild, ...props }: ComboboxItemProps) {\n return (\n <ComboboxPrimitive.Item\n data-slot=\"combobox-item\"\n className={(state) =>\n cn(\n \"relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n {!asChild && children}\n {!asChild && (\n <ComboboxPrimitive.ItemIndicator\n render={<span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\" />}\n >\n <IconCheck className=\"pointer-events-none\" />\n </ComboboxPrimitive.ItemIndicator>\n )}\n </ComboboxPrimitive.Item>\n )\n}\n\nfunction ComboboxGroup({ className, asChild, children, ...props }: ComboboxGroupProps) {\n return (\n <ComboboxPrimitive.Group\n data-slot=\"combobox-group\"\n className={(state) => cn(resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction ComboboxLabel({ className, asChild, children, ...props }: ComboboxLabelProps) {\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot=\"combobox-label\"\n className={(state) => cn('px-2 py-1.5 text-xs text-muted-foreground', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction ComboboxCollection({ ...props }: ComboboxCollectionProps) {\n return <ComboboxPrimitive.Collection data-slot=\"combobox-collection\" {...props} />\n}\n\nfunction ComboboxEmpty({ className, asChild, children, ...props }: ComboboxEmptyProps) {\n return (\n <ComboboxPrimitive.Empty\n data-slot=\"combobox-empty\"\n className={(state) =>\n cn(\n 'hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction ComboboxSeparator({ className, asChild, children, ...props }: ComboboxSeparatorProps) {\n return (\n <ComboboxPrimitive.Separator\n data-slot=\"combobox-separator\"\n className={(state) => cn('-mx-1 my-1 h-px bg-border', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction ComboboxChips({ className, children, showClear = false, asChild, ...props }: ComboboxChipsProps) {\n return (\n <ComboboxPrimitive.Chips\n data-slot=\"combobox-chips\"\n className={(state) =>\n cn(\n 'flex min-h-8 overflow-hidden flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n {!asChild && children}\n {showClear && !asChild && (\n <ComboboxPrimitive.Clear\n data-slot=\"combobox-chips-clear\"\n render={<Button variant=\"ghost\" color=\"zinc\" size=\"icon-xs\" />}\n className=\"shrink-0 self-center size-5\"\n >\n <IconX className=\"pointer-events-none\" />\n </ComboboxPrimitive.Clear>\n )}\n </ComboboxPrimitive.Chips>\n )\n}\n\nfunction ComboboxChip({ className, children, showRemove = true, asChild, ...props }: ComboboxChipProps) {\n return (\n <ComboboxPrimitive.Chip\n data-slot=\"combobox-chip\"\n className={(state) =>\n cn(\n 'flex h-[calc(--spacing(5.25))] w-fit text-left max-w-full items-center justify-start gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n {!asChild && <span className=\"flex-1 truncate\">{children}</span>}\n {showRemove && !asChild && (\n <ComboboxPrimitive.ChipRemove\n render={<Button variant=\"ghost\" color=\"zinc\" size=\"icon-xs\" />}\n className=\"-ml-1 opacity-50 shrink-0 hover:opacity-100\"\n data-slot=\"combobox-chip-remove\"\n >\n <IconX className=\"pointer-events-none\" />\n </ComboboxPrimitive.ChipRemove>\n )}\n </ComboboxPrimitive.Chip>\n )\n}\n\nfunction ComboboxChipsInput({ className, id, 'aria-invalid': ariaInvalid, ...props }: ComboboxChipsInputProps) {\n const fieldControlId = useFieldControlId(id)\n const invalid = useFieldInvalid(ariaInvalid)\n\n return (\n <ComboboxPrimitive.Input\n id={fieldControlId}\n aria-invalid={invalid}\n data-slot=\"combobox-chip-input\"\n className={(state) => cn('min-w-16 flex-1 outline-none', resolveClassName(className, state))}\n {...props}\n />\n )\n}\n\nfunction useComboboxAnchor() {\n return React.useRef<HTMLDivElement | null>(null)\n}\n\nexport {\n Combobox,\n ComboboxChip,\n ComboboxChips,\n ComboboxChipsInput,\n ComboboxClear,\n ComboboxCollection,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxGroup,\n ComboboxInput,\n ComboboxItem,\n ComboboxLabel,\n ComboboxList,\n ComboboxSeparator,\n ComboboxTrigger,\n ComboboxValue,\n useComboboxAnchor\n}\n"],"mappings":"8lBA+FA,MAAMI,EAAWJ,EAAkB,KAEnC,SAAS,cAAc,CAAE,GAAGK,GAA6B,CACvD,MAAO,kBAACL,EAAkB,MAAnB,CAAyB,YAAU,iBAAiB,GAAIK,CAAQ,CAAA,CACzE,CAEA,SAAS,gBAAgB,CACvB,YACA,WACA,OAAO,kBAACC,EAAD,CAAc,UAAU,kDAAoD,CA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,kBAACX,EAAkB,MAAnB,CACE,YAAU,uBACV,OAAQ,kBAAC2B,EAAD,CAAQ,QAAQ,QAAQ,MAAM,OAAO,KAAK,SAAW,CAAA,EAC7D,UAAU,8BAEV,SAAA,kBAACZ,EAAD,CAAO,UAAU,qBAAuB,CAAA,CACjB,CAAA,CAEJ,GAE7B,CAEA,SAAS,aAAa,CAAE,YAAW,WAAU,aAAa,GAAM,UAAS,GAAGV,GAA4B,CACtG,MACE,kBAACL,EAAkB,KAAnB,CACE,YAAU,gBACV,UAAY,GACVO,EACE,iTACAN,EAAiBO,EAAWC,CAAK,CACnC,EAEF,GAAIJ,EACJ,GAAIK,EAAqBC,EAASC,CAAQ,EAT5C,SAAA,CAWG,CAACD,GAAW,kBAAC,OAAD,CAAM,UAAU,kBAAmB,UAAe,CAAA,EAC9DiB,GAAc,CAACjB,GACd,kBAACX,EAAkB,WAAnB,CACE,OAAQ,kBAAC2B,EAAD,CAAQ,QAAQ,QAAQ,MAAM,OAAO,KAAK,SAAW,CAAA,EAC7D,UAAU,8CACV,YAAU,uBAEV,SAAA,kBAACZ,EAAD,CAAO,UAAU,qBAAuB,CAAA,CACZ,CAAA,CAEV,GAE5B,CAEA,SAAS,mBAAmB,CAAE,YAAW,KAAI,eAAgBc,EAAa,GAAGxB,GAAkC,CAC7G,IAAMW,EAAiBC,EAAkBC,CAAE,EACrCY,EAAUC,EAAgBF,CAAW,EAE3C,MACE,kBAAC7B,EAAkB,MAAnB,CACE,GAAIgB,EACJ,eAAcc,EACd,YAAU,sBACV,UAAY,GAAUvB,EAAG,+BAAgCN,EAAiBO,EAAWC,CAAK,CAAC,EAC3F,GAAIJ,CACL,CAAA,CAEL,CAEA,SAAS,mBAAoB,CAC3B,OAAOH,EAAM,OAA8B,IAAI,CACjD"}
1
+ {"version":3,"file":"combobox.js","names":["ComboboxPrimitive","comboboxPopupClassName","comboboxListClassName","comboboxGroupLabelClassName","comboboxSeparatorClassName","comboboxItemClassName","comboboxEmptyClassName","resolveClassName","React","Combobox$1","Combobox","props","IconSelector","cn","className","state","toAsChildRenderProps","asChild","children","icon","InputGroupButton","IconX","fieldControlId","useFieldControlId","id","InputGroup","InputGroupAddon","InputGroupInput","showTrigger","triggerIcon","showClear","anchor","IconCheck","Button","showRemove","ariaInvalid","invalid","useFieldInvalid"],"sources":["../../src/components/combobox.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react/combobox'\nimport { IconCheck, IconSelector, IconX } from '@tabler/icons-react'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport { cn } from '../lib/utils'\nimport {\n comboboxEmptyClassName,\n comboboxGroupLabelClassName,\n comboboxItemClassName,\n comboboxListClassName,\n comboboxPopupClassName,\n comboboxSeparatorClassName\n} from '../utils/combobox-styles'\nimport { resolveClassName } from '../utils/resolve-class-name'\nimport { Button } from './button'\nimport { useFieldControlId, useFieldInvalid } from './field'\nimport { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from './input-group'\n\nexport type ComboboxProps<Value = unknown, Multiple extends boolean | undefined = false> = ComboboxPrimitive.Root.Props<\n Value,\n Multiple\n>\n\nexport type ComboboxValueProps = ComboboxPrimitive.Value.Props\n\nexport type ComboboxTriggerProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.Trigger> & {\n /** Icon of the trigger button. Defaults to an up/down chevron. */\n icon?: React.ReactNode\n}\n\nexport type ComboboxClearProps = Omit<ComboboxPrimitive.Clear.Props, 'render'>\n\nexport type ComboboxInputProps = Omit<ComboboxPrimitive.Input.Props, 'render' | 'className'> & {\n /** Classes for the input group that wraps the input and its buttons. */\n className?: string\n /** Icon shown at the start of the input. */\n icon?: React.ReactNode\n /** Replaces the icon of the trigger button. */\n triggerIcon?: React.ReactNode\n /**\n * Shows the button that opens the list.\n * @default true\n */\n showTrigger?: boolean\n /**\n * Shows a button that clears the value.\n * @default false\n */\n showClear?: boolean\n}\n\nexport type ComboboxContentProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.Popup> &\n Pick<\n ComboboxPrimitive.Positioner.Props,\n | 'side'\n | 'align'\n | 'sideOffset'\n | 'alignOffset'\n | 'anchor'\n | 'positionMethod'\n | 'collisionBoundary'\n | 'collisionPadding'\n | 'sticky'\n | 'arrowPadding'\n | 'disableAnchorTracking'\n | 'collisionAvoidance'\n > &\n Pick<ComboboxPrimitive.Portal.Props, 'container' | 'keepMounted'>\n\nexport type ComboboxListProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.List>\n\nexport type ComboboxItemProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.Item>\n\nexport type ComboboxGroupProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.Group>\n\nexport type ComboboxLabelProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.GroupLabel>\n\nexport type ComboboxCollectionProps = ComboboxPrimitive.Collection.Props\n\nexport type ComboboxEmptyProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.Empty>\n\nexport type ComboboxSeparatorProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.Separator>\n\nexport type ComboboxChipsProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.Chips> & {\n /**\n * Shows a button that removes all chips.\n * @default false\n */\n showClear?: boolean\n}\n\nexport type ComboboxChipProps = AsChildPrimitiveProps<typeof ComboboxPrimitive.Chip> & {\n /**\n * Shows the button that removes this chip.\n * @default true\n */\n showRemove?: boolean\n}\n\nexport type ComboboxChipsInputProps = Omit<ComboboxPrimitive.Input.Props, 'render'>\n\nconst Combobox = ComboboxPrimitive.Root\n\nfunction ComboboxValue({ ...props }: ComboboxValueProps) {\n return <ComboboxPrimitive.Value data-slot=\"combobox-value\" {...props} />\n}\n\nfunction ComboboxTrigger({\n className,\n children,\n icon = <IconSelector className=\"pointer-events-none size-4 text-muted-foreground\" />,\n asChild,\n ...props\n}: ComboboxTriggerProps) {\n return (\n <ComboboxPrimitive.Trigger\n data-slot=\"combobox-trigger\"\n className={(state) => cn(\"[&_svg:not([class*='size-'])]:size-4\", resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n {!asChild && children}\n {!asChild && icon}\n </ComboboxPrimitive.Trigger>\n )\n}\n\nfunction ComboboxClear({ className, ...props }: ComboboxClearProps) {\n return (\n <ComboboxPrimitive.Clear\n data-slot=\"combobox-clear\"\n render={<InputGroupButton variant=\"ghost\" size=\"icon-xs\" />}\n className={(state) => cn(resolveClassName(className, state))}\n {...props}\n >\n <IconX className=\"pointer-events-none\" />\n </ComboboxPrimitive.Clear>\n )\n}\n\nfunction ComboboxInput({\n className,\n children,\n disabled = false,\n icon,\n id,\n showTrigger = true,\n showClear = false,\n triggerIcon,\n ...props\n}: ComboboxInputProps) {\n const fieldControlId = useFieldControlId(id)\n\n return (\n <InputGroup className={cn('w-auto', className)}>\n {icon && <InputGroupAddon align=\"inline-start\">{icon}</InputGroupAddon>}\n <ComboboxPrimitive.Input id={fieldControlId} render={<InputGroupInput disabled={disabled} />} {...props} />\n <InputGroupAddon align=\"inline-end\">\n {showTrigger && (\n <InputGroupButton\n size=\"icon-xs\"\n variant=\"ghost\"\n asChild\n data-slot=\"input-group-button\"\n className=\"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent\"\n disabled={disabled}\n >\n <ComboboxTrigger icon={triggerIcon} />\n </InputGroupButton>\n )}\n {showClear && <ComboboxClear disabled={disabled} />}\n </InputGroupAddon>\n {children}\n </InputGroup>\n )\n}\n\nfunction ComboboxContent({\n className,\n asChild,\n children,\n side = 'bottom',\n sideOffset = 6,\n align = 'start',\n alignOffset = 0,\n anchor,\n container,\n keepMounted,\n positionMethod = 'absolute',\n collisionBoundary,\n collisionPadding,\n sticky,\n arrowPadding,\n disableAnchorTracking,\n collisionAvoidance,\n ...props\n}: ComboboxContentProps) {\n return (\n <ComboboxPrimitive.Portal container={container} keepMounted={keepMounted}>\n <ComboboxPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n positionMethod={positionMethod}\n collisionBoundary={collisionBoundary}\n collisionPadding={collisionPadding}\n sticky={sticky}\n arrowPadding={arrowPadding}\n disableAnchorTracking={disableAnchorTracking}\n collisionAvoidance={collisionAvoidance}\n className=\"isolate z-50\"\n >\n <ComboboxPrimitive.Popup\n data-slot=\"combobox-content\"\n data-chips={!!anchor}\n className={(state) => cn(comboboxPopupClassName, resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n )\n}\n\nfunction ComboboxList({ className, asChild, children, ...props }: ComboboxListProps) {\n return (\n <ComboboxPrimitive.List\n data-slot=\"combobox-list\"\n className={(state) => cn(comboboxListClassName, resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction ComboboxItem({ className, children, asChild, ...props }: ComboboxItemProps) {\n return (\n <ComboboxPrimitive.Item\n data-slot=\"combobox-item\"\n className={(state) => cn(comboboxItemClassName, 'pr-8', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n {!asChild && children}\n {!asChild && (\n <ComboboxPrimitive.ItemIndicator\n render={<span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\" />}\n >\n <IconCheck className=\"pointer-events-none\" />\n </ComboboxPrimitive.ItemIndicator>\n )}\n </ComboboxPrimitive.Item>\n )\n}\n\nfunction ComboboxGroup({ className, asChild, children, ...props }: ComboboxGroupProps) {\n return (\n <ComboboxPrimitive.Group\n data-slot=\"combobox-group\"\n className={(state) => cn(resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction ComboboxLabel({ className, asChild, children, ...props }: ComboboxLabelProps) {\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot=\"combobox-label\"\n className={(state) => cn(comboboxGroupLabelClassName, resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction ComboboxCollection({ ...props }: ComboboxCollectionProps) {\n return <ComboboxPrimitive.Collection data-slot=\"combobox-collection\" {...props} />\n}\n\nfunction ComboboxEmpty({ className, asChild, children, ...props }: ComboboxEmptyProps) {\n return (\n <ComboboxPrimitive.Empty\n data-slot=\"combobox-empty\"\n className={(state) => cn(comboboxEmptyClassName, resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction ComboboxSeparator({ className, asChild, children, ...props }: ComboboxSeparatorProps) {\n return (\n <ComboboxPrimitive.Separator\n data-slot=\"combobox-separator\"\n className={(state) => cn(comboboxSeparatorClassName, resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction ComboboxChips({ className, children, showClear = false, asChild, ...props }: ComboboxChipsProps) {\n return (\n <ComboboxPrimitive.Chips\n data-slot=\"combobox-chips\"\n className={(state) =>\n cn(\n 'flex min-h-8 overflow-hidden flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n {!asChild && children}\n {showClear && !asChild && (\n <ComboboxPrimitive.Clear\n data-slot=\"combobox-chips-clear\"\n render={<Button variant=\"ghost\" color=\"zinc\" size=\"icon-xs\" />}\n className=\"shrink-0 self-center size-5\"\n >\n <IconX className=\"pointer-events-none\" />\n </ComboboxPrimitive.Clear>\n )}\n </ComboboxPrimitive.Chips>\n )\n}\n\nfunction ComboboxChip({ className, children, showRemove = true, asChild, ...props }: ComboboxChipProps) {\n return (\n <ComboboxPrimitive.Chip\n data-slot=\"combobox-chip\"\n className={(state) =>\n cn(\n 'flex h-[calc(--spacing(5.25))] w-fit text-left max-w-full items-center justify-start gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n {!asChild && <span className=\"flex-1 truncate\">{children}</span>}\n {showRemove && !asChild && (\n <ComboboxPrimitive.ChipRemove\n render={<Button variant=\"ghost\" color=\"zinc\" size=\"icon-xs\" />}\n className=\"-ml-1 opacity-50 shrink-0 hover:opacity-100\"\n data-slot=\"combobox-chip-remove\"\n >\n <IconX className=\"pointer-events-none\" />\n </ComboboxPrimitive.ChipRemove>\n )}\n </ComboboxPrimitive.Chip>\n )\n}\n\nfunction ComboboxChipsInput({ className, id, 'aria-invalid': ariaInvalid, ...props }: ComboboxChipsInputProps) {\n const fieldControlId = useFieldControlId(id)\n const invalid = useFieldInvalid(ariaInvalid)\n\n return (\n <ComboboxPrimitive.Input\n id={fieldControlId}\n aria-invalid={invalid}\n data-slot=\"combobox-chip-input\"\n className={(state) => cn('min-w-16 flex-1 outline-none', resolveClassName(className, state))}\n {...props}\n />\n )\n}\n\nfunction useComboboxAnchor() {\n return React.useRef<HTMLDivElement | null>(null)\n}\n\nexport {\n Combobox,\n ComboboxChip,\n ComboboxChips,\n ComboboxChipsInput,\n ComboboxClear,\n ComboboxCollection,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxGroup,\n ComboboxInput,\n ComboboxItem,\n ComboboxLabel,\n ComboboxList,\n ComboboxSeparator,\n ComboboxTrigger,\n ComboboxValue,\n useComboboxAnchor\n}\n"],"mappings":"A,orBAuGA,MAAMU,EAAWV,EAAkB,KAEnC,SAAS,cAAc,CAAE,GAAGW,GAA6B,CACvD,MAAO,kBAACX,EAAkB,M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BAAoB,CAC3B,OAAOH,EAAM,OAA8B,IAAI,CACjD,C"}
@@ -2,7 +2,6 @@ import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
2
2
  import { Dialog } from "./dialog.js";
3
3
  import * as React from "react";
4
4
  import { Command as Command$1 } from "cmdk";
5
- //#region src/components/command.d.ts
6
5
  export type CommandProps = React.ComponentProps<typeof Command$1>;
7
6
  export type CommandDialogProps = Omit<React.ComponentProps<typeof Dialog>, 'children'> & {
8
7
  children?: React.ReactNode;
@@ -40,6 +39,5 @@ declare function CommandGroup({ className, ...props }: CommandGroupProps): React
40
39
  declare function CommandSeparator({ className, ...props }: CommandSeparatorProps): React.JSX.Element;
41
40
  declare function CommandItem({ className, children, ...props }: CommandItemProps): React.JSX.Element;
42
41
  declare function CommandShortcut({ className, ...props }: CommandShortcutProps): React.JSX.Element;
43
- //#endregion
44
42
  export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
45
43
  //# sourceMappingURL=command.d.ts.map