jaci-ui 0.9.4 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/CHANGELOG.md +25 -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-picker/color-utils.cjs +5 -3
  39. package/dist/components/color-picker/color-utils.cjs.map +1 -1
  40. package/dist/components/color-picker/color-utils.js +5 -3
  41. package/dist/components/color-picker/color-utils.js.map +1 -1
  42. package/dist/components/color-swatch/color-swatch.cjs.map +1 -1
  43. package/dist/components/combobox/combobox.cjs +2 -1
  44. package/dist/components/combobox/combobox.cjs.map +1 -1
  45. package/dist/components/combobox/combobox.js +2 -1
  46. package/dist/components/combobox/combobox.js.map +1 -1
  47. package/dist/components/command/command.cjs.map +1 -1
  48. package/dist/components/command/command.js.map +1 -1
  49. package/dist/components/context-menu/context-menu.cjs.map +1 -1
  50. package/dist/components/context-menu/context-menu.d.cts +2 -2
  51. package/dist/components/context-menu/context-menu.d.ts +2 -2
  52. package/dist/components/controls/checkbox.cjs.map +1 -1
  53. package/dist/components/controls/checkbox.js.map +1 -1
  54. package/dist/components/controls/input.cjs.map +1 -1
  55. package/dist/components/controls/input.js.map +1 -1
  56. package/dist/components/controls/radio.cjs.map +1 -1
  57. package/dist/components/controls/switch.cjs.map +1 -1
  58. package/dist/components/controls/switch.js.map +1 -1
  59. package/dist/components/controls/textarea.cjs.map +1 -1
  60. package/dist/components/controls/textarea.js.map +1 -1
  61. package/dist/components/copyable/copyable.cjs.map +1 -1
  62. package/dist/components/copyable/copyable.js.map +1 -1
  63. package/dist/components/data-toolbar/data-toolbar.cjs.map +1 -1
  64. package/dist/components/data-toolbar/data-toolbar.js.map +1 -1
  65. package/dist/components/data-view/data-view.cjs.map +1 -1
  66. package/dist/components/date-picker/date-picker.cjs +4 -7
  67. package/dist/components/date-picker/date-picker.cjs.map +1 -1
  68. package/dist/components/date-picker/date-picker.js +4 -7
  69. package/dist/components/date-picker/date-picker.js.map +1 -1
  70. package/dist/components/date-range-picker/date-range-picker.cjs +4 -6
  71. package/dist/components/date-range-picker/date-range-picker.cjs.map +1 -1
  72. package/dist/components/date-range-picker/date-range-picker.js +4 -6
  73. package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
  74. package/dist/components/dialog/dialog.cjs.map +1 -1
  75. package/dist/components/dialog/dialog.js.map +1 -1
  76. package/dist/components/download-trigger/download-trigger.cjs.map +1 -1
  77. package/dist/components/drawer/drawer.cjs.map +1 -1
  78. package/dist/components/drawer/drawer.js.map +1 -1
  79. package/dist/components/empty-state/empty-state.cjs.map +1 -1
  80. package/dist/components/feedback/badge.cjs.map +1 -1
  81. package/dist/components/field/field.cjs.map +1 -1
  82. package/dist/components/field/field.js.map +1 -1
  83. package/dist/components/fieldset/fieldset.cjs.map +1 -1
  84. package/dist/components/figure/figure.cjs.map +1 -1
  85. package/dist/components/figure/figure.js.map +1 -1
  86. package/dist/components/form/form.cjs.map +1 -1
  87. package/dist/components/form/form.js.map +1 -1
  88. package/dist/components/icon-button/icon-button.cjs.map +1 -1
  89. package/dist/components/icon-button/icon-button.js.map +1 -1
  90. package/dist/components/image/image.cjs.map +1 -1
  91. package/dist/components/image/image.js.map +1 -1
  92. package/dist/components/input-group/input-group.cjs.map +1 -1
  93. package/dist/components/kbd/kbd.cjs.map +1 -1
  94. package/dist/components/layout/index.cjs.map +1 -1
  95. package/dist/components/list/list.cjs.map +1 -1
  96. package/dist/components/menu/menu.cjs.map +1 -1
  97. package/dist/components/menu/menu.d.cts +2 -2
  98. package/dist/components/menu/menu.d.ts +2 -2
  99. package/dist/components/menubar/menubar.cjs.map +1 -1
  100. package/dist/components/menubar/menubar.d.cts +2 -2
  101. package/dist/components/menubar/menubar.d.ts +2 -2
  102. package/dist/components/menubar/menubar.js.map +1 -1
  103. package/dist/components/meter/meter.cjs.map +1 -1
  104. package/dist/components/meter/meter.js.map +1 -1
  105. package/dist/components/navigation/navigation.cjs.map +1 -1
  106. package/dist/components/navigation/navigation.js.map +1 -1
  107. package/dist/components/navigation-menu/navigation-menu.cjs.map +1 -1
  108. package/dist/components/navigation-menu/navigation-menu.js.map +1 -1
  109. package/dist/components/number-field/number-field.cjs +2 -1
  110. package/dist/components/number-field/number-field.cjs.map +1 -1
  111. package/dist/components/number-field/number-field.js +2 -1
  112. package/dist/components/number-field/number-field.js.map +1 -1
  113. package/dist/components/option-selector/option-selector.cjs.map +1 -1
  114. package/dist/components/option-selector/option-selector.js.map +1 -1
  115. package/dist/components/pagination/pagination.cjs.map +1 -1
  116. package/dist/components/pagination/pagination.js.map +1 -1
  117. package/dist/components/pin-input/pin-input.cjs.map +1 -1
  118. package/dist/components/pin-input/pin-input.js.map +1 -1
  119. package/dist/components/popover/popover.cjs.map +1 -1
  120. package/dist/components/popover/popover.js.map +1 -1
  121. package/dist/components/progress/progress.cjs.map +1 -1
  122. package/dist/components/progress/progress.js.map +1 -1
  123. package/dist/components/qr-code/qr-code.cjs.map +1 -1
  124. package/dist/components/qr-code/qr-code.js.map +1 -1
  125. package/dist/components/quote/quote.cjs.map +1 -1
  126. package/dist/components/quote/quote.js.map +1 -1
  127. package/dist/components/radio-group/radio-group.cjs +7 -3
  128. package/dist/components/radio-group/radio-group.cjs.map +1 -1
  129. package/dist/components/radio-group/radio-group.js +7 -3
  130. package/dist/components/radio-group/radio-group.js.map +1 -1
  131. package/dist/components/range-slider/range-slider.cjs.map +1 -1
  132. package/dist/components/range-slider/range-slider.js.map +1 -1
  133. package/dist/components/scroll-area/scroll-area.cjs.map +1 -1
  134. package/dist/components/select/select.cjs.map +1 -1
  135. package/dist/components/select/select.js.map +1 -1
  136. package/dist/components/sidebar/sidebar.cjs.map +1 -1
  137. package/dist/components/sidebar/sidebar.js.map +1 -1
  138. package/dist/components/skeleton/skeleton.cjs.map +1 -1
  139. package/dist/components/slider/slider.cjs.map +1 -1
  140. package/dist/components/slider/slider.js.map +1 -1
  141. package/dist/components/spacer/spacer.cjs.map +1 -1
  142. package/dist/components/stat/stat.cjs.map +1 -1
  143. package/dist/components/stat/stat.js.map +1 -1
  144. package/dist/components/stepper/stepper.cjs +2 -1
  145. package/dist/components/stepper/stepper.cjs.map +1 -1
  146. package/dist/components/stepper/stepper.js +2 -1
  147. package/dist/components/stepper/stepper.js.map +1 -1
  148. package/dist/components/table/table.cjs.map +1 -1
  149. package/dist/components/table/table.js.map +1 -1
  150. package/dist/components/tabs/tabs.cjs.map +1 -1
  151. package/dist/components/tabs/tabs.js.map +1 -1
  152. package/dist/components/tags-input/tags-input.cjs +10 -9
  153. package/dist/components/tags-input/tags-input.cjs.map +1 -1
  154. package/dist/components/tags-input/tags-input.js +10 -9
  155. package/dist/components/tags-input/tags-input.js.map +1 -1
  156. package/dist/components/toast/toast.cjs.map +1 -1
  157. package/dist/components/toast/toast.js.map +1 -1
  158. package/dist/components/toggle/toggle.cjs.map +1 -1
  159. package/dist/components/toggle-group/toggle-group.cjs.map +1 -1
  160. package/dist/components/toolbar/toolbar.cjs.map +1 -1
  161. package/dist/components/tooltip/tooltip.cjs.map +1 -1
  162. package/dist/components/tree-view/tree-view.cjs.map +1 -1
  163. package/dist/components/tree-view/tree-view.js.map +1 -1
  164. package/dist/components/typography/heading.cjs.map +1 -1
  165. package/dist/components/typography/link.cjs.map +1 -1
  166. package/dist/components/typography/paragraph.cjs.map +1 -1
  167. package/dist/components/typography/text.cjs.map +1 -1
  168. package/dist/components/upload/upload.cjs +2 -2
  169. package/dist/components/upload/upload.cjs.map +1 -1
  170. package/dist/components/upload/upload.js +2 -2
  171. package/dist/components/upload/upload.js.map +1 -1
  172. package/dist/components/visually-hidden/visually-hidden.cjs.map +1 -1
  173. package/dist/panda-preset.cjs.map +1 -1
  174. package/dist/styles/theme.cjs +18 -18
  175. package/dist/styles/theme.cjs.map +1 -1
  176. package/dist/styles/theme.js +18 -18
  177. package/dist/styles/theme.js.map +1 -1
  178. package/dist/styles.css +12 -21
  179. package/dist/theme/theme-provider.cjs.map +1 -1
  180. package/dist/theme/theme-provider.js.map +1 -1
  181. package/dist/theme/theme-scope.cjs.map +1 -1
  182. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group.js","names":["Field","BaseRadioGroup","BaseField","BaseRadio","RadioGroup"],"sources":["../../../src/components/radio-group/radio-group.tsx"],"sourcesContent":["\"use client\";\n\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\nimport { Radio as BaseRadio } from \"@base-ui/react/radio\";\nimport { Field as BaseField } from \"@base-ui/react/field\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { RadioGroup as BaseRadioGroupType } from \"@base-ui/react/radio-group\";\nimport type { RadioRoot as BaseRadioRoot } from \"@base-ui/react/radio\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { radioGroup } from \"../../styled-system/recipes\";\nimport { Field } from \"../field\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport interface RadioGroupRootProps<Value = string>\n extends Omit<BaseRadioGroupType.Props<Value>, \"children\" | \"className\"> {\n /** Marks the group invalid when an external validator owns its state. */\n invalid?: boolean;\n /** Direct error content rendered through the surrounding Field context. */\n errors?: ReactNode | ReactNode[];\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * A typed, accessible radio group. The hidden native input is registered with\n * Jaci Form/Base UI, so `required`, `name`, errors and SSR form submission work\n * without an additional form library.\n */\nexport function RadioGroupRoot<Value = string>({\n children,\n className,\n errors,\n invalid,\n name,\n ...props\n}: RadioGroupRootProps<Value>) {\n const styles = radioGroup();\n const fieldProps = {\n className: cx(styles.root, className),\n ...(errors === undefined ? {} : { errors }),\n ...(invalid === undefined ? {} : { invalid }),\n ...(name === undefined ? {} : { name }),\n };\n\n return (\n <Field {...fieldProps}>\n <BaseRadioGroup {...props} {...(name === undefined ? {} : { name })}>\n {children}\n </BaseRadioGroup>\n </Field>\n );\n}\n\nexport type RadioGroupLabelProps = ComponentPropsWithoutRef<typeof BaseField.Label>;\n\nexport const RadioGroupLabel = forwardRef<HTMLElement, RadioGroupLabelProps>(\n function RadioGroupLabel({ className, ...props }, ref) {\n return (\n <BaseField.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(radioGroup().label, className)}\n data-slot=\"radio-group-label\"\n />\n );\n },\n);\n\nexport type RadioGroupOptionProps = ComponentPropsWithoutRef<\"label\">;\n\nexport const RadioGroupOption = forwardRef<HTMLLabelElement, RadioGroupOptionProps>(\n function RadioGroupOption({ children, className, htmlFor, ...props }, ref) {\n return (\n <label\n {...props}\n ref={ref}\n className={cx(radioGroup().option, className)}\n data-slot=\"radio-group-option\"\n htmlFor={htmlFor}\n >\n {children}\n </label>\n );\n },\n);\n\nexport type RadioGroupOptionsProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const RadioGroupOptions = forwardRef<HTMLDivElement, RadioGroupOptionsProps>(\n function RadioGroupOptions({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(radioGroup().options, className)}\n data-slot=\"radio-group-options\"\n />\n );\n },\n);\n\nexport type RadioGroupItemProps<Value = string> = BaseRadioRoot.Props<Value>;\n\nexport const RadioGroupItem = forwardRef<HTMLSpanElement, RadioGroupItemProps>(\n function RadioGroupItem({ className, ...props }, ref) {\n return (\n <BaseRadio.Root\n {...props}\n ref={ref}\n className={withRecipeClassName(radioGroup().radio, className)}\n data-slot=\"radio-group-item\"\n />\n );\n },\n);\n\nexport type RadioGroupIndicatorProps = ComponentPropsWithoutRef<typeof BaseRadio.Indicator>;\n\nexport const RadioGroupIndicator = forwardRef<HTMLSpanElement, RadioGroupIndicatorProps>(\n function RadioGroupIndicator({ children, className, ...props }, ref) {\n return (\n <BaseRadio.Indicator\n {...props}\n ref={ref}\n className={withRecipeClassName(radioGroup().indicator, className)}\n data-slot=\"radio-group-indicator\"\n >\n {children}\n </BaseRadio.Indicator>\n );\n },\n);\n\nexport const RadioGroup = {\n Root: RadioGroupRoot,\n Label: RadioGroupLabel,\n Options: RadioGroupOptions,\n Option: RadioGroupOption,\n Item: RadioGroup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,WAAW,CAAC,CAAC,OAAO,SAAS;EAC5D,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,sBAAsB,WACjC,SAAS,oBAAoB,EAAE,UAAU,WAAW,GAAG,SAAS,KAAK;CACnE,OACE,oBAACA,MAAU,WAAX;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,WAAW,CAAC,CAAC,WAAW,SAAS;EAChE,aAAU;EAET;CACkB,CAAA;AAEzB,CACF;AAEA,MAAaC,eAAa;CACxB,MAAM;CACN,OAAO;CACP,SAAS;CACT,QAAQ;CACR,MAAM;CACN,WAAW;AACb"}
