jaci-ui 0.9.4 → 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 +12 -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/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/styles.css +0 -21
- 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":"switch.cjs","names":["BaseSwitch","cx","toggleSwitch"],"sources":["../../../src/components/controls/switch.tsx"],"sourcesContent":["\"use client\";\n\nimport { Switch as BaseSwitch } from \"@base-ui/react/switch\";\nimport { forwardRef } from \"react\";\nimport type { Ref } from \"react\";\nimport type { SwitchRoot as BaseSwitchRoot } from \"@base-ui/react/switch\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { toggleSwitch } from \"../../styled-system/recipes\";\n\nexport interface SwitchProps\n extends Omit<BaseSwitchRoot.Props, \"children\" | \"className\" | \"onCheckedChange\" | \"render\"> {\n className?: string;\n onCheckedChange?: (checked: boolean) => void;\n}\n\nexport const Switch = forwardRef<HTMLButtonElement, SwitchProps>(function Switch(\n { checked, className, disabled, onCheckedChange, ...props },\n ref,\n) {\n return (\n <BaseSwitch.Root\n {...props}\n checked={checked}\n disabled={disabled}\n nativeButton\n render={<button type=\"button\" />}\n ref={ref as Ref<HTMLElement>}\n className={(state) => cx(toggleSwitch({ checked: state.checked }).root, className)}\n onCheckedChange={(nextChecked) => onCheckedChange?.(nextChecked)}\n data-jaci-component=\"switch\"\n data-slot=\"switch\"\n >\n <BaseSwitch.Thumb\n aria-hidden=\"true\"\n className={(state) => cx(toggleSwitch({ checked: state.checked }).thumb)}\n data-slot=\"switch-thumb\"\n />\n </BaseSwitch.Root>\n );\n});\n"],"mappings":";;;;;;;AAgBA,MAAa,UAAA,
|
|
1
|
+
{"version":3,"file":"switch.cjs","names":["forwardRef","BaseSwitch","cx","toggleSwitch"],"sources":["../../../src/components/controls/switch.tsx"],"sourcesContent":["\"use client\";\n\nimport { Switch as BaseSwitch } from \"@base-ui/react/switch\";\nimport { forwardRef } from \"react\";\nimport type { Ref } from \"react\";\nimport type { SwitchRoot as BaseSwitchRoot } from \"@base-ui/react/switch\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { toggleSwitch } from \"../../styled-system/recipes\";\n\nexport interface SwitchProps\n extends Omit<BaseSwitchRoot.Props, \"children\" | \"className\" | \"onCheckedChange\" | \"render\"> {\n className?: string;\n onCheckedChange?: (checked: boolean) => void;\n}\n\nexport const Switch = forwardRef<HTMLButtonElement, SwitchProps>(function Switch(\n { checked, className, disabled, onCheckedChange, ...props },\n ref,\n) {\n return (\n <BaseSwitch.Root\n {...props}\n checked={checked}\n disabled={disabled}\n nativeButton\n render={<button type=\"button\" />}\n ref={ref as Ref<HTMLElement>}\n className={(state) => cx(toggleSwitch({ checked: state.checked }).root, className)}\n onCheckedChange={(nextChecked) => onCheckedChange?.(nextChecked)}\n data-jaci-component=\"switch\"\n data-slot=\"switch\"\n >\n <BaseSwitch.Thumb\n aria-hidden=\"true\"\n className={(state) => cx(toggleSwitch({ checked: state.checked }).thumb)}\n data-slot=\"switch-thumb\"\n />\n </BaseSwitch.Root>\n );\n});\n"],"mappings":";;;;;;;AAgBA,MAAa,UAAA,GAASA,MAAAA,WAAAA,CAA2C,SAAS,OACxE,EAAE,SAAS,WAAW,UAAU,iBAAiB,GAAG,SACpD,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,OAAW,MAAZ;EACE,GAAI;EACK;EACC;EACV,cAAA;EACA,QAAQ,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD,EAAQ,MAAK,SAAU,CAAA;EAC1B;EACL,YAAY,UAAUC,WAAAA,GAAGC,sBAAAA,aAAa,EAAE,SAAS,MAAM,QAAQ,CAAC,CAAC,CAAC,MAAM,SAAS;EACjF,kBAAkB,gBAAgB,kBAAkB,WAAW;EAC/D,uBAAoB;EACpB,aAAU;EAEV,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACF,sBAAAA,OAAW,OAAZ;GACE,eAAY;GACZ,YAAY,UAAUC,WAAAA,GAAGC,sBAAAA,aAAa,EAAE,SAAS,MAAM,QAAQ,CAAC,CAAC,CAAC,KAAK;GACvE,aAAU;EACX,CAAA;CACc,CAAA;AAErB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.js","names":["Switch","BaseSwitch"],"sources":["../../../src/components/controls/switch.tsx"],"sourcesContent":["\"use client\";\n\nimport { Switch as BaseSwitch } from \"@base-ui/react/switch\";\nimport { forwardRef } from \"react\";\nimport type { Ref } from \"react\";\nimport type { SwitchRoot as BaseSwitchRoot } from \"@base-ui/react/switch\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { toggleSwitch } from \"../../styled-system/recipes\";\n\nexport interface SwitchProps\n extends Omit<BaseSwitchRoot.Props, \"children\" | \"className\" | \"onCheckedChange\" | \"render\"> {\n className?: string;\n onCheckedChange?: (checked: boolean) => void;\n}\n\nexport const Switch = forwardRef<HTMLButtonElement, SwitchProps>(function Switch(\n { checked, className, disabled, onCheckedChange, ...props },\n ref,\n) {\n return (\n <BaseSwitch.Root\n {...props}\n checked={checked}\n disabled={disabled}\n nativeButton\n render={<button type=\"button\" />}\n ref={ref as Ref<HTMLElement>}\n className={(state) => cx(toggleSwitch({ checked: state.checked }).root, className)}\n onCheckedChange={(nextChecked) => onCheckedChange?.(nextChecked)}\n data-jaci-component=\"switch\"\n data-slot=\"switch\"\n >\n <BaseSwitch.Thumb\n aria-hidden=\"true\"\n className={(state) => cx(toggleSwitch({ checked: state.checked }).thumb)}\n data-slot=\"switch-thumb\"\n />\n </BaseSwitch.Root>\n );\n});\n"],"mappings":";;;;;;;AAgBA,MAAaA,WAAS,WAA2C,SAASA,SACxE,EAAE,SAAS,WAAW,UAAU,iBAAiB,GAAG,SACpD,KACA;CACA,OACE,oBAACC,OAAW,MAAZ;EACE,GAAI;EACK;EACC;EACV,cAAA;EACA,QAAQ,oBAAC,UAAD,EAAQ,MAAK,SAAU,CAAA;EAC1B;EACL,YAAY,UAAU,GAAG,aAAa,EAAE,SAAS,MAAM,QAAQ,CAAC,CAAC,CAAC,MAAM,SAAS;EACjF,kBAAkB,gBAAgB,kBAAkB,WAAW;EAC/D,uBAAoB;EACpB,aAAU;
|
|
1
|
+
{"version":3,"file":"switch.js","names":["Switch","BaseSwitch"],"sources":["../../../src/components/controls/switch.tsx"],"sourcesContent":["\"use client\";\n\nimport { Switch as BaseSwitch } from \"@base-ui/react/switch\";\nimport { forwardRef } from \"react\";\nimport type { Ref } from \"react\";\nimport type { SwitchRoot as BaseSwitchRoot } from \"@base-ui/react/switch\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { toggleSwitch } from \"../../styled-system/recipes\";\n\nexport interface SwitchProps\n extends Omit<BaseSwitchRoot.Props, \"children\" | \"className\" | \"onCheckedChange\" | \"render\"> {\n className?: string;\n onCheckedChange?: (checked: boolean) => void;\n}\n\nexport const Switch = forwardRef<HTMLButtonElement, SwitchProps>(function Switch(\n { checked, className, disabled, onCheckedChange, ...props },\n ref,\n) {\n return (\n <BaseSwitch.Root\n {...props}\n checked={checked}\n disabled={disabled}\n nativeButton\n render={<button type=\"button\" />}\n ref={ref as Ref<HTMLElement>}\n className={(state) => cx(toggleSwitch({ checked: state.checked }).root, className)}\n onCheckedChange={(nextChecked) => onCheckedChange?.(nextChecked)}\n data-jaci-component=\"switch\"\n data-slot=\"switch\"\n >\n <BaseSwitch.Thumb\n aria-hidden=\"true\"\n className={(state) => cx(toggleSwitch({ checked: state.checked }).thumb)}\n data-slot=\"switch-thumb\"\n />\n </BaseSwitch.Root>\n );\n});\n"],"mappings":";;;;;;;AAgBA,MAAaA,WAAS,WAA2C,SAASA,SACxE,EAAE,SAAS,WAAW,UAAU,iBAAiB,GAAG,SACpD,KACA;CACA,OACE,oBAACC,OAAW,MAAZ;EACE,GAAI;EACK;EACC;EACV,cAAA;EACA,QAAQ,oBAAC,UAAD,EAAQ,MAAK,SAAU,CAAA;EAC1B;EACL,YAAY,UAAU,GAAG,aAAa,EAAE,SAAS,MAAM,QAAQ,CAAC,CAAC,CAAC,MAAM,SAAS;EACjF,kBAAkB,gBAAgB,kBAAkB,WAAW;EAC/D,uBAAoB;EACpB,aAAU;EAEV,UAAA,oBAACA,OAAW,OAAZ;GACE,eAAY;GACZ,YAAY,UAAU,GAAG,aAAa,EAAE,SAAS,MAAM,QAAQ,CAAC,CAAC,CAAC,KAAK;GACvE,aAAU;EACX,CAAA;CACc,CAAA;AAErB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.cjs","names":["useFieldState","cx","textarea","FieldControl","InputGroup","Spinner"],"sources":["../../../src/components/controls/textarea.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\nimport type { ComponentProps, ComponentPropsWithoutRef, ReactNode, Ref } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { textarea } from \"../../styled-system/recipes\";\nimport { FieldControl, useFieldState } from \"../field\";\nimport { InputGroup } from \"../input-group\";\nimport { Spinner } from \"../layout\";\n\nexport interface TextareaProps extends Omit<ComponentPropsWithoutRef<\"textarea\">, \"prefix\"> {\n size?: \"sm\" | \"md\" | \"lg\";\n prefix?: ReactNode;\n suffix?: ReactNode;\n loading?: boolean;\n}\n\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n { className, loading = false, prefix, size = \"md\", suffix, ...props },\n ref,\n) {\n const { insideField } = useFieldState();\n const controlProps = {\n ...props,\n \"aria-busy\": loading || undefined,\n className: cx(textarea({ size }), className),\n \"data-jaci-component\": \"textarea\",\n \"data-loading\": loading || undefined,\n \"data-slot\": \"textarea\",\n };\n const control = insideField ? (\n <FieldControl\n {...(controlProps as unknown as ComponentProps<typeof FieldControl>)}\n ref={ref as Ref<HTMLElement>}\n render={<textarea />}\n />\n ) : (\n <textarea {...controlProps} ref={ref} />\n );\n\n if (prefix !== undefined || suffix !== undefined || loading) {\n return (\n <InputGroup>\n {prefix !== undefined ? (\n <InputGroup.Addon data-slot=\"textarea-prefix\">{prefix}</InputGroup.Addon>\n ) : null}\n {control}\n {loading ? (\n <InputGroup.Addon aria-hidden=\"true\" data-slot=\"textarea-loading\">\n <Spinner label=\"\" size=\"sm\" />\n </InputGroup.Addon>\n ) : suffix !== undefined ? (\n <InputGroup.Addon data-slot=\"textarea-suffix\">{suffix}</InputGroup.Addon>\n ) : null}\n </InputGroup>\n );\n }\n\n return control;\n});\n"],"mappings":";;;;;;;;;AAkBA,MAAa,YAAA,
|
|
1
|
+
{"version":3,"file":"textarea.cjs","names":["forwardRef","useFieldState","cx","textarea","FieldControl","InputGroup","Spinner"],"sources":["../../../src/components/controls/textarea.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\nimport type { ComponentProps, ComponentPropsWithoutRef, ReactNode, Ref } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { textarea } from \"../../styled-system/recipes\";\nimport { FieldControl, useFieldState } from \"../field\";\nimport { InputGroup } from \"../input-group\";\nimport { Spinner } from \"../layout\";\n\nexport interface TextareaProps extends Omit<ComponentPropsWithoutRef<\"textarea\">, \"prefix\"> {\n size?: \"sm\" | \"md\" | \"lg\";\n prefix?: ReactNode;\n suffix?: ReactNode;\n loading?: boolean;\n}\n\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n { className, loading = false, prefix, size = \"md\", suffix, ...props },\n ref,\n) {\n const { insideField } = useFieldState();\n const controlProps = {\n ...props,\n \"aria-busy\": loading || undefined,\n className: cx(textarea({ size }), className),\n \"data-jaci-component\": \"textarea\",\n \"data-loading\": loading || undefined,\n \"data-slot\": \"textarea\",\n };\n const control = insideField ? (\n <FieldControl\n {...(controlProps as unknown as ComponentProps<typeof FieldControl>)}\n ref={ref as Ref<HTMLElement>}\n render={<textarea />}\n />\n ) : (\n <textarea {...controlProps} ref={ref} />\n );\n\n if (prefix !== undefined || suffix !== undefined || loading) {\n return (\n <InputGroup>\n {prefix !== undefined ? (\n <InputGroup.Addon data-slot=\"textarea-prefix\">{prefix}</InputGroup.Addon>\n ) : null}\n {control}\n {loading ? (\n <InputGroup.Addon aria-hidden=\"true\" data-slot=\"textarea-loading\">\n <Spinner label=\"\" size=\"sm\" />\n </InputGroup.Addon>\n ) : suffix !== undefined ? (\n <InputGroup.Addon data-slot=\"textarea-suffix\">{suffix}</InputGroup.Addon>\n ) : null}\n </InputGroup>\n );\n }\n\n return control;\n});\n"],"mappings":";;;;;;;;;AAkBA,MAAa,YAAA,GAAWA,MAAAA,WAAAA,CAA+C,SAAS,SAC9E,EAAE,WAAW,UAAU,OAAO,QAAQ,OAAO,MAAM,QAAQ,GAAG,SAC9D,KACA;CACA,MAAM,EAAE,gBAAgBC,cAAAA,cAAc;CACtC,MAAM,eAAe;EACnB,GAAG;EACH,aAAa,WAAW,KAAA;EACxB,WAAWC,WAAAA,GAAGC,iBAAAA,SAAS,EAAE,KAAK,CAAC,GAAG,SAAS;EAC3C,uBAAuB;EACvB,gBAAgB,WAAW,KAAA;EAC3B,aAAa;CACf;CACA,MAAM,UAAU,cACd,iBAAA,GAAA,kBAAA,IAAA,CAACC,cAAAA,cAAD;EACE,GAAK;EACA;EACL,QAAQ,iBAAA,GAAA,kBAAA,IAAA,CAAC,YAAD,CAAW,CAAA;CACpB,CAAA,IAED,iBAAA,GAAA,kBAAA,IAAA,CAAC,YAAD;EAAU,GAAI;EAAmB;CAAM,CAAA;CAGzC,IAAI,WAAW,KAAA,KAAa,WAAW,KAAA,KAAa,SAClD,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACC,oBAAAA,YAAD,EAAA,UAAA;EACG,WAAW,KAAA,IACV,iBAAA,GAAA,kBAAA,IAAA,CAACA,oBAAAA,WAAW,OAAZ;GAAkB,aAAU;GAAmB,UAAA;EAAyB,CAAA,IACtE;EACH;EACA,UACC,iBAAA,GAAA,kBAAA,IAAA,CAACA,oBAAAA,WAAW,OAAZ;GAAkB,eAAY;GAAO,aAAU;GAC7C,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,cAAAA,SAAD;IAAS,OAAM;IAAG,MAAK;GAAM,CAAA;EACb,CAAA,IAChB,WAAW,KAAA,IACb,iBAAA,GAAA,kBAAA,IAAA,CAACD,oBAAAA,WAAW,OAAZ;GAAkB,aAAU;GAAmB,UAAA;EAAyB,CAAA,IACtE;CACM,EAAA,CAAA;CAIhB,OAAO;AACT,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.js","names":[],"sources":["../../../src/components/controls/textarea.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\nimport type { ComponentProps, ComponentPropsWithoutRef, ReactNode, Ref } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { textarea } from \"../../styled-system/recipes\";\nimport { FieldControl, useFieldState } from \"../field\";\nimport { InputGroup } from \"../input-group\";\nimport { Spinner } from \"../layout\";\n\nexport interface TextareaProps extends Omit<ComponentPropsWithoutRef<\"textarea\">, \"prefix\"> {\n size?: \"sm\" | \"md\" | \"lg\";\n prefix?: ReactNode;\n suffix?: ReactNode;\n loading?: boolean;\n}\n\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n { className, loading = false, prefix, size = \"md\", suffix, ...props },\n ref,\n) {\n const { insideField } = useFieldState();\n const controlProps = {\n ...props,\n \"aria-busy\": loading || undefined,\n className: cx(textarea({ size }), className),\n \"data-jaci-component\": \"textarea\",\n \"data-loading\": loading || undefined,\n \"data-slot\": \"textarea\",\n };\n const control = insideField ? (\n <FieldControl\n {...(controlProps as unknown as ComponentProps<typeof FieldControl>)}\n ref={ref as Ref<HTMLElement>}\n render={<textarea />}\n />\n ) : (\n <textarea {...controlProps} ref={ref} />\n );\n\n if (prefix !== undefined || suffix !== undefined || loading) {\n return (\n <InputGroup>\n {prefix !== undefined ? (\n <InputGroup.Addon data-slot=\"textarea-prefix\">{prefix}</InputGroup.Addon>\n ) : null}\n {control}\n {loading ? (\n <InputGroup.Addon aria-hidden=\"true\" data-slot=\"textarea-loading\">\n <Spinner label=\"\" size=\"sm\" />\n </InputGroup.Addon>\n ) : suffix !== undefined ? (\n <InputGroup.Addon data-slot=\"textarea-suffix\">{suffix}</InputGroup.Addon>\n ) : null}\n </InputGroup>\n );\n }\n\n return control;\n});\n"],"mappings":";;;;;;;;;AAkBA,MAAa,WAAW,WAA+C,SAAS,SAC9E,EAAE,WAAW,UAAU,OAAO,QAAQ,OAAO,MAAM,QAAQ,GAAG,SAC9D,KACA;CACA,MAAM,EAAE,gBAAgB,cAAc;CACtC,MAAM,eAAe;EACnB,GAAG;EACH,aAAa,WAAW,KAAA;EACxB,WAAW,GAAG,SAAS,EAAE,KAAK,CAAC,GAAG,SAAS;EAC3C,uBAAuB;EACvB,gBAAgB,WAAW,KAAA;EAC3B,aAAa;CACf;CACA,MAAM,UAAU,cACd,oBAAC,cAAD;EACE,GAAK;EACA;EACL,QAAQ,oBAAC,YAAD,CAAW,CAAA;CACpB,CAAA,IAED,oBAAC,YAAD;EAAU,GAAI;EAAmB;CAAM,CAAA;CAGzC,IAAI,WAAW,KAAA,KAAa,WAAW,KAAA,KAAa,SAClD,OACE,qBAAC,YAAD,EAAA,UAAA;EACG,WAAW,KAAA,IACV,oBAAC,WAAW,OAAZ;GAAkB,aAAU;
|
|
1
|
+
{"version":3,"file":"textarea.js","names":[],"sources":["../../../src/components/controls/textarea.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\nimport type { ComponentProps, ComponentPropsWithoutRef, ReactNode, Ref } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { textarea } from \"../../styled-system/recipes\";\nimport { FieldControl, useFieldState } from \"../field\";\nimport { InputGroup } from \"../input-group\";\nimport { Spinner } from \"../layout\";\n\nexport interface TextareaProps extends Omit<ComponentPropsWithoutRef<\"textarea\">, \"prefix\"> {\n size?: \"sm\" | \"md\" | \"lg\";\n prefix?: ReactNode;\n suffix?: ReactNode;\n loading?: boolean;\n}\n\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n { className, loading = false, prefix, size = \"md\", suffix, ...props },\n ref,\n) {\n const { insideField } = useFieldState();\n const controlProps = {\n ...props,\n \"aria-busy\": loading || undefined,\n className: cx(textarea({ size }), className),\n \"data-jaci-component\": \"textarea\",\n \"data-loading\": loading || undefined,\n \"data-slot\": \"textarea\",\n };\n const control = insideField ? (\n <FieldControl\n {...(controlProps as unknown as ComponentProps<typeof FieldControl>)}\n ref={ref as Ref<HTMLElement>}\n render={<textarea />}\n />\n ) : (\n <textarea {...controlProps} ref={ref} />\n );\n\n if (prefix !== undefined || suffix !== undefined || loading) {\n return (\n <InputGroup>\n {prefix !== undefined ? (\n <InputGroup.Addon data-slot=\"textarea-prefix\">{prefix}</InputGroup.Addon>\n ) : null}\n {control}\n {loading ? (\n <InputGroup.Addon aria-hidden=\"true\" data-slot=\"textarea-loading\">\n <Spinner label=\"\" size=\"sm\" />\n </InputGroup.Addon>\n ) : suffix !== undefined ? (\n <InputGroup.Addon data-slot=\"textarea-suffix\">{suffix}</InputGroup.Addon>\n ) : null}\n </InputGroup>\n );\n }\n\n return control;\n});\n"],"mappings":";;;;;;;;;AAkBA,MAAa,WAAW,WAA+C,SAAS,SAC9E,EAAE,WAAW,UAAU,OAAO,QAAQ,OAAO,MAAM,QAAQ,GAAG,SAC9D,KACA;CACA,MAAM,EAAE,gBAAgB,cAAc;CACtC,MAAM,eAAe;EACnB,GAAG;EACH,aAAa,WAAW,KAAA;EACxB,WAAW,GAAG,SAAS,EAAE,KAAK,CAAC,GAAG,SAAS;EAC3C,uBAAuB;EACvB,gBAAgB,WAAW,KAAA;EAC3B,aAAa;CACf;CACA,MAAM,UAAU,cACd,oBAAC,cAAD;EACE,GAAK;EACA;EACL,QAAQ,oBAAC,YAAD,CAAW,CAAA;CACpB,CAAA,IAED,oBAAC,YAAD;EAAU,GAAI;EAAmB;CAAM,CAAA;CAGzC,IAAI,WAAW,KAAA,KAAa,WAAW,KAAA,KAAa,SAClD,OACE,qBAAC,YAAD,EAAA,UAAA;EACG,WAAW,KAAA,IACV,oBAAC,WAAW,OAAZ;GAAkB,aAAU;GAAmB,UAAA;EAAyB,CAAA,IACtE;EACH;EACA,UACC,oBAAC,WAAW,OAAZ;GAAkB,eAAY;GAAO,aAAU;GAC7C,UAAA,oBAAC,SAAD;IAAS,OAAM;IAAG,MAAK;GAAM,CAAA;EACb,CAAA,IAChB,WAAW,KAAA,IACb,oBAAC,WAAW,OAAZ;GAAkB,aAAU;GAAmB,UAAA;EAAyB,CAAA,IACtE;CACM,EAAA,CAAA;CAIhB,OAAO;AACT,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copyable.cjs","names":["copyable","cx","Component"],"sources":["../../../src/components/copyable/copyable.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, forwardRef, useContext, useEffect, useRef, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, MouseEvent, MouseEventHandler, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { copyable } from \"../../styled-system/recipes\";\n\ninterface CopyableContextValue {\n copied: boolean;\n copiedLabel: string;\n styles: ReturnType<typeof copyable>;\n}\n\nconst CopyableContext = createContext<CopyableContextValue | null>(null);\n\nfunction useCopyableContext() {\n const context = useContext(CopyableContext);\n if (!context) {\n throw new Error(\"Copyable parts must be rendered inside Copyable.Root.\");\n }\n\n return context;\n}\n\nasync function copyToClipboard(value: string) {\n let primaryError: unknown;\n\n if (typeof navigator !== \"undefined\" && typeof navigator.clipboard?.writeText === \"function\") {\n try {\n await navigator.clipboard.writeText(value);\n return;\n } catch (error) {\n primaryError = error;\n }\n }\n\n if (typeof document !== \"undefined\" && typeof document.execCommand === \"function\") {\n const textarea = document.createElement(\"textarea\");\n const selection = document.getSelection();\n const ranges = selection\n ? Array.from({ length: selection.rangeCount }, (_, index) => selection.getRangeAt(index))\n : [];\n\n textarea.value = value;\n textarea.setAttribute(\"readonly\", \"true\");\n textarea.style.position = \"fixed\";\n textarea.style.opacity = \"0\";\n document.body.appendChild(textarea);\n textarea.select();\n\n try {\n if (document.execCommand(\"copy\")) {\n return;\n }\n } finally {\n textarea.remove();\n selection?.removeAllRanges();\n for (const range of ranges) {\n selection?.addRange(range);\n }\n }\n }\n\n throw primaryError instanceof Error\n ? primaryError\n : new Error(\"Clipboard access is unavailable.\");\n}\n\nexport interface CopyableRootProps\n extends Omit<ComponentPropsWithoutRef<\"button\">, \"children\" | \"onClick\" | \"onCopy\"> {\n children?: ReactNode;\n copiedDuration?: number;\n copiedLabel?: string;\n copyLabel?: string;\n onCopy?: (value: string) => void;\n onError?: (error: unknown) => void;\n onClick?: MouseEventHandler<HTMLButtonElement>;\n value: string;\n}\n\nexport const CopyableRoot = forwardRef<HTMLButtonElement, CopyableRootProps>(function CopyableRoot(\n {\n \"aria-label\": ariaLabel,\n children,\n className,\n copiedDuration = 1500,\n copiedLabel = \"Copied\",\n copyLabel = \"Copy to clipboard\",\n disabled = false,\n onClick,\n onCopy,\n onError,\n value,\n ...props\n },\n ref,\n) {\n const [copied, setCopied] = useState(false);\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const styles = copyable();\n\n useEffect(() => {\n return () => {\n if (timeoutRef.current !== undefined) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, []);\n\n async function handleCopy() {\n try {\n await copyToClipboard(value);\n setCopied(true);\n onCopy?.(value);\n if (timeoutRef.current !== undefined) {\n clearTimeout(timeoutRef.current);\n }\n timeoutRef.current = setTimeout(() => setCopied(false), copiedDuration);\n } catch (error) {\n setCopied(false);\n onError?.(error);\n }\n }\n\n return (\n <CopyableContext.Provider value={{ copied, copiedLabel, styles }}>\n <button\n {...props}\n ref={ref}\n aria-label={ariaLabel ?? copyLabel}\n className={cx(styles.root, className)}\n data-copied={copied || undefined}\n data-disabled={disabled || undefined}\n data-jaci-component=\"copyable\"\n data-slot=\"copyable\"\n disabled={disabled}\n onClick={(event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n void handleCopy();\n }\n }}\n type=\"button\"\n >\n {children ?? <CopyableContent>{value}</CopyableContent>}\n <span aria-live=\"polite\" className={styles.status} data-slot=\"copyable-status\">\n {copied ? copiedLabel : \"\"}\n </span>\n </button>\n </CopyableContext.Provider>\n );\n});\n\nexport interface CopyableContentProps extends Omit<ComponentPropsWithoutRef<\"code\">, \"as\"> {\n as?: \"code\" | \"span\";\n}\n\nexport const CopyableContent = forwardRef<HTMLElement, CopyableContentProps>(\n function CopyableContent({ as = \"code\", className, ...props }, ref) {\n const { styles } = useCopyableContext();\n const Component = as;\n\n return (\n <Component\n {...props}\n ref={ref as never}\n className={cx(styles.content, className)}\n data-slot=\"copyable-content\"\n />\n );\n },\n);\n\nexport type CopyableIndicatorProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const CopyableIndicator = forwardRef<HTMLSpanElement, CopyableIndicatorProps>(\n function CopyableIndicator({ children, className, ...props }, ref) {\n const { copied, copiedLabel, styles } = useCopyableContext();\n\n return (\n <span\n {...props}\n ref={ref}\n aria-hidden={props[\"aria-hidden\"] ?? true}\n className={cx(styles.indicator, className)}\n data-copied={copied || undefined}\n data-slot=\"copyable-indicator\"\n >\n {children ?? (copied ? copiedLabel : \"Copy\")}\n </span>\n );\n },\n);\n\nexport const Copyable = {\n Root: CopyableRoot,\n Content: CopyableContent,\n Indicator: CopyableIndicator,\n};\n"],"mappings":";;;;;;AAcA,MAAM,mBAAA,
|
|
1
|
+
{"version":3,"file":"copyable.cjs","names":["createContext","useContext","forwardRef","useState","useRef","copyable","cx","Component"],"sources":["../../../src/components/copyable/copyable.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, forwardRef, useContext, useEffect, useRef, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, MouseEvent, MouseEventHandler, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { copyable } from \"../../styled-system/recipes\";\n\ninterface CopyableContextValue {\n copied: boolean;\n copiedLabel: string;\n styles: ReturnType<typeof copyable>;\n}\n\nconst CopyableContext = createContext<CopyableContextValue | null>(null);\n\nfunction useCopyableContext() {\n const context = useContext(CopyableContext);\n if (!context) {\n throw new Error(\"Copyable parts must be rendered inside Copyable.Root.\");\n }\n\n return context;\n}\n\nasync function copyToClipboard(value: string) {\n let primaryError: unknown;\n\n if (typeof navigator !== \"undefined\" && typeof navigator.clipboard?.writeText === \"function\") {\n try {\n await navigator.clipboard.writeText(value);\n return;\n } catch (error) {\n primaryError = error;\n }\n }\n\n if (typeof document !== \"undefined\" && typeof document.execCommand === \"function\") {\n const textarea = document.createElement(\"textarea\");\n const selection = document.getSelection();\n const ranges = selection\n ? Array.from({ length: selection.rangeCount }, (_, index) => selection.getRangeAt(index))\n : [];\n\n textarea.value = value;\n textarea.setAttribute(\"readonly\", \"true\");\n textarea.style.position = \"fixed\";\n textarea.style.opacity = \"0\";\n document.body.appendChild(textarea);\n textarea.select();\n\n try {\n if (document.execCommand(\"copy\")) {\n return;\n }\n } finally {\n textarea.remove();\n selection?.removeAllRanges();\n for (const range of ranges) {\n selection?.addRange(range);\n }\n }\n }\n\n throw primaryError instanceof Error\n ? primaryError\n : new Error(\"Clipboard access is unavailable.\");\n}\n\nexport interface CopyableRootProps\n extends Omit<ComponentPropsWithoutRef<\"button\">, \"children\" | \"onClick\" | \"onCopy\"> {\n children?: ReactNode;\n copiedDuration?: number;\n copiedLabel?: string;\n copyLabel?: string;\n onCopy?: (value: string) => void;\n onError?: (error: unknown) => void;\n onClick?: MouseEventHandler<HTMLButtonElement>;\n value: string;\n}\n\nexport const CopyableRoot = forwardRef<HTMLButtonElement, CopyableRootProps>(function CopyableRoot(\n {\n \"aria-label\": ariaLabel,\n children,\n className,\n copiedDuration = 1500,\n copiedLabel = \"Copied\",\n copyLabel = \"Copy to clipboard\",\n disabled = false,\n onClick,\n onCopy,\n onError,\n value,\n ...props\n },\n ref,\n) {\n const [copied, setCopied] = useState(false);\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const styles = copyable();\n\n useEffect(() => {\n return () => {\n if (timeoutRef.current !== undefined) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, []);\n\n async function handleCopy() {\n try {\n await copyToClipboard(value);\n setCopied(true);\n onCopy?.(value);\n if (timeoutRef.current !== undefined) {\n clearTimeout(timeoutRef.current);\n }\n timeoutRef.current = setTimeout(() => setCopied(false), copiedDuration);\n } catch (error) {\n setCopied(false);\n onError?.(error);\n }\n }\n\n return (\n <CopyableContext.Provider value={{ copied, copiedLabel, styles }}>\n <button\n {...props}\n ref={ref}\n aria-label={ariaLabel ?? copyLabel}\n className={cx(styles.root, className)}\n data-copied={copied || undefined}\n data-disabled={disabled || undefined}\n data-jaci-component=\"copyable\"\n data-slot=\"copyable\"\n disabled={disabled}\n onClick={(event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n void handleCopy();\n }\n }}\n type=\"button\"\n >\n {children ?? <CopyableContent>{value}</CopyableContent>}\n <span aria-live=\"polite\" className={styles.status} data-slot=\"copyable-status\">\n {copied ? copiedLabel : \"\"}\n </span>\n </button>\n </CopyableContext.Provider>\n );\n});\n\nexport interface CopyableContentProps extends Omit<ComponentPropsWithoutRef<\"code\">, \"as\"> {\n as?: \"code\" | \"span\";\n}\n\nexport const CopyableContent = forwardRef<HTMLElement, CopyableContentProps>(\n function CopyableContent({ as = \"code\", className, ...props }, ref) {\n const { styles } = useCopyableContext();\n const Component = as;\n\n return (\n <Component\n {...props}\n ref={ref as never}\n className={cx(styles.content, className)}\n data-slot=\"copyable-content\"\n />\n );\n },\n);\n\nexport type CopyableIndicatorProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const CopyableIndicator = forwardRef<HTMLSpanElement, CopyableIndicatorProps>(\n function CopyableIndicator({ children, className, ...props }, ref) {\n const { copied, copiedLabel, styles } = useCopyableContext();\n\n return (\n <span\n {...props}\n ref={ref}\n aria-hidden={props[\"aria-hidden\"] ?? true}\n className={cx(styles.indicator, className)}\n data-copied={copied || undefined}\n data-slot=\"copyable-indicator\"\n >\n {children ?? (copied ? copiedLabel : \"Copy\")}\n </span>\n );\n },\n);\n\nexport const Copyable = {\n Root: CopyableRoot,\n Content: CopyableContent,\n Indicator: CopyableIndicator,\n};\n"],"mappings":";;;;;;AAcA,MAAM,mBAAA,GAAkBA,MAAAA,cAAAA,CAA2C,IAAI;AAEvE,SAAS,qBAAqB;CAC5B,MAAM,WAAA,GAAUC,MAAAA,WAAAA,CAAW,eAAe;CAC1C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,uDAAuD;CAGzE,OAAO;AACT;AAEA,eAAe,gBAAgB,OAAe;CAC5C,IAAI;CAEJ,IAAI,OAAO,cAAc,eAAe,OAAO,UAAU,WAAW,cAAc,YAChF,IAAI;EACF,MAAM,UAAU,UAAU,UAAU,KAAK;EACzC;CACF,SAAS,OAAO;EACd,eAAe;CACjB;CAGF,IAAI,OAAO,aAAa,eAAe,OAAO,SAAS,gBAAgB,YAAY;EACjF,MAAM,WAAW,SAAS,cAAc,UAAU;EAClD,MAAM,YAAY,SAAS,aAAa;EACxC,MAAM,SAAS,YACX,MAAM,KAAK,EAAE,QAAQ,UAAU,WAAW,IAAI,GAAG,UAAU,UAAU,WAAW,KAAK,CAAC,IACtF,CAAC;EAEL,SAAS,QAAQ;EACjB,SAAS,aAAa,YAAY,MAAM;EACxC,SAAS,MAAM,WAAW;EAC1B,SAAS,MAAM,UAAU;EACzB,SAAS,KAAK,YAAY,QAAQ;EAClC,SAAS,OAAO;EAEhB,IAAI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GACA;GACV,UAAU,UAAyC;IACjD,UAAU,KAAK;IACf,IAAI,CAAC,MAAM,kBACT,WAAgB;GAEpB;GACA,MAAK;GAhBP,UAAA,CAkBG,YAAY,iBAAA,GAAA,kBAAA,IAAA,CAAC,iBAAD,EAAA,UAAkB,MAAuB,CAAA,GACtD,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,aAAU;IAAS,WAAW,OAAO;IAAQ,aAAU;IAC1D,UAAA,SAAS,cAAc;GACpB,CAAA,CACA;;CACgB,CAAA;AAE9B,CAAC;AAMD,MAAa,mBAAA,GAAkBJ,MAAAA,WAAAA,CAC7B,SAAS,gBAAgB,EAAE,KAAK,QAAQ,WAAW,GAAG,SAAS,KAAK;CAClE,MAAM,EAAE,WAAW,mBAAmB;CAGtC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACK,IAAD;EACE,GAAI;EACC;EACL,WAAWD,WAAAA,GAAG,OAAO,SAAS,SAAS;EACvC,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,qBAAA,GAAoBJ,MAAAA,WAAAA,CAC/B,SAAS,kBAAkB,EAAE,UAAU,WAAW,GAAG,SAAS,KAAK;CACjE,MAAM,EAAE,QAAQ,aAAa,WAAW,mBAAmB;CAE3D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;EACE,GAAI;EACC;EACL,eAAa,MAAM,kBAAkB;EACrC,WAAWI,WAAAA,GAAG,OAAO,WAAW,SAAS;EACzC,eAAa,UAAU,KAAA;EACvB,aAAU;EAET,UAAA,aAAa,SAAS,cAAc;CACjC,CAAA;AAEV,CACF;AAEA,MAAa,WAAW;CACtB,MAAM;CACN,SAAS;CACT,WAAW;AACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copyable.js","names":["Component"],"sources":["../../../src/components/copyable/copyable.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, forwardRef, useContext, useEffect, useRef, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, MouseEvent, MouseEventHandler, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { copyable } from \"../../styled-system/recipes\";\n\ninterface CopyableContextValue {\n copied: boolean;\n copiedLabel: string;\n styles: ReturnType<typeof copyable>;\n}\n\nconst CopyableContext = createContext<CopyableContextValue | null>(null);\n\nfunction useCopyableContext() {\n const context = useContext(CopyableContext);\n if (!context) {\n throw new Error(\"Copyable parts must be rendered inside Copyable.Root.\");\n }\n\n return context;\n}\n\nasync function copyToClipboard(value: string) {\n let primaryError: unknown;\n\n if (typeof navigator !== \"undefined\" && typeof navigator.clipboard?.writeText === \"function\") {\n try {\n await navigator.clipboard.writeText(value);\n return;\n } catch (error) {\n primaryError = error;\n }\n }\n\n if (typeof document !== \"undefined\" && typeof document.execCommand === \"function\") {\n const textarea = document.createElement(\"textarea\");\n const selection = document.getSelection();\n const ranges = selection\n ? Array.from({ length: selection.rangeCount }, (_, index) => selection.getRangeAt(index))\n : [];\n\n textarea.value = value;\n textarea.setAttribute(\"readonly\", \"true\");\n textarea.style.position = \"fixed\";\n textarea.style.opacity = \"0\";\n document.body.appendChild(textarea);\n textarea.select();\n\n try {\n if (document.execCommand(\"copy\")) {\n return;\n }\n } finally {\n textarea.remove();\n selection?.removeAllRanges();\n for (const range of ranges) {\n selection?.addRange(range);\n }\n }\n }\n\n throw primaryError instanceof Error\n ? primaryError\n : new Error(\"Clipboard access is unavailable.\");\n}\n\nexport interface CopyableRootProps\n extends Omit<ComponentPropsWithoutRef<\"button\">, \"children\" | \"onClick\" | \"onCopy\"> {\n children?: ReactNode;\n copiedDuration?: number;\n copiedLabel?: string;\n copyLabel?: string;\n onCopy?: (value: string) => void;\n onError?: (error: unknown) => void;\n onClick?: MouseEventHandler<HTMLButtonElement>;\n value: string;\n}\n\nexport const CopyableRoot = forwardRef<HTMLButtonElement, CopyableRootProps>(function CopyableRoot(\n {\n \"aria-label\": ariaLabel,\n children,\n className,\n copiedDuration = 1500,\n copiedLabel = \"Copied\",\n copyLabel = \"Copy to clipboard\",\n disabled = false,\n onClick,\n onCopy,\n onError,\n value,\n ...props\n },\n ref,\n) {\n const [copied, setCopied] = useState(false);\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const styles = copyable();\n\n useEffect(() => {\n return () => {\n if (timeoutRef.current !== undefined) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, []);\n\n async function handleCopy() {\n try {\n await copyToClipboard(value);\n setCopied(true);\n onCopy?.(value);\n if (timeoutRef.current !== undefined) {\n clearTimeout(timeoutRef.current);\n }\n timeoutRef.current = setTimeout(() => setCopied(false), copiedDuration);\n } catch (error) {\n setCopied(false);\n onError?.(error);\n }\n }\n\n return (\n <CopyableContext.Provider value={{ copied, copiedLabel, styles }}>\n <button\n {...props}\n ref={ref}\n aria-label={ariaLabel ?? copyLabel}\n className={cx(styles.root, className)}\n data-copied={copied || undefined}\n data-disabled={disabled || undefined}\n data-jaci-component=\"copyable\"\n data-slot=\"copyable\"\n disabled={disabled}\n onClick={(event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n void handleCopy();\n }\n }}\n type=\"button\"\n >\n {children ?? <CopyableContent>{value}</CopyableContent>}\n <span aria-live=\"polite\" className={styles.status} data-slot=\"copyable-status\">\n {copied ? copiedLabel : \"\"}\n </span>\n </button>\n </CopyableContext.Provider>\n );\n});\n\nexport interface CopyableContentProps extends Omit<ComponentPropsWithoutRef<\"code\">, \"as\"> {\n as?: \"code\" | \"span\";\n}\n\nexport const CopyableContent = forwardRef<HTMLElement, CopyableContentProps>(\n function CopyableContent({ as = \"code\", className, ...props }, ref) {\n const { styles } = useCopyableContext();\n const Component = as;\n\n return (\n <Component\n {...props}\n ref={ref as never}\n className={cx(styles.content, className)}\n data-slot=\"copyable-content\"\n />\n );\n },\n);\n\nexport type CopyableIndicatorProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const CopyableIndicator = forwardRef<HTMLSpanElement, CopyableIndicatorProps>(\n function CopyableIndicator({ children, className, ...props }, ref) {\n const { copied, copiedLabel, styles } = useCopyableContext();\n\n return (\n <span\n {...props}\n ref={ref}\n aria-hidden={props[\"aria-hidden\"] ?? true}\n className={cx(styles.indicator, className)}\n data-copied={copied || undefined}\n data-slot=\"copyable-indicator\"\n >\n {children ?? (copied ? copiedLabel : \"Copy\")}\n </span>\n );\n },\n);\n\nexport const Copyable = {\n Root: CopyableRoot,\n Content: CopyableContent,\n Indicator: CopyableIndicator,\n};\n"],"mappings":";;;;;;AAcA,MAAM,kBAAkB,cAA2C,IAAI;AAEvE,SAAS,qBAAqB;CAC5B,MAAM,UAAU,WAAW,eAAe;CAC1C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,uDAAuD;CAGzE,OAAO;AACT;AAEA,eAAe,gBAAgB,OAAe;CAC5C,IAAI;CAEJ,IAAI,OAAO,cAAc,eAAe,OAAO,UAAU,WAAW,cAAc,YAChF,IAAI;EACF,MAAM,UAAU,UAAU,UAAU,KAAK;EACzC;CACF,SAAS,OAAO;EACd,eAAe;CACjB;CAGF,IAAI,OAAO,aAAa,eAAe,OAAO,SAAS,gBAAgB,YAAY;EACjF,MAAM,WAAW,SAAS,cAAc,UAAU;EAClD,MAAM,YAAY,SAAS,aAAa;EACxC,MAAM,SAAS,YACX,MAAM,KAAK,EAAE,QAAQ,UAAU,WAAW,IAAI,GAAG,UAAU,UAAU,WAAW,KAAK,CAAC,IACtF,CAAC;EAEL,SAAS,QAAQ;EACjB,SAAS,aAAa,YAAY,MAAM;EACxC,SAAS,MAAM,WAAW;EAC1B,SAAS,MAAM,UAAU;EACzB,SAAS,KAAK,YAAY,QAAQ;EAClC,SAAS,OAAO;EAEhB,IAAI;GACF,IAAI,SAAS,YAAY,MAAM,GAC7B;EAEJ,UAAU;GACR,SAAS,OAAO;GAChB,WAAW,gBAAgB;GAC3B,KAAK,MAAM,SAAS,QAClB,WAAW,SAAS,KAAK;EAE7B;CACF;CAEA,MAAM,wBAAwB,QAC1B,+BACA,IAAI,MAAM,kCAAkC;AAClD;AAcA,MAAa,eAAe,WAAiD,SAAS,aACpF,EACE,cAAc,WACd,UACA,WACA,iBAAiB,MACjB,cAAc,UACd,YAAY,qBACZ,WAAW,OACX,SACA,QACA,SACA,OACA,GAAG,SAEL,KACA;CACA,MAAM,CAAC,QAAQ,aAAa,SAAS,KAAK;CAC1C,MAAM,aAAa,OAAkD,KAAA,CAAS;CAC9E,MAAM,SAAS,SAAS;CAExB,gBAAgB;EACd,aAAa;GACX,IAAI,WAAW,YAAY,KAAA,GACzB,aAAa,WAAW,OAAO;EAEnC;CACF,GAAG,CAAC,CAAC;CAEL,eAAe,aAAa;EAC1B,IAAI;GACF,MAAM,gBAAgB,KAAK;GAC3B,UAAU,IAAI;GACd,SAAS,KAAK;GACd,IAAI,WAAW,YAAY,KAAA,GACzB,aAAa,WAAW,OAAO;GAEjC,WAAW,UAAU,iBAAiB,UAAU,KAAK,GAAG,cAAc;EACxE,SAAS,OAAO;GACd,UAAU,KAAK;GACf,UAAU,KAAK;EACjB;CACF;CAEA,OACE,oBAAC,gBAAgB,UAAjB;EAA0B,OAAO;GAAE;GAAQ;GAAa;EAAO;
|
|
1
|
+
{"version":3,"file":"copyable.js","names":["Component"],"sources":["../../../src/components/copyable/copyable.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, forwardRef, useContext, useEffect, useRef, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, MouseEvent, MouseEventHandler, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { copyable } from \"../../styled-system/recipes\";\n\ninterface CopyableContextValue {\n copied: boolean;\n copiedLabel: string;\n styles: ReturnType<typeof copyable>;\n}\n\nconst CopyableContext = createContext<CopyableContextValue | null>(null);\n\nfunction useCopyableContext() {\n const context = useContext(CopyableContext);\n if (!context) {\n throw new Error(\"Copyable parts must be rendered inside Copyable.Root.\");\n }\n\n return context;\n}\n\nasync function copyToClipboard(value: string) {\n let primaryError: unknown;\n\n if (typeof navigator !== \"undefined\" && typeof navigator.clipboard?.writeText === \"function\") {\n try {\n await navigator.clipboard.writeText(value);\n return;\n } catch (error) {\n primaryError = error;\n }\n }\n\n if (typeof document !== \"undefined\" && typeof document.execCommand === \"function\") {\n const textarea = document.createElement(\"textarea\");\n const selection = document.getSelection();\n const ranges = selection\n ? Array.from({ length: selection.rangeCount }, (_, index) => selection.getRangeAt(index))\n : [];\n\n textarea.value = value;\n textarea.setAttribute(\"readonly\", \"true\");\n textarea.style.position = \"fixed\";\n textarea.style.opacity = \"0\";\n document.body.appendChild(textarea);\n textarea.select();\n\n try {\n if (document.execCommand(\"copy\")) {\n return;\n }\n } finally {\n textarea.remove();\n selection?.removeAllRanges();\n for (const range of ranges) {\n selection?.addRange(range);\n }\n }\n }\n\n throw primaryError instanceof Error\n ? primaryError\n : new Error(\"Clipboard access is unavailable.\");\n}\n\nexport interface CopyableRootProps\n extends Omit<ComponentPropsWithoutRef<\"button\">, \"children\" | \"onClick\" | \"onCopy\"> {\n children?: ReactNode;\n copiedDuration?: number;\n copiedLabel?: string;\n copyLabel?: string;\n onCopy?: (value: string) => void;\n onError?: (error: unknown) => void;\n onClick?: MouseEventHandler<HTMLButtonElement>;\n value: string;\n}\n\nexport const CopyableRoot = forwardRef<HTMLButtonElement, CopyableRootProps>(function CopyableRoot(\n {\n \"aria-label\": ariaLabel,\n children,\n className,\n copiedDuration = 1500,\n copiedLabel = \"Copied\",\n copyLabel = \"Copy to clipboard\",\n disabled = false,\n onClick,\n onCopy,\n onError,\n value,\n ...props\n },\n ref,\n) {\n const [copied, setCopied] = useState(false);\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const styles = copyable();\n\n useEffect(() => {\n return () => {\n if (timeoutRef.current !== undefined) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, []);\n\n async function handleCopy() {\n try {\n await copyToClipboard(value);\n setCopied(true);\n onCopy?.(value);\n if (timeoutRef.current !== undefined) {\n clearTimeout(timeoutRef.current);\n }\n timeoutRef.current = setTimeout(() => setCopied(false), copiedDuration);\n } catch (error) {\n setCopied(false);\n onError?.(error);\n }\n }\n\n return (\n <CopyableContext.Provider value={{ copied, copiedLabel, styles }}>\n <button\n {...props}\n ref={ref}\n aria-label={ariaLabel ?? copyLabel}\n className={cx(styles.root, className)}\n data-copied={copied || undefined}\n data-disabled={disabled || undefined}\n data-jaci-component=\"copyable\"\n data-slot=\"copyable\"\n disabled={disabled}\n onClick={(event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n void handleCopy();\n }\n }}\n type=\"button\"\n >\n {children ?? <CopyableContent>{value}</CopyableContent>}\n <span aria-live=\"polite\" className={styles.status} data-slot=\"copyable-status\">\n {copied ? copiedLabel : \"\"}\n </span>\n </button>\n </CopyableContext.Provider>\n );\n});\n\nexport interface CopyableContentProps extends Omit<ComponentPropsWithoutRef<\"code\">, \"as\"> {\n as?: \"code\" | \"span\";\n}\n\nexport const CopyableContent = forwardRef<HTMLElement, CopyableContentProps>(\n function CopyableContent({ as = \"code\", className, ...props }, ref) {\n const { styles } = useCopyableContext();\n const Component = as;\n\n return (\n <Component\n {...props}\n ref={ref as never}\n className={cx(styles.content, className)}\n data-slot=\"copyable-content\"\n />\n );\n },\n);\n\nexport type CopyableIndicatorProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const CopyableIndicator = forwardRef<HTMLSpanElement, CopyableIndicatorProps>(\n function CopyableIndicator({ children, className, ...props }, ref) {\n const { copied, copiedLabel, styles } = useCopyableContext();\n\n return (\n <span\n {...props}\n ref={ref}\n aria-hidden={props[\"aria-hidden\"] ?? true}\n className={cx(styles.indicator, className)}\n data-copied={copied || undefined}\n data-slot=\"copyable-indicator\"\n >\n {children ?? (copied ? copiedLabel : \"Copy\")}\n </span>\n );\n },\n);\n\nexport const Copyable = {\n Root: CopyableRoot,\n Content: CopyableContent,\n Indicator: CopyableIndicator,\n};\n"],"mappings":";;;;;;A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,oBAAC,QAAD;EACE,GAAI;EACC;EACL,eAAa,MAAM,kBAAkB;EACrC,WAAW,GAAG,OAAO,WAAW,SAAS;EACzC,eAAa,UAAU,KAAA;EACvB,aAAU;EAET,UAAA,aAAa,SAAS,cAAc;CACjC,CAAA;AAEV,CACF;AAEA,MAAa,WAAW;CACtB,MAAM;CACN,SAAS;CACT,WAAW;AACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-toolbar.cjs","names":["cx","dataToolbar"],"sources":["../../../src/components/data-toolbar/data-toolbar.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, forwardRef, useContext, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dataToolbar } from \"../../styled-system/recipes\";\n\ninterface SelectionContextValue {\n count: number;\n onClear: (() => void) | undefined;\n}\n\nconst SelectionContext = createContext<SelectionContextValue | null>(null);\n\nexport type DataToolbarRootProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataToolbarRoot = forwardRef<HTMLDivElement, DataToolbarRootProps>(\n function DataToolbarRoot({ className, role, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataToolbar().root, className)}\n data-jaci-component=\"data-toolbar\"\n data-slot=\"data-toolbar\"\n role={role ?? \"toolbar\"}\n />\n );\n },\n);\n\nexport interface DataToolbarSearchProps\n extends Omit<ComponentPropsWithoutRef<\"input\">, \"defaultValue\" | \"onChange\" | \"value\"> {\n defaultValue?: string;\n onChange?: ComponentPropsWithoutRef<\"input\">[\"onChange\"];\n onValueChange?: (value: string) => void;\n value?: string;\n}\n\nexport const DataToolbarSearch = forwardRef<HTMLInputElement, DataToolbarSearchProps>(\n function DataToolbarSearch(\n { className, defaultValue = \"\", onValueChange, value: controlledValue, ...props },\n ref,\n ) {\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const value = controlledValue ?? uncontrolledValue;\n return (\n <input\n {...props}\n ref={ref}\n className={cx(dataToolbar().search, className)}\n data-slot=\"data-toolbar-search\"\n onChange={(event) => {\n if (controlledValue === undefined) setUncontrolledValue(event.currentTarget.value);\n onValueChange?.(event.currentTarget.value);\n props.onChange?.(event);\n }}\n type={props.type ?? \"search\"}\n value={value}\n />\n );\n },\n);\n\nexport type DataToolbarFiltersProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataToolbarFilters = forwardRef<HTMLDivElement, DataToolbarFiltersProps>(\n function DataToolbarFilters({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataToolbar().filters, className)}\n data-slot=\"data-toolbar-filters\"\n />\n );\n },\n);\n\nexport interface DataToolbarSortProps\n extends Omit<ComponentPropsWithoutRef<\"select\">, \"defaultValue\" | \"onChange\" | \"value\"> {\n defaultValue?: string;\n onChange?: ComponentPropsWithoutRef<\"select\">[\"onChange\"];\n onValueChange?: (value: string) => void;\n value?: string;\n}\n\nexport const DataToolbarSort = forwardRef<HTMLSelectElement, DataToolbarSortProps>(\n function DataToolbarSort(\n { className, defaultValue = \"\", onValueChange, value: controlledValue, ...props },\n ref,\n ) {\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const value = controlledValue ?? uncontrolledValue;\n return (\n <select\n {...props}\n ref={ref}\n className={cx(dataToolbar().sort, className)}\n data-slot=\"data-toolbar-sort\"\n onChange={(event) => {\n if (controlledValue === undefined) setUncontrolledValue(event.currentTarget.value);\n onValueChange?.(event.currentTarget.value);\n props.onChange?.(event);\n }}\n value={value}\n />\n );\n },\n);\n\nexport interface DataToolbarSelectionProps extends ComponentPropsWithoutRef<\"div\"> {\n count: number;\n label?: ReactNode;\n onClear?: () => void;\n}\nexport const DataToolbarSelection = forwardRef<HTMLDivElement, DataToolbarSelectionProps>(\n function DataToolbarSelection(\n { children, className, count, label = \"selected\", onClear, ...props },\n ref,\n ) {\n return (\n <SelectionContext.Provider value={{ count, onClear }}>\n <div\n {...props}\n ref={ref}\n aria-live=\"polite\"\n className={cx(dataToolbar().selection, className)}\n data-count={count}\n data-slot=\"data-toolbar-selection\"\n >\n {children ?? `${count} ${label}`}\n </div>\n </SelectionContext.Provider>\n );\n },\n);\n\nexport interface DataToolbarClearSelectionProps extends ComponentPropsWithoutRef<\"button\"> {\n children?: ReactNode;\n}\nexport const DataToolbarClearSelection = forwardRef<\n HTMLButtonElement,\n DataToolbarClearSelectionProps\n>(function DataToolbarClearSelection(\n { children = \"Clear selection\", className, onClick, ...props },\n ref,\n) {\n const context = useContext(SelectionContext);\n return (\n <button\n {...props}\n ref={ref}\n className={cx(dataToolbar().clearSelection, className)}\n data-slot=\"data-toolbar-clear-selection\"\n onClick={(event) => {\n context?.onClear?.();\n onClick?.(event);\n }}\n type=\"button\"\n >\n {children}\n </button>\n );\n});\n\nexport type DataToolbarActionsProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataToolbarActions = forwardRef<HTMLDivElement, DataToolbarActionsProps>(\n function DataToolbarActions({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataToolbar().actions, className)}\n data-slot=\"data-toolbar-actions\"\n />\n );\n },\n);\n\nexport type DataToolbarClearProps = ComponentPropsWithoutRef<\"button\">;\nexport const DataToolbarClear = forwardRef<HTMLButtonElement, DataToolbarClearProps>(\n function DataToolbarClear({ children = \"Clear filters\", className, ...props }, ref) {\n return (\n <button\n {...props}\n ref={ref}\n className={cx(dataToolbar().clear, className)}\n data-slot=\"data-toolbar-clear\"\n type=\"button\"\n >\n {children}\n </button>\n );\n },\n);\n\nexport type DataToolbarSeparatorProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataToolbarSeparator = forwardRef<HTMLDivElement, DataToolbarSeparatorProps>(\n function DataToolbarSeparator({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n aria-hidden=\"true\"\n className={cx(dataToolbar().separator, className)}\n data-slot=\"data-toolbar-separator\"\n />\n );\n },\n);\n\nexport const DataToolbar = {\n Root: DataToolbarRoot,\n Search: DataToolbarSearch,\n Filters: DataToolbarFilters,\n Sort: DataToolbarSort,\n Selection: DataToolbarSelection,\n ClearSelection: DataToolbarClearSelection,\n Actions: DataToolbarActions,\n Clear: DataToolbarClear,\n Separator: DataToolbarSeparator,\n};\n"],"mappings":";;;;;;AAaA,MAAM,oBAAA,GAAA,MAAA,cAAA,CAA+D,IAAI;AAGzE,MAAa,mBAAA,GAAA,MAAA,WAAA,CACX,SAAS,gBAAgB,EAAE,WAAW,MAAM,GAAG,SAAS,KAAK;CAC3D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,WAAWA,WAAAA,GAAGC,qBAAAA,YAAY,CAAC,CAAC,MAAM,SAAS;EAC3C,uBAAoB;EACpB,aAAU;EACV,MAAM,QAAQ;CACf,CAAA;AAEL,CACF;AAUA,MAAa,qBAAA,GAAA,MAAA,WAAA,CACX,SAAS,kBACP,EAAE,WAAW,eAAe,IAAI,eAAe,OAAO,iBAAiB,GAAG,SAC1E,KACA;CACA,MAAM,CAAC,mBAAmB,yBAAA,GAAA,MAAA,SAAA,CAAiC,YAAY;CACvE,MAAM,QAAQ,mBAAmB;CACjC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD;EACE,GAAI;EACC;EACL,WAAWD,WAAAA,GAAGC,qBAAAA,YAAY,CAAC,CAAC,QAAQ,SAAS;EAC7C,aAAU;EACV,WAAW,UAAU;GACnB,IAAI,oBAAoB,KAAA,GAAW,qBAAqB,MAAM,cAAc,KAAK;GACjF,gBAAgB,MAAM,cAAc,KAAK;GACzC,MAAM,WAAW,KAAK;EACxB;EACA,MAAM,MAAM,QAAQ;EACb;CACR,CAAA;AAEL,CACF;AAGA,MAAa,sBAAA,GAAA,MAAA,WAAA,CACX,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CACxD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,WAAWD,WAAAA,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;EACE,GAAI;EACC;EACL,WAAWD,WAAAA,GAAGC,qBAAAA,YAAY,CAAC,CAAC,gBAAgB,SAAS;EACrD,aAAU;EACV,UAAU,UAAU;GAClB,SAAS,UAAU;GACnB,UAAU,KAAK;EACjB;EACA,MAAK;EAEJ;CACK,CAAA;AAEZ,CAAC;AAGD,MAAa,sBAAA,GAAA,MAAA,WAAA,CACX,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CACxD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,WAAWD,WAAAA,GAAGC,qBAAAA,YAAY,CAAC,CAAC,SAAS,SAAS;EAC9C,aAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,oBAAA,GAAA,MAAA,WAAA,CACX,SAAS,iBAAiB,EAAE,WAAW,iBAAiB,WAAW,GAAG,SAAS,KAAK;CAClF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;EACE,GAAI;EACC;EACL,WAAWD,WAAAA,GAAGC,qBAAAA,YAAY,CAAC,CAAC,OAAO,SAAS;EAC5C,aAAU;EACV,MAAK;EAEJ;CACK,CAAA;AAEZ,CACF;AAGA,MAAa,wBAAA,GAAA,MAAA,WAAA,CACX,SAAS,qBAAqB,EAAE,WAAW,GAAG,SAAS,KAAK;CAC1D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,eAAY;EACZ,WAAWD,WAAAA,GAAGC,qBAAAA,YAAY,CAAC,CAAC,WAAW,SAAS;EAChD,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,cAAc;CACzB,MAAM;CACN,QAAQ;CACR,SAAS;CACT,MAAM;CACN,WAAW;CACX,gBAAgB;CAChB,SAAS;CACT,OAAO;CACP,WAAW;AACb"}
|
|
1
|
+
{"version":3,"file":"data-toolbar.cjs","names":["createContext","forwardRef","cx","dataToolbar","useState","useContext"],"sources":["../../../src/components/data-toolbar/data-toolbar.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, forwardRef, useContext, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dataToolbar } from \"../../styled-system/recipes\";\n\ninterface SelectionContextValue {\n count: number;\n onClear: (() => void) | undefined;\n}\n\nconst SelectionContext = createContext<SelectionContextValue | null>(null);\n\nexport type DataToolbarRootProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataToolbarRoot = forwardRef<HTMLDivElement, DataToolbarRootProps>(\n function DataToolbarRoot({ className, role, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataToolbar().root, className)}\n data-jaci-component=\"data-toolbar\"\n data-slot=\"data-toolbar\"\n role={role ?? \"toolbar\"}\n />\n );\n },\n);\n\nexport interface DataToolbarSearchProps\n extends Omit<ComponentPropsWithoutRef<\"input\">, \"defaultValue\" | \"onChange\" | \"value\"> {\n defaultValue?: string;\n onChange?: ComponentPropsWithoutRef<\"input\">[\"onChange\"];\n onValueChange?: (value: string) => void;\n value?: string;\n}\n\nexport const DataToolbarSearch = forwardRef<HTMLInputElement, DataToolbarSearchProps>(\n function DataToolbarSearch(\n { className, defaultValue = \"\", onValueChange, value: controlledValue, ...props },\n ref,\n ) {\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const value = controlledValue ?? uncontrolledValue;\n return (\n <input\n {...props}\n ref={ref}\n className={cx(dataToolbar().search, className)}\n data-slot=\"data-toolbar-search\"\n onChange={(event) => {\n if (controlledValue === undefined) setUncontrolledValue(event.currentTarget.value);\n onValueChange?.(event.currentTarget.value);\n props.onChange?.(event);\n }}\n type={props.type ?? \"search\"}\n value={value}\n />\n );\n },\n);\n\nexport type DataToolbarFiltersProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataToolbarFilters = forwardRef<HTMLDivElement, DataToolbarFiltersProps>(\n function DataToolbarFilters({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataToolbar().filters, className)}\n data-slot=\"data-toolbar-filters\"\n />\n );\n },\n);\n\nexport interface DataToolbarSortProps\n extends Omit<ComponentPropsWithoutRef<\"select\">, \"defaultValue\" | \"onChange\" | \"value\"> {\n defaultValue?: string;\n onChange?: ComponentPropsWithoutRef<\"select\">[\"onChange\"];\n onValueChange?: (value: string) => void;\n value?: string;\n}\n\nexport const DataToolbarSort = forwardRef<HTMLSelectElement, DataToolbarSortProps>(\n function DataToolbarSort(\n { className, defaultValue = \"\", onValueChange, value: controlledValue, ...props },\n ref,\n ) {\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const value = controlledValue ?? uncontrolledValue;\n return (\n <select\n {...props}\n ref={ref}\n className={cx(dataToolbar().sort, className)}\n data-slot=\"data-toolbar-sort\"\n onChange={(event) => {\n if (controlledValue === undefined) setUncontrolledValue(event.currentTarget.value);\n onValueChange?.(event.currentTarget.value);\n props.onChange?.(event);\n }}\n value={value}\n />\n );\n },\n);\n\nexport interface DataToolbarSelectionProps extends ComponentPropsWithoutRef<\"div\"> {\n count: number;\n label?: ReactNode;\n onClear?: () => void;\n}\nexport const DataToolbarSelection = forwardRef<HTMLDivElement, DataToolbarSelectionProps>(\n function DataToolbarSelection(\n { children, className, count, label = \"selected\", onClear, ...props },\n ref,\n ) {\n return (\n <SelectionContext.Provider value={{ count, onClear }}>\n <div\n {...props}\n ref={ref}\n aria-live=\"polite\"\n className={cx(dataToolbar().selection, className)}\n data-count={count}\n data-slot=\"data-toolbar-selection\"\n >\n {children ?? `${count} ${label}`}\n </div>\n </SelectionContext.Provider>\n );\n },\n);\n\nexport interface DataToolbarClearSelectionProps extends ComponentPropsWithoutRef<\"button\"> {\n children?: ReactNode;\n}\nexport const DataToolbarClearSelection = forwardRef<\n HTMLButtonElement,\n DataToolbarClearSelectionProps\n>(function DataToolbarClearSelection(\n { children = \"Clear selection\", className, onClick, ...props },\n ref,\n) {\n const context = useContext(SelectionContext);\n return (\n <button\n {...props}\n ref={ref}\n className={cx(dataToolbar().clearSelection, className)}\n data-slot=\"data-toolbar-clear-selection\"\n onClick={(event) => {\n context?.onClear?.();\n onClick?.(event);\n }}\n type=\"button\"\n >\n {children}\n </button>\n );\n});\n\nexport type DataToolbarActionsProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataToolbarActions = forwardRef<HTMLDivElement, DataToolbarActionsProps>(\n function DataToolbarActions({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataToolbar().actions, className)}\n data-slot=\"data-toolbar-actions\"\n />\n );\n },\n);\n\nexport type DataToolbarClearProps = ComponentPropsWithoutRef<\"button\">;\nexport const DataToolbarClear = forwardRef<HTMLButtonElement, DataToolbarClearProps>(\n function DataToolbarClear({ children = \"Clear filters\", className, ...props }, ref) {\n return (\n <button\n {...props}\n ref={ref}\n className={cx(dataToolbar().clear, className)}\n data-slot=\"data-toolbar-clear\"\n type=\"button\"\n >\n {children}\n </button>\n );\n },\n);\n\nexport type DataToolbarSeparatorProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataToolbarSeparator = forwardRef<HTMLDivElement, DataToolbarSeparatorProps>(\n function DataToolbarSeparator({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n aria-hidden=\"true\"\n className={cx(dataToolbar().separator, className)}\n data-slot=\"data-toolbar-separator\"\n />\n );\n },\n);\n\nexport const DataToolbar = {\n Root: DataToolbarRoot,\n Search: DataToolbarSearch,\n Filters: DataToolbarFilters,\n Sort: DataToolbarSort,\n Selection: DataToolbarSelection,\n ClearSelection: DataToolbarClearSelection,\n Actions: DataToolbarActions,\n Clear: DataToolbarClear,\n Separator: DataToolbarSeparator,\n};\n"],"mappings":";;;;;;AAaA,MAAM,oBAAA,GAAmBA,MAAAA,cAAAA,CAA4C,IAAI;AAGzE,MAAa,mBAAA,GAAkBC,MAAAA,WAAAA,CAC7B,SAAS,gBAAgB,EAAE,WAAW,MAAM,GAAG,SAAS,KAAK;CAC3D,OACE,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AAS,KAAK;CACxD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,WAAWC,WAAAA,GAAGC,qBAAAA,YAAY,CAAC,CAAC,SAAS,SAAS;EAC9C,aAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,oBAAA,GAAmBF,MAAAA,WAAAA,CAC9B,SAAS,iBAAiB,EAAE,WAAW,iBAAiB,WAAW,GAAG,SAAS,KAAK;CAClF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;EACE,GAAI;EACC;EACL,WAAWC,WAAAA,GAAGC,qBAAAA,YAAY,CAAC,CAAC,OAAO,SAAS;EAC5C,aAAU;EACV,MAAK;EAEJ;CACK,CAAA;AAEZ,CACF;AAGA,MAAa,wBAAA,GAAuBF,MAAAA,WAAAA,CAClC,SAAS,qBAAqB,EAAE,WAAW,GAAG,SAAS,KAAK;CAC1D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,eAAY;EACZ,WAAWC,WAAAA,GAAGC,qBAAAA,YAAY,CAAC,CAAC,WAAW,SAAS;EAChD,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,cAAc;CACzB,MAAM;CACN,QAAQ;CACR,SAAS;CACT,MAAM;CACN,WAAW;CACX,gBAAgB;CAChB,SAAS;CACT,OAAO;CACP,WAAW;AACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-toolbar.js","names":[],"sources":["../../../src/components/data-toolbar/data-toolbar.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, forwardRef, useContext, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dataToolbar } from \"../../styled-system/recipes\";\n\ninterface SelectionContextValue {\n count: number;\n onClear: (() => void) | undefined;\n}\n\nconst SelectionContext = createContext<SelectionContextValue | null>(null);\n\nexport type DataToolbarRootProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataToolbarRoot = forwardRef<HTMLDivElement, DataToolbarRootProps>(\n function DataToolbarRoot({ className, role, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataToolbar().root, className)}\n data-jaci-component=\"data-toolbar\"\n data-slot=\"data-toolbar\"\n role={role ?? \"toolbar\"}\n />\n );\n },\n);\n\nexport interface DataToolbarSearchProps\n extends Omit<ComponentPropsWithoutRef<\"input\">, \"defaultValue\" | \"onChange\" | \"value\"> {\n defaultValue?: string;\n onChange?: ComponentPropsWithoutRef<\"input\">[\"onChange\"];\n onValueChange?: (value: string) => void;\n value?: string;\n}\n\nexport const DataToolbarSearch = forwardRef<HTMLInputElement, DataToolbarSearchProps>(\n function DataToolbarSearch(\n { className, defaultValue = \"\", onValueChange, value: controlledValue, ...props },\n ref,\n ) {\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const value = controlledValue ?? uncontrolledValue;\n return (\n <input\n {...props}\n ref={ref}\n className={cx(dataToolbar().search, className)}\n data-slot=\"data-toolbar-search\"\n onChange={(event) => {\n if (controlledValue === undefined) setUncontrolledValue(event.currentTarget.value);\n onValueChange?.(event.currentTarget.value);\n props.onChange?.(event);\n }}\n type={props.type ?? \"search\"}\n value={value}\n />\n );\n },\n);\n\nexport type DataToolbarFiltersProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataToolbarFilters = forwardRef<HTMLDivElement, DataToolbarFiltersProps>(\n function DataToolbarFilters({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataToolbar().filters, className)}\n data-slot=\"data-toolbar-filters\"\n />\n );\n },\n);\n\nexport interface DataToolbarSortProps\n extends Omit<ComponentPropsWithoutRef<\"select\">, \"defaultValue\" | \"onChange\" | \"value\"> {\n defaultValue?: string;\n onChange?: ComponentPropsWithoutRef<\"select\">[\"onChange\"];\n onValueChange?: (value: string) => void;\n value?: string;\n}\n\nexport const DataToolbarSort = forwardRef<HTMLSelectElement, DataToolbarSortProps>(\n function DataToolbarSort(\n { className, defaultValue = \"\", onValueChange, value: controlledValue, ...props },\n ref,\n ) {\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const value = controlledValue ?? uncontrolledValue;\n return (\n <select\n {...props}\n ref={ref}\n className={cx(dataToolbar().sort, className)}\n data-slot=\"data-toolbar-sort\"\n onChange={(event) => {\n if (controlledValue === undefined) setUncontrolledValue(event.currentTarget.value);\n onValueChange?.(event.currentTarget.value);\n props.onChange?.(event);\n }}\n value={value}\n />\n );\n },\n);\n\nexport interface DataToolbarSelectionProps extends ComponentPropsWithoutRef<\"div\"> {\n count: number;\n label?: ReactNode;\n onClear?: () => void;\n}\nexport const DataToolbarSelection = forwardRef<HTMLDivElement, DataToolbarSelectionProps>(\n function DataToolbarSelection(\n { children, className, count, label = \"selected\", onClear, ...props },\n ref,\n ) {\n return (\n <SelectionContext.Provider value={{ count, onClear }}>\n <div\n {...props}\n ref={ref}\n aria-live=\"polite\"\n className={cx(dataToolbar().selection, className)}\n data-count={count}\n data-slot=\"data-toolbar-selection\"\n >\n {children ?? `${count} ${label}`}\n </div>\n </SelectionContext.Provider>\n );\n },\n);\n\nexport interface DataToolbarClearSelectionProps extends ComponentPropsWithoutRef<\"button\"> {\n children?: ReactNode;\n}\nexport const DataToolbarClearSelection = forwardRef<\n HTMLButtonElement,\n DataToolbarClearSelectionProps\n>(function DataToolbarClearSelection(\n { children = \"Clear selection\", className, onClick, ...props },\n ref,\n) {\n const context = useContext(SelectionContext);\n return (\n <button\n {...props}\n ref={ref}\n className={cx(dataToolbar().clearSelection, className)}\n data-slot=\"data-toolbar-clear-selection\"\n onClick={(event) => {\n context?.onClear?.();\n onClick?.(event);\n }}\n type=\"button\"\n >\n {children}\n </button>\n );\n});\n\nexport type DataToolbarActionsProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataToolbarActions = forwardRef<HTMLDivElement, DataToolbarActionsProps>(\n function DataToolbarActions({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataToolbar().actions, className)}\n data-slot=\"data-toolbar-actions\"\n />\n );\n },\n);\n\nexport type DataToolbarClearProps = ComponentPropsWithoutRef<\"button\">;\nexport const DataToolbarClear = forwardRef<HTMLButtonElement, DataToolbarClearProps>(\n function DataToolbarClear({ children = \"Clear filters\", className, ...props }, ref) {\n return (\n <button\n {...props}\n ref={ref}\n className={cx(dataToolbar().clear, className)}\n data-slot=\"data-toolbar-clear\"\n type=\"button\"\n >\n {children}\n </button>\n );\n },\n);\n\nexport type DataToolbarSeparatorProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataToolbarSeparator = forwardRef<HTMLDivElement, DataToolbarSeparatorProps>(\n function DataToolbarSeparator({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n aria-hidden=\"true\"\n className={cx(dataToolbar().separator, className)}\n data-slot=\"data-toolbar-separator\"\n />\n );\n },\n);\n\nexport const DataToolbar = {\n Root: DataToolbarRoot,\n Search: DataToolbarSearch,\n Filters: DataToolbarFilters,\n Sort: DataToolbarSort,\n Selection: DataToolbarSelection,\n ClearSelection: DataToolbarClearSelection,\n Actions: DataToolbarActions,\n Clear: DataToolbarClear,\n Separator: DataToolbarSeparator,\n};\n"],"mappings":";;;;;;AAaA,MAAM,mBAAmB,cAA4C,IAAI;AAGzE,MAAa,kBAAkB,WAC7B,SAAS,gBAAgB,EAAE,WAAW,MAAM,GAAG,SAAS,KAAK;CAC3D,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,YAAY,CAAC,CAAC,MAAM,SAAS;EAC3C,uBAAoB;EACpB,aAAU;EACV,MAAM,QAAQ;CACf,CAAA;AAEL,CACF;AAUA,MAAa,oBAAoB,WAC/B,SAAS,kBACP,EAAE,WAAW,eAAe,IAAI,eAAe,OAAO,iBAAiB,GAAG,SAC1E,KACA;CACA,MAAM,CAAC,mBAAmB,wBAAwB,SAAS,YAAY;CACvE,MAAM,QAAQ,mBAAmB;CACjC,OACE,oBAAC,SAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,YAAY,CAAC,CAAC,QAAQ,SAAS;EAC7C,aAAU;EACV,WAAW,UAAU;GACnB,IAAI,oBAAoB,KAAA,GAAW,qBAAqB,MAAM,cAAc,KAAK;GACjF,gBAAgB,MAAM,cAAc,KAAK;GACzC,MAAM,WAAW,KAAK;EACxB;EACA,MAAM,MAAM,QAAQ;EACb;CACR,CAAA;AAEL,CACF;AAGA,MAAa,qBAAqB,WAChC,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CACxD,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,YAAY,CAAC,CAAC,SAAS,SAAS;EAC9C,aAAU;CACX,CAAA;AAEL,CACF;AAUA,MAAa,kBAAkB,WAC7B,SAAS,gBACP,EAAE,WAAW,eAAe,IAAI,eAAe,OAAO,iBAAiB,GAAG,SAC1E,KACA;CACA,MAAM,CAAC,mBAAmB,wBAAwB,SAAS,YAAY;CACvE,MAAM,QAAQ,mBAAmB;CACjC,OACE,oBAAC,UAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,YAAY,CAAC,CAAC,MAAM,SAAS;EAC3C,aAAU;EACV,WAAW,UAAU;GACnB,IAAI,oBAAoB,KAAA,GAAW,qBAAqB,MAAM,cAAc,KAAK;GACjF,gBAAgB,MAAM,cAAc,KAAK;GACzC,MAAM,WAAW,KAAK;EACxB;EACO;CACR,CAAA;AAEL,CACF;AAOA,MAAa,uBAAuB,WAClC,SAAS,qBACP,EAAE,UAAU,WAAW,OAAO,QAAQ,YAAY,SAAS,GAAG,SAC9D,KACA;CACA,OACE,oBAAC,iBAAiB,UAAlB;EAA2B,OAAO;GAAE;GAAO;EAAQ;
|
|
1
|
+
{"version":3,"file":"data-toolbar.js","names":[],"sources":["../../../src/components/data-toolbar/data-toolbar.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, forwardRef, useContext, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dataToolbar } from \"../../styled-system/recipes\";\n\ninterface SelectionContextValue {\n count: number;\n onClear: (() => void) | undefined;\n}\n\nconst SelectionContext = createContext<SelectionContextValue | null>(null);\n\nexport type DataToolbarRootProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataToolbarRoot = forwardRef<HTMLDivElement, DataToolbarRootProps>(\n function DataToolbarRoot({ className, role, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataToolbar().root, className)}\n data-jaci-component=\"data-toolbar\"\n data-slot=\"data-toolbar\"\n role={role ?? \"toolbar\"}\n />\n );\n },\n);\n\nexport interface DataToolbarSearchProps\n extends Omit<ComponentPropsWithoutRef<\"input\">, \"defaultValue\" | \"onChange\" | \"value\"> {\n defaultValue?: string;\n onChange?: ComponentPropsWithoutRef<\"input\">[\"onChange\"];\n onValueChange?: (value: string) => void;\n value?: string;\n}\n\nexport const DataToolbarSearch = forwardRef<HTMLInputElement, DataToolbarSearchProps>(\n function DataToolbarSearch(\n { className, defaultValue = \"\", onValueChange, value: controlledValue, ...props },\n ref,\n ) {\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const value = controlledValue ?? uncontrolledValue;\n return (\n <input\n {...props}\n ref={ref}\n className={cx(dataToolbar().search, className)}\n data-slot=\"data-toolbar-search\"\n onChange={(event) => {\n if (controlledValue === undefined) setUncontrolledValue(event.currentTarget.value);\n onValueChange?.(event.currentTarget.value);\n props.onChange?.(event);\n }}\n type={props.type ?? \"search\"}\n value={value}\n />\n );\n },\n);\n\nexport type DataToolbarFiltersProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataToolbarFilters = forwardRef<HTMLDivElement, DataToolbarFiltersProps>(\n function DataToolbarFilters({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataToolbar().filters, className)}\n data-slot=\"data-toolbar-filters\"\n />\n );\n },\n);\n\nexport interface DataToolbarSortProps\n extends Omit<ComponentPropsWithoutRef<\"select\">, \"defaultValue\" | \"onChange\" | \"value\"> {\n defaultValue?: string;\n onChange?: ComponentPropsWithoutRef<\"select\">[\"onChange\"];\n onValueChange?: (value: string) => void;\n value?: string;\n}\n\nexport const DataToolbarSort = forwardRef<HTMLSelectElement, DataToolbarSortProps>(\n function DataToolbarSort(\n { className, defaultValue = \"\", onValueChange, value: controlledValue, ...props },\n ref,\n ) {\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const value = controlledValue ?? uncontrolledValue;\n return (\n <select\n {...props}\n ref={ref}\n className={cx(dataToolbar().sort, className)}\n data-slot=\"data-toolbar-sort\"\n onChange={(event) => {\n if (controlledValue === undefined) setUncontrolledValue(event.currentTarget.value);\n onValueChange?.(event.currentTarget.value);\n props.onChange?.(event);\n }}\n value={value}\n />\n );\n },\n);\n\nexport interface DataToolbarSelectionProps extends ComponentPropsWithoutRef<\"div\"> {\n count: number;\n label?: ReactNode;\n onClear?: () => void;\n}\nexport const DataToolbarSelection = forwardRef<HTMLDivElement, DataToolbarSelectionProps>(\n function DataToolbarSelection(\n { children, className, count, label = \"selected\", onClear, ...props },\n ref,\n ) {\n return (\n <SelectionContext.Provider value={{ count, onClear }}>\n <div\n {...props}\n ref={ref}\n aria-live=\"polite\"\n className={cx(dataToolbar().selection, className)}\n data-count={count}\n data-slot=\"data-toolbar-selection\"\n >\n {children ?? `${count} ${label}`}\n </div>\n </SelectionContext.Provider>\n );\n },\n);\n\nexport interface DataToolbarClearSelectionProps extends ComponentPropsWithoutRef<\"button\"> {\n children?: ReactNode;\n}\nexport const DataToolbarClearSelection = forwardRef<\n HTMLButtonElement,\n DataToolbarClearSelectionProps\n>(function DataToolbarClearSelection(\n { children = \"Clear selection\", className, onClick, ...props },\n ref,\n) {\n const context = useContext(SelectionContext);\n return (\n <button\n {...props}\n ref={ref}\n className={cx(dataToolbar().clearSelection, className)}\n data-slot=\"data-toolbar-clear-selection\"\n onClick={(event) => {\n context?.onClear?.();\n onClick?.(event);\n }}\n type=\"button\"\n >\n {children}\n </button>\n );\n});\n\nexport type DataToolbarActionsProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataToolbarActions = forwardRef<HTMLDivElement, DataToolbarActionsProps>(\n function DataToolbarActions({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataToolbar().actions, className)}\n data-slot=\"data-toolbar-actions\"\n />\n );\n },\n);\n\nexport type DataToolbarClearProps = ComponentPropsWithoutRef<\"button\">;\nexport const DataToolbarClear = forwardRef<HTMLButtonElement, DataToolbarClearProps>(\n function DataToolbarClear({ children = \"Clear filters\", className, ...props }, ref) {\n return (\n <button\n {...props}\n ref={ref}\n className={cx(dataToolbar().clear, className)}\n data-slot=\"data-toolbar-clear\"\n type=\"button\"\n >\n {children}\n </button>\n );\n },\n);\n\nexport type DataToolbarSeparatorProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataToolbarSeparator = forwardRef<HTMLDivElement, DataToolbarSeparatorProps>(\n function DataToolbarSeparator({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n aria-hidden=\"true\"\n className={cx(dataToolbar().separator, className)}\n data-slot=\"data-toolbar-separator\"\n />\n );\n },\n);\n\nexport const DataToolbar = {\n Root: DataToolbarRoot,\n Search: DataToolbarSearch,\n Filters: DataToolbarFilters,\n Sort: DataToolbarSort,\n Selection: DataToolbarSelection,\n ClearSelection: DataToolbarClearSelection,\n Actions: DataToolbarActions,\n Clear: DataToolbarClear,\n Separator: DataToolbarSeparator,\n};\n"],"mappings":";;;;;;AAaA,MAAM,mBAAmB,cAA4C,IAAI;AAGzE,MAAa,kBAAkB,WAC7B,SAAS,gBAAgB,EAAE,WAAW,MAAM,GAAG,SAAS,KAAK;CAC3D,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,YAAY,CAAC,CAAC,MAAM,SAAS;EAC3C,uBAAoB;EACpB,aAAU;EACV,MAAM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;CACN,QAAQ;CACR,SAAS;CACT,MAAM;CACN,WAAW;CACX,gBAAgB;CAChB,SAAS;CACT,OAAO;CACP,WAAW;AACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-view.cjs","names":["dataView","cx"],"sources":["../../../src/components/data-view/data-view.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dataView } from \"../../styled-system/recipes\";\n\nexport type DataViewLayout = \"table\" | \"list\" | \"grid\";\nexport type DataViewColumns = 1 | 2 | 3 | 4;\nexport type DataViewStatus = \"idle\" | \"loading\" | \"empty\" | \"error\" | \"ready\";\n\nexport interface DataViewRootProps extends Omit<ComponentPropsWithoutRef<\"section\">, \"children\"> {\n children?: ReactNode;\n columns?: DataViewColumns;\n layout?: DataViewLayout;\n status?: DataViewStatus;\n}\n\nexport const DataViewRoot = forwardRef<HTMLElement, DataViewRootProps>(function DataViewRoot(\n { children, className, columns = 3, layout = \"list\", status = \"idle\", ...props },\n ref,\n) {\n const styles = dataView({ columns: String(columns) as \"1\" | \"2\" | \"3\" | \"4\", layout });\n\n return (\n <section\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n aria-busy={props[\"aria-busy\"] ?? (status === \"loading\" || undefined)}\n data-columns={columns}\n data-jaci-component=\"data-view\"\n data-layout={layout}\n data-status={status}\n data-slot=\"data-view\"\n >\n {children}\n </section>\n );\n});\n\nexport type DataViewToolbarProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataViewToolbar = forwardRef<HTMLDivElement, DataViewToolbarProps>(\n function DataViewToolbar({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataView().toolbar, className)}\n data-slot=\"data-view-toolbar\"\n />\n );\n },\n);\n\nexport type DataViewFiltersProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataViewFilters = forwardRef<HTMLDivElement, DataViewFiltersProps>(\n function DataViewFilters({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataView().filters, className)}\n data-slot=\"data-view-filters\"\n />\n );\n },\n);\n\nexport type DataViewContentProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataViewContent = forwardRef<HTMLDivElement, DataViewContentProps>(\n function DataViewContent({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataView().content, className)}\n data-slot=\"data-view-content\"\n />\n );\n },\n);\n\nexport type DataViewFooterProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataViewFooter = forwardRef<HTMLDivElement, DataViewFooterProps>(\n function DataViewFooter({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataView().footer, className)}\n data-slot=\"data-view-footer\"\n />\n );\n },\n);\n\nexport type DataViewPaginationProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataViewPagination = forwardRef<HTMLDivElement, DataViewPaginationProps>(\n function DataViewPagination({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataView().pagination, className)}\n data-slot=\"data-view-pagination\"\n />\n );\n },\n);\n\nexport interface DataViewStateProps extends ComponentPropsWithoutRef<\"div\"> {\n children?: ReactNode;\n}\n\nexport const DataViewLoading = forwardRef<HTMLDivElement, DataViewStateProps>(\n function DataViewLoading({ children = \"Loading…\", className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n aria-live=\"polite\"\n className={cx(dataView().loading, className)}\n data-slot=\"data-view-loading\"\n >\n {children}\n </div>\n );\n },\n);\n\nexport const DataViewEmpty = forwardRef<HTMLDivElement, DataViewStateProps>(function DataViewEmpty(\n { children = \"No results found.\", className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataView().empty, className)}\n data-slot=\"data-view-empty\"\n >\n {children}\n </div>\n );\n});\n\nexport const DataViewError = forwardRef<HTMLDivElement, DataViewStateProps>(function DataViewError(\n { children = \"Something went wrong.\", className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n aria-live=\"assertive\"\n className={cx(dataView().error, className)}\n data-slot=\"data-view-error\"\n role=\"alert\"\n >\n {children}\n </div>\n );\n});\n\n// biome-ignore lint/suspicious/noShadowRestrictedNames: DataView is the public component API name.\nexport const DataView = {\n Root: DataViewRoot,\n Toolbar: DataViewToolbar,\n Filters: DataViewFilters,\n Content: DataViewContent,\n Footer: DataViewFooter,\n Pagination: DataViewPagination,\n Loading: DataViewLoading,\n Empty: DataViewEmpty,\n Error: DataViewError,\n};\n"],"mappings":";;;;;AAiBA,MAAa,gBAAA,
|
|
1
|
+
{"version":3,"file":"data-view.cjs","names":["forwardRef","dataView","cx"],"sources":["../../../src/components/data-view/data-view.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dataView } from \"../../styled-system/recipes\";\n\nexport type DataViewLayout = \"table\" | \"list\" | \"grid\";\nexport type DataViewColumns = 1 | 2 | 3 | 4;\nexport type DataViewStatus = \"idle\" | \"loading\" | \"empty\" | \"error\" | \"ready\";\n\nexport interface DataViewRootProps extends Omit<ComponentPropsWithoutRef<\"section\">, \"children\"> {\n children?: ReactNode;\n columns?: DataViewColumns;\n layout?: DataViewLayout;\n status?: DataViewStatus;\n}\n\nexport const DataViewRoot = forwardRef<HTMLElement, DataViewRootProps>(function DataViewRoot(\n { children, className, columns = 3, layout = \"list\", status = \"idle\", ...props },\n ref,\n) {\n const styles = dataView({ columns: String(columns) as \"1\" | \"2\" | \"3\" | \"4\", layout });\n\n return (\n <section\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n aria-busy={props[\"aria-busy\"] ?? (status === \"loading\" || undefined)}\n data-columns={columns}\n data-jaci-component=\"data-view\"\n data-layout={layout}\n data-status={status}\n data-slot=\"data-view\"\n >\n {children}\n </section>\n );\n});\n\nexport type DataViewToolbarProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataViewToolbar = forwardRef<HTMLDivElement, DataViewToolbarProps>(\n function DataViewToolbar({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataView().toolbar, className)}\n data-slot=\"data-view-toolbar\"\n />\n );\n },\n);\n\nexport type DataViewFiltersProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataViewFilters = forwardRef<HTMLDivElement, DataViewFiltersProps>(\n function DataViewFilters({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataView().filters, className)}\n data-slot=\"data-view-filters\"\n />\n );\n },\n);\n\nexport type DataViewContentProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataViewContent = forwardRef<HTMLDivElement, DataViewContentProps>(\n function DataViewContent({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataView().content, className)}\n data-slot=\"data-view-content\"\n />\n );\n },\n);\n\nexport type DataViewFooterProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataViewFooter = forwardRef<HTMLDivElement, DataViewFooterProps>(\n function DataViewFooter({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataView().footer, className)}\n data-slot=\"data-view-footer\"\n />\n );\n },\n);\n\nexport type DataViewPaginationProps = ComponentPropsWithoutRef<\"div\">;\nexport const DataViewPagination = forwardRef<HTMLDivElement, DataViewPaginationProps>(\n function DataViewPagination({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataView().pagination, className)}\n data-slot=\"data-view-pagination\"\n />\n );\n },\n);\n\nexport interface DataViewStateProps extends ComponentPropsWithoutRef<\"div\"> {\n children?: ReactNode;\n}\n\nexport const DataViewLoading = forwardRef<HTMLDivElement, DataViewStateProps>(\n function DataViewLoading({ children = \"Loading…\", className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n aria-live=\"polite\"\n className={cx(dataView().loading, className)}\n data-slot=\"data-view-loading\"\n >\n {children}\n </div>\n );\n },\n);\n\nexport const DataViewEmpty = forwardRef<HTMLDivElement, DataViewStateProps>(function DataViewEmpty(\n { children = \"No results found.\", className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dataView().empty, className)}\n data-slot=\"data-view-empty\"\n >\n {children}\n </div>\n );\n});\n\nexport const DataViewError = forwardRef<HTMLDivElement, DataViewStateProps>(function DataViewError(\n { children = \"Something went wrong.\", className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n aria-live=\"assertive\"\n className={cx(dataView().error, className)}\n data-slot=\"data-view-error\"\n role=\"alert\"\n >\n {children}\n </div>\n );\n});\n\n// biome-ignore lint/suspicious/noShadowRestrictedNames: DataView is the public component API name.\nexport const DataView = {\n Root: DataViewRoot,\n Toolbar: DataViewToolbar,\n Filters: DataViewFilters,\n Content: DataViewContent,\n Footer: DataViewFooter,\n Pagination: DataViewPagination,\n Loading: DataViewLoading,\n Empty: DataViewEmpty,\n Error: DataViewError,\n};\n"],"mappings":";;;;;AAiBA,MAAa,gBAAA,GAAeA,MAAAA,WAAAA,CAA2C,SAAS,aAC9E,EAAE,UAAU,WAAW,UAAU,GAAG,SAAS,QAAQ,SAAS,QAAQ,GAAG,SACzE,KACA;CACA,MAAM,SAASC,kBAAAA,SAAS;EAAE,SAAS,OAAO,OAAO;EAA4B;CAAO,CAAC;CAErF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;EACE,GAAI;EACC;EACL,WAAWC,WAAAA,GAAG,OAAO,MAAM,SAAS;EACpC,aAAW,MAAM,iBAAiB,WAAW,aAAa,KAAA;EAC1D,gBAAc;EACd,uBAAoB;EACpB,eAAa;EACb,eAAa;EACb,aAAU;EAET;CACM,CAAA;AAEb,CAAC;AAGD,MAAa,mBAAA,GAAkBF,MAAAA,WAAAA,CAC7B,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAS,KAAK;CACrD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GA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G,SAAS,KAAK;CAC5E,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,aAAU;EACV,WAAWE,WAAAA,GAAGD,kBAAAA,SAAS,CAAC,CAAC,SAAS,SAAS;EAC3C,aAAU;EAET;CACE,CAAA;AAET,CACF;AAEA,MAAa,iBAAA,GAAgBD,MAAAA,WAAAA,CAA+C,SAAS,cACnF,EAAE,WAAW,qBAAqB,WAAW,GAAG,SAChD,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,WAAWE,WAAAA,GAAGD,kBAAAA,SAAS,CAAC,CAAC,OAAO,SAAS;EACzC,aAAU;EAET;CACE,CAAA;AAET,CAAC;AAED,MAAa,iBAAA,GAAgBD,MAAAA,WAAAA,CAA+C,SAAS,cACnF,EAAE,WAAW,yBAAyB,WAAW,GAAG,SACpD,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,aAAU;EACV,WAAWE,WAAAA,GAAGD,kBAAAA,SAAS,CAAC,CAAC,OAAO,SAAS;EACzC,aAAU;EACV,MAAK;EAEJ;CACE,CAAA;AAET,CAAC;AAGD,MAAa,WAAW;CACtB,MAAM;CACN,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;CACR,YAAY;CACZ,SAAS;CACT,OAAO;CACP,OAAO;AACT"}
|
|
@@ -506,13 +506,10 @@ const DatePickerDay = (0, react.forwardRef)(function DatePickerDay({ children, c
|
|
|
506
506
|
nextDate = require_date_utils.addMonths(date, event.shiftKey ? 12 : 1);
|
|
507
507
|
break;
|
|
508
508
|
case "Enter":
|
|
509
|
-
case " ":
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
}
|
|
514
|
-
break;
|
|
515
|
-
default: break;
|
|
509
|
+
case " ": if (!isDisabled) {
|
|
510
|
+
event.preventDefault();
|
|
511
|
+
onSelect(date);
|
|
512
|
+
}
|
|
516
513
|
}
|
|
517
514
|
if (nextDate) {
|
|
518
515
|
event.preventDefault();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.cjs","names":["startOfMonth","datePicker","isBeforeDay","isAfterDay","createCalendarDate","isSameDay","addDays","dateKey","addMonths","toTimeInput","formatDateLabel","BasePopover","toInputMonth","toInputDateTime","toInputDate","cx","withRecipeClassName","useThemePortalProps","formatMonthLabel","getMonthLabels","getDateRangeLabel","getCalendarDays","getWeekdayLabels"],"sources":["../../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { ComponentPropsWithoutRef, KeyboardEvent, MouseEvent, ReactNode, Ref } from \"react\";\nimport type { PopoverRoot as BasePopoverRoot } from \"@base-ui/react/popover\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { datePicker } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\nimport {\n addDays,\n addMonths,\n createCalendarDate,\n dateKey,\n formatDateLabel,\n formatMonthLabel,\n getCalendarDays,\n getDateRangeLabel,\n getMonthLabels,\n getWeekdayLabels,\n isAfterDay,\n isBeforeDay,\n isSameDay,\n startOfMonth,\n toInputDate,\n toInputDateTime,\n toInputMonth,\n toTimeInput,\n} from \"./date-utils\";\nimport type { DatePickerGranularity } from \"./date-utils\";\n\nexport type DatePickerSize = \"sm\" | \"md\" | \"lg\";\nexport type { DatePickerGranularity } from \"./date-utils\";\n\nexport interface DatePickerYearRange {\n start: number;\n end: number;\n}\n\ninterface DatePickerContextValue {\n canNavigate: (amount: number) => boolean;\n close: () => void;\n dateDisabled: (date: Date) => boolean;\n granularity: DatePickerGranularity;\n disabled: boolean;\n focusDate: (date: Date, direction?: number) => void;\n focusedDate: Date;\n formatDate: (date: Date | null) => string;\n labelId: string;\n locale: string;\n month: Date;\n monthDisabled: (date: Date) => boolean;\n onClear: () => void;\n onTimeChange: (value: string) => void;\n onSelect: (date: Date) => void;\n selectMonth: (month: number) => void;\n selectYear: (year: number) => void;\n placeholder: ReactNode;\n registerDay: (key: string, node: HTMLButtonElement | null) => void;\n selected: Date | null;\n setFocusedDate: (date: Date) => void;\n setMonth: (date: Date) => void;\n size: DatePickerSize;\n styles: ReturnType<typeof datePicker>;\n today: Date;\n timeMax: string | undefined;\n timeMin: string | undefined;\n triggerId: string;\n weekStartsOn: number;\n yearRange: DatePickerYearRange;\n}\n\nconst DatePickerContext = createContext<DatePickerContextValue | null>(null);\n\nfunction useDatePickerContext() {\n const context = useContext(DatePickerContext);\n if (!context) {\n throw new Error(\"DatePicker parts must be rendered inside DatePicker.Root.\");\n }\n\n return context;\n}\n\nfunction isSameMonth(left: Date, right: Date) {\n return left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth();\n}\n\nfunction composeRefs<T>(first: Ref<T> | undefined, second: (value: T | null) => void) {\n return (value: T | null) => {\n second(value);\n if (typeof first === \"function\") {\n first(value);\n } else if (first) {\n first.current = value;\n }\n };\n}\n\nexport interface DatePickerRootProps extends Omit<BasePopoverRoot.Props, \"children\"> {\n /** Selected value. Use together with `onValueChange` for a controlled picker. */\n value?: Date | null;\n /** Initial selected value for an uncontrolled picker. */\n defaultValue?: Date | null;\n /** Called after a valid day, month, or time is selected, or when the value is cleared. */\n onValueChange?: (value: Date | null) => void;\n /** Prevents dates before this local calendar day from being selected. */\n minDate?: Date;\n /** Prevents dates after this local calendar day from being selected. */\n maxDate?: Date;\n /** Adds application-specific disabled dates, such as holidays or weekends. */\n isDateDisabled?: (date: Date) => boolean;\n /** Locale used for month, weekday and value formatting. */\n locale?: string;\n /** Called after the visible calendar month changes. */\n onMonthChange?: (month: Date) => void;\n /** First weekday in the calendar, where 0 is Sunday and 1 is Monday. */\n weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n /** Text shown when no date has been selected. */\n placeholder?: ReactNode;\n /** Shared visual size for the trigger and calendar days. */\n size?: DatePickerSize;\n /** Controls whether the picker selects days, months, or date and time. */\n granularity?: DatePickerGranularity;\n /** Inclusive range used by the year selector. */\n yearRange?: DatePickerYearRange;\n /** Reference date used when no value is selected, useful for deterministic SSR and tests. */\n referenceDate?: Date;\n /** Adds a native hidden input using the representation for the selected granularity. */\n name?: string;\n /** Prevents interaction and disables the hidden form input. */\n disabled?: boolean;\n /** Closes the popup after a value is chosen. Defaults to false for date-time mode and true otherwise. */\n closeOnSelect?: boolean;\n children?: ReactNode;\n}\n\nexport function DatePickerRoot({\n children,\n closeOnSelect: closeOnSelectProp,\n defaultValue = null,\n disabled = false,\n granularity = \"day\",\n isDateDisabled,\n locale = \"pt-BR\",\n maxDate,\n minDate,\n name,\n onValueChange,\n onMonthChange,\n placeholder = \"Select a date\",\n size = \"md\",\n value: controlledValue,\n weekStartsOn = 0,\n yearRange: configuredYearRange,\n referenceDate,\n actionsRef: externalActionsRef,\n ...popoverProps\n}: DatePickerRootProps) {\n const [uncontrolledValue, setUncontrolledValue] = useState<Date | null>(defaultValue);\n const selected = controlledValue === undefined ? uncontrolledValue : controlledValue;\n const [month, setMonthState] = useState(() =>\n startOfMonth(selected ?? referenceDate ?? new Date()),\n );\n const [focusedDate, setFocusedDate] = useState(selected ?? referenceDate ?? month);\n const previousMonthRef = useRef(month);\n const internalActionsRef = useRef<BasePopoverRoot.Actions | null>(null);\n const dayRefs = useRef(new Map<string, HTMLButtonElement>());\n const labelId = useId();\n const triggerId = useId();\n const today = useMemo(() => referenceDate ?? new Date(), [referenceDate]);\n const styles = datePicker({ size });\n const minMonth = minDate ? startOfMonth(minDate) : undefined;\n const maxMonth = maxDate ? startOfMonth(maxDate) : undefined;\n const closeOnSelect = closeOnSelectProp ?? granularity !== \"date-time\";\n const yearRange = useMemo(() => {\n const defaultStart = today.getFullYear() - 100;\n const defaultEnd = today.getFullYear() + 20;\n const start = configuredYearRange?.start ?? defaultStart;\n const end = configuredYearRange?.end ?? defaultEnd;\n const years = [selected?.getFullYear(), minDate?.getFullYear(), maxDate?.getFullYear()].filter(\n (year): year is number => year !== undefined,\n );\n return {\n end: Math.max(start, end, ...years),\n start: Math.min(start, end, ...years),\n };\n }, [configuredYearRange?.end, configuredYearRange?.start, maxDate, minDate, selected, today]);\n\n const clampMonth = useCallback(\n (nextMonth: Date) => {\n const normalized = startOfMonth(nextMonth);\n if (minMonth && isBeforeDay(normalized, minMonth)) return minMonth;\n if (maxMonth && isAfterDay(normalized, maxMonth)) return maxMonth;\n return normalized;\n },\n [maxMonth, minMonth],\n );\n\n const setMonth = useCallback(\n (nextMonth: Date) => {\n const normalized = clampMonth(nextMonth);\n setMonthState((current) => {\n if (isSameMonth(current, normalized)) return current;\n return normalized;\n });\n },\n [clampMonth],\n );\n\n useEffect(() => {\n if (isSameMonth(previousMonthRef.current, month)) return;\n previousMonthRef.current = month;\n onMonthChange?.(month);\n }, [month, onMonthChange]);\n\n useEffect(() => {\n if (!selected) {\n return;\n }\n\n setFocusedDate(selected);\n setMonthState((current) => (isSameMonth(current, selected) ? current : clampMonth(selected)));\n }, [clampMonth, selected]);\n\n const dateDisabled = useCallback(\n (date: Date) =>\n Boolean(\n (minDate && isBeforeDay(date, minDate)) ||\n (maxDate && isAfterDay(date, maxDate)) ||\n isDateDisabled?.(date),\n ),\n [isDateDisabled, maxDate, minDate],\n );\n\n const close = useCallback(() => {\n (externalActionsRef ?? internalActionsRef).current?.close();\n }, [externalActionsRef]);\n\n const setValue = useCallback(\n (nextValue: Date | null) => {\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue);\n },\n [controlledValue, onValueChange],\n );\n\n const monthDisabled = useCallback(\n (candidate: Date) => {\n const firstDay = startOfMonth(candidate);\n const lastDay = createCalendarDate(candidate.getFullYear(), candidate.getMonth() + 1, 0);\n return Boolean(\n (minDate && isBeforeDay(lastDay, minDate)) || (maxDate && isAfterDay(firstDay, maxDate)),\n );\n },\n [maxDate, minDate],\n );\n\n const onSelect = useCallback(\n (date: Date) => {\n if (disabled || (granularity === \"month\" ? monthDisabled(date) : dateDisabled(date))) {\n return;\n }\n\n const nextValue = createCalendarDate(\n date.getFullYear(),\n date.getMonth(),\n granularity === \"month\" ? 1 : date.getDate(),\n );\n if (granularity === \"date-time\") {\n nextValue.setHours(selected?.getHours() ?? 12, selected?.getMinutes() ?? 0, 0, 0);\n if (minDate && isSameDay(nextValue, minDate) && nextValue < minDate) {\n nextValue.setHours(minDate.getHours(), minDate.getMinutes(), 0, 0);\n }\n if (maxDate && isSameDay(nextValue, maxDate) && nextValue > maxDate) {\n nextValue.setHours(maxDate.getHours(), maxDate.getMinutes(), 0, 0);\n }\n }\n setValue(nextValue);\n setFocusedDate(nextValue);\n setMonth(startOfMonth(nextValue));\n if (closeOnSelect) {\n close();\n }\n },\n [\n close,\n closeOnSelect,\n dateDisabled,\n disabled,\n granularity,\n maxDate,\n monthDisabled,\n minDate,\n selected,\n setMonth,\n setValue,\n ],\n );\n\n const onClear = useCallback(() => {\n setValue(null);\n }, [setValue]);\n\n const selectMonth = useCallback(\n (monthIndex: number) => {\n const nextMonth = clampMonth(createCalendarDate(month.getFullYear(), monthIndex, 1));\n if (monthDisabled(nextMonth)) return;\n setMonth(nextMonth);\n if (granularity === \"month\") {\n const nextValue = createCalendarDate(nextMonth.getFullYear(), nextMonth.getMonth(), 1);\n setFocusedDate(nextValue);\n setValue(nextValue);\n if (closeOnSelect) close();\n }\n },\n [clampMonth, close, closeOnSelect, granularity, month, monthDisabled, setMonth, setValue],\n );\n\n const selectYear = useCallback(\n (year: number) => {\n const nextMonth = clampMonth(createCalendarDate(year, month.getMonth(), 1));\n if (monthDisabled(nextMonth)) return;\n setMonth(nextMonth);\n if (granularity === \"month\") {\n const nextValue = createCalendarDate(nextMonth.getFullYear(), nextMonth.getMonth(), 1);\n setFocusedDate(nextValue);\n setValue(nextValue);\n if (closeOnSelect) close();\n }\n },\n [clampMonth, close, closeOnSelect, granularity, month, monthDisabled, setMonth, setValue],\n );\n\n const onTimeChange = useCallback(\n (value: string) => {\n const match = value.match(/^(\\d{2}):(\\d{2})$/);\n if (!match) return;\n const hours = Number(match[1]);\n const minutes = Number(match[2]);\n if (hours > 23 || minutes > 59) return;\n const baseDate = selected ?? focusedDate;\n const nextValue = createCalendarDate(\n baseDate.getFullYear(),\n baseDate.getMonth(),\n baseDate.getDate(),\n );\n nextValue.setHours(hours, minutes, 0, 0);\n if (minDate && isSameDay(nextValue, minDate) && nextValue < minDate) return;\n if (maxDate && isSameDay(nextValue, maxDate) && nextValue > maxDate) return;\n setValue(nextValue);\n },\n [focusedDate, maxDate, minDate, selected, setValue],\n );\n\n const focusDate = useCallback(\n (date: Date, direction = 1) => {\n let nextDate = createCalendarDate(date.getFullYear(), date.getMonth(), date.getDate());\n const step = direction < 0 ? -1 : 1;\n let attempts = 0;\n while (dateDisabled(nextDate) && attempts < 366) {\n nextDate = addDays(nextDate, step);\n attempts += 1;\n }\n\n setFocusedDate(nextDate);\n setMonth(nextDate);\n\n const focusTarget = () => dayRefs.current.get(dateKey(nextDate))?.focus();\n focusTarget();\n queueMicrotask(focusTarget);\n },\n [dateDisabled, setMonth],\n );\n\n const canNavigate = useCallback(\n (amount: number) => {\n const nextMonth = addMonths(month, amount);\n return !(\n (minMonth && isBeforeDay(nextMonth, minMonth)) ||\n (maxMonth && isAfterDay(nextMonth, maxMonth))\n );\n },\n [maxMonth, minMonth, month],\n );\n\n const registerDay = useCallback((key: string, node: HTMLButtonElement | null) => {\n if (node) {\n dayRefs.current.set(key, node);\n } else {\n dayRefs.current.delete(key);\n }\n }, []);\n\n const timeMin =\n selected && minDate && isSameDay(selected, minDate) ? toTimeInput(minDate) : undefined;\n const timeMax =\n selected && maxDate && isSameDay(selected, maxDate) ? toTimeInput(maxDate) : undefined;\n\n const context: DatePickerContextValue = {\n canNavigate,\n close,\n dateDisabled,\n granularity,\n disabled,\n focusDate,\n focusedDate,\n formatDate: (date) => formatDateLabel(date, locale, String(placeholder), granularity),\n labelId,\n locale,\n month,\n monthDisabled,\n onClear,\n onTimeChange,\n onSelect,\n selectMonth,\n selectYear,\n placeholder,\n registerDay,\n selected,\n setFocusedDate,\n setMonth,\n size,\n styles,\n today: createCalendarDate(today.getFullYear(), today.getMonth(), today.getDate()),\n timeMax,\n timeMin,\n triggerId,\n weekStartsOn,\n yearRange,\n };\n\n return (\n <DatePickerContext.Provider value={context}>\n <BasePopover.Root {...popoverProps} actionsRef={externalActionsRef ?? internalActionsRef}>\n {children}\n </BasePopover.Root>\n {name ? (\n <input\n disabled={disabled}\n name={name}\n type=\"hidden\"\n value={\n granularity === \"month\"\n ? toInputMonth(selected)\n : granularity === \"date-time\"\n ? toInputDateTime(selected)\n : toInputDate(selected)\n }\n />\n ) : null}\n </DatePickerContext.Provider>\n );\n}\n\nexport type DatePickerLabelProps = ComponentPropsWithoutRef<\"label\">;\n\nexport const DatePickerLabel = forwardRef<HTMLLabelElement, DatePickerLabelProps>(\n function DatePickerLabel({ children, className, ...props }, ref) {\n const { labelId, styles, triggerId } = useDatePickerContext();\n\n return (\n <label\n {...props}\n ref={ref}\n className={cx(styles.label, className)}\n data-slot=\"date-picker-label\"\n htmlFor={props.htmlFor ?? triggerId}\n id={props.id ?? labelId}\n >\n {children}\n </label>\n );\n },\n);\n\nexport type DatePickerControlProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DatePickerControl = forwardRef<HTMLDivElement, DatePickerControlProps>(\n function DatePickerControl({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <div\n {...props}\n ref={ref}\n className={cx(styles.control, className)}\n data-jaci-component=\"date-picker\"\n data-slot=\"date-picker-control\"\n />\n );\n },\n);\n\nexport type DatePickerTriggerProps = ComponentPropsWithoutRef<typeof BasePopover.Trigger>;\n\nexport const DatePickerTrigger = forwardRef<HTMLButtonElement, DatePickerTriggerProps>(\n function DatePickerTrigger({ children, className, disabled, id, ...props }, ref) {\n const { disabled: pickerDisabled, styles, triggerId } = useDatePickerContext();\n\n return (\n <BasePopover.Trigger\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Choose date\"}\n disabled={disabled ?? pickerDisabled}\n id={id ?? triggerId}\n ref={ref}\n className={withRecipeClassName(styles.trigger, className)}\n data-jaci-component=\"date-picker\"\n data-slot=\"date-picker-trigger\"\n >\n {children ?? (\n <>\n <DatePickerValue />\n <span aria-hidden=\"true\">▾</span>\n </>\n )}\n </BasePopover.Trigger>\n );\n },\n);\n\nexport interface DatePickerValueProps extends ComponentPropsWithoutRef<\"span\"> {\n placeholder?: ReactNode;\n}\n\nexport const DatePickerValue = forwardRef<HTMLSpanElement, DatePickerValueProps>(\n function DatePickerValue({ children, className, placeholder, ...props }, ref) {\n const { formatDate, selected, styles } = useDatePickerContext();\n const value = children ?? (selected ? formatDate(selected) : (placeholder ?? \"Select a date\"));\n\n return (\n <span\n {...props}\n ref={ref}\n className={cx(styles.value, className)}\n data-placeholder={selected ? undefined : \"true\"}\n data-slot=\"date-picker-value\"\n >\n {value}\n </span>\n );\n },\n);\n\nexport type DatePickerClearProps = ComponentPropsWithoutRef<\"button\">;\n\nexport const DatePickerClear = forwardRef<HTMLButtonElement, DatePickerClearProps>(\n function DatePickerClear({ children = \"×\", className, disabled, onClick, ...props }, ref) {\n const { close, disabled: pickerDisabled, onClear, selected, styles } = useDatePickerContext();\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClear();\n onClick?.(event);\n close();\n };\n\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Clear date\"}\n className={cx(styles.clear, className)}\n data-slot=\"date-picker-clear\"\n disabled={disabled || pickerDisabled || !selected}\n onClick={handleClick}\n ref={ref}\n type=\"button\"\n >\n {children}\n </button>\n );\n },\n);\n\nexport type DatePickerPortalProps = ComponentPropsWithoutRef<typeof BasePopover.Portal>;\nexport function DatePickerPortal(props: DatePickerPortalProps) {\n return <BasePopover.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type DatePickerPositionerProps = ComponentPropsWithoutRef<typeof BasePopover.Positioner>;\n\nexport const DatePickerPositioner = forwardRef<HTMLDivElement, DatePickerPositionerProps>(\n function DatePickerPositioner({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <BasePopover.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.positioner, className)}\n data-slot=\"date-picker-positioner\"\n />\n );\n },\n);\n\nexport type DatePickerPopupProps = ComponentPropsWithoutRef<typeof BasePopover.Popup>;\n\nexport const DatePickerPopup = forwardRef<HTMLDivElement, DatePickerPopupProps>(\n function DatePickerPopup({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <BasePopover.Popup\n {...props}\n ref={ref}\n aria-label={props[\"aria-label\"] ?? \"Calendar\"}\n className={withRecipeClassName(styles.popup, className)}\n data-slot=\"date-picker-popup\"\n />\n );\n },\n);\n\nexport type DatePickerCloseProps = ComponentPropsWithoutRef<typeof BasePopover.Close>;\n\nexport const DatePickerClose = forwardRef<HTMLButtonElement, DatePickerCloseProps>(\n function DatePickerClose({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <BasePopover.Close\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.close, className)}\n data-slot=\"date-picker-close\"\n />\n );\n },\n);\n\nexport type DatePickerHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DatePickerHeader = forwardRef<HTMLDivElement, DatePickerHeaderProps>(\n function DatePickerHeader({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <div\n {...props}\n ref={ref}\n className={cx(styles.header, className)}\n data-slot=\"date-picker-header\"\n />\n );\n },\n);\n\nexport type DatePickerCaptionProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const DatePickerCaption = forwardRef<HTMLSpanElement, DatePickerCaptionProps>(\n function DatePickerCaption({ children, className, ...props }, ref) {\n const { locale, month, styles } = useDatePickerContext();\n\n return (\n <span\n {...props}\n ref={ref}\n className={cx(styles.caption, className)}\n data-slot=\"date-picker-caption\"\n >\n {children ?? formatMonthLabel(month, locale)}\n </span>\n );\n },\n);\n\nexport type DatePickerMonthSelectProps = Omit<\n ComponentPropsWithoutRef<\"select\">,\n \"children\" | \"onChange\" | \"value\"\n>;\n\nexport const DatePickerMonthSelect = forwardRef<HTMLSelectElement, DatePickerMonthSelectProps>(\n function DatePickerMonthSelect({ className, ...props }, ref) {\n const { locale, month, monthDisabled, selectMonth, styles } = useDatePickerContext();\n const labels = getMonthLabels(locale);\n\n return (\n <select\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select month\"}\n className={cx(styles.monthSelect, className)}\n data-slot=\"date-picker-month-select\"\n onChange={(event) => selectMonth(Number(event.currentTarget.value))}\n ref={ref}\n value={month.getMonth()}\n >\n {labels.map((label, monthIndex) => (\n <option\n disabled={monthDisabled(createCalendarDate(month.getFullYear(), monthIndex, 1))}\n key={label}\n value={monthIndex}\n >\n {label}\n </option>\n ))}\n </select>\n );\n },\n);\n\nexport type DatePickerYearSelectProps = Omit<\n ComponentPropsWithoutRef<\"select\">,\n \"children\" | \"onChange\" | \"value\"\n>;\n\nexport const DatePickerYearSelect = forwardRef<HTMLSelectElement, DatePickerYearSelectProps>(\n function DatePickerYearSelect({ className, ...props }, ref) {\n const { month, monthDisabled, selectYear, styles, yearRange } = useDatePickerContext();\n const years = Array.from(\n { length: yearRange.end - yearRange.start + 1 },\n (_, index) => yearRange.start + index,\n );\n\n return (\n <select\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select year\"}\n className={cx(styles.yearSelect, className)}\n data-slot=\"date-picker-year-select\"\n onChange={(event) => selectYear(Number(event.currentTarget.value))}\n ref={ref}\n value={month.getFullYear()}\n >\n {years.map((year) => (\n <option\n disabled={monthDisabled(createCalendarDate(year, month.getMonth(), 1))}\n key={year}\n value={year}\n >\n {year}\n </option>\n ))}\n </select>\n );\n },\n);\n\nexport type DatePickerTimeFieldProps = Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"onChange\" | \"type\" | \"value\"\n>;\n\nexport const DatePickerTimeField = forwardRef<HTMLInputElement, DatePickerTimeFieldProps>(\n function DatePickerTimeField({ className, ...props }, ref) {\n const { disabled, granularity, onTimeChange, selected, styles, timeMax, timeMin } =\n useDatePickerContext();\n if (granularity !== \"date-time\") return null;\n\n return (\n <input\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select time\"}\n className={cx(styles.timeField, className)}\n data-slot=\"date-picker-time-field\"\n disabled={disabled || !selected}\n max={timeMax}\n min={timeMin}\n onChange={(event) => onTimeChange(event.currentTarget.value)}\n ref={ref}\n type=\"time\"\n value={toTimeInput(selected)}\n />\n );\n },\n);\n\nexport interface DatePickerNavigationProps extends ComponentPropsWithoutRef<\"button\"> {\n amount?: number;\n}\n\nconst DatePickerNavigationButton = forwardRef<HTMLButtonElement, DatePickerNavigationProps>(\n function DatePickerNavigationButton({ amount, children, className, onClick, ...props }, ref) {\n const { canNavigate, month, setMonth, styles } = useDatePickerContext();\n const direction = amount ?? 1;\n const isDisabled = props.disabled || !canNavigate(direction);\n\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? (direction < 0 ? \"Previous month\" : \"Next month\")}\n className={cx(styles.navigation, className)}\n data-slot={direction < 0 ? \"date-picker-previous\" : \"date-picker-next\"}\n disabled={isDisabled}\n onClick={(event) => {\n if (!isDisabled) setMonth(addMonths(month, direction));\n onClick?.(event);\n }}\n ref={ref}\n type=\"button\"\n >\n {children ?? (direction < 0 ? \"‹\" : \"›\")}\n </button>\n );\n },\n);\n\nexport const DatePickerPrevious = forwardRef<HTMLButtonElement, DatePickerNavigationProps>(\n function DatePickerPrevious(props, ref) {\n return <DatePickerNavigationButton {...props} amount={-1} ref={ref} />;\n },\n);\n\nexport const DatePickerNext = forwardRef<HTMLButtonElement, DatePickerNavigationProps>(\n function DatePickerNext(props, ref) {\n return <DatePickerNavigationButton {...props} amount={1} ref={ref} />;\n },\n);\n\nexport interface DatePickerDayProps extends Omit<ComponentPropsWithoutRef<\"button\">, \"value\"> {\n date: Date;\n}\n\nexport const DatePickerDay = forwardRef<HTMLButtonElement, DatePickerDayProps>(\n function DatePickerDay(\n { children, className, date, disabled, onClick, onKeyDown, ...props },\n ref,\n ) {\n const {\n dateDisabled,\n disabled: pickerDisabled,\n focusDate,\n focusedDate,\n locale,\n month,\n onSelect,\n registerDay,\n selected,\n styles,\n today,\n weekStartsOn,\n } = useDatePickerContext();\n const key = dateKey(date);\n const outsideMonth = !isSameMonth(date, month);\n const isDisabled = disabled || pickerDisabled || dateDisabled(date);\n const isFocused = isSameDay(date, focusedDate);\n const isSelected = isSameDay(date, selected);\n const isToday = isSameDay(date, today);\n const dayRef = composeRefs(ref, (node) => registerDay(key, node));\n\n const moveByKey = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (event.defaultPrevented) {\n return;\n }\n\n let nextDate: Date | undefined;\n switch (event.key) {\n case \"ArrowLeft\":\n nextDate = addDays(date, -1);\n break;\n case \"ArrowRight\":\n nextDate = addDays(date, 1);\n break;\n case \"ArrowUp\":\n nextDate = addDays(date, -7);\n break;\n case \"ArrowDown\":\n nextDate = addDays(date, 7);\n break;\n case \"Home\":\n nextDate = addDays(date, -((date.getDay() - weekStartsOn + 7) % 7));\n break;\n case \"End\":\n nextDate = addDays(date, 6 - ((date.getDay() - weekStartsOn + 7) % 7));\n break;\n case \"PageUp\":\n nextDate = addMonths(date, event.shiftKey ? -12 : -1);\n break;\n case \"PageDown\":\n nextDate = addMonths(date, event.shiftKey ? 12 : 1);\n break;\n case \"Enter\":\n case \" \":\n if (!isDisabled) {\n event.preventDefault();\n onSelect(date);\n }\n break;\n default:\n break;\n }\n\n if (nextDate) {\n event.preventDefault();\n focusDate(nextDate, nextDate < date ? -1 : 1);\n }\n };\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: A calendar day is an interactive gridcell, not a generic table cell.\n <button\n {...props}\n ref={dayRef}\n aria-label={props[\"aria-label\"] ?? getDateRangeLabel(date, locale)}\n aria-current={isToday ? \"date\" : undefined}\n aria-selected={isSelected}\n className={cx(styles.day, className)}\n data-date={key}\n data-disabled={isDisabled || undefined}\n data-outside-month={outsideMonth || undefined}\n data-selected={isSelected || undefined}\n data-slot=\"date-picker-day\"\n data-today={isToday || undefined}\n disabled={isDisabled}\n onClick={(event) => {\n onSelect(date);\n onClick?.(event);\n }}\n onKeyDown={(event) => {\n moveByKey(event);\n onKeyDown?.(event);\n }}\n role=\"gridcell\"\n tabIndex={isFocused && !isDisabled ? 0 : -1}\n type=\"button\"\n >\n {children ?? date.getDate()}\n </button>\n );\n },\n);\n\ninterface DatePickerMonthButtonProps {\n date: Date;\n}\n\nconst DatePickerMonthButton = forwardRef<HTMLButtonElement, DatePickerMonthButtonProps>(\n function DatePickerMonthButton({ date }, ref) {\n const { disabled, granularity, locale, monthDisabled, onSelect, selected, styles } =\n useDatePickerContext();\n const isDisabled = disabled || monthDisabled(date);\n const isSelected = granularity === \"month\" && Boolean(selected && isSameMonth(selected, date));\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: Month choices use the calendar gridcell pattern.\n <button\n aria-label={new Intl.DateTimeFormat(locale, { month: \"long\" }).format(date)}\n aria-selected={isSelected}\n className={styles.month}\n data-disabled={isDisabled || undefined}\n data-selected={isSelected || undefined}\n data-slot=\"date-picker-month\"\n disabled={isDisabled}\n onClick={() => onSelect(date)}\n ref={ref}\n role=\"gridcell\"\n type=\"button\"\n >\n {new Intl.DateTimeFormat(locale, { month: \"short\" }).format(date)}\n </button>\n );\n },\n);\n\nexport interface DatePickerCalendarProps\n extends Omit<ComponentPropsWithoutRef<\"section\">, \"children\"> {\n \"aria-label\"?: string;\n}\n\nexport const DatePickerCalendar = forwardRef<HTMLElement, DatePickerCalendarProps>(\n function DatePickerCalendar({ \"aria-label\": ariaLabel, className, ...props }, ref) {\n const { granularity, locale, month, styles, weekStartsOn } = useDatePickerContext();\n const days = useMemo(() => getCalendarDays(month, weekStartsOn), [month, weekStartsOn]);\n const weekdays = useMemo(() => getWeekdayLabels(locale, weekStartsOn), [locale, weekStartsOn]);\n const monthDates = useMemo(\n () =>\n Array.from({ length: 12 }, (_, index) => createCalendarDate(month.getFullYear(), index, 1)),\n [month],\n );\n\n return (\n <section\n {...props}\n ref={ref}\n aria-label={ariaLabel ?? formatMonthLabel(month, locale)}\n className={cx(styles.calendar, className)}\n data-granularity={granularity}\n data-slot=\"date-picker-calendar\"\n >\n {granularity === \"month\" ? (\n // biome-ignore lint/a11y/useSemanticElements: Month selection uses the calendar grid pattern.\n <div\n aria-label={String(month.getFullYear())}\n className={styles.monthGrid}\n data-slot=\"date-picker-month-grid\"\n role=\"grid\"\n >\n {monthDates.map((date) => (\n <DatePickerMonthButton date={date} key={dateKey(date)} />\n ))}\n </div>\n ) : (\n <>\n <div aria-hidden=\"true\" className={styles.weekdays} data-slot=\"date-picker-weekdays\">\n {weekdays.map((weekday) => (\n <span className={styles.weekday} data-slot=\"date-picker-weekday\" key={weekday}>\n {weekday}\n </span>\n ))}\n </div>\n {/* biome-ignore lint/a11y/useSemanticElements: Calendar grids use the WAI-ARIA grid pattern for roving day focus. */}\n <div\n aria-label={formatMonthLabel(month, locale)}\n className={styles.grid}\n data-slot=\"date-picker-grid\"\n role=\"grid\"\n >\n {days.map((date) => (\n <DatePickerDay date={date} key={dateKey(date)} />\n ))}\n </div>\n </>\n )}\n </section>\n );\n },\n);\n\nexport const DatePicker = {\n Root: DatePickerRoot,\n Label: DatePickerLabel,\n Control: DatePickerControl,\n Trigger: DatePickerTrigger,\n Value: DatePickerValue,\n Clear: DatePickerClear,\n Portal: DatePickerPortal,\n Positioner: DatePickerPositioner,\n Popup: DatePickerPopup,\n Close: DatePickerClose,\n Header: DatePickerHeader,\n Caption: DatePickerCaption,\n MonthSelect: DatePickerMonthSelect,\n YearSelect: DatePickerYearSelect,\n TimeField: DatePickerTimeField,\n Previous: DatePickerPrevious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AAQ;CACR,YAAY;CACZ,OAAO;CACP,OAAO;CACP,QAAQ;CACR,SAAS;CACT,aAAa;CACb,YAAY;CACZ,WAAW;CACX,UAAU;CACV,MAAM;CACN,KAAK;CACL,UAAU;AACZ"}
|
|
1
|
+
{"version":3,"file":"date-picker.cjs","names":["createContext","useContext","useState","startOfMonth","useRef","useId","useMemo","datePicker","useCallback","isBeforeDay","isAfterDay","createCalendarDate","isSameDay","addDays","dateKey","addMonths","toTimeInput","formatDateLabel","BasePopover","toInputMonth","toInputDateTime","toInputDate","forwardRef","cx","withRecipeClassName","useThemePortalProps","formatMonthLabel","getMonthLabels","getDateRangeLabel","getCalendarDays","getWeekdayLabels"],"sources":["../../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["\"use client\";\n\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { ComponentPropsWithoutRef, KeyboardEvent, MouseEvent, ReactNode, Ref } from \"react\";\nimport type { PopoverRoot as BasePopoverRoot } from \"@base-ui/react/popover\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { datePicker } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\nimport {\n addDays,\n addMonths,\n createCalendarDate,\n dateKey,\n formatDateLabel,\n formatMonthLabel,\n getCalendarDays,\n getDateRangeLabel,\n getMonthLabels,\n getWeekdayLabels,\n isAfterDay,\n isBeforeDay,\n isSameDay,\n startOfMonth,\n toInputDate,\n toInputDateTime,\n toInputMonth,\n toTimeInput,\n} from \"./date-utils\";\nimport type { DatePickerGranularity } from \"./date-utils\";\n\nexport type DatePickerSize = \"sm\" | \"md\" | \"lg\";\nexport type { DatePickerGranularity } from \"./date-utils\";\n\nexport interface DatePickerYearRange {\n start: number;\n end: number;\n}\n\ninterface DatePickerContextValue {\n canNavigate: (amount: number) => boolean;\n close: () => void;\n dateDisabled: (date: Date) => boolean;\n granularity: DatePickerGranularity;\n disabled: boolean;\n focusDate: (date: Date, direction?: number) => void;\n focusedDate: Date;\n formatDate: (date: Date | null) => string;\n labelId: string;\n locale: string;\n month: Date;\n monthDisabled: (date: Date) => boolean;\n onClear: () => void;\n onTimeChange: (value: string) => void;\n onSelect: (date: Date) => void;\n selectMonth: (month: number) => void;\n selectYear: (year: number) => void;\n placeholder: ReactNode;\n registerDay: (key: string, node: HTMLButtonElement | null) => void;\n selected: Date | null;\n setFocusedDate: (date: Date) => void;\n setMonth: (date: Date) => void;\n size: DatePickerSize;\n styles: ReturnType<typeof datePicker>;\n today: Date;\n timeMax: string | undefined;\n timeMin: string | undefined;\n triggerId: string;\n weekStartsOn: number;\n yearRange: DatePickerYearRange;\n}\n\nconst DatePickerContext = createContext<DatePickerContextValue | null>(null);\n\nfunction useDatePickerContext() {\n const context = useContext(DatePickerContext);\n if (!context) {\n throw new Error(\"DatePicker parts must be rendered inside DatePicker.Root.\");\n }\n\n return context;\n}\n\nfunction isSameMonth(left: Date, right: Date) {\n return left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth();\n}\n\nfunction composeRefs<T>(first: Ref<T> | undefined, second: (value: T | null) => void) {\n return (value: T | null) => {\n second(value);\n if (typeof first === \"function\") {\n first(value);\n } else if (first) {\n first.current = value;\n }\n };\n}\n\nexport interface DatePickerRootProps extends Omit<BasePopoverRoot.Props, \"children\"> {\n /** Selected value. Use together with `onValueChange` for a controlled picker. */\n value?: Date | null;\n /** Initial selected value for an uncontrolled picker. */\n defaultValue?: Date | null;\n /** Called after a valid day, month, or time is selected, or when the value is cleared. */\n onValueChange?: (value: Date | null) => void;\n /** Prevents dates before this local calendar day from being selected. */\n minDate?: Date;\n /** Prevents dates after this local calendar day from being selected. */\n maxDate?: Date;\n /** Adds application-specific disabled dates, such as holidays or weekends. */\n isDateDisabled?: (date: Date) => boolean;\n /** Locale used for month, weekday and value formatting. */\n locale?: string;\n /** Called after the visible calendar month changes. */\n onMonthChange?: (month: Date) => void;\n /** First weekday in the calendar, where 0 is Sunday and 1 is Monday. */\n weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n /** Text shown when no date has been selected. */\n placeholder?: ReactNode;\n /** Shared visual size for the trigger and calendar days. */\n size?: DatePickerSize;\n /** Controls whether the picker selects days, months, or date and time. */\n granularity?: DatePickerGranularity;\n /** Inclusive range used by the year selector. */\n yearRange?: DatePickerYearRange;\n /** Reference date used when no value is selected, useful for deterministic SSR and tests. */\n referenceDate?: Date;\n /** Adds a native hidden input using the representation for the selected granularity. */\n name?: string;\n /** Prevents interaction and disables the hidden form input. */\n disabled?: boolean;\n /** Closes the popup after a value is chosen. Defaults to false for date-time mode and true otherwise. */\n closeOnSelect?: boolean;\n children?: ReactNode;\n}\n\nexport function DatePickerRoot({\n children,\n closeOnSelect: closeOnSelectProp,\n defaultValue = null,\n disabled = false,\n granularity = \"day\",\n isDateDisabled,\n locale = \"pt-BR\",\n maxDate,\n minDate,\n name,\n onValueChange,\n onMonthChange,\n placeholder = \"Select a date\",\n size = \"md\",\n value: controlledValue,\n weekStartsOn = 0,\n yearRange: configuredYearRange,\n referenceDate,\n actionsRef: externalActionsRef,\n ...popoverProps\n}: DatePickerRootProps) {\n const [uncontrolledValue, setUncontrolledValue] = useState<Date | null>(defaultValue);\n const selected = controlledValue === undefined ? uncontrolledValue : controlledValue;\n const [month, setMonthState] = useState(() =>\n startOfMonth(selected ?? referenceDate ?? new Date()),\n );\n const [focusedDate, setFocusedDate] = useState(selected ?? referenceDate ?? month);\n const previousMonthRef = useRef(month);\n const internalActionsRef = useRef<BasePopoverRoot.Actions | null>(null);\n const dayRefs = useRef(new Map<string, HTMLButtonElement>());\n const labelId = useId();\n const triggerId = useId();\n const today = useMemo(() => referenceDate ?? new Date(), [referenceDate]);\n const styles = datePicker({ size });\n const minMonth = minDate ? startOfMonth(minDate) : undefined;\n const maxMonth = maxDate ? startOfMonth(maxDate) : undefined;\n const closeOnSelect = closeOnSelectProp ?? granularity !== \"date-time\";\n const yearRange = useMemo(() => {\n const defaultStart = today.getFullYear() - 100;\n const defaultEnd = today.getFullYear() + 20;\n const start = configuredYearRange?.start ?? defaultStart;\n const end = configuredYearRange?.end ?? defaultEnd;\n const years = [selected?.getFullYear(), minDate?.getFullYear(), maxDate?.getFullYear()].filter(\n (year): year is number => year !== undefined,\n );\n return {\n end: Math.max(start, end, ...years),\n start: Math.min(start, end, ...years),\n };\n }, [configuredYearRange?.end, configuredYearRange?.start, maxDate, minDate, selected, today]);\n\n const clampMonth = useCallback(\n (nextMonth: Date) => {\n const normalized = startOfMonth(nextMonth);\n if (minMonth && isBeforeDay(normalized, minMonth)) return minMonth;\n if (maxMonth && isAfterDay(normalized, maxMonth)) return maxMonth;\n return normalized;\n },\n [maxMonth, minMonth],\n );\n\n const setMonth = useCallback(\n (nextMonth: Date) => {\n const normalized = clampMonth(nextMonth);\n setMonthState((current) => {\n if (isSameMonth(current, normalized)) return current;\n return normalized;\n });\n },\n [clampMonth],\n );\n\n useEffect(() => {\n if (isSameMonth(previousMonthRef.current, month)) return;\n previousMonthRef.current = month;\n onMonthChange?.(month);\n }, [month, onMonthChange]);\n\n useEffect(() => {\n if (!selected) {\n return;\n }\n\n setFocusedDate(selected);\n setMonthState((current) => (isSameMonth(current, selected) ? current : clampMonth(selected)));\n }, [clampMonth, selected]);\n\n const dateDisabled = useCallback(\n (date: Date) =>\n Boolean(\n (minDate && isBeforeDay(date, minDate)) ||\n (maxDate && isAfterDay(date, maxDate)) ||\n isDateDisabled?.(date),\n ),\n [isDateDisabled, maxDate, minDate],\n );\n\n const close = useCallback(() => {\n (externalActionsRef ?? internalActionsRef).current?.close();\n }, [externalActionsRef]);\n\n const setValue = useCallback(\n (nextValue: Date | null) => {\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue);\n },\n [controlledValue, onValueChange],\n );\n\n const monthDisabled = useCallback(\n (candidate: Date) => {\n const firstDay = startOfMonth(candidate);\n const lastDay = createCalendarDate(candidate.getFullYear(), candidate.getMonth() + 1, 0);\n return Boolean(\n (minDate && isBeforeDay(lastDay, minDate)) || (maxDate && isAfterDay(firstDay, maxDate)),\n );\n },\n [maxDate, minDate],\n );\n\n const onSelect = useCallback(\n (date: Date) => {\n if (disabled || (granularity === \"month\" ? monthDisabled(date) : dateDisabled(date))) {\n return;\n }\n\n const nextValue = createCalendarDate(\n date.getFullYear(),\n date.getMonth(),\n granularity === \"month\" ? 1 : date.getDate(),\n );\n if (granularity === \"date-time\") {\n nextValue.setHours(selected?.getHours() ?? 12, selected?.getMinutes() ?? 0, 0, 0);\n if (minDate && isSameDay(nextValue, minDate) && nextValue < minDate) {\n nextValue.setHours(minDate.getHours(), minDate.getMinutes(), 0, 0);\n }\n if (maxDate && isSameDay(nextValue, maxDate) && nextValue > maxDate) {\n nextValue.setHours(maxDate.getHours(), maxDate.getMinutes(), 0, 0);\n }\n }\n setValue(nextValue);\n setFocusedDate(nextValue);\n setMonth(startOfMonth(nextValue));\n if (closeOnSelect) {\n close();\n }\n },\n [\n close,\n closeOnSelect,\n dateDisabled,\n disabled,\n granularity,\n maxDate,\n monthDisabled,\n minDate,\n selected,\n setMonth,\n setValue,\n ],\n );\n\n const onClear = useCallback(() => {\n setValue(null);\n }, [setValue]);\n\n const selectMonth = useCallback(\n (monthIndex: number) => {\n const nextMonth = clampMonth(createCalendarDate(month.getFullYear(), monthIndex, 1));\n if (monthDisabled(nextMonth)) return;\n setMonth(nextMonth);\n if (granularity === \"month\") {\n const nextValue = createCalendarDate(nextMonth.getFullYear(), nextMonth.getMonth(), 1);\n setFocusedDate(nextValue);\n setValue(nextValue);\n if (closeOnSelect) close();\n }\n },\n [clampMonth, close, closeOnSelect, granularity, month, monthDisabled, setMonth, setValue],\n );\n\n const selectYear = useCallback(\n (year: number) => {\n const nextMonth = clampMonth(createCalendarDate(year, month.getMonth(), 1));\n if (monthDisabled(nextMonth)) return;\n setMonth(nextMonth);\n if (granularity === \"month\") {\n const nextValue = createCalendarDate(nextMonth.getFullYear(), nextMonth.getMonth(), 1);\n setFocusedDate(nextValue);\n setValue(nextValue);\n if (closeOnSelect) close();\n }\n },\n [clampMonth, close, closeOnSelect, granularity, month, monthDisabled, setMonth, setValue],\n );\n\n const onTimeChange = useCallback(\n (value: string) => {\n const match = value.match(/^(\\d{2}):(\\d{2})$/);\n if (!match) return;\n const hours = Number(match[1]);\n const minutes = Number(match[2]);\n if (hours > 23 || minutes > 59) return;\n const baseDate = selected ?? focusedDate;\n const nextValue = createCalendarDate(\n baseDate.getFullYear(),\n baseDate.getMonth(),\n baseDate.getDate(),\n );\n nextValue.setHours(hours, minutes, 0, 0);\n if (minDate && isSameDay(nextValue, minDate) && nextValue < minDate) return;\n if (maxDate && isSameDay(nextValue, maxDate) && nextValue > maxDate) return;\n setValue(nextValue);\n },\n [focusedDate, maxDate, minDate, selected, setValue],\n );\n\n const focusDate = useCallback(\n (date: Date, direction = 1) => {\n let nextDate = createCalendarDate(date.getFullYear(), date.getMonth(), date.getDate());\n const step = direction < 0 ? -1 : 1;\n let attempts = 0;\n while (dateDisabled(nextDate) && attempts < 366) {\n nextDate = addDays(nextDate, step);\n attempts += 1;\n }\n\n setFocusedDate(nextDate);\n setMonth(nextDate);\n\n const focusTarget = () => dayRefs.current.get(dateKey(nextDate))?.focus();\n focusTarget();\n queueMicrotask(focusTarget);\n },\n [dateDisabled, setMonth],\n );\n\n const canNavigate = useCallback(\n (amount: number) => {\n const nextMonth = addMonths(month, amount);\n return !(\n (minMonth && isBeforeDay(nextMonth, minMonth)) ||\n (maxMonth && isAfterDay(nextMonth, maxMonth))\n );\n },\n [maxMonth, minMonth, month],\n );\n\n const registerDay = useCallback((key: string, node: HTMLButtonElement | null) => {\n if (node) {\n dayRefs.current.set(key, node);\n } else {\n dayRefs.current.delete(key);\n }\n }, []);\n\n const timeMin =\n selected && minDate && isSameDay(selected, minDate) ? toTimeInput(minDate) : undefined;\n const timeMax =\n selected && maxDate && isSameDay(selected, maxDate) ? toTimeInput(maxDate) : undefined;\n\n const context: DatePickerContextValue = {\n canNavigate,\n close,\n dateDisabled,\n granularity,\n disabled,\n focusDate,\n focusedDate,\n formatDate: (date) => formatDateLabel(date, locale, String(placeholder), granularity),\n labelId,\n locale,\n month,\n monthDisabled,\n onClear,\n onTimeChange,\n onSelect,\n selectMonth,\n selectYear,\n placeholder,\n registerDay,\n selected,\n setFocusedDate,\n setMonth,\n size,\n styles,\n today: createCalendarDate(today.getFullYear(), today.getMonth(), today.getDate()),\n timeMax,\n timeMin,\n triggerId,\n weekStartsOn,\n yearRange,\n };\n\n return (\n <DatePickerContext.Provider value={context}>\n <BasePopover.Root {...popoverProps} actionsRef={externalActionsRef ?? internalActionsRef}>\n {children}\n </BasePopover.Root>\n {name ? (\n <input\n disabled={disabled}\n name={name}\n type=\"hidden\"\n value={\n granularity === \"month\"\n ? toInputMonth(selected)\n : granularity === \"date-time\"\n ? toInputDateTime(selected)\n : toInputDate(selected)\n }\n />\n ) : null}\n </DatePickerContext.Provider>\n );\n}\n\nexport type DatePickerLabelProps = ComponentPropsWithoutRef<\"label\">;\n\nexport const DatePickerLabel = forwardRef<HTMLLabelElement, DatePickerLabelProps>(\n function DatePickerLabel({ children, className, ...props }, ref) {\n const { labelId, styles, triggerId } = useDatePickerContext();\n\n return (\n <label\n {...props}\n ref={ref}\n className={cx(styles.label, className)}\n data-slot=\"date-picker-label\"\n htmlFor={props.htmlFor ?? triggerId}\n id={props.id ?? labelId}\n >\n {children}\n </label>\n );\n },\n);\n\nexport type DatePickerControlProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DatePickerControl = forwardRef<HTMLDivElement, DatePickerControlProps>(\n function DatePickerControl({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <div\n {...props}\n ref={ref}\n className={cx(styles.control, className)}\n data-jaci-component=\"date-picker\"\n data-slot=\"date-picker-control\"\n />\n );\n },\n);\n\nexport type DatePickerTriggerProps = ComponentPropsWithoutRef<typeof BasePopover.Trigger>;\n\nexport const DatePickerTrigger = forwardRef<HTMLButtonElement, DatePickerTriggerProps>(\n function DatePickerTrigger({ children, className, disabled, id, ...props }, ref) {\n const { disabled: pickerDisabled, styles, triggerId } = useDatePickerContext();\n\n return (\n <BasePopover.Trigger\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Choose date\"}\n disabled={disabled ?? pickerDisabled}\n id={id ?? triggerId}\n ref={ref}\n className={withRecipeClassName(styles.trigger, className)}\n data-jaci-component=\"date-picker\"\n data-slot=\"date-picker-trigger\"\n >\n {children ?? (\n <>\n <DatePickerValue />\n <span aria-hidden=\"true\">▾</span>\n </>\n )}\n </BasePopover.Trigger>\n );\n },\n);\n\nexport interface DatePickerValueProps extends ComponentPropsWithoutRef<\"span\"> {\n placeholder?: ReactNode;\n}\n\nexport const DatePickerValue = forwardRef<HTMLSpanElement, DatePickerValueProps>(\n function DatePickerValue({ children, className, placeholder, ...props }, ref) {\n const { formatDate, selected, styles } = useDatePickerContext();\n const value = children ?? (selected ? formatDate(selected) : (placeholder ?? \"Select a date\"));\n\n return (\n <span\n {...props}\n ref={ref}\n className={cx(styles.value, className)}\n data-placeholder={selected ? undefined : \"true\"}\n data-slot=\"date-picker-value\"\n >\n {value}\n </span>\n );\n },\n);\n\nexport type DatePickerClearProps = ComponentPropsWithoutRef<\"button\">;\n\nexport const DatePickerClear = forwardRef<HTMLButtonElement, DatePickerClearProps>(\n function DatePickerClear({ children = \"×\", className, disabled, onClick, ...props }, ref) {\n const { close, disabled: pickerDisabled, onClear, selected, styles } = useDatePickerContext();\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClear();\n onClick?.(event);\n close();\n };\n\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Clear date\"}\n className={cx(styles.clear, className)}\n data-slot=\"date-picker-clear\"\n disabled={disabled || pickerDisabled || !selected}\n onClick={handleClick}\n ref={ref}\n type=\"button\"\n >\n {children}\n </button>\n );\n },\n);\n\nexport type DatePickerPortalProps = ComponentPropsWithoutRef<typeof BasePopover.Portal>;\nexport function DatePickerPortal(props: DatePickerPortalProps) {\n return <BasePopover.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type DatePickerPositionerProps = ComponentPropsWithoutRef<typeof BasePopover.Positioner>;\n\nexport const DatePickerPositioner = forwardRef<HTMLDivElement, DatePickerPositionerProps>(\n function DatePickerPositioner({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <BasePopover.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.positioner, className)}\n data-slot=\"date-picker-positioner\"\n />\n );\n },\n);\n\nexport type DatePickerPopupProps = ComponentPropsWithoutRef<typeof BasePopover.Popup>;\n\nexport const DatePickerPopup = forwardRef<HTMLDivElement, DatePickerPopupProps>(\n function DatePickerPopup({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <BasePopover.Popup\n {...props}\n ref={ref}\n aria-label={props[\"aria-label\"] ?? \"Calendar\"}\n className={withRecipeClassName(styles.popup, className)}\n data-slot=\"date-picker-popup\"\n />\n );\n },\n);\n\nexport type DatePickerCloseProps = ComponentPropsWithoutRef<typeof BasePopover.Close>;\n\nexport const DatePickerClose = forwardRef<HTMLButtonElement, DatePickerCloseProps>(\n function DatePickerClose({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <BasePopover.Close\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.close, className)}\n data-slot=\"date-picker-close\"\n />\n );\n },\n);\n\nexport type DatePickerHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const DatePickerHeader = forwardRef<HTMLDivElement, DatePickerHeaderProps>(\n function DatePickerHeader({ className, ...props }, ref) {\n const { styles } = useDatePickerContext();\n\n return (\n <div\n {...props}\n ref={ref}\n className={cx(styles.header, className)}\n data-slot=\"date-picker-header\"\n />\n );\n },\n);\n\nexport type DatePickerCaptionProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const DatePickerCaption = forwardRef<HTMLSpanElement, DatePickerCaptionProps>(\n function DatePickerCaption({ children, className, ...props }, ref) {\n const { locale, month, styles } = useDatePickerContext();\n\n return (\n <span\n {...props}\n ref={ref}\n className={cx(styles.caption, className)}\n data-slot=\"date-picker-caption\"\n >\n {children ?? formatMonthLabel(month, locale)}\n </span>\n );\n },\n);\n\nexport type DatePickerMonthSelectProps = Omit<\n ComponentPropsWithoutRef<\"select\">,\n \"children\" | \"onChange\" | \"value\"\n>;\n\nexport const DatePickerMonthSelect = forwardRef<HTMLSelectElement, DatePickerMonthSelectProps>(\n function DatePickerMonthSelect({ className, ...props }, ref) {\n const { locale, month, monthDisabled, selectMonth, styles } = useDatePickerContext();\n const labels = getMonthLabels(locale);\n\n return (\n <select\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select month\"}\n className={cx(styles.monthSelect, className)}\n data-slot=\"date-picker-month-select\"\n onChange={(event) => selectMonth(Number(event.currentTarget.value))}\n ref={ref}\n value={month.getMonth()}\n >\n {labels.map((label, monthIndex) => (\n <option\n disabled={monthDisabled(createCalendarDate(month.getFullYear(), monthIndex, 1))}\n key={label}\n value={monthIndex}\n >\n {label}\n </option>\n ))}\n </select>\n );\n },\n);\n\nexport type DatePickerYearSelectProps = Omit<\n ComponentPropsWithoutRef<\"select\">,\n \"children\" | \"onChange\" | \"value\"\n>;\n\nexport const DatePickerYearSelect = forwardRef<HTMLSelectElement, DatePickerYearSelectProps>(\n function DatePickerYearSelect({ className, ...props }, ref) {\n const { month, monthDisabled, selectYear, styles, yearRange } = useDatePickerContext();\n const years = Array.from(\n { length: yearRange.end - yearRange.start + 1 },\n (_, index) => yearRange.start + index,\n );\n\n return (\n <select\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select year\"}\n className={cx(styles.yearSelect, className)}\n data-slot=\"date-picker-year-select\"\n onChange={(event) => selectYear(Number(event.currentTarget.value))}\n ref={ref}\n value={month.getFullYear()}\n >\n {years.map((year) => (\n <option\n disabled={monthDisabled(createCalendarDate(year, month.getMonth(), 1))}\n key={year}\n value={year}\n >\n {year}\n </option>\n ))}\n </select>\n );\n },\n);\n\nexport type DatePickerTimeFieldProps = Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"onChange\" | \"type\" | \"value\"\n>;\n\nexport const DatePickerTimeField = forwardRef<HTMLInputElement, DatePickerTimeFieldProps>(\n function DatePickerTimeField({ className, ...props }, ref) {\n const { disabled, granularity, onTimeChange, selected, styles, timeMax, timeMin } =\n useDatePickerContext();\n if (granularity !== \"date-time\") return null;\n\n return (\n <input\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Select time\"}\n className={cx(styles.timeField, className)}\n data-slot=\"date-picker-time-field\"\n disabled={disabled || !selected}\n max={timeMax}\n min={timeMin}\n onChange={(event) => onTimeChange(event.currentTarget.value)}\n ref={ref}\n type=\"time\"\n value={toTimeInput(selected)}\n />\n );\n },\n);\n\nexport interface DatePickerNavigationProps extends ComponentPropsWithoutRef<\"button\"> {\n amount?: number;\n}\n\nconst DatePickerNavigationButton = forwardRef<HTMLButtonElement, DatePickerNavigationProps>(\n function DatePickerNavigationButton({ amount, children, className, onClick, ...props }, ref) {\n const { canNavigate, month, setMonth, styles } = useDatePickerContext();\n const direction = amount ?? 1;\n const isDisabled = props.disabled || !canNavigate(direction);\n\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? (direction < 0 ? \"Previous month\" : \"Next month\")}\n className={cx(styles.navigation, className)}\n data-slot={direction < 0 ? \"date-picker-previous\" : \"date-picker-next\"}\n disabled={isDisabled}\n onClick={(event) => {\n if (!isDisabled) setMonth(addMonths(month, direction));\n onClick?.(event);\n }}\n ref={ref}\n type=\"button\"\n >\n {children ?? (direction < 0 ? \"‹\" : \"›\")}\n </button>\n );\n },\n);\n\nexport const DatePickerPrevious = forwardRef<HTMLButtonElement, DatePickerNavigationProps>(\n function DatePickerPrevious(props, ref) {\n return <DatePickerNavigationButton {...props} amount={-1} ref={ref} />;\n },\n);\n\nexport const DatePickerNext = forwardRef<HTMLButtonElement, DatePickerNavigationProps>(\n function DatePickerNext(props, ref) {\n return <DatePickerNavigationButton {...props} amount={1} ref={ref} />;\n },\n);\n\nexport interface DatePickerDayProps extends Omit<ComponentPropsWithoutRef<\"button\">, \"value\"> {\n date: Date;\n}\n\nexport const DatePickerDay = forwardRef<HTMLButtonElement, DatePickerDayProps>(\n function DatePickerDay(\n { children, className, date, disabled, onClick, onKeyDown, ...props },\n ref,\n ) {\n const {\n dateDisabled,\n disabled: pickerDisabled,\n focusDate,\n focusedDate,\n locale,\n month,\n onSelect,\n registerDay,\n selected,\n styles,\n today,\n weekStartsOn,\n } = useDatePickerContext();\n const key = dateKey(date);\n const outsideMonth = !isSameMonth(date, month);\n const isDisabled = disabled || pickerDisabled || dateDisabled(date);\n const isFocused = isSameDay(date, focusedDate);\n const isSelected = isSameDay(date, selected);\n const isToday = isSameDay(date, today);\n const dayRef = composeRefs(ref, (node) => registerDay(key, node));\n\n const moveByKey = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (event.defaultPrevented) {\n return;\n }\n\n let nextDate: Date | undefined;\n switch (event.key) {\n case \"ArrowLeft\":\n nextDate = addDays(date, -1);\n break;\n case \"ArrowRight\":\n nextDate = addDays(date, 1);\n break;\n case \"ArrowUp\":\n nextDate = addDays(date, -7);\n break;\n case \"ArrowDown\":\n nextDate = addDays(date, 7);\n break;\n case \"Home\":\n nextDate = addDays(date, -((date.getDay() - weekStartsOn + 7) % 7));\n break;\n case \"End\":\n nextDate = addDays(date, 6 - ((date.getDay() - weekStartsOn + 7) % 7));\n break;\n case \"PageUp\":\n nextDate = addMonths(date, event.shiftKey ? -12 : -1);\n break;\n case \"PageDown\":\n nextDate = addMonths(date, event.shiftKey ? 12 : 1);\n break;\n case \"Enter\":\n case \" \":\n if (!isDisabled) {\n event.preventDefault();\n onSelect(date);\n }\n break;\n default:\n break;\n }\n\n if (nextDate) {\n event.preventDefault();\n focusDate(nextDate, nextDate < date ? -1 : 1);\n }\n };\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: A calendar day is an interactive gridcell, not a generic table cell.\n <button\n {...props}\n ref={dayRef}\n aria-label={props[\"aria-label\"] ?? getDateRangeLabel(date, locale)}\n aria-current={isToday ? \"date\" : undefined}\n aria-selected={isSelected}\n className={cx(styles.day, className)}\n data-date={key}\n data-disabled={isDisabled || undefined}\n data-outside-month={outsideMonth || undefined}\n data-selected={isSelected || undefined}\n data-slot=\"date-picker-day\"\n data-today={isToday || undefined}\n disabled={isDisabled}\n onClick={(event) => {\n onSelect(date);\n onClick?.(event);\n }}\n onKeyDown={(event) => {\n moveByKey(event);\n onKeyDown?.(event);\n }}\n role=\"gridcell\"\n tabIndex={isFocused && !isDisabled ? 0 : -1}\n type=\"button\"\n >\n {children ?? date.getDate()}\n </button>\n );\n },\n);\n\ninterface DatePickerMonthButtonProps {\n date: Date;\n}\n\nconst DatePickerMonthButton = forwardRef<HTMLButtonElement, DatePickerMonthButtonProps>(\n function DatePickerMonthButton({ date }, ref) {\n const { disabled, granularity, locale, monthDisabled, onSelect, selected, styles } =\n useDatePickerContext();\n const isDisabled = disabled || monthDisabled(date);\n const isSelected = granularity === \"month\" && Boolean(selected && isSameMonth(selected, date));\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: Month choices use the calendar gridcell pattern.\n <button\n aria-label={new Intl.DateTimeFormat(locale, { month: \"long\" }).format(date)}\n aria-selected={isSelected}\n className={styles.month}\n data-disabled={isDisabled || undefined}\n data-selected={isSelected || undefined}\n data-slot=\"date-picker-month\"\n disabled={isDisabled}\n onClick={() => onSelect(date)}\n ref={ref}\n role=\"gridcell\"\n type=\"button\"\n >\n {new Intl.DateTimeFormat(locale, { month: \"short\" }).format(date)}\n </button>\n );\n },\n);\n\nexport interface DatePickerCalendarProps\n extends Omit<ComponentPropsWithoutRef<\"section\">, \"children\"> {\n \"aria-label\"?: string;\n}\n\nexport const DatePickerCalendar = forwardRef<HTMLElement, DatePickerCalendarProps>(\n function DatePickerCalendar({ \"aria-label\": ariaLabel, className, ...props }, ref) {\n const { granularity, locale, month, styles, weekStartsOn } = useDatePickerContext();\n const days = useMemo(() => getCalendarDays(month, weekStartsOn), [month, weekStartsOn]);\n const weekdays = useMemo(() => getWeekdayLabels(locale, weekStartsOn), [locale, weekStartsOn]);\n const monthDates = useMemo(\n () =>\n Array.from({ length: 12 }, (_, index) => createCalendarDate(month.getFullYear(), index, 1)),\n [month],\n );\n\n return (\n <section\n {...props}\n ref={ref}\n aria-label={ariaLabel ?? formatMonthLabel(month, locale)}\n className={cx(styles.calendar, className)}\n data-granularity={granularity}\n data-slot=\"date-picker-calendar\"\n >\n {granularity === \"month\" ? (\n // biome-ignore lint/a11y/useSemanticElements: Month selection uses the calendar grid pattern.\n <div\n aria-label={String(month.getFullYear())}\n className={styles.monthGrid}\n data-slot=\"date-picker-month-grid\"\n role=\"grid\"\n >\n {monthDates.map((date) => (\n <DatePickerMonthButton date={date} key={dateKey(date)} />\n ))}\n </div>\n ) : (\n <>\n <div aria-hidden=\"true\" className={styles.weekdays} data-slot=\"date-picker-weekdays\">\n {weekdays.map((weekday) => (\n <span className={styles.weekday} data-slot=\"date-picker-weekday\" key={weekday}>\n {weekday}\n </span>\n ))}\n </div>\n {/* biome-ignore lint/a11y/useSemanticElements: Calendar grids use the WAI-ARIA grid pattern for roving day focus. */}\n <div\n aria-label={formatMonthLabel(month, locale)}\n className={styles.grid}\n data-slot=\"date-picker-grid\"\n role=\"grid\"\n >\n {days.map((date) => (\n <DatePickerDay date={date} key={dateKey(date)} />\n ))}\n </div>\n </>\n )}\n </section>\n );\n },\n);\n\nexport const DatePicker = {\n Root: DatePickerRoot,\n Label: DatePickerLabel,\n Control: DatePickerControl,\n Trigger: DatePickerTrigger,\n Value: DatePickerValue,\n Clear: DatePickerClear,\n Portal: DatePickerPortal,\n Positioner: DatePickerPositioner,\n Popup: DatePickerPopup,\n Close: DatePickerClose,\n Header: DatePickerHeader,\n Caption: DatePickerCaption,\n MonthSelect: DatePickerMonthSelect,\n YearSelect: DatePickerYearSelect,\n TimeField: DatePickerTimeField,\n Previous: DatePickerPrevious,\n Next: DatePickerNext,\n Day: DatePickerDay,\n Calendar: DatePickerCalendar,\n};\n"],"mappings":";;;;;;;;;;AAoFA,MAAM,qBAAA,GAAoBA,MAAAA,cAAAA,CAA6C,IAAI;AAE3E,SAAS,uBAAuB;CAC9B,MAAM,WAAA,GAAUC,MAAAA,WAAAA,CAAW,iBAAiB;CAC5C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,2DAA2D;CAG7E,OAAO;AACT;AAEA,SAAS,YAAY,MAAY,OAAa;CAC5C,OAAO,KAAK,YAAY,MAAM,MAAM,YAAY,KAAK,KAAK,SAAS,MAAM,MAAM,SAAS;AAC1F;AAEA,SAAS,YAAe,OAA2B,QAAmC;CACpF,QAAQ,UAAoB;EAC1B,OAAO,KAAK;EACZ,IAAI,OAAO,UAAU,YACnB,MAAM,KAAK;OACN,IAAI,OACT,MAAM,UAAU;CAEpB;AACF;AAwCA,SAAgB,eAAe,EAC7B,UACA,eAAe,mBACf,eAAe,MACf,WAAW,OACX,cAAc,OACd,gBACA,SAAS,SACT,SACA,SACA,MACA,eACA,eACA,cAAc,iBACd,OAAO,MACP,OAAO,iBACP,eAAe,GACf,WAAW,qBACX,eACA,YAAY,oBACZ,GAAG,gBACmB;CACtB,MAAM,CAAC,mBAAmB,yBAAA,GAAwBC,MAAAA,SAAAA,CAAsB,YAAY;CACpF,MAAM,WAAW,oBAAoB,KAAA,IAAY,oBAAoB;CACrE,MAAM,CAAC,OAAO,kBAAA,GAAiBA,MAAAA,SAAAA,OAC7BC,mBAAAA,aAAa,YAAY,iCAAiB,IAAI,KAAK,CAAC,CACtD;CACA,MAAM,CAAC,aAAa,mBAAA,GAAkBD,MAAAA,SAAAA,CAAS,YAAY,iBAAiB,KAAK;CACjF,MAAM,oBAAA,GAAmBE,MAAAA,OAAAA,CAAO,KAAK;CACrC,M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