jaci-ui 0.9.3 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.md +11 -1
- package/dist/_virtual/_rolldown/runtime.cjs +1 -1
- package/dist/components/accordion/accordion.cjs.map +1 -1
- package/dist/components/accordion/accordion.js.map +1 -1
- package/dist/components/alert/alert.cjs.map +1 -1
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/alert-dialog/alert-dialog.cjs.map +1 -1
- package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.cjs.map +1 -1
- package/dist/components/avatar/avatar.cjs.map +1 -1
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/breadcrumbs/breadcrumbs.cjs.map +1 -1
- package/dist/components/button/button.cjs +1 -0
- package/dist/components/button/button.cjs.map +1 -1
- package/dist/components/button/button.d.cts +2 -1
- package/dist/components/button/button.d.ts +2 -1
- package/dist/components/button/button.js +1 -0
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button-group/button-group.cjs.map +1 -1
- package/dist/components/calendar/calendar.cjs +4 -6
- package/dist/components/calendar/calendar.cjs.map +1 -1
- package/dist/components/calendar/calendar.js +4 -6
- package/dist/components/calendar/calendar.js.map +1 -1
- package/dist/components/card/card.cjs.map +1 -1
- package/dist/components/carousel/carousel.cjs.map +1 -1
- package/dist/components/carousel/carousel.js.map +1 -1
- package/dist/components/checkbox-group/checkbox-group.cjs +7 -3
- package/dist/components/checkbox-group/checkbox-group.cjs.map +1 -1
- package/dist/components/checkbox-group/checkbox-group.js +7 -3
- package/dist/components/checkbox-group/checkbox-group.js.map +1 -1
- package/dist/components/code/code.cjs.map +1 -1
- package/dist/components/code/code.js.map +1 -1
- package/dist/components/collapsible/collapsible.cjs.map +1 -1
- package/dist/components/collapsible/collapsible.js.map +1 -1
- package/dist/components/color-picker/color-picker.cjs.map +1 -1
- package/dist/components/color-picker/color-picker.js.map +1 -1
- package/dist/components/color-swatch/color-swatch.cjs.map +1 -1
- package/dist/components/combobox/combobox.cjs +2 -1
- package/dist/components/combobox/combobox.cjs.map +1 -1
- package/dist/components/combobox/combobox.js +2 -1
- package/dist/components/combobox/combobox.js.map +1 -1
- package/dist/components/command/command.cjs.map +1 -1
- package/dist/components/command/command.js.map +1 -1
- package/dist/components/context-menu/context-menu.cjs.map +1 -1
- package/dist/components/controls/checkbox.cjs.map +1 -1
- package/dist/components/controls/checkbox.js.map +1 -1
- package/dist/components/controls/input.cjs.map +1 -1
- package/dist/components/controls/input.js.map +1 -1
- package/dist/components/controls/radio.cjs.map +1 -1
- package/dist/components/controls/switch.cjs.map +1 -1
- package/dist/components/controls/switch.js.map +1 -1
- package/dist/components/controls/textarea.cjs.map +1 -1
- package/dist/components/controls/textarea.js.map +1 -1
- package/dist/components/copyable/copyable.cjs.map +1 -1
- package/dist/components/copyable/copyable.js.map +1 -1
- package/dist/components/data-toolbar/data-toolbar.cjs.map +1 -1
- package/dist/components/data-toolbar/data-toolbar.js.map +1 -1
- package/dist/components/data-view/data-view.cjs.map +1 -1
- package/dist/components/date-picker/date-picker.cjs +4 -7
- package/dist/components/date-picker/date-picker.cjs.map +1 -1
- package/dist/components/date-picker/date-picker.js +4 -7
- package/dist/components/date-picker/date-picker.js.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.cjs +4 -6
- package/dist/components/date-range-picker/date-range-picker.cjs.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.js +4 -6
- package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/dialog/dialog.cjs.map +1 -1
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/download-trigger/download-trigger.cjs.map +1 -1
- package/dist/components/drawer/drawer.cjs.map +1 -1
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/empty-state/empty-state.cjs.map +1 -1
- package/dist/components/feedback/badge.cjs.map +1 -1
- package/dist/components/feedback/badge.d.cts +2 -1
- package/dist/components/feedback/badge.d.ts +2 -1
- package/dist/components/feedback/badge.js.map +1 -1
- package/dist/components/field/field.cjs.map +1 -1
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/fieldset/fieldset.cjs.map +1 -1
- package/dist/components/figure/figure.cjs.map +1 -1
- package/dist/components/figure/figure.js.map +1 -1
- package/dist/components/form/form.cjs.map +1 -1
- package/dist/components/form/form.js.map +1 -1
- package/dist/components/icon-button/icon-button.cjs.map +1 -1
- package/dist/components/icon-button/icon-button.js.map +1 -1
- package/dist/components/image/image.cjs.map +1 -1
- package/dist/components/image/image.js.map +1 -1
- package/dist/components/input-group/input-group.cjs.map +1 -1
- package/dist/components/kbd/kbd.cjs.map +1 -1
- package/dist/components/layout/index.cjs.map +1 -1
- package/dist/components/list/list.cjs.map +1 -1
- package/dist/components/menu/menu.cjs.map +1 -1
- package/dist/components/menubar/menubar.cjs.map +1 -1
- package/dist/components/menubar/menubar.js.map +1 -1
- package/dist/components/meter/meter.cjs.map +1 -1
- package/dist/components/meter/meter.js.map +1 -1
- package/dist/components/navigation/navigation.cjs.map +1 -1
- package/dist/components/navigation/navigation.js.map +1 -1
- package/dist/components/navigation-menu/navigation-menu.cjs.map +1 -1
- package/dist/components/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/number-field/number-field.cjs +2 -1
- package/dist/components/number-field/number-field.cjs.map +1 -1
- package/dist/components/number-field/number-field.js +2 -1
- package/dist/components/number-field/number-field.js.map +1 -1
- package/dist/components/option-selector/option-selector.cjs.map +1 -1
- package/dist/components/option-selector/option-selector.js.map +1 -1
- package/dist/components/pagination/pagination.cjs.map +1 -1
- package/dist/components/pagination/pagination.js.map +1 -1
- package/dist/components/pin-input/pin-input.cjs.map +1 -1
- package/dist/components/pin-input/pin-input.js.map +1 -1
- package/dist/components/popover/popover.cjs.map +1 -1
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/progress/progress.cjs.map +1 -1
- package/dist/components/progress/progress.js.map +1 -1
- package/dist/components/qr-code/qr-code.cjs.map +1 -1
- package/dist/components/qr-code/qr-code.js.map +1 -1
- package/dist/components/quote/quote.cjs.map +1 -1
- package/dist/components/quote/quote.js.map +1 -1
- package/dist/components/radio-group/radio-group.cjs +7 -3
- package/dist/components/radio-group/radio-group.cjs.map +1 -1
- package/dist/components/radio-group/radio-group.js +7 -3
- package/dist/components/radio-group/radio-group.js.map +1 -1
- package/dist/components/range-slider/range-slider.cjs.map +1 -1
- package/dist/components/range-slider/range-slider.js.map +1 -1
- package/dist/components/scroll-area/scroll-area.cjs.map +1 -1
- package/dist/components/select/select.cjs.map +1 -1
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/sidebar/sidebar.cjs.map +1 -1
- package/dist/components/sidebar/sidebar.js.map +1 -1
- package/dist/components/skeleton/skeleton.cjs.map +1 -1
- package/dist/components/slider/slider.cjs.map +1 -1
- package/dist/components/slider/slider.js.map +1 -1
- package/dist/components/spacer/spacer.cjs.map +1 -1
- package/dist/components/stat/stat.cjs.map +1 -1
- package/dist/components/stat/stat.js.map +1 -1
- package/dist/components/stepper/stepper.cjs +2 -1
- package/dist/components/stepper/stepper.cjs.map +1 -1
- package/dist/components/stepper/stepper.js +2 -1
- package/dist/components/stepper/stepper.js.map +1 -1
- package/dist/components/table/table.cjs.map +1 -1
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/tabs/tabs.cjs.map +1 -1
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/tags-input/tags-input.cjs.map +1 -1
- package/dist/components/tags-input/tags-input.js.map +1 -1
- package/dist/components/toast/toast.cjs.map +1 -1
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/toggle/toggle.cjs.map +1 -1
- package/dist/components/toggle-group/toggle-group.cjs.map +1 -1
- package/dist/components/toolbar/toolbar.cjs.map +1 -1
- package/dist/components/tooltip/tooltip.cjs.map +1 -1
- package/dist/components/tree-view/tree-view.cjs.map +1 -1
- package/dist/components/tree-view/tree-view.js.map +1 -1
- package/dist/components/typography/heading.cjs.map +1 -1
- package/dist/components/typography/link.cjs.map +1 -1
- package/dist/components/typography/paragraph.cjs.map +1 -1
- package/dist/components/typography/text.cjs.map +1 -1
- package/dist/components/upload/upload.cjs +2 -2
- package/dist/components/upload/upload.cjs.map +1 -1
- package/dist/components/upload/upload.js +2 -2
- package/dist/components/upload/upload.js.map +1 -1
- package/dist/components/visually-hidden/visually-hidden.cjs.map +1 -1
- package/dist/panda-preset.cjs.map +1 -1
- package/dist/styled-system/recipes/badge.cjs +4 -1
- package/dist/styled-system/recipes/badge.cjs.map +1 -1
- package/dist/styled-system/recipes/badge.js +4 -1
- package/dist/styled-system/recipes/badge.js.map +1 -1
- package/dist/styles/theme.cjs +88 -68
- package/dist/styles/theme.cjs.map +1 -1
- package/dist/styles/theme.js +88 -68
- package/dist/styles/theme.js.map +1 -1
- package/dist/styles.css +5 -19
- package/dist/theme/theme-provider.cjs.map +1 -1
- package/dist/theme/theme-provider.js.map +1 -1
- package/dist/theme/theme-scope.cjs.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","names":["PopoverRoot","BasePopover","Popover"],"sources":["../../../src/components/popover/popover.tsx"],"sourcesContent":["\"use client\";\n\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { PopoverRoot as BasePopoverRoot } from \"@base-ui/react/popover\";\n\nimport { popover } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\n/** Preserves Base UI's controlled `open` API and uncontrolled `defaultOpen` API. */\nexport type PopoverRootProps<Payload = unknown> = BasePopoverRoot.Props<Payload>;\n\nexport function PopoverRoot<Payload = unknown>(props: PopoverRootProps<Payload>) {\n return <BasePopover.Root {...props} />;\n}\n\nexport type PopoverTriggerProps = ComponentPropsWithoutRef<typeof BasePopover.Trigger>;\n\nexport const PopoverTrigger = forwardRef<HTMLButtonElement, PopoverTriggerProps>(\n function PopoverTrigger({ className, ...props }, ref) {\n return (\n <BasePopover.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(popover().trigger, className)}\n data-jaci-component=\"popover\"\n data-slot=\"popover-trigger\"\n />\n );\n },\n);\n\n/** Preserves Base UI's optional portal container and mount controls. */\nexport function PopoverPortal(props: ComponentPropsWithoutRef<typeof BasePopover.Portal>) {\n return <BasePopover.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type PopoverPositionerProps = ComponentPropsWithoutRef<typeof BasePopover.Positioner>;\n\nexport const PopoverPositioner = forwardRef<HTMLDivElement, PopoverPositionerProps>(\n function PopoverPositioner({ className, ...props }, ref) {\n return (\n <BasePopover.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(popover().positioner, className)}\n data-slot=\"popover-positioner\"\n />\n );\n },\n);\n\nexport type PopoverPopupProps = ComponentPropsWithoutRef<typeof BasePopover.Popup>;\n\nexport const PopoverPopup = forwardRef<HTMLDivElement, PopoverPopupProps>(function PopoverPopup(\n { className, ...props },\n ref,\n) {\n return (\n <BasePopover.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(popover().popup, className)}\n data-jaci-component=\"popover\"\n data-slot=\"popover-popup\"\n />\n );\n});\n\nexport type PopoverTitleProps = ComponentPropsWithoutRef<typeof BasePopover.Title>;\n\nexport const PopoverTitle = forwardRef<HTMLHeadingElement, PopoverTitleProps>(function PopoverTitle(\n { className, ...props },\n ref,\n) {\n return (\n <BasePopover.Title\n {...props}\n ref={ref}\n className={withRecipeClassName(popover().title, className)}\n data-slot=\"popover-title\"\n />\n );\n});\n\nexport type PopoverDescriptionProps = ComponentPropsWithoutRef<typeof BasePopover.Description>;\n\nexport const PopoverDescription = forwardRef<HTMLParagraphElement, PopoverDescriptionProps>(\n function PopoverDescription({ className, ...props }, ref) {\n return (\n <BasePopover.Description\n {...props}\n ref={ref}\n className={withRecipeClassName(popover().description, className)}\n data-slot=\"popover-description\"\n />\n );\n },\n);\n\nexport type PopoverCloseProps = ComponentPropsWithoutRef<typeof BasePopover.Close>;\n\nexport const PopoverClose = forwardRef<HTMLButtonElement, PopoverCloseProps>(function PopoverClose(\n { \"aria-label\": ariaLabel, children, className, ...props },\n ref,\n) {\n const hasVisibleLabel = children != null;\n\n return (\n <BasePopover.Close\n {...props}\n aria-label={ariaLabel ?? (hasVisibleLabel ? undefined : \"Close popover\")}\n ref={ref}\n className={withRecipeClassName(popover().close, className)}\n data-slot=\"popover-close\"\n >\n {children ?? \"×\"}\n </BasePopover.Close>\n );\n});\n\nexport type PopoverArrowProps = ComponentPropsWithoutRef<typeof BasePopover.Arrow>;\n\nexport const PopoverArrow = forwardRef<HTMLDivElement, PopoverArrowProps>(function PopoverArrow(\n { className, ...props },\n ref,\n) {\n return (\n <BasePopover.Arrow\n {...props}\n ref={ref}\n className={withRecipeClassName(popover().arrow, className)}\n data-slot=\"popover-arrow\"\n />\n );\n});\n\nexport const Popover = {\n Root: PopoverRoot,\n Trigger: PopoverTrigger,\n Portal: PopoverPortal,\n Positioner: PopoverPositioner,\n Popup: PopoverPopup,\n Title: PopoverTitle,\n Description: PopoverDescription,\n Close: PopoverClose,\n Arrow: PopoverArrow,\n createHandle: BasePopover.createHandle,\n};\n"],"mappings":";;;;;;;;AAcA,SAAgBA,cAA+B,OAAkC;CAC/E,OAAO,oBAACC,QAAY,MAAb,EAAkB,GAAI,MAAQ,CAAA;AACvC;AAIA,MAAa,iBAAiB,WAC5B,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CACpD,OACE,oBAACA,QAAY,SAAb;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,QAAQ,CAAC,CAAC,SAAS,SAAS;EAC3D,uBAAoB;EACpB,aAAU;CACX,CAAA;AAEL,CACF;;AAGA,SAAgB,cAAc,OAA4D;CACxF,OAAO,oBAACA,QAAY,QAAb,EAAoB,GAAI,oBAAoB,KAAK,EAAI,CAAA;AAC9D;AAIA,MAAa,oBAAoB,WAC/B,SAAS,kBAAkB,EAAE,WAAW,GAAG,SAAS,KAAK;CACvD,OACE,oBAACA,QAAY,YAAb;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,QAAQ,CAAC,CAAC,YAAY,SAAS;EAC9D,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,eAAe,WAA8C,SAAS,aACjF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAACA,QAAY,OAAb;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,QAAQ,CAAC,CAAC,OAAO,SAAS;EACzD,uBAAoB;EACpB,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,eAAe,WAAkD,SAAS,aACrF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAACA,QAAY,OAAb;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,QAAQ,CAAC,CAAC,OAAO,SAAS;EACzD,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,qBAAqB,WAChC,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CACxD,OACE,oBAACA,QAAY,aAAb;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,QAAQ,CAAC,CAAC,aAAa,SAAS;EAC/D,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,eAAe,WAAiD,SAAS,aACpF,EAAE,cAAc,WAAW,UAAU,WAAW,GAAG,SACnD,KACA;CACA,MAAM,kBAAkB,YAAY;CAEpC,OACE,oBAACA,QAAY,OAAb;EACE,GAAI;EACJ,cAAY,cAAc,kBAAkB,KAAA,IAAY;EACnD;EACL,WAAW,oBAAoB,QAAQ,CAAC,CAAC,OAAO,SAAS;EACzD,aAAU;
|
|
1
|
+
{"version":3,"file":"popover.js","names":["PopoverRoot","BasePopover","Popover"],"sources":["../../../src/components/popover/popover.tsx"],"sourcesContent":["\"use client\";\n\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { PopoverRoot as BasePopoverRoot } from \"@base-ui/react/popover\";\n\nimport { popover } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\n/** Preserves Base UI's controlled `open` API and uncontrolled `defaultOpen` API. */\nexport type PopoverRootProps<Payload = unknown> = BasePopoverRoot.Props<Payload>;\n\nexport function PopoverRoot<Payload = unknown>(props: PopoverRootProps<Payload>) {\n return <BasePopover.Root {...props} />;\n}\n\nexport type PopoverTriggerProps = ComponentPropsWithoutRef<typeof BasePopover.Trigger>;\n\nexport const PopoverTrigger = forwardRef<HTMLButtonElement, PopoverTriggerProps>(\n function PopoverTrigger({ className, ...props }, ref) {\n return (\n <BasePopover.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(popover().trigger, className)}\n data-jaci-component=\"popover\"\n data-slot=\"popover-trigger\"\n />\n );\n },\n);\n\n/** Preserves Base UI's optional portal container and mount controls. */\nexport function PopoverPortal(props: ComponentPropsWithoutRef<typeof BasePopover.Portal>) {\n return <BasePopover.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type PopoverPositionerProps = ComponentPropsWithoutRef<typeof BasePopover.Positioner>;\n\nexport const PopoverPositioner = forwardRef<HTMLDivElement, PopoverPositionerProps>(\n function PopoverPositioner({ className, ...props }, ref) {\n return (\n <BasePopover.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(popover().positioner, className)}\n data-slot=\"popover-positioner\"\n />\n );\n },\n);\n\nexport type PopoverPopupProps = ComponentPropsWithoutRef<typeof BasePopover.Popup>;\n\nexport const PopoverPopup = forwardRef<HTMLDivElement, PopoverPopupProps>(function PopoverPopup(\n { className, ...props },\n ref,\n) {\n return (\n <BasePopover.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(popover().popup, className)}\n data-jaci-component=\"popover\"\n data-slot=\"popover-popup\"\n />\n );\n});\n\nexport type PopoverTitleProps = ComponentPropsWithoutRef<typeof BasePopover.Title>;\n\nexport const PopoverTitle = forwardRef<HTMLHeadingElement, PopoverTitleProps>(function PopoverTitle(\n { className, ...props },\n ref,\n) {\n return (\n <BasePopover.Title\n {...props}\n ref={ref}\n className={withRecipeClassName(popover().title, className)}\n data-slot=\"popover-title\"\n />\n );\n});\n\nexport type PopoverDescriptionProps = ComponentPropsWithoutRef<typeof BasePopover.Description>;\n\nexport const PopoverDescription = forwardRef<HTMLParagraphElement, PopoverDescriptionProps>(\n function PopoverDescription({ className, ...props }, ref) {\n return (\n <BasePopover.Description\n {...props}\n ref={ref}\n className={withRecipeClassName(popover().description, className)}\n data-slot=\"popover-description\"\n />\n );\n },\n);\n\nexport type PopoverCloseProps = ComponentPropsWithoutRef<typeof BasePopover.Close>;\n\nexport const PopoverClose = forwardRef<HTMLButtonElement, PopoverCloseProps>(function PopoverClose(\n { \"aria-label\": ariaLabel, children, className, ...props },\n ref,\n) {\n const hasVisibleLabel = children != null;\n\n return (\n <BasePopover.Close\n {...props}\n aria-label={ariaLabel ?? (hasVisibleLabel ? undefined : \"Close popover\")}\n ref={ref}\n className={withRecipeClassName(popover().close, className)}\n data-slot=\"popover-close\"\n >\n {children ?? \"×\"}\n </BasePopover.Close>\n );\n});\n\nexport type PopoverArrowProps = ComponentPropsWithoutRef<typeof BasePopover.Arrow>;\n\nexport const PopoverArrow = forwardRef<HTMLDivElement, PopoverArrowProps>(function PopoverArrow(\n { className, ...props },\n ref,\n) {\n return (\n <BasePopover.Arrow\n {...props}\n ref={ref}\n className={withRecipeClassName(popover().arrow, className)}\n data-slot=\"popover-arrow\"\n />\n );\n});\n\nexport const Popover = {\n Root: PopoverRoot,\n Trigger: PopoverTrigger,\n Portal: PopoverPortal,\n Positioner: PopoverPositioner,\n Popup: PopoverPopup,\n Title: PopoverTitle,\n Description: PopoverDescription,\n Close: PopoverClose,\n Arrow: PopoverArrow,\n createHandle: BasePopover.createHandle,\n};\n"],"mappings":";;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AAIA,MAAa,eAAe,WAAiD,SAAS,aACpF,EAAE,cAAc,WAAW,UAAU,WAAW,GAAG,SACnD,KACA;CACA,MAAM,kBAAkB,YAAY;CAEpC,OACE,oBAACA,QAAY,OAAb;EACE,GAAI;EACJ,cAAY,cAAc,kBAAkB,KAAA,IAAY;EACnD;EACL,WAAW,oBAAoB,QAAQ,CAAC,CAAC,OAAO,SAAS;EACzD,aAAU;EAET,UAAA,YAAY;CACI,CAAA;AAEvB,CAAC;AAID,MAAa,eAAe,WAA8C,SAAS,aACjF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAACA,QAAY,OAAb;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,QAAQ,CAAC,CAAC,OAAO,SAAS;EACzD,aAAU;CACX,CAAA;AAEL,CAAC;AAED,MAAaC,YAAU;CACrB,MAAMF;CACN,SAAS;CACT,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,OAAO;CACP,aAAa;CACb,OAAO;CACP,OAAO;CACP,cAAcC,QAAY;AAC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.cjs","names":["progress","cx"],"sources":["../../../src/components/progress/progress.tsx"],"sourcesContent":["import { forwardRef, useId } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { progress } from \"../../styled-system/recipes\";\n\nfunction clamp(value: number, maximum: number) {\n if (!Number.isFinite(value)) {\n return 0;\n }\n\n return Math.min(Math.max(value, 0), maximum);\n}\n\nexport interface ProgressProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n /** The current amount. Omit it, or set `indeterminate`, when it is unknown. */\n value?: number | null;\n /** The value that represents completion. Defaults to 100. */\n max?: number;\n /** Omits `aria-valuenow` and renders an in-progress visual state. */\n indeterminate?: boolean;\n /** A visible, automatically associated accessible label. */\n label?: ReactNode;\n valueLabel?: ReactNode;\n locale?: Intl.LocalesArgument;\n format?: Intl.NumberFormatOptions;\n getAriaValueText?: (formattedValue: string, value: number) => string;\n}\n\n/**\n * A semantic progress bar. Provide `label` or `aria-label` so its purpose is\n * announced to assistive technology.\n */\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n {\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-valuetext\": ariaValueText,\n className,\n format,\n getAriaValueText,\n indeterminate = false,\n label,\n locale,\n max = 100,\n value = 0,\n valueLabel,\n ...props\n },\n ref,\n) {\n const labelId = useId();\n const maximum = Number.isFinite(max) && max > 0 ? max : 100;\n const currentValue = clamp(value ?? 0, maximum);\n const percentage = (currentValue / maximum) * 100;\n const formattedValue = new Intl.NumberFormat(locale, format).format(currentValue);\n const computedValueText = getAriaValueText?.(formattedValue, currentValue);\n const hasVisibleLabel = label !== null && label !== undefined;\n const labelledBy = ariaLabelledBy ?? (ariaLabel || !hasVisibleLabel ? undefined : labelId);\n const accessibleLabel = ariaLabel ?? (labelledBy ? undefined : \"Progress\");\n const styles = progress({ indeterminate });\n\n return (\n <div\n {...props}\n ref={ref}\n aria-busy={indeterminate || undefined}\n aria-label={accessibleLabel}\n aria-labelledby={labelledBy}\n aria-valuemax={maximum}\n aria-valuemin={0}\n aria-valuenow={indeterminate ? undefined : currentValue}\n aria-valuetext={ariaValueText ?? computedValueText}\n className={cx(styles.root, className)}\n data-indeterminate={indeterminate || undefined}\n data-jaci-component=\"progress\"\n data-slot=\"progress\"\n role=\"progressbar\"\n >\n {hasVisibleLabel || valueLabel !== undefined ? (\n <div style={{ display: \"flex\", minWidth: 0 }}>\n {hasVisibleLabel ? (\n <span className={styles.label} data-slot=\"progress-label\" id={labelId}>\n {label}\n </span>\n ) : null}\n {valueLabel !== undefined ? (\n <span className={styles.value} data-slot=\"progress-value\">\n {valueLabel}\n </span>\n ) : null}\n </div>\n ) : null}\n <div aria-hidden=\"true\" className={styles.track} data-slot=\"progress-track\">\n <div\n className={styles.indicator}\n data-indeterminate={indeterminate || undefined}\n data-slot=\"progress-indicator\"\n style={indeterminate ? undefined : { width: `${percentage}%` }}\n />\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;AAMA,SAAS,MAAM,OAAe,SAAiB;CAC7C,IAAI,CAAC,OAAO,SAAS,KAAK,GACxB,OAAO;CAGT,OAAO,KAAK,IAAI,KAAK,IAAI,OAAO,CAAC,GAAG,OAAO;AAC7C;;;;;AAqBA,MAAa,YAAA,
|
|
1
|
+
{"version":3,"file":"progress.cjs","names":["forwardRef","useId","progress","cx"],"sources":["../../../src/components/progress/progress.tsx"],"sourcesContent":["import { forwardRef, useId } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { progress } from \"../../styled-system/recipes\";\n\nfunction clamp(value: number, maximum: number) {\n if (!Number.isFinite(value)) {\n return 0;\n }\n\n return Math.min(Math.max(value, 0), maximum);\n}\n\nexport interface ProgressProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n /** The current amount. Omit it, or set `indeterminate`, when it is unknown. */\n value?: number | null;\n /** The value that represents completion. Defaults to 100. */\n max?: number;\n /** Omits `aria-valuenow` and renders an in-progress visual state. */\n indeterminate?: boolean;\n /** A visible, automatically associated accessible label. */\n label?: ReactNode;\n valueLabel?: ReactNode;\n locale?: Intl.LocalesArgument;\n format?: Intl.NumberFormatOptions;\n getAriaValueText?: (formattedValue: string, value: number) => string;\n}\n\n/**\n * A semantic progress bar. Provide `label` or `aria-label` so its purpose is\n * announced to assistive technology.\n */\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n {\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-valuetext\": ariaValueText,\n className,\n format,\n getAriaValueText,\n indeterminate = false,\n label,\n locale,\n max = 100,\n value = 0,\n valueLabel,\n ...props\n },\n ref,\n) {\n const labelId = useId();\n const maximum = Number.isFinite(max) && max > 0 ? max : 100;\n const currentValue = clamp(value ?? 0, maximum);\n const percentage = (currentValue / maximum) * 100;\n const formattedValue = new Intl.NumberFormat(locale, format).format(currentValue);\n const computedValueText = getAriaValueText?.(formattedValue, currentValue);\n const hasVisibleLabel = label !== null && label !== undefined;\n const labelledBy = ariaLabelledBy ?? (ariaLabel || !hasVisibleLabel ? undefined : labelId);\n const accessibleLabel = ariaLabel ?? (labelledBy ? undefined : \"Progress\");\n const styles = progress({ indeterminate });\n\n return (\n <div\n {...props}\n ref={ref}\n aria-busy={indeterminate || undefined}\n aria-label={accessibleLabel}\n aria-labelledby={labelledBy}\n aria-valuemax={maximum}\n aria-valuemin={0}\n aria-valuenow={indeterminate ? undefined : currentValue}\n aria-valuetext={ariaValueText ?? computedValueText}\n className={cx(styles.root, className)}\n data-indeterminate={indeterminate || undefined}\n data-jaci-component=\"progress\"\n data-slot=\"progress\"\n role=\"progressbar\"\n >\n {hasVisibleLabel || valueLabel !== undefined ? (\n <div style={{ display: \"flex\", minWidth: 0 }}>\n {hasVisibleLabel ? (\n <span className={styles.label} data-slot=\"progress-label\" id={labelId}>\n {label}\n </span>\n ) : null}\n {valueLabel !== undefined ? (\n <span className={styles.value} data-slot=\"progress-value\">\n {valueLabel}\n </span>\n ) : null}\n </div>\n ) : null}\n <div aria-hidden=\"true\" className={styles.track} data-slot=\"progress-track\">\n <div\n className={styles.indicator}\n data-indeterminate={indeterminate || undefined}\n data-slot=\"progress-indicator\"\n style={indeterminate ? undefined : { width: `${percentage}%` }}\n />\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;AAMA,SAAS,MAAM,OAAe,SAAiB;CAC7C,IAAI,CAAC,OAAO,SAAS,KAAK,GACxB,OAAO;CAGT,OAAO,KAAK,IAAI,KAAK,IAAI,OAAO,CAAC,GAAG,OAAO;AAC7C;;;;;AAqBA,MAAa,YAAA,GAAWA,MAAAA,WAAAA,CAA0C,SAAS,SACzE,EACE,cAAc,WACd,mBAAmB,gBACnB,kBAAkB,eAClB,WACA,QACA,kBACA,gBA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tC,UAAA;GACG,CAAA,IACJ,IACD;EACH,CAAA,IAAA,MACJ,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,eAAY;GAAO,WAAW,OAAO;GAAO,aAAU;GACzD,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IACE,WAAW,OAAO;IAClB,sBAAoB,iBAAiB,KAAA;IACrC,aAAU;IACV,OAAO,gBAAgB,KAAA,IAAY,EAAE,OAAO,GAAG,WAAW,GAAG;GAC9D,CAAA;EACE,CAAA,CACF;;AAET,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.js","names":[],"sources":["../../../src/components/progress/progress.tsx"],"sourcesContent":["import { forwardRef, useId } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { progress } from \"../../styled-system/recipes\";\n\nfunction clamp(value: number, maximum: number) {\n if (!Number.isFinite(value)) {\n return 0;\n }\n\n return Math.min(Math.max(value, 0), maximum);\n}\n\nexport interface ProgressProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n /** The current amount. Omit it, or set `indeterminate`, when it is unknown. */\n value?: number | null;\n /** The value that represents completion. Defaults to 100. */\n max?: number;\n /** Omits `aria-valuenow` and renders an in-progress visual state. */\n indeterminate?: boolean;\n /** A visible, automatically associated accessible label. */\n label?: ReactNode;\n valueLabel?: ReactNode;\n locale?: Intl.LocalesArgument;\n format?: Intl.NumberFormatOptions;\n getAriaValueText?: (formattedValue: string, value: number) => string;\n}\n\n/**\n * A semantic progress bar. Provide `label` or `aria-label` so its purpose is\n * announced to assistive technology.\n */\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n {\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-valuetext\": ariaValueText,\n className,\n format,\n getAriaValueText,\n indeterminate = false,\n label,\n locale,\n max = 100,\n value = 0,\n valueLabel,\n ...props\n },\n ref,\n) {\n const labelId = useId();\n const maximum = Number.isFinite(max) && max > 0 ? max : 100;\n const currentValue = clamp(value ?? 0, maximum);\n const percentage = (currentValue / maximum) * 100;\n const formattedValue = new Intl.NumberFormat(locale, format).format(currentValue);\n const computedValueText = getAriaValueText?.(formattedValue, currentValue);\n const hasVisibleLabel = label !== null && label !== undefined;\n const labelledBy = ariaLabelledBy ?? (ariaLabel || !hasVisibleLabel ? undefined : labelId);\n const accessibleLabel = ariaLabel ?? (labelledBy ? undefined : \"Progress\");\n const styles = progress({ indeterminate });\n\n return (\n <div\n {...props}\n ref={ref}\n aria-busy={indeterminate || undefined}\n aria-label={accessibleLabel}\n aria-labelledby={labelledBy}\n aria-valuemax={maximum}\n aria-valuemin={0}\n aria-valuenow={indeterminate ? undefined : currentValue}\n aria-valuetext={ariaValueText ?? computedValueText}\n className={cx(styles.root, className)}\n data-indeterminate={indeterminate || undefined}\n data-jaci-component=\"progress\"\n data-slot=\"progress\"\n role=\"progressbar\"\n >\n {hasVisibleLabel || valueLabel !== undefined ? (\n <div style={{ display: \"flex\", minWidth: 0 }}>\n {hasVisibleLabel ? (\n <span className={styles.label} data-slot=\"progress-label\" id={labelId}>\n {label}\n </span>\n ) : null}\n {valueLabel !== undefined ? (\n <span className={styles.value} data-slot=\"progress-value\">\n {valueLabel}\n </span>\n ) : null}\n </div>\n ) : null}\n <div aria-hidden=\"true\" className={styles.track} data-slot=\"progress-track\">\n <div\n className={styles.indicator}\n data-indeterminate={indeterminate || undefined}\n data-slot=\"progress-indicator\"\n style={indeterminate ? undefined : { width: `${percentage}%` }}\n />\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;AAMA,SAAS,MAAM,OAAe,SAAiB;CAC7C,IAAI,CAAC,OAAO,SAAS,KAAK,GACxB,OAAO;CAGT,OAAO,KAAK,IAAI,KAAK,IAAI,OAAO,CAAC,GAAG,OAAO;AAC7C;;;;;AAqBA,MAAa,WAAW,WAA0C,SAAS,SACzE,EACE,cAAc,WACd,mBAAmB,gBACnB,kBAAkB,eAClB,WACA,QACA,kBACA,gBAAgB,OAChB,OACA,QACA,MAAM,KACN,QAAQ,GACR,YACA,GAAG,SAEL,KACA;CACA,MAAM,UAAU,MAAM;CACtB,MAAM,UAAU,OAAO,SAAS,GAAG,KAAK,MAAM,IAAI,MAAM;CACxD,MAAM,eAAe,MAAM,SAAS,GAAG,OAAO;CAC9C,MAAM,aAAc,eAAe,UAAW;CAC9C,MAAM,iBAAiB,IAAI,KAAK,aAAa,QAAQ,MAAM,CAAC,CAAC,OAAO,YAAY;CAChF,MAAM,oBAAoB,mBAAmB,gBAAgB,YAAY;CACzE,MAAM,kBAAkB,UAAU,QAAQ,UAAU,KAAA;CACpD,MAAM,aAAa,mBAAmB,aAAa,CAAC,kBAAkB,KAAA,IAAY;CAClF,MAAM,kBAAkB,cAAc,aAAa,KAAA,IAAY;CAC/D,MAAM,SAAS,SAAS,EAAE,cAAc,CAAC;CAEzC,OACE,qBAAC,OAAD;EACE,GAAI;EACC;EACL,aAAW,iBAAiB,KAAA;EAC5B,cAAY;EACZ,mBAAiB;EACjB,iBAAe;EACf,iBAAe;EACf,iBAAe,gBAAgB,KAAA,IAAY;EAC3C,kBAAgB,iBAAiB;EACjC,WAAW,GAAG,OAAO,MAAM,SAAS;EACpC,sBAAoB,iBAAiB,KAAA;EACrC,uBAAoB;EACpB,aAAU;EACV,MAAK;
|
|
1
|
+
{"version":3,"file":"progress.js","names":[],"sources":["../../../src/components/progress/progress.tsx"],"sourcesContent":["import { forwardRef, useId } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { progress } from \"../../styled-system/recipes\";\n\nfunction clamp(value: number, maximum: number) {\n if (!Number.isFinite(value)) {\n return 0;\n }\n\n return Math.min(Math.max(value, 0), maximum);\n}\n\nexport interface ProgressProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n /** The current amount. Omit it, or set `indeterminate`, when it is unknown. */\n value?: number | null;\n /** The value that represents completion. Defaults to 100. */\n max?: number;\n /** Omits `aria-valuenow` and renders an in-progress visual state. */\n indeterminate?: boolean;\n /** A visible, automatically associated accessible label. */\n label?: ReactNode;\n valueLabel?: ReactNode;\n locale?: Intl.LocalesArgument;\n format?: Intl.NumberFormatOptions;\n getAriaValueText?: (formattedValue: string, value: number) => string;\n}\n\n/**\n * A semantic progress bar. Provide `label` or `aria-label` so its purpose is\n * announced to assistive technology.\n */\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n {\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-valuetext\": ariaValueText,\n className,\n format,\n getAriaValueText,\n indeterminate = false,\n label,\n locale,\n max = 100,\n value = 0,\n valueLabel,\n ...props\n },\n ref,\n) {\n const labelId = useId();\n const maximum = Number.isFinite(max) && max > 0 ? max : 100;\n const currentValue = clamp(value ?? 0, maximum);\n const percentage = (currentValue / maximum) * 100;\n const formattedValue = new Intl.NumberFormat(locale, format).format(currentValue);\n const computedValueText = getAriaValueText?.(formattedValue, currentValue);\n const hasVisibleLabel = label !== null && label !== undefined;\n const labelledBy = ariaLabelledBy ?? (ariaLabel || !hasVisibleLabel ? undefined : labelId);\n const accessibleLabel = ariaLabel ?? (labelledBy ? undefined : \"Progress\");\n const styles = progress({ indeterminate });\n\n return (\n <div\n {...props}\n ref={ref}\n aria-busy={indeterminate || undefined}\n aria-label={accessibleLabel}\n aria-labelledby={labelledBy}\n aria-valuemax={maximum}\n aria-valuemin={0}\n aria-valuenow={indeterminate ? undefined : currentValue}\n aria-valuetext={ariaValueText ?? computedValueText}\n className={cx(styles.root, className)}\n data-indeterminate={indeterminate || undefined}\n data-jaci-component=\"progress\"\n data-slot=\"progress\"\n role=\"progressbar\"\n >\n {hasVisibleLabel || valueLabel !== undefined ? (\n <div style={{ display: \"flex\", minWidth: 0 }}>\n {hasVisibleLabel ? (\n <span className={styles.label} data-slot=\"progress-label\" id={labelId}>\n {label}\n </span>\n ) : null}\n {valueLabel !== undefined ? (\n <span className={styles.value} data-slot=\"progress-value\">\n {valueLabel}\n </span>\n ) : null}\n </div>\n ) : null}\n <div aria-hidden=\"true\" className={styles.track} data-slot=\"progress-track\">\n <div\n className={styles.indicator}\n data-indeterminate={indeterminate || undefined}\n data-slot=\"progress-indicator\"\n style={indeterminate ? undefined : { width: `${percentage}%` }}\n />\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;AAMA,SAAS,MAAM,OAAe,SAAiB;CAC7C,IAAI,CAAC,OAAO,SAAS,KAAK,GACxB,OAAO;CAGT,OAAO,KAAK,IAAI,KAAK,IAAI,OAAO,CAAC,GAAG,OAAO;AAC7C;;;;;AAqBA,MAAa,WAAW,WAA0C,SAAS,SACzE,EACE,cAAc,WACd,mBAAmB,gBACnB,kBAAkB,eAClB,WACA,QACA,kBACA,gBAAgB,OAChB,OACA,QACA,MAAM,KACN,QAAQ,GACR,YACA,GAAG,SAEL,KACA;CACA,MAAM,UAAU,MAAM;CACtB,MAAM,UAAU,OAAO,SAAS,GAAG,KAAK,MAAM,IAAI,MAAM;CACxD,MAAM,eAAe,MAAM,SAAS,GAAG,OAAO;CAC9C,MAAM,aAAc,eAAe,UAAW;CAC9C,MAAM,iBAAiB,IAAI,KAAK,aAAa,QAAQ,MAAM,CAAC,CAAC,OAAO,YAAY;CAChF,MAAM,oBAAoB,mBAAmB,gBAAgB,YAAY;CACzE,MAAM,kBAAkB,UAAU,QAAQ,UAAU,KAAA;CACpD,MAAM,aAAa,mBAAmB,aAAa,CAAC,kBAAkB,KAAA,IAAY;CAClF,MAAM,kBAAkB,cAAc,aAAa,KAAA,IAAY;CAC/D,MAAM,SAAS,SAAS,EAAE,cAAc,CAAC;CAEzC,OACE,qBAAC,OAAD;EACE,GAAI;EACC;EACL,aAAW,iBAAiB,KAAA;EAC5B,cAAY;EACZ,mBAAiB;EACjB,iBAAe;EACf,iBAAe;EACf,iBAAe,gBAAgB,KAAA,IAAY;EAC3C,kBAAgB,iBAAiB;EACjC,WAAW,GAAG,OAAO,MAAM,SAAS;EACpC,sBAAoB,iBAAiB,KAAA;EACrC,uBAAoB;EACpB,aAAU;EACV,MAAK;EAdP,UAAA,CAgBG,mBAAmB,eAAe,KAAA,IACjC,qBAAC,OAAD;GAAK,OAAO;IAAE,SAAS;IAAQ,UAAU;GAAE;GAA3C,UAAA,CACG,kBACC,oBAAC,QAAD;IAAM,WAAW,OAAO;IAAO,aAAU;IAAiB,IAAI;IAC3D,UAAA;GACG,CAAA,IACJ,MACH,eAAe,KAAA,IACd,oBAAC,QAAD;IAAM,WAAW,OAAO;IAAO,aAAU;IACtC,UAAA;GACG,CAAA,IACJ,IACD;EACH,CAAA,IAAA,MACJ,oBAAC,OAAD;GAAK,eAAY;GAAO,WAAW,OAAO;GAAO,aAAU;GACzD,UAAA,oBAAC,OAAD;IACE,WAAW,OAAO;IAClB,sBAAoB,iBAAiB,KAAA;IACrC,aAAU;IACV,OAAO,gBAAgB,KAAA,IAAY,EAAE,OAAO,GAAG,WAAW,GAAG;GAC9D,CAAA;EACE,CAAA,CACF;;AAET,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qr-code.cjs","names":["QRCodeEncoder","cx","qrCode"],"sources":["../../../src/components/qr-code/qr-code.tsx"],"sourcesContent":["import * as QRCodeEncoder from \"qrcode\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { qrCode } from \"../../styled-system/recipes\";\n\nexport type QRCodeErrorCorrectionLevel = \"L\" | \"M\" | \"Q\" | \"H\";\n\nexport interface QRCodeProps\n extends Omit<ComponentPropsWithoutRef<\"svg\">, \"children\" | \"download\"> {\n value: string;\n size?: number;\n margin?: number;\n errorCorrectionLevel?: QRCodeErrorCorrectionLevel;\n foreground?: string;\n background?: string;\n label?: string;\n fallback?: ReactNode;\n /** Enables a native SVG download link inside the rendered code. */\n download?: boolean | string;\n downloadLabel?: string;\n}\n\nfunction isFinderCell(row: number, column: number, size: number) {\n return (\n (row < 7 && column < 7) || (row < 7 && column >= size - 7) || (row >= size - 7 && column < 7)\n );\n}\n\nfunction Finder({\n x,\n y,\n color,\n background,\n}: {\n x: number;\n y: number;\n color: string;\n background: string;\n}) {\n return (\n <g data-slot=\"qr-code-eye\">\n <rect data-slot=\"qr-code-eye-frame\" fill={color} height=\"7\" rx=\"1\" width=\"7\" x={x} y={y} />\n <rect\n data-slot=\"qr-code-eye-cutout\"\n fill={background}\n height=\"5\"\n rx=\"0.75\"\n width=\"5\"\n x={x + 1}\n y={y + 1}\n />\n <rect\n data-slot=\"qr-code-eyeball\"\n fill={color}\n height=\"3\"\n rx=\"0.5\"\n width=\"3\"\n x={x + 2}\n y={y + 2}\n />\n </g>\n );\n}\n\nfunction escapeXml(value: string) {\n return value.replace(/[&<>'\"]/g, (character) => {\n const entities: Record<string, string> = {\n \"&\": \"&\",\n \"<\": \"<\",\n \">\": \">\",\n \"'\": \"'\",\n '\"': \""\",\n };\n return entities[character] ?? character;\n });\n}\n\nfunction createDownloadSvg({\n background,\n dots,\n foreground,\n finderBackground,\n label,\n margin,\n moduleCount,\n}: {\n background: string;\n dots: readonly [number, number][];\n foreground: string;\n finderBackground: string;\n label: string;\n margin: number;\n moduleCount: number;\n}) {\n const viewBoxSize = moduleCount + margin * 2;\n const backgroundMarkup =\n background === \"transparent\"\n ? \"\"\n : `<rect fill=\"${escapeXml(background)}\" height=\"${viewBoxSize}\" width=\"${viewBoxSize}\" x=\"0\" y=\"0\"/>`;\n const dotsMarkup = dots\n .map(\n ([row, column]) =>\n `<circle cx=\"${margin + column + 0.5}\" cy=\"${margin + row + 0.5}\" fill=\"${escapeXml(foreground)}\" r=\"0.43\"/>`,\n )\n .join(\"\");\n const finderMarkup = (x: number, y: number) =>\n `<g><rect fill=\"${escapeXml(foreground)}\" height=\"7\" rx=\"1\" width=\"7\" x=\"${x}\" y=\"${y}\"/><rect fill=\"${escapeXml(finderBackground)}\" height=\"5\" rx=\"0.75\" width=\"5\" x=\"${x + 1}\" y=\"${y + 1}\"/><rect fill=\"${escapeXml(foreground)}\" height=\"3\" rx=\"0.5\" width=\"3\" x=\"${x + 2}\" y=\"${y + 2}\"/></g>`;\n\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" aria-label=\"${escapeXml(label)}\" role=\"img\" viewBox=\"0 0 ${viewBoxSize} ${viewBoxSize}\">${backgroundMarkup}${dotsMarkup}${finderMarkup(margin, margin)}${finderMarkup(margin + moduleCount - 7, margin)}${finderMarkup(margin, margin + moduleCount - 7)}</svg>`;\n}\n\nexport const QRCode = forwardRef<SVGSVGElement, QRCodeProps>(function QRCode(\n {\n // A QR code needs a deterministic high-contrast base. Inheriting\n // `currentColor` or a transparent surface can make finder layers merge\n // in dark scopes, so the defaults intentionally remain black on white.\n background = \"#ffffff\",\n className,\n download = false,\n downloadLabel = \"Download QR code\",\n errorCorrectionLevel = \"Q\",\n fallback,\n foreground = \"#18181b\",\n label = \"QR code\",\n margin = 2,\n size = 192,\n style,\n value,\n ...props\n },\n ref,\n) {\n const safeSize = Number.isFinite(size) && size > 0 ? size : 192;\n const safeMargin = Number.isFinite(margin) && margin >= 0 ? Math.floor(margin) : 2;\n const finderBackground =\n background === \"transparent\" ? \"var(--jaci-colors-surface-raised)\" : background;\n\n try {\n const code = QRCodeEncoder.create(value, { errorCorrectionLevel });\n const moduleCount = code.modules.size;\n const viewBoxSize = moduleCount + safeMargin * 2;\n const modules: ReactNode[] = [];\n const dotCoordinates: [number, number][] = [];\n\n for (let row = 0; row < moduleCount; row += 1) {\n for (let column = 0; column < moduleCount; column += 1) {\n if (code.modules.get(row, column) && !isFinderCell(row, column, moduleCount)) {\n dotCoordinates.push([row, column]);\n modules.push(\n <circle\n cx={safeMargin + column + 0.5}\n cy={safeMargin + row + 0.5}\n data-slot=\"qr-code-dot\"\n fill={foreground}\n key={`${row}-${column}`}\n r=\"0.43\"\n />,\n );\n }\n }\n }\n\n const downloadHref =\n download &&\n `data:image/svg+xml;charset=utf-8,${encodeURIComponent(\n createDownloadSvg({\n background,\n dots: dotCoordinates,\n foreground,\n finderBackground: background === \"transparent\" ? \"#ffffff\" : background,\n label,\n margin: safeMargin,\n moduleCount,\n }),\n )}`;\n const downloadFilename = typeof download === \"string\" ? download : \"qrcode.svg\";\n const visualCode = (\n <>\n {background !== \"transparent\" ? (\n <rect fill={background} height={viewBoxSize} width={viewBoxSize} x=\"0\" y=\"0\" />\n ) : null}\n {modules}\n <Finder background={finderBackground} color={foreground} x={safeMargin} y={safeMargin} />\n <Finder\n background={finderBackground}\n color={foreground}\n x={safeMargin + moduleCount - 7}\n y={safeMargin}\n />\n <Finder\n background={finderBackground}\n color={foreground}\n x={safeMargin}\n y={safeMargin + moduleCount - 7}\n />\n </>\n );\n\n const svg = (\n <svg\n {...props}\n ref={ref}\n aria-hidden={downloadHref ? true : undefined}\n aria-label={downloadHref ? undefined : label}\n className={cx(qrCode(), className)}\n data-dot-shape=\"circle\"\n data-download={download ? \"true\" : undefined}\n data-eye-shape=\"rounded-square\"\n data-jaci-component=\"qr-code\"\n data-slot=\"qr-code\"\n height={safeSize}\n role={downloadHref ? undefined : \"img\"}\n style={style}\n viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`}\n width={safeSize}\n >\n <title>{label}</title>\n {visualCode}\n </svg>\n );\n\n return downloadHref ? (\n <a\n aria-label={downloadLabel}\n data-jaci-component=\"qr-code-download\"\n data-slot=\"qr-code-download\"\n download={downloadFilename}\n href={downloadHref}\n >\n {svg}\n </a>\n ) : (\n svg\n );\n } catch {\n return (\n <span\n aria-label={label}\n className={cx(qrCode(), className)}\n data-jaci-component=\"qr-code\"\n data-slot=\"qr-code\"\n data-status=\"error\"\n role=\"img\"\n >\n {fallback ?? \"Unable to generate QR code\"}\n </span>\n );\n }\n});\n"],"mappings":";;;;;;;;AAwBA,SAAS,aAAa,KAAa,QAAgB,MAAc;CAC/D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,UACE;;EAGP,OAAO,eACL,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;GACE,cAAY;GACZ,uBAAoB;GACpB,aAAU;GACV,UAAU;GACV,MAAM;aAEL;EACA,CAAA,IAEH;CAEJ,QAAQ;EACN,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GACE,cAAY;GACZ,WAAWD,WAAAA,GAAGC,gBAAAA,OAAO,GAAG,SAAS;GACjC,uBAAoB;GACpB,aAAU;GACV,eAAY;GACZ,MAAK;aAEJ,YAAY;EACT,CAAA;CAEV;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"qr-code.cjs","names":["forwardRef","QRCodeEncoder","cx","qrCode"],"sources":["../../../src/components/qr-code/qr-code.tsx"],"sourcesContent":["import * as QRCodeEncoder from \"qrcode\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { qrCode } from \"../../styled-system/recipes\";\n\nexport type QRCodeErrorCorrectionLevel = \"L\" | \"M\" | \"Q\" | \"H\";\n\nexport interface QRCodeProps\n extends Omit<ComponentPropsWithoutRef<\"svg\">, \"children\" | \"download\"> {\n value: string;\n size?: number;\n margin?: number;\n errorCorrectionLevel?: QRCodeErrorCorrectionLevel;\n foreground?: string;\n background?: string;\n label?: string;\n fallback?: ReactNode;\n /** Enables a native SVG download link inside the rendered code. */\n download?: boolean | string;\n downloadLabel?: string;\n}\n\nfunction isFinderCell(row: number, column: number, size: number) {\n return (\n (row < 7 && column < 7) || (row < 7 && column >= size - 7) || (row >= size - 7 && column < 7)\n );\n}\n\nfunction Finder({\n x,\n y,\n color,\n background,\n}: {\n x: number;\n y: number;\n color: string;\n background: string;\n}) {\n return (\n <g data-slot=\"qr-code-eye\">\n <rect data-slot=\"qr-code-eye-frame\" fill={color} height=\"7\" rx=\"1\" width=\"7\" x={x} y={y} />\n <rect\n data-slot=\"qr-code-eye-cutout\"\n fill={background}\n height=\"5\"\n rx=\"0.75\"\n width=\"5\"\n x={x + 1}\n y={y + 1}\n />\n <rect\n data-slot=\"qr-code-eyeball\"\n fill={color}\n height=\"3\"\n rx=\"0.5\"\n width=\"3\"\n x={x + 2}\n y={y + 2}\n />\n </g>\n );\n}\n\nfunction escapeXml(value: string) {\n return value.replace(/[&<>'\"]/g, (character) => {\n const entities: Record<string, string> = {\n \"&\": \"&\",\n \"<\": \"<\",\n \">\": \">\",\n \"'\": \"'\",\n '\"': \""\",\n };\n return entities[character] ?? character;\n });\n}\n\nfunction createDownloadSvg({\n background,\n dots,\n foreground,\n finderBackground,\n label,\n margin,\n moduleCount,\n}: {\n background: string;\n dots: readonly [number, number][];\n foreground: string;\n finderBackground: string;\n label: string;\n margin: number;\n moduleCount: number;\n}) {\n const viewBoxSize = moduleCount + margin * 2;\n const backgroundMarkup =\n background === \"transparent\"\n ? \"\"\n : `<rect fill=\"${escapeXml(background)}\" height=\"${viewBoxSize}\" width=\"${viewBoxSize}\" x=\"0\" y=\"0\"/>`;\n const dotsMarkup = dots\n .map(\n ([row, column]) =>\n `<circle cx=\"${margin + column + 0.5}\" cy=\"${margin + row + 0.5}\" fill=\"${escapeXml(foreground)}\" r=\"0.43\"/>`,\n )\n .join(\"\");\n const finderMarkup = (x: number, y: number) =>\n `<g><rect fill=\"${escapeXml(foreground)}\" height=\"7\" rx=\"1\" width=\"7\" x=\"${x}\" y=\"${y}\"/><rect fill=\"${escapeXml(finderBackground)}\" height=\"5\" rx=\"0.75\" width=\"5\" x=\"${x + 1}\" y=\"${y + 1}\"/><rect fill=\"${escapeXml(foreground)}\" height=\"3\" rx=\"0.5\" width=\"3\" x=\"${x + 2}\" y=\"${y + 2}\"/></g>`;\n\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" aria-label=\"${escapeXml(label)}\" role=\"img\" viewBox=\"0 0 ${viewBoxSize} ${viewBoxSize}\">${backgroundMarkup}${dotsMarkup}${finderMarkup(margin, margin)}${finderMarkup(margin + moduleCount - 7, margin)}${finderMarkup(margin, margin + moduleCount - 7)}</svg>`;\n}\n\nexport const QRCode = forwardRef<SVGSVGElement, QRCodeProps>(function QRCode(\n {\n // A QR code needs a deterministic high-contrast base. Inheriting\n // `currentColor` or a transparent surface can make finder layers merge\n // in dark scopes, so the defaults intentionally remain black on white.\n background = \"#ffffff\",\n className,\n download = false,\n downloadLabel = \"Download QR code\",\n errorCorrectionLevel = \"Q\",\n fallback,\n foreground = \"#18181b\",\n label = \"QR code\",\n margin = 2,\n size = 192,\n style,\n value,\n ...props\n },\n ref,\n) {\n const safeSize = Number.isFinite(size) && size > 0 ? size : 192;\n const safeMargin = Number.isFinite(margin) && margin >= 0 ? Math.floor(margin) : 2;\n const finderBackground =\n background === \"transparent\" ? \"var(--jaci-colors-surface-raised)\" : background;\n\n try {\n const code = QRCodeEncoder.create(value, { errorCorrectionLevel });\n const moduleCount = code.modules.size;\n const viewBoxSize = moduleCount + safeMargin * 2;\n const modules: ReactNode[] = [];\n const dotCoordinates: [number, number][] = [];\n\n for (let row = 0; row < moduleCount; row += 1) {\n for (let column = 0; column < moduleCount; column += 1) {\n if (code.modules.get(row, column) && !isFinderCell(row, column, moduleCount)) {\n dotCoordinates.push([row, column]);\n modules.push(\n <circle\n cx={safeMargin + column + 0.5}\n cy={safeMargin + row + 0.5}\n data-slot=\"qr-code-dot\"\n fill={foreground}\n key={`${row}-${column}`}\n r=\"0.43\"\n />,\n );\n }\n }\n }\n\n const downloadHref =\n download &&\n `data:image/svg+xml;charset=utf-8,${encodeURIComponent(\n createDownloadSvg({\n background,\n dots: dotCoordinates,\n foreground,\n finderBackground: background === \"transparent\" ? \"#ffffff\" : background,\n label,\n margin: safeMargin,\n moduleCount,\n }),\n )}`;\n const downloadFilename = typeof download === \"string\" ? download : \"qrcode.svg\";\n const visualCode = (\n <>\n {background !== \"transparent\" ? (\n <rect fill={background} height={viewBoxSize} width={viewBoxSize} x=\"0\" y=\"0\" />\n ) : null}\n {modules}\n <Finder background={finderBackground} color={foreground} x={safeMargin} y={safeMargin} />\n <Finder\n background={finderBackground}\n color={foreground}\n x={safeMargin + moduleCount - 7}\n y={safeMargin}\n />\n <Finder\n background={finderBackground}\n color={foreground}\n x={safeMargin}\n y={safeMargin + moduleCount - 7}\n />\n </>\n );\n\n const svg = (\n <svg\n {...props}\n ref={ref}\n aria-hidden={downloadHref ? true : undefined}\n aria-label={downloadHref ? undefined : label}\n className={cx(qrCode(), className)}\n data-dot-shape=\"circle\"\n data-download={download ? \"true\" : undefined}\n data-eye-shape=\"rounded-square\"\n data-jaci-component=\"qr-code\"\n data-slot=\"qr-code\"\n height={safeSize}\n role={downloadHref ? undefined : \"img\"}\n style={style}\n viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`}\n width={safeSize}\n >\n <title>{label}</title>\n {visualCode}\n </svg>\n );\n\n return downloadHref ? (\n <a\n aria-label={downloadLabel}\n data-jaci-component=\"qr-code-download\"\n data-slot=\"qr-code-download\"\n download={downloadFilename}\n href={downloadHref}\n >\n {svg}\n </a>\n ) : (\n svg\n );\n } catch {\n return (\n <span\n aria-label={label}\n className={cx(qrCode(), className)}\n data-jaci-component=\"qr-code\"\n data-slot=\"qr-code\"\n data-status=\"error\"\n role=\"img\"\n >\n {fallback ?? \"Unable to generate QR code\"}\n </span>\n );\n }\n});\n"],"mappings":";;;;;;;;AAwBA,SAAS,aAAa,KAAa,QAAgB,MAAc;CAC/D,OACG,MAAM,KAAK,SAAS,KAAO,MAAM,KAAK,UAAU,OAAO,KAAO,OAAO,OAAO,KAAK,SAAS;AAE/F;AAEA,SAAS,OAAO,EACd,GACA,GACA,OACA,cAMC;CACD,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,KAAD;EAAG,aAAU;EAAb,UAAA;GACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,aAAU;IAAoB,MAAM;IAAO,QAAO;IAAI,IAAG;IAAI,OAAM;IAAO;IAAM;GAAI,CAAA;GAC1F,iBAAA,GAAA,k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AY;EACT,CAAA;CAEV;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qr-code.js","names":[],"sources":["../../../src/components/qr-code/qr-code.tsx"],"sourcesContent":["import * as QRCodeEncoder from \"qrcode\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { qrCode } from \"../../styled-system/recipes\";\n\nexport type QRCodeErrorCorrectionLevel = \"L\" | \"M\" | \"Q\" | \"H\";\n\nexport interface QRCodeProps\n extends Omit<ComponentPropsWithoutRef<\"svg\">, \"children\" | \"download\"> {\n value: string;\n size?: number;\n margin?: number;\n errorCorrectionLevel?: QRCodeErrorCorrectionLevel;\n foreground?: string;\n background?: string;\n label?: string;\n fallback?: ReactNode;\n /** Enables a native SVG download link inside the rendered code. */\n download?: boolean | string;\n downloadLabel?: string;\n}\n\nfunction isFinderCell(row: number, column: number, size: number) {\n return (\n (row < 7 && column < 7) || (row < 7 && column >= size - 7) || (row >= size - 7 && column < 7)\n );\n}\n\nfunction Finder({\n x,\n y,\n color,\n background,\n}: {\n x: number;\n y: number;\n color: string;\n background: string;\n}) {\n return (\n <g data-slot=\"qr-code-eye\">\n <rect data-slot=\"qr-code-eye-frame\" fill={color} height=\"7\" rx=\"1\" width=\"7\" x={x} y={y} />\n <rect\n data-slot=\"qr-code-eye-cutout\"\n fill={background}\n height=\"5\"\n rx=\"0.75\"\n width=\"5\"\n x={x + 1}\n y={y + 1}\n />\n <rect\n data-slot=\"qr-code-eyeball\"\n fill={color}\n height=\"3\"\n rx=\"0.5\"\n width=\"3\"\n x={x + 2}\n y={y + 2}\n />\n </g>\n );\n}\n\nfunction escapeXml(value: string) {\n return value.replace(/[&<>'\"]/g, (character) => {\n const entities: Record<string, string> = {\n \"&\": \"&\",\n \"<\": \"<\",\n \">\": \">\",\n \"'\": \"'\",\n '\"': \""\",\n };\n return entities[character] ?? character;\n });\n}\n\nfunction createDownloadSvg({\n background,\n dots,\n foreground,\n finderBackground,\n label,\n margin,\n moduleCount,\n}: {\n background: string;\n dots: readonly [number, number][];\n foreground: string;\n finderBackground: string;\n label: string;\n margin: number;\n moduleCount: number;\n}) {\n const viewBoxSize = moduleCount + margin * 2;\n const backgroundMarkup =\n background === \"transparent\"\n ? \"\"\n : `<rect fill=\"${escapeXml(background)}\" height=\"${viewBoxSize}\" width=\"${viewBoxSize}\" x=\"0\" y=\"0\"/>`;\n const dotsMarkup = dots\n .map(\n ([row, column]) =>\n `<circle cx=\"${margin + column + 0.5}\" cy=\"${margin + row + 0.5}\" fill=\"${escapeXml(foreground)}\" r=\"0.43\"/>`,\n )\n .join(\"\");\n const finderMarkup = (x: number, y: number) =>\n `<g><rect fill=\"${escapeXml(foreground)}\" height=\"7\" rx=\"1\" width=\"7\" x=\"${x}\" y=\"${y}\"/><rect fill=\"${escapeXml(finderBackground)}\" height=\"5\" rx=\"0.75\" width=\"5\" x=\"${x + 1}\" y=\"${y + 1}\"/><rect fill=\"${escapeXml(foreground)}\" height=\"3\" rx=\"0.5\" width=\"3\" x=\"${x + 2}\" y=\"${y + 2}\"/></g>`;\n\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" aria-label=\"${escapeXml(label)}\" role=\"img\" viewBox=\"0 0 ${viewBoxSize} ${viewBoxSize}\">${backgroundMarkup}${dotsMarkup}${finderMarkup(margin, margin)}${finderMarkup(margin + moduleCount - 7, margin)}${finderMarkup(margin, margin + moduleCount - 7)}</svg>`;\n}\n\nexport const QRCode = forwardRef<SVGSVGElement, QRCodeProps>(function QRCode(\n {\n // A QR code needs a deterministic high-contrast base. Inheriting\n // `currentColor` or a transparent surface can make finder layers merge\n // in dark scopes, so the defaults intentionally remain black on white.\n background = \"#ffffff\",\n className,\n download = false,\n downloadLabel = \"Download QR code\",\n errorCorrectionLevel = \"Q\",\n fallback,\n foreground = \"#18181b\",\n label = \"QR code\",\n margin = 2,\n size = 192,\n style,\n value,\n ...props\n },\n ref,\n) {\n const safeSize = Number.isFinite(size) && size > 0 ? size : 192;\n const safeMargin = Number.isFinite(margin) && margin >= 0 ? Math.floor(margin) : 2;\n const finderBackground =\n background === \"transparent\" ? \"var(--jaci-colors-surface-raised)\" : background;\n\n try {\n const code = QRCodeEncoder.create(value, { errorCorrectionLevel });\n const moduleCount = code.modules.size;\n const viewBoxSize = moduleCount + safeMargin * 2;\n const modules: ReactNode[] = [];\n const dotCoordinates: [number, number][] = [];\n\n for (let row = 0; row < moduleCount; row += 1) {\n for (let column = 0; column < moduleCount; column += 1) {\n if (code.modules.get(row, column) && !isFinderCell(row, column, moduleCount)) {\n dotCoordinates.push([row, column]);\n modules.push(\n <circle\n cx={safeMargin + column + 0.5}\n cy={safeMargin + row + 0.5}\n data-slot=\"qr-code-dot\"\n fill={foreground}\n key={`${row}-${column}`}\n r=\"0.43\"\n />,\n );\n }\n }\n }\n\n const downloadHref =\n download &&\n `data:image/svg+xml;charset=utf-8,${encodeURIComponent(\n createDownloadSvg({\n background,\n dots: dotCoordinates,\n foreground,\n finderBackground: background === \"transparent\" ? \"#ffffff\" : background,\n label,\n margin: safeMargin,\n moduleCount,\n }),\n )}`;\n const downloadFilename = typeof download === \"string\" ? download : \"qrcode.svg\";\n const visualCode = (\n <>\n {background !== \"transparent\" ? (\n <rect fill={background} height={viewBoxSize} width={viewBoxSize} x=\"0\" y=\"0\" />\n ) : null}\n {modules}\n <Finder background={finderBackground} color={foreground} x={safeMargin} y={safeMargin} />\n <Finder\n background={finderBackground}\n color={foreground}\n x={safeMargin + moduleCount - 7}\n y={safeMargin}\n />\n <Finder\n background={finderBackground}\n color={foreground}\n x={safeMargin}\n y={safeMargin + moduleCount - 7}\n />\n </>\n );\n\n const svg = (\n <svg\n {...props}\n ref={ref}\n aria-hidden={downloadHref ? true : undefined}\n aria-label={downloadHref ? undefined : label}\n className={cx(qrCode(), className)}\n data-dot-shape=\"circle\"\n data-download={download ? \"true\" : undefined}\n data-eye-shape=\"rounded-square\"\n data-jaci-component=\"qr-code\"\n data-slot=\"qr-code\"\n height={safeSize}\n role={downloadHref ? undefined : \"img\"}\n style={style}\n viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`}\n width={safeSize}\n >\n <title>{label}</title>\n {visualCode}\n </svg>\n );\n\n return downloadHref ? (\n <a\n aria-label={downloadLabel}\n data-jaci-component=\"qr-code-download\"\n data-slot=\"qr-code-download\"\n download={downloadFilename}\n href={downloadHref}\n >\n {svg}\n </a>\n ) : (\n svg\n );\n } catch {\n return (\n <span\n aria-label={label}\n className={cx(qrCode(), className)}\n data-jaci-component=\"qr-code\"\n data-slot=\"qr-code\"\n data-status=\"error\"\n role=\"img\"\n >\n {fallback ?? \"Unable to generate QR code\"}\n </span>\n );\n }\n});\n"],"mappings":";;;;;;AAwBA,SAAS,aAAa,KAAa,QAAgB,MAAc;CAC/D,OACG,MAAM,KAAK,SAAS,KAAO,MAAM,KAAK,UAAU,OAAO,KAAO,OAAO,OAAO,KAAK,SAAS;AAE/F;AAEA,SAAS,OAAO,EACd,GACA,GACA,OACA,cAMC;CACD,OACE,qBAAC,KAAD;EAAG,aAAU;YAAb;GACE,oBAAC,QAAD;IAAM,aAAU;IAAoB,MAAM;IAAO,QAAO;IAAI,IAAG;IAAI,OAAM;IAAO;IAAM;GAAI,CAAA;GAC1F,oBAAC,QAAD;IACE,aAAU;IACV,MAAM;IACN,QAAO;IACP,IAAG;IACH,OAAM;IACN,GAAG,IAAI;IACP,GAAG,IAAI;GACR,CAAA;GACD,oBAAC,QAAD;IACE,aAAU;IACV,MAAM;IACN,QAAO;IACP,IAAG;IACH,OAAM;IACN,GAAG,IAAI;IACP,GAAG,IAAI;GACR,CAAA;EACA;;AAEP;AAEA,SAAS,UAAU,OAAe;CAChC,OAAO,MAAM,QAAQ,aAAa,cAAc;EAQ9C,OAAO;GANL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,MAAK;EAEO,EAAE,cAAc;CAChC,CAAC;AACH;AAEA,SA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ACnC,kBAAe;GACf,uBAAoB;GACpB,aAAU;GACV,QAAQ;GACR,MAAM,eAAe,KAAA,IAAY;GAC1B;GACP,SAAS,OAAO,YAAY,GAAG;GAC/B,OAAO;aAfT,CAiBE,oBAAC,SAAD,EAAA,UAAQ,MAAa,CAAA,GACpB,UACE;;EAGP,OAAO,eACL,oBAAC,KAAD;GACE,cAAY;GACZ,uBAAoB;GACpB,aAAU;GACV,UAAU;GACV,MAAM;aAEL;EACA,CAAA,IAEH;CAEJ,QAAQ;EACN,OACE,oBAAC,QAAD;GACE,cAAY;GACZ,WAAW,GAAG,OAAO,GAAG,SAAS;GACjC,uBAAoB;GACpB,aAAU;GACV,eAAY;GACZ,MAAK;aAEJ,YAAY;EACT,CAAA;CAEV;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"qr-code.js","names":[],"sources":["../../../src/components/qr-code/qr-code.tsx"],"sourcesContent":["import * as QRCodeEncoder from \"qrcode\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { qrCode } from \"../../styled-system/recipes\";\n\nexport type QRCodeErrorCorrectionLevel = \"L\" | \"M\" | \"Q\" | \"H\";\n\nexport interface QRCodeProps\n extends Omit<ComponentPropsWithoutRef<\"svg\">, \"children\" | \"download\"> {\n value: string;\n size?: number;\n margin?: number;\n errorCorrectionLevel?: QRCodeErrorCorrectionLevel;\n foreground?: string;\n background?: string;\n label?: string;\n fallback?: ReactNode;\n /** Enables a native SVG download link inside the rendered code. */\n download?: boolean | string;\n downloadLabel?: string;\n}\n\nfunction isFinderCell(row: number, column: number, size: number) {\n return (\n (row < 7 && column < 7) || (row < 7 && column >= size - 7) || (row >= size - 7 && column < 7)\n );\n}\n\nfunction Finder({\n x,\n y,\n color,\n background,\n}: {\n x: number;\n y: number;\n color: string;\n background: string;\n}) {\n return (\n <g data-slot=\"qr-code-eye\">\n <rect data-slot=\"qr-code-eye-frame\" fill={color} height=\"7\" rx=\"1\" width=\"7\" x={x} y={y} />\n <rect\n data-slot=\"qr-code-eye-cutout\"\n fill={background}\n height=\"5\"\n rx=\"0.75\"\n width=\"5\"\n x={x + 1}\n y={y + 1}\n />\n <rect\n data-slot=\"qr-code-eyeball\"\n fill={color}\n height=\"3\"\n rx=\"0.5\"\n width=\"3\"\n x={x + 2}\n y={y + 2}\n />\n </g>\n );\n}\n\nfunction escapeXml(value: string) {\n return value.replace(/[&<>'\"]/g, (character) => {\n const entities: Record<string, string> = {\n \"&\": \"&\",\n \"<\": \"<\",\n \">\": \">\",\n \"'\": \"'\",\n '\"': \""\",\n };\n return entities[character] ?? character;\n });\n}\n\nfunction createDownloadSvg({\n background,\n dots,\n foreground,\n finderBackground,\n label,\n margin,\n moduleCount,\n}: {\n background: string;\n dots: readonly [number, number][];\n foreground: string;\n finderBackground: string;\n label: string;\n margin: number;\n moduleCount: number;\n}) {\n const viewBoxSize = moduleCount + margin * 2;\n const backgroundMarkup =\n background === \"transparent\"\n ? \"\"\n : `<rect fill=\"${escapeXml(background)}\" height=\"${viewBoxSize}\" width=\"${viewBoxSize}\" x=\"0\" y=\"0\"/>`;\n const dotsMarkup = dots\n .map(\n ([row, column]) =>\n `<circle cx=\"${margin + column + 0.5}\" cy=\"${margin + row + 0.5}\" fill=\"${escapeXml(foreground)}\" r=\"0.43\"/>`,\n )\n .join(\"\");\n const finderMarkup = (x: number, y: number) =>\n `<g><rect fill=\"${escapeXml(foreground)}\" height=\"7\" rx=\"1\" width=\"7\" x=\"${x}\" y=\"${y}\"/><rect fill=\"${escapeXml(finderBackground)}\" height=\"5\" rx=\"0.75\" width=\"5\" x=\"${x + 1}\" y=\"${y + 1}\"/><rect fill=\"${escapeXml(foreground)}\" height=\"3\" rx=\"0.5\" width=\"3\" x=\"${x + 2}\" y=\"${y + 2}\"/></g>`;\n\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" aria-label=\"${escapeXml(label)}\" role=\"img\" viewBox=\"0 0 ${viewBoxSize} ${viewBoxSize}\">${backgroundMarkup}${dotsMarkup}${finderMarkup(margin, margin)}${finderMarkup(margin + moduleCount - 7, margin)}${finderMarkup(margin, margin + moduleCount - 7)}</svg>`;\n}\n\nexport const QRCode = forwardRef<SVGSVGElement, QRCodeProps>(function QRCode(\n {\n // A QR code needs a deterministic high-contrast base. Inheriting\n // `currentColor` or a transparent surface can make finder layers merge\n // in dark scopes, so the defaults intentionally remain black on white.\n background = \"#ffffff\",\n className,\n download = false,\n downloadLabel = \"Download QR code\",\n errorCorrectionLevel = \"Q\",\n fallback,\n foreground = \"#18181b\",\n label = \"QR code\",\n margin = 2,\n size = 192,\n style,\n value,\n ...props\n },\n ref,\n) {\n const safeSize = Number.isFinite(size) && size > 0 ? size : 192;\n const safeMargin = Number.isFinite(margin) && margin >= 0 ? Math.floor(margin) : 2;\n const finderBackground =\n background === \"transparent\" ? \"var(--jaci-colors-surface-raised)\" : background;\n\n try {\n const code = QRCodeEncoder.create(value, { errorCorrectionLevel });\n const moduleCount = code.modules.size;\n const viewBoxSize = moduleCount + safeMargin * 2;\n const modules: ReactNode[] = [];\n const dotCoordinates: [number, number][] = [];\n\n for (let row = 0; row < moduleCount; row += 1) {\n for (let column = 0; column < moduleCount; column += 1) {\n if (code.modules.get(row, column) && !isFinderCell(row, column, moduleCount)) {\n dotCoordinates.push([row, column]);\n modules.push(\n <circle\n cx={safeMargin + column + 0.5}\n cy={safeMargin + row + 0.5}\n data-slot=\"qr-code-dot\"\n fill={foreground}\n key={`${row}-${column}`}\n r=\"0.43\"\n />,\n );\n }\n }\n }\n\n const downloadHref =\n download &&\n `data:image/svg+xml;charset=utf-8,${encodeURIComponent(\n createDownloadSvg({\n background,\n dots: dotCoordinates,\n foreground,\n finderBackground: background === \"transparent\" ? \"#ffffff\" : background,\n label,\n margin: safeMargin,\n moduleCount,\n }),\n )}`;\n const downloadFilename = typeof download === \"string\" ? download : \"qrcode.svg\";\n const visualCode = (\n <>\n {background !== \"transparent\" ? (\n <rect fill={background} height={viewBoxSize} width={viewBoxSize} x=\"0\" y=\"0\" />\n ) : null}\n {modules}\n <Finder background={finderBackground} color={foreground} x={safeMargin} y={safeMargin} />\n <Finder\n background={finderBackground}\n color={foreground}\n x={safeMargin + moduleCount - 7}\n y={safeMargin}\n />\n <Finder\n background={finderBackground}\n color={foreground}\n x={safeMargin}\n y={safeMargin + moduleCount - 7}\n />\n </>\n );\n\n const svg = (\n <svg\n {...props}\n ref={ref}\n aria-hidden={downloadHref ? true : undefined}\n aria-label={downloadHref ? undefined : label}\n className={cx(qrCode(), className)}\n data-dot-shape=\"circle\"\n data-download={download ? \"true\" : undefined}\n data-eye-shape=\"rounded-square\"\n data-jaci-component=\"qr-code\"\n data-slot=\"qr-code\"\n height={safeSize}\n role={downloadHref ? undefined : \"img\"}\n style={style}\n viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`}\n width={safeSize}\n >\n <title>{label}</title>\n {visualCode}\n </svg>\n );\n\n return downloadHref ? (\n <a\n aria-label={downloadLabel}\n data-jaci-component=\"qr-code-download\"\n data-slot=\"qr-code-download\"\n download={downloadFilename}\n href={downloadHref}\n >\n {svg}\n </a>\n ) : (\n svg\n );\n } catch {\n return (\n <span\n aria-label={label}\n className={cx(qrCode(), className)}\n data-jaci-component=\"qr-code\"\n data-slot=\"qr-code\"\n data-status=\"error\"\n role=\"img\"\n >\n {fallback ?? \"Unable to generate QR code\"}\n </span>\n );\n }\n});\n"],"mappings":";;;;;;AAwBA,SAAS,aAAa,KAAa,QAAgB,MAAc;CAC/D,OACG,MAAM,KAAK,SAAS,KAAO,MAAM,KAAK,UAAU,OAAO,KAAO,OAAO,OAAO,KAAK,SAAS;AAE/F;AAEA,SAAS,OAAO,EACd,GACA,GACA,OACA,cAMC;CACD,OACE,qBAAC,KAAD;EAAG,aAAU;EAAb,UAAA;GACE,oBAAC,QAAD;IAAM,aAAU;IAAoB,MAAM;IAAO,QAAO;IAAI,IAAG;IAAI,OAAM;IAAO;IAAM;GA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AAkB,OAAO;IAAY,GAAG;IAAY,GAAG;GAAa,CAAA;GACxF,oBAAC,QAAD;IACE,YAAY;IACZ,OAAO;IACP,GAAG,aAAa,cAAc;IAC9B,GAAG;GACJ,CAAA;GACD,oBAAC,QAAD;IACE,YAAY;IACZ,OAAO;IACP,GAAG;IACH,GAAG,aAAa,cAAc;GAC/B,CAAA;EACD,EAAA,CAAA;EAGJ,MAAM,MACJ,qBAAC,OAAD;GACE,GAAI;GACC;GACL,eAAa,eAAe,OAAO,KAAA;GACnC,cAAY,eAAe,KAAA,IAAY;GACvC,WAAW,GAAG,OAAO,GAAG,SAAS;GACjC,kBAAe;GACf,iBAAe,WAAW,SAAS,KAAA;GACnC,kBAAe;GACf,uBAAoB;GACpB,aAAU;GACV,QAAQ;GACR,MAAM,eAAe,KAAA,IAAY;GAC1B;GACP,SAAS,OAAO,YAAY,GAAG;GAC/B,OAAO;GAfT,UAAA,CAiBE,oBAAC,SAAD,EAAA,UAAQ,MAAa,CAAA,GACpB,UACE;;EAGP,OAAO,eACL,oBAAC,KAAD;GACE,cAAY;GACZ,uBAAoB;GACpB,aAAU;GACV,UAAU;GACV,MAAM;GAEL,UAAA;EACA,CAAA,IAEH;CAEJ,QAAQ;EACN,OACE,oBAAC,QAAD;GACE,cAAY;GACZ,WAAW,GAAG,OAAO,GAAG,SAAS;GACjC,uBAAoB;GACpB,aAAU;GACV,eAAY;GACZ,MAAK;GAEJ,UAAA,YAAY;EACT,CAAA;CAEV;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quote.cjs","names":["cx","quote"],"sources":["../../../src/components/quote/quote.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { quote } from \"../../styled-system/recipes\";\n\nexport type QuoteVariant = \"default\" | \"accent\" | \"subtle\";\nexport type QuoteSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface QuoteProps extends ComponentPropsWithoutRef<\"blockquote\"> {\n /** Visual treatment for the quote surface and leading border. */\n variant?: QuoteVariant;\n /** Typography scale for the quoted content. */\n size?: QuoteSize;\n /** Optional author rendered in a semantic footer. */\n author?: ReactNode;\n /** Optional source rendered as a semantic `<cite>`. */\n source?: ReactNode;\n}\n\n/** A semantic blockquote with optional author and source attribution. */\nexport const Quote = forwardRef<HTMLQuoteElement, QuoteProps>(function Quote(\n { author, children, className, size = \"md\", source, variant = \"default\", ...props },\n ref,\n) {\n const hasAttribution = author !== undefined || source !== undefined;\n\n return (\n <blockquote\n {...props}\n ref={ref}\n className={cx(quote({ size, variant }), className)}\n data-jaci-component=\"quote\"\n data-size={size}\n data-slot=\"quote\"\n data-variant={variant}\n >\n <div data-slot=\"quote-content\">{children}</div>\n {hasAttribution ? (\n <footer data-slot=\"quote-footer\">\n {author !== undefined ? <span data-slot=\"quote-author\">{author}</span> : null}\n {source !== undefined ? <cite data-slot=\"quote-source\">{source}</cite> : null}\n </footer>\n ) : null}\n </blockquote>\n );\n});\n"],"mappings":";;;;;;AAqBA,MAAa,SAAA,
|
|
1
|
+
{"version":3,"file":"quote.cjs","names":["forwardRef","cx","quote"],"sources":["../../../src/components/quote/quote.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { quote } from \"../../styled-system/recipes\";\n\nexport type QuoteVariant = \"default\" | \"accent\" | \"subtle\";\nexport type QuoteSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface QuoteProps extends ComponentPropsWithoutRef<\"blockquote\"> {\n /** Visual treatment for the quote surface and leading border. */\n variant?: QuoteVariant;\n /** Typography scale for the quoted content. */\n size?: QuoteSize;\n /** Optional author rendered in a semantic footer. */\n author?: ReactNode;\n /** Optional source rendered as a semantic `<cite>`. */\n source?: ReactNode;\n}\n\n/** A semantic blockquote with optional author and source attribution. */\nexport const Quote = forwardRef<HTMLQuoteElement, QuoteProps>(function Quote(\n { author, children, className, size = \"md\", source, variant = \"default\", ...props },\n ref,\n) {\n const hasAttribution = author !== undefined || source !== undefined;\n\n return (\n <blockquote\n {...props}\n ref={ref}\n className={cx(quote({ size, variant }), className)}\n data-jaci-component=\"quote\"\n data-size={size}\n data-slot=\"quote\"\n data-variant={variant}\n >\n <div data-slot=\"quote-content\">{children}</div>\n {hasAttribution ? (\n <footer data-slot=\"quote-footer\">\n {author !== undefined ? <span data-slot=\"quote-author\">{author}</span> : null}\n {source !== undefined ? <cite data-slot=\"quote-source\">{source}</cite> : null}\n </footer>\n ) : null}\n </blockquote>\n );\n});\n"],"mappings":";;;;;;AAqBA,MAAa,SAAA,GAAQA,MAAAA,WAAAA,CAAyC,SAAS,MACrE,EAAE,QAAQ,UAAU,WAAW,OAAO,MAAM,QAAQ,UAAU,WAAW,GAAG,SAC5E,KACA;CACA,MAAM,iBAAiB,WAAW,KAAA,KAAa,WAAW,KAAA;CAE1D,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,cAAD;EACE,GAAI;EACC;EACL,WAAWC,WAAAA,GAAGC,cAAAA,MAAM;GAAE;GAAM;EAAQ,CAAC,GAAG,SAAS;EACjD,uBAAoB;EACpB,aAAW;EACX,aAAU;EACV,gBAAc;EAPhB,UAAA,CASE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,aAAU;GAAiB;EAAc,CAAA,GAC7C,iBACC,iBAAA,GAAA,kBAAA,KAAA,CAAC,UAAD;GAAQ,aAAU;GAAlB,UAAA,CACG,WAAW,KAAA,IAAY,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,aAAU;IAAgB,UAAA;GAAa,CAAA,IAAI,MACxE,WAAW,KAAA,IAAY,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,aAAU;IAAgB,UAAA;GAAa,CAAA,IAAI,IACnE;EACN,CAAA,IAAA,IACM;;AAEhB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quote.js","names":[],"sources":["../../../src/components/quote/quote.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { quote } from \"../../styled-system/recipes\";\n\nexport type QuoteVariant = \"default\" | \"accent\" | \"subtle\";\nexport type QuoteSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface QuoteProps extends ComponentPropsWithoutRef<\"blockquote\"> {\n /** Visual treatment for the quote surface and leading border. */\n variant?: QuoteVariant;\n /** Typography scale for the quoted content. */\n size?: QuoteSize;\n /** Optional author rendered in a semantic footer. */\n author?: ReactNode;\n /** Optional source rendered as a semantic `<cite>`. */\n source?: ReactNode;\n}\n\n/** A semantic blockquote with optional author and source attribution. */\nexport const Quote = forwardRef<HTMLQuoteElement, QuoteProps>(function Quote(\n { author, children, className, size = \"md\", source, variant = \"default\", ...props },\n ref,\n) {\n const hasAttribution = author !== undefined || source !== undefined;\n\n return (\n <blockquote\n {...props}\n ref={ref}\n className={cx(quote({ size, variant }), className)}\n data-jaci-component=\"quote\"\n data-size={size}\n data-slot=\"quote\"\n data-variant={variant}\n >\n <div data-slot=\"quote-content\">{children}</div>\n {hasAttribution ? (\n <footer data-slot=\"quote-footer\">\n {author !== undefined ? <span data-slot=\"quote-author\">{author}</span> : null}\n {source !== undefined ? <cite data-slot=\"quote-source\">{source}</cite> : null}\n </footer>\n ) : null}\n </blockquote>\n );\n});\n"],"mappings":";;;;;;AAqBA,MAAa,QAAQ,WAAyC,SAAS,MACrE,EAAE,QAAQ,UAAU,WAAW,OAAO,MAAM,QAAQ,UAAU,WAAW,GAAG,SAC5E,KACA;CACA,MAAM,iBAAiB,WAAW,KAAA,KAAa,WAAW,KAAA;CAE1D,OACE,qBAAC,cAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,MAAM;GAAE;GAAM;EAAQ,CAAC,GAAG,SAAS;EACjD,uBAAoB;EACpB,aAAW;EACX,aAAU;EACV,gBAAc;
|
|
1
|
+
{"version":3,"file":"quote.js","names":[],"sources":["../../../src/components/quote/quote.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { quote } from \"../../styled-system/recipes\";\n\nexport type QuoteVariant = \"default\" | \"accent\" | \"subtle\";\nexport type QuoteSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface QuoteProps extends ComponentPropsWithoutRef<\"blockquote\"> {\n /** Visual treatment for the quote surface and leading border. */\n variant?: QuoteVariant;\n /** Typography scale for the quoted content. */\n size?: QuoteSize;\n /** Optional author rendered in a semantic footer. */\n author?: ReactNode;\n /** Optional source rendered as a semantic `<cite>`. */\n source?: ReactNode;\n}\n\n/** A semantic blockquote with optional author and source attribution. */\nexport const Quote = forwardRef<HTMLQuoteElement, QuoteProps>(function Quote(\n { author, children, className, size = \"md\", source, variant = \"default\", ...props },\n ref,\n) {\n const hasAttribution = author !== undefined || source !== undefined;\n\n return (\n <blockquote\n {...props}\n ref={ref}\n className={cx(quote({ size, variant }), className)}\n data-jaci-component=\"quote\"\n data-size={size}\n data-slot=\"quote\"\n data-variant={variant}\n >\n <div data-slot=\"quote-content\">{children}</div>\n {hasAttribution ? (\n <footer data-slot=\"quote-footer\">\n {author !== undefined ? <span data-slot=\"quote-author\">{author}</span> : null}\n {source !== undefined ? <cite data-slot=\"quote-source\">{source}</cite> : null}\n </footer>\n ) : null}\n </blockquote>\n );\n});\n"],"mappings":";;;;;;AAqBA,MAAa,QAAQ,WAAyC,SAAS,MACrE,EAAE,QAAQ,UAAU,WAAW,OAAO,MAAM,QAAQ,UAAU,WAAW,GAAG,SAC5E,KACA;CACA,MAAM,iBAAiB,WAAW,KAAA,KAAa,WAAW,KAAA;CAE1D,OACE,qBAAC,cAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,MAAM;GAAE;GAAM;EAAQ,CAAC,GAAG,SAAS;EACjD,uBAAoB;EACpB,aAAW;EACX,aAAU;EACV,gBAAc;EAPhB,UAAA,CASE,oBAAC,OAAD;GAAK,aAAU;GAAiB;EAAc,CAAA,GAC7C,iBACC,qBAAC,UAAD;GAAQ,aAAU;GAAlB,UAAA,CACG,WAAW,KAAA,IAAY,oBAAC,QAAD;IAAM,aAAU;IAAgB,UAAA;GAAa,CAAA,IAAI,MACxE,WAAW,KAAA,IAAY,oBAAC,QAAD;IAAM,aAAU;IAAgB,UAAA;GAAa,CAAA,IAAI,IACnE;EACN,CAAA,IAAA,IACM;;AAEhB,CAAC"}
|
|
@@ -15,11 +15,15 @@ let _base_ui_react_radio = require("@base-ui/react/radio");
|
|
|
15
15
|
* without an additional form library.
|
|
16
16
|
*/
|
|
17
17
|
function RadioGroupRoot({ children, className, errors, invalid, name, ...props }) {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const styles = require_radio_group.radioGroup();
|
|
19
|
+
const fieldProps = {
|
|
20
|
+
className: require_cx.cx(styles.root, className),
|
|
20
21
|
...errors === void 0 ? {} : { errors },
|
|
21
22
|
...invalid === void 0 ? {} : { invalid },
|
|
22
|
-
...name === void 0 ? {} : { name }
|
|
23
|
+
...name === void 0 ? {} : { name }
|
|
24
|
+
};
|
|
25
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_field.Field, {
|
|
26
|
+
...fieldProps,
|
|
23
27
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_radio_group.RadioGroup, {
|
|
24
28
|
...props,
|
|
25
29
|
...name === void 0 ? {} : { name },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.cjs","names":["
|
|
1
|
+
{"version":3,"file":"radio-group.cjs","names":["radioGroup","cx","Field","BaseRadioGroup","forwardRef","BaseField","withRecipeClassName","BaseRadio"],"sources":["../../../src/components/radio-group/radio-group.tsx"],"sourcesContent":["\"use client\";\n\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\nimport { Radio as BaseRadio } from \"@base-ui/react/radio\";\nimport { Field as BaseField } from \"@base-ui/react/field\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { RadioGroup as BaseRadioGroupType } from \"@base-ui/react/radio-group\";\nimport type { RadioRoot as BaseRadioRoot } from \"@base-ui/react/radio\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { radioGroup } from \"../../styled-system/recipes\";\nimport { Field } from \"../field\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport interface RadioGroupRootProps<Value = string>\n extends Omit<BaseRadioGroupType.Props<Value>, \"children\" | \"className\"> {\n /** Marks the group invalid when an external validator owns its state. */\n invalid?: boolean;\n /** Direct error content rendered through the surrounding Field context. */\n errors?: ReactNode | ReactNode[];\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * A typed, accessible radio group. The hidden native input is registered with\n * Jaci Form/Base UI, so `required`, `name`, errors and SSR form submission work\n * without an additional form library.\n */\nexport function RadioGroupRoot<Value = string>({\n children,\n className,\n errors,\n invalid,\n name,\n ...props\n}: RadioGroupRootProps<Value>) {\n const styles = radioGroup();\n const fieldProps = {\n className: cx(styles.root, className),\n ...(errors === undefined ? {} : { errors }),\n ...(invalid === undefined ? {} : { invalid }),\n ...(name === undefined ? {} : { name }),\n };\n\n return (\n <Field {...fieldProps}>\n <BaseRadioGroup {...props} {...(name === undefined ? {} : { name })}>\n {children}\n </BaseRadioGroup>\n </Field>\n );\n}\n\nexport type RadioGroupLabelProps = ComponentPropsWithoutRef<typeof BaseField.Label>;\n\nexport const RadioGroupLabel = forwardRef<HTMLElement, RadioGroupLabelProps>(\n function RadioGroupLabel({ className, ...props }, ref) {\n return (\n <BaseField.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(radioGroup().label, className)}\n data-slot=\"radio-group-label\"\n />\n );\n },\n);\n\nexport type RadioGroupOptionProps = ComponentPropsWithoutRef<\"label\">;\n\nexport const RadioGroupOption = forwardRef<HTMLLabelElement, RadioGroupOptionProps>(\n function RadioGroupOption({ children, className, htmlFor, ...props }, ref) {\n return (\n <label\n {...props}\n ref={ref}\n className={cx(radioGroup().option, className)}\n data-slot=\"radio-group-option\"\n htmlFor={htmlFor}\n >\n {children}\n </label>\n );\n },\n);\n\nexport type RadioGroupOptionsProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const RadioGroupOptions = forwardRef<HTMLDivElement, RadioGroupOptionsProps>(\n function RadioGroupOptions({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(radioGroup().options, className)}\n data-slot=\"radio-group-options\"\n />\n );\n },\n);\n\nexport type RadioGroupItemProps<Value = string> = BaseRadioRoot.Props<Value>;\n\nexport const RadioGroupItem = forwardRef<HTMLSpanElement, RadioGroupItemProps>(\n function RadioGroupItem({ className, ...props }, ref) {\n return (\n <BaseRadio.Root\n {...props}\n ref={ref}\n className={withRecipeClassName(radioGroup().radio, className)}\n data-slot=\"radio-group-item\"\n />\n );\n },\n);\n\nexport type RadioGroupIndicatorProps = ComponentPropsWithoutRef<typeof BaseRadio.Indicator>;\n\nexport const RadioGroupIndicator = forwardRef<HTMLSpanElement, RadioGroupIndicatorProps>(\n function RadioGroupIndicator({ children, className, ...props }, ref) {\n return (\n <BaseRadio.Indicator\n {...props}\n ref={ref}\n className={withRecipeClassName(radioGroup().indicator, className)}\n data-slot=\"radio-group-indicator\"\n >\n {children}\n </BaseRadio.Indicator>\n );\n },\n);\n\nexport const RadioGroup = {\n Root: RadioGroupRoot,\n Label: RadioGroupLabel,\n Options: RadioGroupOptions,\n Option: RadioGroupOption,\n Item: RadioGroupItem,\n Indicator: RadioGroupIndicator,\n};\n"],"mappings":";;;;;;;;;;;;;;;;AA8BA,SAAgB,eAA+B,EAC7C,UACA,WACA,QACA,SACA,MACA,GAAG,SAC0B;CAC7B,MAAM,SAASA,oBAAAA,WAAW;CAC1B,MAAM,aAAa;EACjB,WAAWC,WAAAA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AEL,CACF;AAIA,MAAa,kBAAA,GAAiBI,MAAAA,WAAAA,CAC5B,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CACpD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACG,qBAAAA,MAAU,MAAX;EACE,GAAI;EACC;EACL,WAAWD,gBAAAA,oBAAoBN,oBAAAA,WAAW,CAAC,CAAC,OAAO,SAAS;EAC5D,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,uBAAA,GAAsBI,MAAAA,WAAAA,CACjC,SAAS,oBAAoB,EAAE,UAAU,WAAW,GAAG,SAAS,KAAK;CACnE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACG,qBAAAA,MAAU,WAAX;EACE,GAAI;EACC;EACL,WAAWD,gBAAAA,oBAAoBN,oBAAAA,WAAW,CAAC,CAAC,WAAW,SAAS;EAChE,aAAU;EAET;CACkB,CAAA;AAEzB,CACF;AAEA,MAAa,aAAa;CACxB,MAAM;CACN,OAAO;CACP,SAAS;CACT,QAAQ;CACR,MAAM;CACN,WAAW;AACb"}
|
|
@@ -15,11 +15,15 @@ import { Radio } from "@base-ui/react/radio";
|
|
|
15
15
|
* without an additional form library.
|
|
16
16
|
*/
|
|
17
17
|
function RadioGroupRoot({ children, className, errors, invalid, name, ...props }) {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const styles = radioGroup();
|
|
19
|
+
const fieldProps = {
|
|
20
|
+
className: cx(styles.root, className),
|
|
20
21
|
...errors === void 0 ? {} : { errors },
|
|
21
22
|
...invalid === void 0 ? {} : { invalid },
|
|
22
|
-
...name === void 0 ? {} : { name }
|
|
23
|
+
...name === void 0 ? {} : { name }
|
|
24
|
+
};
|
|
25
|
+
return /* @__PURE__ */ jsx(Field$1, {
|
|
26
|
+
...fieldProps,
|
|
23
27
|
children: /* @__PURE__ */ jsx(RadioGroup, {
|
|
24
28
|
...props,
|
|
25
29
|
...name === void 0 ? {} : { name },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.js","names":["Field","BaseRadioGroup","BaseField","BaseRadio","RadioGroup"],"sources":["../../../src/components/radio-group/radio-group.tsx"],"sourcesContent":["\"use client\";\n\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\nimport { Radio as BaseRadio } from \"@base-ui/react/radio\";\nimport { Field as BaseField } from \"@base-ui/react/field\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { RadioGroup as BaseRadioGroupType } from \"@base-ui/react/radio-group\";\nimport type { RadioRoot as BaseRadioRoot } from \"@base-ui/react/radio\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { radioGroup } from \"../../styled-system/recipes\";\nimport { Field } from \"../field\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport interface RadioGroupRootProps<Value = string>\n extends Omit<BaseRadioGroupType.Props<Value>, \"children\" | \"className\"> {\n /** Marks the group invalid when an external validator owns its state. */\n invalid?: boolean;\n /** Direct error content rendered through the surrounding Field context. */\n errors?: ReactNode | ReactNode[];\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * A typed, accessible radio group. The hidden native input is registered with\n * Jaci Form/Base UI, so `required`, `name`, errors and SSR form submission work\n * without an additional form library.\n */\nexport function RadioGroupRoot<Value = string>({\n children,\n className,\n errors,\n invalid,\n name,\n ...props\n}: RadioGroupRootProps<Value>) {\n const styles = radioGroup();\n const fieldProps = {\n className: cx(styles.root, className),\n ...(errors === undefined ? {} : { errors }),\n ...(invalid === undefined ? {} : { invalid }),\n ...(name === undefined ? {} : { name }),\n };\n\n return (\n <Field {...fieldProps}>\n <BaseRadioGroup {...props} {...(name === undefined ? {} : { name })}>\n {children}\n </BaseRadioGroup>\n </Field>\n );\n}\n\nexport type RadioGroupLabelProps = ComponentPropsWithoutRef<typeof BaseField.Label>;\n\nexport const RadioGroupLabel = forwardRef<HTMLElement, RadioGroupLabelProps>(\n function RadioGroupLabel({ className, ...props }, ref) {\n return (\n <BaseField.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(radioGroup().label, className)}\n data-slot=\"radio-group-label\"\n />\n );\n },\n);\n\nexport type RadioGroupOptionProps = ComponentPropsWithoutRef<\"label\">;\n\nexport const RadioGroupOption = forwardRef<HTMLLabelElement, RadioGroupOptionProps>(\n function RadioGroupOption({ children, className, htmlFor, ...props }, ref) {\n return (\n <label\n {...props}\n ref={ref}\n className={cx(radioGroup().option, className)}\n data-slot=\"radio-group-option\"\n htmlFor={htmlFor}\n >\n {children}\n </label>\n );\n },\n);\n\nexport type RadioGroupOptionsProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const RadioGroupOptions = forwardRef<HTMLDivElement, RadioGroupOptionsProps>(\n function RadioGroupOptions({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(radioGroup().options, className)}\n data-slot=\"radio-group-options\"\n />\n );\n },\n);\n\nexport type RadioGroupItemProps<Value = string> = BaseRadioRoot.Props<Value>;\n\nexport const RadioGroupItem = forwardRef<HTMLSpanElement, RadioGroupItemProps>(\n function RadioGroupItem({ className, ...props }, ref) {\n return (\n <BaseRadio.Root\n {...props}\n ref={ref}\n className={withRecipeClassName(radioGroup().radio, className)}\n data-slot=\"radio-group-item\"\n />\n );\n },\n);\n\nexport type RadioGroupIndicatorProps = ComponentPropsWithoutRef<typeof BaseRadio.Indicator>;\n\nexport const RadioGroupIndicator = forwardRef<HTMLSpanElement, RadioGroupIndicatorProps>(\n function RadioGroupIndicator({ children, className, ...props }, ref) {\n return (\n <BaseRadio.Indicator\n {...props}\n ref={ref}\n className={withRecipeClassName(radioGroup().indicator, className)}\n data-slot=\"radio-group-indicator\"\n >\n {children}\n </BaseRadio.Indicator>\n );\n },\n);\n\nexport const RadioGroup = {\n Root: RadioGroupRoot,\n Label: RadioGroupLabel,\n Options: RadioGroupOptions,\n Option: RadioGroupOption,\n Item: RadioGroupItem,\n Indicator: RadioGroupIndicator,\n};\n"],"mappings":";;;;;;;;;;;;;;;;AA8BA,SAAgB,eAA+B,EAC7C,UACA,WACA,QACA,SACA,MACA,GAAG,SAC0B;
|
|
1
|
+
{"version":3,"file":"radio-group.js","names":["Field","BaseRadioGroup","BaseField","BaseRadio","RadioGroup"],"sources":["../../../src/components/radio-group/radio-group.tsx"],"sourcesContent":["\"use client\";\n\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\nimport { Radio as BaseRadio } from \"@base-ui/react/radio\";\nimport { Field as BaseField } from \"@base-ui/react/field\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { RadioGroup as BaseRadioGroupType } from \"@base-ui/react/radio-group\";\nimport type { RadioRoot as BaseRadioRoot } from \"@base-ui/react/radio\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { radioGroup } from \"../../styled-system/recipes\";\nimport { Field } from \"../field\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport interface RadioGroupRootProps<Value = string>\n extends Omit<BaseRadioGroupType.Props<Value>, \"children\" | \"className\"> {\n /** Marks the group invalid when an external validator owns its state. */\n invalid?: boolean;\n /** Direct error content rendered through the surrounding Field context. */\n errors?: ReactNode | ReactNode[];\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * A typed, accessible radio group. The hidden native input is registered with\n * Jaci Form/Base UI, so `required`, `name`, errors and SSR form submission work\n * without an additional form library.\n */\nexport function RadioGroupRoot<Value = string>({\n children,\n className,\n errors,\n invalid,\n name,\n ...props\n}: RadioGroupRootProps<Value>) {\n const styles = radioGroup();\n const fieldProps = {\n className: cx(styles.root, className),\n ...(errors === undefined ? {} : { errors }),\n ...(invalid === undefined ? {} : { invalid }),\n ...(name === undefined ? {} : { name }),\n };\n\n return (\n <Field {...fieldProps}>\n <BaseRadioGroup {...props} {...(name === undefined ? {} : { name })}>\n {children}\n </BaseRadioGroup>\n </Field>\n );\n}\n\nexport type RadioGroupLabelProps = ComponentPropsWithoutRef<typeof BaseField.Label>;\n\nexport const RadioGroupLabel = forwardRef<HTMLElement, RadioGroupLabelProps>(\n function RadioGroupLabel({ className, ...props }, ref) {\n return (\n <BaseField.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(radioGroup().label, className)}\n data-slot=\"radio-group-label\"\n />\n );\n },\n);\n\nexport type RadioGroupOptionProps = ComponentPropsWithoutRef<\"label\">;\n\nexport const RadioGroupOption = forwardRef<HTMLLabelElement, RadioGroupOptionProps>(\n function RadioGroupOption({ children, className, htmlFor, ...props }, ref) {\n return (\n <label\n {...props}\n ref={ref}\n className={cx(radioGroup().option, className)}\n data-slot=\"radio-group-option\"\n htmlFor={htmlFor}\n >\n {children}\n </label>\n );\n },\n);\n\nexport type RadioGroupOptionsProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const RadioGroupOptions = forwardRef<HTMLDivElement, RadioGroupOptionsProps>(\n function RadioGroupOptions({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(radioGroup().options, className)}\n data-slot=\"radio-group-options\"\n />\n );\n },\n);\n\nexport type RadioGroupItemProps<Value = string> = BaseRadioRoot.Props<Value>;\n\nexport const RadioGroupItem = forwardRef<HTMLSpanElement, RadioGroupItemProps>(\n function RadioGroupItem({ className, ...props }, ref) {\n return (\n <BaseRadio.Root\n {...props}\n ref={ref}\n className={withRecipeClassName(radioGroup().radio, className)}\n data-slot=\"radio-group-item\"\n />\n );\n },\n);\n\nexport type RadioGroupIndicatorProps = ComponentPropsWithoutRef<typeof BaseRadio.Indicator>;\n\nexport const RadioGroupIndicator = forwardRef<HTMLSpanElement, RadioGroupIndicatorProps>(\n function RadioGroupIndicator({ children, className, ...props }, ref) {\n return (\n <BaseRadio.Indicator\n {...props}\n ref={ref}\n className={withRecipeClassName(radioGroup().indicator, className)}\n data-slot=\"radio-group-indicator\"\n >\n {children}\n </BaseRadio.Indicator>\n );\n },\n);\n\nexport const RadioGroup = {\n Root: RadioGroupRoot,\n Label: RadioGroupLabel,\n Options: RadioGroupOptions,\n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AAG,SAAS,KAAK;CACpD,OACE,oBAACC,MAAU,MAAX;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,WAAW,CAAC,CAAC,OAAO,SAAS;EAC5D,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,sBAAsB,WACjC,SAAS,oBAAoB,EAAE,UAAU,WAAW,GAAG,SAAS,KAAK;CACnE,OACE,oBAACA,MAAU,WAAX;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,WAAW,CAAC,CAAC,WAAW,SAAS;EAChE,aAAU;EAET;CACkB,CAAA;AAEzB,CACF;AAEA,MAAaC,eAAa;CACxB,MAAM;CACN,OAAO;CACP,SAAS;CACT,QAAQ;CACR,MAAM;CACN,WAAW;AACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range-slider.cjs","names":["rangeSlider","BaseSlider","withRecipeClassName"],"sources":["../../../src/components/range-slider/range-slider.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slider as BaseSlider } from \"@base-ui/react/slider\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { SliderRoot as BaseSliderRoot } from \"@base-ui/react/slider\";\n\nimport { rangeSlider } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type RangeSliderSize = \"sm\" | \"md\" | \"lg\";\n\nconst RangeSliderSizeContext = createContext<RangeSliderSize>(\"md\");\n\nfunction useRangeSliderStyles() {\n return rangeSlider({ size: useContext(RangeSliderSizeContext) });\n}\n\nexport interface RangeSliderRootProps\n extends Omit<\n BaseSliderRoot.Props<readonly number[]>,\n \"children\" | \"className\" | \"defaultValue\" | \"value\" | \"onValueChange\" | \"onValueCommitted\"\n > {\n value?: readonly [number, number];\n defaultValue?: readonly [number, number];\n onValueChange?: (value: readonly [number, number]) => void;\n onValueCommitted?: (value: readonly [number, number]) => void;\n size?: RangeSliderSize;\n children?: ReactNode;\n className?: string;\n}\n\nfunction asRange(values: readonly number[], min: number, max: number): readonly [number, number] {\n return [values[0] ?? min, values[1] ?? max];\n}\n\nexport const RangeSliderRoot = forwardRef<HTMLDivElement, RangeSliderRootProps>(\n function RangeSliderRoot(\n {\n children,\n className,\n defaultValue,\n max = 100,\n min = 0,\n onValueChange,\n onValueCommitted,\n size = \"md\",\n value,\n ...props\n },\n ref,\n ) {\n const styles = rangeSlider({ size });\n const fallbackValue = defaultValue ?? [min, max];\n\n return (\n <RangeSliderSizeContext.Provider value={size}>\n <BaseSlider.Root\n {...props}\n defaultValue={fallbackValue}\n max={max}\n min={min}\n onValueChange={(next) => onValueChange?.(asRange(next, min, max))}\n onValueCommitted={(next) => onValueCommitted?.(asRange(next, min, max))}\n ref={ref}\n value={value}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"range-slider\"\n data-slot=\"range-slider\"\n >\n {children}\n </BaseSlider.Root>\n </RangeSliderSizeContext.Provider>\n );\n },\n);\n\nexport type RangeSliderLabelProps = ComponentPropsWithoutRef<typeof BaseSlider.Label>;\nexport const RangeSliderLabel = forwardRef<HTMLDivElement, RangeSliderLabelProps>(\n function RangeSliderLabel({ className, ...props }, ref) {\n return (\n <BaseSlider.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().label, className)}\n data-slot=\"range-slider-label\"\n />\n );\n },\n);\n\nexport type RangeSliderValueProps = ComponentPropsWithoutRef<typeof BaseSlider.Value>;\nexport const RangeSliderValue = forwardRef<HTMLOutputElement, RangeSliderValueProps>(\n function RangeSliderValue({ className, ...props }, ref) {\n return (\n <BaseSlider.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().value, className)}\n data-slot=\"range-slider-value\"\n />\n );\n },\n);\n\nexport type RangeSliderControlProps = ComponentPropsWithoutRef<typeof BaseSlider.Control>;\nexport const RangeSliderControl = forwardRef<HTMLDivElement, RangeSliderControlProps>(\n function RangeSliderControl({ className, ...props }, ref) {\n return (\n <BaseSlider.Control\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().control, className)}\n data-slot=\"range-slider-control\"\n />\n );\n },\n);\n\nexport type RangeSliderTrackProps = ComponentPropsWithoutRef<typeof BaseSlider.Track>;\nexport const RangeSliderTrack = forwardRef<HTMLDivElement, RangeSliderTrackProps>(\n function RangeSliderTrack({ className, ...props }, ref) {\n return (\n <BaseSlider.Track\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().track, className)}\n data-slot=\"range-slider-track\"\n />\n );\n },\n);\n\nexport type RangeSliderIndicatorProps = ComponentPropsWithoutRef<typeof BaseSlider.Indicator>;\nexport const RangeSliderIndicator = forwardRef<HTMLDivElement, RangeSliderIndicatorProps>(\n function RangeSliderIndicator({ className, ...props }, ref) {\n return (\n <BaseSlider.Indicator\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().indicator, className)}\n data-slot=\"range-slider-indicator\"\n />\n );\n },\n);\n\nexport interface RangeSliderThumbProps extends ComponentPropsWithoutRef<typeof BaseSlider.Thumb> {\n index: 0 | 1;\n}\n\nexport const RangeSliderThumb = forwardRef<HTMLDivElement, RangeSliderThumbProps>(\n function RangeSliderThumb({ className, ...props }, ref) {\n return (\n <BaseSlider.Thumb\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().thumb, className)}\n data-slot=\"range-slider-thumb\"\n />\n );\n },\n);\n\nexport const RangeSlider = {\n Root: RangeSliderRoot,\n Label: RangeSliderLabel,\n Value: RangeSliderValue,\n Control: RangeSliderControl,\n Track: RangeSliderTrack,\n Indicator: RangeSliderIndicator,\n Thumb: RangeSliderThumb,\n};\n"],"mappings":";;;;;;;AAYA,MAAM,0BAAA,
|
|
1
|
+
{"version":3,"file":"range-slider.cjs","names":["createContext","rangeSlider","useContext","forwardRef","BaseSlider","withRecipeClassName"],"sources":["../../../src/components/range-slider/range-slider.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slider as BaseSlider } from \"@base-ui/react/slider\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { SliderRoot as BaseSliderRoot } from \"@base-ui/react/slider\";\n\nimport { rangeSlider } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type RangeSliderSize = \"sm\" | \"md\" | \"lg\";\n\nconst RangeSliderSizeContext = createContext<RangeSliderSize>(\"md\");\n\nfunction useRangeSliderStyles() {\n return rangeSlider({ size: useContext(RangeSliderSizeContext) });\n}\n\nexport interface RangeSliderRootProps\n extends Omit<\n BaseSliderRoot.Props<readonly number[]>,\n \"children\" | \"className\" | \"defaultValue\" | \"value\" | \"onValueChange\" | \"onValueCommitted\"\n > {\n value?: readonly [number, number];\n defaultValue?: readonly [number, number];\n onValueChange?: (value: readonly [number, number]) => void;\n onValueCommitted?: (value: readonly [number, number]) => void;\n size?: RangeSliderSize;\n children?: ReactNode;\n className?: string;\n}\n\nfunction asRange(values: readonly number[], min: number, max: number): readonly [number, number] {\n return [values[0] ?? min, values[1] ?? max];\n}\n\nexport const RangeSliderRoot = forwardRef<HTMLDivElement, RangeSliderRootProps>(\n function RangeSliderRoot(\n {\n children,\n className,\n defaultValue,\n max = 100,\n min = 0,\n onValueChange,\n onValueCommitted,\n size = \"md\",\n value,\n ...props\n },\n ref,\n ) {\n const styles = rangeSlider({ size });\n const fallbackValue = defaultValue ?? [min, max];\n\n return (\n <RangeSliderSizeContext.Provider value={size}>\n <BaseSlider.Root\n {...props}\n defaultValue={fallbackValue}\n max={max}\n min={min}\n onValueChange={(next) => onValueChange?.(asRange(next, min, max))}\n onValueCommitted={(next) => onValueCommitted?.(asRange(next, min, max))}\n ref={ref}\n value={value}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"range-slider\"\n data-slot=\"range-slider\"\n >\n {children}\n </BaseSlider.Root>\n </RangeSliderSizeContext.Provider>\n );\n },\n);\n\nexport type RangeSliderLabelProps = ComponentPropsWithoutRef<typeof BaseSlider.Label>;\nexport const RangeSliderLabel = forwardRef<HTMLDivElement, RangeSliderLabelProps>(\n function RangeSliderLabel({ className, ...props }, ref) {\n return (\n <BaseSlider.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().label, className)}\n data-slot=\"range-slider-label\"\n />\n );\n },\n);\n\nexport type RangeSliderValueProps = ComponentPropsWithoutRef<typeof BaseSlider.Value>;\nexport const RangeSliderValue = forwardRef<HTMLOutputElement, RangeSliderValueProps>(\n function RangeSliderValue({ className, ...props }, ref) {\n return (\n <BaseSlider.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().value, className)}\n data-slot=\"range-slider-value\"\n />\n );\n },\n);\n\nexport type RangeSliderControlProps = ComponentPropsWithoutRef<typeof BaseSlider.Control>;\nexport const RangeSliderControl = forwardRef<HTMLDivElement, RangeSliderControlProps>(\n function RangeSliderControl({ className, ...props }, ref) {\n return (\n <BaseSlider.Control\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().control, className)}\n data-slot=\"range-slider-control\"\n />\n );\n },\n);\n\nexport type RangeSliderTrackProps = ComponentPropsWithoutRef<typeof BaseSlider.Track>;\nexport const RangeSliderTrack = forwardRef<HTMLDivElement, RangeSliderTrackProps>(\n function RangeSliderTrack({ className, ...props }, ref) {\n return (\n <BaseSlider.Track\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().track, className)}\n data-slot=\"range-slider-track\"\n />\n );\n },\n);\n\nexport type RangeSliderIndicatorProps = ComponentPropsWithoutRef<typeof BaseSlider.Indicator>;\nexport const RangeSliderIndicator = forwardRef<HTMLDivElement, RangeSliderIndicatorProps>(\n function RangeSliderIndicator({ className, ...props }, ref) {\n return (\n <BaseSlider.Indicator\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().indicator, className)}\n data-slot=\"range-slider-indicator\"\n />\n );\n },\n);\n\nexport interface RangeSliderThumbProps extends ComponentPropsWithoutRef<typeof BaseSlider.Thumb> {\n index: 0 | 1;\n}\n\nexport const RangeSliderThumb = forwardRef<HTMLDivElement, RangeSliderThumbProps>(\n function RangeSliderThumb({ className, ...props }, ref) {\n return (\n <BaseSlider.Thumb\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().thumb, className)}\n data-slot=\"range-slider-thumb\"\n />\n );\n },\n);\n\nexport const RangeSlider = {\n Root: RangeSliderRoot,\n Label: RangeSliderLabel,\n Value: RangeSliderValue,\n Control: RangeSliderControl,\n Track: RangeSliderTrack,\n Indicator: RangeSliderIndicator,\n Thumb: RangeSliderThumb,\n};\n"],"mappings":";;;;;;;AAYA,MAAM,0BAAA,GAAyBA,MAAAA,cAAAA,CAA+B,IAAI;AAElE,SAAS,uBAAuB;CAC9B,OAAOC,qBAAAA,YAAY,EAAE,OAAA,GAAMC,MAAAA,WAAAA,CAAW,sBAAsB,EAAE,CAAC;AACjE;AAgBA,SAAS,QAAQ,QAA2B,KAAa,KAAwC;CAC/F,OAAO,CAAC,OAAO,MAAM,KAAK,OAAO,MAAM,GAAG;AAC5C;AAEA,MAAa,mBAAA,GAAkBC,MAAAA,WAAAA,CAC7B,SAAS,gBACP,EACE,UACA,WACA,cACA,MAAM,KACN,MAAM,GACN,eACA,kBACA,OAAO,MACP,OACA,GAAG,SAEL,KACA;CACA,MAAM,SAASF,qBAAAA,YAAY,EAAE,KAAK,CAAC;CACnC,MAAM,gBAAgB,gBAAgB,CAAC,KAAK,GAAG;CAE/C,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,uBAAuB,UAAxB;EAAiC,OAAO;EACtC,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACG,sBAAAA,OAAW,MAAZ;GACE,GAAI;GACJ,cAAc;GACT;GACA;GACL,gBAAgB,SAAS,gBAAgB,QAAQ,MAAM,KAAK,GAAG,CAAC;GAChE,mBAAmB,SAAS,mBAAmB,QAAQ,MAAM,KAAK,GAAG,CAAC;GACjE;GACE;GACP,WAAWC,gBAAAA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AAE,WAAW,GAAG,SAAS,KAAK;CAC1D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,OAAW,WAAZ;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoB,qBAAqB,CAAC,CAAC,WAAW,SAAS;EAC1E,aAAU;CACX,CAAA;AAEL,CACF;AAMA,MAAa,oBAAA,GAAmBF,MAAAA,WAAAA,CAC9B,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAS,KAAK;CACtD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoB,qBAAqB,CAAC,CAAC,OAAO,SAAS;EACtE,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,cAAc;CACzB,MAAM;CACN,OAAO;CACP,OAAO;CACP,SAAS;CACT,OAAO;CACP,WAAW;CACX,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range-slider.js","names":["BaseSlider"],"sources":["../../../src/components/range-slider/range-slider.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slider as BaseSlider } from \"@base-ui/react/slider\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { SliderRoot as BaseSliderRoot } from \"@base-ui/react/slider\";\n\nimport { rangeSlider } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type RangeSliderSize = \"sm\" | \"md\" | \"lg\";\n\nconst RangeSliderSizeContext = createContext<RangeSliderSize>(\"md\");\n\nfunction useRangeSliderStyles() {\n return rangeSlider({ size: useContext(RangeSliderSizeContext) });\n}\n\nexport interface RangeSliderRootProps\n extends Omit<\n BaseSliderRoot.Props<readonly number[]>,\n \"children\" | \"className\" | \"defaultValue\" | \"value\" | \"onValueChange\" | \"onValueCommitted\"\n > {\n value?: readonly [number, number];\n defaultValue?: readonly [number, number];\n onValueChange?: (value: readonly [number, number]) => void;\n onValueCommitted?: (value: readonly [number, number]) => void;\n size?: RangeSliderSize;\n children?: ReactNode;\n className?: string;\n}\n\nfunction asRange(values: readonly number[], min: number, max: number): readonly [number, number] {\n return [values[0] ?? min, values[1] ?? max];\n}\n\nexport const RangeSliderRoot = forwardRef<HTMLDivElement, RangeSliderRootProps>(\n function RangeSliderRoot(\n {\n children,\n className,\n defaultValue,\n max = 100,\n min = 0,\n onValueChange,\n onValueCommitted,\n size = \"md\",\n value,\n ...props\n },\n ref,\n ) {\n const styles = rangeSlider({ size });\n const fallbackValue = defaultValue ?? [min, max];\n\n return (\n <RangeSliderSizeContext.Provider value={size}>\n <BaseSlider.Root\n {...props}\n defaultValue={fallbackValue}\n max={max}\n min={min}\n onValueChange={(next) => onValueChange?.(asRange(next, min, max))}\n onValueCommitted={(next) => onValueCommitted?.(asRange(next, min, max))}\n ref={ref}\n value={value}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"range-slider\"\n data-slot=\"range-slider\"\n >\n {children}\n </BaseSlider.Root>\n </RangeSliderSizeContext.Provider>\n );\n },\n);\n\nexport type RangeSliderLabelProps = ComponentPropsWithoutRef<typeof BaseSlider.Label>;\nexport const RangeSliderLabel = forwardRef<HTMLDivElement, RangeSliderLabelProps>(\n function RangeSliderLabel({ className, ...props }, ref) {\n return (\n <BaseSlider.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().label, className)}\n data-slot=\"range-slider-label\"\n />\n );\n },\n);\n\nexport type RangeSliderValueProps = ComponentPropsWithoutRef<typeof BaseSlider.Value>;\nexport const RangeSliderValue = forwardRef<HTMLOutputElement, RangeSliderValueProps>(\n function RangeSliderValue({ className, ...props }, ref) {\n return (\n <BaseSlider.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().value, className)}\n data-slot=\"range-slider-value\"\n />\n );\n },\n);\n\nexport type RangeSliderControlProps = ComponentPropsWithoutRef<typeof BaseSlider.Control>;\nexport const RangeSliderControl = forwardRef<HTMLDivElement, RangeSliderControlProps>(\n function RangeSliderControl({ className, ...props }, ref) {\n return (\n <BaseSlider.Control\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().control, className)}\n data-slot=\"range-slider-control\"\n />\n );\n },\n);\n\nexport type RangeSliderTrackProps = ComponentPropsWithoutRef<typeof BaseSlider.Track>;\nexport const RangeSliderTrack = forwardRef<HTMLDivElement, RangeSliderTrackProps>(\n function RangeSliderTrack({ className, ...props }, ref) {\n return (\n <BaseSlider.Track\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().track, className)}\n data-slot=\"range-slider-track\"\n />\n );\n },\n);\n\nexport type RangeSliderIndicatorProps = ComponentPropsWithoutRef<typeof BaseSlider.Indicator>;\nexport const RangeSliderIndicator = forwardRef<HTMLDivElement, RangeSliderIndicatorProps>(\n function RangeSliderIndicator({ className, ...props }, ref) {\n return (\n <BaseSlider.Indicator\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().indicator, className)}\n data-slot=\"range-slider-indicator\"\n />\n );\n },\n);\n\nexport interface RangeSliderThumbProps extends ComponentPropsWithoutRef<typeof BaseSlider.Thumb> {\n index: 0 | 1;\n}\n\nexport const RangeSliderThumb = forwardRef<HTMLDivElement, RangeSliderThumbProps>(\n function RangeSliderThumb({ className, ...props }, ref) {\n return (\n <BaseSlider.Thumb\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().thumb, className)}\n data-slot=\"range-slider-thumb\"\n />\n );\n },\n);\n\nexport const RangeSlider = {\n Root: RangeSliderRoot,\n Label: RangeSliderLabel,\n Value: RangeSliderValue,\n Control: RangeSliderControl,\n Track: RangeSliderTrack,\n Indicator: RangeSliderIndicator,\n Thumb: RangeSliderThumb,\n};\n"],"mappings":";;;;;;;AAYA,MAAM,yBAAyB,cAA+B,IAAI;AAElE,SAAS,uBAAuB;CAC9B,OAAO,YAAY,EAAE,MAAM,WAAW,sBAAsB,EAAE,CAAC;AACjE;AAgBA,SAAS,QAAQ,QAA2B,KAAa,KAAwC;CAC/F,OAAO,CAAC,OAAO,MAAM,KAAK,OAAO,MAAM,GAAG;AAC5C;AAEA,MAAa,kBAAkB,WAC7B,SAAS,gBACP,EACE,UACA,WACA,cACA,MAAM,KACN,MAAM,GACN,eACA,kBACA,OAAO,MACP,OACA,GAAG,SAEL,KACA;CACA,MAAM,SAAS,YAAY,EAAE,KAAK,CAAC;CACnC,MAAM,gBAAgB,gBAAgB,CAAC,KAAK,GAAG;CAE/C,OACE,oBAAC,uBAAuB,UAAxB;EAAiC,OAAO;
|
|
1
|
+
{"version":3,"file":"range-slider.js","names":["BaseSlider"],"sources":["../../../src/components/range-slider/range-slider.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slider as BaseSlider } from \"@base-ui/react/slider\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { SliderRoot as BaseSliderRoot } from \"@base-ui/react/slider\";\n\nimport { rangeSlider } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type RangeSliderSize = \"sm\" | \"md\" | \"lg\";\n\nconst RangeSliderSizeContext = createContext<RangeSliderSize>(\"md\");\n\nfunction useRangeSliderStyles() {\n return rangeSlider({ size: useContext(RangeSliderSizeContext) });\n}\n\nexport interface RangeSliderRootProps\n extends Omit<\n BaseSliderRoot.Props<readonly number[]>,\n \"children\" | \"className\" | \"defaultValue\" | \"value\" | \"onValueChange\" | \"onValueCommitted\"\n > {\n value?: readonly [number, number];\n defaultValue?: readonly [number, number];\n onValueChange?: (value: readonly [number, number]) => void;\n onValueCommitted?: (value: readonly [number, number]) => void;\n size?: RangeSliderSize;\n children?: ReactNode;\n className?: string;\n}\n\nfunction asRange(values: readonly number[], min: number, max: number): readonly [number, number] {\n return [values[0] ?? min, values[1] ?? max];\n}\n\nexport const RangeSliderRoot = forwardRef<HTMLDivElement, RangeSliderRootProps>(\n function RangeSliderRoot(\n {\n children,\n className,\n defaultValue,\n max = 100,\n min = 0,\n onValueChange,\n onValueCommitted,\n size = \"md\",\n value,\n ...props\n },\n ref,\n ) {\n const styles = rangeSlider({ size });\n const fallbackValue = defaultValue ?? [min, max];\n\n return (\n <RangeSliderSizeContext.Provider value={size}>\n <BaseSlider.Root\n {...props}\n defaultValue={fallbackValue}\n max={max}\n min={min}\n onValueChange={(next) => onValueChange?.(asRange(next, min, max))}\n onValueCommitted={(next) => onValueCommitted?.(asRange(next, min, max))}\n ref={ref}\n value={value}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"range-slider\"\n data-slot=\"range-slider\"\n >\n {children}\n </BaseSlider.Root>\n </RangeSliderSizeContext.Provider>\n );\n },\n);\n\nexport type RangeSliderLabelProps = ComponentPropsWithoutRef<typeof BaseSlider.Label>;\nexport const RangeSliderLabel = forwardRef<HTMLDivElement, RangeSliderLabelProps>(\n function RangeSliderLabel({ className, ...props }, ref) {\n return (\n <BaseSlider.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().label, className)}\n data-slot=\"range-slider-label\"\n />\n );\n },\n);\n\nexport type RangeSliderValueProps = ComponentPropsWithoutRef<typeof BaseSlider.Value>;\nexport const RangeSliderValue = forwardRef<HTMLOutputElement, RangeSliderValueProps>(\n function RangeSliderValue({ className, ...props }, ref) {\n return (\n <BaseSlider.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().value, className)}\n data-slot=\"range-slider-value\"\n />\n );\n },\n);\n\nexport type RangeSliderControlProps = ComponentPropsWithoutRef<typeof BaseSlider.Control>;\nexport const RangeSliderControl = forwardRef<HTMLDivElement, RangeSliderControlProps>(\n function RangeSliderControl({ className, ...props }, ref) {\n return (\n <BaseSlider.Control\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().control, className)}\n data-slot=\"range-slider-control\"\n />\n );\n },\n);\n\nexport type RangeSliderTrackProps = ComponentPropsWithoutRef<typeof BaseSlider.Track>;\nexport const RangeSliderTrack = forwardRef<HTMLDivElement, RangeSliderTrackProps>(\n function RangeSliderTrack({ className, ...props }, ref) {\n return (\n <BaseSlider.Track\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().track, className)}\n data-slot=\"range-slider-track\"\n />\n );\n },\n);\n\nexport type RangeSliderIndicatorProps = ComponentPropsWithoutRef<typeof BaseSlider.Indicator>;\nexport const RangeSliderIndicator = forwardRef<HTMLDivElement, RangeSliderIndicatorProps>(\n function RangeSliderIndicator({ className, ...props }, ref) {\n return (\n <BaseSlider.Indicator\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().indicator, className)}\n data-slot=\"range-slider-indicator\"\n />\n );\n },\n);\n\nexport interface RangeSliderThumbProps extends ComponentPropsWithoutRef<typeof BaseSlider.Thumb> {\n index: 0 | 1;\n}\n\nexport const RangeSliderThumb = forwardRef<HTMLDivElement, RangeSliderThumbProps>(\n function RangeSliderThumb({ className, ...props }, ref) {\n return (\n <BaseSlider.Thumb\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().thumb, className)}\n data-slot=\"range-slider-thumb\"\n />\n );\n },\n);\n\nexport const RangeSlider = {\n Root: RangeSliderRoot,\n Label: RangeSliderLabel,\n Value: RangeSliderValue,\n Control: RangeSliderControl,\n Track: RangeSliderTrack,\n Indicator: RangeSliderIndicator,\n Thumb: RangeSliderThumb,\n};\n"],"mappings":";;;;;;;AAYA,MAAM,yBAAyB,cAA+B,IAAI;AAElE,SAAS,uBAAuB;CAC9B,OAAO,YAAY,EAAE,MAAM,WAAW,sBAAsB,EAAE,CAAC;AACjE;AAgBA,SAAS,QAAQ,QAA2B,KAAa,KAAwC;CAC/F,OAAO,CAAC,OAAO,MAAM,KAAK,OAAO,MAAM,GAAG;AAC5C;AAEA,MAAa,kBAAkB,WAC7B,SAAS,gBACP,EACE,UACA,WACA,cACA,MAAM,KACN,MAAM,GACN,eACA,kBAC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CAAC,OAAO,SAAS;EACtE,aAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,uBAAuB,WAClC,SAAS,qBAAqB,EAAE,WAAW,GAAG,SAAS,KAAK;CAC1D,OACE,oBAACA,OAAW,WAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,qBAAqB,CAAC,CAAC,WAAW,SAAS;EAC1E,aAAU;CACX,CAAA;AAEL,CACF;AAMA,MAAa,mBAAmB,WAC9B,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAS,KAAK;CACtD,OACE,oBAACA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,qBAAqB,CAAC,CAAC,OAAO,SAAS;EACtE,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,cAAc;CACzB,MAAM;CACN,OAAO;CACP,OAAO;CACP,SAAS;CACT,OAAO;CACP,WAAW;CACX,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-area.cjs","names":["BaseScrollArea","withRecipeClassName","scrollArea"],"sources":["../../../src/components/scroll-area/scroll-area.tsx"],"sourcesContent":["\"use client\";\n\nimport { ScrollArea as BaseScrollArea } from \"@base-ui/react/scroll-area\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { scrollArea } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type ScrollAreaRootProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Root>;\n\nexport const ScrollAreaRoot = forwardRef<HTMLDivElement, ScrollAreaRootProps>(\n function ScrollAreaRoot({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Root\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().root, className)}\n data-jaci-component=\"scroll-area\"\n data-slot=\"scroll-area\"\n />\n );\n },\n);\n\nexport type ScrollAreaViewportProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Viewport>;\n\nexport const ScrollAreaViewport = forwardRef<HTMLDivElement, ScrollAreaViewportProps>(\n function ScrollAreaViewport({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().viewport, className)}\n data-slot=\"scroll-area-viewport\"\n />\n );\n },\n);\n\nexport type ScrollAreaContentProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Content>;\n\nexport const ScrollAreaContent = forwardRef<HTMLDivElement, ScrollAreaContentProps>(\n function ScrollAreaContent({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Content\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().content, className)}\n data-slot=\"scroll-area-content\"\n />\n );\n },\n);\n\nexport type ScrollAreaScrollbarProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Scrollbar>;\n\nexport const ScrollAreaScrollbar = forwardRef<HTMLDivElement, ScrollAreaScrollbarProps>(\n function ScrollAreaScrollbar({ className, orientation = \"vertical\", ...props }, ref) {\n return (\n <BaseScrollArea.Scrollbar\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().scrollbar, className)}\n data-orientation={orientation}\n data-slot=\"scroll-area-scrollbar\"\n orientation={orientation}\n />\n );\n },\n);\n\nexport type ScrollAreaThumbProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Thumb>;\n\nexport const ScrollAreaThumb = forwardRef<HTMLDivElement, ScrollAreaThumbProps>(\n function ScrollAreaThumb({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Thumb\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().thumb, className)}\n data-slot=\"scroll-area-thumb\"\n />\n );\n },\n);\n\nexport type ScrollAreaCornerProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Corner>;\n\nexport const ScrollAreaCorner = forwardRef<HTMLDivElement, ScrollAreaCornerProps>(\n function ScrollAreaCorner({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Corner\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().corner, className)}\n data-slot=\"scroll-area-corner\"\n />\n );\n },\n);\n\nexport const ScrollArea = {\n Root: ScrollAreaRoot,\n Viewport: ScrollAreaViewport,\n Content: ScrollAreaContent,\n Scrollbar: ScrollAreaScrollbar,\n Thumb: ScrollAreaThumb,\n Corner: ScrollAreaCorner,\n};\n"],"mappings":";;;;;;;AAWA,MAAa,kBAAA,
|
|
1
|
+
{"version":3,"file":"scroll-area.cjs","names":["forwardRef","BaseScrollArea","withRecipeClassName","scrollArea"],"sources":["../../../src/components/scroll-area/scroll-area.tsx"],"sourcesContent":["\"use client\";\n\nimport { ScrollArea as BaseScrollArea } from \"@base-ui/react/scroll-area\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { scrollArea } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type ScrollAreaRootProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Root>;\n\nexport const ScrollAreaRoot = forwardRef<HTMLDivElement, ScrollAreaRootProps>(\n function ScrollAreaRoot({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Root\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().root, className)}\n data-jaci-component=\"scroll-area\"\n data-slot=\"scroll-area\"\n />\n );\n },\n);\n\nexport type ScrollAreaViewportProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Viewport>;\n\nexport const ScrollAreaViewport = forwardRef<HTMLDivElement, ScrollAreaViewportProps>(\n function ScrollAreaViewport({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().viewport, className)}\n data-slot=\"scroll-area-viewport\"\n />\n );\n },\n);\n\nexport type ScrollAreaContentProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Content>;\n\nexport const ScrollAreaContent = forwardRef<HTMLDivElement, ScrollAreaContentProps>(\n function ScrollAreaContent({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Content\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().content, className)}\n data-slot=\"scroll-area-content\"\n />\n );\n },\n);\n\nexport type ScrollAreaScrollbarProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Scrollbar>;\n\nexport const ScrollAreaScrollbar = forwardRef<HTMLDivElement, ScrollAreaScrollbarProps>(\n function ScrollAreaScrollbar({ className, orientation = \"vertical\", ...props }, ref) {\n return (\n <BaseScrollArea.Scrollbar\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().scrollbar, className)}\n data-orientation={orientation}\n data-slot=\"scroll-area-scrollbar\"\n orientation={orientation}\n />\n );\n },\n);\n\nexport type ScrollAreaThumbProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Thumb>;\n\nexport const ScrollAreaThumb = forwardRef<HTMLDivElement, ScrollAreaThumbProps>(\n function ScrollAreaThumb({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Thumb\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().thumb, className)}\n data-slot=\"scroll-area-thumb\"\n />\n );\n },\n);\n\nexport type ScrollAreaCornerProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Corner>;\n\nexport const ScrollAreaCorner = forwardRef<HTMLDivElement, ScrollAreaCornerProps>(\n function ScrollAreaCorner({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Corner\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().corner, className)}\n data-slot=\"scroll-area-corner\"\n />\n );\n },\n);\n\nexport const ScrollArea = {\n Root: ScrollAreaRoot,\n Viewport: ScrollAreaViewport,\n Content: ScrollAreaContent,\n Scrollbar: ScrollAreaScrollbar,\n Thumb: ScrollAreaThumb,\n Corner: ScrollAreaCorner,\n};\n"],"mappings":";;;;;;;AAWA,MAAa,kBAAA,GAAiBA,MAAAA,WAAAA,CAC5B,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CACpD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,2BAAAA,WAAe,MAAhB;EACE,GAAI;EACC;EACL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CACX,CAAA;AAEL,CACF;AAIA,MAAa,oBAAA,GAAmBH,MAAAA,WAAAA,CAC9B,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAS,KAAK;CACtD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,2BAAAA,WAAe,QAAhB;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoBC,oBAAAA,WAAW,CAAC,CAAC,QAAQ,SAAS;EAC7D,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,aAAa;CACxB,MAAM;CACN,UAAU;CACV,SAAS;CACT,WAAW;CACX,OAAO;CACP,QAAQ;AACV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.cjs","names":["select","BaseSelect","withRecipeClassName","useThemePortalProps","cx"],"sources":["../../../src/components/select/select.tsx"],"sourcesContent":["\"use client\";\n\nimport { Select as BaseSelect } from \"@base-ui/react/select\";\nimport { createContext, forwardRef, useContext, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { SelectRoot as BaseSelectRoot } from \"@base-ui/react/select\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { select } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\nexport type SelectSize = \"sm\" | \"md\" | \"lg\";\n\nconst SelectSizeContext = createContext<SelectSize>(\"md\");\nconst SelectAuxContext = createContext<{ clear: () => void; disabled: boolean } | null>(null);\n\nfunction useSelectStyles() {\n return select({ size: useContext(SelectSizeContext) });\n}\n\n/**\n * Groups an accessible listbox select. Use `value`/`onValueChange` for a\n * controlled selection, or `defaultValue` for an uncontrolled selection.\n *\n * `size` is shared by all visual parts so the trigger stays aligned with the\n * library's `Input` component.\n */\nexport interface SelectRootProps<Value, Multiple extends boolean | undefined = false>\n extends BaseSelectRoot.Props<Value, Multiple> {\n size?: SelectSize;\n loading?: boolean;\n}\n\nexport function SelectRoot<Value = unknown, Multiple extends boolean | undefined = false>({\n defaultValue,\n disabled = false,\n loading: _loading,\n multiple,\n onValueChange,\n size = \"md\",\n value: controlledValue,\n ...props\n}: SelectRootProps<Value, Multiple>) {\n const [uncontrolledValue, setUncontrolledValue] = useState<unknown>(\n defaultValue ?? (multiple ? [] : null),\n );\n const value = controlledValue === undefined ? uncontrolledValue : controlledValue;\n const clear = () => {\n const nextValue = multiple ? [] : null;\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue as never, undefined as never);\n };\n return (\n <SelectSizeContext.Provider value={size}>\n <SelectAuxContext.Provider value={{ clear, disabled }}>\n <BaseSelect.Root\n {...props}\n disabled={disabled}\n defaultValue={undefined}\n multiple={multiple}\n onValueChange={(nextValue, details) => {\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue, details);\n }}\n value={value as SelectRootProps<Value, Multiple>[\"value\"]}\n />\n </SelectAuxContext.Provider>\n </SelectSizeContext.Provider>\n );\n}\n\nexport type SelectLabelProps = ComponentPropsWithoutRef<typeof BaseSelect.Label>;\n\n/** An accessible label that Base UI associates with the trigger automatically. */\nexport const SelectLabel = forwardRef<HTMLDivElement, SelectLabelProps>(function SelectLabel(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().label, className)}\n data-slot=\"select-label\"\n />\n );\n});\n\nexport type SelectTriggerProps = ComponentPropsWithoutRef<typeof BaseSelect.Trigger>;\n\n/** The button-shaped control that opens the select popup. */\nexport const SelectTrigger = forwardRef<HTMLButtonElement, SelectTriggerProps>(\n function SelectTrigger({ className, ...props }, ref) {\n return (\n <BaseSelect.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().trigger, className)}\n data-jaci-component=\"select\"\n data-slot=\"select-trigger\"\n />\n );\n },\n);\n\nexport type SelectValueProps = ComponentPropsWithoutRef<typeof BaseSelect.Value>;\n\n/** Renders the selected item's label, or its placeholder when empty. */\nexport const SelectValue = forwardRef<HTMLSpanElement, SelectValueProps>(function SelectValue(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().value, className)}\n data-slot=\"select-value\"\n />\n );\n});\n\nexport type SelectIconProps = ComponentPropsWithoutRef<typeof BaseSelect.Icon>;\n\n/** A small chevron that rotates while the popup is open. */\nexport const SelectIcon = forwardRef<HTMLSpanElement, SelectIconProps>(function SelectIcon(\n { children = \"⌄\", className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Icon\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={withRecipeClassName(useSelectStyles().icon, className)}\n data-slot=\"select-icon\"\n >\n {children}\n </BaseSelect.Icon>\n );\n});\n\n/** Preserves Base UI's optional portal container and mount controls. */\nexport function SelectPortal(props: ComponentPropsWithoutRef<typeof BaseSelect.Portal>) {\n return <BaseSelect.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type SelectPositionerProps = ComponentPropsWithoutRef<typeof BaseSelect.Positioner>;\n\nexport const SelectPositioner = forwardRef<HTMLDivElement, SelectPositionerProps>(\n function SelectPositioner({ className, ...props }, ref) {\n return (\n <BaseSelect.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().positioner, className)}\n data-slot=\"select-positioner\"\n />\n );\n },\n);\n\nexport type SelectPopupProps = ComponentPropsWithoutRef<typeof BaseSelect.Popup>;\n\nexport const SelectPopup = forwardRef<HTMLDivElement, SelectPopupProps>(function SelectPopup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().popup, className)}\n data-slot=\"select-popup\"\n />\n );\n});\n\nexport type SelectListProps = ComponentPropsWithoutRef<typeof BaseSelect.List>;\n\nexport const SelectList = forwardRef<HTMLDivElement, SelectListProps>(function SelectList(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.List\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().list, className)}\n data-slot=\"select-list\"\n />\n );\n});\n\nexport type SelectItemProps = ComponentPropsWithoutRef<typeof BaseSelect.Item>;\n\nexport const SelectItem = forwardRef<HTMLElement, SelectItemProps>(function SelectItem(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().item, className)}\n data-slot=\"select-item\"\n />\n );\n});\n\nexport type SelectItemTextProps = ComponentPropsWithoutRef<typeof BaseSelect.ItemText>;\n\nexport const SelectItemText = forwardRef<HTMLDivElement, SelectItemTextProps>(\n function SelectItemText({ className, ...props }, ref) {\n return (\n <BaseSelect.ItemText\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().itemText, className)}\n data-slot=\"select-item-text\"\n />\n );\n },\n);\n\nexport type SelectItemIndicatorProps = ComponentPropsWithoutRef<typeof BaseSelect.ItemIndicator>;\n\nexport const SelectItemIndicator = forwardRef<HTMLSpanElement, SelectItemIndicatorProps>(\n function SelectItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <BaseSelect.ItemIndicator\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={withRecipeClassName(useSelectStyles().itemIndicator, className)}\n data-slot=\"select-item-indicator\"\n >\n {children}\n </BaseSelect.ItemIndicator>\n );\n },\n);\n\nexport type SelectGroupProps = ComponentPropsWithoutRef<typeof BaseSelect.Group>;\n\nexport const SelectGroup = forwardRef<HTMLDivElement, SelectGroupProps>(function SelectGroup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Group\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().group, className)}\n data-slot=\"select-group\"\n />\n );\n});\n\nexport type SelectGroupLabelProps = ComponentPropsWithoutRef<typeof BaseSelect.GroupLabel>;\n\nexport const SelectGroupLabel = forwardRef<HTMLDivElement, SelectGroupLabelProps>(\n function SelectGroupLabel({ className, ...props }, ref) {\n return (\n <BaseSelect.GroupLabel\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().groupLabel, className)}\n data-slot=\"select-group-label\"\n />\n );\n },\n);\n\n/**\n * A visual separator for groups in a listbox. It is intentionally hidden from\n * assistive technology because ARIA listboxes may only contain options or\n * option groups, not semantic separators.\n */\nexport interface SelectSeparatorProps extends ComponentPropsWithoutRef<\"div\"> {\n orientation?: \"horizontal\" | \"vertical\";\n}\n\nexport const SelectSeparator = forwardRef<HTMLDivElement, SelectSeparatorProps>(\n function SelectSeparator({ className, orientation = \"horizontal\", ...props }, ref) {\n return (\n <div\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={cx(useSelectStyles().separator, className)}\n data-orientation={orientation}\n data-slot=\"select-separator\"\n />\n );\n },\n);\n\nexport interface SelectClearProps extends ComponentPropsWithoutRef<\"button\"> {\n children?: ReactNode;\n}\nexport const SelectClear = forwardRef<HTMLButtonElement, SelectClearProps>(function SelectClear(\n { children = \"×\", className, ...props },\n ref,\n) {\n const context = useContext(SelectAuxContext);\n const styles = useSelectStyles();\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n className={cx(styles.clear, className)}\n data-slot=\"select-clear\"\n disabled={props.disabled || context?.disabled}\n onClick={(event) => {\n context?.clear();\n props.onClick?.(event);\n }}\n ref={ref}\n type=\"button\"\n >\n {children}\n </button>\n );\n});\n\nexport type SelectEmptyProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectEmpty = forwardRef<HTMLDivElement, SelectEmptyProps>(function SelectEmpty(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n className={cx(useSelectStyles().empty, className)}\n data-slot=\"select-empty\"\n ref={ref}\n />\n );\n});\nexport type SelectLoadingProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectLoading = forwardRef<HTMLDivElement, SelectLoadingProps>(function SelectLoading(\n { children = \"Loading…\", className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n aria-live=\"polite\"\n className={cx(useSelectStyles().loading, className)}\n data-slot=\"select-loading\"\n ref={ref}\n >\n {children}\n </div>\n );\n});\nexport type SelectStatusProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectStatus = forwardRef<HTMLDivElement, SelectStatusProps>(function SelectStatus(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n aria-live=\"polite\"\n className={cx(useSelectStyles().status, className)}\n data-slot=\"select-status\"\n ref={ref}\n />\n );\n});\n\nexport const Select = {\n Root: SelectRoot,\n Label: SelectLabel,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Icon: SelectIcon,\n Portal: SelectPortal,\n Positioner: SelectPositioner,\n Popup: SelectPopup,\n List: SelectList,\n Item: SelectItem,\n ItemText: SelectItemText,\n ItemIndicator: SelectItemIndicator,\n Group: SelectGroup,\n GroupLabel: SelectGroupLabel,\n Separator: SelectSeparator,\n Clear: SelectClear,\n Empty: SelectEmpty,\n Loading: SelectLoading,\n Status: SelectStatus,\n};\n"],"mappings":";;;;;;;;;AAcA,MAAM,qBAAA,GAAA,MAAA,cAAA,CAA8C,IAAI;AACxD,MAAM,oBAAA,GAAA,MAAA,cAAA,CAAkF,IAAI;AAE5F,SAAS,kBAAkB;CACzB,OAAOA,eAAAA,OAAO,EAAE,OAAA,GAAA,MAAA,WAAA,CAAiB,iBAAiB,EAAE,CAAC;AACvD;AAeA,SAAgB,WAA0E,EACxF,cACA,WAAW,OACX,SAAS,UACT,UACA,eACA,OAAO,MACP,OAAO,iBACP,GAAG,SACgC;CACnC,MAAM,CAAC,mBAAmB,yBAAA,GAAA,MAAA,SAAA,CACxB,iBAAiB,WAAW,CAAC,IAAI,KACnC;CACA,MAAM,QAAQ,oBAAoB,KAAA,IAAY,oBAAoB;CAClE,MAAM,cAAc;EAClB,MAAM,YAAY,WAAW,CAAC,IAAI;EAClC,IAAI,oBAAoB,KAAA,GAAW,qBAAqB,SAAS;EACjE,gBAAgB,WAAoB,KAAA,CAAkB;CACxD;CACA,OACE,iBAAA,GAAA,kBAAA,IAA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AAS,SAAS;EAClD,aAAU;EACL;EAEJ;CACE,CAAA;AAET,CAAC;AAED,MAAa,gBAAA,GAAA,MAAA,WAAA,CAA6D,SAAS,aACjF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACJ,aAAU;EACV,WAAWA,WAAAA,GAAG,gBAAgB,CAAC,CAAC,QAAQ,SAAS;EACjD,aAAU;EACL;CACN,CAAA;AAEL,CAAC;AAED,MAAa,SAAS;CACpB,MAAM;CACN,OAAO;CACP,SAAS;CACT,OAAO;CACP,MAAM;CACN,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,MAAM;CACN,MAAM;CACN,UAAU;CACV,eAAe;CACf,OAAO;CACP,YAAY;CACZ,WAAW;CACX,OAAO;CACP,OAAO;CACP,SAAS;CACT,QAAQ;AACV"}
|
|
1
|
+
{"version":3,"file":"select.cjs","names":["createContext","select","useContext","useState","BaseSelect","forwardRef","withRecipeClassName","useThemePortalProps","cx"],"sources":["../../../src/components/select/select.tsx"],"sourcesContent":["\"use client\";\n\nimport { Select as BaseSelect } from \"@base-ui/react/select\";\nimport { createContext, forwardRef, useContext, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { SelectRoot as BaseSelectRoot } from \"@base-ui/react/select\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { select } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\nexport type SelectSize = \"sm\" | \"md\" | \"lg\";\n\nconst SelectSizeContext = createContext<SelectSize>(\"md\");\nconst SelectAuxContext = createContext<{ clear: () => void; disabled: boolean } | null>(null);\n\nfunction useSelectStyles() {\n return select({ size: useContext(SelectSizeContext) });\n}\n\n/**\n * Groups an accessible listbox select. Use `value`/`onValueChange` for a\n * controlled selection, or `defaultValue` for an uncontrolled selection.\n *\n * `size` is shared by all visual parts so the trigger stays aligned with the\n * library's `Input` component.\n */\nexport interface SelectRootProps<Value, Multiple extends boolean | undefined = false>\n extends BaseSelectRoot.Props<Value, Multiple> {\n size?: SelectSize;\n loading?: boolean;\n}\n\nexport function SelectRoot<Value = unknown, Multiple extends boolean | undefined = false>({\n defaultValue,\n disabled = false,\n loading: _loading,\n multiple,\n onValueChange,\n size = \"md\",\n value: controlledValue,\n ...props\n}: SelectRootProps<Value, Multiple>) {\n const [uncontrolledValue, setUncontrolledValue] = useState<unknown>(\n defaultValue ?? (multiple ? [] : null),\n );\n const value = controlledValue === undefined ? uncontrolledValue : controlledValue;\n const clear = () => {\n const nextValue = multiple ? [] : null;\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue as never, undefined as never);\n };\n return (\n <SelectSizeContext.Provider value={size}>\n <SelectAuxContext.Provider value={{ clear, disabled }}>\n <BaseSelect.Root\n {...props}\n disabled={disabled}\n defaultValue={undefined}\n multiple={multiple}\n onValueChange={(nextValue, details) => {\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue, details);\n }}\n value={value as SelectRootProps<Value, Multiple>[\"value\"]}\n />\n </SelectAuxContext.Provider>\n </SelectSizeContext.Provider>\n );\n}\n\nexport type SelectLabelProps = ComponentPropsWithoutRef<typeof BaseSelect.Label>;\n\n/** An accessible label that Base UI associates with the trigger automatically. */\nexport const SelectLabel = forwardRef<HTMLDivElement, SelectLabelProps>(function SelectLabel(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().label, className)}\n data-slot=\"select-label\"\n />\n );\n});\n\nexport type SelectTriggerProps = ComponentPropsWithoutRef<typeof BaseSelect.Trigger>;\n\n/** The button-shaped control that opens the select popup. */\nexport const SelectTrigger = forwardRef<HTMLButtonElement, SelectTriggerProps>(\n function SelectTrigger({ className, ...props }, ref) {\n return (\n <BaseSelect.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().trigger, className)}\n data-jaci-component=\"select\"\n data-slot=\"select-trigger\"\n />\n );\n },\n);\n\nexport type SelectValueProps = ComponentPropsWithoutRef<typeof BaseSelect.Value>;\n\n/** Renders the selected item's label, or its placeholder when empty. */\nexport const SelectValue = forwardRef<HTMLSpanElement, SelectValueProps>(function SelectValue(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().value, className)}\n data-slot=\"select-value\"\n />\n );\n});\n\nexport type SelectIconProps = ComponentPropsWithoutRef<typeof BaseSelect.Icon>;\n\n/** A small chevron that rotates while the popup is open. */\nexport const SelectIcon = forwardRef<HTMLSpanElement, SelectIconProps>(function SelectIcon(\n { children = \"⌄\", className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Icon\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={withRecipeClassName(useSelectStyles().icon, className)}\n data-slot=\"select-icon\"\n >\n {children}\n </BaseSelect.Icon>\n );\n});\n\n/** Preserves Base UI's optional portal container and mount controls. */\nexport function SelectPortal(props: ComponentPropsWithoutRef<typeof BaseSelect.Portal>) {\n return <BaseSelect.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type SelectPositionerProps = ComponentPropsWithoutRef<typeof BaseSelect.Positioner>;\n\nexport const SelectPositioner = forwardRef<HTMLDivElement, SelectPositionerProps>(\n function SelectPositioner({ className, ...props }, ref) {\n return (\n <BaseSelect.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().positioner, className)}\n data-slot=\"select-positioner\"\n />\n );\n },\n);\n\nexport type SelectPopupProps = ComponentPropsWithoutRef<typeof BaseSelect.Popup>;\n\nexport const SelectPopup = forwardRef<HTMLDivElement, SelectPopupProps>(function SelectPopup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().popup, className)}\n data-slot=\"select-popup\"\n />\n );\n});\n\nexport type SelectListProps = ComponentPropsWithoutRef<typeof BaseSelect.List>;\n\nexport const SelectList = forwardRef<HTMLDivElement, SelectListProps>(function SelectList(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.List\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().list, className)}\n data-slot=\"select-list\"\n />\n );\n});\n\nexport type SelectItemProps = ComponentPropsWithoutRef<typeof BaseSelect.Item>;\n\nexport const SelectItem = forwardRef<HTMLElement, SelectItemProps>(function SelectItem(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().item, className)}\n data-slot=\"select-item\"\n />\n );\n});\n\nexport type SelectItemTextProps = ComponentPropsWithoutRef<typeof BaseSelect.ItemText>;\n\nexport const SelectItemText = forwardRef<HTMLDivElement, SelectItemTextProps>(\n function SelectItemText({ className, ...props }, ref) {\n return (\n <BaseSelect.ItemText\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().itemText, className)}\n data-slot=\"select-item-text\"\n />\n );\n },\n);\n\nexport type SelectItemIndicatorProps = ComponentPropsWithoutRef<typeof BaseSelect.ItemIndicator>;\n\nexport const SelectItemIndicator = forwardRef<HTMLSpanElement, SelectItemIndicatorProps>(\n function SelectItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <BaseSelect.ItemIndicator\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={withRecipeClassName(useSelectStyles().itemIndicator, className)}\n data-slot=\"select-item-indicator\"\n >\n {children}\n </BaseSelect.ItemIndicator>\n );\n },\n);\n\nexport type SelectGroupProps = ComponentPropsWithoutRef<typeof BaseSelect.Group>;\n\nexport const SelectGroup = forwardRef<HTMLDivElement, SelectGroupProps>(function SelectGroup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Group\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().group, className)}\n data-slot=\"select-group\"\n />\n );\n});\n\nexport type SelectGroupLabelProps = ComponentPropsWithoutRef<typeof BaseSelect.GroupLabel>;\n\nexport const SelectGroupLabel = forwardRef<HTMLDivElement, SelectGroupLabelProps>(\n function SelectGroupLabel({ className, ...props }, ref) {\n return (\n <BaseSelect.GroupLabel\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().groupLabel, className)}\n data-slot=\"select-group-label\"\n />\n );\n },\n);\n\n/**\n * A visual separator for groups in a listbox. It is intentionally hidden from\n * assistive technology because ARIA listboxes may only contain options or\n * option groups, not semantic separators.\n */\nexport interface SelectSeparatorProps extends ComponentPropsWithoutRef<\"div\"> {\n orientation?: \"horizontal\" | \"vertical\";\n}\n\nexport const SelectSeparator = forwardRef<HTMLDivElement, SelectSeparatorProps>(\n function SelectSeparator({ className, orientation = \"horizontal\", ...props }, ref) {\n return (\n <div\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={cx(useSelectStyles().separator, className)}\n data-orientation={orientation}\n data-slot=\"select-separator\"\n />\n );\n },\n);\n\nexport interface SelectClearProps extends ComponentPropsWithoutRef<\"button\"> {\n children?: ReactNode;\n}\nexport const SelectClear = forwardRef<HTMLButtonElement, SelectClearProps>(function SelectClear(\n { children = \"×\", className, ...props },\n ref,\n) {\n const context = useContext(SelectAuxContext);\n const styles = useSelectStyles();\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n className={cx(styles.clear, className)}\n data-slot=\"select-clear\"\n disabled={props.disabled || context?.disabled}\n onClick={(event) => {\n context?.clear();\n props.onClick?.(event);\n }}\n ref={ref}\n type=\"button\"\n >\n {children}\n </button>\n );\n});\n\nexport type SelectEmptyProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectEmpty = forwardRef<HTMLDivElement, SelectEmptyProps>(function SelectEmpty(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n className={cx(useSelectStyles().empty, className)}\n data-slot=\"select-empty\"\n ref={ref}\n />\n );\n});\nexport type SelectLoadingProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectLoading = forwardRef<HTMLDivElement, SelectLoadingProps>(function SelectLoading(\n { children = \"Loading…\", className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n aria-live=\"polite\"\n className={cx(useSelectStyles().loading, className)}\n data-slot=\"select-loading\"\n ref={ref}\n >\n {children}\n </div>\n );\n});\nexport type SelectStatusProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectStatus = forwardRef<HTMLDivElement, SelectStatusProps>(function SelectStatus(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n aria-live=\"polite\"\n className={cx(useSelectStyles().status, className)}\n data-slot=\"select-status\"\n ref={ref}\n />\n );\n});\n\nexport const Select = {\n Root: SelectRoot,\n Label: SelectLabel,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Icon: SelectIcon,\n Portal: SelectPortal,\n Positioner: SelectPositioner,\n Popup: SelectPopup,\n List: SelectList,\n Item: SelectItem,\n ItemText: SelectItemText,\n ItemIndicator: SelectItemIndicator,\n Group: SelectGroup,\n GroupLabel: SelectGroupLabel,\n Separator: SelectSeparator,\n Clear: SelectClear,\n Empty: SelectEmpty,\n Loading: SelectLoading,\n Status: SelectStatus,\n};\n"],"mappings":";;;;;;;;;AAcA,MAAM,qBAAA,GAAoBA,MAAAA,cAAAA,CAA0B,IAAI;AACxD,MAAM,oBAAA,GAAmBA,MAAAA,cAAAA,CAA+D,IAAI;AAE5F,SAAS,kBAAkB;CACzB,OAAOC,eAAAA,OAAO,EAAE,OAAA,GAAMC,MAAAA,WAAAA,CAAW,iBAAiB,EAAE,CAAC;AACvD;AAeA,SAAgB,WAA0E,EACxF,cACA,WAAW,OACX,SAAS,UACT,UACA,eACA,OAAO,MACP,OAAO,iBACP,GAAG,SACgC;CACnC,MAAM,CAAC,mBAAmB,yBAAA,GAAwBC,MAAAA,SAAAA,CAChD,iBAAiB,WAAW,CAAC,IAAI,KACnC;CACA,MAAM,QAAQ,oBAAoB,KAAA,IAAY,oBAAoB;CAClE,M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