jaci-ui 0.9.3 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +11 -1
  3. package/dist/_virtual/_rolldown/runtime.cjs +1 -1
  4. package/dist/components/accordion/accordion.cjs.map +1 -1
  5. package/dist/components/accordion/accordion.js.map +1 -1
  6. package/dist/components/alert/alert.cjs.map +1 -1
  7. package/dist/components/alert/alert.js.map +1 -1
  8. package/dist/components/alert-dialog/alert-dialog.cjs.map +1 -1
  9. package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
  10. package/dist/components/aspect-ratio/aspect-ratio.cjs.map +1 -1
  11. package/dist/components/avatar/avatar.cjs.map +1 -1
  12. package/dist/components/avatar/avatar.js.map +1 -1
  13. package/dist/components/breadcrumbs/breadcrumbs.cjs.map +1 -1
  14. package/dist/components/button/button.cjs +1 -0
  15. package/dist/components/button/button.cjs.map +1 -1
  16. package/dist/components/button/button.d.cts +2 -1
  17. package/dist/components/button/button.d.ts +2 -1
  18. package/dist/components/button/button.js +1 -0
  19. package/dist/components/button/button.js.map +1 -1
  20. package/dist/components/button-group/button-group.cjs.map +1 -1
  21. package/dist/components/calendar/calendar.cjs +4 -6
  22. package/dist/components/calendar/calendar.cjs.map +1 -1
  23. package/dist/components/calendar/calendar.js +4 -6
  24. package/dist/components/calendar/calendar.js.map +1 -1
  25. package/dist/components/card/card.cjs.map +1 -1
  26. package/dist/components/carousel/carousel.cjs.map +1 -1
  27. package/dist/components/carousel/carousel.js.map +1 -1
  28. package/dist/components/checkbox-group/checkbox-group.cjs +7 -3
  29. package/dist/components/checkbox-group/checkbox-group.cjs.map +1 -1
  30. package/dist/components/checkbox-group/checkbox-group.js +7 -3
  31. package/dist/components/checkbox-group/checkbox-group.js.map +1 -1
  32. package/dist/components/code/code.cjs.map +1 -1
  33. package/dist/components/code/code.js.map +1 -1
  34. package/dist/components/collapsible/collapsible.cjs.map +1 -1
  35. package/dist/components/collapsible/collapsible.js.map +1 -1
  36. package/dist/components/color-picker/color-picker.cjs.map +1 -1
  37. package/dist/components/color-picker/color-picker.js.map +1 -1
  38. package/dist/components/color-swatch/color-swatch.cjs.map +1 -1
  39. package/dist/components/combobox/combobox.cjs +2 -1
  40. package/dist/components/combobox/combobox.cjs.map +1 -1
  41. package/dist/components/combobox/combobox.js +2 -1
  42. package/dist/components/combobox/combobox.js.map +1 -1
  43. package/dist/components/command/command.cjs.map +1 -1
  44. package/dist/components/command/command.js.map +1 -1
  45. package/dist/components/context-menu/context-menu.cjs.map +1 -1
  46. package/dist/components/controls/checkbox.cjs.map +1 -1
  47. package/dist/components/controls/checkbox.js.map +1 -1
  48. package/dist/components/controls/input.cjs.map +1 -1
  49. package/dist/components/controls/input.js.map +1 -1
  50. package/dist/components/controls/radio.cjs.map +1 -1
  51. package/dist/components/controls/switch.cjs.map +1 -1
  52. package/dist/components/controls/switch.js.map +1 -1
  53. package/dist/components/controls/textarea.cjs.map +1 -1
  54. package/dist/components/controls/textarea.js.map +1 -1
  55. package/dist/components/copyable/copyable.cjs.map +1 -1
  56. package/dist/components/copyable/copyable.js.map +1 -1
  57. package/dist/components/data-toolbar/data-toolbar.cjs.map +1 -1
  58. package/dist/components/data-toolbar/data-toolbar.js.map +1 -1
  59. package/dist/components/data-view/data-view.cjs.map +1 -1
  60. package/dist/components/date-picker/date-picker.cjs +4 -7
  61. package/dist/components/date-picker/date-picker.cjs.map +1 -1
  62. package/dist/components/date-picker/date-picker.js +4 -7
  63. package/dist/components/date-picker/date-picker.js.map +1 -1
  64. package/dist/components/date-range-picker/date-range-picker.cjs +4 -6
  65. package/dist/components/date-range-picker/date-range-picker.cjs.map +1 -1
  66. package/dist/components/date-range-picker/date-range-picker.js +4 -6
  67. package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
  68. package/dist/components/dialog/dialog.cjs.map +1 -1
  69. package/dist/components/dialog/dialog.js.map +1 -1
  70. package/dist/components/download-trigger/download-trigger.cjs.map +1 -1
  71. package/dist/components/drawer/drawer.cjs.map +1 -1
  72. package/dist/components/drawer/drawer.js.map +1 -1
  73. package/dist/components/empty-state/empty-state.cjs.map +1 -1
  74. package/dist/components/feedback/badge.cjs.map +1 -1
  75. package/dist/components/feedback/badge.d.cts +2 -1
  76. package/dist/components/feedback/badge.d.ts +2 -1
  77. package/dist/components/feedback/badge.js.map +1 -1
  78. package/dist/components/field/field.cjs.map +1 -1
  79. package/dist/components/field/field.js.map +1 -1
  80. package/dist/components/fieldset/fieldset.cjs.map +1 -1
  81. package/dist/components/figure/figure.cjs.map +1 -1
  82. package/dist/components/figure/figure.js.map +1 -1
  83. package/dist/components/form/form.cjs.map +1 -1
  84. package/dist/components/form/form.js.map +1 -1
  85. package/dist/components/icon-button/icon-button.cjs.map +1 -1
  86. package/dist/components/icon-button/icon-button.js.map +1 -1
  87. package/dist/components/image/image.cjs.map +1 -1
  88. package/dist/components/image/image.js.map +1 -1
  89. package/dist/components/input-group/input-group.cjs.map +1 -1
  90. package/dist/components/kbd/kbd.cjs.map +1 -1
  91. package/dist/components/layout/index.cjs.map +1 -1
  92. package/dist/components/list/list.cjs.map +1 -1
  93. package/dist/components/menu/menu.cjs.map +1 -1
  94. package/dist/components/menubar/menubar.cjs.map +1 -1
  95. package/dist/components/menubar/menubar.js.map +1 -1
  96. package/dist/components/meter/meter.cjs.map +1 -1
  97. package/dist/components/meter/meter.js.map +1 -1
  98. package/dist/components/navigation/navigation.cjs.map +1 -1
  99. package/dist/components/navigation/navigation.js.map +1 -1
  100. package/dist/components/navigation-menu/navigation-menu.cjs.map +1 -1
  101. package/dist/components/navigation-menu/navigation-menu.js.map +1 -1
  102. package/dist/components/number-field/number-field.cjs +2 -1
  103. package/dist/components/number-field/number-field.cjs.map +1 -1
  104. package/dist/components/number-field/number-field.js +2 -1
  105. package/dist/components/number-field/number-field.js.map +1 -1
  106. package/dist/components/option-selector/option-selector.cjs.map +1 -1
  107. package/dist/components/option-selector/option-selector.js.map +1 -1
  108. package/dist/components/pagination/pagination.cjs.map +1 -1
  109. package/dist/components/pagination/pagination.js.map +1 -1
  110. package/dist/components/pin-input/pin-input.cjs.map +1 -1
  111. package/dist/components/pin-input/pin-input.js.map +1 -1
  112. package/dist/components/popover/popover.cjs.map +1 -1
  113. package/dist/components/popover/popover.js.map +1 -1
  114. package/dist/components/progress/progress.cjs.map +1 -1
  115. package/dist/components/progress/progress.js.map +1 -1
  116. package/dist/components/qr-code/qr-code.cjs.map +1 -1
  117. package/dist/components/qr-code/qr-code.js.map +1 -1
  118. package/dist/components/quote/quote.cjs.map +1 -1
  119. package/dist/components/quote/quote.js.map +1 -1
  120. package/dist/components/radio-group/radio-group.cjs +7 -3
  121. package/dist/components/radio-group/radio-group.cjs.map +1 -1
  122. package/dist/components/radio-group/radio-group.js +7 -3
  123. package/dist/components/radio-group/radio-group.js.map +1 -1
  124. package/dist/components/range-slider/range-slider.cjs.map +1 -1
  125. package/dist/components/range-slider/range-slider.js.map +1 -1
  126. package/dist/components/scroll-area/scroll-area.cjs.map +1 -1
  127. package/dist/components/select/select.cjs.map +1 -1
  128. package/dist/components/select/select.js.map +1 -1
  129. package/dist/components/sidebar/sidebar.cjs.map +1 -1
  130. package/dist/components/sidebar/sidebar.js.map +1 -1
  131. package/dist/components/skeleton/skeleton.cjs.map +1 -1
  132. package/dist/components/slider/slider.cjs.map +1 -1
  133. package/dist/components/slider/slider.js.map +1 -1
  134. package/dist/components/spacer/spacer.cjs.map +1 -1
  135. package/dist/components/stat/stat.cjs.map +1 -1
  136. package/dist/components/stat/stat.js.map +1 -1
  137. package/dist/components/stepper/stepper.cjs +2 -1
  138. package/dist/components/stepper/stepper.cjs.map +1 -1
  139. package/dist/components/stepper/stepper.js +2 -1
  140. package/dist/components/stepper/stepper.js.map +1 -1
  141. package/dist/components/table/table.cjs.map +1 -1
  142. package/dist/components/table/table.js.map +1 -1
  143. package/dist/components/tabs/tabs.cjs.map +1 -1
  144. package/dist/components/tabs/tabs.js.map +1 -1
  145. package/dist/components/tags-input/tags-input.cjs.map +1 -1
  146. package/dist/components/tags-input/tags-input.js.map +1 -1
  147. package/dist/components/toast/toast.cjs.map +1 -1
  148. package/dist/components/toast/toast.js.map +1 -1
  149. package/dist/components/toggle/toggle.cjs.map +1 -1
  150. package/dist/components/toggle-group/toggle-group.cjs.map +1 -1
  151. package/dist/components/toolbar/toolbar.cjs.map +1 -1
  152. package/dist/components/tooltip/tooltip.cjs.map +1 -1
  153. package/dist/components/tree-view/tree-view.cjs.map +1 -1
  154. package/dist/components/tree-view/tree-view.js.map +1 -1
  155. package/dist/components/typography/heading.cjs.map +1 -1
  156. package/dist/components/typography/link.cjs.map +1 -1
  157. package/dist/components/typography/paragraph.cjs.map +1 -1
  158. package/dist/components/typography/text.cjs.map +1 -1
  159. package/dist/components/upload/upload.cjs +2 -2
  160. package/dist/components/upload/upload.cjs.map +1 -1
  161. package/dist/components/upload/upload.js +2 -2
  162. package/dist/components/upload/upload.js.map +1 -1
  163. package/dist/components/visually-hidden/visually-hidden.cjs.map +1 -1
  164. package/dist/panda-preset.cjs.map +1 -1
  165. package/dist/styled-system/recipes/badge.cjs +4 -1
  166. package/dist/styled-system/recipes/badge.cjs.map +1 -1
  167. package/dist/styled-system/recipes/badge.js +4 -1
  168. package/dist/styled-system/recipes/badge.js.map +1 -1
  169. package/dist/styles/theme.cjs +88 -68
  170. package/dist/styles/theme.cjs.map +1 -1
  171. package/dist/styles/theme.js +88 -68
  172. package/dist/styles/theme.js.map +1 -1
  173. package/dist/styles.css +5 -19
  174. package/dist/theme/theme-provider.cjs.map +1 -1
  175. package/dist/theme/theme-provider.js.map +1 -1
  176. package/dist/theme/theme-scope.cjs.map +1 -1
  177. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","names":["SelectRoot","BaseSelect","Select"],"sources":["../../../src/components/select/select.tsx"],"sourcesContent":["\"use client\";\n\nimport { Select as BaseSelect } from \"@base-ui/react/select\";\nimport { createContext, forwardRef, useContext, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { SelectRoot as BaseSelectRoot } from \"@base-ui/react/select\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { select } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\nexport type SelectSize = \"sm\" | \"md\" | \"lg\";\n\nconst SelectSizeContext = createContext<SelectSize>(\"md\");\nconst SelectAuxContext = createContext<{ clear: () => void; disabled: boolean } | null>(null);\n\nfunction useSelectStyles() {\n return select({ size: useContext(SelectSizeContext) });\n}\n\n/**\n * Groups an accessible listbox select. Use `value`/`onValueChange` for a\n * controlled selection, or `defaultValue` for an uncontrolled selection.\n *\n * `size` is shared by all visual parts so the trigger stays aligned with the\n * library's `Input` component.\n */\nexport interface SelectRootProps<Value, Multiple extends boolean | undefined = false>\n extends BaseSelectRoot.Props<Value, Multiple> {\n size?: SelectSize;\n loading?: boolean;\n}\n\nexport function SelectRoot<Value = unknown, Multiple extends boolean | undefined = false>({\n defaultValue,\n disabled = false,\n loading: _loading,\n multiple,\n onValueChange,\n size = \"md\",\n value: controlledValue,\n ...props\n}: SelectRootProps<Value, Multiple>) {\n const [uncontrolledValue, setUncontrolledValue] = useState<unknown>(\n defaultValue ?? (multiple ? [] : null),\n );\n const value = controlledValue === undefined ? uncontrolledValue : controlledValue;\n const clear = () => {\n const nextValue = multiple ? [] : null;\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue as never, undefined as never);\n };\n return (\n <SelectSizeContext.Provider value={size}>\n <SelectAuxContext.Provider value={{ clear, disabled }}>\n <BaseSelect.Root\n {...props}\n disabled={disabled}\n defaultValue={undefined}\n multiple={multiple}\n onValueChange={(nextValue, details) => {\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue, details);\n }}\n value={value as SelectRootProps<Value, Multiple>[\"value\"]}\n />\n </SelectAuxContext.Provider>\n </SelectSizeContext.Provider>\n );\n}\n\nexport type SelectLabelProps = ComponentPropsWithoutRef<typeof BaseSelect.Label>;\n\n/** An accessible label that Base UI associates with the trigger automatically. */\nexport const SelectLabel = forwardRef<HTMLDivElement, SelectLabelProps>(function SelectLabel(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().label, className)}\n data-slot=\"select-label\"\n />\n );\n});\n\nexport type SelectTriggerProps = ComponentPropsWithoutRef<typeof BaseSelect.Trigger>;\n\n/** The button-shaped control that opens the select popup. */\nexport const SelectTrigger = forwardRef<HTMLButtonElement, SelectTriggerProps>(\n function SelectTrigger({ className, ...props }, ref) {\n return (\n <BaseSelect.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().trigger, className)}\n data-jaci-component=\"select\"\n data-slot=\"select-trigger\"\n />\n );\n },\n);\n\nexport type SelectValueProps = ComponentPropsWithoutRef<typeof BaseSelect.Value>;\n\n/** Renders the selected item's label, or its placeholder when empty. */\nexport const SelectValue = forwardRef<HTMLSpanElement, SelectValueProps>(function SelectValue(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().value, className)}\n data-slot=\"select-value\"\n />\n );\n});\n\nexport type SelectIconProps = ComponentPropsWithoutRef<typeof BaseSelect.Icon>;\n\n/** A small chevron that rotates while the popup is open. */\nexport const SelectIcon = forwardRef<HTMLSpanElement, SelectIconProps>(function SelectIcon(\n { children = \"⌄\", className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Icon\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={withRecipeClassName(useSelectStyles().icon, className)}\n data-slot=\"select-icon\"\n >\n {children}\n </BaseSelect.Icon>\n );\n});\n\n/** Preserves Base UI's optional portal container and mount controls. */\nexport function SelectPortal(props: ComponentPropsWithoutRef<typeof BaseSelect.Portal>) {\n return <BaseSelect.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type SelectPositionerProps = ComponentPropsWithoutRef<typeof BaseSelect.Positioner>;\n\nexport const SelectPositioner = forwardRef<HTMLDivElement, SelectPositionerProps>(\n function SelectPositioner({ className, ...props }, ref) {\n return (\n <BaseSelect.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().positioner, className)}\n data-slot=\"select-positioner\"\n />\n );\n },\n);\n\nexport type SelectPopupProps = ComponentPropsWithoutRef<typeof BaseSelect.Popup>;\n\nexport const SelectPopup = forwardRef<HTMLDivElement, SelectPopupProps>(function SelectPopup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().popup, className)}\n data-slot=\"select-popup\"\n />\n );\n});\n\nexport type SelectListProps = ComponentPropsWithoutRef<typeof BaseSelect.List>;\n\nexport const SelectList = forwardRef<HTMLDivElement, SelectListProps>(function SelectList(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.List\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().list, className)}\n data-slot=\"select-list\"\n />\n );\n});\n\nexport type SelectItemProps = ComponentPropsWithoutRef<typeof BaseSelect.Item>;\n\nexport const SelectItem = forwardRef<HTMLElement, SelectItemProps>(function SelectItem(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().item, className)}\n data-slot=\"select-item\"\n />\n );\n});\n\nexport type SelectItemTextProps = ComponentPropsWithoutRef<typeof BaseSelect.ItemText>;\n\nexport const SelectItemText = forwardRef<HTMLDivElement, SelectItemTextProps>(\n function SelectItemText({ className, ...props }, ref) {\n return (\n <BaseSelect.ItemText\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().itemText, className)}\n data-slot=\"select-item-text\"\n />\n );\n },\n);\n\nexport type SelectItemIndicatorProps = ComponentPropsWithoutRef<typeof BaseSelect.ItemIndicator>;\n\nexport const SelectItemIndicator = forwardRef<HTMLSpanElement, SelectItemIndicatorProps>(\n function SelectItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <BaseSelect.ItemIndicator\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={withRecipeClassName(useSelectStyles().itemIndicator, className)}\n data-slot=\"select-item-indicator\"\n >\n {children}\n </BaseSelect.ItemIndicator>\n );\n },\n);\n\nexport type SelectGroupProps = ComponentPropsWithoutRef<typeof BaseSelect.Group>;\n\nexport const SelectGroup = forwardRef<HTMLDivElement, SelectGroupProps>(function SelectGroup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Group\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().group, className)}\n data-slot=\"select-group\"\n />\n );\n});\n\nexport type SelectGroupLabelProps = ComponentPropsWithoutRef<typeof BaseSelect.GroupLabel>;\n\nexport const SelectGroupLabel = forwardRef<HTMLDivElement, SelectGroupLabelProps>(\n function SelectGroupLabel({ className, ...props }, ref) {\n return (\n <BaseSelect.GroupLabel\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().groupLabel, className)}\n data-slot=\"select-group-label\"\n />\n );\n },\n);\n\n/**\n * A visual separator for groups in a listbox. It is intentionally hidden from\n * assistive technology because ARIA listboxes may only contain options or\n * option groups, not semantic separators.\n */\nexport interface SelectSeparatorProps extends ComponentPropsWithoutRef<\"div\"> {\n orientation?: \"horizontal\" | \"vertical\";\n}\n\nexport const SelectSeparator = forwardRef<HTMLDivElement, SelectSeparatorProps>(\n function SelectSeparator({ className, orientation = \"horizontal\", ...props }, ref) {\n return (\n <div\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={cx(useSelectStyles().separator, className)}\n data-orientation={orientation}\n data-slot=\"select-separator\"\n />\n );\n },\n);\n\nexport interface SelectClearProps extends ComponentPropsWithoutRef<\"button\"> {\n children?: ReactNode;\n}\nexport const SelectClear = forwardRef<HTMLButtonElement, SelectClearProps>(function SelectClear(\n { children = \"×\", className, ...props },\n ref,\n) {\n const context = useContext(SelectAuxContext);\n const styles = useSelectStyles();\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n className={cx(styles.clear, className)}\n data-slot=\"select-clear\"\n disabled={props.disabled || context?.disabled}\n onClick={(event) => {\n context?.clear();\n props.onClick?.(event);\n }}\n ref={ref}\n type=\"button\"\n >\n {children}\n </button>\n );\n});\n\nexport type SelectEmptyProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectEmpty = forwardRef<HTMLDivElement, SelectEmptyProps>(function SelectEmpty(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n className={cx(useSelectStyles().empty, className)}\n data-slot=\"select-empty\"\n ref={ref}\n />\n );\n});\nexport type SelectLoadingProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectLoading = forwardRef<HTMLDivElement, SelectLoadingProps>(function SelectLoading(\n { children = \"Loading…\", className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n aria-live=\"polite\"\n className={cx(useSelectStyles().loading, className)}\n data-slot=\"select-loading\"\n ref={ref}\n >\n {children}\n </div>\n );\n});\nexport type SelectStatusProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectStatus = forwardRef<HTMLDivElement, SelectStatusProps>(function SelectStatus(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n aria-live=\"polite\"\n className={cx(useSelectStyles().status, className)}\n data-slot=\"select-status\"\n ref={ref}\n />\n );\n});\n\nexport const Select = {\n Root: SelectRoot,\n Label: SelectLabel,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Icon: SelectIcon,\n Portal: SelectPortal,\n Positioner: SelectPositioner,\n Popup: SelectPopup,\n List: SelectList,\n Item: SelectItem,\n ItemText: SelectItemText,\n ItemIndicator: SelectItemIndicator,\n Group: SelectGroup,\n GroupLabel: SelectGroupLabel,\n Separator: SelectSeparator,\n Clear: SelectClear,\n Empty: SelectEmpty,\n Loading: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S;CACT,QAAQ;AACV"}
