jaci-ui 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +95 -0
  3. package/dist/components/button-group/button-group.cjs +22 -0
  4. package/dist/components/button-group/button-group.cjs.map +1 -0
  5. package/dist/components/button-group/button-group.d.cts +12 -0
  6. package/dist/components/button-group/button-group.d.ts +12 -0
  7. package/dist/components/button-group/button-group.js +21 -0
  8. package/dist/components/button-group/button-group.js.map +1 -0
  9. package/dist/components/button-group/index.d.cts +2 -0
  10. package/dist/components/button-group/index.d.ts +2 -0
  11. package/dist/components/calendar/calendar.cjs +377 -0
  12. package/dist/components/calendar/calendar.cjs.map +1 -0
  13. package/dist/components/calendar/calendar.d.cts +56 -0
  14. package/dist/components/calendar/calendar.d.ts +56 -0
  15. package/dist/components/calendar/calendar.js +368 -0
  16. package/dist/components/calendar/calendar.js.map +1 -0
  17. package/dist/components/calendar/index.d.cts +2 -0
  18. package/dist/components/calendar/index.d.ts +2 -0
  19. package/dist/components/combobox/combobox.cjs +13 -1
  20. package/dist/components/combobox/combobox.cjs.map +1 -1
  21. package/dist/components/combobox/combobox.d.cts +7 -2
  22. package/dist/components/combobox/combobox.d.ts +7 -2
  23. package/dist/components/combobox/combobox.js +13 -2
  24. package/dist/components/combobox/combobox.js.map +1 -1
  25. package/dist/components/combobox/index.d.cts +2 -2
  26. package/dist/components/combobox/index.d.ts +2 -2
  27. package/dist/components/controls/input.cjs +26 -5
  28. package/dist/components/controls/input.cjs.map +1 -1
  29. package/dist/components/controls/input.d.cts +5 -2
  30. package/dist/components/controls/input.d.ts +5 -2
  31. package/dist/components/controls/input.js +28 -7
  32. package/dist/components/controls/input.js.map +1 -1
  33. package/dist/components/controls/textarea.cjs +26 -5
  34. package/dist/components/controls/textarea.cjs.map +1 -1
  35. package/dist/components/controls/textarea.d.cts +5 -2
  36. package/dist/components/controls/textarea.d.ts +5 -2
  37. package/dist/components/controls/textarea.js +28 -7
  38. package/dist/components/controls/textarea.js.map +1 -1
  39. package/dist/components/date-picker/date-picker.cjs +9 -9
  40. package/dist/components/date-picker/date-picker.cjs.map +1 -1
  41. package/dist/components/date-picker/date-picker.d.cts +3 -1
  42. package/dist/components/date-picker/date-picker.d.ts +3 -1
  43. package/dist/components/date-picker/date-picker.js +9 -9
  44. package/dist/components/date-picker/date-picker.js.map +1 -1
  45. package/dist/components/date-range-picker/date-range-picker.cjs +589 -0
  46. package/dist/components/date-range-picker/date-range-picker.cjs.map +1 -0
  47. package/dist/components/date-range-picker/date-range-picker.d.cts +134 -0
  48. package/dist/components/date-range-picker/date-range-picker.d.ts +134 -0
  49. package/dist/components/date-range-picker/date-range-picker.js +568 -0
  50. package/dist/components/date-range-picker/date-range-picker.js.map +1 -0
  51. package/dist/components/date-range-picker/index.d.cts +2 -0
  52. package/dist/components/date-range-picker/index.d.ts +2 -0
  53. package/dist/components/empty-state/empty-state.cjs +62 -0
  54. package/dist/components/empty-state/empty-state.cjs.map +1 -0
  55. package/dist/components/empty-state/empty-state.d.cts +18 -0
  56. package/dist/components/empty-state/empty-state.d.ts +18 -0
  57. package/dist/components/empty-state/empty-state.js +57 -0
  58. package/dist/components/empty-state/empty-state.js.map +1 -0
  59. package/dist/components/empty-state/index.d.cts +2 -0
  60. package/dist/components/empty-state/index.d.ts +2 -0
  61. package/dist/components/field/field.cjs +106 -11
  62. package/dist/components/field/field.cjs.map +1 -1
  63. package/dist/components/field/field.d.cts +22 -4
  64. package/dist/components/field/field.d.ts +22 -4
  65. package/dist/components/field/field.js +107 -13
  66. package/dist/components/field/field.js.map +1 -1
  67. package/dist/components/field/index.d.cts +2 -2
  68. package/dist/components/field/index.d.ts +2 -2
  69. package/dist/components/icon-button/icon-button.cjs +40 -0
  70. package/dist/components/icon-button/icon-button.cjs.map +1 -0
  71. package/dist/components/icon-button/icon-button.d.cts +12 -0
  72. package/dist/components/icon-button/icon-button.d.ts +12 -0
  73. package/dist/components/icon-button/icon-button.js +40 -0
  74. package/dist/components/icon-button/icon-button.js.map +1 -0
  75. package/dist/components/icon-button/index.d.cts +2 -0
  76. package/dist/components/icon-button/index.d.ts +2 -0
  77. package/dist/components/input-group/index.d.cts +2 -0
  78. package/dist/components/input-group/index.d.ts +2 -0
  79. package/dist/components/input-group/input-group.cjs +32 -0
  80. package/dist/components/input-group/input-group.cjs.map +1 -0
  81. package/dist/components/input-group/input-group.d.cts +15 -0
  82. package/dist/components/input-group/input-group.d.ts +15 -0
  83. package/dist/components/input-group/input-group.js +30 -0
  84. package/dist/components/input-group/input-group.js.map +1 -0
  85. package/dist/components/pin-input/index.d.cts +2 -0
  86. package/dist/components/pin-input/index.d.ts +2 -0
  87. package/dist/components/pin-input/pin-input.cjs +266 -0
  88. package/dist/components/pin-input/pin-input.cjs.map +1 -0
  89. package/dist/components/pin-input/pin-input.d.cts +46 -0
  90. package/dist/components/pin-input/pin-input.d.ts +46 -0
  91. package/dist/components/pin-input/pin-input.js +258 -0
  92. package/dist/components/pin-input/pin-input.js.map +1 -0
  93. package/dist/components/select/index.d.cts +2 -2
  94. package/dist/components/select/index.d.ts +2 -2
  95. package/dist/components/select/select.cjs +80 -3
  96. package/dist/components/select/select.cjs.map +1 -1
  97. package/dist/components/select/select.d.cts +18 -3
  98. package/dist/components/select/select.d.ts +18 -3
  99. package/dist/components/select/select.js +78 -5
  100. package/dist/components/select/select.js.map +1 -1
  101. package/dist/components/tags-input/tags-input.cjs +83 -5
  102. package/dist/components/tags-input/tags-input.cjs.map +1 -1
  103. package/dist/components/tags-input/tags-input.d.cts +3 -0
  104. package/dist/components/tags-input/tags-input.d.ts +3 -0
  105. package/dist/components/tags-input/tags-input.js +83 -5
  106. package/dist/components/tags-input/tags-input.js.map +1 -1
  107. package/dist/components/upload/index.d.cts +2 -2
  108. package/dist/components/upload/index.d.ts +2 -2
  109. package/dist/components/upload/upload.cjs +90 -10
  110. package/dist/components/upload/upload.cjs.map +1 -1
  111. package/dist/components/upload/upload.d.cts +25 -2
  112. package/dist/components/upload/upload.d.ts +25 -2
  113. package/dist/components/upload/upload.js +89 -11
  114. package/dist/components/upload/upload.js.map +1 -1
  115. package/dist/index.cjs +70 -0
  116. package/dist/index.d.cts +21 -5
  117. package/dist/index.d.ts +21 -5
  118. package/dist/index.js +13 -5
  119. package/dist/styled-system/recipes/button-group.cjs +30 -0
  120. package/dist/styled-system/recipes/button-group.cjs.map +1 -0
  121. package/dist/styled-system/recipes/button-group.js +30 -0
  122. package/dist/styled-system/recipes/button-group.js.map +1 -0
  123. package/dist/styled-system/recipes/calendar.cjs +43 -0
  124. package/dist/styled-system/recipes/calendar.cjs.map +1 -0
  125. package/dist/styled-system/recipes/calendar.js +43 -0
  126. package/dist/styled-system/recipes/calendar.js.map +1 -0
  127. package/dist/styled-system/recipes/combobox.cjs +1 -0
  128. package/dist/styled-system/recipes/combobox.cjs.map +1 -1
  129. package/dist/styled-system/recipes/combobox.js +1 -0
  130. package/dist/styled-system/recipes/combobox.js.map +1 -1
  131. package/dist/styled-system/recipes/date-range-picker.cjs +52 -0
  132. package/dist/styled-system/recipes/date-range-picker.cjs.map +1 -0
  133. package/dist/styled-system/recipes/date-range-picker.js +52 -0
  134. package/dist/styled-system/recipes/date-range-picker.js.map +1 -0
  135. package/dist/styled-system/recipes/empty-state.cjs +36 -0
  136. package/dist/styled-system/recipes/empty-state.cjs.map +1 -0
  137. package/dist/styled-system/recipes/empty-state.js +36 -0
  138. package/dist/styled-system/recipes/empty-state.js.map +1 -0
  139. package/dist/styled-system/recipes/icon-button.cjs +40 -0
  140. package/dist/styled-system/recipes/icon-button.cjs.map +1 -0
  141. package/dist/styled-system/recipes/icon-button.js +40 -0
  142. package/dist/styled-system/recipes/icon-button.js.map +1 -0
  143. package/dist/styled-system/recipes/input-group.cjs +30 -0
  144. package/dist/styled-system/recipes/input-group.cjs.map +1 -0
  145. package/dist/styled-system/recipes/input-group.js +30 -0
  146. package/dist/styled-system/recipes/input-group.js.map +1 -0
  147. package/dist/styled-system/recipes/pin-input.cjs +39 -0
  148. package/dist/styled-system/recipes/pin-input.cjs.map +1 -0
  149. package/dist/styled-system/recipes/pin-input.js +39 -0
  150. package/dist/styled-system/recipes/pin-input.js.map +1 -0
  151. package/dist/styled-system/recipes/select.cjs +5 -1
  152. package/dist/styled-system/recipes/select.cjs.map +1 -1
  153. package/dist/styled-system/recipes/select.js +5 -1
  154. package/dist/styled-system/recipes/select.js.map +1 -1
  155. package/dist/styled-system/recipes/upload.cjs +2 -0
  156. package/dist/styled-system/recipes/upload.cjs.map +1 -1
  157. package/dist/styled-system/recipes/upload.js +2 -0
  158. package/dist/styled-system/recipes/upload.js.map +1 -1
  159. package/dist/styles/theme.cjs +15 -0
  160. package/dist/styles/theme.cjs.map +1 -1
  161. package/dist/styles/theme.js +15 -0
  162. package/dist/styles/theme.js.map +1 -1
  163. package/dist/styles.css +901 -46
  164. package/dist/theme/index.d.cts +2 -0
  165. package/dist/theme/index.d.ts +2 -0
  166. package/dist/theme/theme-provider.cjs +86 -0
  167. package/dist/theme/theme-provider.cjs.map +1 -0
  168. package/dist/theme/theme-provider.d.cts +66 -0
  169. package/dist/theme/theme-provider.d.ts +66 -0
  170. package/dist/theme/theme-provider.js +85 -0
  171. package/dist/theme/theme-provider.js.map +1 -0
  172. package/package.json +3 -2
