@gv-tech/design-system 2.23.0 → 2.23.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/README.md +4 -0
  2. package/dist/accordion.cjs.map +1 -1
  3. package/dist/accordion.mjs.map +1 -1
  4. package/dist/alert-dialog.cjs.map +1 -1
  5. package/dist/alert-dialog.mjs.map +1 -1
  6. package/dist/alert.cjs.map +1 -1
  7. package/dist/alert.mjs.map +1 -1
  8. package/dist/aspect-ratio.cjs.map +1 -1
  9. package/dist/aspect-ratio.mjs.map +1 -1
  10. package/dist/avatar.cjs.map +1 -1
  11. package/dist/avatar.mjs.map +1 -1
  12. package/dist/badge.cjs.map +1 -1
  13. package/dist/badge.mjs.map +1 -1
  14. package/dist/breadcrumb.cjs.map +1 -1
  15. package/dist/breadcrumb.mjs.map +1 -1
  16. package/dist/button.cjs.map +1 -1
  17. package/dist/button.mjs.map +1 -1
  18. package/dist/calendar.cjs.map +1 -1
  19. package/dist/calendar.mjs.map +1 -1
  20. package/dist/card.cjs.map +1 -1
  21. package/dist/card.mjs.map +1 -1
  22. package/dist/carousel.cjs.map +1 -1
  23. package/dist/carousel.mjs.map +1 -1
  24. package/dist/chart.cjs +1 -1
  25. package/dist/chart.cjs.map +1 -1
  26. package/dist/chart.mjs +1 -1
  27. package/dist/chart.mjs.map +1 -1
  28. package/dist/checkbox.cjs.map +1 -1
  29. package/dist/checkbox.mjs.map +1 -1
  30. package/dist/collapsible.cjs.map +1 -1
  31. package/dist/collapsible.mjs.map +1 -1
  32. package/dist/command.cjs.map +1 -1
  33. package/dist/command.mjs.map +1 -1
  34. package/dist/context-menu.cjs.map +1 -1
  35. package/dist/context-menu.mjs.map +1 -1
  36. package/dist/design-system.css +1 -1
  37. package/dist/dialog.cjs.map +1 -1
  38. package/dist/dialog.mjs.map +1 -1
  39. package/dist/drawer.cjs.map +1 -1
  40. package/dist/drawer.mjs.map +1 -1
  41. package/dist/dropdown-menu.cjs.map +1 -1
  42. package/dist/dropdown-menu.mjs.map +1 -1
  43. package/dist/hover-card.cjs.map +1 -1
  44. package/dist/hover-card.mjs.map +1 -1
  45. package/dist/input.cjs.map +1 -1
  46. package/dist/input.mjs.map +1 -1
  47. package/dist/label.cjs.map +1 -1
  48. package/dist/label.mjs.map +1 -1
  49. package/dist/menubar.cjs.map +1 -1
  50. package/dist/menubar.mjs.map +1 -1
  51. package/dist/navigation-menu.cjs.map +1 -1
  52. package/dist/navigation-menu.mjs.map +1 -1
  53. package/dist/packages/ui-web/src/accordion.d.ts +2 -0
  54. package/dist/packages/ui-web/src/alert-dialog.d.ts +2 -0
  55. package/dist/packages/ui-web/src/alert.d.ts +2 -0
  56. package/dist/packages/ui-web/src/aspect-ratio.d.ts +2 -0
  57. package/dist/packages/ui-web/src/avatar.d.ts +2 -0
  58. package/dist/packages/ui-web/src/badge.d.ts +2 -0
  59. package/dist/packages/ui-web/src/breadcrumb.d.ts +2 -0
  60. package/dist/packages/ui-web/src/button.d.ts +2 -0
  61. package/dist/packages/ui-web/src/calendar.d.ts +2 -0
  62. package/dist/packages/ui-web/src/card.d.ts +2 -0
  63. package/dist/packages/ui-web/src/carousel.d.ts +2 -0
  64. package/dist/packages/ui-web/src/checkbox.d.ts +2 -0
  65. package/dist/packages/ui-web/src/collapsible.d.ts +2 -0
  66. package/dist/packages/ui-web/src/command.d.ts +2 -0
  67. package/dist/packages/ui-web/src/context-menu.d.ts +2 -0
  68. package/dist/packages/ui-web/src/dialog.d.ts +2 -0
  69. package/dist/packages/ui-web/src/drawer.d.ts +2 -0
  70. package/dist/packages/ui-web/src/dropdown-menu.d.ts +2 -0
  71. package/dist/packages/ui-web/src/hover-card.d.ts +2 -0
  72. package/dist/packages/ui-web/src/input.d.ts +2 -0
  73. package/dist/packages/ui-web/src/label.d.ts +2 -0
  74. package/dist/packages/ui-web/src/menubar.d.ts +2 -0
  75. package/dist/packages/ui-web/src/navigation-menu.d.ts +2 -0
  76. package/dist/packages/ui-web/src/pagination.d.ts +2 -0
  77. package/dist/packages/ui-web/src/popover.d.ts +2 -0
  78. package/dist/packages/ui-web/src/progress.d.ts +2 -0
  79. package/dist/packages/ui-web/src/scroll-area.d.ts +2 -0
  80. package/dist/packages/ui-web/src/select.d.ts +2 -0
  81. package/dist/packages/ui-web/src/separator.d.ts +2 -0
  82. package/dist/packages/ui-web/src/sheet.d.ts +2 -0
  83. package/dist/packages/ui-web/src/skeleton.d.ts +2 -0
  84. package/dist/packages/ui-web/src/slider.d.ts +2 -0
  85. package/dist/packages/ui-web/src/sonner.d.ts +3 -1
  86. package/dist/packages/ui-web/src/switch.d.ts +2 -0
  87. package/dist/packages/ui-web/src/table.d.ts +2 -0
  88. package/dist/packages/ui-web/src/tabs.d.ts +2 -0
  89. package/dist/packages/ui-web/src/textarea.d.ts +2 -0
  90. package/dist/packages/ui-web/src/toast.d.ts +2 -0
  91. package/dist/packages/ui-web/src/toggle-group.d.ts +2 -0
  92. package/dist/packages/ui-web/src/toggle.d.ts +2 -0
  93. package/dist/packages/ui-web/src/tooltip.d.ts +2 -0
  94. package/dist/pagination.cjs.map +1 -1
  95. package/dist/pagination.mjs.map +1 -1
  96. package/dist/popover.cjs.map +1 -1
  97. package/dist/popover.mjs.map +1 -1
  98. package/dist/progress.cjs.map +1 -1
  99. package/dist/progress.mjs.map +1 -1
  100. package/dist/scroll-area.cjs.map +1 -1
  101. package/dist/scroll-area.mjs.map +1 -1
  102. package/dist/select.cjs.map +1 -1
  103. package/dist/select.mjs.map +1 -1
  104. package/dist/separator.cjs.map +1 -1
  105. package/dist/separator.mjs.map +1 -1
  106. package/dist/sheet.cjs.map +1 -1
  107. package/dist/sheet.mjs.map +1 -1
  108. package/dist/skeleton.cjs.map +1 -1
  109. package/dist/skeleton.mjs.map +1 -1
  110. package/dist/slider.cjs.map +1 -1
  111. package/dist/slider.mjs.map +1 -1
  112. package/dist/sonner.cjs.map +1 -1
  113. package/dist/sonner.mjs.map +1 -1
  114. package/dist/switch.cjs.map +1 -1
  115. package/dist/switch.mjs.map +1 -1
  116. package/dist/table.cjs.map +1 -1
  117. package/dist/table.mjs.map +1 -1
  118. package/dist/tabs.cjs.map +1 -1
  119. package/dist/tabs.mjs.map +1 -1
  120. package/dist/textarea.cjs.map +1 -1
  121. package/dist/textarea.mjs.map +1 -1
  122. package/dist/toast.cjs.map +1 -1
  123. package/dist/toast.mjs.map +1 -1
  124. package/dist/toggle-group.cjs.map +1 -1
  125. package/dist/toggle-group.mjs.map +1 -1
  126. package/dist/toggle.cjs.map +1 -1
  127. package/dist/toggle.mjs.map +1 -1
  128. package/dist/tooltip.cjs.map +1 -1
  129. package/dist/tooltip.mjs.map +1 -1
  130. package/package.json +5 -2
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.cjs","names":[],"sources":["../packages/ui-web/src/carousel.tsx"],"sourcesContent":["import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';\nimport * as React from 'react';\n\nimport { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';\nimport { Button } from './button';\nimport { cn } from './lib/utils';\n\nimport type { CarouselBaseProps } from '@gv-tech/ui-core';\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: 'horizontal' | 'vertical';\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error('useCarousel must be used within a <Carousel />');\n }\n\n return context;\n}\n\nfunction Carousel({\n orientation = 'horizontal',\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<'div'> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y',\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) {\n return;\n }\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === 'ArrowRight') {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) {\n return;\n }\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) {\n return;\n }\n onSelect(api);\n api.on('reInit', onSelect);\n api.on('select', onSelect);\n\n return () => {\n api?.off('select', onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn('relative', className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n}\n\nfunction CarouselContent({ className, ...props }: React.ComponentProps<'div'>) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div className={cn('flex', orientation === 'horizontal' ? '-ms-4' : '-mt-4 flex-col', className)} {...props} />\n </div>\n );\n}\n\nfunction CarouselItem({ className, ...props }: React.ComponentProps<'div'>) {\n const { orientation } = useCarousel();\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'ps-4' : 'pt-4', className)}\n {...props}\n />\n );\n}\n\nfunction CarouselPrevious({\n className,\n variant = 'outline',\n size = 'icon-sm',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? '-start-12 top-1/2 -translate-y-1/2'\n : 'start-1/2 -top-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2',\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ChevronLeftIcon />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\nfunction CarouselNext({\n className,\n variant = 'outline',\n size = 'icon-sm',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? '-end-12 top-1/2 -translate-y-1/2'\n : 'start-1/2 -bottom-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2',\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ChevronRightIcon />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n}\n\nexport { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel, type CarouselApi };\n\n// Verify that the component satisfies the ui-core contract\nconst _verifyCarouselContract: CarouselBaseProps = {} as unknown as React.ComponentProps<typeof Carousel>;\n"],"mappings":"4QA8BM,EAAkB,EAAM,cAA2C,IAAI,EAE7E,SAAS,GAAc,CACrB,IAAM,EAAU,EAAM,WAAW,CAAe,EAEhD,GAAI,CAAC,EACH,MAAU,MAAM,gDAAgD,EAGlE,OAAO,CACT,CAEA,SAAS,EAAS,CAChB,cAAc,aACd,OACA,SACA,UACA,YACA,WACA,GAAG,GAC2C,CAC9C,GAAM,CAAC,EAAa,GAAO,EAAA,EACzB,CACE,GAAG,EACH,KAAM,IAAgB,aAAe,IAAM,GAC7C,EACA,CACF,EACM,CAAC,EAAe,GAAoB,EAAM,SAAS,EAAK,EACxD,CAAC,EAAe,GAAoB,EAAM,SAAS,EAAK,EAExD,EAAW,EAAM,YAAa,GAAqB,CAClD,IAGL,EAAiB,EAAI,cAAc,CAAC,EACpC,EAAiB,EAAI,cAAc,CAAC,EACtC,EAAG,CAAC,CAAC,EAEC,EAAa,EAAM,gBAAkB,CACzC,GAAK,WAAW,CAClB,EAAG,CAAC,CAAG,CAAC,EAEF,EAAa,EAAM,gBAAkB,CACzC,GAAK,WAAW,CAClB,EAAG,CAAC,CAAG,CAAC,EAEF,EAAgB,EAAM,YACzB,GAA+C,CAC1C,EAAM,MAAQ,aAChB,EAAM,eAAe,EACrB,EAAW,GACF,EAAM,MAAQ,eACvB,EAAM,eAAe,EACrB,EAAW,EAEf,EACA,CAAC,EAAY,CAAU,CACzB,EAsBA,OApBA,EAAM,cAAgB,CAChB,CAAC,GAAO,CAAC,GAGb,EAAO,CAAG,CACZ,EAAG,CAAC,EAAK,CAAM,CAAC,EAEhB,EAAM,cAAgB,CACf,KAOL,OAJA,EAAS,CAAG,EACZ,EAAI,GAAG,SAAU,CAAQ,EACzB,EAAI,GAAG,SAAU,CAAQ,MAEZ,CACX,GAAK,IAAI,SAAU,CAAQ,CAC7B,CACF,EAAG,CAAC,EAAK,CAAQ,CAAC,GAGhB,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,CAEA,SAAS,EAAa,CACpB,YACA,UAAU,UACV,OAAO,UACP,GAAG,GACmC,CACtC,GAAM,CAAE,cAAa,aAAY,iBAAkB,EAAY,EAE/D,OACE,EAAA,EAAA,MAAC,EAAA,OAAD,CACE,YAAU,gBACD,UACH,OACN,UAAW,EAAA,EACT,2CACA,IAAgB,aACZ,mCACA,sEACJ,CACF,EACA,SAAU,CAAC,EACX,QAAS,EACT,GAAI,WAbN,EAeE,EAAA,EAAA,KAAC,EAAA,GAAD,CAAmB,CAAA,GACnB,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,mBAAU,YAAgB,CAAA,CACpC,GAEZ"}
1
+ {"version":3,"file":"carousel.cjs","names":[],"sources":["../packages/ui-web/src/carousel.tsx"],"sourcesContent":["import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';\nimport * as React from 'react';\n\nimport { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';\nimport { Button } from './button';\nimport { cn } from './lib/utils';\n\nimport type { CarouselBaseProps } from '@gv-tech/ui-core';\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: 'horizontal' | 'vertical';\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error('useCarousel must be used within a <Carousel />');\n }\n\n return context;\n}\n\nfunction Carousel({\n orientation = 'horizontal',\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<'div'> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y',\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) {\n return;\n }\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === 'ArrowRight') {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) {\n return;\n }\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) {\n return;\n }\n onSelect(api);\n api.on('reInit', onSelect);\n api.on('select', onSelect);\n\n return () => {\n api?.off('select', onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn('relative', className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n}\n\nfunction CarouselContent({ className, ...props }: React.ComponentProps<'div'>) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div className={cn('flex', orientation === 'horizontal' ? '-ms-4' : '-mt-4 flex-col', className)} {...props} />\n </div>\n );\n}\n\nfunction CarouselItem({ className, ...props }: React.ComponentProps<'div'>) {\n const { orientation } = useCarousel();\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'ps-4' : 'pt-4', className)}\n {...props}\n />\n );\n}\n\nfunction CarouselPrevious({\n className,\n variant = 'outline',\n size = 'icon-sm',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? '-start-12 top-1/2 -translate-y-1/2'\n : 'start-1/2 -top-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2',\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ChevronLeftIcon />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\nfunction CarouselNext({\n className,\n variant = 'outline',\n size = 'icon-sm',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? '-end-12 top-1/2 -translate-y-1/2'\n : 'start-1/2 -bottom-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2',\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ChevronRightIcon />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n}\n\nexport { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel, type CarouselApi };\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyCarouselContract = React.ComponentProps<typeof Carousel> extends CarouselBaseProps ? true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mC,CACtC,GAAM,CAAE,cAAa,aAAY,iBAAkB,EAAY,EAE/D,OACE,EAAA,EAAA,MAAC,EAAA,OAAD,CACE,YAAU,gBACD,UACH,OACN,UAAW,EAAA,EACT,2CACA,IAAgB,aACZ,mCACA,sEACJ,CACF,EACA,SAAU,CAAC,EACX,QAAS,EACT,GAAI,WAbN,EAeE,EAAA,EAAA,KAAC,EAAA,GAAD,CAAmB,CAAA,GACnB,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,mBAAU,YAAgB,CAAA,CACpC,GAEZ"}
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.mjs","names":[],"sources":["../packages/ui-web/src/carousel.tsx"],"sourcesContent":["import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';\nimport * as React from 'react';\n\nimport { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';\nimport { Button } from './button';\nimport { cn } from './lib/utils';\n\nimport type { CarouselBaseProps } from '@gv-tech/ui-core';\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: 'horizontal' | 'vertical';\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error('useCarousel must be used within a <Carousel />');\n }\n\n return context;\n}\n\nfunction Carousel({\n orientation = 'horizontal',\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<'div'> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y',\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) {\n return;\n }\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === 'ArrowRight') {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) {\n return;\n }\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) {\n return;\n }\n onSelect(api);\n api.on('reInit', onSelect);\n api.on('select', onSelect);\n\n return () => {\n api?.off('select', onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn('relative', className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n}\n\nfunction CarouselContent({ className, ...props }: React.ComponentProps<'div'>) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div className={cn('flex', orientation === 'horizontal' ? '-ms-4' : '-mt-4 flex-col', className)} {...props} />\n </div>\n );\n}\n\nfunction CarouselItem({ className, ...props }: React.ComponentProps<'div'>) {\n const { orientation } = useCarousel();\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'ps-4' : 'pt-4', className)}\n {...props}\n />\n );\n}\n\nfunction CarouselPrevious({\n className,\n variant = 'outline',\n size = 'icon-sm',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? '-start-12 top-1/2 -translate-y-1/2'\n : 'start-1/2 -top-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2',\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ChevronLeftIcon />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\nfunction CarouselNext({\n className,\n variant = 'outline',\n size = 'icon-sm',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? '-end-12 top-1/2 -translate-y-1/2'\n : 'start-1/2 -bottom-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2',\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ChevronRightIcon />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n}\n\nexport { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel, type CarouselApi };\n\n// Verify that the component satisfies the ui-core contract\nconst _verifyCarouselContract: CarouselBaseProps = {} as unknown as React.ComponentProps<typeof Carousel>;\n"],"mappings":";;;;;;aA8BM,IAAkB,EAAM,cAA2C,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,gBAAa,eAAY,qBAAkB,EAAY;CAE/D,OACE,iBAAA,GAAA,EAAA,MAAC,GAAD;EACE,aAAU;EACD;EACH;EACN,WAAW,EACT,4CACA,MAAgB,eACZ,qCACA,uEACJ,CACF;EACA,UAAU,CAAC;EACX,SAAS;EACT,GAAI;YAbN,CAeE,iBAAA,GAAA,EAAA,KAAC,GAAD,CAAmB,CAAA,GACnB,iBAAA,GAAA,EAAA,KAAC,QAAD;GAAM,WAAU;aAAU;EAAgB,CAAA,CACpC;;AAEZ"}
1
+ {"version":3,"file":"carousel.mjs","names":[],"sources":["../packages/ui-web/src/carousel.tsx"],"sourcesContent":["import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';\nimport * as React from 'react';\n\nimport { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';\nimport { Button } from './button';\nimport { cn } from './lib/utils';\n\nimport type { CarouselBaseProps } from '@gv-tech/ui-core';\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: 'horizontal' | 'vertical';\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error('useCarousel must be used within a <Carousel />');\n }\n\n return context;\n}\n\nfunction Carousel({\n orientation = 'horizontal',\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<'div'> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y',\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) {\n return;\n }\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === 'ArrowRight') {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) {\n return;\n }\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) {\n return;\n }\n onSelect(api);\n api.on('reInit', onSelect);\n api.on('select', onSelect);\n\n return () => {\n api?.off('select', onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn('relative', className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n}\n\nfunction CarouselContent({ className, ...props }: React.ComponentProps<'div'>) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div className={cn('flex', orientation === 'horizontal' ? '-ms-4' : '-mt-4 flex-col', className)} {...props} />\n </div>\n );\n}\n\nfunction CarouselItem({ className, ...props }: React.ComponentProps<'div'>) {\n const { orientation } = useCarousel();\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'ps-4' : 'pt-4', className)}\n {...props}\n />\n );\n}\n\nfunction CarouselPrevious({\n className,\n variant = 'outline',\n size = 'icon-sm',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? '-start-12 top-1/2 -translate-y-1/2'\n : 'start-1/2 -top-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2',\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ChevronLeftIcon />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\nfunction CarouselNext({\n className,\n variant = 'outline',\n size = 'icon-sm',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? '-end-12 top-1/2 -translate-y-1/2'\n : 'start-1/2 -bottom-12 -translate-x-1/2 rotate-90 rtl:translate-x-1/2',\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ChevronRightIcon />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n}\n\nexport { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel, type CarouselApi };\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyCarouselContract = React.ComponentProps<typeof Carousel> extends CarouselBaseProps ? true : false;\n"],"mappings":";;;;;;aA8BM,IAAkB,EAAM,cAA2C,IAAI;AAE7E,SAAS,IAAc;CACr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CAE/D,OACE,iBAAA,GAAA,EAAA,MAAC,GAAD;EACE,aAAU;EACD;EACH;EACN,WAAW,EACT,4CACA,MAAgB,eACZ,qCACA,uEACJ,CACF;EACA,UAAU,CAAC;EACX,SAAS;EACT,GAAI;YAbN,CAeE,iBAAA,GAAA,EAAA,KAAC,GAAD,CAAmB,CAAA,GACnB,iBAAA,GAAA,EAAA,KAAC,QAAD;GAAM,WAAU;aAAU;EAAgB,CAAA,CACpC;;AAEZ"}
package/dist/chart.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use client";"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-mLOUI7ql.js"),t=require("./vendor-UfQavLF9.js"),n=require("./utils-D7tt_q-u.js");let r=require("react");r=e.r(r);var i=t.Jr(),a={light:``,dark:`.dark`},o={width:320,height:200},s=r.createContext(null);function c(){let e=r.useContext(s);if(!e)throw Error(`useChart must be used within a <ChartContainer />`);return e}function l({id:e,className:a,children:c,config:l,initialDimension:d=o,...f}){let p=r.useId(),m=`chart-${e??p.replace(/:/g,``)}`;return(0,i.jsx)(s.Provider,{value:{config:l},children:(0,i.jsxs)(`div`,{"data-slot":`chart`,"data-chart":m,className:n.t(`[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke=#ccc]]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke=#ccc]]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke=#ccc]]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke=#fff]]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke=#fff]]:stroke-transparent [&_.recharts-surface]:outline-hidden`,a),...f,children:[(0,i.jsx)(u,{id:m,config:l}),(0,i.jsx)(t.P,{initialDimension:d,children:c})]})})}var u=({id:e,config:t})=>{let n=Object.entries(t).filter(([,e])=>e.theme??e.color);return n.length?(0,i.jsx)(`style`,{dangerouslySetInnerHTML:{__html:Object.entries(a).map(([t,r])=>`
1
+ "use client";"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-mLOUI7ql.js"),t=require("./vendor-UfQavLF9.js"),n=require("./utils-D7tt_q-u.js");let r=require("react");r=e.r(r);var i=t.Jr(),a={light:``,dark:`.dark`},o={width:320,height:200},s=r.createContext(null);function c(){let e=r.useContext(s);if(!e)throw Error(`useChart must be used within a <ChartContainer />`);return e}function l({id:e,className:a,children:c,config:l,initialDimension:d=o,...f}){let p=r.useId(),m=`chart-${e??p.replace(/:/g,``)}`;return(0,i.jsx)(s.Provider,{value:{config:l},children:(0,i.jsxs)(`div`,{"data-slot":`chart`,"data-chart":m,className:n.t(`[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden`,a),...f,children:[(0,i.jsx)(u,{id:m,config:l}),(0,i.jsx)(t.P,{initialDimension:d,children:c})]})})}var u=({id:e,config:t})=>{let n=Object.entries(t).filter(([,e])=>e.theme??e.color);return n.length?(0,i.jsx)(`style`,{dangerouslySetInnerHTML:{__html:Object.entries(a).map(([t,r])=>`
2
2
  ${r} [data-chart=${e}] {
3
3
  ${n.map(([e,n])=>{let r=n.theme?.[t]??n.color;return r?` --color-${e}: ${r};`:null}).join(`
4
4
  `)}
@@ -1 +1 @@
1
- {"version":3,"file":"chart.cjs","names":[],"sources":["../packages/ui-web/src/chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { TooltipValueType } from 'recharts';\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\nconst INITIAL_DIMENSION = { width: 320, height: 200 } as const;\ntype TooltipNameType = number | string;\n\nexport type ChartConfig = Record<\n string,\n {\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\nconst ChartContext = React.createContext<ChartContextProps | null>(null);\n\nfunction useChart() {\n const context = React.useContext(ChartContext);\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />');\n }\n\n return context;\n}\n\nfunction ChartContainer({\n id,\n className,\n children,\n config,\n initialDimension = INITIAL_DIMENSION,\n ...props\n}: React.ComponentProps<'div'> & {\n config: ChartConfig;\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];\n initialDimension?: {\n width: number;\n height: number;\n };\n}) {\n const uniqueId = React.useId();\n const chartId = `chart-${id ?? uniqueId.replace(/:/g, '')}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n '[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke=#ccc]]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke=#ccc]]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke=#ccc]]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke=#fff]]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke=#fff]]:stroke-transparent [&_.recharts-surface]:outline-hidden',\n className,\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer initialDimension={initialDimension}>\n {children}\n </RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n}\n\nconst ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {\n const colorConfig = Object.entries(config).filter(([, config]) => config.theme ?? config.color);\n\n if (!colorConfig.length) {\n return null;\n }\n\n return (\n <style\n dangerouslySetInnerHTML={{\n __html: Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ?? itemConfig.color;\n return color ? ` --color-${key}: ${color};` : null;\n })\n .join('\\n')}\n}\n`,\n )\n .join('\\n'),\n }}\n />\n );\n};\n\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\nfunction ChartTooltipContent({\n active,\n payload,\n className,\n indicator = 'dot',\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey,\n}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<'div'> & {\n hideLabel?: boolean;\n hideIndicator?: boolean;\n indicator?: 'line' | 'dot' | 'dashed';\n nameKey?: string;\n labelKey?: string;\n } & Omit<RechartsPrimitive.DefaultTooltipContentProps<TooltipValueType, TooltipNameType>, 'accessibilityLayer'>) {\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 = !labelKey && typeof label === 'string' ? (config[label]?.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 'border-border/50 bg-background grid min-w-32 items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload\n .filter((item) => 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={index}\n className={cn(\n '[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',\n indicator === 'dot' && 'items-center',\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, 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 != null && (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {typeof item.value === 'number' ? item.value.toLocaleString() : String(item.value)}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = 'bottom',\n nameKey,\n}: React.ComponentProps<'div'> & {\n hideIcon?: boolean;\n nameKey?: string;\n} & RechartsPrimitive.DefaultLegendContentProps) {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div className={cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className)}>\n {payload\n .filter((item) => item.type !== 'none')\n .map((item, index) => {\n const key = `${nameKey ?? item.dataKey ?? 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={index}\n className={cn('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n}\n\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];\n}\n\nexport { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };\n\n// The script was manually reverted here\n"],"mappings":"+PASM,EAAS,CAAE,MAAO,GAAI,KAAM,OAAQ,EAEpC,EAAoB,CAAE,MAAO,IAAK,OAAQ,GAAI,EAe9C,EAAe,EAAM,cAAwC,IAAI,EAEvE,SAAS,GAAW,CAClB,IAAM,EAAU,EAAM,WAAW,CAAY,EAE7C,GAAI,CAAC,EACH,MAAU,MAAM,mDAAmD,EAGrE,OAAO,CACT,CAEA,SAAS,EAAe,CACtB,KACA,YACA,WACA,SACA,mBAAmB,EACnB,GAAG,GAQF,CACD,IAAM,EAAW,EAAM,MAAM,EACvB,EAAU,SAAS,GAAM,EAAS,QAAQ,KAAM,EAAE,IAExD,OACE,EAAA,EAAA,KAAC,EAAa,SAAd,CAAuB,MAAO,CAAE,QAAO,YACrC,EAAA,EAAA,MAAC,MAAD,CACE,YAAU,QACV,aAAY,EACZ,UAAW,EAAA,EACT,opBACA,CACF,EACA,GAAI,WAPN,EASE,EAAA,EAAA,KAAC,EAAD,CAAY,GAAI,EAAiB,QAAS,CAAA,GAC1C,EAAA,EAAA,KAAA,EAAA,EAAA,CAAyD,mBACtD,UACoC,CAAA,CACpC,GACgB,CAAA,CAE3B,CAEA,IAAM,GAAc,CAAE,KAAI,YAAkD,CAC1E,IAAM,EAAc,OAAO,QAAQ,CAAM,EAAE,QAAQ,EAAG,KAAY,EAAO,OAAS,EAAO,KAAK,EAM9F,OAJK,EAAY,QAKf,EAAA,EAAA,KAAC,QAAD,CACE,wBAAyB,CACvB,OAAQ,OAAO,QAAQ,CAAM,EAC1B,KACE,CAAC,EAAO,KAAY;EAC/B,EAAO,eAAe,EAAG;EACzB,EACC,KAAK,CAAC,EAAK,KAAgB,CAC1B,IAAM,EAAQ,EAAW,QAAQ,IAA2C,EAAW,MACvF,OAAO,EAAQ,aAAa,EAAI,IA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S,MAAM,EACrC,KAAK,EAAM,IAAU,CAEpB,IAAM,EAAa,EAA4B,EAAQ,EAAM,GAD9C,GAAW,EAAK,SAAW,SACsB,EAEhE,OACE,EAAA,EAAA,MAAC,MAAD,CAEE,UAAW,EAAA,EAAG,iFAAiF,WAFjG,CAIG,GAAY,MAAQ,CAAC,GACpB,EAAA,EAAA,KAAC,EAAW,KAAZ,CAAkB,CAAA,GAElB,EAAA,EAAA,KAAC,MAAD,CACE,UAAU,iCACV,MAAO,CACL,gBAAiB,EAAK,KACxB,CACD,CAAA,EAEF,GAAY,KACV,GAdE,CAcF,CAET,CAAC,CACA,CAAA,EA9BE,IAgCX,CAEA,SAAS,EAA4B,EAAqB,EAAkB,EAAa,CACvF,GAAI,OAAO,GAAY,WAAY,EACjC,OAGF,IAAM,EACJ,YAAa,GAAW,OAAO,EAAQ,SAAY,UAAY,EAAQ,UAAY,KAC/E,EAAQ,QACR,IAAA,GAEF,EAAyB,EAY7B,OAVI,KAAO,GAAW,OAAO,EAAQ,IAAiC,SACpE,EAAiB,EAAQ,GAEzB,GACA,KAAO,GACP,OAAO,EAAe,IAAwC,WAE9D,EAAiB,EAAe,IAG3B,KAAkB,EAAS,EAAO,GAAkB,EAAO,EACpE"}
1
+ {"version":3,"file":"chart.cjs","names":[],"sources":["../packages/ui-web/src/chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { TooltipValueType } from 'recharts';\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\nconst INITIAL_DIMENSION = { width: 320, height: 200 } as const;\ntype TooltipNameType = number | string;\n\nexport type ChartConfig = Record<\n string,\n {\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\nconst ChartContext = React.createContext<ChartContextProps | null>(null);\n\nfunction useChart() {\n const context = React.useContext(ChartContext);\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />');\n }\n\n return context;\n}\n\nfunction ChartContainer({\n id,\n className,\n children,\n config,\n initialDimension = INITIAL_DIMENSION,\n ...props\n}: React.ComponentProps<'div'> & {\n config: ChartConfig;\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];\n initialDimension?: {\n width: number;\n height: number;\n };\n}) {\n const uniqueId = React.useId();\n const chartId = `chart-${id ?? uniqueId.replace(/:/g, '')}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n \"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className,\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer initialDimension={initialDimension}>\n {children}\n </RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n}\n\nconst ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {\n const colorConfig = Object.entries(config).filter(([, config]) => config.theme ?? config.color);\n\n if (!colorConfig.length) {\n return null;\n }\n\n return (\n <style\n dangerouslySetInnerHTML={{\n __html: Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ?? itemConfig.color;\n return color ? ` --color-${key}: ${color};` : null;\n })\n .join('\\n')}\n}\n`,\n )\n .join('\\n'),\n }}\n />\n );\n};\n\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\nfunction ChartTooltipContent({\n active,\n payload,\n className,\n indicator = 'dot',\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey,\n}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<'div'> & {\n hideLabel?: boolean;\n hideIndicator?: boolean;\n indicator?: 'line' | 'dot' | 'dashed';\n nameKey?: string;\n labelKey?: string;\n } & Omit<RechartsPrimitive.DefaultTooltipContentProps<TooltipValueType, TooltipNameType>, 'accessibilityLayer'>) {\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 = !labelKey && typeof label === 'string' ? (config[label]?.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 'border-border/50 bg-background grid min-w-32 items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload\n .filter((item) => 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={index}\n className={cn(\n '[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',\n indicator === 'dot' && 'items-center',\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, 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 != null && (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {typeof item.value === 'number' ? item.value.toLocaleString() : String(item.value)}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = 'bottom',\n nameKey,\n}: React.ComponentProps<'div'> & {\n hideIcon?: boolean;\n nameKey?: string;\n} & RechartsPrimitive.DefaultLegendContentProps) {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div className={cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className)}>\n {payload\n .filter((item) => item.type !== 'none')\n .map((item, index) => {\n const key = `${nameKey ?? item.dataKey ?? 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={index}\n className={cn('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n}\n\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];\n}\n\nexport { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };\n\n// The script was manually reverted here\n"],"mappings":"+PASM,EAAS,CAAE,MAAO,GAAI,KAAM,OAAQ,EAEpC,EAAoB,CAAE,MAAO,IAAK,OAAQ,GAAI,EAe9C,EAAe,EAAM,cAAwC,IAAI,EAEvE,SAAS,GAAW,CAClB,IAAM,EAAU,EAAM,WAAW,CAAY,EAE7C,GAAI,CAAC,EACH,MAAU,MAAM,mDAAmD,EAGrE,OAAO,CACT,CAEA,SAAS,EAAe,CACtB,KACA,YACA,WACA,SACA,mBAAmB,EACnB,GAAG,GAQF,CACD,IAAM,EAAW,EAAM,MAAM,EACvB,EAAU,SAAS,GAAM,EAAS,QAAQ,KAA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W,OAAO,EAAQ,SAAY,UAAY,EAAQ,UAAY,KAC/E,EAAQ,QACR,IAAA,GAEF,EAAyB,EAY7B,OAVI,KAAO,GAAW,OAAO,EAAQ,IAAiC,SACpE,EAAiB,EAAQ,GAEzB,GACA,KAAO,GACP,OAAO,EAAe,IAAwC,WAE9D,EAAiB,EAAe,IAG3B,KAAkB,EAAS,EAAO,GAAkB,EAAO,EACpE"}
package/dist/chart.mjs CHANGED
@@ -23,7 +23,7 @@ function d({ id: e, className: t, children: n, config: s, initialDimension: u =
23
23
  children: /* @__PURE__ */ (0, o.jsxs)("div", {
24
24
  "data-slot": "chart",
25
25
  "data-chart": m,
26
- className: i("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke=#ccc]]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke=#ccc]]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke=#ccc]]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke=#fff]]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke=#fff]]:stroke-transparent [&_.recharts-surface]:outline-hidden", t),
26
+ className: i("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", t),
27
27
  ...d,
28
28
  children: [/* @__PURE__ */ (0, o.jsx)(f, {
29
29
  id: m,
@@ -1 +1 @@
1
- {"version":3,"file":"chart.mjs","names":[],"sources":["../packages/ui-web/src/chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { TooltipValueType } from 'recharts';\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\nconst INITIAL_DIMENSION = { width: 320, height: 200 } as const;\ntype TooltipNameType = number | string;\n\nexport type ChartConfig = Record<\n string,\n {\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\nconst ChartContext = React.createContext<ChartContextProps | null>(null);\n\nfunction useChart() {\n const context = React.useContext(ChartContext);\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />');\n }\n\n return context;\n}\n\nfunction ChartContainer({\n id,\n className,\n children,\n config,\n initialDimension = INITIAL_DIMENSION,\n ...props\n}: React.ComponentProps<'div'> & {\n config: ChartConfig;\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];\n initialDimension?: {\n width: number;\n height: number;\n };\n}) {\n const uniqueId = React.useId();\n const chartId = `chart-${id ?? uniqueId.replace(/:/g, '')}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n '[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke=#ccc]]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke=#ccc]]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke=#ccc]]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke=#fff]]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke=#fff]]:stroke-transparent [&_.recharts-surface]:outline-hidden',\n className,\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer initialDimension={initialDimension}>\n {children}\n </RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n}\n\nconst ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {\n const colorConfig = Object.entries(config).filter(([, config]) => config.theme ?? config.color);\n\n if (!colorConfig.length) {\n return null;\n }\n\n return (\n <style\n dangerouslySetInnerHTML={{\n __html: Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ?? itemConfig.color;\n return color ? ` --color-${key}: ${color};` : null;\n })\n .join('\\n')}\n}\n`,\n )\n .join('\\n'),\n }}\n />\n );\n};\n\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\nfunction ChartTooltipContent({\n active,\n payload,\n className,\n indicator = 'dot',\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey,\n}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<'div'> & {\n hideLabel?: boolean;\n hideIndicator?: boolean;\n indicator?: 'line' | 'dot' | 'dashed';\n nameKey?: string;\n labelKey?: string;\n } & Omit<RechartsPrimitive.DefaultTooltipContentProps<TooltipValueType, TooltipNameType>, 'accessibilityLayer'>) {\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 = !labelKey && typeof label === 'string' ? (config[label]?.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 'border-border/50 bg-background grid min-w-32 items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload\n .filter((item) => 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={index}\n className={cn(\n '[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',\n indicator === 'dot' && 'items-center',\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, 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 != null && (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {typeof item.value === 'number' ? item.value.toLocaleString() : String(item.value)}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = 'bottom',\n nameKey,\n}: React.ComponentProps<'div'> & {\n hideIcon?: boolean;\n nameKey?: string;\n} & RechartsPrimitive.DefaultLegendContentProps) {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div className={cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className)}>\n {payload\n .filter((item) => item.type !== 'none')\n .map((item, index) => {\n const key = `${nameKey ?? item.dataKey ?? 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={index}\n className={cn('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n}\n\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];\n}\n\nexport { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };\n\n// The script was manually reverted here\n"],"mappings":";;;;;;aASM,IAAS;CAAE,OAAO;CAAI,MAAM;AAAQ,GAEpC,IAAoB;CAAE,OAAO;CAAK,QAAQ;AAAI,GAe9C,IAAe,EAAM,cAAwC,IAAI;AAEvE,SAAS,IAAW;CAClB,IAAM,IAAU,EAAM,WAAW,CAAY;CAE7C,IAAI,CAAC,GACH,MAAU,MAAM,mDAAmD;CAGrE,OAAO;AACT;AAEA,SAAS,EAAe,EACtB,OACA,cACA,aACA,WACA,sBAAmB,GACnB,GAAG,KAQF;CACD,IAAM,IAAW,EAAM,MAAM,GACvB,IAAU,SAAS,KAAM,EAAS,QAAQ,MAAM,EAAE;CAExD,OACE,iBAAA,GAAA,EAAA,KAAC,EAAa,UAAd;EAAuB,OAAO,EAAE,UAAO;YACrC,iBAAA,GAAA,EAAA,MAAC,OAAD;GACE,aAAU;GACV,cAAY;GACZ,WAAW,EACT,qpBACA,CACF;GACA,GAAI;aAPN,CASE,iBAAA,GAAA,EAAA,KAAC,GAAD;IAAY,IAAI;IAAiB;GAAS,CAAA,GAC1C,iBAAA,GAAA,EAAA,KAAC,GAAD;IAAyD;IACtD;GACoC,CAAA,CACpC;;CACgB,CAAA;AAE3B;AAEA,IAAM,KAAc,EAAE,OAAI,gBAAkD;CAC1E,IAAM,IAAc,OAAO,QAAQ,CAAM,EAAE,QAAQ,GAAG,OAAY,EAAO,SAAS,EAAO,KAAK;CAM9F,OAJK,EAAY,SAKf,iBAAA,GAAA,EAAA,KAAC,SAAD,EACE,yBAAyB,EACvB,QAAQ,OAAO,QAAQ,CAAM,EAC1B,KACE,CAAC,GAAO,OAAY;EAC/B,EAAO,eAAe,EAAG;EACzB,EACC,KAAK,CAAC,GAAK,OAAgB;EA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,GAAA,EAAA,KAAC,OAAD;EAAK,WAAW,EAAG,0CAA0C,MAAkB,QAAQ,SAAS,QAAQ,CAAS;YAC9G,EACE,QAAQ,MAAS,EAAK,SAAS,MAAM,EACrC,KAAK,GAAM,MAAU;GAEpB,IAAM,IAAa,EAA4B,GAAQ,GAAM,GAD9C,KAAW,EAAK,WAAW,SACsB;GAEhE,OACE,iBAAA,GAAA,EAAA,MAAC,OAAD;IAEE,WAAW,EAAG,iFAAiF;cAFjG,CAIG,GAAY,QAAQ,CAAC,IACpB,iBAAA,GAAA,EAAA,KAAC,EAAW,MAAZ,CAAkB,CAAA,IAElB,iBAAA,GAAA,EAAA,KAAC,OAAD;KACE,WAAU;KACV,OAAO,EACL,iBAAiB,EAAK,MACxB;IACD,CAAA,GAEF,GAAY,KACV;MAdE,CAcF;EAET,CAAC;CACA,CAAA,IA9BE;AAgCX;AAEA,SAAS,EAA4B,GAAqB,GAAkB,GAAa;CACvF,IAAI,OAAO,KAAY,aAAY,GACjC;CAGF,IAAM,IACJ,aAAa,KAAW,OAAO,EAAQ,WAAY,YAAY,EAAQ,YAAY,OAC/E,EAAQ,UACR,KAAA,GAEF,IAAyB;CAY7B,OAVI,KAAO,KAAW,OAAO,EAAQ,MAAiC,WACpE,IAAiB,EAAQ,KAEzB,KACA,KAAO,KACP,OAAO,EAAe,MAAwC,aAE9D,IAAiB,EAAe,KAG3B,KAAkB,IAAS,EAAO,KAAkB,EAAO;AACpE"}
1
+ {"version":3,"file":"chart.mjs","names":[],"sources":["../packages/ui-web/src/chart.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { TooltipValueType } from 'recharts';\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\nconst INITIAL_DIMENSION = { width: 320, height: 200 } as const;\ntype TooltipNameType = number | string;\n\nexport type ChartConfig = Record<\n string,\n {\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\nconst ChartContext = React.createContext<ChartContextProps | null>(null);\n\nfunction useChart() {\n const context = React.useContext(ChartContext);\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />');\n }\n\n return context;\n}\n\nfunction ChartContainer({\n id,\n className,\n children,\n config,\n initialDimension = INITIAL_DIMENSION,\n ...props\n}: React.ComponentProps<'div'> & {\n config: ChartConfig;\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];\n initialDimension?: {\n width: number;\n height: number;\n };\n}) {\n const uniqueId = React.useId();\n const chartId = `chart-${id ?? uniqueId.replace(/:/g, '')}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n data-slot=\"chart\"\n data-chart={chartId}\n className={cn(\n \"[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className,\n )}\n {...props}\n >\n <ChartStyle id={chartId} config={config} />\n <RechartsPrimitive.ResponsiveContainer initialDimension={initialDimension}>\n {children}\n </RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n}\n\nconst ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {\n const colorConfig = Object.entries(config).filter(([, config]) => config.theme ?? config.color);\n\n if (!colorConfig.length) {\n return null;\n }\n\n return (\n <style\n dangerouslySetInnerHTML={{\n __html: Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ?? itemConfig.color;\n return color ? ` --color-${key}: ${color};` : null;\n })\n .join('\\n')}\n}\n`,\n )\n .join('\\n'),\n }}\n />\n );\n};\n\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\nfunction ChartTooltipContent({\n active,\n payload,\n className,\n indicator = 'dot',\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey,\n}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<'div'> & {\n hideLabel?: boolean;\n hideIndicator?: boolean;\n indicator?: 'line' | 'dot' | 'dashed';\n nameKey?: string;\n labelKey?: string;\n } & Omit<RechartsPrimitive.DefaultTooltipContentProps<TooltipValueType, TooltipNameType>, 'accessibilityLayer'>) {\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 = !labelKey && typeof label === 'string' ? (config[label]?.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 'border-border/50 bg-background grid min-w-32 items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload\n .filter((item) => 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={index}\n className={cn(\n '[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',\n indicator === 'dot' && 'items-center',\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, 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 != null && (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {typeof item.value === 'number' ? item.value.toLocaleString() : String(item.value)}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\nfunction ChartLegendContent({\n className,\n hideIcon = false,\n payload,\n verticalAlign = 'bottom',\n nameKey,\n}: React.ComponentProps<'div'> & {\n hideIcon?: boolean;\n nameKey?: string;\n} & RechartsPrimitive.DefaultLegendContentProps) {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div className={cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className)}>\n {payload\n .filter((item) => item.type !== 'none')\n .map((item, index) => {\n const key = `${nameKey ?? item.dataKey ?? 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={index}\n className={cn('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"h-2 w-2 shrink-0 rounded-[2px]\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n}\n\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];\n}\n\nexport { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };\n\n// The script was manually reverted here\n"],"mappings":";;;;;;aASM,IAAS;CAAE,OAAO;CAAI,MAAM;AAAQ,GAEpC,IAAoB;CAAE,OAAO;CAAK,QAAQ;AAAI,GAe9C,IAAe,EAAM,cAAwC,IAAI;AAEvE,SAAS,IAAW;CAClB,IAAM,IAAU,EAAM,WAAW,CAAY;CAE7C,IAAI,CAAC,GACH,MAAU,MAAM,mDAAmD;CAGrE,OAAO;AACT;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WAAU;KACV,OAAO,EACL,iBAAiB,EAAK,MACxB;IACD,CAAA,GAEF,GAAY,KACV;MAdE,CAcF;EAET,CAAC;CACA,CAAA,IA9BE;AAgCX;AAEA,SAAS,EAA4B,GAAqB,GAAkB,GAAa;CACvF,IAAI,OAAO,KAAY,aAAY,GACjC;CAGF,IAAM,IACJ,aAAa,KAAW,OAAO,EAAQ,WAAY,YAAY,EAAQ,YAAY,OAC/E,EAAQ,UACR,KAAA,GAEF,IAAyB;CAY7B,OAVI,KAAO,KAAW,OAAO,EAAQ,MAAiC,WACpE,IAAiB,EAAQ,KAEzB,KACA,KAAO,KACP,OAAO,EAAe,MAAwC,aAE9D,IAAiB,EAAe,KAG3B,KAAkB,IAAS,EAAO,KAAkB,EAAO;AACpE"}
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.cjs","names":[],"sources":["../packages/ui-web/src/checkbox.tsx"],"sourcesContent":["import { Checkbox as CheckboxPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { CheckIcon } from 'lucide-react';\nimport { cn } from './lib/utils';\n\nimport type { CheckboxBaseProps } from '@gv-tech/ui-core';\n\nfunction Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n 'peer border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none [&>svg]:size-3.5\"\n >\n <CheckIcon />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n\n// Verify that the component satisfies the ui-core contract\nconst _verifyCheckboxContract: CheckboxBaseProps = {} as unknown as React.ComponentProps<typeof Checkbox>;\n"],"mappings":"kPAQA,SAAS,EAAS,CAAE,YAAW,GAAG,GAA8D,CAC9F,OACE,EAAA,EAAA,KAAA,EAAA,GAAA,CACE,YAAU,WACV,UAAW,EAAA,EACT,osBACA,CACF,EACA,GAAI,YAEJ,EAAA,EAAA,KAAA,EAAA,GAAA,CACE,YAAU,qBACV,UAAU,oFAEV,EAAA,EAAA,KAAC,EAAA,GAAD,CAAY,CAAA,CACe,CAAA,CACP,CAAA,CAE5B"}
1
+ {"version":3,"file":"checkbox.cjs","names":[],"sources":["../packages/ui-web/src/checkbox.tsx"],"sourcesContent":["import { Checkbox as CheckboxPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { CheckIcon } from 'lucide-react';\nimport { cn } from './lib/utils';\n\nimport type { CheckboxBaseProps } from '@gv-tech/ui-core';\n\nfunction Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n 'peer border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none [&>svg]:size-3.5\"\n >\n <CheckIcon />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyCheckboxContract = React.ComponentProps<typeof Checkbox> extends CheckboxBaseProps ? true : false;\n"],"mappings":"kPAQA,SAAS,EAAS,CAAE,YAAW,GAAG,GAA8D,CAC9F,OACE,EAAA,EAAA,KAAA,EAAA,GAAA,CACE,YAAU,WACV,UAAW,EAAA,EACT,osBACA,CACF,EACA,GAAI,YAEJ,EAAA,EAAA,KAAA,EAAA,GAAA,CACE,YAAU,qBACV,UAAU,oFAEV,EAAA,EAAA,KAAC,EAAA,GAAD,CAAY,CAAA,CACe,CAAA,CACP,CAAA,CAE5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.mjs","names":[],"sources":["../packages/ui-web/src/checkbox.tsx"],"sourcesContent":["import { Checkbox as CheckboxPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { CheckIcon } from 'lucide-react';\nimport { cn } from './lib/utils';\n\nimport type { CheckboxBaseProps } from '@gv-tech/ui-core';\n\nfunction Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n 'peer border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none [&>svg]:size-3.5\"\n >\n <CheckIcon />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n\n// Verify that the component satisfies the ui-core contract\nconst _verifyCheckboxContract: CheckboxBaseProps = {} as unknown as React.ComponentProps<typeof Checkbox>;\n"],"mappings":";;;;;;AAQA,SAAS,EAAS,EAAE,cAAW,GAAG,KAA8D;CAC9F,OACE,iBAAA,GAAA,EAAA,KAAC,GAAD;EACE,aAAU;EACV,WAAW,EACT,qsBACA,CACF;EACA,GAAI;YAEJ,iBAAA,GAAA,EAAA,KAAC,GAAD;GACE,aAAU;GACV,WAAU;aAEV,iBAAA,GAAA,EAAA,KAAC,GAAD,CAAY,CAAA;EACe,CAAA;CACP,CAAA;AAE5B"}
1
+ {"version":3,"file":"checkbox.mjs","names":[],"sources":["../packages/ui-web/src/checkbox.tsx"],"sourcesContent":["import { Checkbox as CheckboxPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { CheckIcon } from 'lucide-react';\nimport { cn } from './lib/utils';\n\nimport type { CheckboxBaseProps } from '@gv-tech/ui-core';\n\nfunction Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n 'peer border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none [&>svg]:size-3.5\"\n >\n <CheckIcon />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyCheckboxContract = React.ComponentProps<typeof Checkbox> extends CheckboxBaseProps ? true : false;\n"],"mappings":";;;;;;AAQA,SAAS,EAAS,EAAE,cAAW,GAAG,KAA8D;CAC9F,OACE,iBAAA,GAAA,EAAA,KAAC,GAAD;EACE,aAAU;EACV,WAAW,EACT,qsBACA,CACF;EACA,GAAI;YAEJ,iBAAA,GAAA,EAAA,KAAC,GAAD;GACE,aAAU;GACV,WAAU;aAEV,iBAAA,GAAA,EAAA,KAAC,GAAD,CAAY,CAAA;EACe,CAAA;CACP,CAAA;AAE5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"collapsible.cjs","names":[],"sources":["../packages/ui-web/src/collapsible.tsx"],"sourcesContent":["'use client';\n\nimport { Collapsible as CollapsiblePrimitive } from 'radix-ui';\n\nimport type { CollapsibleBaseProps } from '@gv-tech/ui-core';\n\nfunction Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nfunction CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return <CollapsiblePrimitive.CollapsibleTrigger data-slot=\"collapsible-trigger\" {...props} />;\n}\n\nfunction CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return <CollapsiblePrimitive.CollapsibleContent data-slot=\"collapsible-content\" {...props} />;\n}\n\nexport { Collapsible, CollapsibleContent, CollapsibleTrigger };\n\n// Verify that the component satisfies the ui-core contract\nconst _verifyCollapsibleContract: CollapsibleBaseProps = {} as unknown as React.ComponentProps<typeof Collapsible>;\n"],"mappings":"kJAMA,SAAS,EAAY,CAAE,GAAG,GAAiE,CACzF,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAA2B,YAAU,cAAc,GAAI,CAAQ,CAAA,CACxE,CAEA,SAAS,EAAmB,CAAE,GAAG,GAA+E,CAC9G,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAAyC,YAAU,sBAAsB,GAAI,CAAQ,CAAA,CAC9F,CAEA,SAAS,EAAmB,CAAE,GAAG,GAA+E,CAC9G,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAAyC,YAAU,sBAAsB,GAAI,CAAQ,CAAA,CAC9F"}
1
+ {"version":3,"file":"collapsible.cjs","names":[],"sources":["../packages/ui-web/src/collapsible.tsx"],"sourcesContent":["'use client';\n\nimport { Collapsible as CollapsiblePrimitive } from 'radix-ui';\n\nimport type { CollapsibleBaseProps } from '@gv-tech/ui-core';\n\nfunction Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nfunction CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return <CollapsiblePrimitive.CollapsibleTrigger data-slot=\"collapsible-trigger\" {...props} />;\n}\n\nfunction CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return <CollapsiblePrimitive.CollapsibleContent data-slot=\"collapsible-content\" {...props} />;\n}\n\nexport { Collapsible, CollapsibleContent, CollapsibleTrigger };\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyCollapsibleContract =\n React.ComponentProps<typeof Collapsible> extends CollapsibleBaseProps ? true : false;\n"],"mappings":"kJAMA,SAAS,EAAY,CAAE,GAAG,GAAiE,CACzF,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAA2B,YAAU,cAAc,GAAI,CAAQ,CAAA,CACxE,CAEA,SAAS,EAAmB,CAAE,GAAG,GAA+E,CAC9G,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAAyC,YAAU,sBAAsB,GAAI,CAAQ,CAAA,CAC9F,CAEA,SAAS,EAAmB,CAAE,GAAG,GAA+E,CAC9G,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAAyC,YAAU,sBAAsB,GAAI,CAAQ,CAAA,CAC9F"}
@@ -1 +1 @@
1
- {"version":3,"file":"collapsible.mjs","names":[],"sources":["../packages/ui-web/src/collapsible.tsx"],"sourcesContent":["'use client';\n\nimport { Collapsible as CollapsiblePrimitive } from 'radix-ui';\n\nimport type { CollapsibleBaseProps } from '@gv-tech/ui-core';\n\nfunction Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nfunction CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return <CollapsiblePrimitive.CollapsibleTrigger data-slot=\"collapsible-trigger\" {...props} />;\n}\n\nfunction CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return <CollapsiblePrimitive.CollapsibleContent data-slot=\"collapsible-content\" {...props} />;\n}\n\nexport { Collapsible, CollapsibleContent, CollapsibleTrigger };\n\n// Verify that the component satisfies the ui-core contract\nconst _verifyCollapsibleContract: CollapsibleBaseProps = {} as unknown as React.ComponentProps<typeof Collapsible>;\n"],"mappings":";;;;;AAMA,SAAS,EAAY,EAAE,GAAG,KAAiE;CACzF,OAAO,iBAAA,GAAA,EAAA,KAAC,GAAD;EAA2B,aAAU;EAAc,GAAI;CAAQ,CAAA;AACxE;AAEA,SAAS,EAAmB,EAAE,GAAG,KAA+E;CAC9G,OAAO,iBAAA,GAAA,EAAA,KAAC,GAAD;EAAyC,aAAU;EAAsB,GAAI;CAAQ,CAAA;AAC9F;AAEA,SAAS,EAAmB,EAAE,GAAG,KAA+E;CAC9G,OAAO,iBAAA,GAAA,EAAA,KAAC,GAAD;EAAyC,aAAU;EAAsB,GAAI;CAAQ,CAAA;AAC9F"}
1
+ {"version":3,"file":"collapsible.mjs","names":[],"sources":["../packages/ui-web/src/collapsible.tsx"],"sourcesContent":["'use client';\n\nimport { Collapsible as CollapsiblePrimitive } from 'radix-ui';\n\nimport type { CollapsibleBaseProps } from '@gv-tech/ui-core';\n\nfunction Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nfunction CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return <CollapsiblePrimitive.CollapsibleTrigger data-slot=\"collapsible-trigger\" {...props} />;\n}\n\nfunction CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return <CollapsiblePrimitive.CollapsibleContent data-slot=\"collapsible-content\" {...props} />;\n}\n\nexport { Collapsible, CollapsibleContent, CollapsibleTrigger };\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyCollapsibleContract =\n React.ComponentProps<typeof Collapsible> extends CollapsibleBaseProps ? true : false;\n"],"mappings":";;;;;AAMA,SAAS,EAAY,EAAE,GAAG,KAAiE;CACzF,OAAO,iBAAA,GAAA,EAAA,KAAC,GAAD;EAA2B,aAAU;EAAc,GAAI;CAAQ,CAAA;AACxE;AAEA,SAAS,EAAmB,EAAE,GAAG,KAA+E;CAC9G,OAAO,iBAAA,GAAA,EAAA,KAAC,GAAD;EAAyC,aAAU;EAAsB,GAAI;CAAQ,CAAA;AAC9F;AAEA,SAAS,EAAmB,EAAE,GAAG,KAA+E;CAC9G,OAAO,iBAAA,GAAA,EAAA,KAAC,GAAD;EAAyC,aAAU;EAAsB,GAAI;CAAQ,CAAA;AAC9F"}
@@ -1 +1 @@
1
- {"version":3,"file":"command.cjs","names":[],"sources":["../packages/ui-web/src/command.tsx"],"sourcesContent":["import { Command as CommandPrimitive } from 'cmdk';\nimport * as React from 'react';\n\nimport { CheckIcon, SearchIcon } from 'lucide-react';\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from './dialog';\nimport { InputGroup, InputGroupAddon } from './input-group';\nimport { cn } from './lib/utils';\n\nimport type { CommandBaseProps } from '@gv-tech/ui-core';\n\nfunction Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {\n return (\n <CommandPrimitive\n data-slot=\"command\"\n className={cn(\n 'bg-popover text-popover-foreground flex size-full flex-col overflow-hidden rounded-xl! p-1',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandDialog({\n title = 'Command Palette',\n description = 'Search for a command to run...',\n children,\n className,\n showCloseButton = false,\n ...props\n}: React.ComponentProps<typeof Dialog> & {\n title?: string;\n description?: string;\n className?: string;\n showCloseButton?: boolean;\n}) {\n return (\n <Dialog {...props}>\n <DialogHeader className=\"sr-only\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent\n className={cn('top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0 shadow-2xl', className)}\n showCloseButton={showCloseButton}\n >\n <Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:size-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div data-slot=\"command-input-wrapper\" className=\"p-1 pb-0\">\n <InputGroup className=\"border-input/30 bg-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:ps-2!\">\n <CommandPrimitive.Input\n data-slot=\"command-input\"\n className={cn('w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50', className)}\n {...props}\n />\n <InputGroupAddon>\n <SearchIcon className=\"size-4 shrink-0 opacity-50\" />\n </InputGroupAddon>\n </InputGroup>\n </div>\n );\n}\n\nfunction CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <CommandPrimitive.List\n data-slot=\"command-list\"\n className={cn('no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none', className)}\n {...props}\n />\n );\n}\n\nfunction CommandEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n data-slot=\"command-empty\"\n className={cn('py-6 text-center text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n data-slot=\"command-group\"\n className={cn(\n 'text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n data-slot=\"command-separator\"\n className={cn('bg-border -mx-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction CommandItem({ className, children, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n data-slot=\"command-item\"\n className={cn(\n 'group/command-item data-[selected=true]:bg-muted data-[selected=true]:text-foreground data-[selected=true]:*:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n {...props}\n >\n {children}\n <CheckIcon className=\"ms-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100\" />\n </CommandPrimitive.Item>\n );\n}\n\nfunction CommandShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"command-shortcut\"\n className={cn(\n 'text-muted-foreground group-data-[selected=true]/command-item:text-foreground ms-auto text-xs tracking-widest',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n Command,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n CommandShortcut,\n};\n\n// Verify that the component satisfies the ui-core contract\nconst _verifyCommandContract: CommandBaseProps = {} as unknown as React.ComponentProps<typeof Command>;\n"],"mappings":"2SAUA,SAAS,EAAQ,CAAE,YAAW,GAAG,GAAwD,CACvF,OACE,EAAA,EAAA,KAAC,EAAA,EAAD,CACE,YAAU,UACV,UAAW,EAAA,EACT,6FACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,EAAc,CACrB,QAAQ,kBACR,cAAc,iCACd,WACA,YACA,kBAAkB,GAClB,GAAG,GAMF,CACD,OACE,EAAA,EAAA,MAAC,EAAA,OAAD,CAAQ,GAAI,WAAZ,EACE,EAAA,EAAA,MAAC,EAAA,aAAD,CAAc,UAAU,mBAAxB,EACE,EAAA,EAAA,KAAC,EAAA,YAAD,CAAA,SAAc,CAAmB,CAAA,GACjC,EAAA,EAAA,KAAC,EAAA,kBAAD,CAAA,SAAoB,CAA+B,CAAA,CACvC,KACd,EAAA,EAAA,KAAC,EAAA,cAAD,CACE,UAAW,EAAA,EAAG,mEAAoE,CAAS,EAC1E,4BAEjB,EAAA,E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,EAAA,MAAC,EAAA,EAAiB,KAAlB,CACE,YAAU,eACV,UAAW,EAAA,EACT,kbACA,CACF,EACA,GAAI,WANN,CAQG,GACD,EAAA,EAAA,KAAC,EAAA,GAAD,CAAW,UAAU,iIAAmI,CAAA,CACnI,GAE3B,CAEA,SAAS,EAAgB,CAAE,YAAW,GAAG,GAAuC,CAC9E,OACE,EAAA,EAAA,KAAC,OAAD,CACE,YAAU,mBACV,UAAW,EAAA,EACT,gHACA,CACF,EACA,GAAI,CACL,CAAA,CAEL"}
1
+ {"version":3,"file":"command.cjs","names":[],"sources":["../packages/ui-web/src/command.tsx"],"sourcesContent":["import { Command as CommandPrimitive } from 'cmdk';\nimport * as React from 'react';\n\nimport { CheckIcon, SearchIcon } from 'lucide-react';\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from './dialog';\nimport { InputGroup, InputGroupAddon } from './input-group';\nimport { cn } from './lib/utils';\n\nimport type { CommandBaseProps } from '@gv-tech/ui-core';\n\nfunction Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {\n return (\n <CommandPrimitive\n data-slot=\"command\"\n className={cn(\n 'bg-popover text-popover-foreground flex size-full flex-col overflow-hidden rounded-xl! p-1',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandDialog({\n title = 'Command Palette',\n description = 'Search for a command to run...',\n children,\n className,\n showCloseButton = false,\n ...props\n}: React.ComponentProps<typeof Dialog> & {\n title?: string;\n description?: string;\n className?: string;\n showCloseButton?: boolean;\n}) {\n return (\n <Dialog {...props}>\n <DialogHeader className=\"sr-only\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent\n className={cn('top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0 shadow-2xl', className)}\n showCloseButton={showCloseButton}\n >\n <Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:size-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div data-slot=\"command-input-wrapper\" className=\"p-1 pb-0\">\n <InputGroup className=\"border-input/30 bg-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:ps-2!\">\n <CommandPrimitive.Input\n data-slot=\"command-input\"\n className={cn('w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50', className)}\n {...props}\n />\n <InputGroupAddon>\n <SearchIcon className=\"size-4 shrink-0 opacity-50\" />\n </InputGroupAddon>\n </InputGroup>\n </div>\n );\n}\n\nfunction CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <CommandPrimitive.List\n data-slot=\"command-list\"\n className={cn('no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none', className)}\n {...props}\n />\n );\n}\n\nfunction CommandEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n data-slot=\"command-empty\"\n className={cn('py-6 text-center text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n data-slot=\"command-group\"\n className={cn(\n 'text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n data-slot=\"command-separator\"\n className={cn('bg-border -mx-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction CommandItem({ className, children, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n data-slot=\"command-item\"\n className={cn(\n 'group/command-item data-[selected=true]:bg-muted data-[selected=true]:text-foreground data-[selected=true]:*:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n {...props}\n >\n {children}\n <CheckIcon className=\"ms-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100\" />\n </CommandPrimitive.Item>\n );\n}\n\nfunction CommandShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"command-shortcut\"\n className={cn(\n 'text-muted-foreground group-data-[selected=true]/command-item:text-foreground ms-auto text-xs tracking-widest',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n Command,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n CommandShortcut,\n};\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyCommandContract = React.ComponentProps<typeof Command> extends CommandBaseProps ? true : false;\n"],"mappings":"2SAUA,SAAS,EAAQ,CAAE,YAAW,GAAG,GAAwD,CACvF,OACE,EAAA,EAAA,KAAC,EAAA,EAAD,CACE,YAAU,UACV,UAAW,EAAA,EACT,6FACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,EAAc,CACrB,QAAQ,kBACR,cAAc,iCACd,WACA,YACA,kBAAkB,GAClB,GAAG,GAMF,CACD,OACE,EAAA,EAAA,MAAC,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CACE,YAAU,gBACV,UAAW,EAAA,EACT,8NACA,CACF,EACA,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,EAAiB,CAAE,YAAW,GAAG,GAAkE,CAC1G,OACE,EAAA,EAAA,KAAC,EAAA,EAAiB,UAAlB,CACE,YAAU,oBACV,UAAW,EAAA,EAAG,uBAAwB,CAAS,EAC/C,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,EAAY,CAAE,YAAW,WAAU,GAAG,GAA6D,CAC1G,OACE,EAAA,EAAA,MAAC,EAAA,EAAiB,KAAlB,CACE,YAAU,eACV,UAAW,EAAA,EACT,kbACA,CACF,EACA,GAAI,WANN,CAQG,GACD,EAAA,EAAA,KAAC,EAAA,GAAD,CAAW,UAAU,iIAAmI,CAAA,CACnI,GAE3B,CAEA,SAAS,EAAgB,CAAE,YAAW,GAAG,GAAuC,CAC9E,OACE,EAAA,EAAA,KAAC,OAAD,CACE,YAAU,mBACV,UAAW,EAAA,EACT,gHACA,CACF,EACA,GAAI,CACL,CAAA,CAEL"}
@@ -1 +1 @@
1
- {"version":3,"file":"command.mjs","names":[],"sources":["../packages/ui-web/src/command.tsx"],"sourcesContent":["import { Command as CommandPrimitive } from 'cmdk';\nimport * as React from 'react';\n\nimport { CheckIcon, SearchIcon } from 'lucide-react';\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from './dialog';\nimport { InputGroup, InputGroupAddon } from './input-group';\nimport { cn } from './lib/utils';\n\nimport type { CommandBaseProps } from '@gv-tech/ui-core';\n\nfunction Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {\n return (\n <CommandPrimitive\n data-slot=\"command\"\n className={cn(\n 'bg-popover text-popover-foreground flex size-full flex-col overflow-hidden rounded-xl! p-1',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandDialog({\n title = 'Command Palette',\n description = 'Search for a command to run...',\n children,\n className,\n showCloseButton = false,\n ...props\n}: React.ComponentProps<typeof Dialog> & {\n title?: string;\n description?: string;\n className?: string;\n showCloseButton?: boolean;\n}) {\n return (\n <Dialog {...props}>\n <DialogHeader className=\"sr-only\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent\n className={cn('top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0 shadow-2xl', className)}\n showCloseButton={showCloseButton}\n >\n <Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:size-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div data-slot=\"command-input-wrapper\" className=\"p-1 pb-0\">\n <InputGroup className=\"border-input/30 bg-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:ps-2!\">\n <CommandPrimitive.Input\n data-slot=\"command-input\"\n className={cn('w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50', className)}\n {...props}\n />\n <InputGroupAddon>\n <SearchIcon className=\"size-4 shrink-0 opacity-50\" />\n </InputGroupAddon>\n </InputGroup>\n </div>\n );\n}\n\nfunction CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <CommandPrimitive.List\n data-slot=\"command-list\"\n className={cn('no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none', className)}\n {...props}\n />\n );\n}\n\nfunction CommandEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n data-slot=\"command-empty\"\n className={cn('py-6 text-center text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n data-slot=\"command-group\"\n className={cn(\n 'text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n data-slot=\"command-separator\"\n className={cn('bg-border -mx-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction CommandItem({ className, children, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n data-slot=\"command-item\"\n className={cn(\n 'group/command-item data-[selected=true]:bg-muted data-[selected=true]:text-foreground data-[selected=true]:*:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n {...props}\n >\n {children}\n <CheckIcon className=\"ms-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100\" />\n </CommandPrimitive.Item>\n );\n}\n\nfunction CommandShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"command-shortcut\"\n className={cn(\n 'text-muted-foreground group-data-[selected=true]/command-item:text-foreground ms-auto text-xs tracking-widest',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n Command,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n CommandShortcut,\n};\n\n// Verify that the component satisfies the ui-core contract\nconst _verifyCommand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AU;EACV,WAAW,EAAG,oFAAoF,CAAS;EAC3G,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAa,EAAE,cAAW,GAAG,KAA8D;CAClG,OACE,iBAAA,GAAA,EAAA,KAAC,EAAiB,OAAlB;EACE,aAAU;EACV,WAAW,EAAG,4BAA4B,CAAS;EACnD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAa,EAAE,cAAW,GAAG,KAA8D;CAClG,OACE,iBAAA,GAAA,EAAA,KAAC,EAAiB,OAAlB;EACE,aAAU;EACV,WAAW,EACT,+NACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAiB,EAAE,cAAW,GAAG,KAAkE;CAC1G,OACE,iBAAA,GAAA,EAAA,KAAC,EAAiB,WAAlB;EACE,aAAU;EACV,WAAW,EAAG,wBAAwB,CAAS;EAC/C,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAY,EAAE,cAAW,aAAU,GAAG,KAA6D;CAC1G,OACE,iBAAA,GAAA,EAAA,MAAC,EAAiB,MAAlB;EACE,aAAU;EACV,WAAW,EACT,mbACA,CACF;EACA,GAAI;YANN,CAQG,GACD,iBAAA,GAAA,EAAA,KAAC,GAAD,EAAW,WAAU,kIAAmI,CAAA,CACnI;;AAE3B;AAEA,SAAS,EAAgB,EAAE,cAAW,GAAG,KAAuC;CAC9E,OACE,iBAAA,GAAA,EAAA,KAAC,QAAD;EACE,aAAU;EACV,WAAW,EACT,iHACA,CACF;EACA,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"command.mjs","names":[],"sources":["../packages/ui-web/src/command.tsx"],"sourcesContent":["import { Command as CommandPrimitive } from 'cmdk';\nimport * as React from 'react';\n\nimport { CheckIcon, SearchIcon } from 'lucide-react';\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from './dialog';\nimport { InputGroup, InputGroupAddon } from './input-group';\nimport { cn } from './lib/utils';\n\nimport type { CommandBaseProps } from '@gv-tech/ui-core';\n\nfunction Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {\n return (\n <CommandPrimitive\n data-slot=\"command\"\n className={cn(\n 'bg-popover text-popover-foreground flex size-full flex-col overflow-hidden rounded-xl! p-1',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandDialog({\n title = 'Command Palette',\n description = 'Search for a command to run...',\n children,\n className,\n showCloseButton = false,\n ...props\n}: React.ComponentProps<typeof Dialog> & {\n title?: string;\n description?: string;\n className?: string;\n showCloseButton?: boolean;\n}) {\n return (\n <Dialog {...props}>\n <DialogHeader className=\"sr-only\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent\n className={cn('top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0 shadow-2xl', className)}\n showCloseButton={showCloseButton}\n >\n <Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:size-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div data-slot=\"command-input-wrapper\" className=\"p-1 pb-0\">\n <InputGroup className=\"border-input/30 bg-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:ps-2!\">\n <CommandPrimitive.Input\n data-slot=\"command-input\"\n className={cn('w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50', className)}\n {...props}\n />\n <InputGroupAddon>\n <SearchIcon className=\"size-4 shrink-0 opacity-50\" />\n </InputGroupAddon>\n </InputGroup>\n </div>\n );\n}\n\nfunction CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <CommandPrimitive.List\n data-slot=\"command-list\"\n className={cn('no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none', className)}\n {...props}\n />\n );\n}\n\nfunction CommandEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n data-slot=\"command-empty\"\n className={cn('py-6 text-center text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n data-slot=\"command-group\"\n className={cn(\n 'text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n data-slot=\"command-separator\"\n className={cn('bg-border -mx-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction CommandItem({ className, children, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n data-slot=\"command-item\"\n className={cn(\n 'group/command-item data-[selected=true]:bg-muted data-[selected=true]:text-foreground data-[selected=true]:*:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n {...props}\n >\n {children}\n <CheckIcon className=\"ms-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100\" />\n </CommandPrimitive.Item>\n );\n}\n\nfunction CommandShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"command-shortcut\"\n className={cn(\n 'text-muted-foreground group-data-[selected=true]/command-item:text-foreground ms-auto text-xs tracking-widest',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n Command,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n CommandShortcut,\n};\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyCommandContract = React.ComponentProps<typeof Command> extends CommandBaseProps ? true : false;\n"],"mappings":";;;;;;;;AAUA,SAAS,EAAQ,EAAE,cAAW,GAAG,KAAwD;CACvF,OACE,iBAAA,GAAA,EAAA,KAAC,GAAD;EACE,aAAU;EACV,WAAW,EACT,8FACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAc,EACrB,WAAQ,mBACR,iBAAc,kCACd,aACA,cACA,qBAAkB,IAClB,GAAG,KAMF;CACD,OACE,iBAAA,GAAA,EAAA,MAAC,GAAD;EAAQ,GAAI;YAAZ,CACE,iBAAA,GAAA,EAAA,MAAC,GAAD;GAAc,WAAU;aAAxB,CACE,iBAAA,GAAA,EAAA,KAAC,GAAD,EAAA,UAAc,EAAmB,CAAA,GACjC,iBAAA,GAAA,EAAA,KAAC,GAAD,EAAA,UAAoB,EAA+B,CAAA,CACvC;MACd,iBAAA,GAAA,EAAA,KAAC,GAAD;GACE,WAAW,EAAG,oEAAoE,CAAS;GAC1E;aAEjB,iBAAA,GAAA,EAAA,KAAC,GAAD;IAAS,WAAU;IAChB;GACM,CAAA;EACI,CAAA,CACT;;AAEZ;AAEA,SAAS,EAAa,EAAE,cAAW,GAAG,KAA8D;CAClG,OACE,iBAAA,GAAA,EAAA,KAAC,OAAD;EAAK,aAAU;EAAwB,WAAU;YAC/C,iBAAA,GAAA,EAAA,MAAC,GAAD;GAAY,WAAU;aAAtB,CACE,iBAAA,GAAA,EAAA,KAAC,EAAiB,OAAlB;IACE,aAA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AAA;AAEL"}
@@ -1 +1 @@
1
- {"version":3,"file":"context-menu.cjs","names":[],"sources":["../packages/ui-web/src/context-menu.tsx"],"sourcesContent":["import { ContextMenu as ContextMenuPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { CheckIcon, ChevronRightIcon } from 'lucide-react';\nimport { cn } from './lib/utils';\n\nimport type { ContextMenuBaseProps } from '@gv-tech/ui-core';\n\nfunction ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {\n return <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />;\n}\n\nfunction ContextMenuTrigger({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {\n return (\n <ContextMenuPrimitive.Trigger\n data-slot=\"context-menu-trigger\"\n className={cn('select-none', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {\n return <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />;\n}\n\nfunction ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {\n return <ContextMenuPrimitive.Portal data-slot=\"context-menu-portal\" {...props} />;\n}\n\nfunction ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {\n return <ContextMenuPrimitive.Sub data-slot=\"context-menu-sub\" {...props} />;\n}\n\nfunction ContextMenuRadioGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {\n return <ContextMenuPrimitive.RadioGroup data-slot=\"context-menu-radio-group\" {...props} />;\n}\n\nfunction ContextMenuContent({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Content> & {\n side?: 'top' | 'right' | 'bottom' | 'left';\n}) {\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n data-slot=\"context-menu-content\"\n className={cn(\n 'bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-1 shadow-md ring-1 duration-100',\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n );\n}\n\nfunction ContextMenuItem({\n className,\n inset,\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) {\n return (\n <ContextMenuPrimitive.Item\n data-slot=\"context-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n 'group/context-menu-item focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:ps-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.SubTrigger\n data-slot=\"context-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-inset:ps-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ms-auto\" />\n </ContextMenuPrimitive.SubTrigger>\n );\n}\n\nfunction ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {\n return (\n <ContextMenuPrimitive.SubContent\n data-slot=\"context-menu-sub-content\"\n className={cn(\n 'bg-popover text-popover-foreground data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg border p-1 shadow-lg duration-100',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuCheckboxItem({\n className,\n children,\n checked,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.CheckboxItem\n data-slot=\"context-menu-checkbox-item\"\n data-inset={inset}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-1.5 rounded-md py-1 ps-1.5 pe-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:ps-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute end-2\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction ContextMenuRadioItem({\n className,\n children,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.RadioItem\n data-slot=\"context-menu-radio-item\"\n data-inset={inset}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-1.5 rounded-md py-1 ps-1.5 pe-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:ps-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute end-2\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n );\n}\n\nfunction ContextMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.Label\n data-slot=\"context-menu-label\"\n data-inset={inset}\n className={cn('text-muted-foreground px-1.5 py-1 text-xs font-medium data-inset:ps-7', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSeparator({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {\n return (\n <ContextMenuPrimitive.Separator\n data-slot=\"context-menu-separator\"\n className={cn('bg-border -mx-1 my-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"context-menu-shortcut\"\n className={cn(\n 'text-muted-foreground group-focus/context-menu-item:text-accent-foreground ms-auto text-xs tracking-widest',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n ContextMenu,\n ContextMenuCheckboxItem,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuItem,\n ContextMenuLabel,\n ContextMenuPortal,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuTrigger,\n};\n\n// Verify that the component satisfies the ui-core contract\nconst _verifyContextMenuContract: ContextMenuBaseProps = {} as unknown as React.ComponentProps<typeof ContextMenu>;\n"],"mappings":"kPAQA,SAAS,EAAY,CAAE,GAAG,GAAiE,CACzF,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAA2B,YAAU,eAAe,GAAI,CAAQ,CAAA,CACzE,CAEA,SAAS,EAAmB,CAAE,YAAW,GAAG,GAAoE,CAC9G,OACE,EAAA,EAAA,KAAA,EAAA,GAAA,CACE,YAAU,uBACV,UAAW,EAAA,EAAG,cAAe,CAAS,EACtC,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,EAAiB,CAAE,GAAG,GAAkE,CAC/F,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAA4B,YAAU,qBAAqB,GAAI,CAAQ,CAAA,CAChF,CAEA,SAAS,EAAkB,CAAE,GAAG,GAAmE,CACjG,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAA6B,YAAU,sBAAsB,GAAI,CAAQ,CAAA,CAClF,CAEA,SAAS,EAAe,CAAE,GAAG,GAAgE,CAC3F,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAA0B,YAAU,mBAAmB,GAAI,CAAQ,CAAA,CAC5E,CAEA,SAAS,EAAsB,CAAE,GAAG,GAAuE,CACzG,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAAiC,YAAU,2BAA2B,GAAI,CAAQ,CAAA,CAC3F,CAEA,SAAS,EAAmB,CAC1B,YACA,GAAG,GAGF,CACD,OACE,EAAA,EAAA,KAAA,EAAA,GAAA,CAAA,UACE,EAAA,EAAA,KAAA,EAAA,GAAA,CACE,YAAU,uBACV,UAAW,EAAA,EACT,mlBACA,CACF,EACA,GAAI,CACL,CAAA,CAC0B,CAAA,CAEjC,CAEA,SAAS,EAAgB,CACvB,YACA,QACA,UAAU,UACV,GAAG,GAIF,CACD,OACE,EAAA,EAAA,KAAA,EAAA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AGF,CACD,OACE,EAAA,EAAA,KAAA,EAAA,GAAA,CACE,YAAU,qBACV,aAAY,EACZ,UAAW,EAAA,EAAG,wEAAyE,CAAS,EAChG,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,EAAqB,CAAE,YAAW,GAAG,GAAsE,CAClH,OACE,EAAA,EAAA,KAAA,EAAA,GAAA,CACE,YAAU,yBACV,UAAW,EAAA,EAAG,4BAA6B,CAAS,EACpD,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,EAAoB,CAAE,YAAW,GAAG,GAAuC,CAClF,OACE,EAAA,EAAA,KAAC,OAAD,CACE,YAAU,wBACV,UAAW,EAAA,EACT,6GACA,CACF,EACA,GAAI,CACL,CAAA,CAEL"}
1
+ {"version":3,"file":"context-menu.cjs","names":[],"sources":["../packages/ui-web/src/context-menu.tsx"],"sourcesContent":["import { ContextMenu as ContextMenuPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { CheckIcon, ChevronRightIcon } from 'lucide-react';\nimport { cn } from './lib/utils';\n\nimport type { ContextMenuBaseProps } from '@gv-tech/ui-core';\n\nfunction ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {\n return <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />;\n}\n\nfunction ContextMenuTrigger({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {\n return (\n <ContextMenuPrimitive.Trigger\n data-slot=\"context-menu-trigger\"\n className={cn('select-none', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {\n return <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />;\n}\n\nfunction ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {\n return <ContextMenuPrimitive.Portal data-slot=\"context-menu-portal\" {...props} />;\n}\n\nfunction ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {\n return <ContextMenuPrimitive.Sub data-slot=\"context-menu-sub\" {...props} />;\n}\n\nfunction ContextMenuRadioGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {\n return <ContextMenuPrimitive.RadioGroup data-slot=\"context-menu-radio-group\" {...props} />;\n}\n\nfunction ContextMenuContent({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Content> & {\n side?: 'top' | 'right' | 'bottom' | 'left';\n}) {\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n data-slot=\"context-menu-content\"\n className={cn(\n 'bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-1 shadow-md ring-1 duration-100',\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n );\n}\n\nfunction ContextMenuItem({\n className,\n inset,\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) {\n return (\n <ContextMenuPrimitive.Item\n data-slot=\"context-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n 'group/context-menu-item focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:ps-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.SubTrigger\n data-slot=\"context-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-inset:ps-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ms-auto\" />\n </ContextMenuPrimitive.SubTrigger>\n );\n}\n\nfunction ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {\n return (\n <ContextMenuPrimitive.SubContent\n data-slot=\"context-menu-sub-content\"\n className={cn(\n 'bg-popover text-popover-foreground data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg border p-1 shadow-lg duration-100',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuCheckboxItem({\n className,\n children,\n checked,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.CheckboxItem\n data-slot=\"context-menu-checkbox-item\"\n data-inset={inset}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-1.5 rounded-md py-1 ps-1.5 pe-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:ps-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute end-2\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction ContextMenuRadioItem({\n className,\n children,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.RadioItem\n data-slot=\"context-menu-radio-item\"\n data-inset={inset}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-1.5 rounded-md py-1 ps-1.5 pe-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:ps-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute end-2\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n );\n}\n\nfunction ContextMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.Label\n data-slot=\"context-menu-label\"\n data-inset={inset}\n className={cn('text-muted-foreground px-1.5 py-1 text-xs font-medium data-inset:ps-7', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSeparator({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {\n return (\n <ContextMenuPrimitive.Separator\n data-slot=\"context-menu-separator\"\n className={cn('bg-border -mx-1 my-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"context-menu-shortcut\"\n className={cn(\n 'text-muted-foreground group-focus/context-menu-item:text-accent-foreground ms-auto text-xs tracking-widest',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n ContextMenu,\n ContextMenuCheckboxItem,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuItem,\n ContextMenuLabel,\n ContextMenuPortal,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuTrigger,\n};\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyContextMenuContract =\n React.ComponentProps<typeof ContextMenu> extends ContextMenuBaseProps ? true : false;\n"],"mappings":"kPAQA,SAAS,EAAY,CAAE,GAAG,GAAiE,CACzF,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAA2B,YAAU,eAAe,GAAI,CAAQ,CAAA,CACzE,CAEA,SAAS,EAAmB,CAAE,YAAW,GAAG,GAAoE,CAC9G,OACE,EAAA,EAAA,KAAA,EAAA,GAAA,CACE,YAAU,uBACV,UAAW,EAAA,EAAG,cAAe,CAAS,EACtC,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,EAAiB,CAAE,GAAG,GAAkE,CAC/F,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAA4B,YAAU,qBAAqB,GAAI,CAAQ,CAAA,CAChF,CAEA,SAAS,EAAkB,CAAE,GAAG,GAAmE,CACjG,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAA6B,YAAU,sBAAsB,GAAI,CAAQ,CAAA,CAClF,CAEA,SAAS,EAAe,CAAE,GAAG,GAAgE,CAC3F,OAAO,EAAA,EAAA,KAAA,EAAA,GAAA,CAA0B,YAAU,mBAAmB,GAAI,CAAQ,CAAA,CAC5E,C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CAAA,CACsB,CAAA,CAChC,CAAA,EACL,CACgC,GAEvC,CAEA,SAAS,EAAqB,CAC5B,YACA,WACA,QACA,GAAG,GAGF,CACD,OACE,EAAA,EAAA,MAAA,EAAA,GAAA,CACE,YAAU,0BACV,aAAY,EACZ,UAAW,EAAA,EACT,2TACA,CACF,EACA,GAAI,WAPN,EASE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,+CACd,EAAA,EAAA,KAAA,EAAA,GAAA,CAAA,UACE,EAAA,EAAA,KAAC,EAAA,GAAD,CAAY,CAAA,CACsB,CAAA,CAChC,CAAA,EACL,CAC6B,GAEpC,CAEA,SAAS,EAAiB,CACxB,YACA,QACA,GAAG,GAGF,CACD,OACE,EAAA,EAAA,KAAA,EAAA,GAAA,CACE,YAAU,qBACV,aAAY,EACZ,UAAW,EAAA,EAAG,wEAAyE,CAAS,EAChG,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,EAAqB,CAAE,YAAW,GAAG,GAAsE,CAClH,OACE,EAAA,EAAA,KAAA,EAAA,GAAA,CACE,YAAU,yBACV,UAAW,EAAA,EAAG,4BAA6B,CAAS,EACpD,GAAI,CACL,CAAA,CAEL,CAEA,SAAS,EAAoB,CAAE,YAAW,GAAG,GAAuC,CAClF,OACE,EAAA,EAAA,KAAC,OAAD,CACE,YAAU,wBACV,UAAW,EAAA,EACT,6GACA,CACF,EACA,GAAI,CACL,CAAA,CAEL"}
@@ -1 +1 @@
1
- {"version":3,"file":"context-menu.mjs","names":[],"sources":["../packages/ui-web/src/context-menu.tsx"],"sourcesContent":["import { ContextMenu as ContextMenuPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { CheckIcon, ChevronRightIcon } from 'lucide-react';\nimport { cn } from './lib/utils';\n\nimport type { ContextMenuBaseProps } from '@gv-tech/ui-core';\n\nfunction ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {\n return <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />;\n}\n\nfunction ContextMenuTrigger({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {\n return (\n <ContextMenuPrimitive.Trigger\n data-slot=\"context-menu-trigger\"\n className={cn('select-none', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {\n return <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />;\n}\n\nfunction ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {\n return <ContextMenuPrimitive.Portal data-slot=\"context-menu-portal\" {...props} />;\n}\n\nfunction ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {\n return <ContextMenuPrimitive.Sub data-slot=\"context-menu-sub\" {...props} />;\n}\n\nfunction ContextMenuRadioGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {\n return <ContextMenuPrimitive.RadioGroup data-slot=\"context-menu-radio-group\" {...props} />;\n}\n\nfunction ContextMenuContent({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Content> & {\n side?: 'top' | 'right' | 'bottom' | 'left';\n}) {\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n data-slot=\"context-menu-content\"\n className={cn(\n 'bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-1 shadow-md ring-1 duration-100',\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n );\n}\n\nfunction ContextMenuItem({\n className,\n inset,\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) {\n return (\n <ContextMenuPrimitive.Item\n data-slot=\"context-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n 'group/context-menu-item focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:ps-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.SubTrigger\n data-slot=\"context-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-inset:ps-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ms-auto\" />\n </ContextMenuPrimitive.SubTrigger>\n );\n}\n\nfunction ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {\n return (\n <ContextMenuPrimitive.SubContent\n data-slot=\"context-menu-sub-content\"\n className={cn(\n 'bg-popover text-popover-foreground data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg border p-1 shadow-lg duration-100',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuCheckboxItem({\n className,\n children,\n checked,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.CheckboxItem\n data-slot=\"context-menu-checkbox-item\"\n data-inset={inset}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-1.5 rounded-md py-1 ps-1.5 pe-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:ps-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute end-2\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction ContextMenuRadioItem({\n className,\n children,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.RadioItem\n data-slot=\"context-menu-radio-item\"\n data-inset={inset}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-1.5 rounded-md py-1 ps-1.5 pe-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:ps-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute end-2\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n );\n}\n\nfunction ContextMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.Label\n data-slot=\"context-menu-label\"\n data-inset={inset}\n className={cn('text-muted-foreground px-1.5 py-1 text-xs font-medium data-inset:ps-7', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSeparator({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {\n return (\n <ContextMenuPrimitive.Separator\n data-slot=\"context-menu-separator\"\n className={cn('bg-border -mx-1 my-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"context-menu-shortcut\"\n className={cn(\n 'text-muted-foreground group-focus/context-menu-item:text-accent-foreground ms-auto text-xs tracking-widest',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n ContextMenu,\n ContextMenuCheckboxItem,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuItem,\n ContextMenuLabel,\n ContextMenuPortal,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuTrigger,\n};\n\n// Verify that the component satisfies the ui-core contract\nconst _verifyContextMenuContract: ContextMenuBaseProps = {} as unknown as React.ComponentProps<typeof ContextMenu>;\n"],"mappings":";;;;;;AAQA,SAAS,EAAY,EAAE,GAAG,KAAiE;CACzF,OAAO,iBAAA,GAAA,EAAA,KAAC,GAAD;EAA2B,aAAU;EAAe,GAAI;CAAQ,CAAA;AACzE;AAEA,SAAS,EAAmB,EAAE,cAAW,GAAG,KAAoE;CAC9G,OACE,iBAAA,GAAA,EAAA,KAAC,GAAD;EACE,aAAU;EACV,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aAAU;EACV,WAAW,EACT,8GACA,CACF;EACA,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"context-menu.mjs","names":[],"sources":["../packages/ui-web/src/context-menu.tsx"],"sourcesContent":["import { ContextMenu as ContextMenuPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { CheckIcon, ChevronRightIcon } from 'lucide-react';\nimport { cn } from './lib/utils';\n\nimport type { ContextMenuBaseProps } from '@gv-tech/ui-core';\n\nfunction ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {\n return <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />;\n}\n\nfunction ContextMenuTrigger({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {\n return (\n <ContextMenuPrimitive.Trigger\n data-slot=\"context-menu-trigger\"\n className={cn('select-none', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {\n return <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />;\n}\n\nfunction ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {\n return <ContextMenuPrimitive.Portal data-slot=\"context-menu-portal\" {...props} />;\n}\n\nfunction ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {\n return <ContextMenuPrimitive.Sub data-slot=\"context-menu-sub\" {...props} />;\n}\n\nfunction ContextMenuRadioGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {\n return <ContextMenuPrimitive.RadioGroup data-slot=\"context-menu-radio-group\" {...props} />;\n}\n\nfunction ContextMenuContent({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Content> & {\n side?: 'top' | 'right' | 'bottom' | 'left';\n}) {\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n data-slot=\"context-menu-content\"\n className={cn(\n 'bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-1 shadow-md ring-1 duration-100',\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n );\n}\n\nfunction ContextMenuItem({\n className,\n inset,\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) {\n return (\n <ContextMenuPrimitive.Item\n data-slot=\"context-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n 'group/context-menu-item focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:ps-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.SubTrigger\n data-slot=\"context-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-inset:ps-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ms-auto\" />\n </ContextMenuPrimitive.SubTrigger>\n );\n}\n\nfunction ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {\n return (\n <ContextMenuPrimitive.SubContent\n data-slot=\"context-menu-sub-content\"\n className={cn(\n 'bg-popover text-popover-foreground data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg border p-1 shadow-lg duration-100',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuCheckboxItem({\n className,\n children,\n checked,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.CheckboxItem\n data-slot=\"context-menu-checkbox-item\"\n data-inset={inset}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-1.5 rounded-md py-1 ps-1.5 pe-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:ps-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute end-2\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction ContextMenuRadioItem({\n className,\n children,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.RadioItem\n data-slot=\"context-menu-radio-item\"\n data-inset={inset}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-1.5 rounded-md py-1 ps-1.5 pe-8 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:ps-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute end-2\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n );\n}\n\nfunction ContextMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.Label\n data-slot=\"context-menu-label\"\n data-inset={inset}\n className={cn('text-muted-foreground px-1.5 py-1 text-xs font-medium data-inset:ps-7', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSeparator({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {\n return (\n <ContextMenuPrimitive.Separator\n data-slot=\"context-menu-separator\"\n className={cn('bg-border -mx-1 my-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"context-menu-shortcut\"\n className={cn(\n 'text-muted-foreground group-focus/context-menu-item:text-accent-foreground ms-auto text-xs tracking-widest',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n ContextMenu,\n ContextMenuCheckboxItem,\n ContextMenuContent,\n ContextMenuGroup,\n ContextMenuItem,\n ContextMenuLabel,\n ContextMenuPortal,\n ContextMenuRadioGroup,\n ContextMenuRadioItem,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuTrigger,\n};\n\n// Verify that the component satisfies the ui-core contract\nexport type ___verifyContextMenuContract =\n React.ComponentProps<typeof ContextMenu> extends ContextMenuBaseProps ? true : false;\n"],"mappings":";;;;;;AAQA,SAAS,EAAY,EAAE,GAAG,KAAiE;CACzF,OAAO,iBAAA,GAAA,EAAA,KAAC,GAAD;EAA2B,aAAU;EAAe,GAAI;CAAQ,CAAA;AACzE;AAEA,SAAS,EAAmB,EAAE,cAAW,GAAG,KAAoE;CAC9G,OACE,iBAAA,GAAA,EAAA,KAAC,GAAD;EACE,aAAU;EACV,WAAW,EAAG,eAAe,CAAS;EACtC,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAiB,EAAE,GAAG,KAAkE;CAC/F,OAAO,iBAAA,GAAA,EAAA,KAAC,GAAD;EAA4B,aAAU;EAAqB,GAAI;CAAQ,CAAA;AAChF;AAEA,SAAS,EAAkB,EAAE,GAAG,KAAmE;CACjG,OAAO,iBAAA,GAAA,EAAA,KAAC,GAAD;EAA6B,aAAU;EAAsB,GAAI;CAAQ,CAAA;AAClF;AAEA,SAAS,EAAe,EAAE,GAAG,KAAgE;CAC3F,OAAO,iBAAA,GAAA,EAAA,KAAC,GAAD;EAA0B,aAAU;EAAmB,GAAI;CAAQ,CAAA;AAC5E;AAEA,SAAS,EAAsB,EAAE,GAAG,KAAuE;CACzG,OAAO,iBAAA,GAAA,EAAA,KAAC,GAAD;EAAiC,aAAU;EAA2B,GAAI;CAAQ,CAAA;AAC3F;AAEA,SAAS,EAAmB,EAC1B,cACA,GAAG,KAGF;CACD,OACE,iBAAA,GAAA,EAAA,KAAC,GAAD,EAAA,UACE,iBAAA,GAAA,EAAA,KAAC,GAAD;EACE,aAAU;EACV,WAAW,EACT,olBACA,CACF;EACA,GAAI;CACL,CAAA,EAC0B,CAAA;AAEjC;AAEA,SAAS,EAAgB,EACvB,cACA,UACA,aAAU,WACV,GAAG,KAIF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