1
+ {"version":3,"file":"select.js","names":["SelectRoot","BaseSelect","Select"],"sources":["../../../src/components/select/select.tsx"],"sourcesContent":["\"use client\";\n\nimport { Select as BaseSelect } from \"@base-ui/react/select\";\nimport { createContext, forwardRef, useContext, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { SelectRoot as BaseSelectRoot } from \"@base-ui/react/select\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { select } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\nexport type SelectSize = \"sm\" | \"md\" | \"lg\";\n\nconst SelectSizeContext = createContext<SelectSize>(\"md\");\nconst SelectAuxContext = createContext<{ clear: () => void; disabled: boolean } | null>(null);\n\nfunction useSelectStyles() {\n return select({ size: useContext(SelectSizeContext) });\n}\n\n/**\n * Groups an accessible listbox select. Use `value`/`onValueChange` for a\n * controlled selection, or `defaultValue` for an uncontrolled selection.\n *\n * `size` is shared by all visual parts so the trigger stays aligned with the\n * library's `Input` component.\n */\nexport interface SelectRootProps<Value, Multiple extends boolean | undefined = false>\n extends BaseSelectRoot.Props<Value, Multiple> {\n size?: SelectSize;\n loading?: boolean;\n}\n\nexport function SelectRoot<Value = unknown, Multiple extends boolean | undefined = false>({\n defaultValue,\n disabled = false,\n loading: _loading,\n multiple,\n onValueChange,\n size = \"md\",\n value: controlledValue,\n ...props\n}: SelectRootProps<Value, Multiple>) {\n const [uncontrolledValue, setUncontrolledValue] = useState<unknown>(\n defaultValue ?? (multiple ? [] : null),\n );\n const value = controlledValue === undefined ? uncontrolledValue : controlledValue;\n const clear = () => {\n const nextValue = multiple ? [] : null;\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue as never, undefined as never);\n };\n return (\n <SelectSizeContext.Provider value={size}>\n <SelectAuxContext.Provider value={{ clear, disabled }}>\n <BaseSelect.Root\n {...props}\n disabled={disabled}\n defaultValue={undefined}\n multiple={multiple}\n onValueChange={(nextValue, details) => {\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue, details);\n }}\n value={value as SelectRootProps<Value, Multiple>[\"value\"]}\n />\n </SelectAuxContext.Provider>\n </SelectSizeContext.Provider>\n );\n}\n\nexport type SelectLabelProps = ComponentPropsWithoutRef<typeof BaseSelect.Label>;\n\n/** An accessible label that Base UI associates with the trigger automatically. */\nexport const SelectLabel = forwardRef<HTMLDivElement, SelectLabelProps>(function SelectLabel(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().label, className)}\n data-slot=\"select-label\"\n />\n );\n});\n\nexport type SelectTriggerProps = ComponentPropsWithoutRef<typeof BaseSelect.Trigger>;\n\n/** The button-shaped control that opens the select popup. */\nexport const SelectTrigger = forwardRef<HTMLButtonElement, SelectTriggerProps>(\n function SelectTrigger({ className, ...props }, ref) {\n return (\n <BaseSelect.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().trigger, className)}\n data-jaci-component=\"select\"\n data-slot=\"select-trigger\"\n />\n );\n },\n);\n\nexport type SelectValueProps = ComponentPropsWithoutRef<typeof BaseSelect.Value>;\n\n/** Renders the selected item's label, or its placeholder when empty. */\nexport const SelectValue = forwardRef<HTMLSpanElement, SelectValueProps>(function SelectValue(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().value, className)}\n data-slot=\"select-value\"\n />\n );\n});\n\nexport type SelectIconProps = ComponentPropsWithoutRef<typeof BaseSelect.Icon>;\n\n/** A small chevron that rotates while the popup is open. */\nexport const SelectIcon = forwardRef<HTMLSpanElement, SelectIconProps>(function SelectIcon(\n { children = \"⌄\", className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Icon\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={withRecipeClassName(useSelectStyles().icon, className)}\n data-slot=\"select-icon\"\n >\n {children}\n </BaseSelect.Icon>\n );\n});\n\n/** Preserves Base UI's optional portal container and mount controls. */\nexport function SelectPortal(props: ComponentPropsWithoutRef<typeof BaseSelect.Portal>) {\n return <BaseSelect.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type SelectPositionerProps = ComponentPropsWithoutRef<typeof BaseSelect.Positioner>;\n\nexport const SelectPositioner = forwardRef<HTMLDivElement, SelectPositionerProps>(\n function SelectPositioner({ className, ...props }, ref) {\n return (\n <BaseSelect.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().positioner, className)}\n data-slot=\"select-positioner\"\n />\n );\n },\n);\n\nexport type SelectPopupProps = ComponentPropsWithoutRef<typeof BaseSelect.Popup>;\n\nexport const SelectPopup = forwardRef<HTMLDivElement, SelectPopupProps>(function SelectPopup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().popup, className)}\n data-slot=\"select-popup\"\n />\n );\n});\n\nexport type SelectListProps = ComponentPropsWithoutRef<typeof BaseSelect.List>;\n\nexport const SelectList = forwardRef<HTMLDivElement, SelectListProps>(function SelectList(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.List\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().list, className)}\n data-slot=\"select-list\"\n />\n );\n});\n\nexport type SelectItemProps = ComponentPropsWithoutRef<typeof BaseSelect.Item>;\n\nexport const SelectItem = forwardRef<HTMLElement, SelectItemProps>(function SelectItem(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().item, className)}\n data-slot=\"select-item\"\n />\n );\n});\n\nexport type SelectItemTextProps = ComponentPropsWithoutRef<typeof BaseSelect.ItemText>;\n\nexport const SelectItemText = forwardRef<HTMLDivElement, SelectItemTextProps>(\n function SelectItemText({ className, ...props }, ref) {\n return (\n <BaseSelect.ItemText\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().itemText, className)}\n data-slot=\"select-item-text\"\n />\n );\n },\n);\n\nexport type SelectItemIndicatorProps = ComponentPropsWithoutRef<typeof BaseSelect.ItemIndicator>;\n\nexport const SelectItemIndicator = forwardRef<HTMLSpanElement, SelectItemIndicatorProps>(\n function SelectItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <BaseSelect.ItemIndicator\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={withRecipeClassName(useSelectStyles().itemIndicator, className)}\n data-slot=\"select-item-indicator\"\n >\n {children}\n </BaseSelect.ItemIndicator>\n );\n },\n);\n\nexport type SelectGroupProps = ComponentPropsWithoutRef<typeof BaseSelect.Group>;\n\nexport const SelectGroup = forwardRef<HTMLDivElement, SelectGroupProps>(function SelectGroup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Group\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().group, className)}\n data-slot=\"select-group\"\n />\n );\n});\n\nexport type SelectGroupLabelProps = ComponentPropsWithoutRef<typeof BaseSelect.GroupLabel>;\n\nexport const SelectGroupLabel = forwardRef<HTMLDivElement, SelectGroupLabelProps>(\n function SelectGroupLabel({ className, ...props }, ref) {\n return (\n <BaseSelect.GroupLabel\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().groupLabel, className)}\n data-slot=\"select-group-label\"\n />\n );\n },\n);\n\n/**\n * A visual separator for groups in a listbox. It is intentionally hidden from\n * assistive technology because ARIA listboxes may only contain options or\n * option groups, not semantic separators.\n */\nexport interface SelectSeparatorProps extends ComponentPropsWithoutRef<\"div\"> {\n orientation?: \"horizontal\" | \"vertical\";\n}\n\nexport const SelectSeparator = forwardRef<HTMLDivElement, SelectSeparatorProps>(\n function SelectSeparator({ className, orientation = \"horizontal\", ...props }, ref) {\n return (\n <div\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={cx(useSelectStyles().separator, className)}\n data-orientation={orientation}\n data-slot=\"select-separator\"\n />\n );\n },\n);\n\nexport interface SelectClearProps extends ComponentPropsWithoutRef<\"button\"> {\n children?: ReactNode;\n}\nexport const SelectClear = forwardRef<HTMLButtonElement, SelectClearProps>(function SelectClear(\n { children = \"×\", className, ...props },\n ref,\n) {\n const context = useContext(SelectAuxContext);\n const styles = useSelectStyles();\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n className={cx(styles.clear, className)}\n data-slot=\"select-clear\"\n disabled={props.disabled || context?.disabled}\n onClick={(event) => {\n context?.clear();\n props.onClick?.(event);\n }}\n ref={ref}\n type=\"button\"\n >\n {children}\n </button>\n );\n});\n\nexport type SelectEmptyProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectEmpty = forwardRef<HTMLDivElement, SelectEmptyProps>(function SelectEmpty(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n className={cx(useSelectStyles().empty, className)}\n data-slot=\"select-empty\"\n ref={ref}\n />\n );\n});\nexport type SelectLoadingProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectLoading = forwardRef<HTMLDivElement, SelectLoadingProps>(function SelectLoading(\n { children = \"Loading…\", className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n aria-live=\"polite\"\n className={cx(useSelectStyles().loading, className)}\n data-slot=\"select-loading\"\n ref={ref}\n >\n {children}\n </div>\n );\n});\nexport type SelectStatusProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectStatus = forwardRef<HTMLDivElement, SelectStatusProps>(function SelectStatus(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n aria-live=\"polite\"\n className={cx(useSelectStyles().status, className)}\n data-slot=\"select-status\"\n ref={ref}\n />\n );\n});\n\nexport const Select = {\n Root: SelectRoot,\n Label: SelectLabel,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Icon: SelectIcon,\n Portal: SelectPortal,\n Positioner: SelectPositioner,\n Popup: SelectPopup,\n List: SelectList,\n Item: SelectItem,\n ItemText: SelectItemText,\n ItemIndicator: SelectItemIndicator,\n Group: SelectGroup,\n GroupLabel: SelectGroupLabel,\n Separator: SelectSeparator,\n Clear: SelectClear,\n Empty: SelectEmpty,\n Loading: SelectLoading,\n Status: SelectStatus,\n};\n"],"mappings":";;;;;;;;;AAcA,MAAM,oBAAoB,cAA0B,IAAI;AACxD,MAAM,mBAAmB,cAA+D,IAAI;AAE5F,SAAS,kBAAkB;CACzB,OAAO,OAAO,EAAE,MAAM,WAAW,iBAAiB,EAAE,CAAC;AACvD;AAeA,SAAgBA,aAA0E,EACxF,cACA,WAAW,OACX,SAAS,UACT,UACA,eACA,OAAO,MACP,OAAO,iBACP,GAAG,SACgC;CACnC,MAAM,CAAC,mBAAmB,wBAAwB,SAChD,iBAAiB,WAAW,CAAC,IAAI,KACnC;CACA,MAAM,QAAQ,oBAAoB,KAAA,IAAY,oBAAoB;CAClE,MAAM,cAAc;EAClB,MAAM,YAAY,WAAW,CAAC,IAAI;EAClC,IAAI,oBAAoB,KAAA,GAAW,qBAAqB,SAAS;EACjE,gBAAgB,WAAoB,KAAA,CAAkB;CACxD;CACA,OACE,oBAAC,kBAAkB,UAAnB;EAA4B,OAAO;EACjC,UAAA,oBAAC,iBAAiB,UAAlB;GAA2B,OAAO;IAAE;IAAO;GAAS;GAClD,UAAA,oBAACC,OAAW,MAAZ;IACE,GAAI;IACM;IACV,cAAc,KAAA;IACJ;IACV,gBAAgB,WAAW,YAAY;KACrC,IAAI,oBAAoB,KAAA,GAAW,qBAAqB,SAAS;KACjE,gBAAgB,WAAW,OAAO;IACpC;IACO;GACR,CAAA;EACwB,CAAA;CACD,CAAA;AAEhC;;AAKA,MAAa,cAAc,WAA6C,SAAS,YAC/E,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAACA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,gBAAgB,CAAC,CAAC,OAAO,SAAS;EACjE,aAAU;CACX,CAAA;AAEL,C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;CACP,MAAM;CACN,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,MAAM;CACN,MAAM;CACN,UAAU;CACV,eAAe;CACf,OAAO;CACP,YAAY;CACZ,WAAW;CACX,OAAO;CACP,OAAO;CACP,SAAS;CACT,QAAQ;AACV"}
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.cjs","names":["sidebar","useThemePortalProps","cx","BaseDialog","withRecipeClassName"],"sources":["../../../src/components/sidebar/sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { createContext, forwardRef, useCallback, useContext, useMemo, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, MouseEvent, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { sidebar } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\nexport interface SidebarContextValue {\n /** Whether the sidebar is visually expanded. */\n open: boolean;\n /** Updates the expanded state, respecting controlled usage. */\n setOpen: (open: boolean) => void;\n /** Convenience callback for toggles placed anywhere in the sidebar. */\n toggle: () => void;\n}\n\nconst SidebarContext = createContext<SidebarContextValue | null>(null);\n\n/**\n * Reads the state exposed by `Sidebar.Root`.\n *\n * Use it in custom sidebar parts when the built-in composition is not enough.\n */\nexport function useSidebar() {\n const context = useContext(SidebarContext);\n\n if (!context) {\n throw new Error(\"useSidebar must be used within a Sidebar.Root component.\");\n }\n\n return context;\n}\n\nfunction useSidebarStyles() {\n const { open } = useSidebar();\n return sidebar({ open });\n}\n\nexport interface SidebarRootProps extends ComponentPropsWithoutRef<\"aside\"> {\n /** Controlled expanded state. */\n open?: boolean;\n /** Initial expanded state for uncontrolled use. */\n defaultOpen?: boolean;\n /** Called after the requested expanded state changes. */\n onOpenChange?: (open: boolean) => void;\n /** Renders the sidebar as a modal mobile surface when set to overlay. */\n mode?: \"static\" | \"overlay\";\n /** Allows Escape to be disabled for overlay mode. */\n closeOnEscape?: boolean;\n /** Allows outside presses to be disabled for overlay mode. */\n closeOnOutsidePress?: boolean;\n /** Restores focus to the element that opened the overlay. */\n restoreFocus?: boolean;\n /** Controls whether the overlay traps focus and locks page scroll. */\n modal?: boolean | \"trap-focus\";\n children?: ReactNode;\n}\n\n/**\n * The sidebar container. It supports both controlled and uncontrolled state.\n */\nexport const SidebarRoot = forwardRef<HTMLElement, SidebarRootProps>(function SidebarRoot(\n {\n children,\n className,\n closeOnEscape = true,\n closeOnOutsidePress = true,\n defaultOpen = true,\n modal = true,\n mode = \"static\",\n onOpenChange,\n open: controlledOpen,\n restoreFocus = true,\n ...props\n },\n ref,\n) {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = controlledOpen ?? uncontrolledOpen;\n\n const setOpen = useCallback(\n (nextOpen: boolean) => {\n if (!isControlled) {\n setUncontrolledOpen(nextOpen);\n }\n\n onOpenChange?.(nextOpen);\n },\n [isControlled, onOpenChange],\n );\n\n const toggle = useCallback(() => {\n setOpen(!open);\n }, [open, setOpen]);\n\n const context = useMemo<SidebarContextValue>(\n () => ({ open, setOpen, toggle }),\n [open, setOpen, toggle],\n );\n const styles = sidebar({ open });\n const scopedPortalProps = useThemePortalProps({});\n\n const surface = (\n <aside\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"sidebar\"\n data-open={open}\n data-slot=\"sidebar\"\n data-state={open ? \"open\" : \"closed\"}\n >\n {children}\n </aside>\n );\n\n if (mode === \"overlay\") {\n return (\n <SidebarContext.Provider value={context}>\n <BaseDialog.Root\n open={open}\n modal={modal}\n onOpenChange={(nextOpen, details) => {\n if (\n !nextOpen &&\n ((!closeOnEscape && details.reason === \"escape-key\") ||\n (!closeOnOutsidePress && details.reason === \"outside-press\"))\n ) {\n details.cancel();\n return;\n }\n setOpen(nextOpen);\n }}\n >\n <BaseDialog.Portal {...scopedPortalProps}>\n <BaseDialog.Backdrop\n className={cx(styles.backdrop)}\n data-jaci-component=\"sidebar\"\n data-slot=\"sidebar-backdrop\"\n />\n <BaseDialog.Viewport className={cx(styles.viewport)} data-slot=\"sidebar-viewport\">\n <BaseDialog.Popup\n aria-label={props[\"aria-label\"] ?? \"Sidebar navigation\"}\n className={cx(styles.popup)}\n data-jaci-component=\"sidebar\"\n data-slot=\"sidebar-popup\"\n finalFocus={restoreFocus}\n initialFocus\n >\n {surface}\n </BaseDialog.Popup>\n </BaseDialog.Viewport>\n </BaseDialog.Portal>\n </BaseDialog.Root>\n </SidebarContext.Provider>\n );\n }\n\n return <SidebarContext.Provider value={context}>{surface}</SidebarContext.Provider>;\n});\n\nexport type SidebarPortalProps = ComponentPropsWithoutRef<typeof BaseDialog.Portal>;\nexport function SidebarPortal(props: SidebarPortalProps) {\n return <BaseDialog.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type SidebarBackdropProps = ComponentPropsWithoutRef<typeof BaseDialog.Backdrop>;\nexport const SidebarBackdrop = forwardRef<HTMLDivElement, SidebarBackdropProps>(\n function SidebarBackdrop({ className, ...props }, ref) {\n const { open } = useSidebar();\n return (\n <BaseDialog.Backdrop\n {...props}\n className={withRecipeClassName(sidebar({ open }).backdrop, className)}\n data-slot=\"sidebar-backdrop\"\n ref={ref}\n />\n );\n },\n);\n\nexport type SidebarToggleProps = ComponentPropsWithoutRef<\"button\">;\n\n/**\n * A floating, accessible control that expands or collapses the sidebar.\n */\nexport const SidebarToggle = forwardRef<HTMLButtonElement, SidebarToggleProps>(\n function SidebarToggle(\n { \"aria-label\": ariaLabel, children, className, onClick, type = \"button\", ...props },\n ref,\n ) {\n const { open, toggle } = useSidebar();\n const styles = useSidebarStyles();\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n\n if (!event.defaultPrevented) {\n toggle();\n }\n };\n\n return (\n <button\n {...props}\n aria-expanded={open}\n aria-label={ariaLabel ?? (open ? \"Collapse sidebar\" : \"Expand sidebar\")}\n className={cx(styles.toggle, className)}\n data-slot=\"sidebar-toggle\"\n onClick={handleClick}\n ref={ref}\n type={type}\n >\n {children ?? <span aria-hidden=\"true\">{open ? \"‹\" : \"›\"}</span>}\n </button>\n );\n },\n);\n\nexport type SidebarHeaderProps = ComponentPropsWithoutRef<\"header\">;\n\nexport const SidebarHeader = forwardRef<HTMLElement, SidebarHeaderProps>(function SidebarHeader(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <header\n {...props}\n ref={ref}\n className={cx(styles.header, className)}\n data-slot=\"sidebar-header\"\n />\n );\n});\n\nexport type SidebarContentProps = ComponentPropsWithoutRef<\"nav\">;\n\nexport const SidebarContent = forwardRef<HTMLElement, SidebarContentProps>(function SidebarContent(\n { \"aria-label\": ariaLabel, className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <nav\n {...props}\n aria-label={ariaLabel ?? \"Sidebar navigation\"}\n ref={ref}\n className={cx(styles.content, className)}\n data-slot=\"sidebar-content\"\n />\n );\n});\n\nexport type SidebarFooterProps = ComponentPropsWithoutRef<\"footer\">;\n\nexport const SidebarFooter = forwardRef<HTMLElement, SidebarFooterProps>(function SidebarFooter(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <footer\n {...props}\n ref={ref}\n className={cx(styles.footer, className)}\n data-slot=\"sidebar-footer\"\n />\n );\n});\n\nexport interface SidebarItemProps extends ComponentPropsWithoutRef<\"a\"> {\n /** Marks the current navigation destination. */\n active?: boolean;\n}\n\n/**\n * A semantic navigation item. Pair its icon/content with `Sidebar.Label` so\n * the text transitions out of view while remaining available to assistive\n * technology when the sidebar is collapsed.\n */\nexport const SidebarItem = forwardRef<HTMLAnchorElement, SidebarItemProps>(function SidebarItem(\n { \"aria-current\": ariaCurrent, active = false, className, ...props },\n ref,\n) {\n const { open } = useSidebar();\n const styles = sidebar({ active, open });\n\n return (\n <a\n {...props}\n aria-current={ariaCurrent ?? (active ? \"page\" : undefined)}\n ref={ref}\n className={cx(styles.item, className)}\n data-active={active || undefined}\n data-slot=\"sidebar-item\"\n />\n );\n});\n\nexport type SidebarLabelProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const SidebarLabel = forwardRef<HTMLSpanElement, SidebarLabelProps>(function SidebarLabel(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <span {...props} ref={ref} className={cx(styles.label, className)} data-slot=\"sidebar-label\" />\n );\n});\n\nexport const Sidebar = {\n Root: SidebarRoot,\n Portal: SidebarPortal,\n Backdrop: SidebarBackdrop,\n Toggle: SidebarToggle,\n Header: SidebarHeader,\n Content: SidebarContent,\n Footer: SidebarFooter,\n Item: SidebarItem,\n Label: SidebarLabel,\n};\n"],"mappings":";;;;;;;;;AAoBA,MAAM,kBAAA,GAAA,MAAA,cAAA,CAA2D,IAAI;;;;;;AAOrE,SAAgB,aAAa;CAC3B,MAAM,WAAA,GAAA,MAAA,WAAA,CAAqB,cAAc;CAEzC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,0DAA0D;CAG5E,OAAO;AACT;AAEA,SAAS,mBAAmB;CAC1B,MAAM,EAAE,SAAS,WAAW;CAC5B,OAAOA,gBAAAA,QAAQ,EAAE,KAAK,CAAC;AACzB;;;;AAyBA,MAAa,eAAA,GAAA,MAAA,WAAA,CAAwD,SAAS,YAC5E,EACE,UACA,WACA,gBAAgB,MAChB,sBAAsB,MACtB,cAAc,MACd,QAAQ,MACR,OAAO,UACP,cACA,MAAM,gBACN,eAAe,MACf,GAAG,SAEL,KACA;CACA,MAAM,CAAC,kBAAkB,wBAAA,GAAA,MAAA,SAAA,CAAgC,WAAW;CACpE,MAAM,eAAe,mBAAmB,KAAA;CACxC,MAAM,OAAO,kBAAkB;CAE/B,MAAM,WAAA,GAAA,MAAA,YAAA,EACH,aAAsB;EACrB,IAAI,CAAC,cACH,oBAAoB,QAAQ;EAG9B,eAAe,QAAQ;CACzB,GACA,CAAC,cAAc,YAAY,CAC7B;CAEA,MAA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AAa,UAAU,KAAA;EACvB,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,gBAAA,GAAA,MAAA,WAAA,CAA8D,SAAS,aAClF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,MAAM,SAAS,iBAAiB;CAEhC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;EAAM,GAAI;EAAY;EAAK,WAAWA,WAAAA,GAAG,OAAO,OAAO,SAAS;EAAG,aAAU;CAAiB,CAAA;AAElG,CAAC;AAED,MAAa,UAAU;CACrB,MAAM;CACN,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,MAAM;CACN,OAAO;AACT"}
1
+ {"version":3,"file":"sidebar.cjs","names":["createContext","useContext","sidebar","forwardRef","useState","useCallback","useMemo","useThemePortalProps","cx","BaseDialog","withRecipeClassName"],"sources":["../../../src/components/sidebar/sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { createContext, forwardRef, useCallback, useContext, useMemo, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, MouseEvent, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { sidebar } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\nexport interface SidebarContextValue {\n /** Whether the sidebar is visually expanded. */\n open: boolean;\n /** Updates the expanded state, respecting controlled usage. */\n setOpen: (open: boolean) => void;\n /** Convenience callback for toggles placed anywhere in the sidebar. */\n toggle: () => void;\n}\n\nconst SidebarContext = createContext<SidebarContextValue | null>(null);\n\n/**\n * Reads the state exposed by `Sidebar.Root`.\n *\n * Use it in custom sidebar parts when the built-in composition is not enough.\n */\nexport function useSidebar() {\n const context = useContext(SidebarContext);\n\n if (!context) {\n throw new Error(\"useSidebar must be used within a Sidebar.Root component.\");\n }\n\n return context;\n}\n\nfunction useSidebarStyles() {\n const { open } = useSidebar();\n return sidebar({ open });\n}\n\nexport interface SidebarRootProps extends ComponentPropsWithoutRef<\"aside\"> {\n /** Controlled expanded state. */\n open?: boolean;\n /** Initial expanded state for uncontrolled use. */\n defaultOpen?: boolean;\n /** Called after the requested expanded state changes. */\n onOpenChange?: (open: boolean) => void;\n /** Renders the sidebar as a modal mobile surface when set to overlay. */\n mode?: \"static\" | \"overlay\";\n /** Allows Escape to be disabled for overlay mode. */\n closeOnEscape?: boolean;\n /** Allows outside presses to be disabled for overlay mode. */\n closeOnOutsidePress?: boolean;\n /** Restores focus to the element that opened the overlay. */\n restoreFocus?: boolean;\n /** Controls whether the overlay traps focus and locks page scroll. */\n modal?: boolean | \"trap-focus\";\n children?: ReactNode;\n}\n\n/**\n * The sidebar container. It supports both controlled and uncontrolled state.\n */\nexport const SidebarRoot = forwardRef<HTMLElement, SidebarRootProps>(function SidebarRoot(\n {\n children,\n className,\n closeOnEscape = true,\n closeOnOutsidePress = true,\n defaultOpen = true,\n modal = true,\n mode = \"static\",\n onOpenChange,\n open: controlledOpen,\n restoreFocus = true,\n ...props\n },\n ref,\n) {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = controlledOpen ?? uncontrolledOpen;\n\n const setOpen = useCallback(\n (nextOpen: boolean) => {\n if (!isControlled) {\n setUncontrolledOpen(nextOpen);\n }\n\n onOpenChange?.(nextOpen);\n },\n [isControlled, onOpenChange],\n );\n\n const toggle = useCallback(() => {\n setOpen(!open);\n }, [open, setOpen]);\n\n const context = useMemo<SidebarContextValue>(\n () => ({ open, setOpen, toggle }),\n [open, setOpen, toggle],\n );\n const styles = sidebar({ open });\n const scopedPortalProps = useThemePortalProps({});\n\n const surface = (\n <aside\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"sidebar\"\n data-open={open}\n data-slot=\"sidebar\"\n data-state={open ? \"open\" : \"closed\"}\n >\n {children}\n </aside>\n );\n\n if (mode === \"overlay\") {\n return (\n <SidebarContext.Provider value={context}>\n <BaseDialog.Root\n open={open}\n modal={modal}\n onOpenChange={(nextOpen, details) => {\n if (\n !nextOpen &&\n ((!closeOnEscape && details.reason === \"escape-key\") ||\n (!closeOnOutsidePress && details.reason === \"outside-press\"))\n ) {\n details.cancel();\n return;\n }\n setOpen(nextOpen);\n }}\n >\n <BaseDialog.Portal {...scopedPortalProps}>\n <BaseDialog.Backdrop\n className={cx(styles.backdrop)}\n data-jaci-component=\"sidebar\"\n data-slot=\"sidebar-backdrop\"\n />\n <BaseDialog.Viewport className={cx(styles.viewport)} data-slot=\"sidebar-viewport\">\n <BaseDialog.Popup\n aria-label={props[\"aria-label\"] ?? \"Sidebar navigation\"}\n className={cx(styles.popup)}\n data-jaci-component=\"sidebar\"\n data-slot=\"sidebar-popup\"\n finalFocus={restoreFocus}\n initialFocus\n >\n {surface}\n </BaseDialog.Popup>\n </BaseDialog.Viewport>\n </BaseDialog.Portal>\n </BaseDialog.Root>\n </SidebarContext.Provider>\n );\n }\n\n return <SidebarContext.Provider value={context}>{surface}</SidebarContext.Provider>;\n});\n\nexport type SidebarPortalProps = ComponentPropsWithoutRef<typeof BaseDialog.Portal>;\nexport function SidebarPortal(props: SidebarPortalProps) {\n return <BaseDialog.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type SidebarBackdropProps = ComponentPropsWithoutRef<typeof BaseDialog.Backdrop>;\nexport const SidebarBackdrop = forwardRef<HTMLDivElement, SidebarBackdropProps>(\n function SidebarBackdrop({ className, ...props }, ref) {\n const { open } = useSidebar();\n return (\n <BaseDialog.Backdrop\n {...props}\n className={withRecipeClassName(sidebar({ open }).backdrop, className)}\n data-slot=\"sidebar-backdrop\"\n ref={ref}\n />\n );\n },\n);\n\nexport type SidebarToggleProps = ComponentPropsWithoutRef<\"button\">;\n\n/**\n * A floating, accessible control that expands or collapses the sidebar.\n */\nexport const SidebarToggle = forwardRef<HTMLButtonElement, SidebarToggleProps>(\n function SidebarToggle(\n { \"aria-label\": ariaLabel, children, className, onClick, type = \"button\", ...props },\n ref,\n ) {\n const { open, toggle } = useSidebar();\n const styles = useSidebarStyles();\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n\n if (!event.defaultPrevented) {\n toggle();\n }\n };\n\n return (\n <button\n {...props}\n aria-expanded={open}\n aria-label={ariaLabel ?? (open ? \"Collapse sidebar\" : \"Expand sidebar\")}\n className={cx(styles.toggle, className)}\n data-slot=\"sidebar-toggle\"\n onClick={handleClick}\n ref={ref}\n type={type}\n >\n {children ?? <span aria-hidden=\"true\">{open ? \"‹\" : \"›\"}</span>}\n </button>\n );\n },\n);\n\nexport type SidebarHeaderProps = ComponentPropsWithoutRef<\"header\">;\n\nexport const SidebarHeader = forwardRef<HTMLElement, SidebarHeaderProps>(function SidebarHeader(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <header\n {...props}\n ref={ref}\n className={cx(styles.header, className)}\n data-slot=\"sidebar-header\"\n />\n );\n});\n\nexport type SidebarContentProps = ComponentPropsWithoutRef<\"nav\">;\n\nexport const SidebarContent = forwardRef<HTMLElement, SidebarContentProps>(function SidebarContent(\n { \"aria-label\": ariaLabel, className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <nav\n {...props}\n aria-label={ariaLabel ?? \"Sidebar navigation\"}\n ref={ref}\n className={cx(styles.content, className)}\n data-slot=\"sidebar-content\"\n />\n );\n});\n\nexport type SidebarFooterProps = ComponentPropsWithoutRef<\"footer\">;\n\nexport const SidebarFooter = forwardRef<HTMLElement, SidebarFooterProps>(function SidebarFooter(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <footer\n {...props}\n ref={ref}\n className={cx(styles.footer, className)}\n data-slot=\"sidebar-footer\"\n />\n );\n});\n\nexport interface SidebarItemProps extends ComponentPropsWithoutRef<\"a\"> {\n /** Marks the current navigation destination. */\n active?: boolean;\n}\n\n/**\n * A semantic navigation item. Pair its icon/content with `Sidebar.Label` so\n * the text transitions out of view while remaining available to assistive\n * technology when the sidebar is collapsed.\n */\nexport const SidebarItem = forwardRef<HTMLAnchorElement, SidebarItemProps>(function SidebarItem(\n { \"aria-current\": ariaCurrent, active = false, className, ...props },\n ref,\n) {\n const { open } = useSidebar();\n const styles = sidebar({ active, open });\n\n return (\n <a\n {...props}\n aria-current={ariaCurrent ?? (active ? \"page\" : undefined)}\n ref={ref}\n className={cx(styles.item, className)}\n data-active={active || undefined}\n data-slot=\"sidebar-item\"\n />\n );\n});\n\nexport type SidebarLabelProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const SidebarLabel = forwardRef<HTMLSpanElement, SidebarLabelProps>(function SidebarLabel(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <span {...props} ref={ref} className={cx(styles.label, className)} data-slot=\"sidebar-label\" />\n );\n});\n\nexport const Sidebar = {\n Root: SidebarRoot,\n Portal: SidebarPortal,\n Backdrop: SidebarBackdrop,\n Toggle: SidebarToggle,\n Header: SidebarHeader,\n Content: SidebarContent,\n Footer: SidebarFooter,\n Item: SidebarItem,\n Label: SidebarLabel,\n};\n"],"mappings":";;;;;;;;;AAoBA,MAAM,kBAAA,GAAiBA,MAAAA,cAAAA,CAA0C,IAAI;;;;;;AAOrE,SAAgB,aAAa;CAC3B,MAAM,WAAA,GAAUC,MAAAA,WAAAA,CAAW,cAAc;CAEzC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,0DAA0D;CAG5E,OAAO;AACT;AAEA,SAAS,mBAAmB;CAC1B,MAAM,EAAE,SAAS,WAAW;CAC5B,OAAOC,gBAAAA,QAAQ,EAAE,KAAK,CAAC;AACzB;;;;AAyBA,MAAa,eAAA,GAAcC,MAAAA,WAAAA,CAA0C,SAAS,YAC5E,EACE,UACA,WACA,gBAAgB,MAChB,sBAAsB,MACtB,cAAc,MACd,QAAQ,MACR,OAAO,UACP,cACA,MAAM,gBACN,eAAe,MACf,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CAAA;AAEL,CAAC;;;;;;AAYD,MAAa,eAAA,GAAcL,MAAAA,WAAAA,CAAgD,SAAS,YAClF,EAAE,gBAAgB,aAAa,SAAS,OAAO,WAAW,GAAG,SAC7D,KACA;CACA,MAAM,EAAE,SAAS,WAAW;CAC5B,MAAM,SAASD,gBAAAA,QAAQ;EAAE;EAAQ;CAAK,CAAC;CAEvC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;EACE,GAAI;EACJ,gBAAc,gBAAgB,SAAS,SAAS,KAAA;EAC3C;EACL,WAAWM,WAAAA,GAAG,OAAO,MAAM,SAAS;EACpC,eAAa,UAAU,KAAA;EACvB,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,gBAAA,GAAeL,MAAAA,WAAAA,CAA+C,SAAS,aAClF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,MAAM,SAAS,iBAAiB;CAEhC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;EAAM,GAAI;EAAY;EAAK,WAAWK,WAAAA,GAAG,OAAO,OAAO,SAAS;EAAG,aAAU;CAAiB,CAAA;AAElG,CAAC;AAED,MAAa,UAAU;CACrB,MAAM;CACN,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,MAAM;CACN,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.js","names":["BaseDialog"],"sources":["../../../src/components/sidebar/sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { createContext, forwardRef, useCallback, useContext, useMemo, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, MouseEvent, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { sidebar } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\nexport interface SidebarContextValue {\n /** Whether the sidebar is visually expanded. */\n open: boolean;\n /** Updates the expanded state, respecting controlled usage. */\n setOpen: (open: boolean) => void;\n /** Convenience callback for toggles placed anywhere in the sidebar. */\n toggle: () => void;\n}\n\nconst SidebarContext = createContext<SidebarContextValue | null>(null);\n\n/**\n * Reads the state exposed by `Sidebar.Root`.\n *\n * Use it in custom sidebar parts when the built-in composition is not enough.\n */\nexport function useSidebar() {\n const context = useContext(SidebarContext);\n\n if (!context) {\n throw new Error(\"useSidebar must be used within a Sidebar.Root component.\");\n }\n\n return context;\n}\n\nfunction useSidebarStyles() {\n const { open } = useSidebar();\n return sidebar({ open });\n}\n\nexport interface SidebarRootProps extends ComponentPropsWithoutRef<\"aside\"> {\n /** Controlled expanded state. */\n open?: boolean;\n /** Initial expanded state for uncontrolled use. */\n defaultOpen?: boolean;\n /** Called after the requested expanded state changes. */\n onOpenChange?: (open: boolean) => void;\n /** Renders the sidebar as a modal mobile surface when set to overlay. */\n mode?: \"static\" | \"overlay\";\n /** Allows Escape to be disabled for overlay mode. */\n closeOnEscape?: boolean;\n /** Allows outside presses to be disabled for overlay mode. */\n closeOnOutsidePress?: boolean;\n /** Restores focus to the element that opened the overlay. */\n restoreFocus?: boolean;\n /** Controls whether the overlay traps focus and locks page scroll. */\n modal?: boolean | \"trap-focus\";\n children?: ReactNode;\n}\n\n/**\n * The sidebar container. It supports both controlled and uncontrolled state.\n */\nexport const SidebarRoot = forwardRef<HTMLElement, SidebarRootProps>(function SidebarRoot(\n {\n children,\n className,\n closeOnEscape = true,\n closeOnOutsidePress = true,\n defaultOpen = true,\n modal = true,\n mode = \"static\",\n onOpenChange,\n open: controlledOpen,\n restoreFocus = true,\n ...props\n },\n ref,\n) {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = controlledOpen ?? uncontrolledOpen;\n\n const setOpen = useCallback(\n (nextOpen: boolean) => {\n if (!isControlled) {\n setUncontrolledOpen(nextOpen);\n }\n\n onOpenChange?.(nextOpen);\n },\n [isControlled, onOpenChange],\n );\n\n const toggle = useCallback(() => {\n setOpen(!open);\n }, [open, setOpen]);\n\n const context = useMemo<SidebarContextValue>(\n () => ({ open, setOpen, toggle }),\n [open, setOpen, toggle],\n );\n const styles = sidebar({ open });\n const scopedPortalProps = useThemePortalProps({});\n\n const surface = (\n <aside\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"sidebar\"\n data-open={open}\n data-slot=\"sidebar\"\n data-state={open ? \"open\" : \"closed\"}\n >\n {children}\n </aside>\n );\n\n if (mode === \"overlay\") {\n return (\n <SidebarContext.Provider value={context}>\n <BaseDialog.Root\n open={open}\n modal={modal}\n onOpenChange={(nextOpen, details) => {\n if (\n !nextOpen &&\n ((!closeOnEscape && details.reason === \"escape-key\") ||\n (!closeOnOutsidePress && details.reason === \"outside-press\"))\n ) {\n details.cancel();\n return;\n }\n setOpen(nextOpen);\n }}\n >\n <BaseDialog.Portal {...scopedPortalProps}>\n <BaseDialog.Backdrop\n className={cx(styles.backdrop)}\n data-jaci-component=\"sidebar\"\n data-slot=\"sidebar-backdrop\"\n />\n <BaseDialog.Viewport className={cx(styles.viewport)} data-slot=\"sidebar-viewport\">\n <BaseDialog.Popup\n aria-label={props[\"aria-label\"] ?? \"Sidebar navigation\"}\n className={cx(styles.popup)}\n data-jaci-component=\"sidebar\"\n data-slot=\"sidebar-popup\"\n finalFocus={restoreFocus}\n initialFocus\n >\n {surface}\n </BaseDialog.Popup>\n </BaseDialog.Viewport>\n </BaseDialog.Portal>\n </BaseDialog.Root>\n </SidebarContext.Provider>\n );\n }\n\n return <SidebarContext.Provider value={context}>{surface}</SidebarContext.Provider>;\n});\n\nexport type SidebarPortalProps = ComponentPropsWithoutRef<typeof BaseDialog.Portal>;\nexport function SidebarPortal(props: SidebarPortalProps) {\n return <BaseDialog.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type SidebarBackdropProps = ComponentPropsWithoutRef<typeof BaseDialog.Backdrop>;\nexport const SidebarBackdrop = forwardRef<HTMLDivElement, SidebarBackdropProps>(\n function SidebarBackdrop({ className, ...props }, ref) {\n const { open } = useSidebar();\n return (\n <BaseDialog.Backdrop\n {...props}\n className={withRecipeClassName(sidebar({ open }).backdrop, className)}\n data-slot=\"sidebar-backdrop\"\n ref={ref}\n />\n );\n },\n);\n\nexport type SidebarToggleProps = ComponentPropsWithoutRef<\"button\">;\n\n/**\n * A floating, accessible control that expands or collapses the sidebar.\n */\nexport const SidebarToggle = forwardRef<HTMLButtonElement, SidebarToggleProps>(\n function SidebarToggle(\n { \"aria-label\": ariaLabel, children, className, onClick, type = \"button\", ...props },\n ref,\n ) {\n const { open, toggle } = useSidebar();\n const styles = useSidebarStyles();\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n\n if (!event.defaultPrevented) {\n toggle();\n }\n };\n\n return (\n <button\n {...props}\n aria-expanded={open}\n aria-label={ariaLabel ?? (open ? \"Collapse sidebar\" : \"Expand sidebar\")}\n className={cx(styles.toggle, className)}\n data-slot=\"sidebar-toggle\"\n onClick={handleClick}\n ref={ref}\n type={type}\n >\n {children ?? <span aria-hidden=\"true\">{open ? \"‹\" : \"›\"}</span>}\n </button>\n );\n },\n);\n\nexport type SidebarHeaderProps = ComponentPropsWithoutRef<\"header\">;\n\nexport const SidebarHeader = forwardRef<HTMLElement, SidebarHeaderProps>(function SidebarHeader(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <header\n {...props}\n ref={ref}\n className={cx(styles.header, className)}\n data-slot=\"sidebar-header\"\n />\n );\n});\n\nexport type SidebarContentProps = ComponentPropsWithoutRef<\"nav\">;\n\nexport const SidebarContent = forwardRef<HTMLElement, SidebarContentProps>(function SidebarContent(\n { \"aria-label\": ariaLabel, className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <nav\n {...props}\n aria-label={ariaLabel ?? \"Sidebar navigation\"}\n ref={ref}\n className={cx(styles.content, className)}\n data-slot=\"sidebar-content\"\n />\n );\n});\n\nexport type SidebarFooterProps = ComponentPropsWithoutRef<\"footer\">;\n\nexport const SidebarFooter = forwardRef<HTMLElement, SidebarFooterProps>(function SidebarFooter(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <footer\n {...props}\n ref={ref}\n className={cx(styles.footer, className)}\n data-slot=\"sidebar-footer\"\n />\n );\n});\n\nexport interface SidebarItemProps extends ComponentPropsWithoutRef<\"a\"> {\n /** Marks the current navigation destination. */\n active?: boolean;\n}\n\n/**\n * A semantic navigation item. Pair its icon/content with `Sidebar.Label` so\n * the text transitions out of view while remaining available to assistive\n * technology when the sidebar is collapsed.\n */\nexport const SidebarItem = forwardRef<HTMLAnchorElement, SidebarItemProps>(function SidebarItem(\n { \"aria-current\": ariaCurrent, active = false, className, ...props },\n ref,\n) {\n const { open } = useSidebar();\n const styles = sidebar({ active, open });\n\n return (\n <a\n {...props}\n aria-current={ariaCurrent ?? (active ? \"page\" : undefined)}\n ref={ref}\n className={cx(styles.item, className)}\n data-active={active || undefined}\n data-slot=\"sidebar-item\"\n />\n );\n});\n\nexport type SidebarLabelProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const SidebarLabel = forwardRef<HTMLSpanElement, SidebarLabelProps>(function SidebarLabel(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <span {...props} ref={ref} className={cx(styles.label, className)} data-slot=\"sidebar-label\" />\n );\n});\n\nexport const Sidebar = {\n Root: SidebarRoot,\n Portal: SidebarPortal,\n Backdrop: SidebarBackdrop,\n Toggle: SidebarToggle,\n Header: SidebarHeader,\n Content: SidebarContent,\n Footer: SidebarFooter,\n Item: SidebarItem,\n Label: SidebarLabel,\n};\n"],"mappings":";;;;;;;;;AAoBA,MAAM,iBAAiB,cAA0C,IAAI;;;;;;AAOrE,SAAgB,aAAa;CAC3B,MAAM,UAAU,WAAW,cAAc;CAEzC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,0DAA0D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O,OAAO,SAAS;EAAG,aAAU;CAAiB,CAAA;AAElG,CAAC;AAED,MAAa,UAAU;CACrB,MAAM;CACN,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,MAAM;CACN,OAAO;AACT"}
1
+ {"version":3,"file":"sidebar.js","names":["BaseDialog"],"sources":["../../../src/components/sidebar/sidebar.tsx"],"sourcesContent":["\"use client\";\n\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { createContext, forwardRef, useCallback, useContext, useMemo, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, MouseEvent, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { sidebar } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\nexport interface SidebarContextValue {\n /** Whether the sidebar is visually expanded. */\n open: boolean;\n /** Updates the expanded state, respecting controlled usage. */\n setOpen: (open: boolean) => void;\n /** Convenience callback for toggles placed anywhere in the sidebar. */\n toggle: () => void;\n}\n\nconst SidebarContext = createContext<SidebarContextValue | null>(null);\n\n/**\n * Reads the state exposed by `Sidebar.Root`.\n *\n * Use it in custom sidebar parts when the built-in composition is not enough.\n */\nexport function useSidebar() {\n const context = useContext(SidebarContext);\n\n if (!context) {\n throw new Error(\"useSidebar must be used within a Sidebar.Root component.\");\n }\n\n return context;\n}\n\nfunction useSidebarStyles() {\n const { open } = useSidebar();\n return sidebar({ open });\n}\n\nexport interface SidebarRootProps extends ComponentPropsWithoutRef<\"aside\"> {\n /** Controlled expanded state. */\n open?: boolean;\n /** Initial expanded state for uncontrolled use. */\n defaultOpen?: boolean;\n /** Called after the requested expanded state changes. */\n onOpenChange?: (open: boolean) => void;\n /** Renders the sidebar as a modal mobile surface when set to overlay. */\n mode?: \"static\" | \"overlay\";\n /** Allows Escape to be disabled for overlay mode. */\n closeOnEscape?: boolean;\n /** Allows outside presses to be disabled for overlay mode. */\n closeOnOutsidePress?: boolean;\n /** Restores focus to the element that opened the overlay. */\n restoreFocus?: boolean;\n /** Controls whether the overlay traps focus and locks page scroll. */\n modal?: boolean | \"trap-focus\";\n children?: ReactNode;\n}\n\n/**\n * The sidebar container. It supports both controlled and uncontrolled state.\n */\nexport const SidebarRoot = forwardRef<HTMLElement, SidebarRootProps>(function SidebarRoot(\n {\n children,\n className,\n closeOnEscape = true,\n closeOnOutsidePress = true,\n defaultOpen = true,\n modal = true,\n mode = \"static\",\n onOpenChange,\n open: controlledOpen,\n restoreFocus = true,\n ...props\n },\n ref,\n) {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const isControlled = controlledOpen !== undefined;\n const open = controlledOpen ?? uncontrolledOpen;\n\n const setOpen = useCallback(\n (nextOpen: boolean) => {\n if (!isControlled) {\n setUncontrolledOpen(nextOpen);\n }\n\n onOpenChange?.(nextOpen);\n },\n [isControlled, onOpenChange],\n );\n\n const toggle = useCallback(() => {\n setOpen(!open);\n }, [open, setOpen]);\n\n const context = useMemo<SidebarContextValue>(\n () => ({ open, setOpen, toggle }),\n [open, setOpen, toggle],\n );\n const styles = sidebar({ open });\n const scopedPortalProps = useThemePortalProps({});\n\n const surface = (\n <aside\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"sidebar\"\n data-open={open}\n data-slot=\"sidebar\"\n data-state={open ? \"open\" : \"closed\"}\n >\n {children}\n </aside>\n );\n\n if (mode === \"overlay\") {\n return (\n <SidebarContext.Provider value={context}>\n <BaseDialog.Root\n open={open}\n modal={modal}\n onOpenChange={(nextOpen, details) => {\n if (\n !nextOpen &&\n ((!closeOnEscape && details.reason === \"escape-key\") ||\n (!closeOnOutsidePress && details.reason === \"outside-press\"))\n ) {\n details.cancel();\n return;\n }\n setOpen(nextOpen);\n }}\n >\n <BaseDialog.Portal {...scopedPortalProps}>\n <BaseDialog.Backdrop\n className={cx(styles.backdrop)}\n data-jaci-component=\"sidebar\"\n data-slot=\"sidebar-backdrop\"\n />\n <BaseDialog.Viewport className={cx(styles.viewport)} data-slot=\"sidebar-viewport\">\n <BaseDialog.Popup\n aria-label={props[\"aria-label\"] ?? \"Sidebar navigation\"}\n className={cx(styles.popup)}\n data-jaci-component=\"sidebar\"\n data-slot=\"sidebar-popup\"\n finalFocus={restoreFocus}\n initialFocus\n >\n {surface}\n </BaseDialog.Popup>\n </BaseDialog.Viewport>\n </BaseDialog.Portal>\n </BaseDialog.Root>\n </SidebarContext.Provider>\n );\n }\n\n return <SidebarContext.Provider value={context}>{surface}</SidebarContext.Provider>;\n});\n\nexport type SidebarPortalProps = ComponentPropsWithoutRef<typeof BaseDialog.Portal>;\nexport function SidebarPortal(props: SidebarPortalProps) {\n return <BaseDialog.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type SidebarBackdropProps = ComponentPropsWithoutRef<typeof BaseDialog.Backdrop>;\nexport const SidebarBackdrop = forwardRef<HTMLDivElement, SidebarBackdropProps>(\n function SidebarBackdrop({ className, ...props }, ref) {\n const { open } = useSidebar();\n return (\n <BaseDialog.Backdrop\n {...props}\n className={withRecipeClassName(sidebar({ open }).backdrop, className)}\n data-slot=\"sidebar-backdrop\"\n ref={ref}\n />\n );\n },\n);\n\nexport type SidebarToggleProps = ComponentPropsWithoutRef<\"button\">;\n\n/**\n * A floating, accessible control that expands or collapses the sidebar.\n */\nexport const SidebarToggle = forwardRef<HTMLButtonElement, SidebarToggleProps>(\n function SidebarToggle(\n { \"aria-label\": ariaLabel, children, className, onClick, type = \"button\", ...props },\n ref,\n ) {\n const { open, toggle } = useSidebar();\n const styles = useSidebarStyles();\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n\n if (!event.defaultPrevented) {\n toggle();\n }\n };\n\n return (\n <button\n {...props}\n aria-expanded={open}\n aria-label={ariaLabel ?? (open ? \"Collapse sidebar\" : \"Expand sidebar\")}\n className={cx(styles.toggle, className)}\n data-slot=\"sidebar-toggle\"\n onClick={handleClick}\n ref={ref}\n type={type}\n >\n {children ?? <span aria-hidden=\"true\">{open ? \"‹\" : \"›\"}</span>}\n </button>\n );\n },\n);\n\nexport type SidebarHeaderProps = ComponentPropsWithoutRef<\"header\">;\n\nexport const SidebarHeader = forwardRef<HTMLElement, SidebarHeaderProps>(function SidebarHeader(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <header\n {...props}\n ref={ref}\n className={cx(styles.header, className)}\n data-slot=\"sidebar-header\"\n />\n );\n});\n\nexport type SidebarContentProps = ComponentPropsWithoutRef<\"nav\">;\n\nexport const SidebarContent = forwardRef<HTMLElement, SidebarContentProps>(function SidebarContent(\n { \"aria-label\": ariaLabel, className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <nav\n {...props}\n aria-label={ariaLabel ?? \"Sidebar navigation\"}\n ref={ref}\n className={cx(styles.content, className)}\n data-slot=\"sidebar-content\"\n />\n );\n});\n\nexport type SidebarFooterProps = ComponentPropsWithoutRef<\"footer\">;\n\nexport const SidebarFooter = forwardRef<HTMLElement, SidebarFooterProps>(function SidebarFooter(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <footer\n {...props}\n ref={ref}\n className={cx(styles.footer, className)}\n data-slot=\"sidebar-footer\"\n />\n );\n});\n\nexport interface SidebarItemProps extends ComponentPropsWithoutRef<\"a\"> {\n /** Marks the current navigation destination. */\n active?: boolean;\n}\n\n/**\n * A semantic navigation item. Pair its icon/content with `Sidebar.Label` so\n * the text transitions out of view while remaining available to assistive\n * technology when the sidebar is collapsed.\n */\nexport const SidebarItem = forwardRef<HTMLAnchorElement, SidebarItemProps>(function SidebarItem(\n { \"aria-current\": ariaCurrent, active = false, className, ...props },\n ref,\n) {\n const { open } = useSidebar();\n const styles = sidebar({ active, open });\n\n return (\n <a\n {...props}\n aria-current={ariaCurrent ?? (active ? \"page\" : undefined)}\n ref={ref}\n className={cx(styles.item, className)}\n data-active={active || undefined}\n data-slot=\"sidebar-item\"\n />\n );\n});\n\nexport type SidebarLabelProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const SidebarLabel = forwardRef<HTMLSpanElement, SidebarLabelProps>(function SidebarLabel(\n { className, ...props },\n ref,\n) {\n const styles = useSidebarStyles();\n\n return (\n <span {...props} ref={ref} className={cx(styles.label, className)} data-slot=\"sidebar-label\" />\n );\n});\n\nexport const Sidebar = {\n Root: SidebarRoot,\n Portal: SidebarPortal,\n Backdrop: SidebarBackdrop,\n Toggle: SidebarToggle,\n Header: SidebarHeader,\n Content: SidebarContent,\n Footer: SidebarFooter,\n Item: SidebarItem,\n Label: SidebarLabel,\n};\n"],"mappings":";;;;;;;;;AAoBA,MAAM,iBAAiB,cAA0C,IAAI;;;;;;AAOrE,SAAgB,aAAa;CAC3B,MAAM,UAAU,WAAW,cAAc;CAEzC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,0DAA0D;CAG5E,OAAO;AACT;AAEA,SAAS,mBAAmB;CAC1B,MAAM,EAAE,SAAS,WAAW;CAC5B,OAAO,QAAQ,EAAE,KAAK,CAAC;AACzB;;;;AAyBA,MAAa,cAAc,WAA0C,SAAS,YAC5E,EACE,UACA,WACA,gBAAgB,MAChB,sBAAsB,MACtB,cAAc,MACd,QAAQ,MACR,OAAO,UACP,cACA,MAAM,gBACN,eAAe,MACf,GAAG,SAEL,KACA;CACA,MAAM,CAAC,kBAAkB,uBAAuB,SAAS,WAAW;CACpE,MAAM,eAAe,mBAAmB,KAAA;CACxC,MAAM,OAAO,kBAAkB;CAE/B,MAAM,UAAU,aACb,aAAsB;EACrB,IAAI,CAAC,cACH,oBAAoB,QAAQ;EAG9B,eAAe,QAAQ;CACzB,GACA,CAAC,cAAc,YAAY,CAC7B;CAEA,MAAM,SAAS,kBAAkB;EAC/B,QAAQ,CAAC,IAAI;CACf,GAAG,CAAC,MAAM,OAAO,CAAC;CAElB,MAAM,UAAU,eACP;EAAE;EAAM;EAAS;CAAO,IAC/B;EAAC;EAAM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E,oBAAC,UAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,OAAO,QAAQ,SAAS;EACtC,aAAU;CACX,CAAA;AAEL,CAAC;;;;;;AAYD,MAAa,cAAc,WAAgD,SAAS,YAClF,EAAE,gBAAgB,aAAa,SAAS,OAAO,WAAW,GAAG,SAC7D,KACA;CACA,MAAM,EAAE,SAAS,WAAW;CAC5B,MAAM,SAAS,QAAQ;EAAE;EAAQ;CAAK,CAAC;CAEvC,OACE,oBAAC,KAAD;EACE,GAAI;EACJ,gBAAc,gBAAgB,SAAS,SAAS,KAAA;EAC3C;EACL,WAAW,GAAG,OAAO,MAAM,SAAS;EACpC,eAAa,UAAU,KAAA;EACvB,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,eAAe,WAA+C,SAAS,aAClF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,MAAM,SAAS,iBAAiB;CAEhC,OACE,oBAAC,QAAD;EAAM,GAAI;EAAY;EAAK,WAAW,GAAG,OAAO,OAAO,SAAS;EAAG,aAAU;CAAiB,CAAA;AAElG,CAAC;AAED,MAAa,UAAU;CACrB,MAAM;CACN,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,MAAM;CACN,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"skeleton.cjs","names":["cx","skeleton"],"sources":["../../../src/components/skeleton/skeleton.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { skeleton } from \"../../styled-system/recipes\";\n\nexport type SkeletonVariant = \"text\" | \"circle\" | \"rect\";\n\nexport interface SkeletonProps extends ComponentPropsWithoutRef<\"div\"> {\n variant?: SkeletonVariant;\n /** Disables the pulse while retaining the placeholder's shape. */\n animated?: boolean;\n}\n\n/** A decorative loading placeholder; place `aria-busy` on the loading region. */\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(function Skeleton(\n { animated = true, className, variant = \"rect\", ...props },\n ref,\n) {\n return (\n <div\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={cx(skeleton({ animated, variant }), className)}\n data-animated={animated || undefined}\n data-jaci-component=\"skeleton\"\n data-slot=\"skeleton\"\n data-variant={variant}\n />\n );\n});\n"],"mappings":";;;;;;AAeA,MAAa,YAAA,GAAA,MAAA,WAAA,CAAqD,SAAS,SACzE,EAAE,WAAW,MAAM,WAAW,UAAU,QAAQ,GAAG,SACnD,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACJ,eAAY;EACP;EACL,WAAWA,WAAAA,GAAGC,iBAAAA,SAAS;GAAE;GAAU;EAAQ,CAAC,GAAG,SAAS;EACxD,iBAAe,YAAY,KAAA;EAC3B,uBAAoB;EACpB,aAAU;EACV,gBAAc;CACf,CAAA;AAEL,CAAC"}
1
+ {"version":3,"file":"skeleton.cjs","names":["forwardRef","cx","skeleton"],"sources":["../../../src/components/skeleton/skeleton.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { skeleton } from \"../../styled-system/recipes\";\n\nexport type SkeletonVariant = \"text\" | \"circle\" | \"rect\";\n\nexport interface SkeletonProps extends ComponentPropsWithoutRef<\"div\"> {\n variant?: SkeletonVariant;\n /** Disables the pulse while retaining the placeholder's shape. */\n animated?: boolean;\n}\n\n/** A decorative loading placeholder; place `aria-busy` on the loading region. */\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(function Skeleton(\n { animated = true, className, variant = \"rect\", ...props },\n ref,\n) {\n return (\n <div\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={cx(skeleton({ animated, variant }), className)}\n data-animated={animated || undefined}\n data-jaci-component=\"skeleton\"\n data-slot=\"skeleton\"\n data-variant={variant}\n />\n );\n});\n"],"mappings":";;;;;;AAeA,MAAa,YAAA,GAAWA,MAAAA,WAAAA,CAA0C,SAAS,SACzE,EAAE,WAAW,MAAM,WAAW,UAAU,QAAQ,GAAG,SACnD,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACJ,eAAY;EACP;EACL,WAAWC,WAAAA,GAAGC,iBAAAA,SAAS;GAAE;GAAU;EAAQ,CAAC,GAAG,SAAS;EACxD,iBAAe,YAAY,KAAA;EAC3B,uBAAoB;EACpB,aAAU;EACV,gBAAc;CACf,CAAA;AAEL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"slider.cjs","names":["slider","BaseSlider","withRecipeClassName"],"sources":["../../../src/components/slider/slider.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slider as BaseSlider } from \"@base-ui/react/slider\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { SliderRoot as BaseSliderRoot } from \"@base-ui/react/slider\";\n\nimport { slider } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type SliderSize = \"sm\" | \"md\" | \"lg\";\n\nconst SliderSizeContext = createContext<SliderSize>(\"md\");\n\nfunction useSliderStyles() {\n return slider({ size: useContext(SliderSizeContext) });\n}\n\nexport interface SliderRootProps<\n Value extends number | readonly number[] = number | readonly number[],\n> extends Omit<BaseSliderRoot.Props<Value>, \"children\" | \"className\"> {\n /** Shared visual size for the track and thumb. */\n size?: SliderSize;\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * An accessible single-value or range slider. Use `value`/`onValueChange`\n * for controlled state, or `defaultValue` for an uncontrolled slider.\n */\nexport function SliderRoot<Value extends number | readonly number[] = number | readonly number[]>({\n children,\n className,\n size = \"md\",\n ...props\n}: SliderRootProps<Value>) {\n const styles = slider({ size });\n\n return (\n <SliderSizeContext.Provider value={size}>\n <BaseSlider.Root\n {...props}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"slider\"\n data-slot=\"slider\"\n >\n {children}\n </BaseSlider.Root>\n </SliderSizeContext.Provider>\n );\n}\n\nexport type SliderLabelProps = ComponentPropsWithoutRef<typeof BaseSlider.Label>;\n\nexport const SliderLabel = forwardRef<HTMLDivElement, SliderLabelProps>(function SliderLabel(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().label, className)}\n data-slot=\"slider-label\"\n />\n );\n});\n\nexport type SliderValueProps = ComponentPropsWithoutRef<typeof BaseSlider.Value>;\n\nexport const SliderValue = forwardRef<HTMLOutputElement, SliderValueProps>(function SliderValue(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().value, className)}\n data-slot=\"slider-value\"\n />\n );\n});\n\nexport type SliderControlProps = ComponentPropsWithoutRef<typeof BaseSlider.Control>;\n\nexport const SliderControl = forwardRef<HTMLDivElement, SliderControlProps>(function SliderControl(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Control\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().control, className)}\n data-slot=\"slider-control\"\n />\n );\n});\n\nexport type SliderTrackProps = ComponentPropsWithoutRef<typeof BaseSlider.Track>;\n\nexport const SliderTrack = forwardRef<HTMLDivElement, SliderTrackProps>(function SliderTrack(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Track\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().track, className)}\n data-slot=\"slider-track\"\n />\n );\n});\n\nexport type SliderIndicatorProps = ComponentPropsWithoutRef<typeof BaseSlider.Indicator>;\n\nexport const SliderIndicator = forwardRef<HTMLDivElement, SliderIndicatorProps>(\n function SliderIndicator({ className, ...props }, ref) {\n return (\n <BaseSlider.Indicator\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().indicator, className)}\n data-slot=\"slider-indicator\"\n />\n );\n },\n);\n\nexport type SliderThumbProps = ComponentPropsWithoutRef<typeof BaseSlider.Thumb>;\n\nexport const SliderThumb = forwardRef<HTMLDivElement, SliderThumbProps>(function SliderThumb(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Thumb\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().thumb, className)}\n data-slot=\"slider-thumb\"\n />\n );\n});\n\nexport const Slider = {\n Root: SliderRoot,\n Label: SliderLabel,\n Value: SliderValue,\n Control: SliderControl,\n Track: SliderTrack,\n Indicator: SliderIndicator,\n Thumb: SliderThumb,\n};\n"],"mappings":";;;;;;;AAYA,MAAM,qBAAA,GAAA,MAAA,cAAA,CAA8C,IAAI;AAExD,SAAS,kBAAkB;CACzB,OAAOA,eAAAA,OAAO,EAAE,OAAA,GAAA,MAAA,WAAA,CAAiB,iBAAiB,EAAE,CAAC;AACvD;;;;;AAeA,SAAgB,WAAkF,EAChG,UACA,WACA,OAAO,MACP,GAAG,SACsB;CACzB,MAAM,SAASA,eAAAA,OAAO,EAAE,KAAK,CAAC;CAE9B,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAkB,UAAnB;EAA4B,OAAO;YACjC,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,OAAW,MAAZ;GACE,GAAI;GACJ,WAAWC,gBAAAA,oBAAoB,OAAO,MAAM,SAAS;GACrD,uBAAoB;GACpB,aAAU;GAET;EACc,CAAA;CACS,CAAA;AAEhC;AAIA,MAAa,eAAA,GAAA,MAAA,WAAA,CAA2D,SAAS,YAC/E,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACD,sBAAAA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoB,gBAAgB,CAAC,CAAC,OAAO,SAAS;EACjE,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,eAAA,GAAA,MAAA,WAAA,CAA8D,SAAS,YAClF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,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AAM;CACN,OAAO;CACP,OAAO;CACP,SAAS;CACT,OAAO;CACP,WAAW;CACX,OAAO;AACT"}
1
+ {"version":3,"file":"slider.cjs","names":["createContext","slider","useContext","BaseSlider","withRecipeClassName","forwardRef"],"sources":["../../../src/components/slider/slider.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slider as BaseSlider } from \"@base-ui/react/slider\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { SliderRoot as BaseSliderRoot } from \"@base-ui/react/slider\";\n\nimport { slider } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type SliderSize = \"sm\" | \"md\" | \"lg\";\n\nconst SliderSizeContext = createContext<SliderSize>(\"md\");\n\nfunction useSliderStyles() {\n return slider({ size: useContext(SliderSizeContext) });\n}\n\nexport interface SliderRootProps<\n Value extends number | readonly number[] = number | readonly number[],\n> extends Omit<BaseSliderRoot.Props<Value>, \"children\" | \"className\"> {\n /** Shared visual size for the track and thumb. */\n size?: SliderSize;\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * An accessible single-value or range slider. Use `value`/`onValueChange`\n * for controlled state, or `defaultValue` for an uncontrolled slider.\n */\nexport function SliderRoot<Value extends number | readonly number[] = number | readonly number[]>({\n children,\n className,\n size = \"md\",\n ...props\n}: SliderRootProps<Value>) {\n const styles = slider({ size });\n\n return (\n <SliderSizeContext.Provider value={size}>\n <BaseSlider.Root\n {...props}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"slider\"\n data-slot=\"slider\"\n >\n {children}\n </BaseSlider.Root>\n </SliderSizeContext.Provider>\n );\n}\n\nexport type SliderLabelProps = ComponentPropsWithoutRef<typeof BaseSlider.Label>;\n\nexport const SliderLabel = forwardRef<HTMLDivElement, SliderLabelProps>(function SliderLabel(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().label, className)}\n data-slot=\"slider-label\"\n />\n );\n});\n\nexport type SliderValueProps = ComponentPropsWithoutRef<typeof BaseSlider.Value>;\n\nexport const SliderValue = forwardRef<HTMLOutputElement, SliderValueProps>(function SliderValue(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().value, className)}\n data-slot=\"slider-value\"\n />\n );\n});\n\nexport type SliderControlProps = ComponentPropsWithoutRef<typeof BaseSlider.Control>;\n\nexport const SliderControl = forwardRef<HTMLDivElement, SliderControlProps>(function SliderControl(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Control\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().control, className)}\n data-slot=\"slider-control\"\n />\n );\n});\n\nexport type SliderTrackProps = ComponentPropsWithoutRef<typeof BaseSlider.Track>;\n\nexport const SliderTrack = forwardRef<HTMLDivElement, SliderTrackProps>(function SliderTrack(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Track\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().track, className)}\n data-slot=\"slider-track\"\n />\n );\n});\n\nexport type SliderIndicatorProps = ComponentPropsWithoutRef<typeof BaseSlider.Indicator>;\n\nexport const SliderIndicator = forwardRef<HTMLDivElement, SliderIndicatorProps>(\n function SliderIndicator({ className, ...props }, ref) {\n return (\n <BaseSlider.Indicator\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().indicator, className)}\n data-slot=\"slider-indicator\"\n />\n );\n },\n);\n\nexport type SliderThumbProps = ComponentPropsWithoutRef<typeof BaseSlider.Thumb>;\n\nexport const SliderThumb = forwardRef<HTMLDivElement, SliderThumbProps>(function SliderThumb(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Thumb\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().thumb, className)}\n data-slot=\"slider-thumb\"\n />\n );\n});\n\nexport const Slider = {\n Root: SliderRoot,\n Label: SliderLabel,\n Value: SliderValue,\n Control: SliderControl,\n Track: SliderTrack,\n Indicator: SliderIndicator,\n Thumb: SliderThumb,\n};\n"],"mappings":";;;;;;;AAYA,MAAM,qBAAA,GAAoBA,MAAAA,cAAAA,CAA0B,IAAI;AAExD,SAAS,kBAAkB;CACzB,OAAOC,eAAAA,OAAO,EAAE,OAAA,GAAMC,MAAAA,WAAAA,CAAW,iBAAiB,EAAE,CAAC;AACvD;;;;;AAeA,SAAgB,WAAkF,EAChG,UACA,WACA,OAAO,MACP,GAAG,SACsB;CACzB,MAAM,SAASD,eAAAA,OAAO,EAAE,KAAK,CAAC;CAE9B,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAkB,UAAnB;EAA4B,OAAO;EACjC,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACE,sBAAAA,OAAW,MAAZ;GACE,GAAI;GACJ,WAAWC,gBAAAA,oBAAoB,OAAO,MAAM,SAAS;GACrD,uBAAoB;GACpB,aAAU;GAET;EACc,CAAA;CACS,CAAA;AAEhC;AAIA,MAAa,eAAA,GAAcC,MAAAA,WAAAA,CAA6C,SAAS,YAC/E,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACF,sBAAAA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoB,gBAAgB,CAAC,CAAC,OAAO,SAAS;EACjE,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,eAAA,GAAcC,MAAAA,WAAAA,CAAgD,SAAS,YAClF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACF,sBAAAA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoB,gBAAgB,CAAC,CAAC,OAAO,SAAS;EACjE,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,iBAAA,GAAgBC,MAAAA,WAAAA,CAA+C,SAAS,cACnF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACF,sBAAAA,OAAW,SAAZ;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoB,gBAAgB,CAAC,CAAC,SAAS,SAAS;EACnE,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,eAAA,GAAcC,MAAAA,WAAAA,CAA6C,SAAS,YAC/E,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACF,sBAAAA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoB,gBAAgB,CAAC,CAAC,OAAO,SAAS;EACjE,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,mBAAA,GAAkBC,MAAAA,WAAAA,CAC7B,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAS,KAAK;CACrD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACF,sBAAAA,OAAW,WAAZ;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoB,gBAAgB,CAAC,CAAC,WAAW,SAAS;EACrE,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,eAAA,GAAcC,MAAAA,WAAAA,CAA6C,SAAS,YAC/E,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACF,sBAAAA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoB,gBAAgB,CAAC,CAAC,OAAO,SAAS;EACjE,aAAU;CACX,CAAA;AAEL,CAAC;AAED,MAAa,SAAS;CACpB,MAAM;CACN,OAAO;CACP,OAAO;CACP,SAAS;CACT,OAAO;CACP,WAAW;CACX,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"slider.js","names":["SliderRoot","BaseSlider","Slider"],"sources":["../../../src/components/slider/slider.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slider as BaseSlider } from \"@base-ui/react/slider\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { SliderRoot as BaseSliderRoot } from \"@base-ui/react/slider\";\n\nimport { slider } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type SliderSize = \"sm\" | \"md\" | \"lg\";\n\nconst SliderSizeContext = createContext<SliderSize>(\"md\");\n\nfunction useSliderStyles() {\n return slider({ size: useContext(SliderSizeContext) });\n}\n\nexport interface SliderRootProps<\n Value extends number | readonly number[] = number | readonly number[],\n> extends Omit<BaseSliderRoot.Props<Value>, \"children\" | \"className\"> {\n /** Shared visual size for the track and thumb. */\n size?: SliderSize;\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * An accessible single-value or range slider. Use `value`/`onValueChange`\n * for controlled state, or `defaultValue` for an uncontrolled slider.\n */\nexport function SliderRoot<Value extends number | readonly number[] = number | readonly number[]>({\n children,\n className,\n size = \"md\",\n ...props\n}: SliderRootProps<Value>) {\n const styles = slider({ size });\n\n return (\n <SliderSizeContext.Provider value={size}>\n <BaseSlider.Root\n {...props}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"slider\"\n data-slot=\"slider\"\n >\n {children}\n </BaseSlider.Root>\n </SliderSizeContext.Provider>\n );\n}\n\nexport type SliderLabelProps = ComponentPropsWithoutRef<typeof BaseSlider.Label>;\n\nexport const SliderLabel = forwardRef<HTMLDivElement, SliderLabelProps>(function SliderLabel(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().label, className)}\n data-slot=\"slider-label\"\n />\n );\n});\n\nexport type SliderValueProps = ComponentPropsWithoutRef<typeof BaseSlider.Value>;\n\nexport const SliderValue = forwardRef<HTMLOutputElement, SliderValueProps>(function SliderValue(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().value, className)}\n data-slot=\"slider-value\"\n />\n );\n});\n\nexport type SliderControlProps = ComponentPropsWithoutRef<typeof BaseSlider.Control>;\n\nexport const SliderControl = forwardRef<HTMLDivElement, SliderControlProps>(function SliderControl(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Control\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().control, className)}\n data-slot=\"slider-control\"\n />\n );\n});\n\nexport type SliderTrackProps = ComponentPropsWithoutRef<typeof BaseSlider.Track>;\n\nexport const SliderTrack = forwardRef<HTMLDivElement, SliderTrackProps>(function SliderTrack(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Track\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().track, className)}\n data-slot=\"slider-track\"\n />\n );\n});\n\nexport type SliderIndicatorProps = ComponentPropsWithoutRef<typeof BaseSlider.Indicator>;\n\nexport const SliderIndicator = forwardRef<HTMLDivElement, SliderIndicatorProps>(\n function SliderIndicator({ className, ...props }, ref) {\n return (\n <BaseSlider.Indicator\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().indicator, className)}\n data-slot=\"slider-indicator\"\n />\n );\n },\n);\n\nexport type SliderThumbProps = ComponentPropsWithoutRef<typeof BaseSlider.Thumb>;\n\nexport const SliderThumb = forwardRef<HTMLDivElement, SliderThumbProps>(function SliderThumb(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Thumb\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().thumb, className)}\n data-slot=\"slider-thumb\"\n />\n );\n});\n\nexport const Slider = {\n Root: SliderRoot,\n Label: SliderLabel,\n Value: SliderValue,\n Control: SliderControl,\n Track: SliderTrack,\n Indicator: SliderIndicator,\n Thumb: SliderThumb,\n};\n"],"mappings":";;;;;;;AAYA,MAAM,oBAAoB,cAA0B,IAAI;AAExD,SAAS,kBAAkB;CACzB,OAAO,OAAO,EAAE,MAAM,WAAW,iBAAiB,EAAE,CAAC;AACvD;;;;;AAeA,SAAgB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,SAAS;EACrE,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,cAAc,WAA6C,SAAS,YAC/E,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAACA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,gBAAgB,CAAC,CAAC,OAAO,SAAS;EACjE,aAAU;CACX,CAAA;AAEL,CAAC;AAED,MAAaC,WAAS;CACpB,MAAMF;CACN,OAAO;CACP,OAAO;CACP,SAAS;CACT,OAAO;CACP,WAAW;CACX,OAAO;AACT"}
1
+ {"version":3,"file":"slider.js","names":["SliderRoot","BaseSlider","Slider"],"sources":["../../../src/components/slider/slider.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slider as BaseSlider } from \"@base-ui/react/slider\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { SliderRoot as BaseSliderRoot } from \"@base-ui/react/slider\";\n\nimport { slider } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type SliderSize = \"sm\" | \"md\" | \"lg\";\n\nconst SliderSizeContext = createContext<SliderSize>(\"md\");\n\nfunction useSliderStyles() {\n return slider({ size: useContext(SliderSizeContext) });\n}\n\nexport interface SliderRootProps<\n Value extends number | readonly number[] = number | readonly number[],\n> extends Omit<BaseSliderRoot.Props<Value>, \"children\" | \"className\"> {\n /** Shared visual size for the track and thumb. */\n size?: SliderSize;\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * An accessible single-value or range slider. Use `value`/`onValueChange`\n * for controlled state, or `defaultValue` for an uncontrolled slider.\n */\nexport function SliderRoot<Value extends number | readonly number[] = number | readonly number[]>({\n children,\n className,\n size = \"md\",\n ...props\n}: SliderRootProps<Value>) {\n const styles = slider({ size });\n\n return (\n <SliderSizeContext.Provider value={size}>\n <BaseSlider.Root\n {...props}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"slider\"\n data-slot=\"slider\"\n >\n {children}\n </BaseSlider.Root>\n </SliderSizeContext.Provider>\n );\n}\n\nexport type SliderLabelProps = ComponentPropsWithoutRef<typeof BaseSlider.Label>;\n\nexport const SliderLabel = forwardRef<HTMLDivElement, SliderLabelProps>(function SliderLabel(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().label, className)}\n data-slot=\"slider-label\"\n />\n );\n});\n\nexport type SliderValueProps = ComponentPropsWithoutRef<typeof BaseSlider.Value>;\n\nexport const SliderValue = forwardRef<HTMLOutputElement, SliderValueProps>(function SliderValue(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().value, className)}\n data-slot=\"slider-value\"\n />\n );\n});\n\nexport type SliderControlProps = ComponentPropsWithoutRef<typeof BaseSlider.Control>;\n\nexport const SliderControl = forwardRef<HTMLDivElement, SliderControlProps>(function SliderControl(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Control\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().control, className)}\n data-slot=\"slider-control\"\n />\n );\n});\n\nexport type SliderTrackProps = ComponentPropsWithoutRef<typeof BaseSlider.Track>;\n\nexport const SliderTrack = forwardRef<HTMLDivElement, SliderTrackProps>(function SliderTrack(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Track\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().track, className)}\n data-slot=\"slider-track\"\n />\n );\n});\n\nexport type SliderIndicatorProps = ComponentPropsWithoutRef<typeof BaseSlider.Indicator>;\n\nexport const SliderIndicator = forwardRef<HTMLDivElement, SliderIndicatorProps>(\n function SliderIndicator({ className, ...props }, ref) {\n return (\n <BaseSlider.Indicator\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().indicator, className)}\n data-slot=\"slider-indicator\"\n />\n );\n },\n);\n\nexport type SliderThumbProps = ComponentPropsWithoutRef<typeof BaseSlider.Thumb>;\n\nexport const SliderThumb = forwardRef<HTMLDivElement, SliderThumbProps>(function SliderThumb(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSlider.Thumb\n {...props}\n ref={ref}\n className={withRecipeClassName(useSliderStyles().thumb, className)}\n data-slot=\"slider-thumb\"\n />\n );\n});\n\nexport const Slider = {\n Root: SliderRoot,\n Label: SliderLabel,\n Value: SliderValue,\n Control: SliderControl,\n Track: SliderTrack,\n Indicator: SliderIndicator,\n Thumb: SliderThumb,\n};\n"],"mappings":";;;;;;;AAYA,MAAM,oBAAoB,cAA0B,IAAI;AAExD,SAAS,kBAAkB;CACzB,OAAO,OAAO,EAAE,MAAM,WAAW,iBAAiB,EAAE,CAAC;AACvD;;;;;AAeA,SAAgBA,aAAkF,EAChG,UACA,WACA,OAAO,MACP,GAAG,SACsB;CACzB,MAAM,SAAS,OAAO,EAAE,KAAK,CAAC;CAE9B,OACE,oBAAC,kBAAkB,UAAnB;EAA4B,OAAO;EACjC,UAAA,oBAACC,OAAW,MAAZ;GACE,GAAI;GACJ,WAAW,oBAAoB,OAAO,MAAM,SAAS;GACrD,uBAAoB;GACpB,aAAU;GAET;EACc,CAAA;CACS,CAAA;AAEhC;AAIA,MAAa,cAAc,WAA6C,SAAS,YAC/E,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAACA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,gBAAgB,CAAC,CAAC,OAAO,SAAS;EACjE,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,cAAc,WAAgD,SAAS,YAClF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAACA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,gBAAgB,CAAC,CAAC,OAAO,SAAS;EACjE,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,gBAAgB,WAA+C,SAAS,cACnF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAACA,OAAW,SAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,gBAAgB,CAAC,CAAC,SAAS,SAAS;EACnE,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,cAAc,WAA6C,SAAS,YAC/E,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAACA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,gBAAgB,CAAC,CAAC,OAAO,SAAS;EACjE,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,kBAAkB,WAC7B,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAS,KAAK;CACrD,OACE,oBAACA,OAAW,WAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,gBAAgB,CAAC,CAAC,WAAW,SAAS;EACrE,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,cAAc,WAA6C,SAAS,YAC/E,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAACA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,gBAAgB,CAAC,CAAC,OAAO,SAAS;EACjE,aAAU;CACX,CAAA;AAEL,CAAC;AAED,MAAaC,WAAS;CACpB,MAAMF;CACN,OAAO;CACP,OAAO;CACP,SAAS;CACT,OAAO;CACP,WAAW;CACX,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"spacer.cjs","names":["cx","layoutSpacer"],"sources":["../../../src/components/spacer/spacer.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { layoutSpacer } from \"../../styled-system/recipes\";\n\nexport interface SpacerProps extends ComponentPropsWithoutRef<\"div\"> {\n axis?: \"horizontal\" | \"vertical\";\n size?: \"none\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n}\n\nexport const Spacer = forwardRef<HTMLDivElement, SpacerProps>(function Spacer(\n { axis = \"vertical\", className, size = \"md\", ...props },\n ref,\n) {\n return (\n <div\n {...props}\n aria-hidden={props[\"aria-hidden\"] ?? true}\n className={cx(layoutSpacer({ axis, size }), className)}\n data-axis={axis}\n data-jaci-component=\"spacer\"\n data-size={size}\n data-slot=\"spacer\"\n ref={ref}\n />\n );\n});\n"],"mappings":";;;;;AAWA,MAAa,UAAA,GAAA,MAAA,WAAA,CAAiD,SAAS,OACrE,EAAE,OAAO,YAAY,WAAW,OAAO,MAAM,GAAG,SAChD,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACJ,eAAa,MAAM,kBAAkB;EACrC,WAAWA,WAAAA,GAAGC,sBAAAA,aAAa;GAAE;GAAM;EAAK,CAAC,GAAG,SAAS;EACrD,aAAW;EACX,uBAAoB;EACpB,aAAW;EACX,aAAU;EACL;CACN,CAAA;AAEL,CAAC"}
1
+ {"version":3,"file":"spacer.cjs","names":["forwardRef","cx","layoutSpacer"],"sources":["../../../src/components/spacer/spacer.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { layoutSpacer } from \"../../styled-system/recipes\";\n\nexport interface SpacerProps extends ComponentPropsWithoutRef<\"div\"> {\n axis?: \"horizontal\" | \"vertical\";\n size?: \"none\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n}\n\nexport const Spacer = forwardRef<HTMLDivElement, SpacerProps>(function Spacer(\n { axis = \"vertical\", className, size = \"md\", ...props },\n ref,\n) {\n return (\n <div\n {...props}\n aria-hidden={props[\"aria-hidden\"] ?? true}\n className={cx(layoutSpacer({ axis, size }), className)}\n data-axis={axis}\n data-jaci-component=\"spacer\"\n data-size={size}\n data-slot=\"spacer\"\n ref={ref}\n />\n );\n});\n"],"mappings":";;;;;AAWA,MAAa,UAAA,GAASA,MAAAA,WAAAA,CAAwC,SAAS,OACrE,EAAE,OAAO,YAAY,WAAW,OAAO,MAAM,GAAG,SAChD,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACJ,eAAa,MAAM,kBAAkB;EACrC,WAAWC,WAAAA,GAAGC,sBAAAA,aAAa;GAAE;GAAM;EAAK,CAAC,GAAG,SAAS;EACrD,aAAW;EACX,uBAAoB;EACpB,aAAW;EACX,aAAU;EACL;CACN,CAAA;AAEL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"stat.cjs","names":["stat","cx","statGroup"],"sources":["../../../src/components/stat/stat.tsx"],"sourcesContent":["import { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { stat, statGroup } from \"../../styled-system/recipes\";\n\nexport type StatTone = \"neutral\" | \"accent\" | \"success\" | \"warning\" | \"danger\";\nexport type StatSize = \"sm\" | \"md\" | \"lg\";\nexport type StatTrendDirection = \"up\" | \"down\" | \"neutral\";\n\ninterface StatContextValue {\n size: StatSize;\n styles: ReturnType<typeof stat>;\n tone: StatTone;\n}\n\nconst StatContext = createContext<StatContextValue | null>(null);\n\nfunction useStatContext() {\n const context = useContext(StatContext);\n if (!context) {\n throw new Error(\"Stat parts must be rendered inside Stat.Root.\");\n }\n\n return context;\n}\n\nexport interface StatRootProps extends ComponentPropsWithoutRef<\"article\"> {\n size?: StatSize;\n tone?: StatTone;\n}\n\nexport const StatRoot = forwardRef<HTMLElement, StatRootProps>(function StatRoot(\n { children, className, size = \"md\", tone = \"neutral\", ...props },\n ref,\n) {\n const styles = stat({ size, tone });\n\n return (\n <StatContext.Provider value={{ size, styles, tone }}>\n <article\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"stat\"\n data-size={size}\n data-slot=\"stat\"\n data-tone={tone}\n >\n {children}\n </article>\n </StatContext.Provider>\n );\n});\n\nexport type StatIconProps = ComponentPropsWithoutRef<\"span\">;\nexport const StatIcon = forwardRef<HTMLSpanElement, StatIconProps>(function StatIcon(\n { className, ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return <span {...props} ref={ref} className={cx(styles.icon, className)} data-slot=\"stat-icon\" />;\n});\n\nexport type StatLabelProps = ComponentPropsWithoutRef<\"span\">;\nexport const StatLabel = forwardRef<HTMLSpanElement, StatLabelProps>(function StatLabel(\n { className, ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return (\n <span {...props} ref={ref} className={cx(styles.label, className)} data-slot=\"stat-label\" />\n );\n});\n\nexport type StatValueProps = ComponentPropsWithoutRef<\"strong\">;\nexport const StatValue = forwardRef<HTMLElement, StatValueProps>(function StatValue(\n { className, ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return (\n <strong {...props} ref={ref} className={cx(styles.value, className)} data-slot=\"stat-value\" />\n );\n});\n\nexport type StatDescriptionProps = ComponentPropsWithoutRef<\"p\">;\nexport const StatDescription = forwardRef<HTMLParagraphElement, StatDescriptionProps>(\n function StatDescription({ className, ...props }, ref) {\n const { styles } = useStatContext();\n return (\n <p\n {...props}\n ref={ref}\n className={cx(styles.description, className)}\n data-slot=\"stat-description\"\n />\n );\n },\n);\n\nexport interface StatTrendProps extends ComponentPropsWithoutRef<\"span\"> {\n direction?: StatTrendDirection;\n}\n\nexport const StatTrend = forwardRef<HTMLSpanElement, StatTrendProps>(function StatTrend(\n { className, direction = \"neutral\", ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return (\n <span\n {...props}\n ref={ref}\n className={cx(styles.trend, stat({ direction }).trend, className)}\n data-direction={direction}\n data-slot=\"stat-trend\"\n />\n );\n});\n\nexport const Stat = {\n Root: StatRoot,\n Icon: StatIcon,\n Label: StatLabel,\n Value: StatValue,\n Description: StatDescription,\n Trend: StatTrend,\n};\n\nexport type StatGroupRootProps = ComponentPropsWithoutRef<\"div\"> & {\n columns?: 1 | 2 | 3 | 4;\n gap?: \"sm\" | \"md\" | \"lg\";\n responsive?: boolean;\n};\n\nexport const StatGroupRoot = forwardRef<HTMLDivElement, StatGroupRootProps>(function StatGroupRoot(\n { children, className, columns = 3, gap = \"md\", responsive = true, style, ...props },\n ref,\n) {\n const columnValue = String(columns) as \"1\" | \"2\" | \"3\" | \"4\";\n return (\n <div\n {...props}\n ref={ref}\n className={cx(statGroup({ columns: columnValue, gap }), className)}\n data-columns={columns}\n data-jaci-component=\"stat-group\"\n data-responsive={responsive || undefined}\n data-slot=\"stat-group\"\n style={\n responsive ? style : { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`, ...style }\n }\n >\n {children}\n </div>\n );\n});\n\nexport const StatGroup = { Root: StatGroupRoot };\n\nexport type StatGroupProps = StatGroupRootProps;\n\nexport type StatChildren = ReactNode;\n"],"mappings":";;;;;;AAgBA,MAAM,eAAA,GAAA,MAAA,cAAA,CAAqD,IAAI;AAE/D,SAAS,iBAAiB;CACxB,MAAM,WAAA,GAAA,MAAA,WAAA,CAAqB,WAAW;CACtC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,+CAA+C;CAGjE,OAAO;AACT;AAOA,MAAa,YAAA,GAAA,MAAA,WAAA,CAAkD,SAAS,SACtE,EAAE,UAAU,WAAW,OAAO,MAAM,OAAO,WAAW,GAAG,SACzD,KACA;CACA,MAAM,SAASA,aAAAA,KAAK;EAAE;EAAM;CAAK,CAAC;CAElC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,YAAY,UAAb;EAAsB,OAAO;GAAE;GAAM;GAAQ;EAAK;YAChD,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD;GACE,GAAI;GACC;GACL,WAAWC,WAAAA,GAAG,OAAO,MAAM,SAAS;GACpC,uBAAoB;GACpB,aAAW;GACX,aAAU;GACV,aAAW;GAEV;EACM,CAAA;CACW,CAAA;AAE1B,CAAC;AAGD,MAAa,YAAA,GAAA,MAAA,WAAA,CAAsD,SAAS,SAC1E,EAAE,WAAW,GAAG,SAChB,KACA;CACA,MAAM,EAAE,WAAW,eAAe;CAClC,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC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MAAa,OAAO;CAClB,MAAM;CACN,MAAM;CACN,OAAO;CACP,OAAO;CACP,aAAa;CACb,OAAO;AACT;AAQA,MAAa,iBAAA,GAAA,MAAA,WAAA,CAA+D,SAAS,cACnF,EAAE,UAAU,WAAW,UAAU,GAAG,MAAM,MAAM,aAAa,MAAM,OAAO,GAAG,SAC7E,KACA;CACA,MAAM,cAAc,OAAO,OAAO;CAClC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,WAAWC,WAAAA,GAAGC,mBAAAA,UAAU;GAAE,SAAS;GAAa;EAAI,CAAC,GAAG,SAAS;EACjE,gBAAc;EACd,uBAAoB;EACpB,mBAAiB,cAAc,KAAA;EAC/B,aAAU;EACV,OACE,aAAa,QAAQ;GAAE,qBAAqB,UAAU,QAAQ;GAAoB,GAAG;EAAM;EAG5F;CACE,CAAA;AAET,CAAC;AAED,MAAa,YAAY,EAAE,MAAM,cAAc"}
1
+ {"version":3,"file":"stat.cjs","names":["createContext","useContext","forwardRef","stat","cx","statGroup"],"sources":["../../../src/components/stat/stat.tsx"],"sourcesContent":["import { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { stat, statGroup } from \"../../styled-system/recipes\";\n\nexport type StatTone = \"neutral\" | \"accent\" | \"success\" | \"warning\" | \"danger\";\nexport type StatSize = \"sm\" | \"md\" | \"lg\";\nexport type StatTrendDirection = \"up\" | \"down\" | \"neutral\";\n\ninterface StatContextValue {\n size: StatSize;\n styles: ReturnType<typeof stat>;\n tone: StatTone;\n}\n\nconst StatContext = createContext<StatContextValue | null>(null);\n\nfunction useStatContext() {\n const context = useContext(StatContext);\n if (!context) {\n throw new Error(\"Stat parts must be rendered inside Stat.Root.\");\n }\n\n return context;\n}\n\nexport interface StatRootProps extends ComponentPropsWithoutRef<\"article\"> {\n size?: StatSize;\n tone?: StatTone;\n}\n\nexport const StatRoot = forwardRef<HTMLElement, StatRootProps>(function StatRoot(\n { children, className, size = \"md\", tone = \"neutral\", ...props },\n ref,\n) {\n const styles = stat({ size, tone });\n\n return (\n <StatContext.Provider value={{ size, styles, tone }}>\n <article\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"stat\"\n data-size={size}\n data-slot=\"stat\"\n data-tone={tone}\n >\n {children}\n </article>\n </StatContext.Provider>\n );\n});\n\nexport type StatIconProps = ComponentPropsWithoutRef<\"span\">;\nexport const StatIcon = forwardRef<HTMLSpanElement, StatIconProps>(function StatIcon(\n { className, ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return <span {...props} ref={ref} className={cx(styles.icon, className)} data-slot=\"stat-icon\" />;\n});\n\nexport type StatLabelProps = ComponentPropsWithoutRef<\"span\">;\nexport const StatLabel = forwardRef<HTMLSpanElement, StatLabelProps>(function StatLabel(\n { className, ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return (\n <span {...props} ref={ref} className={cx(styles.label, className)} data-slot=\"stat-label\" />\n );\n});\n\nexport type StatValueProps = ComponentPropsWithoutRef<\"strong\">;\nexport const StatValue = forwardRef<HTMLElement, StatValueProps>(function StatValue(\n { className, ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return (\n <strong {...props} ref={ref} className={cx(styles.value, className)} data-slot=\"stat-value\" />\n );\n});\n\nexport type StatDescriptionProps = ComponentPropsWithoutRef<\"p\">;\nexport const StatDescription = forwardRef<HTMLParagraphElement, StatDescriptionProps>(\n function StatDescription({ className, ...props }, ref) {\n const { styles } = useStatContext();\n return (\n <p\n {...props}\n ref={ref}\n className={cx(styles.description, className)}\n data-slot=\"stat-description\"\n />\n );\n },\n);\n\nexport interface StatTrendProps extends ComponentPropsWithoutRef<\"span\"> {\n direction?: StatTrendDirection;\n}\n\nexport const StatTrend = forwardRef<HTMLSpanElement, StatTrendProps>(function StatTrend(\n { className, direction = \"neutral\", ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return (\n <span\n {...props}\n ref={ref}\n className={cx(styles.trend, stat({ direction }).trend, className)}\n data-direction={direction}\n data-slot=\"stat-trend\"\n />\n );\n});\n\nexport const Stat = {\n Root: StatRoot,\n Icon: StatIcon,\n Label: StatLabel,\n Value: StatValue,\n Description: StatDescription,\n Trend: StatTrend,\n};\n\nexport type StatGroupRootProps = ComponentPropsWithoutRef<\"div\"> & {\n columns?: 1 | 2 | 3 | 4;\n gap?: \"sm\" | \"md\" | \"lg\";\n responsive?: boolean;\n};\n\nexport const StatGroupRoot = forwardRef<HTMLDivElement, StatGroupRootProps>(function StatGroupRoot(\n { children, className, columns = 3, gap = \"md\", responsive = true, style, ...props },\n ref,\n) {\n const columnValue = String(columns) as \"1\" | \"2\" | \"3\" | \"4\";\n return (\n <div\n {...props}\n ref={ref}\n className={cx(statGroup({ columns: columnValue, gap }), className)}\n data-columns={columns}\n data-jaci-component=\"stat-group\"\n data-responsive={responsive || undefined}\n data-slot=\"stat-group\"\n style={\n responsive ? style : { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`, ...style }\n }\n >\n {children}\n </div>\n );\n});\n\nexport const StatGroup = { Root: StatGroupRoot };\n\nexport type StatGroupProps = StatGroupRootProps;\n\nexport type StatChildren = ReactNode;\n"],"mappings":";;;;;;AAgBA,MAAM,eAAA,GAAcA,MAAAA,cAAAA,CAAuC,IAAI;AAE/D,SAAS,iBAAiB;CACxB,MAAM,WAAA,GAAUC,MAAAA,WAAAA,CAAW,WAAW;CACtC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,+CAA+C;CAGjE,OAAO;AACT;AAOA,MAAa,YAAA,GAAWC,MAAAA,WAAAA,CAAuC,SAAS,SACtE,EAAE,UAAU,WAAW,OAAO,MAAM,OAAO,WAAW,GAAG,SACzD,KACA;CACA,MAAM,SAASC,aAAAA,KAAK;EAAE;EAAM;CAAK,CAAC;CAElC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,YAAY,UAAb;EAAsB,OAAO;GAAE;GAA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AO,aAAa,SAAS;EAC3C,aAAU;CACX,CAAA;AAEL,CACF;AAMA,MAAa,aAAA,GAAYF,MAAAA,WAAAA,CAA4C,SAAS,UAC5E,EAAE,WAAW,YAAY,WAAW,GAAG,SACvC,KACA;CACA,MAAM,EAAE,WAAW,eAAe;CAClC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;EACE,GAAI;EACC;EACL,WAAWE,WAAAA,GAAG,OAAO,OAAOD,aAAAA,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,SAAS;EAChE,kBAAgB;EAChB,aAAU;CACX,CAAA;AAEL,CAAC;AAED,MAAa,OAAO;CAClB,MAAM;CACN,MAAM;CACN,OAAO;CACP,OAAO;CACP,aAAa;CACb,OAAO;AACT;AAQA,MAAa,iBAAA,GAAgBD,MAAAA,WAAAA,CAA+C,SAAS,cACnF,EAAE,UAAU,WAAW,UAAU,GAAG,MAAM,MAAM,aAAa,MAAM,OAAO,GAAG,SAC7E,KACA;CACA,MAAM,cAAc,OAAO,OAAO;CAClC,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,WAAWE,WAAAA,GAAGC,mBAAAA,UAAU;GAAE,SAAS;GAAa;EAAI,CAAC,GAAG,SAAS;EACjE,gBAAc;EACd,uBAAoB;EACpB,mBAAiB,cAAc,KAAA;EAC/B,aAAU;EACV,OACE,aAAa,QAAQ;GAAE,qBAAqB,UAAU,QAAQ;GAAoB,GAAG;EAAM;EAG5F;CACE,CAAA;AAET,CAAC;AAED,MAAa,YAAY,EAAE,MAAM,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"stat.js","names":[],"sources":["../../../src/components/stat/stat.tsx"],"sourcesContent":["import { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { stat, statGroup } from \"../../styled-system/recipes\";\n\nexport type StatTone = \"neutral\" | \"accent\" | \"success\" | \"warning\" | \"danger\";\nexport type StatSize = \"sm\" | \"md\" | \"lg\";\nexport type StatTrendDirection = \"up\" | \"down\" | \"neutral\";\n\ninterface StatContextValue {\n size: StatSize;\n styles: ReturnType<typeof stat>;\n tone: StatTone;\n}\n\nconst StatContext = createContext<StatContextValue | null>(null);\n\nfunction useStatContext() {\n const context = useContext(StatContext);\n if (!context) {\n throw new Error(\"Stat parts must be rendered inside Stat.Root.\");\n }\n\n return context;\n}\n\nexport interface StatRootProps extends ComponentPropsWithoutRef<\"article\"> {\n size?: StatSize;\n tone?: StatTone;\n}\n\nexport const StatRoot = forwardRef<HTMLElement, StatRootProps>(function StatRoot(\n { children, className, size = \"md\", tone = \"neutral\", ...props },\n ref,\n) {\n const styles = stat({ size, tone });\n\n return (\n <StatContext.Provider value={{ size, styles, tone }}>\n <article\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"stat\"\n data-size={size}\n data-slot=\"stat\"\n data-tone={tone}\n >\n {children}\n </article>\n </StatContext.Provider>\n );\n});\n\nexport type StatIconProps = ComponentPropsWithoutRef<\"span\">;\nexport const StatIcon = forwardRef<HTMLSpanElement, StatIconProps>(function StatIcon(\n { className, ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return <span {...props} ref={ref} className={cx(styles.icon, className)} data-slot=\"stat-icon\" />;\n});\n\nexport type StatLabelProps = ComponentPropsWithoutRef<\"span\">;\nexport const StatLabel = forwardRef<HTMLSpanElement, StatLabelProps>(function StatLabel(\n { className, ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return (\n <span {...props} ref={ref} className={cx(styles.label, className)} data-slot=\"stat-label\" />\n );\n});\n\nexport type StatValueProps = ComponentPropsWithoutRef<\"strong\">;\nexport const StatValue = forwardRef<HTMLElement, StatValueProps>(function StatValue(\n { className, ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return (\n <strong {...props} ref={ref} className={cx(styles.value, className)} data-slot=\"stat-value\" />\n );\n});\n\nexport type StatDescriptionProps = ComponentPropsWithoutRef<\"p\">;\nexport const StatDescription = forwardRef<HTMLParagraphElement, StatDescriptionProps>(\n function StatDescription({ className, ...props }, ref) {\n const { styles } = useStatContext();\n return (\n <p\n {...props}\n ref={ref}\n className={cx(styles.description, className)}\n data-slot=\"stat-description\"\n />\n );\n },\n);\n\nexport interface StatTrendProps extends ComponentPropsWithoutRef<\"span\"> {\n direction?: StatTrendDirection;\n}\n\nexport const StatTrend = forwardRef<HTMLSpanElement, StatTrendProps>(function StatTrend(\n { className, direction = \"neutral\", ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return (\n <span\n {...props}\n ref={ref}\n className={cx(styles.trend, stat({ direction }).trend, className)}\n data-direction={direction}\n data-slot=\"stat-trend\"\n />\n );\n});\n\nexport const Stat = {\n Root: StatRoot,\n Icon: StatIcon,\n Label: StatLabel,\n Value: StatValue,\n Description: StatDescription,\n Trend: StatTrend,\n};\n\nexport type StatGroupRootProps = ComponentPropsWithoutRef<\"div\"> & {\n columns?: 1 | 2 | 3 | 4;\n gap?: \"sm\" | \"md\" | \"lg\";\n responsive?: boolean;\n};\n\nexport const StatGroupRoot = forwardRef<HTMLDivElement, StatGroupRootProps>(function StatGroupRoot(\n { children, className, columns = 3, gap = \"md\", responsive = true, style, ...props },\n ref,\n) {\n const columnValue = String(columns) as \"1\" | \"2\" | \"3\" | \"4\";\n return (\n <div\n {...props}\n ref={ref}\n className={cx(statGroup({ columns: columnValue, gap }), className)}\n data-columns={columns}\n data-jaci-component=\"stat-group\"\n data-responsive={responsive || undefined}\n data-slot=\"stat-group\"\n style={\n responsive ? style : { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`, ...style }\n }\n >\n {children}\n </div>\n );\n});\n\nexport const StatGroup = { Root: StatGroupRoot };\n\nexport type StatGroupProps = StatGroupRootProps;\n\nexport type StatChildren = ReactNode;\n"],"mappings":";;;;;;AAgBA,MAAM,cAAc,cAAuC,IAAI;AAE/D,SAAS,iBAAiB;CACxB,MAAM,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;EACL,WAAW,GAAG,OAAO,aAAa,SAAS;EAC3C,aAAU;CACX,CAAA;AAEL,CACF;AAMA,MAAa,YAAY,WAA4C,SAAS,UAC5E,EAAE,WAAW,YAAY,WAAW,GAAG,SACvC,KACA;CACA,MAAM,EAAE,WAAW,eAAe;CAClC,OACE,oBAAC,QAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,OAAO,OAAO,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,SAAS;EAChE,kBAAgB;EAChB,aAAU;CACX,CAAA;AAEL,CAAC;AAED,MAAa,OAAO;CAClB,MAAM;CACN,MAAM;CACN,OAAO;CACP,OAAO;CACP,aAAa;CACb,OAAO;AACT;AAQA,MAAa,gBAAgB,WAA+C,SAAS,cACnF,EAAE,UAAU,WAAW,UAAU,GAAG,MAAM,MAAM,aAAa,MAAM,OAAO,GAAG,SAC7E,KACA;CACA,MAAM,cAAc,OAAO,OAAO;CAClC,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,UAAU;GAAE,SAAS;GAAa;EAAI,CAAC,GAAG,SAAS;EACjE,gBAAc;EACd,uBAAoB;EACpB,mBAAiB,cAAc,KAAA;EAC/B,aAAU;EACV,OACE,aAAa,QAAQ;GAAE,qBAAqB,UAAU,QAAQ;GAAoB,GAAG;EAAM;EAG5F;CACE,CAAA;AAET,CAAC;AAED,MAAa,YAAY,EAAE,MAAM,cAAc"}
1
+ {"version":3,"file":"stat.js","names":[],"sources":["../../../src/components/stat/stat.tsx"],"sourcesContent":["import { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { stat, statGroup } from \"../../styled-system/recipes\";\n\nexport type StatTone = \"neutral\" | \"accent\" | \"success\" | \"warning\" | \"danger\";\nexport type StatSize = \"sm\" | \"md\" | \"lg\";\nexport type StatTrendDirection = \"up\" | \"down\" | \"neutral\";\n\ninterface StatContextValue {\n size: StatSize;\n styles: ReturnType<typeof stat>;\n tone: StatTone;\n}\n\nconst StatContext = createContext<StatContextValue | null>(null);\n\nfunction useStatContext() {\n const context = useContext(StatContext);\n if (!context) {\n throw new Error(\"Stat parts must be rendered inside Stat.Root.\");\n }\n\n return context;\n}\n\nexport interface StatRootProps extends ComponentPropsWithoutRef<\"article\"> {\n size?: StatSize;\n tone?: StatTone;\n}\n\nexport const StatRoot = forwardRef<HTMLElement, StatRootProps>(function StatRoot(\n { children, className, size = \"md\", tone = \"neutral\", ...props },\n ref,\n) {\n const styles = stat({ size, tone });\n\n return (\n <StatContext.Provider value={{ size, styles, tone }}>\n <article\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"stat\"\n data-size={size}\n data-slot=\"stat\"\n data-tone={tone}\n >\n {children}\n </article>\n </StatContext.Provider>\n );\n});\n\nexport type StatIconProps = ComponentPropsWithoutRef<\"span\">;\nexport const StatIcon = forwardRef<HTMLSpanElement, StatIconProps>(function StatIcon(\n { className, ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return <span {...props} ref={ref} className={cx(styles.icon, className)} data-slot=\"stat-icon\" />;\n});\n\nexport type StatLabelProps = ComponentPropsWithoutRef<\"span\">;\nexport const StatLabel = forwardRef<HTMLSpanElement, StatLabelProps>(function StatLabel(\n { className, ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return (\n <span {...props} ref={ref} className={cx(styles.label, className)} data-slot=\"stat-label\" />\n );\n});\n\nexport type StatValueProps = ComponentPropsWithoutRef<\"strong\">;\nexport const StatValue = forwardRef<HTMLElement, StatValueProps>(function StatValue(\n { className, ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return (\n <strong {...props} ref={ref} className={cx(styles.value, className)} data-slot=\"stat-value\" />\n );\n});\n\nexport type StatDescriptionProps = ComponentPropsWithoutRef<\"p\">;\nexport const StatDescription = forwardRef<HTMLParagraphElement, StatDescriptionProps>(\n function StatDescription({ className, ...props }, ref) {\n const { styles } = useStatContext();\n return (\n <p\n {...props}\n ref={ref}\n className={cx(styles.description, className)}\n data-slot=\"stat-description\"\n />\n );\n },\n);\n\nexport interface StatTrendProps extends ComponentPropsWithoutRef<\"span\"> {\n direction?: StatTrendDirection;\n}\n\nexport const StatTrend = forwardRef<HTMLSpanElement, StatTrendProps>(function StatTrend(\n { className, direction = \"neutral\", ...props },\n ref,\n) {\n const { styles } = useStatContext();\n return (\n <span\n {...props}\n ref={ref}\n className={cx(styles.trend, stat({ direction }).trend, className)}\n data-direction={direction}\n data-slot=\"stat-trend\"\n />\n );\n});\n\nexport const Stat = {\n Root: StatRoot,\n Icon: StatIcon,\n Label: StatLabel,\n Value: StatValue,\n Description: StatDescription,\n Trend: StatTrend,\n};\n\nexport type StatGroupRootProps = ComponentPropsWithoutRef<\"div\"> & {\n columns?: 1 | 2 | 3 | 4;\n gap?: \"sm\" | \"md\" | \"lg\";\n responsive?: boolean;\n};\n\nexport const StatGroupRoot = forwardRef<HTMLDivElement, StatGroupRootProps>(function StatGroupRoot(\n { children, className, columns = 3, gap = \"md\", responsive = true, style, ...props },\n ref,\n) {\n const columnValue = String(columns) as \"1\" | \"2\" | \"3\" | \"4\";\n return (\n <div\n {...props}\n ref={ref}\n className={cx(statGroup({ columns: columnValue, gap }), className)}\n data-columns={columns}\n data-jaci-component=\"stat-group\"\n data-responsive={responsive || undefined}\n data-slot=\"stat-group\"\n style={\n responsive ? style : { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`, ...style }\n }\n >\n {children}\n </div>\n );\n});\n\nexport const StatGroup = { Root: StatGroupRoot };\n\nexport type StatGroupProps = StatGroupRootProps;\n\nexport type StatChildren = ReactNode;\n"],"mappings":";;;;;;AAgBA,MAAM,cAAc,cAAuC,IAAI;AAE/D,SAAS,iBAAiB;CACxB,MAAM,UAAU,WAAW,WAAW;CACtC,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,+CAA+C;CAGjE,OAAO;AACT;AAOA,MAAa,WAAW,WAAuC,SAAS,SACtE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WAAW,YAAY,WAAW,GAAG,SACvC,KACA;CACA,MAAM,EAAE,WAAW,eAAe;CAClC,OACE,oBAAC,QAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,OAAO,OAAO,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,SAAS;EAChE,kBAAgB;EAChB,aAAU;CACX,CAAA;AAEL,CAAC;AAED,MAAa,OAAO;CAClB,MAAM;CACN,MAAM;CACN,OAAO;CACP,OAAO;CACP,aAAa;CACb,OAAO;AACT;AAQA,MAAa,gBAAgB,WAA+C,SAAS,cACnF,EAAE,UAAU,WAAW,UAAU,GAAG,MAAM,MAAM,aAAa,MAAM,OAAO,GAAG,SAC7E,KACA;CACA,MAAM,cAAc,OAAO,OAAO;CAClC,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,UAAU;GAAE,SAAS;GAAa;EAAI,CAAC,GAAG,SAAS;EACjE,gBAAc;EACd,uBAAoB;EACpB,mBAAiB,cAAc,KAAA;EAC/B,aAAU;EACV,OACE,aAAa,QAAQ;GAAE,qBAAqB,UAAU,QAAQ;GAAoB,GAAG;EAAM;EAG5F;CACE,CAAA;AAET,CAAC;AAED,MAAa,YAAY,EAAE,MAAM,cAAc"}
@@ -247,9 +247,10 @@ const StepperIndicator = (0, react.forwardRef)(function StepperIndicator({ child
247
247
  function createSpanSlot(slot) {
248
248
  return (0, react.forwardRef)(function StepperSlot({ className, ...props }, ref) {
249
249
  const { orientation } = useStepperContext();
250
+ const item = useStepperItemContext();
250
251
  const styles = require_stepper.stepper({
251
252
  orientation,
252
- status: useStepperItemContext().status
253
+ status: item.status
253
254
  });
254
255
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
255
256
  ...props,
@@ -1 +1 @@
1
- {"version":3,"file":"stepper.cjs","names":["cx","stepper"],"sources":["../../../src/components/stepper/stepper.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { stepper } from \"../../styled-system/recipes\";\n\nexport type StepperOrientation = \"horizontal\" | \"vertical\";\nexport type StepperStatus = \"current\" | \"complete\" | \"upcoming\" | \"disabled\";\n\ninterface StepRecord {\n value: string;\n disabled: boolean;\n status?: StepperStatus;\n}\n\ninterface StepperContextValue {\n activeValue: string | undefined;\n allowStepSelect: boolean;\n disabled: boolean;\n getStatus: (value: string, status?: StepperStatus, disabled?: boolean) => StepperStatus;\n goTo: (value: string, options?: { fromNavigation?: boolean }) => void;\n linear: boolean;\n orientation: StepperOrientation;\n register: (record: StepRecord) => void;\n unregister: (value: string) => void;\n move: (direction: -1 | 1) => void;\n moveToBoundary: (direction: -1 | 1) => void;\n}\n\ninterface StepperItemContextValue {\n disabled: boolean;\n status: StepperStatus;\n value: string;\n}\n\nconst StepperContext = createContext<StepperContextValue | null>(null);\nconst StepperItemContext = createContext<StepperItemContextValue | null>(null);\n\nfunction useStepperContext() {\n const context = useContext(StepperContext);\n if (!context) throw new Error(\"Stepper parts must be rendered inside Stepper.Root.\");\n return context;\n}\n\nfunction useStepperItemContext() {\n const context = useContext(StepperItemContext);\n if (!context) throw new Error(\"This Stepper part must be rendered inside Stepper.Item.\");\n return context;\n}\n\nexport interface StepperRootProps extends Omit<ComponentPropsWithoutRef<\"nav\">, \"children\"> {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n orientation?: StepperOrientation;\n linear?: boolean;\n allowStepSelect?: boolean;\n disabled?: boolean;\n name?: string;\n form?: string;\n children?: ReactNode;\n}\n\nexport const StepperRoot = forwardRef<HTMLElement, StepperRootProps>(function StepperRoot(\n {\n allowStepSelect = true,\n \"aria-label\": ariaLabel,\n children,\n className,\n defaultValue,\n disabled = false,\n form,\n linear = false,\n name,\n onValueChange,\n orientation = \"horizontal\",\n value: controlledValue,\n ...props\n },\n ref,\n) {\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const [records, setRecords] = useState<StepRecord[]>([]);\n const activeValue = controlledValue ?? uncontrolledValue ?? records[0]?.value;\n\n const register = useCallback((record: StepRecord) => {\n setRecords((current) => {\n const index = current.findIndex((item) => item.value === record.value);\n if (index === -1) return [...current, record];\n const currentRecord = current[index];\n if (!currentRecord) return current;\n if (currentRecord.disabled === record.disabled && currentRecord.status === record.status) {\n return current;\n }\n const next = current.slice();\n next[index] = record;\n return next;\n });\n }, []);\n\n const unregister = useCallback((valueToRemove: string) => {\n setRecords((current) => current.filter((item) => item.value !== valueToRemove));\n }, []);\n\n const goTo = useCallback(\n (nextValue: string, options?: { fromNavigation?: boolean }) => {\n if (disabled) return;\n const targetIndex = records.findIndex((item) => item.value === nextValue);\n const activeIndex = records.findIndex((item) => item.value === activeValue);\n const target = records[targetIndex];\n if (!target || target.disabled) return;\n if (nextValue === activeValue) return;\n if (!allowStepSelect && !options?.fromNavigation && nextValue !== activeValue) return;\n if (linear && activeIndex >= 0 && targetIndex > activeIndex + 1) return;\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue);\n },\n [activeValue, allowStepSelect, controlledValue, disabled, linear, onValueChange, records],\n );\n\n const move = useCallback(\n (direction: -1 | 1) => {\n const activeIndex = records.findIndex((item) => item.value === activeValue);\n let index = activeIndex + direction;\n while (index >= 0 && index < records.length && records[index]?.disabled) index += direction;\n const target = records[index];\n if (target) goTo(target.value, { fromNavigation: true });\n },\n [activeValue, goTo, records],\n );\n\n const moveToBoundary = useCallback(\n (direction: -1 | 1) => {\n const candidates = direction === -1 ? records : records.slice().reverse();\n const target = candidates.find((record) => !record.disabled);\n if (target) goTo(target.value, { fromNavigation: true });\n },\n [goTo, records],\n );\n\n const getStatus = useCallback(\n (itemValue: string, explicitStatus?: StepperStatus, itemDisabled = false) => {\n if (itemDisabled || disabled) return \"disabled\";\n if (explicitStatus) return explicitStatus;\n const itemIndex = records.findIndex((item) => item.value === itemValue);\n const activeIndex = records.findIndex((item) => item.value === activeValue);\n if (itemValue === activeValue || (activeIndex < 0 && itemIndex === 0)) return \"current\";\n if (itemIndex >= 0 && activeIndex >= 0 && itemIndex < activeIndex) return \"complete\";\n return \"upcoming\";\n },\n [activeValue, disabled, records],\n );\n\n const context = useMemo(\n () => ({\n activeValue,\n allowStepSelect,\n disabled,\n getStatus,\n goTo,\n linear,\n move,\n moveToBoundary,\n orientation,\n register,\n unregister,\n }),\n [\n activeValue,\n allowStepSelect,\n disabled,\n getStatus,\n goTo,\n linear,\n move,\n moveToBoundary,\n orientation,\n register,\n unregister,\n ],\n );\n\n return (\n <StepperContext.Provider value={context}>\n <nav\n {...props}\n aria-label={ariaLabel ?? \"Progress\"}\n className={cx(stepper({ orientation }).root, className)}\n data-jaci-component=\"stepper\"\n data-orientation={orientation}\n data-slot=\"stepper\"\n data-state={disabled ? \"disabled\" : \"active\"}\n ref={ref}\n >\n {children}\n {name ? (\n <input\n aria-hidden=\"true\"\n name={name}\n type=\"hidden\"\n value={activeValue ?? \"\"}\n form={form}\n />\n ) : null}\n </nav>\n </StepperContext.Provider>\n );\n});\n\nexport type StepperListProps = ComponentPropsWithoutRef<\"ol\">;\nexport const StepperList = forwardRef<HTMLOListElement, StepperListProps>(function StepperList(\n { className, ...props },\n ref,\n) {\n const { orientation } = useStepperContext();\n return (\n <ol\n {...props}\n className={cx(stepper({ orientation }).list, className)}\n data-slot=\"stepper-list\"\n ref={ref}\n />\n );\n});\n\nexport interface StepperItemProps extends ComponentPropsWithoutRef<\"li\"> {\n value: string;\n status?: StepperStatus;\n disabled?: boolean;\n}\n\nexport const StepperItem = forwardRef<HTMLLIElement, StepperItemProps>(function StepperItem(\n { children, className, disabled = false, status, value, ...props },\n ref,\n) {\n const context = useStepperContext();\n const resolvedStatus = context.getStatus(value, status, disabled);\n useEffect(() => {\n const record: StepRecord = { disabled: disabled || status === \"disabled\", value };\n if (status !== undefined) record.status = status;\n context.register(record);\n return () => context.unregister(value);\n }, [context.register, context.unregister, disabled, status, value]);\n const itemContext = useMemo<StepperItemContextValue>(\n () => ({\n disabled: disabled || context.disabled || resolvedStatus === \"disabled\",\n status: resolvedStatus,\n value,\n }),\n [context.disabled, disabled, resolvedStatus, value],\n );\n const styles = stepper({ orientation: context.orientation, status: resolvedStatus });\n\n return (\n <StepperItemContext.Provider value={itemContext}>\n <li\n {...props}\n aria-disabled={itemContext.disabled || undefined}\n className={cx(styles.item, className)}\n data-disabled={itemContext.disabled || undefined}\n data-jaci-component=\"stepper-item\"\n data-slot=\"stepper-item\"\n data-status={resolvedStatus}\n data-value={value}\n ref={ref}\n >\n {children}\n </li>\n </StepperItemContext.Provider>\n );\n});\n\nexport type StepperTriggerProps = ComponentPropsWithoutRef<\"button\">;\nexport const StepperTrigger = forwardRef<HTMLButtonElement, StepperTriggerProps>(\n function StepperTrigger({ className, onClick, onKeyDown, type = \"button\", ...props }, ref) {\n const context = useStepperContext();\n const item = useStepperItemContext();\n const styles = stepper({ orientation: context.orientation, status: item.status });\n return (\n <button\n {...props}\n aria-current={item.status === \"current\" ? \"step\" : undefined}\n aria-disabled={\n item.disabled || (!context.allowStepSelect && item.status !== \"current\") || undefined\n }\n className={cx(styles.trigger, className)}\n data-disabled={item.disabled || undefined}\n data-slot=\"stepper-trigger\"\n data-status={item.status}\n disabled={context.disabled || item.disabled}\n onClick={(event) => {\n if (!event.defaultPrevented) context.goTo(item.value);\n onClick?.(event);\n }}\n onKeyDown={(event) => {\n const isForwardKey =\n (context.orientation === \"horizontal\" && event.key === \"ArrowRight\") ||\n (context.orientation === \"vertical\" && event.key === \"ArrowDown\");\n const isBackwardKey =\n (context.orientation === \"horizontal\" && event.key === \"ArrowLeft\") ||\n (context.orientation === \"vertical\" && event.key === \"ArrowUp\");\n if (isForwardKey) {\n event.preventDefault();\n context.move(1);\n } else if (isBackwardKey) {\n event.preventDefault();\n context.move(-1);\n } else if (event.key === \"Home\") {\n event.preventDefault();\n context.moveToBoundary(-1);\n } else if (event.key === \"End\") {\n event.preventDefault();\n context.moveToBoundary(1);\n }\n onKeyDown?.(event);\n }}\n ref={ref}\n type={type}\n />\n );\n },\n);\n\nexport type StepperIndicatorProps = ComponentPropsWithoutRef<\"span\">;\nexport const StepperIndicator = forwardRef<HTMLSpanElement, StepperIndicatorProps>(\n function StepperIndicator({ children, className, ...props }, ref) {\n const { orientation } = useStepperContext();\n const item = useStepperItemContext();\n const styles = stepper({ orientation, status: item.status });\n return (\n <span\n {...props}\n aria-hidden={props[\"aria-hidden\"] ?? true}\n className={cx(styles.indicator, className)}\n data-slot=\"stepper-indicator\"\n data-status={item.status}\n ref={ref}\n >\n {children ?? (item.status === \"complete\" ? \"✓\" : \"\")}\n </span>\n );\n },\n);\n\nfunction createSpanSlot(slot: \"title\" | \"description\" | \"separator\") {\n return forwardRef<HTMLSpanElement, ComponentPropsWithoutRef<\"span\">>(function StepperSlot(\n { className, ...props },\n ref,\n ) {\n const { orientation } = useStepperContext();\n const item = useStepperItemContext();\n const styles = stepper({ orientation, status: item.status });\n return (\n <span\n {...props}\n className={cx(styles[slot], className)}\n data-slot={`stepper-${slot}`}\n ref={ref}\n />\n );\n });\n}\n\nexport const StepperTitle = createSpanSlot(\"title\");\nexport const StepperDescription = createSpanSlot(\"description\");\n\nexport const StepperContent = forwardRef<HTMLDivElement, ComponentPropsWithoutRef<\"div\">>(\n function StepperContent({ className, hidden, ...props }, ref) {\n const item = useStepperItemContext();\n const { orientation } = useStepperContext();\n const styles = stepper({ orientation, status: item.status });\n return (\n <div\n {...props}\n className={cx(styles.content, className)}\n data-slot=\"stepper-content\"\n hidden={hidden ?? item.status !== \"current\"}\n ref={ref}\n />\n );\n },\n);\n\nexport const StepperSeparator = createSpanSlot(\"separator\");\n\nexport interface StepperNavigationButtonProps extends ComponentPropsWithoutRef<\"button\"> {\n children?: ReactNode;\n}\n\nexport const StepperPrevious = forwardRef<HTMLButtonElement, StepperNavigationButtonProps>(\n function StepperPrevious(\n { children = \"Previous\", className, disabled: disabledProp, ...props },\n ref,\n ) {\n const context = useStepperContext();\n const styles = stepper({ orientation: context.orientation });\n return (\n <button\n {...props}\n className={cx(styles.previous, className)}\n data-slot=\"stepper-previous\"\n disabled={disabledProp || context.disabled}\n onClick={(event) => {\n context.move(-1);\n props.onClick?.(event);\n }}\n ref={ref}\n type={props.type ?? \"button\"}\n >\n {children}\n </button>\n );\n },\n);\n\nexport const StepperNext = forwardRef<HTMLButtonElement, StepperNavigationButtonProps>(\n function StepperNext({ children = \"Next\", className, disabled: disabledProp, ...props }, ref) {\n const context = useStepperContext();\n const styles = stepper({ orientation: context.orientation });\n return (\n <button\n {...props}\n className={cx(styles.next, className)}\n data-slot=\"stepper-next\"\n disabled={disabledProp || context.disabled}\n onClick={(event) => {\n context.move(1);\n props.onClick?.(event);\n }}\n ref={ref}\n type={props.type ?? \"button\"}\n >\n {children}\n </button>\n );\n },\n);\n\nexport const Stepper = {\n Root: StepperRoot,\n List: StepperList,\n Item: StepperItem,\n Trigger: StepperTrigger,\n Indicator: StepperIndicator,\n Title: StepperTitle,\n Description: StepperDescription,\n Content: StepperContent,\n Separator: StepperSeparator,\n Previous: StepperPrevious,\n Next: StepperNext,\n};\n"],"mappings":";;;;;;AA6CA,MAAM,kBAAA,GAAA,MAAA,cAAA,CAA2D,IAAI;AACrE,MAAM,sBAAA,GAAA,MAAA,cAAA,CAAmE,IAAI;AAE7E,SAAS,oBAAoB;CAC3B,MAAM,WAAA,GAAA,MAAA,WAAA,CAAqB,cAAc;CACzC,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,qDAAqD;CACnF,OAAO;AACT;AAEA,SAAS,wBAAwB;CAC/B,MAAM,WAAA,GAAA,MAAA,WAAA,CAAqB,kBAAkB;CAC7C,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,yDAAyD;CACvF,OAAO;AACT;AAeA,MAAa,eAAA,GAAA,MAAA,WAAA,CAAwD,SAAS,YAC5E,EACE,kBAAkB,MAClB,cAAc,W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GAAG,SAAS,KAAK;CAC5F,MAAM,UAAU,kBAAkB;CAClC,MAAM,SAASC,gBAAAA,QAAQ,EAAE,aAAa,QAAQ,YAAY,CAAC;CAC3D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;EACE,GAAI;EACJ,WAAWD,WAAAA,GAAG,OAAO,MAAM,SAAS;EACpC,aAAU;EACV,UAAU,gBAAgB,QAAQ;EAClC,UAAU,UAAU;GAClB,QAAQ,KAAK,CAAC;GACd,MAAM,UAAU,KAAK;EACvB;EACK;EACL,MAAM,MAAM,QAAQ;EAEnB;CACK,CAAA;AAEZ,CACF;AAEA,MAAa,UAAU;CACrB,MAAM;CACN,MAAM;CACN,MAAM;CACN,SAAS;CACT,WAAW;CACX,OAAO;CACP,aAAa;CACb,SAAS;CACT,WAAW;CACX,UAAU;CACV,MAAM;AACR"}
1
+ {"version":3,"file":"stepper.cjs","names":["createContext","useContext","forwardRef","useState","useCallback","useMemo","cx","stepper"],"sources":["../../../src/components/stepper/stepper.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { stepper } from \"../../styled-system/recipes\";\n\nexport type StepperOrientation = \"horizontal\" | \"vertical\";\nexport type StepperStatus = \"current\" | \"complete\" | \"upcoming\" | \"disabled\";\n\ninterface StepRecord {\n value: string;\n disabled: boolean;\n status?: StepperStatus;\n}\n\ninterface StepperContextValue {\n activeValue: string | undefined;\n allowStepSelect: boolean;\n disabled: boolean;\n getStatus: (value: string, status?: StepperStatus, disabled?: boolean) => StepperStatus;\n goTo: (value: string, options?: { fromNavigation?: boolean }) => void;\n linear: boolean;\n orientation: StepperOrientation;\n register: (record: StepRecord) => void;\n unregister: (value: string) => void;\n move: (direction: -1 | 1) => void;\n moveToBoundary: (direction: -1 | 1) => void;\n}\n\ninterface StepperItemContextValue {\n disabled: boolean;\n status: StepperStatus;\n value: string;\n}\n\nconst StepperContext = createContext<StepperContextValue | null>(null);\nconst StepperItemContext = createContext<StepperItemContextValue | null>(null);\n\nfunction useStepperContext() {\n const context = useContext(StepperContext);\n if (!context) throw new Error(\"Stepper parts must be rendered inside Stepper.Root.\");\n return context;\n}\n\nfunction useStepperItemContext() {\n const context = useContext(StepperItemContext);\n if (!context) throw new Error(\"This Stepper part must be rendered inside Stepper.Item.\");\n return context;\n}\n\nexport interface StepperRootProps extends Omit<ComponentPropsWithoutRef<\"nav\">, \"children\"> {\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n orientation?: StepperOrientation;\n linear?: boolean;\n allowStepSelect?: boolean;\n disabled?: boolean;\n name?: string;\n form?: string;\n children?: ReactNode;\n}\n\nexport const StepperRoot = forwardRef<HTMLElement, StepperRootProps>(function StepperRoot(\n {\n allowStepSelect = true,\n \"aria-label\": ariaLabel,\n children,\n className,\n defaultValue,\n disabled = false,\n form,\n linear = false,\n name,\n onValueChange,\n orientation = \"horizontal\",\n value: controlledValue,\n ...props\n },\n ref,\n) {\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n const [records, setRecords] = useState<StepRecord[]>([]);\n const activeValue = controlledValue ?? uncontrolledValue ?? records[0]?.value;\n\n const register = useCallback((record: StepRecord) => {\n setRecords((current) => {\n const index = current.findIndex((item) => item.value === record.value);\n if (index === -1) return [...current, record];\n const currentRecord = current[index];\n if (!currentRecord) return current;\n if (currentRecord.disabled === record.disabled && currentRecord.status === record.status) {\n return current;\n }\n const next = current.slice();\n next[index] = record;\n return next;\n });\n }, []);\n\n const unregister = useCallback((valueToRemove: string) => {\n setRecords((current) => current.filter((item) => item.value !== valueToRemove));\n }, []);\n\n const goTo = useCallback(\n (nextValue: string, options?: { fromNavigation?: boolean }) => {\n if (disabled) return;\n const targetIndex = records.findIndex((item) => item.value === nextValue);\n const activeIndex = records.findIndex((item) => item.value === activeValue);\n const target = records[targetIndex];\n if (!target || target.disabled) return;\n if (nextValue === activeValue) return;\n if (!allowStepSelect && !options?.fromNavigation && nextValue !== activeValue) return;\n if (linear && activeIndex >= 0 && targetIndex > activeIndex + 1) return;\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue);\n },\n [activeValue, allowStepSelect, controlledValue, disabled, linear, onValueChange, records],\n );\n\n const move = useCallback(\n (direction: -1 | 1) => {\n const activeIndex = records.findIndex((item) => item.value === activeValue);\n let index = activeIndex + direction;\n while (index >= 0 && index < records.length && records[index]?.disabled) index += direction;\n const target = records[index];\n if (target) goTo(target.value, { fromNavigation: true });\n },\n [activeValue, goTo, records],\n );\n\n const moveToBoundary = useCallback(\n (direction: -1 | 1) => {\n const candidates = direction === -1 ? records : records.slice().reverse();\n const target = candidates.find((record) => !record.disabled);\n if (target) goTo(target.value, { fromNavigation: true });\n },\n [goTo, records],\n );\n\n const getStatus = useCallback(\n (itemValue: string, explicitStatus?: StepperStatus, itemDisabled = false) => {\n if (itemDisabled || disabled) return \"disabled\";\n if (explicitStatus) return explicitStatus;\n const itemIndex = records.findIndex((item) => item.value === itemValue);\n const activeIndex = records.findIndex((item) => item.value === activeValue);\n if (itemValue === activeValue || (activeIndex < 0 && itemIndex === 0)) return \"current\";\n if (itemIndex >= 0 && activeIndex >= 0 && itemIndex < activeIndex) return \"complete\";\n return \"upcoming\";\n },\n [activeValue, disabled, records],\n );\n\n const context = useMemo(\n () => ({\n activeValue,\n allowStepSelect,\n disabled,\n getStatus,\n goTo,\n linear,\n move,\n moveToBoundary,\n orientation,\n register,\n unregister,\n }),\n [\n activeValue,\n allowStepSelect,\n disabled,\n getStatus,\n goTo,\n linear,\n move,\n moveToBoundary,\n orientation,\n register,\n unregister,\n ],\n );\n\n return (\n <StepperContext.Provider value={context}>\n <nav\n {...props}\n aria-label={ariaLabel ?? \"Progress\"}\n className={cx(stepper({ orientation }).root, className)}\n data-jaci-component=\"stepper\"\n data-orientation={orientation}\n data-slot=\"stepper\"\n data-state={disabled ? \"disabled\" : \"active\"}\n ref={ref}\n >\n {children}\n {name ? (\n <input\n aria-hidden=\"true\"\n name={name}\n type=\"hidden\"\n value={activeValue ?? \"\"}\n form={form}\n />\n ) : null}\n </nav>\n </StepperContext.Provider>\n );\n});\n\nexport type StepperListProps = ComponentPropsWithoutRef<\"ol\">;\nexport const StepperList = forwardRef<HTMLOListElement, StepperListProps>(function StepperList(\n { className, ...props },\n ref,\n) {\n const { orientation } = useStepperContext();\n return (\n <ol\n {...props}\n className={cx(stepper({ orientation }).list, className)}\n data-slot=\"stepper-list\"\n ref={ref}\n />\n );\n});\n\nexport interface StepperItemProps extends ComponentPropsWithoutRef<\"li\"> {\n value: string;\n status?: StepperStatus;\n disabled?: boolean;\n}\n\nexport const StepperItem = forwardRef<HTMLLIElement, StepperItemProps>(function StepperItem(\n { children, className, disabled = false, status, value, ...props },\n ref,\n) {\n const context = useStepperContext();\n const resolvedStatus = context.getStatus(value, status, disabled);\n useEffect(() => {\n const record: StepRecord = { disabled: disabled || status === \"disabled\", value };\n if (status !== undefined) record.status = status;\n context.register(record);\n return () => context.unregister(value);\n }, [context.register, context.unregister, disabled, status, value]);\n const itemContext = useMemo<StepperItemContextValue>(\n () => ({\n disabled: disabled || context.disabled || resolvedStatus === \"disabled\",\n status: resolvedStatus,\n value,\n }),\n [context.disabled, disabled, resolvedStatus, value],\n );\n const styles = stepper({ orientation: context.orientation, status: resolvedStatus });\n\n return (\n <StepperItemContext.Provider value={itemContext}>\n <li\n {...props}\n aria-disabled={itemContext.disabled || undefined}\n className={cx(styles.item, className)}\n data-disabled={itemContext.disabled || undefined}\n data-jaci-component=\"stepper-item\"\n data-slot=\"stepper-item\"\n data-status={resolvedStatus}\n data-value={value}\n ref={ref}\n >\n {children}\n </li>\n </StepperItemContext.Provider>\n );\n});\n\nexport type StepperTriggerProps = ComponentPropsWithoutRef<\"button\">;\nexport const StepperTrigger = forwardRef<HTMLButtonElement, StepperTriggerProps>(\n function StepperTrigger({ className, onClick, onKeyDown, type = \"button\", ...props }, ref) {\n const context = useStepperContext();\n const item = useStepperItemContext();\n const styles = stepper({ orientation: context.orientation, status: item.status });\n return (\n <button\n {...props}\n aria-current={item.status === \"current\" ? \"step\" : undefined}\n aria-disabled={\n item.disabled || (!context.allowStepSelect && item.status !== \"current\") || undefined\n }\n className={cx(styles.trigger, className)}\n data-disabled={item.disabled || undefined}\n data-slot=\"stepper-trigger\"\n data-status={item.status}\n disabled={context.disabled || item.disabled}\n onClick={(event) => {\n if (!event.defaultPrevented) context.goTo(item.value);\n onClick?.(event);\n }}\n onKeyDown={(event) => {\n const isForwardKey =\n (context.orientation === \"horizontal\" && event.key === \"ArrowRight\") ||\n (context.orientation === \"vertical\" && event.key === \"ArrowDown\");\n const isBackwardKey =\n (context.orientation === \"horizontal\" && event.key === \"ArrowLeft\") ||\n (context.orientation === \"vertical\" && event.key === \"ArrowUp\");\n if (isForwardKey) {\n event.preventDefault();\n context.move(1);\n } else if (isBackwardKey) {\n event.preventDefault();\n context.move(-1);\n } else if (event.key === \"Home\") {\n event.preventDefault();\n context.moveToBoundary(-1);\n } else if (event.key === \"End\") {\n event.preventDefault();\n context.moveToBoundary(1);\n }\n onKeyDown?.(event);\n }}\n ref={ref}\n type={type}\n />\n );\n },\n);\n\nexport type StepperIndicatorProps = ComponentPropsWithoutRef<\"span\">;\nexport const StepperIndicator = forwardRef<HTMLSpanElement, StepperIndicatorProps>(\n function StepperIndicator({ children, className, ...props }, ref) {\n const { orientation } = useStepperContext();\n const item = useStepperItemContext();\n const styles = stepper({ orientation, status: item.status });\n return (\n <span\n {...props}\n aria-hidden={props[\"aria-hidden\"] ?? true}\n className={cx(styles.indicator, className)}\n data-slot=\"stepper-indicator\"\n data-status={item.status}\n ref={ref}\n >\n {children ?? (item.status === \"complete\" ? \"✓\" : \"\")}\n </span>\n );\n },\n);\n\nfunction createSpanSlot(slot: \"title\" | \"description\" | \"separator\") {\n return forwardRef<HTMLSpanElement, ComponentPropsWithoutRef<\"span\">>(function StepperSlot(\n { className, ...props },\n ref,\n ) {\n const { orientation } = useStepperContext();\n const item = useStepperItemContext();\n const styles = stepper({ orientation, status: item.status });\n return (\n <span\n {...props}\n className={cx(styles[slot], className)}\n data-slot={`stepper-${slot}`}\n ref={ref}\n />\n );\n });\n}\n\nexport const StepperTitle = createSpanSlot(\"title\");\nexport const StepperDescription = createSpanSlot(\"description\");\n\nexport const StepperContent = forwardRef<HTMLDivElement, ComponentPropsWithoutRef<\"div\">>(\n function StepperContent({ className, hidden, ...props }, ref) {\n const item = useStepperItemContext();\n const { orientation } = useStepperContext();\n const styles = stepper({ orientation, status: item.status });\n return (\n <div\n {...props}\n className={cx(styles.content, className)}\n data-slot=\"stepper-content\"\n hidden={hidden ?? item.status !== \"current\"}\n ref={ref}\n />\n );\n },\n);\n\nexport const StepperSeparator = createSpanSlot(\"separator\");\n\nexport interface StepperNavigationButtonProps extends ComponentPropsWithoutRef<\"button\"> {\n children?: ReactNode;\n}\n\nexport const StepperPrevious = forwardRef<HTMLButtonElement, StepperNavigationButtonProps>(\n function StepperPrevious(\n { children = \"Previous\", className, disabled: disabledProp, ...props },\n ref,\n ) {\n const context = useStepperContext();\n const styles = stepper({ orientation: context.orientation });\n return (\n <button\n {...props}\n className={cx(styles.previous, className)}\n data-slot=\"stepper-previous\"\n disabled={disabledProp || context.disabled}\n onClick={(event) => {\n context.move(-1);\n props.onClick?.(event);\n }}\n ref={ref}\n type={props.type ?? \"button\"}\n >\n {children}\n </button>\n );\n },\n);\n\nexport const StepperNext = forwardRef<HTMLButtonElement, StepperNavigationButtonProps>(\n function StepperNext({ children = \"Next\", className, disabled: disabledProp, ...props }, ref) {\n const context = useStepperContext();\n const styles = stepper({ orientation: context.orientation });\n return (\n <button\n {...props}\n className={cx(styles.next, className)}\n data-slot=\"stepper-next\"\n disabled={disabledProp || context.disabled}\n onClick={(event) => {\n context.move(1);\n props.onClick?.(event);\n }}\n ref={ref}\n type={props.type ?? \"button\"}\n >\n {children}\n </button>\n );\n },\n);\n\nexport const Stepper = {\n Root: StepperRoot,\n List: StepperList,\n Item: StepperItem,\n Trigger: StepperTrigger,\n Indicator: StepperIndicator,\n Title: StepperTitle,\n Description: StepperDescription,\n Content: StepperContent,\n Separator: StepperSeparator,\n Previous: StepperPrevious,\n Next: StepperNext,\n};\n"],"mappings":";;;;;;AA6CA,MAAM,kBAAA,GAAiBA,MAAAA,cAAAA,CAA0C,IAAI;AACrE,MAAM,sBAAA,GAAqBA,MAAAA,cAAAA,CAA8C,IAAI;AAE7E,SAAS,oBAAoB;CAC3B,MAAM,WAAA,GAAUC,MAAAA,WAAAA,CAAW,cAAc;CACzC,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,qDAAqD;CACnF,OAAO;AACT;AAEA,SAAS,wBAAwB;CAC/B,MAAM,WAAA,GAAUA,MAAAA,WAAAA,CAAW,kBAAkB;CAC7C,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,yDAAyD;CACvF,OAAO;AACT;AAeA,MAAa,eAAA,GAAcC,MAAAA,WAAAA,CAA0C,SAAS,YAC5E,EACE,kBAAkB,MAClB,cAAc,WACd,UACA,WACA,cACA,WAAW,OACX,MACA,SAAS,OACT,MACA,eACA,cAAc,cACd,OAAO,iBACP,GAAG,SAEL,KACA;CACA,MAAM,CAAC,mBAAmB,yBAAA,GAAwBC,MAAAA,SAAAA,CAAS,YAAY;CACvE,MAAM,CAAC,SAAS,eAAA,GAAcA,MAAAA,SAAAA,CAAuB,CAAC,CAAC;CACvD,MAAM,cAAc,mBAAmB,qBAAqB,QAAQ,EAAE,EAAE;CAExE,MAAM,YAAA,GAAWC,MAAAA,YAAAA,EAAa,WAAuB;EACnD,YAAY,YAAY;GACtB,MAAM,QAAQ,QAAQ,WAAW,SAAS,KAAK,UAAU,OAAO,KAAK;GACrE,IAAI,UAAU,IAAI,OAAO,CAAC,GAAG,SAAS,MAAM;GAC5C,MAAM,gBAAgB,QAAQ;GAC9B,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F;AAEA,MAAa,UAAU;CACrB,MAAM;CACN,MAAM;CACN,MAAM;CACN,SAAS;CACT,WAAW;CACX,OAAO;CACP,aAAa;CACb,SAAS;CACT,WAAW;CACX,UAAU;CACV,MAAM;AACR"}
@@ -247,9 +247,10 @@ const StepperIndicator = forwardRef(function StepperIndicator({ children, classN
247
247
  function createSpanSlot(slot) {
248
248
  return forwardRef(function StepperSlot({ className, ...props }, ref) {
249
249
  const { orientation } = useStepperContext();
250
+ const item = useStepperItemContext();
250
251
  const styles = stepper({
251
252
  orientation,
252
- status: useStepperItemContext().status
253
+ status: item.status
253
254
  });
254
255
  return /* @__PURE__ */ jsx("span", {
255
256
  ...props,