1
+ {"version":3,"file":"radio-group.js","names":["Field","BaseRadioGroup","BaseField","BaseRadio","RadioGroup"],"sources":["../../../src/components/radio-group/radio-group.tsx"],"sourcesContent":["\"use client\";\n\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\nimport { Radio as BaseRadio } from \"@base-ui/react/radio\";\nimport { Field as BaseField } from \"@base-ui/react/field\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { RadioGroup as BaseRadioGroupType } from \"@base-ui/react/radio-group\";\nimport type { RadioRoot as BaseRadioRoot } from \"@base-ui/react/radio\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { radioGroup } from \"../../styled-system/recipes\";\nimport { Field } from \"../field\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport interface RadioGroupRootProps<Value = string>\n extends Omit<BaseRadioGroupType.Props<Value>, \"children\" | \"className\"> {\n /** Marks the group invalid when an external validator owns its state. */\n invalid?: boolean;\n /** Direct error content rendered through the surrounding Field context. */\n errors?: ReactNode | ReactNode[];\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * A typed, accessible radio group. The hidden native input is registered with\n * Jaci Form/Base UI, so `required`, `name`, errors and SSR form submission work\n * without an additional form library.\n */\nexport function RadioGroupRoot<Value = string>({\n children,\n className,\n errors,\n invalid,\n name,\n ...props\n}: RadioGroupRootProps<Value>) {\n const styles = radioGroup();\n const fieldProps = {\n className: cx(styles.root, className),\n ...(errors === undefined ? {} : { errors }),\n ...(invalid === undefined ? {} : { invalid }),\n ...(name === undefined ? {} : { name }),\n };\n\n return (\n <Field {...fieldProps}>\n <BaseRadioGroup {...props} {...(name === undefined ? {} : { name })}>\n {children}\n </BaseRadioGroup>\n </Field>\n );\n}\n\nexport type RadioGroupLabelProps = ComponentPropsWithoutRef<typeof BaseField.Label>;\n\nexport const RadioGroupLabel = forwardRef<HTMLElement, RadioGroupLabelProps>(\n function RadioGroupLabel({ className, ...props }, ref) {\n return (\n <BaseField.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(radioGroup().label, className)}\n data-slot=\"radio-group-label\"\n />\n );\n },\n);\n\nexport type RadioGroupOptionProps = ComponentPropsWithoutRef<\"label\">;\n\nexport const RadioGroupOption = forwardRef<HTMLLabelElement, RadioGroupOptionProps>(\n function RadioGroupOption({ children, className, htmlFor, ...props }, ref) {\n return (\n <label\n {...props}\n ref={ref}\n className={cx(radioGroup().option, className)}\n data-slot=\"radio-group-option\"\n htmlFor={htmlFor}\n >\n {children}\n </label>\n );\n },\n);\n\nexport type RadioGroupOptionsProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const RadioGroupOptions = forwardRef<HTMLDivElement, RadioGroupOptionsProps>(\n function RadioGroupOptions({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(radioGroup().options, className)}\n data-slot=\"radio-group-options\"\n />\n );\n },\n);\n\nexport type RadioGroupItemProps<Value = string> = BaseRadioRoot.Props<Value>;\n\nexport const RadioGroupItem = forwardRef<HTMLSpanElement, RadioGroupItemProps>(\n function RadioGroupItem({ className, ...props }, ref) {\n return (\n <BaseRadio.Root\n {...props}\n ref={ref}\n className={withRecipeClassName(radioGroup().radio, className)}\n data-slot=\"radio-group-item\"\n />\n );\n },\n);\n\nexport type RadioGroupIndicatorProps = ComponentPropsWithoutRef<typeof BaseRadio.Indicator>;\n\nexport const RadioGroupIndicator = forwardRef<HTMLSpanElement, RadioGroupIndicatorProps>(\n function RadioGroupIndicator({ children, className, ...props }, ref) {\n return (\n <BaseRadio.Indicator\n {...props}\n ref={ref}\n className={withRecipeClassName(radioGroup().indicator, className)}\n data-slot=\"radio-group-indicator\"\n >\n {children}\n </BaseRadio.Indicator>\n );\n },\n);\n\nexport const RadioGroup = {\n Root: RadioGroupRoot,\n Label: RadioGroupLabel,\n Options: RadioGroupOptions,\n Option: RadioGroupOption,\n Item: RadioGroupItem,\n Indicator: RadioGroupIndicator,\n};\n"],"mappings":";;;;;;;;;;;;;;;;AA8BA,SAAgB,eAA+B,EAC7C,UACA,WACA,QACA,SACA,MACA,GAAG,SAC0B;CAC7B,MAAM,SAAS,WAAW;CAC1B,MAAM,aAAa;EACjB,WAAW,GAAG,OAAO,MAAM,SAAS;EACpC,GAAI,WAAW,KAAA,IAAY,CAAC,IAAI,EAAE,OAAO;EACzC,GAAI,YAAY,KAAA,IAAY,CAAC,IAAI,EAAE,QAAQ;EAC3C,GAAI,SAAS,KAAA,IAAY,CAAC,IAAI,EAAE,KAAK;CACvC;CAEA,OACE,oBAACA,SAAD;EAAO,GAAI;EACT,UAAA,oBAACC,YAAD;GAAgB,GAAI;GAAO,GAAK,SAAS,KAAA,IAAY,CAAC,IAAI,EAAE,KAAK;GAC9D;EACa,CAAA;CACX,CAAA;AAEX;AAIA,MAAa,kBAAkB,WAC7B,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAS,KAAK;CACrD,OACE,oBAACC,MAAU,OAAX;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,WAAW,CAAC,CAAC,OAAO,SAAS;EAC5D,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,mBAAmB,WAC9B,SAAS,iBAAiB,EAAE,UAAU,WAAW,SAAS,GAAG,SAAS,KAAK;CACzE,OACE,oBAAC,SAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,WAAW,CAAC,CAAC,QAAQ,SAAS;EAC5C,aAAU;EACD;EAER;CACI,CAAA;AAEX,CACF;AAIA,MAAa,oBAAoB,WAC/B,SAAS,kBAAkB,EAAE,WAAW,GAAG,SAAS,KAAK;CACvD,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,WAAW,CAAC,CAAC,SAAS,SAAS;EAC7C,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,iBAAiB,WAC5B,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CACpD,OACE,oBAACC,MAAU,MAAX;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,WAAW,CAAC,CAAC,OAAO,SAAS;EAC5D,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,sBAAsB,WACjC,SAAS,oBAAoB,EAAE,UAAU,WAAW,GAAG,SAAS,KAAK;CACnE,OACE,oBAACA,MAAU,WAAX;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,WAAW,CAAC,CAAC,WAAW,SAAS;EAChE,aAAU;EAET;CACkB,CAAA;AAEzB,CACF;AAEA,MAAaC,eAAa;CACxB,MAAM;CACN,OAAO;CACP,SAAS;CACT,QAAQ;CACR,MAAM;CACN,WAAW;AACb"}
@@ -1 +1 @@
1
- {"version":3,"file":"range-slider.cjs","names":["rangeSlider","BaseSlider","withRecipeClassName"],"sources":["../../../src/components/range-slider/range-slider.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slider as BaseSlider } from \"@base-ui/react/slider\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { SliderRoot as BaseSliderRoot } from \"@base-ui/react/slider\";\n\nimport { rangeSlider } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type RangeSliderSize = \"sm\" | \"md\" | \"lg\";\n\nconst RangeSliderSizeContext = createContext<RangeSliderSize>(\"md\");\n\nfunction useRangeSliderStyles() {\n return rangeSlider({ size: useContext(RangeSliderSizeContext) });\n}\n\nexport interface RangeSliderRootProps\n extends Omit<\n BaseSliderRoot.Props<readonly number[]>,\n \"children\" | \"className\" | \"defaultValue\" | \"value\" | \"onValueChange\" | \"onValueCommitted\"\n > {\n value?: readonly [number, number];\n defaultValue?: readonly [number, number];\n onValueChange?: (value: readonly [number, number]) => void;\n onValueCommitted?: (value: readonly [number, number]) => void;\n size?: RangeSliderSize;\n children?: ReactNode;\n className?: string;\n}\n\nfunction asRange(values: readonly number[], min: number, max: number): readonly [number, number] {\n return [values[0] ?? min, values[1] ?? max];\n}\n\nexport const RangeSliderRoot = forwardRef<HTMLDivElement, RangeSliderRootProps>(\n function RangeSliderRoot(\n {\n children,\n className,\n defaultValue,\n max = 100,\n min = 0,\n onValueChange,\n onValueCommitted,\n size = \"md\",\n value,\n ...props\n },\n ref,\n ) {\n const styles = rangeSlider({ size });\n const fallbackValue = defaultValue ?? [min, max];\n\n return (\n <RangeSliderSizeContext.Provider value={size}>\n <BaseSlider.Root\n {...props}\n defaultValue={fallbackValue}\n max={max}\n min={min}\n onValueChange={(next) => onValueChange?.(asRange(next, min, max))}\n onValueCommitted={(next) => onValueCommitted?.(asRange(next, min, max))}\n ref={ref}\n value={value}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"range-slider\"\n data-slot=\"range-slider\"\n >\n {children}\n </BaseSlider.Root>\n </RangeSliderSizeContext.Provider>\n );\n },\n);\n\nexport type RangeSliderLabelProps = ComponentPropsWithoutRef<typeof BaseSlider.Label>;\nexport const RangeSliderLabel = forwardRef<HTMLDivElement, RangeSliderLabelProps>(\n function RangeSliderLabel({ className, ...props }, ref) {\n return (\n <BaseSlider.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().label, className)}\n data-slot=\"range-slider-label\"\n />\n );\n },\n);\n\nexport type RangeSliderValueProps = ComponentPropsWithoutRef<typeof BaseSlider.Value>;\nexport const RangeSliderValue = forwardRef<HTMLOutputElement, RangeSliderValueProps>(\n function RangeSliderValue({ className, ...props }, ref) {\n return (\n <BaseSlider.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().value, className)}\n data-slot=\"range-slider-value\"\n />\n );\n },\n);\n\nexport type RangeSliderControlProps = ComponentPropsWithoutRef<typeof BaseSlider.Control>;\nexport const RangeSliderControl = forwardRef<HTMLDivElement, RangeSliderControlProps>(\n function RangeSliderControl({ className, ...props }, ref) {\n return (\n <BaseSlider.Control\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().control, className)}\n data-slot=\"range-slider-control\"\n />\n );\n },\n);\n\nexport type RangeSliderTrackProps = ComponentPropsWithoutRef<typeof BaseSlider.Track>;\nexport const RangeSliderTrack = forwardRef<HTMLDivElement, RangeSliderTrackProps>(\n function RangeSliderTrack({ className, ...props }, ref) {\n return (\n <BaseSlider.Track\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().track, className)}\n data-slot=\"range-slider-track\"\n />\n );\n },\n);\n\nexport type RangeSliderIndicatorProps = ComponentPropsWithoutRef<typeof BaseSlider.Indicator>;\nexport const RangeSliderIndicator = forwardRef<HTMLDivElement, RangeSliderIndicatorProps>(\n function RangeSliderIndicator({ className, ...props }, ref) {\n return (\n <BaseSlider.Indicator\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().indicator, className)}\n data-slot=\"range-slider-indicator\"\n />\n );\n },\n);\n\nexport interface RangeSliderThumbProps extends ComponentPropsWithoutRef<typeof BaseSlider.Thumb> {\n index: 0 | 1;\n}\n\nexport const RangeSliderThumb = forwardRef<HTMLDivElement, RangeSliderThumbProps>(\n function RangeSliderThumb({ className, ...props }, ref) {\n return (\n <BaseSlider.Thumb\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().thumb, className)}\n data-slot=\"range-slider-thumb\"\n />\n );\n },\n);\n\nexport const RangeSlider = {\n Root: RangeSliderRoot,\n Label: RangeSliderLabel,\n Value: RangeSliderValue,\n Control: RangeSliderControl,\n Track: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C;EACL,WAAWC,gBAAAA,oBAAoB,qBAAqB,CAAC,CAAC,OAAO,SAAS;EACtE,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,cAAc;CACzB,MAAM;CACN,OAAO;CACP,OAAO;CACP,SAAS;CACT,OAAO;CACP,WAAW;CACX,OAAO;AACT"}
1
+ {"version":3,"file":"range-slider.cjs","names":["createContext","rangeSlider","useContext","forwardRef","BaseSlider","withRecipeClassName"],"sources":["../../../src/components/range-slider/range-slider.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slider as BaseSlider } from \"@base-ui/react/slider\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { SliderRoot as BaseSliderRoot } from \"@base-ui/react/slider\";\n\nimport { rangeSlider } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type RangeSliderSize = \"sm\" | \"md\" | \"lg\";\n\nconst RangeSliderSizeContext = createContext<RangeSliderSize>(\"md\");\n\nfunction useRangeSliderStyles() {\n return rangeSlider({ size: useContext(RangeSliderSizeContext) });\n}\n\nexport interface RangeSliderRootProps\n extends Omit<\n BaseSliderRoot.Props<readonly number[]>,\n \"children\" | \"className\" | \"defaultValue\" | \"value\" | \"onValueChange\" | \"onValueCommitted\"\n > {\n value?: readonly [number, number];\n defaultValue?: readonly [number, number];\n onValueChange?: (value: readonly [number, number]) => void;\n onValueCommitted?: (value: readonly [number, number]) => void;\n size?: RangeSliderSize;\n children?: ReactNode;\n className?: string;\n}\n\nfunction asRange(values: readonly number[], min: number, max: number): readonly [number, number] {\n return [values[0] ?? min, values[1] ?? max];\n}\n\nexport const RangeSliderRoot = forwardRef<HTMLDivElement, RangeSliderRootProps>(\n function RangeSliderRoot(\n {\n children,\n className,\n defaultValue,\n max = 100,\n min = 0,\n onValueChange,\n onValueCommitted,\n size = \"md\",\n value,\n ...props\n },\n ref,\n ) {\n const styles = rangeSlider({ size });\n const fallbackValue = defaultValue ?? [min, max];\n\n return (\n <RangeSliderSizeContext.Provider value={size}>\n <BaseSlider.Root\n {...props}\n defaultValue={fallbackValue}\n max={max}\n min={min}\n onValueChange={(next) => onValueChange?.(asRange(next, min, max))}\n onValueCommitted={(next) => onValueCommitted?.(asRange(next, min, max))}\n ref={ref}\n value={value}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"range-slider\"\n data-slot=\"range-slider\"\n >\n {children}\n </BaseSlider.Root>\n </RangeSliderSizeContext.Provider>\n );\n },\n);\n\nexport type RangeSliderLabelProps = ComponentPropsWithoutRef<typeof BaseSlider.Label>;\nexport const RangeSliderLabel = forwardRef<HTMLDivElement, RangeSliderLabelProps>(\n function RangeSliderLabel({ className, ...props }, ref) {\n return (\n <BaseSlider.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().label, className)}\n data-slot=\"range-slider-label\"\n />\n );\n },\n);\n\nexport type RangeSliderValueProps = ComponentPropsWithoutRef<typeof BaseSlider.Value>;\nexport const RangeSliderValue = forwardRef<HTMLOutputElement, RangeSliderValueProps>(\n function RangeSliderValue({ className, ...props }, ref) {\n return (\n <BaseSlider.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().value, className)}\n data-slot=\"range-slider-value\"\n />\n );\n },\n);\n\nexport type RangeSliderControlProps = ComponentPropsWithoutRef<typeof BaseSlider.Control>;\nexport const RangeSliderControl = forwardRef<HTMLDivElement, RangeSliderControlProps>(\n function RangeSliderControl({ className, ...props }, ref) {\n return (\n <BaseSlider.Control\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().control, className)}\n data-slot=\"range-slider-control\"\n />\n );\n },\n);\n\nexport type RangeSliderTrackProps = ComponentPropsWithoutRef<typeof BaseSlider.Track>;\nexport const RangeSliderTrack = forwardRef<HTMLDivElement, RangeSliderTrackProps>(\n function RangeSliderTrack({ className, ...props }, ref) {\n return (\n <BaseSlider.Track\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().track, className)}\n data-slot=\"range-slider-track\"\n />\n );\n },\n);\n\nexport type RangeSliderIndicatorProps = ComponentPropsWithoutRef<typeof BaseSlider.Indicator>;\nexport const RangeSliderIndicator = forwardRef<HTMLDivElement, RangeSliderIndicatorProps>(\n function RangeSliderIndicator({ className, ...props }, ref) {\n return (\n <BaseSlider.Indicator\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().indicator, className)}\n data-slot=\"range-slider-indicator\"\n />\n );\n },\n);\n\nexport interface RangeSliderThumbProps extends ComponentPropsWithoutRef<typeof BaseSlider.Thumb> {\n index: 0 | 1;\n}\n\nexport const RangeSliderThumb = forwardRef<HTMLDivElement, RangeSliderThumbProps>(\n function RangeSliderThumb({ className, ...props }, ref) {\n return (\n <BaseSlider.Thumb\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().thumb, className)}\n data-slot=\"range-slider-thumb\"\n />\n );\n },\n);\n\nexport const RangeSlider = {\n Root: RangeSliderRoot,\n Label: RangeSliderLabel,\n Value: RangeSliderValue,\n Control: RangeSliderControl,\n Track: RangeSliderTrack,\n Indicator: RangeSliderIndicator,\n Thumb: RangeSliderThumb,\n};\n"],"mappings":";;;;;;;AAYA,MAAM,0BAAA,GAAyBA,MAAAA,cAAAA,CAA+B,IAAI;AAElE,SAAS,uBAAuB;CAC9B,OAAOC,qBAAAA,YAAY,EAAE,OAAA,GAAMC,MAAAA,WAAAA,CAAW,sBAAsB,EAAE,CAAC;AACjE;AAgBA,SAAS,QAAQ,QAA2B,KAAa,KAAwC;CAC/F,OAAO,CAAC,OAAO,MAAM,KAAK,OAAO,MAAM,GAAG;AAC5C;AAEA,MAAa,mBAAA,GAAkBC,MAAAA,WAAAA,CAC7B,SAAS,gBACP,EACE,UACA,WACA,cACA,MAAM,KACN,MAAM,GACN,eACA,kBACA,OAAO,MACP,OACA,GAAG,SAEL,KACA;CACA,MAAM,SAASF,qBAAAA,YAAY,EAAE,KAAK,CA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AAS;EACxE,aAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,oBAAA,GAAmBF,MAAAA,WAAAA,CAC9B,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAS,KAAK;CACtD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoB,qBAAqB,CAAC,CAAC,OAAO,SAAS;EACtE,aAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,wBAAA,GAAuBF,MAAAA,WAAAA,CAClC,SAAS,qBAAqB,EAAE,WAAW,GAAG,SAAS,KAAK;CAC1D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,OAAW,WAAZ;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoB,qBAAqB,CAAC,CAAC,WAAW,SAAS;EAC1E,aAAU;CACX,CAAA;AAEL,CACF;AAMA,MAAa,oBAAA,GAAmBF,MAAAA,WAAAA,CAC9B,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAS,KAAK;CACtD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoB,qBAAqB,CAAC,CAAC,OAAO,SAAS;EACtE,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,cAAc;CACzB,MAAM;CACN,OAAO;CACP,OAAO;CACP,SAAS;CACT,OAAO;CACP,WAAW;CACX,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"range-slider.js","names":["BaseSlider"],"sources":["../../../src/components/range-slider/range-slider.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slider as BaseSlider } from \"@base-ui/react/slider\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { SliderRoot as BaseSliderRoot } from \"@base-ui/react/slider\";\n\nimport { rangeSlider } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type RangeSliderSize = \"sm\" | \"md\" | \"lg\";\n\nconst RangeSliderSizeContext = createContext<RangeSliderSize>(\"md\");\n\nfunction useRangeSliderStyles() {\n return rangeSlider({ size: useContext(RangeSliderSizeContext) });\n}\n\nexport interface RangeSliderRootProps\n extends Omit<\n BaseSliderRoot.Props<readonly number[]>,\n \"children\" | \"className\" | \"defaultValue\" | \"value\" | \"onValueChange\" | \"onValueCommitted\"\n > {\n value?: readonly [number, number];\n defaultValue?: readonly [number, number];\n onValueChange?: (value: readonly [number, number]) => void;\n onValueCommitted?: (value: readonly [number, number]) => void;\n size?: RangeSliderSize;\n children?: ReactNode;\n className?: string;\n}\n\nfunction asRange(values: readonly number[], min: number, max: number): readonly [number, number] {\n return [values[0] ?? min, values[1] ?? max];\n}\n\nexport const RangeSliderRoot = forwardRef<HTMLDivElement, RangeSliderRootProps>(\n function RangeSliderRoot(\n {\n children,\n className,\n defaultValue,\n max = 100,\n min = 0,\n onValueChange,\n onValueCommitted,\n size = \"md\",\n value,\n ...props\n },\n ref,\n ) {\n const styles = rangeSlider({ size });\n const fallbackValue = defaultValue ?? [min, max];\n\n return (\n <RangeSliderSizeContext.Provider value={size}>\n <BaseSlider.Root\n {...props}\n defaultValue={fallbackValue}\n max={max}\n min={min}\n onValueChange={(next) => onValueChange?.(asRange(next, min, max))}\n onValueCommitted={(next) => onValueCommitted?.(asRange(next, min, max))}\n ref={ref}\n value={value}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"range-slider\"\n data-slot=\"range-slider\"\n >\n {children}\n </BaseSlider.Root>\n </RangeSliderSizeContext.Provider>\n );\n },\n);\n\nexport type RangeSliderLabelProps = ComponentPropsWithoutRef<typeof BaseSlider.Label>;\nexport const RangeSliderLabel = forwardRef<HTMLDivElement, RangeSliderLabelProps>(\n function RangeSliderLabel({ className, ...props }, ref) {\n return (\n <BaseSlider.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().label, className)}\n data-slot=\"range-slider-label\"\n />\n );\n },\n);\n\nexport type RangeSliderValueProps = ComponentPropsWithoutRef<typeof BaseSlider.Value>;\nexport const RangeSliderValue = forwardRef<HTMLOutputElement, RangeSliderValueProps>(\n function RangeSliderValue({ className, ...props }, ref) {\n return (\n <BaseSlider.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().value, className)}\n data-slot=\"range-slider-value\"\n />\n );\n },\n);\n\nexport type RangeSliderControlProps = ComponentPropsWithoutRef<typeof BaseSlider.Control>;\nexport const RangeSliderControl = forwardRef<HTMLDivElement, RangeSliderControlProps>(\n function RangeSliderControl({ className, ...props }, ref) {\n return (\n <BaseSlider.Control\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().control, className)}\n data-slot=\"range-slider-control\"\n />\n );\n },\n);\n\nexport type RangeSliderTrackProps = ComponentPropsWithoutRef<typeof BaseSlider.Track>;\nexport const RangeSliderTrack = forwardRef<HTMLDivElement, RangeSliderTrackProps>(\n function RangeSliderTrack({ className, ...props }, ref) {\n return (\n <BaseSlider.Track\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().track, className)}\n data-slot=\"range-slider-track\"\n />\n );\n },\n);\n\nexport type RangeSliderIndicatorProps = ComponentPropsWithoutRef<typeof BaseSlider.Indicator>;\nexport const RangeSliderIndicator = forwardRef<HTMLDivElement, RangeSliderIndicatorProps>(\n function RangeSliderIndicator({ className, ...props }, ref) {\n return (\n <BaseSlider.Indicator\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().indicator, className)}\n data-slot=\"range-slider-indicator\"\n />\n );\n },\n);\n\nexport interface RangeSliderThumbProps extends ComponentPropsWithoutRef<typeof BaseSlider.Thumb> {\n index: 0 | 1;\n}\n\nexport const RangeSliderThumb = forwardRef<HTMLDivElement, RangeSliderThumbProps>(\n function RangeSliderThumb({ className, ...props }, ref) {\n return (\n <BaseSlider.Thumb\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().thumb, className)}\n data-slot=\"range-slider-thumb\"\n />\n );\n },\n);\n\nexport const RangeSlider = {\n Root: RangeSliderRoot,\n Label: RangeSliderLabel,\n Value: RangeSliderValue,\n Control: RangeSliderControl,\n Track: RangeSliderTrack,\n Indicator: RangeSliderIndicator,\n Thumb: RangeSliderThumb,\n};\n"],"mappings":";;;;;;;AAYA,MAAM,yBAAyB,cAA+B,IAAI;AAElE,SAAS,uBAAuB;CAC9B,OAAO,YAAY,EAAE,MAAM,WAAW,sBAAsB,EAAE,CAAC;AACjE;AAgBA,SAAS,QAAQ,QAA2B,KAAa,KAAwC;CAC/F,OAAO,CAAC,OAAO,MAAM,KAAK,OAAO,MAAM,GAAG;AAC5C;AAEA,MAAa,kBAAkB,WAC7B,SAAS,gBACP,EACE,UACA,WACA,cACA,MAAM,KACN,MAAM,GACN,eACA,kBACA,OAAO,MACP,OACA,GAAG,SAEL,KACA;CACA,MAAM,SAAS,YAAY,EAAE,KAAK,CAAC;CACnC,MAAM,gBAAgB,gBAAgB,CAAC,KAAK,GAAG;CAE/C,OACE,oBAAC,uBAAuB,UAAxB;EAAiC,OAAO;YACtC,oBAACA,OAAW,MAAZ;GACE,GAAI;GACJ,cAAc;GACT;GACA;GACL,gBAAgB,SAAS,gBAAgB,QAAQ,MAAM,KAAK,GAAG,CAAC;GAChE,mBAAmB,SAAS,mBAAmB,QAAQ,MAAM,KAAK,GAAG,CAAC;GACjE;GACE;GACP,WAAW,oBAAoB,OAAO,MAAM,SAAS;GACrD,uBAAoB;GACpB,aAAU;GAET;EACc,CAAA;CACc,CAAA;AAErC,CACF;AAGA,MAAa,mBAAmB,WAC9B,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAS,KAAK;CACtD,OACE,oBAACA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,qBAAqB,CAAC,CAAC,OAAO,SAAS;EACtE,aAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,mBAAmB,WAC9B,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAS,KAAK;CACtD,OACE,oBAACA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,qBAAqB,CAAC,CAAC,OAAO,SAAS;EACtE,aAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,qBAAqB,WAChC,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CACxD,OACE,oBAACA,OAAW,SAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,qBAAqB,CAAC,CAAC,SAAS,SAAS;EACxE,aAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,mBAAmB,WAC9B,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAS,KAAK;CACtD,OACE,oBAACA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,qBAAqB,CAAC,CAAC,OAAO,SAAS;EACtE,aAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,uBAAuB,WAClC,SAAS,qBAAqB,EAAE,WAAW,GAAG,SAAS,KAAK;CAC1D,OACE,oBAACA,OAAW,WAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,qBAAqB,CAAC,CAAC,WAAW,SAAS;EAC1E,aAAU;CACX,CAAA;AAEL,CACF;AAMA,MAAa,mBAAmB,WAC9B,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAS,KAAK;CACtD,OACE,oBAACA,OAAW,OAAZ;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,qBAAqB,CAAC,CAAC,OAAO,SAAS;EACtE,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,cAAc;CACzB,MAAM;CACN,OAAO;CACP,OAAO;CACP,SAAS;CACT,OAAO;CACP,WAAW;CACX,OAAO;AACT"}
1
+ {"version":3,"file":"range-slider.js","names":["BaseSlider"],"sources":["../../../src/components/range-slider/range-slider.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slider as BaseSlider } from \"@base-ui/react/slider\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { SliderRoot as BaseSliderRoot } from \"@base-ui/react/slider\";\n\nimport { rangeSlider } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type RangeSliderSize = \"sm\" | \"md\" | \"lg\";\n\nconst RangeSliderSizeContext = createContext<RangeSliderSize>(\"md\");\n\nfunction useRangeSliderStyles() {\n return rangeSlider({ size: useContext(RangeSliderSizeContext) });\n}\n\nexport interface RangeSliderRootProps\n extends Omit<\n BaseSliderRoot.Props<readonly number[]>,\n \"children\" | \"className\" | \"defaultValue\" | \"value\" | \"onValueChange\" | \"onValueCommitted\"\n > {\n value?: readonly [number, number];\n defaultValue?: readonly [number, number];\n onValueChange?: (value: readonly [number, number]) => void;\n onValueCommitted?: (value: readonly [number, number]) => void;\n size?: RangeSliderSize;\n children?: ReactNode;\n className?: string;\n}\n\nfunction asRange(values: readonly number[], min: number, max: number): readonly [number, number] {\n return [values[0] ?? min, values[1] ?? max];\n}\n\nexport const RangeSliderRoot = forwardRef<HTMLDivElement, RangeSliderRootProps>(\n function RangeSliderRoot(\n {\n children,\n className,\n defaultValue,\n max = 100,\n min = 0,\n onValueChange,\n onValueCommitted,\n size = \"md\",\n value,\n ...props\n },\n ref,\n ) {\n const styles = rangeSlider({ size });\n const fallbackValue = defaultValue ?? [min, max];\n\n return (\n <RangeSliderSizeContext.Provider value={size}>\n <BaseSlider.Root\n {...props}\n defaultValue={fallbackValue}\n max={max}\n min={min}\n onValueChange={(next) => onValueChange?.(asRange(next, min, max))}\n onValueCommitted={(next) => onValueCommitted?.(asRange(next, min, max))}\n ref={ref}\n value={value}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"range-slider\"\n data-slot=\"range-slider\"\n >\n {children}\n </BaseSlider.Root>\n </RangeSliderSizeContext.Provider>\n );\n },\n);\n\nexport type RangeSliderLabelProps = ComponentPropsWithoutRef<typeof BaseSlider.Label>;\nexport const RangeSliderLabel = forwardRef<HTMLDivElement, RangeSliderLabelProps>(\n function RangeSliderLabel({ className, ...props }, ref) {\n return (\n <BaseSlider.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().label, className)}\n data-slot=\"range-slider-label\"\n />\n );\n },\n);\n\nexport type RangeSliderValueProps = ComponentPropsWithoutRef<typeof BaseSlider.Value>;\nexport const RangeSliderValue = forwardRef<HTMLOutputElement, RangeSliderValueProps>(\n function RangeSliderValue({ className, ...props }, ref) {\n return (\n <BaseSlider.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().value, className)}\n data-slot=\"range-slider-value\"\n />\n );\n },\n);\n\nexport type RangeSliderControlProps = ComponentPropsWithoutRef<typeof BaseSlider.Control>;\nexport const RangeSliderControl = forwardRef<HTMLDivElement, RangeSliderControlProps>(\n function RangeSliderControl({ className, ...props }, ref) {\n return (\n <BaseSlider.Control\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().control, className)}\n data-slot=\"range-slider-control\"\n />\n );\n },\n);\n\nexport type RangeSliderTrackProps = ComponentPropsWithoutRef<typeof BaseSlider.Track>;\nexport const RangeSliderTrack = forwardRef<HTMLDivElement, RangeSliderTrackProps>(\n function RangeSliderTrack({ className, ...props }, ref) {\n return (\n <BaseSlider.Track\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().track, className)}\n data-slot=\"range-slider-track\"\n />\n );\n },\n);\n\nexport type RangeSliderIndicatorProps = ComponentPropsWithoutRef<typeof BaseSlider.Indicator>;\nexport const RangeSliderIndicator = forwardRef<HTMLDivElement, RangeSliderIndicatorProps>(\n function RangeSliderIndicator({ className, ...props }, ref) {\n return (\n <BaseSlider.Indicator\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().indicator, className)}\n data-slot=\"range-slider-indicator\"\n />\n );\n },\n);\n\nexport interface RangeSliderThumbProps extends ComponentPropsWithoutRef<typeof BaseSlider.Thumb> {\n index: 0 | 1;\n}\n\nexport const RangeSliderThumb = forwardRef<HTMLDivElement, RangeSliderThumbProps>(\n function RangeSliderThumb({ className, ...props }, ref) {\n return (\n <BaseSlider.Thumb\n {...props}\n ref={ref}\n className={withRecipeClassName(useRangeSliderStyles().thumb, className)}\n data-slot=\"range-slider-thumb\"\n />\n );\n },\n);\n\nexport const RangeSlider = {\n Root: RangeSliderRoot,\n Label: RangeSliderLabel,\n Value: RangeSliderValue,\n Control: RangeSliderControl,\n Track: RangeSliderTrack,\n Indicator: RangeSliderIndicator,\n Thumb: RangeSliderThumb,\n};\n"],"mappings":";;;;;;;AAYA,MAAM,yBAAyB,cAA+B,IAAI;AAElE,SAAS,uBAAuB;CAC9B,OAAO,YAAY,EAAE,MAAM,WAAW,sBAAsB,EAAE,CAAC;AACjE;AAgBA,SAAS,QAAQ,QAA2B,KAAa,KAAwC;CAC/F,OAAO,CAAC,OAAO,MAAM,KAAK,OAAO,MAAM,GAAG;AAC5C;AAEA,MAAa,kBAAkB,WAC7B,SAAS,gBACP,EACE,UACA,WACA,cACA,MAAM,KACN,MAAM,GACN,eACA,kBACA,OAAO,MACP,OACA,GAAG,SAEL,KACA;CACA,MAAM,SAAS,YAAY,EAAE,KAAK,CAAC;CACnC,MAAM,gBAAgB,gBAAgB,CAAC,KAAK,GAAG;CAE/C,OACE,oBAAC,uBAAuB,UAAxB;EAAiC,OAAO;EACtC,UAAA,oBAACA,OAAW,MAAZ;GACE,GAAI;GACJ,cAAc;GACT;GACA;GACL,gBAAgB,SAAS,gBAAgB,QAAQ,MAAM,KAAK,GAAG,CAAC;GAChE,mBAAmB,SAAS,mBAAmB,QAAQ,MAAM,KAAK,GAAG,CAAC;GACjE;GACE;GACP,WAAW,oBAAoB,OAAO,MAAM,SAAS;GACrD,uBAAoB;GACpB,aAAU;GAET;EACc,CAAA;CACc,CAAA;AAErC,CACF;AAGA,MAAa,mBAAmB,WAC9B,SA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OAAO;CACP,OAAO;CACP,SAAS;CACT,OAAO;CACP,WAAW;CACX,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-area.cjs","names":["BaseScrollArea","withRecipeClassName","scrollArea"],"sources":["../../../src/components/scroll-area/scroll-area.tsx"],"sourcesContent":["\"use client\";\n\nimport { ScrollArea as BaseScrollArea } from \"@base-ui/react/scroll-area\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { scrollArea } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type ScrollAreaRootProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Root>;\n\nexport const ScrollAreaRoot = forwardRef<HTMLDivElement, ScrollAreaRootProps>(\n function ScrollAreaRoot({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Root\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().root, className)}\n data-jaci-component=\"scroll-area\"\n data-slot=\"scroll-area\"\n />\n );\n },\n);\n\nexport type ScrollAreaViewportProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Viewport>;\n\nexport const ScrollAreaViewport = forwardRef<HTMLDivElement, ScrollAreaViewportProps>(\n function ScrollAreaViewport({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().viewport, className)}\n data-slot=\"scroll-area-viewport\"\n />\n );\n },\n);\n\nexport type ScrollAreaContentProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Content>;\n\nexport const ScrollAreaContent = forwardRef<HTMLDivElement, ScrollAreaContentProps>(\n function ScrollAreaContent({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Content\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().content, className)}\n data-slot=\"scroll-area-content\"\n />\n );\n },\n);\n\nexport type ScrollAreaScrollbarProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Scrollbar>;\n\nexport const ScrollAreaScrollbar = forwardRef<HTMLDivElement, ScrollAreaScrollbarProps>(\n function ScrollAreaScrollbar({ className, orientation = \"vertical\", ...props }, ref) {\n return (\n <BaseScrollArea.Scrollbar\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().scrollbar, className)}\n data-orientation={orientation}\n data-slot=\"scroll-area-scrollbar\"\n orientation={orientation}\n />\n );\n },\n);\n\nexport type ScrollAreaThumbProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Thumb>;\n\nexport const ScrollAreaThumb = forwardRef<HTMLDivElement, ScrollAreaThumbProps>(\n function ScrollAreaThumb({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Thumb\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().thumb, className)}\n data-slot=\"scroll-area-thumb\"\n />\n );\n },\n);\n\nexport type ScrollAreaCornerProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Corner>;\n\nexport const ScrollAreaCorner = forwardRef<HTMLDivElement, ScrollAreaCornerProps>(\n function ScrollAreaCorner({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Corner\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().corner, className)}\n data-slot=\"scroll-area-corner\"\n />\n );\n },\n);\n\nexport const ScrollArea = {\n Root: ScrollAreaRoot,\n Viewport: ScrollAreaViewport,\n Content: ScrollAreaContent,\n Scrollbar: ScrollAreaScrollbar,\n Thumb: ScrollAreaThumb,\n Corner: ScrollAreaCorner,\n};\n"],"mappings":";;;;;;;AAWA,MAAa,kBAAA,GAAA,MAAA,WAAA,CACX,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CACpD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,2BAAAA,WAAe,MAAhB;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoBC,oBAAAA,WAAW,CAAC,CAAC,MAAM,SAAS;EAC3D,uBAAoB;EACpB,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,sBAAA,GAAA,MAAA,WAAA,C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AAI;EACC;EACL,WAAWC,gBAAAA,oBAAoBC,oBAAAA,WAAW,CAAC,CAAC,QAAQ,SAAS;EAC7D,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,aAAa;CACxB,MAAM;CACN,UAAU;CACV,SAAS;CACT,WAAW;CACX,OAAO;CACP,QAAQ;AACV"}
1
+ {"version":3,"file":"scroll-area.cjs","names":["forwardRef","BaseScrollArea","withRecipeClassName","scrollArea"],"sources":["../../../src/components/scroll-area/scroll-area.tsx"],"sourcesContent":["\"use client\";\n\nimport { ScrollArea as BaseScrollArea } from \"@base-ui/react/scroll-area\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { scrollArea } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type ScrollAreaRootProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Root>;\n\nexport const ScrollAreaRoot = forwardRef<HTMLDivElement, ScrollAreaRootProps>(\n function ScrollAreaRoot({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Root\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().root, className)}\n data-jaci-component=\"scroll-area\"\n data-slot=\"scroll-area\"\n />\n );\n },\n);\n\nexport type ScrollAreaViewportProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Viewport>;\n\nexport const ScrollAreaViewport = forwardRef<HTMLDivElement, ScrollAreaViewportProps>(\n function ScrollAreaViewport({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().viewport, className)}\n data-slot=\"scroll-area-viewport\"\n />\n );\n },\n);\n\nexport type ScrollAreaContentProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Content>;\n\nexport const ScrollAreaContent = forwardRef<HTMLDivElement, ScrollAreaContentProps>(\n function ScrollAreaContent({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Content\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().content, className)}\n data-slot=\"scroll-area-content\"\n />\n );\n },\n);\n\nexport type ScrollAreaScrollbarProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Scrollbar>;\n\nexport const ScrollAreaScrollbar = forwardRef<HTMLDivElement, ScrollAreaScrollbarProps>(\n function ScrollAreaScrollbar({ className, orientation = \"vertical\", ...props }, ref) {\n return (\n <BaseScrollArea.Scrollbar\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().scrollbar, className)}\n data-orientation={orientation}\n data-slot=\"scroll-area-scrollbar\"\n orientation={orientation}\n />\n );\n },\n);\n\nexport type ScrollAreaThumbProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Thumb>;\n\nexport const ScrollAreaThumb = forwardRef<HTMLDivElement, ScrollAreaThumbProps>(\n function ScrollAreaThumb({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Thumb\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().thumb, className)}\n data-slot=\"scroll-area-thumb\"\n />\n );\n },\n);\n\nexport type ScrollAreaCornerProps = ComponentPropsWithoutRef<typeof BaseScrollArea.Corner>;\n\nexport const ScrollAreaCorner = forwardRef<HTMLDivElement, ScrollAreaCornerProps>(\n function ScrollAreaCorner({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Corner\n {...props}\n ref={ref}\n className={withRecipeClassName(scrollArea().corner, className)}\n data-slot=\"scroll-area-corner\"\n />\n );\n },\n);\n\nexport const ScrollArea = {\n Root: ScrollAreaRoot,\n Viewport: ScrollAreaViewport,\n Content: ScrollAreaContent,\n Scrollbar: ScrollAreaScrollbar,\n Thumb: ScrollAreaThumb,\n Corner: ScrollAreaCorner,\n};\n"],"mappings":";;;;;;;AAWA,MAAa,kBAAA,GAAiBA,MAAAA,WAAAA,CAC5B,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CACpD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,2BAAAA,WAAe,MAAhB;EACE,GAAI;EACC;EACL,WAAWC,gBA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AEL,CACF;AAIA,MAAa,oBAAA,GAAmBH,MAAAA,WAAAA,CAC9B,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAS,KAAK;CACtD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,2BAAAA,WAAe,QAAhB;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoBC,oBAAAA,WAAW,CAAC,CAAC,QAAQ,SAAS;EAC7D,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,aAAa;CACxB,MAAM;CACN,UAAU;CACV,SAAS;CACT,WAAW;CACX,OAAO;CACP,QAAQ;AACV"}
@@ -1 +1 @@
1
- {"version":3,"file":"select.cjs","names":["select","BaseSelect","withRecipeClassName","useThemePortalProps","cx"],"sources":["../../../src/components/select/select.tsx"],"sourcesContent":["\"use client\";\n\nimport { Select as BaseSelect } from \"@base-ui/react/select\";\nimport { createContext, forwardRef, useContext, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { SelectRoot as BaseSelectRoot } from \"@base-ui/react/select\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { select } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\nexport type SelectSize = \"sm\" | \"md\" | \"lg\";\n\nconst SelectSizeContext = createContext<SelectSize>(\"md\");\nconst SelectAuxContext = createContext<{ clear: () => void; disabled: boolean } | null>(null);\n\nfunction useSelectStyles() {\n return select({ size: useContext(SelectSizeContext) });\n}\n\n/**\n * Groups an accessible listbox select. Use `value`/`onValueChange` for a\n * controlled selection, or `defaultValue` for an uncontrolled selection.\n *\n * `size` is shared by all visual parts so the trigger stays aligned with the\n * library's `Input` component.\n */\nexport interface SelectRootProps<Value, Multiple extends boolean | undefined = false>\n extends BaseSelectRoot.Props<Value, Multiple> {\n size?: SelectSize;\n loading?: boolean;\n}\n\nexport function SelectRoot<Value = unknown, Multiple extends boolean | undefined = false>({\n defaultValue,\n disabled = false,\n loading: _loading,\n multiple,\n onValueChange,\n size = \"md\",\n value: controlledValue,\n ...props\n}: SelectRootProps<Value, Multiple>) {\n const [uncontrolledValue, setUncontrolledValue] = useState<unknown>(\n defaultValue ?? (multiple ? [] : null),\n );\n const value = controlledValue === undefined ? uncontrolledValue : controlledValue;\n const clear = () => {\n const nextValue = multiple ? [] : null;\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue as never, undefined as never);\n };\n return (\n <SelectSizeContext.Provider value={size}>\n <SelectAuxContext.Provider value={{ clear, disabled }}>\n <BaseSelect.Root\n {...props}\n disabled={disabled}\n defaultValue={undefined}\n multiple={multiple}\n onValueChange={(nextValue, details) => {\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue, details);\n }}\n value={value as SelectRootProps<Value, Multiple>[\"value\"]}\n />\n </SelectAuxContext.Provider>\n </SelectSizeContext.Provider>\n );\n}\n\nexport type SelectLabelProps = ComponentPropsWithoutRef<typeof BaseSelect.Label>;\n\n/** An accessible label that Base UI associates with the trigger automatically. */\nexport const SelectLabel = forwardRef<HTMLDivElement, SelectLabelProps>(function SelectLabel(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().label, className)}\n data-slot=\"select-label\"\n />\n );\n});\n\nexport type SelectTriggerProps = ComponentPropsWithoutRef<typeof BaseSelect.Trigger>;\n\n/** The button-shaped control that opens the select popup. */\nexport const SelectTrigger = forwardRef<HTMLButtonElement, SelectTriggerProps>(\n function SelectTrigger({ className, ...props }, ref) {\n return (\n <BaseSelect.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().trigger, className)}\n data-jaci-component=\"select\"\n data-slot=\"select-trigger\"\n />\n );\n },\n);\n\nexport type SelectValueProps = ComponentPropsWithoutRef<typeof BaseSelect.Value>;\n\n/** Renders the selected item's label, or its placeholder when empty. */\nexport const SelectValue = forwardRef<HTMLSpanElement, SelectValueProps>(function SelectValue(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().value, className)}\n data-slot=\"select-value\"\n />\n );\n});\n\nexport type SelectIconProps = ComponentPropsWithoutRef<typeof BaseSelect.Icon>;\n\n/** A small chevron that rotates while the popup is open. */\nexport const SelectIcon = forwardRef<HTMLSpanElement, SelectIconProps>(function SelectIcon(\n { children = \"⌄\", className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Icon\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={withRecipeClassName(useSelectStyles().icon, className)}\n data-slot=\"select-icon\"\n >\n {children}\n </BaseSelect.Icon>\n );\n});\n\n/** Preserves Base UI's optional portal container and mount controls. */\nexport function SelectPortal(props: ComponentPropsWithoutRef<typeof BaseSelect.Portal>) {\n return <BaseSelect.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type SelectPositionerProps = ComponentPropsWithoutRef<typeof BaseSelect.Positioner>;\n\nexport const SelectPositioner = forwardRef<HTMLDivElement, SelectPositionerProps>(\n function SelectPositioner({ className, ...props }, ref) {\n return (\n <BaseSelect.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().positioner, className)}\n data-slot=\"select-positioner\"\n />\n );\n },\n);\n\nexport type SelectPopupProps = ComponentPropsWithoutRef<typeof BaseSelect.Popup>;\n\nexport const SelectPopup = forwardRef<HTMLDivElement, SelectPopupProps>(function SelectPopup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().popup, className)}\n data-slot=\"select-popup\"\n />\n );\n});\n\nexport type SelectListProps = ComponentPropsWithoutRef<typeof BaseSelect.List>;\n\nexport const SelectList = forwardRef<HTMLDivElement, SelectListProps>(function SelectList(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.List\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().list, className)}\n data-slot=\"select-list\"\n />\n );\n});\n\nexport type SelectItemProps = ComponentPropsWithoutRef<typeof BaseSelect.Item>;\n\nexport const SelectItem = forwardRef<HTMLElement, SelectItemProps>(function SelectItem(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().item, className)}\n data-slot=\"select-item\"\n />\n );\n});\n\nexport type SelectItemTextProps = ComponentPropsWithoutRef<typeof BaseSelect.ItemText>;\n\nexport const SelectItemText = forwardRef<HTMLDivElement, SelectItemTextProps>(\n function SelectItemText({ className, ...props }, ref) {\n return (\n <BaseSelect.ItemText\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().itemText, className)}\n data-slot=\"select-item-text\"\n />\n );\n },\n);\n\nexport type SelectItemIndicatorProps = ComponentPropsWithoutRef<typeof BaseSelect.ItemIndicator>;\n\nexport const SelectItemIndicator = forwardRef<HTMLSpanElement, SelectItemIndicatorProps>(\n function SelectItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <BaseSelect.ItemIndicator\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={withRecipeClassName(useSelectStyles().itemIndicator, className)}\n data-slot=\"select-item-indicator\"\n >\n {children}\n </BaseSelect.ItemIndicator>\n );\n },\n);\n\nexport type SelectGroupProps = ComponentPropsWithoutRef<typeof BaseSelect.Group>;\n\nexport const SelectGroup = forwardRef<HTMLDivElement, SelectGroupProps>(function SelectGroup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Group\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().group, className)}\n data-slot=\"select-group\"\n />\n );\n});\n\nexport type SelectGroupLabelProps = ComponentPropsWithoutRef<typeof BaseSelect.GroupLabel>;\n\nexport const SelectGroupLabel = forwardRef<HTMLDivElement, SelectGroupLabelProps>(\n function SelectGroupLabel({ className, ...props }, ref) {\n return (\n <BaseSelect.GroupLabel\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().groupLabel, className)}\n data-slot=\"select-group-label\"\n />\n );\n },\n);\n\n/**\n * A visual separator for groups in a listbox. It is intentionally hidden from\n * assistive technology because ARIA listboxes may only contain options or\n * option groups, not semantic separators.\n */\nexport interface SelectSeparatorProps extends ComponentPropsWithoutRef<\"div\"> {\n orientation?: \"horizontal\" | \"vertical\";\n}\n\nexport const SelectSeparator = forwardRef<HTMLDivElement, SelectSeparatorProps>(\n function SelectSeparator({ className, orientation = \"horizontal\", ...props }, ref) {\n return (\n <div\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={cx(useSelectStyles().separator, className)}\n data-orientation={orientation}\n data-slot=\"select-separator\"\n />\n );\n },\n);\n\nexport interface SelectClearProps extends ComponentPropsWithoutRef<\"button\"> {\n children?: ReactNode;\n}\nexport const SelectClear = forwardRef<HTMLButtonElement, SelectClearProps>(function SelectClear(\n { children = \"×\", className, ...props },\n ref,\n) {\n const context = useContext(SelectAuxContext);\n const styles = useSelectStyles();\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n className={cx(styles.clear, className)}\n data-slot=\"select-clear\"\n disabled={props.disabled || context?.disabled}\n onClick={(event) => {\n context?.clear();\n props.onClick?.(event);\n }}\n ref={ref}\n type=\"button\"\n >\n {children}\n </button>\n );\n});\n\nexport type SelectEmptyProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectEmpty = forwardRef<HTMLDivElement, SelectEmptyProps>(function SelectEmpty(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n className={cx(useSelectStyles().empty, className)}\n data-slot=\"select-empty\"\n ref={ref}\n />\n );\n});\nexport type SelectLoadingProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectLoading = forwardRef<HTMLDivElement, SelectLoadingProps>(function SelectLoading(\n { children = \"Loading…\", className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n aria-live=\"polite\"\n className={cx(useSelectStyles().loading, className)}\n data-slot=\"select-loading\"\n ref={ref}\n >\n {children}\n </div>\n );\n});\nexport type SelectStatusProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectStatus = forwardRef<HTMLDivElement, SelectStatusProps>(function SelectStatus(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n aria-live=\"polite\"\n className={cx(useSelectStyles().status, className)}\n data-slot=\"select-status\"\n ref={ref}\n />\n );\n});\n\nexport const Select = {\n Root: SelectRoot,\n Label: SelectLabel,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Icon: SelectIcon,\n Portal: SelectPortal,\n Positioner: SelectPositioner,\n Popup: SelectPopup,\n List: SelectList,\n Item: SelectItem,\n ItemText: SelectItemText,\n ItemIndicator: SelectItemIndicator,\n Group: SelectGroup,\n GroupLabel: SelectGroupLabel,\n Separator: SelectSeparator,\n Clear: SelectClear,\n Empty: SelectEmpty,\n Loading: SelectLoading,\n Status: SelectStatus,\n};\n"],"mappings":";;;;;;;;;AAcA,MAAM,qBAAA,GAAA,MAAA,cAAA,CAA8C,IAAI;AACxD,MAAM,oBAAA,GAAA,MAAA,cAAA,CAAkF,IAAI;AAE5F,SAAS,kBAAkB;CACzB,OAAOA,eAAAA,OAAO,EAAE,OAAA,GAAA,MAAA,WAAA,CAAiB,iBAAiB,EAAE,CAAC;AACvD;AAeA,SAAgB,WAA0E,EACxF,cACA,WAAW,OACX,SAAS,UACT,UACA,eACA,OAAO,MACP,OAAO,iBACP,GAAG,SACgC;CACnC,MAAM,CAAC,mBAAmB,yBAAA,GAAA,MAAA,SAAA,CACxB,iBAAiB,WAAW,CAAC,IAAI,KACnC;CACA,MAAM,QAAQ,oBAAoB,KAAA,IAAY,oBAAoB;CAClE,MAAM,cAAc;EAClB,MAAM,YAAY,WAAW,CAAC,IAAI;EAClC,IAAI,oBAAoB,KAAA,GAAW,qBAAqB,SAAS;EACjE,gBAAgB,WAAoB,KAAA,CAAkB;CACxD;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAkB,UAAnB;EAA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EAEJ;CACE,CAAA;AAET,CAAC;AAED,MAAa,gBAAA,GAAA,MAAA,WAAA,CAA6D,SAAS,aACjF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACJ,aAAU;EACV,WAAWA,WAAAA,GAAG,gBAAgB,CAAC,CAAC,QAAQ,SAAS;EACjD,aAAU;EACL;CACN,CAAA;AAEL,CAAC;AAED,MAAa,SAAS;CACpB,MAAM;CACN,OAAO;CACP,SAAS;CACT,OAAO;CACP,MAAM;CACN,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,MAAM;CACN,MAAM;CACN,UAAU;CACV,eAAe;CACf,OAAO;CACP,YAAY;CACZ,WAAW;CACX,OAAO;CACP,OAAO;CACP,SAAS;CACT,QAAQ;AACV"}
1
+ {"version":3,"file":"select.cjs","names":["createContext","select","useContext","useState","BaseSelect","forwardRef","withRecipeClassName","useThemePortalProps","cx"],"sources":["../../../src/components/select/select.tsx"],"sourcesContent":["\"use client\";\n\nimport { Select as BaseSelect } from \"@base-ui/react/select\";\nimport { createContext, forwardRef, useContext, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { SelectRoot as BaseSelectRoot } from \"@base-ui/react/select\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { select } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\nexport type SelectSize = \"sm\" | \"md\" | \"lg\";\n\nconst SelectSizeContext = createContext<SelectSize>(\"md\");\nconst SelectAuxContext = createContext<{ clear: () => void; disabled: boolean } | null>(null);\n\nfunction useSelectStyles() {\n return select({ size: useContext(SelectSizeContext) });\n}\n\n/**\n * Groups an accessible listbox select. Use `value`/`onValueChange` for a\n * controlled selection, or `defaultValue` for an uncontrolled selection.\n *\n * `size` is shared by all visual parts so the trigger stays aligned with the\n * library's `Input` component.\n */\nexport interface SelectRootProps<Value, Multiple extends boolean | undefined = false>\n extends BaseSelectRoot.Props<Value, Multiple> {\n size?: SelectSize;\n loading?: boolean;\n}\n\nexport function SelectRoot<Value = unknown, Multiple extends boolean | undefined = false>({\n defaultValue,\n disabled = false,\n loading: _loading,\n multiple,\n onValueChange,\n size = \"md\",\n value: controlledValue,\n ...props\n}: SelectRootProps<Value, Multiple>) {\n const [uncontrolledValue, setUncontrolledValue] = useState<unknown>(\n defaultValue ?? (multiple ? [] : null),\n );\n const value = controlledValue === undefined ? uncontrolledValue : controlledValue;\n const clear = () => {\n const nextValue = multiple ? [] : null;\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue as never, undefined as never);\n };\n return (\n <SelectSizeContext.Provider value={size}>\n <SelectAuxContext.Provider value={{ clear, disabled }}>\n <BaseSelect.Root\n {...props}\n disabled={disabled}\n defaultValue={undefined}\n multiple={multiple}\n onValueChange={(nextValue, details) => {\n if (controlledValue === undefined) setUncontrolledValue(nextValue);\n onValueChange?.(nextValue, details);\n }}\n value={value as SelectRootProps<Value, Multiple>[\"value\"]}\n />\n </SelectAuxContext.Provider>\n </SelectSizeContext.Provider>\n );\n}\n\nexport type SelectLabelProps = ComponentPropsWithoutRef<typeof BaseSelect.Label>;\n\n/** An accessible label that Base UI associates with the trigger automatically. */\nexport const SelectLabel = forwardRef<HTMLDivElement, SelectLabelProps>(function SelectLabel(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().label, className)}\n data-slot=\"select-label\"\n />\n );\n});\n\nexport type SelectTriggerProps = ComponentPropsWithoutRef<typeof BaseSelect.Trigger>;\n\n/** The button-shaped control that opens the select popup. */\nexport const SelectTrigger = forwardRef<HTMLButtonElement, SelectTriggerProps>(\n function SelectTrigger({ className, ...props }, ref) {\n return (\n <BaseSelect.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().trigger, className)}\n data-jaci-component=\"select\"\n data-slot=\"select-trigger\"\n />\n );\n },\n);\n\nexport type SelectValueProps = ComponentPropsWithoutRef<typeof BaseSelect.Value>;\n\n/** Renders the selected item's label, or its placeholder when empty. */\nexport const SelectValue = forwardRef<HTMLSpanElement, SelectValueProps>(function SelectValue(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Value\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().value, className)}\n data-slot=\"select-value\"\n />\n );\n});\n\nexport type SelectIconProps = ComponentPropsWithoutRef<typeof BaseSelect.Icon>;\n\n/** A small chevron that rotates while the popup is open. */\nexport const SelectIcon = forwardRef<HTMLSpanElement, SelectIconProps>(function SelectIcon(\n { children = \"⌄\", className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Icon\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={withRecipeClassName(useSelectStyles().icon, className)}\n data-slot=\"select-icon\"\n >\n {children}\n </BaseSelect.Icon>\n );\n});\n\n/** Preserves Base UI's optional portal container and mount controls. */\nexport function SelectPortal(props: ComponentPropsWithoutRef<typeof BaseSelect.Portal>) {\n return <BaseSelect.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type SelectPositionerProps = ComponentPropsWithoutRef<typeof BaseSelect.Positioner>;\n\nexport const SelectPositioner = forwardRef<HTMLDivElement, SelectPositionerProps>(\n function SelectPositioner({ className, ...props }, ref) {\n return (\n <BaseSelect.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().positioner, className)}\n data-slot=\"select-positioner\"\n />\n );\n },\n);\n\nexport type SelectPopupProps = ComponentPropsWithoutRef<typeof BaseSelect.Popup>;\n\nexport const SelectPopup = forwardRef<HTMLDivElement, SelectPopupProps>(function SelectPopup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().popup, className)}\n data-slot=\"select-popup\"\n />\n );\n});\n\nexport type SelectListProps = ComponentPropsWithoutRef<typeof BaseSelect.List>;\n\nexport const SelectList = forwardRef<HTMLDivElement, SelectListProps>(function SelectList(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.List\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().list, className)}\n data-slot=\"select-list\"\n />\n );\n});\n\nexport type SelectItemProps = ComponentPropsWithoutRef<typeof BaseSelect.Item>;\n\nexport const SelectItem = forwardRef<HTMLElement, SelectItemProps>(function SelectItem(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().item, className)}\n data-slot=\"select-item\"\n />\n );\n});\n\nexport type SelectItemTextProps = ComponentPropsWithoutRef<typeof BaseSelect.ItemText>;\n\nexport const SelectItemText = forwardRef<HTMLDivElement, SelectItemTextProps>(\n function SelectItemText({ className, ...props }, ref) {\n return (\n <BaseSelect.ItemText\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().itemText, className)}\n data-slot=\"select-item-text\"\n />\n );\n },\n);\n\nexport type SelectItemIndicatorProps = ComponentPropsWithoutRef<typeof BaseSelect.ItemIndicator>;\n\nexport const SelectItemIndicator = forwardRef<HTMLSpanElement, SelectItemIndicatorProps>(\n function SelectItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <BaseSelect.ItemIndicator\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={withRecipeClassName(useSelectStyles().itemIndicator, className)}\n data-slot=\"select-item-indicator\"\n >\n {children}\n </BaseSelect.ItemIndicator>\n );\n },\n);\n\nexport type SelectGroupProps = ComponentPropsWithoutRef<typeof BaseSelect.Group>;\n\nexport const SelectGroup = forwardRef<HTMLDivElement, SelectGroupProps>(function SelectGroup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseSelect.Group\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().group, className)}\n data-slot=\"select-group\"\n />\n );\n});\n\nexport type SelectGroupLabelProps = ComponentPropsWithoutRef<typeof BaseSelect.GroupLabel>;\n\nexport const SelectGroupLabel = forwardRef<HTMLDivElement, SelectGroupLabelProps>(\n function SelectGroupLabel({ className, ...props }, ref) {\n return (\n <BaseSelect.GroupLabel\n {...props}\n ref={ref}\n className={withRecipeClassName(useSelectStyles().groupLabel, className)}\n data-slot=\"select-group-label\"\n />\n );\n },\n);\n\n/**\n * A visual separator for groups in a listbox. It is intentionally hidden from\n * assistive technology because ARIA listboxes may only contain options or\n * option groups, not semantic separators.\n */\nexport interface SelectSeparatorProps extends ComponentPropsWithoutRef<\"div\"> {\n orientation?: \"horizontal\" | \"vertical\";\n}\n\nexport const SelectSeparator = forwardRef<HTMLDivElement, SelectSeparatorProps>(\n function SelectSeparator({ className, orientation = \"horizontal\", ...props }, ref) {\n return (\n <div\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={cx(useSelectStyles().separator, className)}\n data-orientation={orientation}\n data-slot=\"select-separator\"\n />\n );\n },\n);\n\nexport interface SelectClearProps extends ComponentPropsWithoutRef<\"button\"> {\n children?: ReactNode;\n}\nexport const SelectClear = forwardRef<HTMLButtonElement, SelectClearProps>(function SelectClear(\n { children = \"×\", className, ...props },\n ref,\n) {\n const context = useContext(SelectAuxContext);\n const styles = useSelectStyles();\n return (\n <button\n {...props}\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n className={cx(styles.clear, className)}\n data-slot=\"select-clear\"\n disabled={props.disabled || context?.disabled}\n onClick={(event) => {\n context?.clear();\n props.onClick?.(event);\n }}\n ref={ref}\n type=\"button\"\n >\n {children}\n </button>\n );\n});\n\nexport type SelectEmptyProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectEmpty = forwardRef<HTMLDivElement, SelectEmptyProps>(function SelectEmpty(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n className={cx(useSelectStyles().empty, className)}\n data-slot=\"select-empty\"\n ref={ref}\n />\n );\n});\nexport type SelectLoadingProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectLoading = forwardRef<HTMLDivElement, SelectLoadingProps>(function SelectLoading(\n { children = \"Loading…\", className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n aria-live=\"polite\"\n className={cx(useSelectStyles().loading, className)}\n data-slot=\"select-loading\"\n ref={ref}\n >\n {children}\n </div>\n );\n});\nexport type SelectStatusProps = ComponentPropsWithoutRef<\"div\">;\nexport const SelectStatus = forwardRef<HTMLDivElement, SelectStatusProps>(function SelectStatus(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n aria-live=\"polite\"\n className={cx(useSelectStyles().status, className)}\n data-slot=\"select-status\"\n ref={ref}\n />\n );\n});\n\nexport const Select = {\n Root: SelectRoot,\n Label: SelectLabel,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Icon: SelectIcon,\n Portal: SelectPortal,\n Positioner: SelectPositioner,\n Popup: SelectPopup,\n List: SelectList,\n Item: SelectItem,\n ItemText: SelectItemText,\n ItemIndicator: SelectItemIndicator,\n Group: SelectGroup,\n GroupLabel: SelectGroupLabel,\n Separator: SelectSeparator,\n Clear: SelectClear,\n Empty: SelectEmpty,\n Loading: SelectLoading,\n Status: SelectStatus,\n};\n"],"mappings":";;;;;;;;;AAcA,MAAM,qBAAA,GAAoBA,MAAAA,cAAAA,CAA0B,IAAI;AACxD,MAAM,oBAAA,GAAmBA,MAAAA,cAAAA,CAA+D,IAAI;AAE5F,SAAS,kBAAkB;CACzB,OAAOC,eAAAA,OAAO,EAAE,OAAA,GAAMC,MAAAA,WAAAA,CAAW,iBAAiB,EAAE,CAAC;AACvD;AAeA,SAAgB,WAA0E,EACxF,cACA,WAAW,OACX,SAAS,UACT,UACA,eACA,OAAO,MACP,OAAO,iBACP,GAAG,SACgC;CACnC,MAAM,CAAC,mBAAmB,yBAAA,GAAwBC,MAAAA,SAAAA,CAChD,iBAAiB,WAAW,CAAC,IAAI,KACnC;CACA,MAAM,QAAQ,oBAAoB,KAAA,IAAY,oBAAoB;CAClE,MAAM,cAAc;EAClB,MAAM,YAAY,WAAW,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L,CAAC;AAED,MAAa,iBAAA,GAAgBH,MAAAA,WAAAA,CAA+C,SAAS,cACnF,EAAE,WAAW,YAAY,WAAW,GAAG,SACvC,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACJ,aAAU;EACV,WAAWG,WAAAA,GAAG,gBAAgB,CAAC,CAAC,SAAS,SAAS;EAClD,aAAU;EACL;EAEJ;CACE,CAAA;AAET,CAAC;AAED,MAAa,gBAAA,GAAeH,MAAAA,WAAAA,CAA8C,SAAS,aACjF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACJ,aAAU;EACV,WAAWG,WAAAA,GAAG,gBAAgB,CAAC,CAAC,QAAQ,SAAS;EACjD,aAAU;EACL;CACN,CAAA;AAEL,CAAC;AAED,MAAa,SAAS;CACpB,MAAM;CACN,OAAO;CACP,SAAS;CACT,OAAO;CACP,MAAM;CACN,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,MAAM;CACN,MAAM;CACN,UAAU;CACV,eAAe;CACf,OAAO;CACP,YAAY;CACZ,WAAW;CACX,OAAO;CACP,OAAO;CACP,SAAS;CACT,QAAQ;AACV"}
@@ -1 +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: 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,mBAA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MAAM;GACf,MAAM,UAAU,KAAK;EACvB;EACK;EACL,MAAK;EAEJ;CACK,CAAA;AAEZ,CAAC;AAGD,MAAa,cAAc,WAA6C,SAAS,YAC/E,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAAC,OAAD;EACE,GAAI;EACJ,WAAW,GAAG,gBAAgB,CAAC,CAAC,OAAO,SAAS;EAChD,aAAU;EACL;CACN,CAAA;AAEL,CAAC;AAED,MAAa,gBAAgB,WAA+C,SAAS,cACnF,EAAE,WAAW,YAAY,WAAW,GAAG,SACvC,KACA;CACA,OACE,oBAAC,OAAD;EACE,GAAI;EACJ,aAAU;EACV,WAAW,GAAG,gBAAgB,CAAC,CAAC,SAAS,SAAS;EAClD,aAAU;EACL;EAEJ;CACE,CAAA;AAET,CAAC;AAED,MAAa,eAAe,WAA8C,SAAS,aACjF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAAC,OAAD;EACE,GAAI;EACJ,aAAU;EACV,WAAW,GAAG,gBAAgB,CAAC,CAAC,QAAQ,SAAS;EACjD,aAAU;EACL;CACN,CAAA;AAEL,CAAC;AAED,MAAaC,WAAS;CACpB,MAAMF;CACN,OAAO;CACP,SAAS;CACT,OAAO;CACP,MAAM;CACN,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,MAAM;CACN,MAAM;CACN,UAAU;CACV,eAAe;CACf,OAAO;CACP,YAAY;CACZ,WAAW;CACX,OAAO;CACP,OAAO;CACP,SAAS;CACT,QAAQ;AACV"}
1
+ {"version":3,"file":"select.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,iBAAi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AC,UAAD;EACE,GAAI;EACJ,cAAY,MAAM,iBAAiB;EACnC,WAAW,GAAG,OAAO,OAAO,SAAS;EACrC,aAAU;EACV,UAAU,MAAM,YAAY,SAAS;EACrC,UAAU,UAAU;GAClB,SAAS,MAAM;GACf,MAAM,UAAU,KAAK;EACvB;EACK;EACL,MAAK;EAEJ;CACK,CAAA;AAEZ,CAAC;AAGD,MAAa,cAAc,WAA6C,SAAS,YAC/E,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAAC,OAAD;EACE,GAAI;EACJ,WAAW,GAAG,gBAAgB,CAAC,CAAC,OAAO,SAAS;EAChD,aAAU;EACL;CACN,CAAA;AAEL,CAAC;AAED,MAAa,gBAAgB,WAA+C,SAAS,cACnF,EAAE,WAAW,YAAY,WAAW,GAAG,SACvC,KACA;CACA,OACE,oBAAC,OAAD;EACE,GAAI;EACJ,aAAU;EACV,WAAW,GAAG,gBAAgB,CAAC,CAAC,SAAS,SAAS;EAClD,aAAU;EACL;EAEJ;CACE,CAAA;AAET,CAAC;AAED,MAAa,eAAe,WAA8C,SAAS,aACjF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAAC,OAAD;EACE,GAAI;EACJ,aAAU;EACV,WAAW,GAAG,gBAAgB,CAAC,CAAC,QAAQ,SAAS;EACjD,aAAU;EACL;CACN,CAAA;AAEL,CAAC;AAED,MAAaC,WAAS;CACpB,MAAMF;CACN,OAAO;CACP,SAAS;CACT,OAAO;CACP,MAAM;CACN,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,MAAM;CACN,MAAM;CACN,UAAU;CACV,eAAe;CACf,OAAO;CACP,YAAY;CACZ,WAAW;CACX,OAAO;CACP,OAAO;CACP,SAAS;CACT,QAAQ;AACV"}
@@ -1 +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,MAAM,UAAA,GAAA,MAAA,YAAA,OAA2B;EAC/B,QAAQ,CAAC,IAAI;CACf,GAAG,CAAC,MAAM,OAAO,CAAC;CAElB,MAAM,WAAA,GAAA,MAAA,QAAA,QACG;EAAE;EAAM;EAAS;CAAO,IAC/B;EAAC;EAAM;EAAS;CAAM,CACxB;CACA,MAAM,SAASA,gBAAAA,QAAQ,EAAE,KAAK,CAAC;CAC/B,MAAM,oBAAoBC,oBAAAA,oBAAoB,CAAC,CAAC;CAEhD,MAAM,UACJ,iB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,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,GAAG,SAEL,KACA;CACA,MAAM,CAAC,kBAAkB,wBAAA,GAAuBC,MAAAA,SAAAA,CAAS,WAAW;CACpE,MAAM,eAAe,mBAAmB,KAAA;CACxC,MAAM,OAAO,kBAAkB;CAE/B,MAAM,WAAA,GAAUC,MAAAA,YAAAA,EACb,aAAsB;EACrB,IAAI,CAAC,cACH,oBAAoB,QAAQ;EAG9B,eAAe,QAAQ;CACzB,GACA,CAAC,cAAc,YAAY,CAC7B;CAEA,MAAM,UAAA,GAASA,MAAAA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S,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;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,W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AE,cAAc,WAAW,WAAW,GAAG,SACzC,KACA;CACA,MAAM,SAAS,iBAAiB;CAEhC,OACE,oBAAC,OAAD;EACE,GAAI;EACJ,cAAY,aAAa;EACpB;EACL,WAAW,GAAG,OAAO,SAAS,SAAS;EACvC,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,gBAAgB,WAA4C,SAAS,cAChF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,MAAM,SAAS,iBAAiB;CAEhC,OACE,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
+ {"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: SidebarTogg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J,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: S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AI;EACC;EACL,WAAWC,gBAAAA,oBAAoB,gBAAgB,CAAC,CAAC,SAAS,SAAS;EACnE,aAAU;CACX,CAAA;AAEL,CAAC;AAID,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,mBAAA,GAAA,MAAA,WAAA,CACX,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAS,KAAK;CACrD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACD,sBAAAA,OAAW,WAAZ;EACE,GAAI;EACC;EACL,WAAWC,gBAAAA,oBAAoB,gBAAgB,CAAC,CAAC,WAAW,SAAS;EACrE,aAAU;CACX,CAAA;AAEL,CACF;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;AAED,MAAa,SAAS;CACpB,MAAM;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,SAC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,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,SAAgBA,aAAkF,EAChG,UACA,WACA,OAAO,MACP,GAAG,SACsB;CACzB,MAAM,SAAS,OAAO,EAAE,KAAK,CAAC;CAE9B,OACE,oBAAC,kBAAkB,UAAnB;EAA4B,OAAO;YACjC,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,WA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AAW;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};\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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"}