@@ -17,7 +17,7 @@ function useComboboxStyles() {
17
17
  * controlled `value`/`onValueChange` and uncontrolled `defaultValue` APIs,
18
18
  * object values, grouped items, filtering and multiple selection.
19
19
  */
20
- function ComboboxRoot({ children, className, errors, invalid, name, size = "md", ...props }) {
20
+ function ComboboxRoot({ children, className, errors, invalid, loading: _loading, name, size = "md", ...props }) {
21
21
  const fieldProps = {
22
22
  className: require_cx.cx(require_combobox.combobox({ size }).root, className),
23
23
  ...errors === void 0 ? {} : { errors },
@@ -155,6 +155,16 @@ const ComboboxClear = (0, react.forwardRef)(function ComboboxClear({ children =
155
155
  children
156
156
  });
157
157
  });
158
+ const ComboboxLoading = (0, react.forwardRef)(function ComboboxLoading({ children = "Loading…", className, ...props }, ref) {
159
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
160
+ ...props,
161
+ ref,
162
+ "aria-live": "polite",
163
+ className: require_cx.cx(useComboboxStyles().loading, className),
164
+ "data-slot": "combobox-loading",
165
+ children
166
+ });
167
+ });
158
168
  const ComboboxStatus = (0, react.forwardRef)(function ComboboxStatus({ className, ...props }, ref) {
159
169
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_combobox.Combobox.Status, {
160
170
  ...props,
@@ -188,6 +198,7 @@ const Combobox = {
188
198
  Group: ComboboxGroup,
189
199
  GroupLabel: ComboboxGroupLabel,
190
200
  Empty: ComboboxEmpty,
201
+ Loading: ComboboxLoading,
191
202
  Clear: ComboboxClear,
192
203
  Status: ComboboxStatus,
193
204
  Arrow: ComboboxArrow,
@@ -207,6 +218,7 @@ exports.ComboboxItem = ComboboxItem;
207
218
  exports.ComboboxItemIndicator = ComboboxItemIndicator;
208
219
  exports.ComboboxLabel = ComboboxLabel;
209
220
  exports.ComboboxList = ComboboxList;
221
+ exports.ComboboxLoading = ComboboxLoading;
210
222
  exports.ComboboxPopup = ComboboxPopup;
211
223
  exports.ComboboxPortal = ComboboxPortal;
212
224
  exports.ComboboxPositioner = ComboboxPositioner;
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.cjs","names":["combobox","cx","Field","BaseCombobox","BaseField","withRecipeClassName"],"sources":["../../../src/components/combobox/combobox.tsx"],"sourcesContent":["\"use client\";\n\nimport { Combobox as BaseCombobox } from \"@base-ui/react/combobox\";\nimport { forwardRef, createContext, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { ComboboxRoot as BaseComboboxRoot } from \"@base-ui/react/combobox\";\nimport { Field as BaseField } from \"@base-ui/react/field\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { combobox } from \"../../styled-system/recipes\";\nimport { Field } from \"../field\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type ComboboxSize = \"sm\" | \"md\" | \"lg\";\n\nconst ComboboxSizeContext = createContext<ComboboxSize>(\"md\");\n\nfunction useComboboxStyles() {\n return combobox({ size: useContext(ComboboxSizeContext) });\n}\n\nexport interface ComboboxRootProps<Value, Multiple extends boolean | undefined = false>\n extends Omit<BaseComboboxRoot.Props<Value, Multiple>, \"children\" | \"className\"> {\n /** Visual size shared by the input and trigger. */\n size?: ComboboxSize;\n /** Marks the field 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 searchable Base UI combobox with Field integration. It supports the\n * controlled `value`/`onValueChange` and uncontrolled `defaultValue` APIs,\n * object values, grouped items, filtering and multiple selection.\n */\nexport function ComboboxRoot<Value = string, Multiple extends boolean | undefined = false>({\n children,\n className,\n errors,\n invalid,\n name,\n size = \"md\",\n ...props\n}: ComboboxRootProps<Value, Multiple>) {\n const styles = combobox({ size });\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 <ComboboxSizeContext.Provider value={size}>\n <Field {...fieldProps}>\n <BaseCombobox.Root {...props} {...(name === undefined ? {} : { name })}>\n {children}\n </BaseCombobox.Root>\n </Field>\n </ComboboxSizeContext.Provider>\n );\n}\n\nexport type ComboboxLabelProps = ComponentPropsWithoutRef<typeof BaseField.Label>;\n\nexport const ComboboxLabel = forwardRef<HTMLElement, ComboboxLabelProps>(function ComboboxLabel(\n { className, ...props },\n ref,\n) {\n return (\n <BaseField.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().label, className)}\n data-slot=\"combobox-label\"\n />\n );\n});\n\nexport type ComboboxInputGroupProps = ComponentPropsWithoutRef<typeof BaseCombobox.InputGroup>;\n\nexport const ComboboxInputGroup = forwardRef<HTMLDivElement, ComboboxInputGroupProps>(\n function ComboboxInputGroup({ className, ...props }, ref) {\n return (\n <BaseCombobox.InputGroup\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().inputGroup, className)}\n data-slot=\"combobox-input-group\"\n />\n );\n },\n);\n\nexport type ComboboxInputProps = ComponentPropsWithoutRef<typeof BaseCombobox.Input>;\n\nexport const ComboboxInput = forwardRef<HTMLInputElement, ComboboxInputProps>(\n function ComboboxInput({ className, ...props }, ref) {\n return (\n <BaseCombobox.Input\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().input, className)}\n data-jaci-component=\"combobox\"\n data-slot=\"combobox-input\"\n />\n );\n },\n);\n\nexport type ComboboxTriggerProps = ComponentPropsWithoutRef<typeof BaseCombobox.Trigger>;\n\nexport const ComboboxTrigger = forwardRef<HTMLButtonElement, ComboboxTriggerProps>(\n function ComboboxTrigger({ className, ...props }, ref) {\n return (\n <BaseCombobox.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().trigger, className)}\n data-slot=\"combobox-trigger\"\n />\n );\n },\n);\n\nexport type ComboboxIconProps = ComponentPropsWithoutRef<typeof BaseCombobox.Icon>;\n\nexport const ComboboxIcon = forwardRef<HTMLSpanElement, ComboboxIconProps>(function ComboboxIcon(\n { children = \"⌄\", className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Icon\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().icon, className)}\n data-slot=\"combobox-icon\"\n >\n {children}\n </BaseCombobox.Icon>\n );\n});\n\nexport type ComboboxValueProps = ComponentPropsWithoutRef<typeof BaseCombobox.Value>;\nexport const ComboboxValue = BaseCombobox.Value;\n\nexport const ComboboxPortal = BaseCombobox.Portal;\n\nexport type ComboboxPositionerProps = ComponentPropsWithoutRef<typeof BaseCombobox.Positioner>;\nexport const ComboboxPositioner = forwardRef<HTMLDivElement, ComboboxPositionerProps>(\n function ComboboxPositioner({ className, ...props }, ref) {\n return (\n <BaseCombobox.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().positioner, className)}\n data-slot=\"combobox-positioner\"\n />\n );\n },\n);\n\nexport type ComboboxPopupProps = ComponentPropsWithoutRef<typeof BaseCombobox.Popup>;\nexport const ComboboxPopup = forwardRef<HTMLDivElement, ComboboxPopupProps>(function ComboboxPopup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().popup, className)}\n data-slot=\"combobox-popup\"\n />\n );\n});\n\nexport type ComboboxListProps = ComponentPropsWithoutRef<typeof BaseCombobox.List>;\nexport const ComboboxList = forwardRef<HTMLDivElement, ComboboxListProps>(function ComboboxList(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.List\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().list, className)}\n data-slot=\"combobox-list\"\n />\n );\n});\n\nexport type ComboboxItemProps = ComponentPropsWithoutRef<typeof BaseCombobox.Item>;\nexport const ComboboxItem = forwardRef<HTMLDivElement, ComboboxItemProps>(function ComboboxItem(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().item, className)}\n data-slot=\"combobox-item\"\n />\n );\n});\n\nexport type ComboboxItemIndicatorProps = ComponentPropsWithoutRef<\n typeof BaseCombobox.ItemIndicator\n>;\nexport const ComboboxItemIndicator = forwardRef<HTMLSpanElement, ComboboxItemIndicatorProps>(\n function ComboboxItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <BaseCombobox.ItemIndicator\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().itemIndicator, className)}\n data-slot=\"combobox-item-indicator\"\n >\n {children}\n </BaseCombobox.ItemIndicator>\n );\n },\n);\n\nexport type ComboboxGroupProps = ComponentPropsWithoutRef<typeof BaseCombobox.Group>;\nexport const ComboboxGroup = forwardRef<HTMLDivElement, ComboboxGroupProps>(function ComboboxGroup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Group\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().group, className)}\n data-slot=\"combobox-group\"\n />\n );\n});\n\nexport type ComboboxGroupLabelProps = ComponentPropsWithoutRef<typeof BaseCombobox.GroupLabel>;\nexport const ComboboxGroupLabel = forwardRef<HTMLDivElement, ComboboxGroupLabelProps>(\n function ComboboxGroupLabel({ className, ...props }, ref) {\n return (\n <BaseCombobox.GroupLabel\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().groupLabel, className)}\n data-slot=\"combobox-group-label\"\n />\n );\n },\n);\n\nexport type ComboboxEmptyProps = ComponentPropsWithoutRef<typeof BaseCombobox.Empty>;\nexport const ComboboxEmpty = forwardRef<HTMLDivElement, ComboboxEmptyProps>(function ComboboxEmpty(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Empty\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().empty, className)}\n data-slot=\"combobox-empty\"\n />\n );\n});\n\nexport type ComboboxClearProps = ComponentPropsWithoutRef<typeof BaseCombobox.Clear>;\nexport const ComboboxClear = forwardRef<HTMLButtonElement, ComboboxClearProps>(\n function ComboboxClear({ children = \"×\", className, ...props }, ref) {\n return (\n <BaseCombobox.Clear\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().clear, className)}\n data-slot=\"combobox-clear\"\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n >\n {children}\n </BaseCombobox.Clear>\n );\n },\n);\n\nexport type ComboboxStatusProps = ComponentPropsWithoutRef<typeof BaseCombobox.Status>;\nexport const ComboboxStatus = forwardRef<HTMLDivElement, ComboboxStatusProps>(\n function ComboboxStatus({ className, ...props }, ref) {\n return (\n <BaseCombobox.Status\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().status, className)}\n data-slot=\"combobox-status\"\n />\n );\n },\n);\n\nexport type ComboboxArrowProps = ComponentPropsWithoutRef<typeof BaseCombobox.Arrow>;\nexport const ComboboxArrow = forwardRef<HTMLDivElement, ComboboxArrowProps>(function ComboboxArrow(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Arrow\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().arrow, className)}\n data-slot=\"combobox-arrow\"\n />\n );\n});\n\nexport const Combobox = {\n Root: ComboboxRoot,\n Label: ComboboxLabel,\n InputGroup: ComboboxInputGroup,\n Input: ComboboxInput,\n Trigger: ComboboxTrigger,\n Icon: ComboboxIcon,\n Value: ComboboxValue,\n Portal: ComboboxPortal,\n Positioner: ComboboxPositioner,\n Popup: ComboboxPopup,\n List: ComboboxList,\n Item: ComboboxItem,\n ItemIndicator: ComboboxItemIndicator,\n Group: ComboboxGroup,\n GroupLabel: ComboboxGroupLabel,\n Empty: ComboboxEmpty,\n Clear: ComboboxClear,\n Status: ComboboxStatus,\n Arrow: ComboboxArrow,\n useFilter: BaseCombobox.useFilter,\n};\n"],"mappings":";;;;;;;;;;AAeA,MAAM,uBAAA,GAAA,MAAA,cAAA,CAAkD,IAAI;AAE5D,SAAS,oBAAoB;CAC3B,OAAOA,iBAAAA,SAAS,EAAE,OAAA,GAAA,MAAA,WAAA,CAAiB,mBAAmB,EAAE,CAAC;AAC3D;;;;;;AAmBA,SAAgB,aAA2E,EACzF,UACA,WACA,QACA,SACA,MACA,OAAO,MACP,GAAG,SACkC;CAErC,MAAM,aAAa;EACjB,WAAWC,WAAAA,GAFED,iBAAAA,SAAS,EAAE,KAAK,CAEV,CAAC,CAAC,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,iBAAA,GAAA,kBAAA,IAAA,CAAC,o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A,oBAAoB,kBAAkB,CAAC,CAAC,OAAO,SAAS;EACnE,aAAU;CACX,CAAA;AAEL,CAAC;AAGD,MAAa,iBAAA,GAAA,MAAA,WAAA,CACX,SAAS,cAAc,EAAE,WAAW,KAAK,WAAW,GAAG,SAAS,KAAK;CACnE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACF,wBAAAA,SAAa,OAAd;EACE,GAAI;EACC;EACL,WAAWE,gBAAAA,oBAAoB,kBAAkB,CAAC,CAAC,OAAO,SAAS;EACnE,aAAU;EACV,cAAY,MAAM,iBAAiB;EAElC;CACiB,CAAA;AAExB,CACF;AAGA,MAAa,kBAAA,GAAA,MAAA,WAAA,CACX,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CACpD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACF,wBAAAA,SAAa,QAAd;EACE,GAAI;EACC;EACL,WAAWE,gBAAAA,oBAAoB,kBAAkB,CAAC,CAAC,QAAQ,SAAS;EACpE,aAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,iBAAA,GAAA,MAAA,WAAA,CAA+D,SAAS,cACnF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACF,wBAAAA,SAAa,OAAd;EACE,GAAI;EACC;EACL,WAAWE,gBAAAA,oBAAoB,kBAAkB,CAAC,CAAC,OAAO,SAAS;EACnE,aAAU;CACX,CAAA;AAEL,CAAC;AAED,MAAa,WAAW;CACtB,MAAM;CACN,OAAO;CACP,YAAY;CACZ,OAAO;CACP,SAAS;CACT,MAAM;CACN,OAAO;CACP,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,MAAM;CACN,MAAM;CACN,eAAe;CACf,OAAO;CACP,YAAY;CACZ,OAAO;CACP,OAAO;CACP,QAAQ;CACR,OAAO;CACP,WAAWF,wBAAAA,SAAa;AAC1B"}
1
+ {"version":3,"file":"combobox.cjs","names":["combobox","cx","Field","BaseCombobox","BaseField","withRecipeClassName"],"sources":["../../../src/components/combobox/combobox.tsx"],"sourcesContent":["\"use client\";\n\nimport { Combobox as BaseCombobox } from \"@base-ui/react/combobox\";\nimport { forwardRef, createContext, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { ComboboxRoot as BaseComboboxRoot } from \"@base-ui/react/combobox\";\nimport { Field as BaseField } from \"@base-ui/react/field\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { combobox } from \"../../styled-system/recipes\";\nimport { Field } from \"../field\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type ComboboxSize = \"sm\" | \"md\" | \"lg\";\n\nconst ComboboxSizeContext = createContext<ComboboxSize>(\"md\");\n\nfunction useComboboxStyles() {\n return combobox({ size: useContext(ComboboxSizeContext) });\n}\n\nexport interface ComboboxRootProps<Value, Multiple extends boolean | undefined = false>\n extends Omit<BaseComboboxRoot.Props<Value, Multiple>, \"children\" | \"className\"> {\n /** Visual size shared by the input and trigger. */\n size?: ComboboxSize;\n /** Marks the field invalid when an external validator owns its state. */\n invalid?: boolean;\n /** Shows a loading state through the optional Loading slot. */\n loading?: 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 searchable Base UI combobox with Field integration. It supports the\n * controlled `value`/`onValueChange` and uncontrolled `defaultValue` APIs,\n * object values, grouped items, filtering and multiple selection.\n */\nexport function ComboboxRoot<Value = string, Multiple extends boolean | undefined = false>({\n children,\n className,\n errors,\n invalid,\n loading: _loading,\n name,\n size = \"md\",\n ...props\n}: ComboboxRootProps<Value, Multiple>) {\n const styles = combobox({ size });\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 <ComboboxSizeContext.Provider value={size}>\n <Field {...fieldProps}>\n <BaseCombobox.Root {...props} {...(name === undefined ? {} : { name })}>\n {children}\n </BaseCombobox.Root>\n </Field>\n </ComboboxSizeContext.Provider>\n );\n}\n\nexport type ComboboxLabelProps = ComponentPropsWithoutRef<typeof BaseField.Label>;\n\nexport const ComboboxLabel = forwardRef<HTMLElement, ComboboxLabelProps>(function ComboboxLabel(\n { className, ...props },\n ref,\n) {\n return (\n <BaseField.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().label, className)}\n data-slot=\"combobox-label\"\n />\n );\n});\n\nexport type ComboboxInputGroupProps = ComponentPropsWithoutRef<typeof BaseCombobox.InputGroup>;\n\nexport const ComboboxInputGroup = forwardRef<HTMLDivElement, ComboboxInputGroupProps>(\n function ComboboxInputGroup({ className, ...props }, ref) {\n return (\n <BaseCombobox.InputGroup\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().inputGroup, className)}\n data-slot=\"combobox-input-group\"\n />\n );\n },\n);\n\nexport type ComboboxInputProps = ComponentPropsWithoutRef<typeof BaseCombobox.Input>;\n\nexport const ComboboxInput = forwardRef<HTMLInputElement, ComboboxInputProps>(\n function ComboboxInput({ className, ...props }, ref) {\n return (\n <BaseCombobox.Input\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().input, className)}\n data-jaci-component=\"combobox\"\n data-slot=\"combobox-input\"\n />\n );\n },\n);\n\nexport type ComboboxTriggerProps = ComponentPropsWithoutRef<typeof BaseCombobox.Trigger>;\n\nexport const ComboboxTrigger = forwardRef<HTMLButtonElement, ComboboxTriggerProps>(\n function ComboboxTrigger({ className, ...props }, ref) {\n return (\n <BaseCombobox.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().trigger, className)}\n data-slot=\"combobox-trigger\"\n />\n );\n },\n);\n\nexport type ComboboxIconProps = ComponentPropsWithoutRef<typeof BaseCombobox.Icon>;\n\nexport const ComboboxIcon = forwardRef<HTMLSpanElement, ComboboxIconProps>(function ComboboxIcon(\n { children = \"⌄\", className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Icon\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().icon, className)}\n data-slot=\"combobox-icon\"\n >\n {children}\n </BaseCombobox.Icon>\n );\n});\n\nexport type ComboboxValueProps = ComponentPropsWithoutRef<typeof BaseCombobox.Value>;\nexport const ComboboxValue = BaseCombobox.Value;\n\nexport const ComboboxPortal = BaseCombobox.Portal;\n\nexport type ComboboxPositionerProps = ComponentPropsWithoutRef<typeof BaseCombobox.Positioner>;\nexport const ComboboxPositioner = forwardRef<HTMLDivElement, ComboboxPositionerProps>(\n function ComboboxPositioner({ className, ...props }, ref) {\n return (\n <BaseCombobox.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().positioner, className)}\n data-slot=\"combobox-positioner\"\n />\n );\n },\n);\n\nexport type ComboboxPopupProps = ComponentPropsWithoutRef<typeof BaseCombobox.Popup>;\nexport const ComboboxPopup = forwardRef<HTMLDivElement, ComboboxPopupProps>(function ComboboxPopup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().popup, className)}\n data-slot=\"combobox-popup\"\n />\n );\n});\n\nexport type ComboboxListProps = ComponentPropsWithoutRef<typeof BaseCombobox.List>;\nexport const ComboboxList = forwardRef<HTMLDivElement, ComboboxListProps>(function ComboboxList(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.List\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().list, className)}\n data-slot=\"combobox-list\"\n />\n );\n});\n\nexport type ComboboxItemProps = ComponentPropsWithoutRef<typeof BaseCombobox.Item>;\nexport const ComboboxItem = forwardRef<HTMLDivElement, ComboboxItemProps>(function ComboboxItem(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().item, className)}\n data-slot=\"combobox-item\"\n />\n );\n});\n\nexport type ComboboxItemIndicatorProps = ComponentPropsWithoutRef<\n typeof BaseCombobox.ItemIndicator\n>;\nexport const ComboboxItemIndicator = forwardRef<HTMLSpanElement, ComboboxItemIndicatorProps>(\n function ComboboxItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <BaseCombobox.ItemIndicator\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().itemIndicator, className)}\n data-slot=\"combobox-item-indicator\"\n >\n {children}\n </BaseCombobox.ItemIndicator>\n );\n },\n);\n\nexport type ComboboxGroupProps = ComponentPropsWithoutRef<typeof BaseCombobox.Group>;\nexport const ComboboxGroup = forwardRef<HTMLDivElement, ComboboxGroupProps>(function ComboboxGroup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Group\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().group, className)}\n data-slot=\"combobox-group\"\n />\n );\n});\n\nexport type ComboboxGroupLabelProps = ComponentPropsWithoutRef<typeof BaseCombobox.GroupLabel>;\nexport const ComboboxGroupLabel = forwardRef<HTMLDivElement, ComboboxGroupLabelProps>(\n function ComboboxGroupLabel({ className, ...props }, ref) {\n return (\n <BaseCombobox.GroupLabel\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().groupLabel, className)}\n data-slot=\"combobox-group-label\"\n />\n );\n },\n);\n\nexport type ComboboxEmptyProps = ComponentPropsWithoutRef<typeof BaseCombobox.Empty>;\nexport const ComboboxEmpty = forwardRef<HTMLDivElement, ComboboxEmptyProps>(function ComboboxEmpty(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Empty\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().empty, className)}\n data-slot=\"combobox-empty\"\n />\n );\n});\n\nexport type ComboboxClearProps = ComponentPropsWithoutRef<typeof BaseCombobox.Clear>;\nexport const ComboboxClear = forwardRef<HTMLButtonElement, ComboboxClearProps>(\n function ComboboxClear({ children = \"×\", className, ...props }, ref) {\n return (\n <BaseCombobox.Clear\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().clear, className)}\n data-slot=\"combobox-clear\"\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n >\n {children}\n </BaseCombobox.Clear>\n );\n },\n);\n\nexport type ComboboxLoadingProps = ComponentPropsWithoutRef<\"div\">;\nexport const ComboboxLoading = forwardRef<HTMLDivElement, ComboboxLoadingProps>(\n function ComboboxLoading({ children = \"Loading…\", className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n aria-live=\"polite\"\n className={cx(useComboboxStyles().loading, className)}\n data-slot=\"combobox-loading\"\n >\n {children}\n </div>\n );\n },\n);\n\nexport type ComboboxStatusProps = ComponentPropsWithoutRef<typeof BaseCombobox.Status>;\nexport const ComboboxStatus = forwardRef<HTMLDivElement, ComboboxStatusProps>(\n function ComboboxStatus({ className, ...props }, ref) {\n return (\n <BaseCombobox.Status\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().status, className)}\n data-slot=\"combobox-status\"\n />\n );\n },\n);\n\nexport type ComboboxArrowProps = ComponentPropsWithoutRef<typeof BaseCombobox.Arrow>;\nexport const ComboboxArrow = forwardRef<HTMLDivElement, ComboboxArrowProps>(function ComboboxArrow(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Arrow\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().arrow, className)}\n data-slot=\"combobox-arrow\"\n />\n );\n});\n\nexport const Combobox = {\n Root: ComboboxRoot,\n Label: ComboboxLabel,\n InputGroup: ComboboxInputGroup,\n Input: ComboboxInput,\n Trigger: ComboboxTrigger,\n Icon: ComboboxIcon,\n Value: ComboboxValue,\n Portal: ComboboxPortal,\n Positioner: ComboboxPositioner,\n Popup: ComboboxPopup,\n List: ComboboxList,\n Item: ComboboxItem,\n ItemIndicator: ComboboxItemIndicator,\n Group: ComboboxGroup,\n GroupLabel: ComboboxGroupLabel,\n Empty: ComboboxEmpty,\n Loading: ComboboxLoading,\n Clear: ComboboxClear,\n Status: ComboboxStatus,\n Ar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AAC,CAAC,SAAS,SAAS;EACpD,aAAU;EAET;CACE,CAAA;AAET,CACF;AAGA,MAAa,kBAAA,GAAA,MAAA,WAAA,CACX,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CACpD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACE,wBAAAA,SAAa,QAAd;EACE,GAAI;EACC;EACL,WAAWE,gBAAAA,oBAAoB,kBAAkB,CAAC,CAAC,QAAQ,SAAS;EACpE,aAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,iBAAA,GAAA,MAAA,WAAA,CAA+D,SAAS,cACnF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACF,wBAAAA,SAAa,OAAd;EACE,GAAI;EACC;EACL,WAAWE,gBAAAA,oBAAoB,kBAAkB,CAAC,CAAC,OAAO,SAAS;EACnE,aAAU;CACX,CAAA;AAEL,CAAC;AAED,MAAa,WAAW;CACtB,MAAM;CACN,OAAO;CACP,YAAY;CACZ,OAAO;CACP,SAAS;CACT,MAAM;CACN,OAAO;CACP,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,MAAM;CACN,MAAM;CACN,eAAe;CACf,OAAO;CACP,YAAY;CACZ,OAAO;CACP,SAAS;CACT,OAAO;CACP,QAAQ;CACR,OAAO;CACP,WAAWF,wBAAAA,SAAa;AAC1B"}
@@ -8,6 +8,8 @@ interface ComboboxRootProps<Value, Multiple extends boolean | undefined = false>
8
8
  size?: ComboboxSize;
9
9
  /** Marks the field invalid when an external validator owns its state. */
10
10
  invalid?: boolean;
11
+ /** Shows a loading state through the optional Loading slot. */
12
+ loading?: boolean;
11
13
  /** Direct error content rendered through the surrounding Field context. */
12
14
  errors?: ReactNode | ReactNode[];
13
15
  children?: ReactNode;
@@ -18,7 +20,7 @@ interface ComboboxRootProps<Value, Multiple extends boolean | undefined = false>
18
20
  * controlled `value`/`onValueChange` and uncontrolled `defaultValue` APIs,
19
21
  * object values, grouped items, filtering and multiple selection.
20
22
  */
21
- declare function ComboboxRoot$1<Value = string, Multiple extends boolean | undefined = false>({ children, className, errors, invalid, name, size, ...props }: ComboboxRootProps<Value, Multiple>): import("react").JSX.Element;
23
+ declare function ComboboxRoot$1<Value = string, Multiple extends boolean | undefined = false>({ children, className, errors, invalid, loading: _loading, name, size, ...props }: ComboboxRootProps<Value, Multiple>): import("react").JSX.Element;
22
24
  type ComboboxLabelProps = ComponentPropsWithoutRef<typeof Field.Label>;
23
25
  declare const ComboboxLabel: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").FieldLabelProps, "ref"> & import("react").RefAttributes<HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
24
26
  type ComboboxInputGroupProps = ComponentPropsWithoutRef<typeof Combobox.InputGroup>;
@@ -50,6 +52,8 @@ type ComboboxEmptyProps = ComponentPropsWithoutRef<typeof Combobox.Empty>;
50
52
  declare const ComboboxEmpty: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteEmptyProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
51
53
  type ComboboxClearProps = ComponentPropsWithoutRef<typeof Combobox.Clear>;
52
54
  declare const ComboboxClear: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteClearProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
55
+ type ComboboxLoadingProps = ComponentPropsWithoutRef<"div">;
56
+ declare const ComboboxLoading: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
53
57
  type ComboboxStatusProps = ComponentPropsWithoutRef<typeof Combobox.Status>;
54
58
  declare const ComboboxStatus: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteStatusProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
55
59
  type ComboboxArrowProps = ComponentPropsWithoutRef<typeof Combobox.Arrow>;
@@ -71,11 +75,12 @@ declare const Combobox$1: {
71
75
  Group: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
72
76
  GroupLabel: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteGroupLabelProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
73
77
  Empty: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteEmptyProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
78
+ Loading: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
74
79
  Clear: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteClearProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
75
80
  Status: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteStatusProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
76
81
  Arrow: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteArrowProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
77
82
  useFilter: typeof Combobox.useFilter;
78
83
  };
79
84
  //#endregion
80
- export { Combobox$1 as Combobox, ComboboxArrow, ComboboxArrowProps, ComboboxClear, ComboboxClearProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupLabel, ComboboxGroupLabelProps, ComboboxGroupProps, ComboboxIcon, ComboboxIconProps, ComboboxInput, ComboboxInputGroup, ComboboxInputGroupProps, ComboboxInputProps, ComboboxItem, ComboboxItemIndicator, ComboboxItemIndicatorProps, ComboboxItemProps, ComboboxLabel, ComboboxLabelProps, ComboboxList, ComboboxListProps, ComboboxPopup, ComboboxPopupProps, ComboboxPortal, ComboboxPositioner, ComboboxPositionerProps, ComboboxRoot$1 as ComboboxRoot, ComboboxRootProps, ComboboxSize, ComboboxStatus, ComboboxStatusProps, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxValueProps };
85
+ export { Combobox$1 as Combobox, ComboboxArrow, ComboboxArrowProps, ComboboxClear, ComboboxClearProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupLabel, ComboboxGroupLabelProps, ComboboxGroupProps, ComboboxIcon, ComboboxIconProps, ComboboxInput, ComboboxInputGroup, ComboboxInputGroupProps, ComboboxInputProps, ComboboxItem, ComboboxItemIndicator, ComboboxItemIndicatorProps, ComboboxItemProps, ComboboxLabel, ComboboxLabelProps, ComboboxList, ComboboxListProps, ComboboxLoading, ComboboxLoadingProps, ComboboxPopup, ComboboxPopupProps, ComboboxPortal, ComboboxPositioner, ComboboxPositionerProps, ComboboxRoot$1 as ComboboxRoot, ComboboxRootProps, ComboboxSize, ComboboxStatus, ComboboxStatusProps, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxValueProps };
81
86
  //# sourceMappingURL=combobox.d.cts.map
@@ -8,6 +8,8 @@ interface ComboboxRootProps<Value, Multiple extends boolean | undefined = false>
8
8
  size?: ComboboxSize;
9
9
  /** Marks the field invalid when an external validator owns its state. */
10
10
  invalid?: boolean;
11
+ /** Shows a loading state through the optional Loading slot. */
12
+ loading?: boolean;
11
13
  /** Direct error content rendered through the surrounding Field context. */
12
14
  errors?: ReactNode | ReactNode[];
13
15
  children?: ReactNode;
@@ -18,7 +20,7 @@ interface ComboboxRootProps<Value, Multiple extends boolean | undefined = false>
18
20
  * controlled `value`/`onValueChange` and uncontrolled `defaultValue` APIs,
19
21
  * object values, grouped items, filtering and multiple selection.
20
22
  */
21
- declare function ComboboxRoot$1<Value = string, Multiple extends boolean | undefined = false>({ children, className, errors, invalid, name, size, ...props }: ComboboxRootProps<Value, Multiple>): import("react").JSX.Element;
23
+ declare function ComboboxRoot$1<Value = string, Multiple extends boolean | undefined = false>({ children, className, errors, invalid, loading: _loading, name, size, ...props }: ComboboxRootProps<Value, Multiple>): import("react").JSX.Element;
22
24
  type ComboboxLabelProps = ComponentPropsWithoutRef<typeof Field.Label>;
23
25
  declare const ComboboxLabel: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").FieldLabelProps, "ref"> & import("react").RefAttributes<HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
24
26
  type ComboboxInputGroupProps = ComponentPropsWithoutRef<typeof Combobox.InputGroup>;
@@ -50,6 +52,8 @@ type ComboboxEmptyProps = ComponentPropsWithoutRef<typeof Combobox.Empty>;
50
52
  declare const ComboboxEmpty: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteEmptyProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
51
53
  type ComboboxClearProps = ComponentPropsWithoutRef<typeof Combobox.Clear>;
52
54
  declare const ComboboxClear: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteClearProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
55
+ type ComboboxLoadingProps = ComponentPropsWithoutRef<"div">;
56
+ declare const ComboboxLoading: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
53
57
  type ComboboxStatusProps = ComponentPropsWithoutRef<typeof Combobox.Status>;
54
58
  declare const ComboboxStatus: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteStatusProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
55
59
  type ComboboxArrowProps = ComponentPropsWithoutRef<typeof Combobox.Arrow>;
@@ -71,11 +75,12 @@ declare const Combobox$1: {
71
75
  Group: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
72
76
  GroupLabel: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteGroupLabelProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
73
77
  Empty: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteEmptyProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
78
+ Loading: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
74
79
  Clear: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteClearProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
75
80
  Status: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteStatusProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
76
81
  Arrow: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").AutocompleteArrowProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
77
82
  useFilter: typeof Combobox.useFilter;
78
83
  };
79
84
  //#endregion
80
- export { Combobox$1 as Combobox, ComboboxArrow, ComboboxArrowProps, ComboboxClear, ComboboxClearProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupLabel, ComboboxGroupLabelProps, ComboboxGroupProps, ComboboxIcon, ComboboxIconProps, ComboboxInput, ComboboxInputGroup, ComboboxInputGroupProps, ComboboxInputProps, ComboboxItem, ComboboxItemIndicator, ComboboxItemIndicatorProps, ComboboxItemProps, ComboboxLabel, ComboboxLabelProps, ComboboxList, ComboboxListProps, ComboboxPopup, ComboboxPopupProps, ComboboxPortal, ComboboxPositioner, ComboboxPositionerProps, ComboboxRoot$1 as ComboboxRoot, ComboboxRootProps, ComboboxSize, ComboboxStatus, ComboboxStatusProps, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxValueProps };
85
+ export { Combobox$1 as Combobox, ComboboxArrow, ComboboxArrowProps, ComboboxClear, ComboboxClearProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupLabel, ComboboxGroupLabelProps, ComboboxGroupProps, ComboboxIcon, ComboboxIconProps, ComboboxInput, ComboboxInputGroup, ComboboxInputGroupProps, ComboboxInputProps, ComboboxItem, ComboboxItemIndicator, ComboboxItemIndicatorProps, ComboboxItemProps, ComboboxLabel, ComboboxLabelProps, ComboboxList, ComboboxListProps, ComboboxLoading, ComboboxLoadingProps, ComboboxPopup, ComboboxPopupProps, ComboboxPortal, ComboboxPositioner, ComboboxPositionerProps, ComboboxRoot$1 as ComboboxRoot, ComboboxRootProps, ComboboxSize, ComboboxStatus, ComboboxStatusProps, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxValueProps };
81
86
  //# sourceMappingURL=combobox.d.ts.map
@@ -17,7 +17,7 @@ function useComboboxStyles() {
17
17
  * controlled `value`/`onValueChange` and uncontrolled `defaultValue` APIs,
18
18
  * object values, grouped items, filtering and multiple selection.
19
19
  */
20
- function ComboboxRoot$1({ children, className, errors, invalid, name, size = "md", ...props }) {
20
+ function ComboboxRoot$1({ children, className, errors, invalid, loading: _loading, name, size = "md", ...props }) {
21
21
  const fieldProps = {
22
22
  className: cx(combobox({ size }).root, className),
23
23
  ...errors === void 0 ? {} : { errors },
@@ -155,6 +155,16 @@ const ComboboxClear = forwardRef(function ComboboxClear({ children = "×", class
155
155
  children
156
156
  });
157
157
  });
158
+ const ComboboxLoading = forwardRef(function ComboboxLoading({ children = "Loading…", className, ...props }, ref) {
159
+ return /* @__PURE__ */ jsx("div", {
160
+ ...props,
161
+ ref,
162
+ "aria-live": "polite",
163
+ className: cx(useComboboxStyles().loading, className),
164
+ "data-slot": "combobox-loading",
165
+ children
166
+ });
167
+ });
158
168
  const ComboboxStatus = forwardRef(function ComboboxStatus({ className, ...props }, ref) {
159
169
  return /* @__PURE__ */ jsx(Combobox.Status, {
160
170
  ...props,
@@ -188,12 +198,13 @@ const Combobox$1 = {
188
198
  Group: ComboboxGroup,
189
199
  GroupLabel: ComboboxGroupLabel,
190
200
  Empty: ComboboxEmpty,
201
+ Loading: ComboboxLoading,
191
202
  Clear: ComboboxClear,
192
203
  Status: ComboboxStatus,
193
204
  Arrow: ComboboxArrow,
194
205
  useFilter: Combobox.useFilter
195
206
  };
196
207
  //#endregion
197
- export { Combobox$1 as Combobox, ComboboxArrow, ComboboxClear, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxIcon, ComboboxInput, ComboboxInputGroup, ComboboxItem, ComboboxItemIndicator, ComboboxLabel, ComboboxList, ComboboxPopup, ComboboxPortal, ComboboxPositioner, ComboboxRoot$1 as ComboboxRoot, ComboboxStatus, ComboboxTrigger, ComboboxValue };
208
+ export { Combobox$1 as Combobox, ComboboxArrow, ComboboxClear, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxIcon, ComboboxInput, ComboboxInputGroup, ComboboxItem, ComboboxItemIndicator, ComboboxLabel, ComboboxList, ComboboxLoading, ComboboxPopup, ComboboxPortal, ComboboxPositioner, ComboboxRoot$1 as ComboboxRoot, ComboboxStatus, ComboboxTrigger, ComboboxValue };
198
209
 
199
210
  //# sourceMappingURL=combobox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.js","names":["ComboboxRoot","Field","BaseCombobox","BaseField","Combobox"],"sources":["../../../src/components/combobox/combobox.tsx"],"sourcesContent":["\"use client\";\n\nimport { Combobox as BaseCombobox } from \"@base-ui/react/combobox\";\nimport { forwardRef, createContext, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { ComboboxRoot as BaseComboboxRoot } from \"@base-ui/react/combobox\";\nimport { Field as BaseField } from \"@base-ui/react/field\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { combobox } from \"../../styled-system/recipes\";\nimport { Field } from \"../field\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type ComboboxSize = \"sm\" | \"md\" | \"lg\";\n\nconst ComboboxSizeContext = createContext<ComboboxSize>(\"md\");\n\nfunction useComboboxStyles() {\n return combobox({ size: useContext(ComboboxSizeContext) });\n}\n\nexport interface ComboboxRootProps<Value, Multiple extends boolean | undefined = false>\n extends Omit<BaseComboboxRoot.Props<Value, Multiple>, \"children\" | \"className\"> {\n /** Visual size shared by the input and trigger. */\n size?: ComboboxSize;\n /** Marks the field 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 searchable Base UI combobox with Field integration. It supports the\n * controlled `value`/`onValueChange` and uncontrolled `defaultValue` APIs,\n * object values, grouped items, filtering and multiple selection.\n */\nexport function ComboboxRoot<Value = string, Multiple extends boolean | undefined = false>({\n children,\n className,\n errors,\n invalid,\n name,\n size = \"md\",\n ...props\n}: ComboboxRootProps<Value, Multiple>) {\n const styles = combobox({ size });\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 <ComboboxSizeContext.Provider value={size}>\n <Field {...fieldProps}>\n <BaseCombobox.Root {...props} {...(name === undefined ? {} : { name })}>\n {children}\n </BaseCombobox.Root>\n </Field>\n </ComboboxSizeContext.Provider>\n );\n}\n\nexport type ComboboxLabelProps = ComponentPropsWithoutRef<typeof BaseField.Label>;\n\nexport const ComboboxLabel = forwardRef<HTMLElement, ComboboxLabelProps>(function ComboboxLabel(\n { className, ...props },\n ref,\n) {\n return (\n <BaseField.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().label, className)}\n data-slot=\"combobox-label\"\n />\n );\n});\n\nexport type ComboboxInputGroupProps = ComponentPropsWithoutRef<typeof BaseCombobox.InputGroup>;\n\nexport const ComboboxInputGroup = forwardRef<HTMLDivElement, ComboboxInputGroupProps>(\n function ComboboxInputGroup({ className, ...props }, ref) {\n return (\n <BaseCombobox.InputGroup\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().inputGroup, className)}\n data-slot=\"combobox-input-group\"\n />\n );\n },\n);\n\nexport type ComboboxInputProps = ComponentPropsWithoutRef<typeof BaseCombobox.Input>;\n\nexport const ComboboxInput = forwardRef<HTMLInputElement, ComboboxInputProps>(\n function ComboboxInput({ className, ...props }, ref) {\n return (\n <BaseCombobox.Input\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().input, className)}\n data-jaci-component=\"combobox\"\n data-slot=\"combobox-input\"\n />\n );\n },\n);\n\nexport type ComboboxTriggerProps = ComponentPropsWithoutRef<typeof BaseCombobox.Trigger>;\n\nexport const ComboboxTrigger = forwardRef<HTMLButtonElement, ComboboxTriggerProps>(\n function ComboboxTrigger({ className, ...props }, ref) {\n return (\n <BaseCombobox.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().trigger, className)}\n data-slot=\"combobox-trigger\"\n />\n );\n },\n);\n\nexport type ComboboxIconProps = ComponentPropsWithoutRef<typeof BaseCombobox.Icon>;\n\nexport const ComboboxIcon = forwardRef<HTMLSpanElement, ComboboxIconProps>(function ComboboxIcon(\n { children = \"⌄\", className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Icon\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().icon, className)}\n data-slot=\"combobox-icon\"\n >\n {children}\n </BaseCombobox.Icon>\n );\n});\n\nexport type ComboboxValueProps = ComponentPropsWithoutRef<typeof BaseCombobox.Value>;\nexport const ComboboxValue = BaseCombobox.Value;\n\nexport const ComboboxPortal = BaseCombobox.Portal;\n\nexport type ComboboxPositionerProps = ComponentPropsWithoutRef<typeof BaseCombobox.Positioner>;\nexport const ComboboxPositioner = forwardRef<HTMLDivElement, ComboboxPositionerProps>(\n function ComboboxPositioner({ className, ...props }, ref) {\n return (\n <BaseCombobox.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().positioner, className)}\n data-slot=\"combobox-positioner\"\n />\n );\n },\n);\n\nexport type ComboboxPopupProps = ComponentPropsWithoutRef<typeof BaseCombobox.Popup>;\nexport const ComboboxPopup = forwardRef<HTMLDivElement, ComboboxPopupProps>(function ComboboxPopup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().popup, className)}\n data-slot=\"combobox-popup\"\n />\n );\n});\n\nexport type ComboboxListProps = ComponentPropsWithoutRef<typeof BaseCombobox.List>;\nexport const ComboboxList = forwardRef<HTMLDivElement, ComboboxListProps>(function ComboboxList(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.List\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().list, className)}\n data-slot=\"combobox-list\"\n />\n );\n});\n\nexport type ComboboxItemProps = ComponentPropsWithoutRef<typeof BaseCombobox.Item>;\nexport const ComboboxItem = forwardRef<HTMLDivElement, ComboboxItemProps>(function ComboboxItem(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().item, className)}\n data-slot=\"combobox-item\"\n />\n );\n});\n\nexport type ComboboxItemIndicatorProps = ComponentPropsWithoutRef<\n typeof BaseCombobox.ItemIndicator\n>;\nexport const ComboboxItemIndicator = forwardRef<HTMLSpanElement, ComboboxItemIndicatorProps>(\n function ComboboxItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <BaseCombobox.ItemIndicator\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().itemIndicator, className)}\n data-slot=\"combobox-item-indicator\"\n >\n {children}\n </BaseCombobox.ItemIndicator>\n );\n },\n);\n\nexport type ComboboxGroupProps = ComponentPropsWithoutRef<typeof BaseCombobox.Group>;\nexport const ComboboxGroup = forwardRef<HTMLDivElement, ComboboxGroupProps>(function ComboboxGroup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Group\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().group, className)}\n data-slot=\"combobox-group\"\n />\n );\n});\n\nexport type ComboboxGroupLabelProps = ComponentPropsWithoutRef<typeof BaseCombobox.GroupLabel>;\nexport const ComboboxGroupLabel = forwardRef<HTMLDivElement, ComboboxGroupLabelProps>(\n function ComboboxGroupLabel({ className, ...props }, ref) {\n return (\n <BaseCombobox.GroupLabel\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().groupLabel, className)}\n data-slot=\"combobox-group-label\"\n />\n );\n },\n);\n\nexport type ComboboxEmptyProps = ComponentPropsWithoutRef<typeof BaseCombobox.Empty>;\nexport const ComboboxEmpty = forwardRef<HTMLDivElement, ComboboxEmptyProps>(function ComboboxEmpty(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Empty\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().empty, className)}\n data-slot=\"combobox-empty\"\n />\n );\n});\n\nexport type ComboboxClearProps = ComponentPropsWithoutRef<typeof BaseCombobox.Clear>;\nexport const ComboboxClear = forwardRef<HTMLButtonElement, ComboboxClearProps>(\n function ComboboxClear({ children = \"×\", className, ...props }, ref) {\n return (\n <BaseCombobox.Clear\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().clear, className)}\n data-slot=\"combobox-clear\"\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n >\n {children}\n </BaseCombobox.Clear>\n );\n },\n);\n\nexport type ComboboxStatusProps = ComponentPropsWithoutRef<typeof BaseCombobox.Status>;\nexport const ComboboxStatus = forwardRef<HTMLDivElement, ComboboxStatusProps>(\n function ComboboxStatus({ className, ...props }, ref) {\n return (\n <BaseCombobox.Status\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().status, className)}\n data-slot=\"combobox-status\"\n />\n );\n },\n);\n\nexport type ComboboxArrowProps = ComponentPropsWithoutRef<typeof BaseCombobox.Arrow>;\nexport const ComboboxArrow = forwardRef<HTMLDivElement, ComboboxArrowProps>(function ComboboxArrow(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Arrow\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().arrow, className)}\n data-slot=\"combobox-arrow\"\n />\n );\n});\n\nexport const Combobox = {\n Root: ComboboxRoot,\n Label: ComboboxLabel,\n InputGroup: ComboboxInputGroup,\n Input: ComboboxInput,\n Trigger: ComboboxTrigger,\n Icon: ComboboxIcon,\n Value: ComboboxValue,\n Portal: ComboboxPortal,\n Positioner: ComboboxPositioner,\n Popup: ComboboxPopup,\n List: ComboboxList,\n Item: ComboboxItem,\n ItemIndicator: ComboboxItemIndicator,\n Group: ComboboxGroup,\n GroupLabel: ComboboxGroupLabel,\n Empty: ComboboxEmpty,\n Clear: ComboboxClear,\n Status: ComboboxStatus,\n Arrow: ComboboxArrow,\n useFilter: BaseCombobox.useFilter,\n};\n"],"mappings":";;;;;;;;;;AAeA,MAAM,sBAAsB,cAA4B,IAAI;AAE5D,SAAS,oBAAoB;CAC3B,OAAO,SAAS,EAAE,MAAM,WAAW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,QAAQ,SAAS;EACpE,aAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,gBAAgB,WAA+C,SAAS,cACnF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAACA,SAAa,OAAd;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,kBAAkB,CAAC,CAAC,OAAO,SAAS;EACnE,aAAU;CACX,CAAA;AAEL,CAAC;AAED,MAAaE,aAAW;CACtB,MAAMJ;CACN,OAAO;CACP,YAAY;CACZ,OAAO;CACP,SAAS;CACT,MAAM;CACN,OAAO;CACP,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,MAAM;CACN,MAAM;CACN,eAAe;CACf,OAAO;CACP,YAAY;CACZ,OAAO;CACP,OAAO;CACP,QAAQ;CACR,OAAO;CACP,WAAWE,SAAa;AAC1B"}
1
+ {"version":3,"file":"combobox.js","names":["ComboboxRoot","Field","BaseCombobox","BaseField","Combobox"],"sources":["../../../src/components/combobox/combobox.tsx"],"sourcesContent":["\"use client\";\n\nimport { Combobox as BaseCombobox } from \"@base-ui/react/combobox\";\nimport { forwardRef, createContext, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { ComboboxRoot as BaseComboboxRoot } from \"@base-ui/react/combobox\";\nimport { Field as BaseField } from \"@base-ui/react/field\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { combobox } from \"../../styled-system/recipes\";\nimport { Field } from \"../field\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type ComboboxSize = \"sm\" | \"md\" | \"lg\";\n\nconst ComboboxSizeContext = createContext<ComboboxSize>(\"md\");\n\nfunction useComboboxStyles() {\n return combobox({ size: useContext(ComboboxSizeContext) });\n}\n\nexport interface ComboboxRootProps<Value, Multiple extends boolean | undefined = false>\n extends Omit<BaseComboboxRoot.Props<Value, Multiple>, \"children\" | \"className\"> {\n /** Visual size shared by the input and trigger. */\n size?: ComboboxSize;\n /** Marks the field invalid when an external validator owns its state. */\n invalid?: boolean;\n /** Shows a loading state through the optional Loading slot. */\n loading?: 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 searchable Base UI combobox with Field integration. It supports the\n * controlled `value`/`onValueChange` and uncontrolled `defaultValue` APIs,\n * object values, grouped items, filtering and multiple selection.\n */\nexport function ComboboxRoot<Value = string, Multiple extends boolean | undefined = false>({\n children,\n className,\n errors,\n invalid,\n loading: _loading,\n name,\n size = \"md\",\n ...props\n}: ComboboxRootProps<Value, Multiple>) {\n const styles = combobox({ size });\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 <ComboboxSizeContext.Provider value={size}>\n <Field {...fieldProps}>\n <BaseCombobox.Root {...props} {...(name === undefined ? {} : { name })}>\n {children}\n </BaseCombobox.Root>\n </Field>\n </ComboboxSizeContext.Provider>\n );\n}\n\nexport type ComboboxLabelProps = ComponentPropsWithoutRef<typeof BaseField.Label>;\n\nexport const ComboboxLabel = forwardRef<HTMLElement, ComboboxLabelProps>(function ComboboxLabel(\n { className, ...props },\n ref,\n) {\n return (\n <BaseField.Label\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().label, className)}\n data-slot=\"combobox-label\"\n />\n );\n});\n\nexport type ComboboxInputGroupProps = ComponentPropsWithoutRef<typeof BaseCombobox.InputGroup>;\n\nexport const ComboboxInputGroup = forwardRef<HTMLDivElement, ComboboxInputGroupProps>(\n function ComboboxInputGroup({ className, ...props }, ref) {\n return (\n <BaseCombobox.InputGroup\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().inputGroup, className)}\n data-slot=\"combobox-input-group\"\n />\n );\n },\n);\n\nexport type ComboboxInputProps = ComponentPropsWithoutRef<typeof BaseCombobox.Input>;\n\nexport const ComboboxInput = forwardRef<HTMLInputElement, ComboboxInputProps>(\n function ComboboxInput({ className, ...props }, ref) {\n return (\n <BaseCombobox.Input\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().input, className)}\n data-jaci-component=\"combobox\"\n data-slot=\"combobox-input\"\n />\n );\n },\n);\n\nexport type ComboboxTriggerProps = ComponentPropsWithoutRef<typeof BaseCombobox.Trigger>;\n\nexport const ComboboxTrigger = forwardRef<HTMLButtonElement, ComboboxTriggerProps>(\n function ComboboxTrigger({ className, ...props }, ref) {\n return (\n <BaseCombobox.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().trigger, className)}\n data-slot=\"combobox-trigger\"\n />\n );\n },\n);\n\nexport type ComboboxIconProps = ComponentPropsWithoutRef<typeof BaseCombobox.Icon>;\n\nexport const ComboboxIcon = forwardRef<HTMLSpanElement, ComboboxIconProps>(function ComboboxIcon(\n { children = \"⌄\", className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Icon\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().icon, className)}\n data-slot=\"combobox-icon\"\n >\n {children}\n </BaseCombobox.Icon>\n );\n});\n\nexport type ComboboxValueProps = ComponentPropsWithoutRef<typeof BaseCombobox.Value>;\nexport const ComboboxValue = BaseCombobox.Value;\n\nexport const ComboboxPortal = BaseCombobox.Portal;\n\nexport type ComboboxPositionerProps = ComponentPropsWithoutRef<typeof BaseCombobox.Positioner>;\nexport const ComboboxPositioner = forwardRef<HTMLDivElement, ComboboxPositionerProps>(\n function ComboboxPositioner({ className, ...props }, ref) {\n return (\n <BaseCombobox.Positioner\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().positioner, className)}\n data-slot=\"combobox-positioner\"\n />\n );\n },\n);\n\nexport type ComboboxPopupProps = ComponentPropsWithoutRef<typeof BaseCombobox.Popup>;\nexport const ComboboxPopup = forwardRef<HTMLDivElement, ComboboxPopupProps>(function ComboboxPopup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().popup, className)}\n data-slot=\"combobox-popup\"\n />\n );\n});\n\nexport type ComboboxListProps = ComponentPropsWithoutRef<typeof BaseCombobox.List>;\nexport const ComboboxList = forwardRef<HTMLDivElement, ComboboxListProps>(function ComboboxList(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.List\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().list, className)}\n data-slot=\"combobox-list\"\n />\n );\n});\n\nexport type ComboboxItemProps = ComponentPropsWithoutRef<typeof BaseCombobox.Item>;\nexport const ComboboxItem = forwardRef<HTMLDivElement, ComboboxItemProps>(function ComboboxItem(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().item, className)}\n data-slot=\"combobox-item\"\n />\n );\n});\n\nexport type ComboboxItemIndicatorProps = ComponentPropsWithoutRef<\n typeof BaseCombobox.ItemIndicator\n>;\nexport const ComboboxItemIndicator = forwardRef<HTMLSpanElement, ComboboxItemIndicatorProps>(\n function ComboboxItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <BaseCombobox.ItemIndicator\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().itemIndicator, className)}\n data-slot=\"combobox-item-indicator\"\n >\n {children}\n </BaseCombobox.ItemIndicator>\n );\n },\n);\n\nexport type ComboboxGroupProps = ComponentPropsWithoutRef<typeof BaseCombobox.Group>;\nexport const ComboboxGroup = forwardRef<HTMLDivElement, ComboboxGroupProps>(function ComboboxGroup(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Group\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().group, className)}\n data-slot=\"combobox-group\"\n />\n );\n});\n\nexport type ComboboxGroupLabelProps = ComponentPropsWithoutRef<typeof BaseCombobox.GroupLabel>;\nexport const ComboboxGroupLabel = forwardRef<HTMLDivElement, ComboboxGroupLabelProps>(\n function ComboboxGroupLabel({ className, ...props }, ref) {\n return (\n <BaseCombobox.GroupLabel\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().groupLabel, className)}\n data-slot=\"combobox-group-label\"\n />\n );\n },\n);\n\nexport type ComboboxEmptyProps = ComponentPropsWithoutRef<typeof BaseCombobox.Empty>;\nexport const ComboboxEmpty = forwardRef<HTMLDivElement, ComboboxEmptyProps>(function ComboboxEmpty(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Empty\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().empty, className)}\n data-slot=\"combobox-empty\"\n />\n );\n});\n\nexport type ComboboxClearProps = ComponentPropsWithoutRef<typeof BaseCombobox.Clear>;\nexport const ComboboxClear = forwardRef<HTMLButtonElement, ComboboxClearProps>(\n function ComboboxClear({ children = \"×\", className, ...props }, ref) {\n return (\n <BaseCombobox.Clear\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().clear, className)}\n data-slot=\"combobox-clear\"\n aria-label={props[\"aria-label\"] ?? \"Clear selection\"}\n >\n {children}\n </BaseCombobox.Clear>\n );\n },\n);\n\nexport type ComboboxLoadingProps = ComponentPropsWithoutRef<\"div\">;\nexport const ComboboxLoading = forwardRef<HTMLDivElement, ComboboxLoadingProps>(\n function ComboboxLoading({ children = \"Loading…\", className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n aria-live=\"polite\"\n className={cx(useComboboxStyles().loading, className)}\n data-slot=\"combobox-loading\"\n >\n {children}\n </div>\n );\n },\n);\n\nexport type ComboboxStatusProps = ComponentPropsWithoutRef<typeof BaseCombobox.Status>;\nexport const ComboboxStatus = forwardRef<HTMLDivElement, ComboboxStatusProps>(\n function ComboboxStatus({ className, ...props }, ref) {\n return (\n <BaseCombobox.Status\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().status, className)}\n data-slot=\"combobox-status\"\n />\n );\n },\n);\n\nexport type ComboboxArrowProps = ComponentPropsWithoutRef<typeof BaseCombobox.Arrow>;\nexport const ComboboxArrow = forwardRef<HTMLDivElement, ComboboxArrowProps>(function ComboboxArrow(\n { className, ...props },\n ref,\n) {\n return (\n <BaseCombobox.Arrow\n {...props}\n ref={ref}\n className={withRecipeClassName(useComboboxStyles().arrow, className)}\n data-slot=\"combobox-arrow\"\n />\n );\n});\n\nexport const Combobox = {\n Root: ComboboxRoot,\n Label: ComboboxLabel,\n InputGroup: ComboboxInputGroup,\n Input: ComboboxInput,\n Trigger: ComboboxTrigger,\n Icon: ComboboxIcon,\n Value: ComboboxValue,\n Portal: ComboboxPortal,\n Positioner: ComboboxPositioner,\n Popup: ComboboxPopup,\n List: ComboboxList,\n Item: ComboboxItem,\n ItemIndicator: ComboboxItemIndicator,\n Group: ComboboxGroup,\n GroupLabel: ComboboxGroupLabel,\n Empty: ComboboxEmpty,\n Loading: ComboboxLoading,\n Clear: ComboboxClear,\n Status: ComboboxStatus,\n Arrow: ComboboxArrow,\n useFilter: BaseCombobox.useFilter,\n};\n"],"mappings":";;;;;;;;;;AAeA,MAAM,sBAAsB,cAA4B,IAAI;AAE5D,SAAS,oBAAoB;CAC3B,OAAO,SAAS,EAAE,MAAM,WAAW,mBAAmB,EAAE,CAAC;AAC3D;;;;;;AAqBA,SAAgBA,eAA2E,EACzF,UACA,WACA,QACA,SACA,SAAS,UACT,MACA,OAAO,MACP,GAAG,SACkC;CAErC,MAAM,aAAa;EACjB,WAAW,GAFE,SAAS,EAAE,KAAK,CAEV,CAAC,CAAC,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,oBAAC,oBAAoB,UAArB;EAA8B,OAAO;YACnC,oBAACC,SAAD;GAAO,GAAI;aACT,oBAACC,SAAa,MAAd;IAAmB,GAAI;IAAO,GAAK,SAA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AAMJ;CACN,OAAO;CACP,YAAY;CACZ,OAAO;CACP,SAAS;CACT,MAAM;CACN,OAAO;CACP,QAAQ;CACR,YAAY;CACZ,OAAO;CACP,MAAM;CACN,MAAM;CACN,eAAe;CACf,OAAO;CACP,YAAY;CACZ,OAAO;CACP,SAAS;CACT,OAAO;CACP,QAAQ;CACR,OAAO;CACP,WAAWE,SAAa;AAC1B"}
@@ -1,2 +1,2 @@
1
- import { Combobox, ComboboxArrow, ComboboxArrowProps, ComboboxClear, ComboboxClearProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupLabel, ComboboxGroupLabelProps, ComboboxGroupProps, ComboboxIcon, ComboboxIconProps, ComboboxInput, ComboboxInputGroup, ComboboxInputGroupProps, ComboboxInputProps, ComboboxItem, ComboboxItemIndicator, ComboboxItemIndicatorProps, ComboboxItemProps, ComboboxLabel, ComboboxLabelProps, ComboboxList, ComboboxListProps, ComboboxPopup, ComboboxPopupProps, ComboboxPortal, ComboboxPositioner, ComboboxPositionerProps, ComboboxRoot, ComboboxRootProps, ComboboxSize, ComboboxStatus, ComboboxStatusProps, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxValueProps } from "./combobox.cjs";
2
- export { Combobox, ComboboxArrow, type ComboboxArrowProps, ComboboxClear, type ComboboxClearProps, ComboboxEmpty, type ComboboxEmptyProps, ComboboxGroup, ComboboxGroupLabel, type ComboboxGroupLabelProps, type ComboboxGroupProps, ComboboxIcon, type ComboboxIconProps, ComboboxInput, ComboboxInputGroup, type ComboboxInputGroupProps, type ComboboxInputProps, ComboboxItem, ComboboxItemIndicator, type ComboboxItemIndicatorProps, type ComboboxItemProps, ComboboxLabel, type ComboboxLabelProps, ComboboxList, type ComboboxListProps, ComboboxPopup, type ComboboxPopupProps, ComboboxPortal, ComboboxPositioner, type ComboboxPositionerProps, ComboboxRoot, type ComboboxRootProps, type ComboboxSize, ComboboxStatus, type ComboboxStatusProps, ComboboxTrigger, type ComboboxTriggerProps, ComboboxValue, type ComboboxValueProps };
1
+ import { Combobox, ComboboxArrow, ComboboxArrowProps, ComboboxClear, ComboboxClearProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupLabel, ComboboxGroupLabelProps, ComboboxGroupProps, ComboboxIcon, ComboboxIconProps, ComboboxInput, ComboboxInputGroup, ComboboxInputGroupProps, ComboboxInputProps, ComboboxItem, ComboboxItemIndicator, ComboboxItemIndicatorProps, ComboboxItemProps, ComboboxLabel, ComboboxLabelProps, ComboboxList, ComboboxListProps, ComboboxLoading, ComboboxLoadingProps, ComboboxPopup, ComboboxPopupProps, ComboboxPortal, ComboboxPositioner, ComboboxPositionerProps, ComboboxRoot, ComboboxRootProps, ComboboxSize, ComboboxStatus, ComboboxStatusProps, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxValueProps } from "./combobox.cjs";
2
+ export { Combobox, ComboboxArrow, type ComboboxArrowProps, ComboboxClear, type ComboboxClearProps, ComboboxEmpty, type ComboboxEmptyProps, ComboboxGroup, ComboboxGroupLabel, type ComboboxGroupLabelProps, type ComboboxGroupProps, ComboboxIcon, type ComboboxIconProps, ComboboxInput, ComboboxInputGroup, type ComboboxInputGroupProps, type ComboboxInputProps, ComboboxItem, ComboboxItemIndicator, type ComboboxItemIndicatorProps, type ComboboxItemProps, ComboboxLabel, type ComboboxLabelProps, ComboboxList, type ComboboxListProps, ComboboxLoading, type ComboboxLoadingProps, ComboboxPopup, type ComboboxPopupProps, ComboboxPortal, ComboboxPositioner, type ComboboxPositionerProps, ComboboxRoot, type ComboboxRootProps, type ComboboxSize, ComboboxStatus, type ComboboxStatusProps, ComboboxTrigger, type ComboboxTriggerProps, ComboboxValue, type ComboboxValueProps };
@@ -1,2 +1,2 @@
1
- import { Combobox, ComboboxArrow, ComboboxArrowProps, ComboboxClear, ComboboxClearProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupLabel, ComboboxGroupLabelProps, ComboboxGroupProps, ComboboxIcon, ComboboxIconProps, ComboboxInput, ComboboxInputGroup, ComboboxInputGroupProps, ComboboxInputProps, ComboboxItem, ComboboxItemIndicator, ComboboxItemIndicatorProps, ComboboxItemProps, ComboboxLabel, ComboboxLabelProps, ComboboxList, ComboboxListProps, ComboboxPopup, ComboboxPopupProps, ComboboxPortal, ComboboxPositioner, ComboboxPositionerProps, ComboboxRoot, ComboboxRootProps, ComboboxSize, ComboboxStatus, ComboboxStatusProps, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxValueProps } from "./combobox.js";
2
- export { Combobox, ComboboxArrow, type ComboboxArrowProps, ComboboxClear, type ComboboxClearProps, ComboboxEmpty, type ComboboxEmptyProps, ComboboxGroup, ComboboxGroupLabel, type ComboboxGroupLabelProps, type ComboboxGroupProps, ComboboxIcon, type ComboboxIconProps, ComboboxInput, ComboboxInputGroup, type ComboboxInputGroupProps, type ComboboxInputProps, ComboboxItem, ComboboxItemIndicator, type ComboboxItemIndicatorProps, type ComboboxItemProps, ComboboxLabel, type ComboboxLabelProps, ComboboxList, type ComboboxListProps, ComboboxPopup, type ComboboxPopupProps, ComboboxPortal, ComboboxPositioner, type ComboboxPositionerProps, ComboboxRoot, type ComboboxRootProps, type ComboboxSize, ComboboxStatus, type ComboboxStatusProps, ComboboxTrigger, type ComboboxTriggerProps, ComboboxValue, type ComboboxValueProps };
1
+ import { Combobox, ComboboxArrow, ComboboxArrowProps, ComboboxClear, ComboboxClearProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupLabel, ComboboxGroupLabelProps, ComboboxGroupProps, ComboboxIcon, ComboboxIconProps, ComboboxInput, ComboboxInputGroup, ComboboxInputGroupProps, ComboboxInputProps, ComboboxItem, ComboboxItemIndicator, ComboboxItemIndicatorProps, ComboboxItemProps, ComboboxLabel, ComboboxLabelProps, ComboboxList, ComboboxListProps, ComboboxLoading, ComboboxLoadingProps, ComboboxPopup, ComboboxPopupProps, ComboboxPortal, ComboboxPositioner, ComboboxPositionerProps, ComboboxRoot, ComboboxRootProps, ComboboxSize, ComboboxStatus, ComboboxStatusProps, ComboboxTrigger, ComboboxTriggerProps, ComboboxValue, ComboboxValueProps } from "./combobox.js";
2
+ export { Combobox, ComboboxArrow, type ComboboxArrowProps, ComboboxClear, type ComboboxClearProps, ComboboxEmpty, type ComboboxEmptyProps, ComboboxGroup, ComboboxGroupLabel, type ComboboxGroupLabelProps, type ComboboxGroupProps, ComboboxIcon, type ComboboxIconProps, ComboboxInput, ComboboxInputGroup, type ComboboxInputGroupProps, type ComboboxInputProps, ComboboxItem, ComboboxItemIndicator, type ComboboxItemIndicatorProps, type ComboboxItemProps, ComboboxLabel, type ComboboxLabelProps, ComboboxList, type ComboboxListProps, ComboboxLoading, type ComboboxLoadingProps, ComboboxPopup, type ComboboxPopupProps, ComboboxPortal, ComboboxPositioner, type ComboboxPositionerProps, ComboboxRoot, type ComboboxRootProps, type ComboboxSize, ComboboxStatus, type ComboboxStatusProps, ComboboxTrigger, type ComboboxTriggerProps, ComboboxValue, type ComboboxValueProps };
@@ -1,27 +1,48 @@
1
1
  "use client";
2
2
  const require_cx = require("../../styled-system/css/cx.cjs");
3
3
  const require_input = require("../../styled-system/recipes/input.cjs");
4
+ const require_index = require("../layout/index.cjs");
4
5
  const require_field = require("../field/field.cjs");
6
+ const require_input_group = require("../input-group/input-group.cjs");
5
7
  let react = require("react");
6
8
  let react_jsx_runtime = require("react/jsx-runtime");
7
- let _base_ui_react_field = require("@base-ui/react/field");
8
9
  //#region src/components/controls/input.tsx
9
- const Input = (0, react.forwardRef)(function Input({ className, size = "md", ...props }, ref) {
10
+ const Input = (0, react.forwardRef)(function Input({ className, loading = false, prefix, size = "md", suffix, ...props }, ref) {
10
11
  const { insideField } = require_field.useFieldState();
11
12
  const controlProps = {
12
13
  ...props,
14
+ "aria-busy": loading || void 0,
13
15
  className: require_cx.cx(require_input.input({ size }), className),
14
16
  "data-jaci-component": "input",
17
+ "data-loading": loading || void 0,
15
18
  "data-slot": "input"
16
19
  };
17
- if (insideField) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_field.Field.Control, {
20
+ const control = insideField ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_field.FieldControl, {
18
21
  ...controlProps,
19
22
  ref
20
- });
21
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
23
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
22
24
  ...controlProps,
23
25
  ref
24
26
  });
27
+ if (prefix !== void 0 || suffix !== void 0 || loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_input_group.InputGroup, { children: [
28
+ prefix !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_input_group.InputGroup.Addon, {
29
+ "data-slot": "input-prefix",
30
+ children: prefix
31
+ }) : null,
32
+ control,
33
+ loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_input_group.InputGroup.Addon, {
34
+ "aria-hidden": "true",
35
+ "data-slot": "input-loading",
36
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.Spinner, {
37
+ label: "",
38
+ size: "sm"
39
+ })
40
+ }) : suffix !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_input_group.InputGroup.Addon, {
41
+ "data-slot": "input-suffix",
42
+ children: suffix
43
+ }) : null
44
+ ] });
45
+ return control;
25
46
  });
26
47
  //#endregion
27
48
  exports.Input = Input;
@@ -1 +1 @@
1
- {"version":3,"file":"input.cjs","names":["useFieldState","cx","input","BaseField"],"sources":["../../../src/components/controls/input.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, Ref } from \"react\";\nimport { Field as BaseField } from \"@base-ui/react/field\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { input } from \"../../styled-system/recipes\";\nimport { useFieldState } from \"../field\";\n\nexport interface InputProps extends Omit<ComponentPropsWithoutRef<\"input\">, \"size\"> {\n size?: \"sm\" | \"md\" | \"lg\";\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { className, size = \"md\", ...props },\n ref,\n) {\n const { insideField } = useFieldState();\n const controlProps = {\n ...props,\n className: cx(input({ size }), className),\n \"data-jaci-component\": \"input\",\n \"data-slot\": \"input\",\n };\n\n if (insideField) {\n return <BaseField.Control {...controlProps} ref={ref as Ref<HTMLElement>} />;\n }\n\n return <input {...controlProps} ref={ref} />;\n});\n"],"mappings":";;;;;;;;AAcA,MAAa,SAAA,GAAA,MAAA,WAAA,CAAiD,SAAS,MACrE,EAAE,WAAW,OAAO,MAAM,GAAG,SAC7B,KACA;CACA,MAAM,EAAE,gBAAgBA,cAAAA,cAAc;CACtC,MAAM,eAAe;EACnB,GAAG;EACH,WAAWC,WAAAA,GAAGC,cAAAA,MAAM,EAAE,KAAK,CAAC,GAAG,SAAS;EACxC,uBAAuB;EACvB,aAAa;CACf;CAEA,IAAI,aACF,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,MAAU,SAAX;EAAmB,GAAI;EAAmB;CAA0B,CAAA;CAG7E,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD;EAAO,GAAI;EAAmB;CAAM,CAAA;AAC7C,CAAC"}
1
+ {"version":3,"file":"input.cjs","names":["useFieldState","cx","input","FieldControl","InputGroup","Spinner"],"sources":["../../../src/components/controls/input.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, Ref } from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { input } from \"../../styled-system/recipes\";\nimport { FieldControl, useFieldState } from \"../field\";\nimport { InputGroup } from \"../input-group\";\nimport { Spinner } from \"../layout\";\n\nexport interface InputProps extends Omit<ComponentPropsWithoutRef<\"input\">, \"prefix\" | \"size\"> {\n size?: \"sm\" | \"md\" | \"lg\";\n prefix?: ReactNode;\n suffix?: ReactNode;\n loading?: boolean;\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { className, loading = false, prefix, size = \"md\", suffix, ...props },\n ref,\n) {\n const { insideField } = useFieldState();\n const controlProps = {\n ...props,\n \"aria-busy\": loading || undefined,\n className: cx(input({ size }), className),\n \"data-jaci-component\": \"input\",\n \"data-loading\": loading || undefined,\n \"data-slot\": \"input\",\n };\n const control = insideField ? (\n <FieldControl {...controlProps} ref={ref as Ref<HTMLElement>} />\n ) : (\n <input {...controlProps} ref={ref} />\n );\n\n if (prefix !== undefined || suffix !== undefined || loading) {\n return (\n <InputGroup>\n {prefix !== undefined ? (\n <InputGroup.Addon data-slot=\"input-prefix\">{prefix}</InputGroup.Addon>\n ) : null}\n {control}\n {loading ? (\n <InputGroup.Addon aria-hidden=\"true\" data-slot=\"input-loading\">\n <Spinner label=\"\" size=\"sm\" />\n </InputGroup.Addon>\n ) : suffix !== undefined ? (\n <InputGroup.Addon data-slot=\"input-suffix\">{suffix}</InputGroup.Addon>\n ) : null}\n </InputGroup>\n );\n }\n\n return control;\n});\n"],"mappings":";;;;;;;;;AAmBA,MAAa,SAAA,GAAA,MAAA,WAAA,CAAiD,SAAS,MACrE,EAAE,WAAW,UAAU,OAAO,QAAQ,OAAO,MAAM,QAAQ,GAAG,SAC9D,KACA;CACA,MAAM,EAAE,gBAAgBA,cAAAA,cAAc;CACtC,MAAM,eAAe;EACnB,GAAG;EACH,aAAa,WAAW,KAAA;EACxB,WAAWC,WAAAA,GAAGC,cAAAA,MAAM,EAAE,KAAK,CAAC,GAAG,SAAS;EACxC,uBAAuB;EACvB,gBAAgB,WAAW,KAAA;EAC3B,aAAa;CACf;CACA,MAAM,UAAU,cACd,iBAAA,GAAA,kBAAA,IAAA,CAACC,cAAAA,cAAD;EAAc,GAAI;EAAmB;CAA0B,CAAA,IAE/D,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD;EAAO,GAAI;EAAmB;CAAM,CAAA;CAGtC,IAAI,WAAW,KAAA,KAAa,WAAW,KAAA,KAAa,SAClD,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACC,oBAAAA,YAAD,EAAA,UAAA;EACG,WAAW,KAAA,IACV,iBAAA,GAAA,kBAAA,IAAA,CAACA,oBAAAA,WAAW,OAAZ;GAAkB,aAAU;aAAgB;EAAyB,CAAA,IACnE;EACH;EACA,UACC,iBAAA,GAAA,kBAAA,IAAA,CAACA,oBAAAA,WAAW,OAAZ;GAAkB,eAAY;GAAO,aAAU;aAC7C,iBAAA,GAAA,kBAAA,IAAA,CAACC,cAAAA,SAAD;IAAS,OAAM;IAAG,MAAK;GAAM,CAAA;EACb,CAAA,IAChB,WAAW,KAAA,IACb,iBAAA,GAAA,kBAAA,IAAA,CAACD,oBAAAA,WAAW,OAAZ;GAAkB,aAAU;aAAgB;EAAyB,CAAA,IACnE;CACM,EAAA,CAAA;CAIhB,OAAO;AACT,CAAC"}
@@ -1,7 +1,10 @@
1
- import { ComponentPropsWithoutRef } from "react";
1
+ import { ComponentPropsWithoutRef, ReactNode } from "react";
2
2
  //#region src/components/controls/input.d.ts
3
- interface InputProps extends Omit<ComponentPropsWithoutRef<"input">, "size"> {
3
+ interface InputProps extends Omit<ComponentPropsWithoutRef<"input">, "prefix" | "size"> {
4
4
  size?: "sm" | "md" | "lg";
5
+ prefix?: ReactNode;
6
+ suffix?: ReactNode;
7
+ loading?: boolean;
5
8
  }
6
9
  declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>>;
7
10
  //#endregion
@@ -1,7 +1,10 @@
1
- import { ComponentPropsWithoutRef } from "react";
1
+ import { ComponentPropsWithoutRef, ReactNode } from "react";
2
2
  //#region src/components/controls/input.d.ts
3
- interface InputProps extends Omit<ComponentPropsWithoutRef<"input">, "size"> {
3
+ interface InputProps extends Omit<ComponentPropsWithoutRef<"input">, "prefix" | "size"> {
4
4
  size?: "sm" | "md" | "lg";
5
+ prefix?: ReactNode;
6
+ suffix?: ReactNode;
7
+ loading?: boolean;
5
8
  }
6
9
  declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>>;
7
10
  //#endregion
@@ -1,27 +1,48 @@
1
1
  "use client";
2
2
  import { cx } from "../../styled-system/css/cx.js";
3
3
  import { input } from "../../styled-system/recipes/input.js";
4
- import { useFieldState } from "../field/field.js";
4
+ import { Spinner } from "../layout/index.js";
5
+ import { FieldControl, useFieldState } from "../field/field.js";
6
+ import { InputGroup } from "../input-group/input-group.js";
5
7
  import { forwardRef } from "react";
6
- import { jsx } from "react/jsx-runtime";
7
- import { Field } from "@base-ui/react/field";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
8
9
  //#region src/components/controls/input.tsx
9
- const Input = forwardRef(function Input({ className, size = "md", ...props }, ref) {
10
+ const Input = forwardRef(function Input({ className, loading = false, prefix, size = "md", suffix, ...props }, ref) {
10
11
  const { insideField } = useFieldState();
11
12
  const controlProps = {
12
13
  ...props,
14
+ "aria-busy": loading || void 0,
13
15
  className: cx(input({ size }), className),
14
16
  "data-jaci-component": "input",
17
+ "data-loading": loading || void 0,
15
18
  "data-slot": "input"
16
19
  };
17
- if (insideField) return /* @__PURE__ */ jsx(Field.Control, {
20
+ const control = insideField ? /* @__PURE__ */ jsx(FieldControl, {
18
21
  ...controlProps,
19
22
  ref
20
- });
21
- return /* @__PURE__ */ jsx("input", {
23
+ }) : /* @__PURE__ */ jsx("input", {
22
24
  ...controlProps,
23
25
  ref
24
26
  });
27
+ if (prefix !== void 0 || suffix !== void 0 || loading) return /* @__PURE__ */ jsxs(InputGroup, { children: [
28
+ prefix !== void 0 ? /* @__PURE__ */ jsx(InputGroup.Addon, {
29
+ "data-slot": "input-prefix",
30
+ children: prefix
31
+ }) : null,
32
+ control,
33
+ loading ? /* @__PURE__ */ jsx(InputGroup.Addon, {
34
+ "aria-hidden": "true",
35
+ "data-slot": "input-loading",
36
+ children: /* @__PURE__ */ jsx(Spinner, {
37
+ label: "",
38
+ size: "sm"
39
+ })
40
+ }) : suffix !== void 0 ? /* @__PURE__ */ jsx(InputGroup.Addon, {
41
+ "data-slot": "input-suffix",
42
+ children: suffix
43
+ }) : null
44
+ ] });
45
+ return control;
25
46
  });
26
47
  //#endregion
27
48
  export { Input };
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","names":["BaseField"],"sources":["../../../src/components/controls/input.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, Ref } from \"react\";\nimport { Field as BaseField } from \"@base-ui/react/field\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { input } from \"../../styled-system/recipes\";\nimport { useFieldState } from \"../field\";\n\nexport interface InputProps extends Omit<ComponentPropsWithoutRef<\"input\">, \"size\"> {\n size?: \"sm\" | \"md\" | \"lg\";\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { className, size = \"md\", ...props },\n ref,\n) {\n const { insideField } = useFieldState();\n const controlProps = {\n ...props,\n className: cx(input({ size }), className),\n \"data-jaci-component\": \"input\",\n \"data-slot\": \"input\",\n };\n\n if (insideField) {\n return <BaseField.Control {...controlProps} ref={ref as Ref<HTMLElement>} />;\n }\n\n return <input {...controlProps} ref={ref} />;\n});\n"],"mappings":";;;;;;;;AAcA,MAAa,QAAQ,WAAyC,SAAS,MACrE,EAAE,WAAW,OAAO,MAAM,GAAG,SAC7B,KACA;CACA,MAAM,EAAE,gBAAgB,cAAc;CACtC,MAAM,eAAe;EACnB,GAAG;EACH,WAAW,GAAG,MAAM,EAAE,KAAK,CAAC,GAAG,SAAS;EACxC,uBAAuB;EACvB,aAAa;CACf;CAEA,IAAI,aACF,OAAO,oBAACA,MAAU,SAAX;EAAmB,GAAI;EAAmB;CAA0B,CAAA;CAG7E,OAAO,oBAAC,SAAD;EAAO,GAAI;EAAmB;CAAM,CAAA;AAC7C,CAAC"}
1
+ {"version":3,"file":"input.js","names":[],"sources":["../../../src/components/controls/input.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, Ref } from \"react\";\nimport type { ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { input } from \"../../styled-system/recipes\";\nimport { FieldControl, useFieldState } from \"../field\";\nimport { InputGroup } from \"../input-group\";\nimport { Spinner } from \"../layout\";\n\nexport interface InputProps extends Omit<ComponentPropsWithoutRef<\"input\">, \"prefix\" | \"size\"> {\n size?: \"sm\" | \"md\" | \"lg\";\n prefix?: ReactNode;\n suffix?: ReactNode;\n loading?: boolean;\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { className, loading = false, prefix, size = \"md\", suffix, ...props },\n ref,\n) {\n const { insideField } = useFieldState();\n const controlProps = {\n ...props,\n \"aria-busy\": loading || undefined,\n className: cx(input({ size }), className),\n \"data-jaci-component\": \"input\",\n \"data-loading\": loading || undefined,\n \"data-slot\": \"input\",\n };\n const control = insideField ? (\n <FieldControl {...controlProps} ref={ref as Ref<HTMLElement>} />\n ) : (\n <input {...controlProps} ref={ref} />\n );\n\n if (prefix !== undefined || suffix !== undefined || loading) {\n return (\n <InputGroup>\n {prefix !== undefined ? (\n <InputGroup.Addon data-slot=\"input-prefix\">{prefix}</InputGroup.Addon>\n ) : null}\n {control}\n {loading ? (\n <InputGroup.Addon aria-hidden=\"true\" data-slot=\"input-loading\">\n <Spinner label=\"\" size=\"sm\" />\n </InputGroup.Addon>\n ) : suffix !== undefined ? (\n <InputGroup.Addon data-slot=\"input-suffix\">{suffix}</InputGroup.Addon>\n ) : null}\n </InputGroup>\n );\n }\n\n return control;\n});\n"],"mappings":";;;;;;;;;AAmBA,MAAa,QAAQ,WAAyC,SAAS,MACrE,EAAE,WAAW,UAAU,OAAO,QAAQ,OAAO,MAAM,QAAQ,GAAG,SAC9D,KACA;CACA,MAAM,EAAE,gBAAgB,cAAc;CACtC,MAAM,eAAe;EACnB,GAAG;EACH,aAAa,WAAW,KAAA;EACxB,WAAW,GAAG,MAAM,EAAE,KAAK,CAAC,GAAG,SAAS;EACxC,uBAAuB;EACvB,gBAAgB,WAAW,KAAA;EAC3B,aAAa;CACf;CACA,MAAM,UAAU,cACd,oBAAC,cAAD;EAAc,GAAI;EAAmB;CAA0B,CAAA,IAE/D,oBAAC,SAAD;EAAO,GAAI;EAAmB;CAAM,CAAA;CAGtC,IAAI,WAAW,KAAA,KAAa,WAAW,KAAA,KAAa,SAClD,OACE,qBAAC,YAAD,EAAA,UAAA;EACG,WAAW,KAAA,IACV,oBAAC,WAAW,OAAZ;GAAkB,aAAU;aAAgB;EAAyB,CAAA,IACnE;EACH;EACA,UACC,oBAAC,WAAW,OAAZ;GAAkB,eAAY;GAAO,aAAU;aAC7C,oBAAC,SAAD;IAAS,OAAM;IAAG,MAAK;GAAM,CAAA;EACb,CAAA,IAChB,WAAW,KAAA,IACb,oBAAC,WAAW,OAAZ;GAAkB,aAAU;aAAgB;EAAyB,CAAA,IACnE;CACM,EAAA,CAAA;CAIhB,OAAO;AACT,CAAC"}
@@ -1,28 +1,49 @@
1
1
  "use client";
2
2
  const require_cx = require("../../styled-system/css/cx.cjs");
3
3
  const require_textarea = require("../../styled-system/recipes/textarea.cjs");
4
+ const require_index = require("../layout/index.cjs");
4
5
  const require_field = require("../field/field.cjs");
6
+ const require_input_group = require("../input-group/input-group.cjs");
5
7
  let react = require("react");
6
8
  let react_jsx_runtime = require("react/jsx-runtime");
7
- let _base_ui_react_field = require("@base-ui/react/field");
8
9
  //#region src/components/controls/textarea.tsx
9
- const Textarea = (0, react.forwardRef)(function Textarea({ className, size = "md", ...props }, ref) {
10
+ const Textarea = (0, react.forwardRef)(function Textarea({ className, loading = false, prefix, size = "md", suffix, ...props }, ref) {
10
11
  const { insideField } = require_field.useFieldState();
11
12
  const controlProps = {
12
13
  ...props,
14
+ "aria-busy": loading || void 0,
13
15
  className: require_cx.cx(require_textarea.textarea({ size }), className),
14
16
  "data-jaci-component": "textarea",
17
+ "data-loading": loading || void 0,
15
18
  "data-slot": "textarea"
16
19
  };
17
- if (insideField) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_field.Field.Control, {
20
+ const control = insideField ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_field.FieldControl, {
18
21
  ...controlProps,
19
22
  ref,
20
23
  render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {})
21
- });
22
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
24
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
23
25
  ...controlProps,
24
26
  ref
25
27
  });
28
+ if (prefix !== void 0 || suffix !== void 0 || loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_input_group.InputGroup, { children: [
29
+ prefix !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_input_group.InputGroup.Addon, {
30
+ "data-slot": "textarea-prefix",
31
+ children: prefix
32
+ }) : null,
33
+ control,
34
+ loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_input_group.InputGroup.Addon, {
35
+ "aria-hidden": "true",
36
+ "data-slot": "textarea-loading",
37
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.Spinner, {
38
+ label: "",
39
+ size: "sm"
40
+ })
41
+ }) : suffix !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_input_group.InputGroup.Addon, {
42
+ "data-slot": "textarea-suffix",
43
+ children: suffix
44
+ }) : null
45
+ ] });
46
+ return control;
26
47
  });
27
48
  //#endregion
28
49
  exports.Textarea = Textarea;
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.cjs","names":["useFieldState","cx","textarea","BaseField"],"sources":["../../../src/components/controls/textarea.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\nimport type { ComponentProps, ComponentPropsWithoutRef, Ref } from \"react\";\nimport { Field as BaseField } from \"@base-ui/react/field\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { textarea } from \"../../styled-system/recipes\";\nimport { useFieldState } from \"../field\";\n\nexport interface TextareaProps extends ComponentPropsWithoutRef<\"textarea\"> {\n size?: \"sm\" | \"md\" | \"lg\";\n}\n\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n { className, size = \"md\", ...props },\n ref,\n) {\n const { insideField } = useFieldState();\n const controlProps = {\n ...props,\n className: cx(textarea({ size }), className),\n \"data-jaci-component\": \"textarea\",\n \"data-slot\": \"textarea\",\n };\n\n if (insideField) {\n return (\n <BaseField.Control\n {...(controlProps as unknown as ComponentProps<typeof BaseField.Control>)}\n ref={ref as Ref<HTMLElement>}\n render={<textarea />}\n />\n );\n }\n\n return <textarea {...controlProps} ref={ref} />;\n});\n"],"mappings":";;;;;;;;AAcA,MAAa,YAAA,GAAA,MAAA,WAAA,CAA0D,SAAS,SAC9E,EAAE,WAAW,OAAO,MAAM,GAAG,SAC7B,KACA;CACA,MAAM,EAAE,gBAAgBA,cAAAA,cAAc;CACtC,MAAM,eAAe;EACnB,GAAG;EACH,WAAWC,WAAAA,GAAGC,iBAAAA,SAAS,EAAE,KAAK,CAAC,GAAG,SAAS;EAC3C,uBAAuB;EACvB,aAAa;CACf;CAEA,IAAI,aACF,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,qBAAAA,MAAU,SAAX;EACE,GAAK;EACA;EACL,QAAQ,iBAAA,GAAA,kBAAA,IAAA,CAAC,YAAD,CAAW,CAAA;CACpB,CAAA;CAIL,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,YAAD;EAAU,GAAI;EAAmB;CAAM,CAAA;AAChD,CAAC"}
1
+ {"version":3,"file":"textarea.cjs","names":["useFieldState","cx","textarea","FieldControl","InputGroup","Spinner"],"sources":["../../../src/components/controls/textarea.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\nimport type { ComponentProps, ComponentPropsWithoutRef, ReactNode, Ref } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { textarea } from \"../../styled-system/recipes\";\nimport { FieldControl, useFieldState } from \"../field\";\nimport { InputGroup } from \"../input-group\";\nimport { Spinner } from \"../layout\";\n\nexport interface TextareaProps extends Omit<ComponentPropsWithoutRef<\"textarea\">, \"prefix\"> {\n size?: \"sm\" | \"md\" | \"lg\";\n prefix?: ReactNode;\n suffix?: ReactNode;\n loading?: boolean;\n}\n\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n { className, loading = false, prefix, size = \"md\", suffix, ...props },\n ref,\n) {\n const { insideField } = useFieldState();\n const controlProps = {\n ...props,\n \"aria-busy\": loading || undefined,\n className: cx(textarea({ size }), className),\n \"data-jaci-component\": \"textarea\",\n \"data-loading\": loading || undefined,\n \"data-slot\": \"textarea\",\n };\n const control = insideField ? (\n <FieldControl\n {...(controlProps as unknown as ComponentProps<typeof FieldControl>)}\n ref={ref as Ref<HTMLElement>}\n render={<textarea />}\n />\n ) : (\n <textarea {...controlProps} ref={ref} />\n );\n\n if (prefix !== undefined || suffix !== undefined || loading) {\n return (\n <InputGroup>\n {prefix !== undefined ? (\n <InputGroup.Addon data-slot=\"textarea-prefix\">{prefix}</InputGroup.Addon>\n ) : null}\n {control}\n {loading ? (\n <InputGroup.Addon aria-hidden=\"true\" data-slot=\"textarea-loading\">\n <Spinner label=\"\" size=\"sm\" />\n </InputGroup.Addon>\n ) : suffix !== undefined ? (\n <InputGroup.Addon data-slot=\"textarea-suffix\">{suffix}</InputGroup.Addon>\n ) : null}\n </InputGroup>\n );\n }\n\n return control;\n});\n"],"mappings":";;;;;;;;;AAkBA,MAAa,YAAA,GAAA,MAAA,WAAA,CAA0D,SAAS,SAC9E,EAAE,WAAW,UAAU,OAAO,QAAQ,OAAO,MAAM,QAAQ,GAAG,SAC9D,KACA;CACA,MAAM,EAAE,gBAAgBA,cAAAA,cAAc;CACtC,MAAM,eAAe;EACnB,GAAG;EACH,aAAa,WAAW,KAAA;EACxB,WAAWC,WAAAA,GAAGC,i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