jaci-ui 0.3.0 → 0.5.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 (188) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +85 -0
  3. package/dist/components/calendar/calendar.cjs +377 -0
  4. package/dist/components/calendar/calendar.cjs.map +1 -0
  5. package/dist/components/calendar/calendar.d.cts +56 -0
  6. package/dist/components/calendar/calendar.d.ts +56 -0
  7. package/dist/components/calendar/calendar.js +368 -0
  8. package/dist/components/calendar/calendar.js.map +1 -0
  9. package/dist/components/calendar/index.d.cts +2 -0
  10. package/dist/components/calendar/index.d.ts +2 -0
  11. package/dist/components/combobox/combobox.cjs +13 -1
  12. package/dist/components/combobox/combobox.cjs.map +1 -1
  13. package/dist/components/combobox/combobox.d.cts +7 -2
  14. package/dist/components/combobox/combobox.d.ts +7 -2
  15. package/dist/components/combobox/combobox.js +13 -2
  16. package/dist/components/combobox/combobox.js.map +1 -1
  17. package/dist/components/combobox/index.d.cts +2 -2
  18. package/dist/components/combobox/index.d.ts +2 -2
  19. package/dist/components/command/command.cjs +55 -34
  20. package/dist/components/command/command.cjs.map +1 -1
  21. package/dist/components/command/command.d.cts +1 -0
  22. package/dist/components/command/command.d.ts +1 -0
  23. package/dist/components/command/command.js +55 -34
  24. package/dist/components/command/command.js.map +1 -1
  25. package/dist/components/controls/input.cjs +26 -5
  26. package/dist/components/controls/input.cjs.map +1 -1
  27. package/dist/components/controls/input.d.cts +5 -2
  28. package/dist/components/controls/input.d.ts +5 -2
  29. package/dist/components/controls/input.js +28 -7
  30. package/dist/components/controls/input.js.map +1 -1
  31. package/dist/components/controls/textarea.cjs +26 -5
  32. package/dist/components/controls/textarea.cjs.map +1 -1
  33. package/dist/components/controls/textarea.d.cts +5 -2
  34. package/dist/components/controls/textarea.d.ts +5 -2
  35. package/dist/components/controls/textarea.js +28 -7
  36. package/dist/components/controls/textarea.js.map +1 -1
  37. package/dist/components/data-toolbar/data-toolbar.cjs +141 -0
  38. package/dist/components/data-toolbar/data-toolbar.cjs.map +1 -0
  39. package/dist/components/data-toolbar/data-toolbar.d.cts +50 -0
  40. package/dist/components/data-toolbar/data-toolbar.d.ts +50 -0
  41. package/dist/components/data-toolbar/data-toolbar.js +132 -0
  42. package/dist/components/data-toolbar/data-toolbar.js.map +1 -0
  43. package/dist/components/data-toolbar/index.d.cts +2 -0
  44. package/dist/components/data-toolbar/index.d.ts +2 -0
  45. package/dist/components/data-view/data-view.cjs +33 -1
  46. package/dist/components/data-view/data-view.cjs.map +1 -1
  47. package/dist/components/data-view/data-view.d.cts +12 -1
  48. package/dist/components/data-view/data-view.d.ts +12 -1
  49. package/dist/components/data-view/data-view.js +31 -2
  50. package/dist/components/data-view/data-view.js.map +1 -1
  51. package/dist/components/data-view/index.d.cts +2 -2
  52. package/dist/components/data-view/index.d.ts +2 -2
  53. package/dist/components/date-picker/date-picker.cjs +9 -9
  54. package/dist/components/date-picker/date-picker.cjs.map +1 -1
  55. package/dist/components/date-picker/date-picker.d.cts +3 -1
  56. package/dist/components/date-picker/date-picker.d.ts +3 -1
  57. package/dist/components/date-picker/date-picker.js +9 -9
  58. package/dist/components/date-picker/date-picker.js.map +1 -1
  59. package/dist/components/date-range-picker/date-range-picker.cjs +589 -0
  60. package/dist/components/date-range-picker/date-range-picker.cjs.map +1 -0
  61. package/dist/components/date-range-picker/date-range-picker.d.cts +134 -0
  62. package/dist/components/date-range-picker/date-range-picker.d.ts +134 -0
  63. package/dist/components/date-range-picker/date-range-picker.js +568 -0
  64. package/dist/components/date-range-picker/date-range-picker.js.map +1 -0
  65. package/dist/components/date-range-picker/index.d.cts +2 -0
  66. package/dist/components/date-range-picker/index.d.ts +2 -0
  67. package/dist/components/field/field.cjs +106 -11
  68. package/dist/components/field/field.cjs.map +1 -1
  69. package/dist/components/field/field.d.cts +22 -4
  70. package/dist/components/field/field.d.ts +22 -4
  71. package/dist/components/field/field.js +107 -13
  72. package/dist/components/field/field.js.map +1 -1
  73. package/dist/components/field/index.d.cts +2 -2
  74. package/dist/components/field/index.d.ts +2 -2
  75. package/dist/components/list/list.cjs +3 -1
  76. package/dist/components/list/list.cjs.map +1 -1
  77. package/dist/components/list/list.d.cts +3 -1
  78. package/dist/components/list/list.d.ts +3 -1
  79. package/dist/components/list/list.js +3 -1
  80. package/dist/components/list/list.js.map +1 -1
  81. package/dist/components/pagination/index.d.cts +2 -2
  82. package/dist/components/pagination/index.d.ts +2 -2
  83. package/dist/components/pagination/pagination.cjs +122 -21
  84. package/dist/components/pagination/pagination.cjs.map +1 -1
  85. package/dist/components/pagination/pagination.d.cts +25 -13
  86. package/dist/components/pagination/pagination.d.ts +25 -13
  87. package/dist/components/pagination/pagination.js +122 -23
  88. package/dist/components/pagination/pagination.js.map +1 -1
  89. package/dist/components/pin-input/index.d.cts +2 -0
  90. package/dist/components/pin-input/index.d.ts +2 -0
  91. package/dist/components/pin-input/pin-input.cjs +266 -0
  92. package/dist/components/pin-input/pin-input.cjs.map +1 -0
  93. package/dist/components/pin-input/pin-input.d.cts +46 -0
  94. package/dist/components/pin-input/pin-input.d.ts +46 -0
  95. package/dist/components/pin-input/pin-input.js +258 -0
  96. package/dist/components/pin-input/pin-input.js.map +1 -0
  97. package/dist/components/select/index.d.cts +2 -2
  98. package/dist/components/select/index.d.ts +2 -2
  99. package/dist/components/select/select.cjs +80 -3
  100. package/dist/components/select/select.cjs.map +1 -1
  101. package/dist/components/select/select.d.cts +18 -3
  102. package/dist/components/select/select.d.ts +18 -3
  103. package/dist/components/select/select.js +78 -5
  104. package/dist/components/select/select.js.map +1 -1
  105. package/dist/components/table/index.d.cts +2 -2
  106. package/dist/components/table/index.d.ts +2 -2
  107. package/dist/components/table/table.cjs +265 -46
  108. package/dist/components/table/table.cjs.map +1 -1
  109. package/dist/components/table/table.d.cts +41 -8
  110. package/dist/components/table/table.d.ts +41 -8
  111. package/dist/components/table/table.js +264 -48
  112. package/dist/components/table/table.js.map +1 -1
  113. package/dist/components/tags-input/tags-input.cjs +83 -5
  114. package/dist/components/tags-input/tags-input.cjs.map +1 -1
  115. package/dist/components/tags-input/tags-input.d.cts +3 -0
  116. package/dist/components/tags-input/tags-input.d.ts +3 -0
  117. package/dist/components/tags-input/tags-input.js +83 -5
  118. package/dist/components/tags-input/tags-input.js.map +1 -1
  119. package/dist/components/tree-view/index.d.cts +2 -2
  120. package/dist/components/tree-view/index.d.ts +2 -2
  121. package/dist/components/tree-view/tree-view.cjs +60 -3
  122. package/dist/components/tree-view/tree-view.cjs.map +1 -1
  123. package/dist/components/tree-view/tree-view.d.cts +12 -1
  124. package/dist/components/tree-view/tree-view.d.ts +12 -1
  125. package/dist/components/tree-view/tree-view.js +58 -4
  126. package/dist/components/tree-view/tree-view.js.map +1 -1
  127. package/dist/components/upload/index.d.cts +2 -2
  128. package/dist/components/upload/index.d.ts +2 -2
  129. package/dist/components/upload/upload.cjs +90 -10
  130. package/dist/components/upload/upload.cjs.map +1 -1
  131. package/dist/components/upload/upload.d.cts +25 -2
  132. package/dist/components/upload/upload.d.ts +25 -2
  133. package/dist/components/upload/upload.js +89 -11
  134. package/dist/components/upload/upload.js.map +1 -1
  135. package/dist/index.cjs +74 -1
  136. package/dist/index.d.cts +17 -9
  137. package/dist/index.d.ts +17 -9
  138. package/dist/index.js +14 -10
  139. package/dist/styled-system/recipes/calendar.cjs +43 -0
  140. package/dist/styled-system/recipes/calendar.cjs.map +1 -0
  141. package/dist/styled-system/recipes/calendar.js +43 -0
  142. package/dist/styled-system/recipes/calendar.js.map +1 -0
  143. package/dist/styled-system/recipes/combobox.cjs +1 -0
  144. package/dist/styled-system/recipes/combobox.cjs.map +1 -1
  145. package/dist/styled-system/recipes/combobox.js +1 -0
  146. package/dist/styled-system/recipes/combobox.js.map +1 -1
  147. package/dist/styled-system/recipes/data-toolbar.cjs +40 -0
  148. package/dist/styled-system/recipes/data-toolbar.cjs.map +1 -0
  149. package/dist/styled-system/recipes/data-toolbar.js +40 -0
  150. package/dist/styled-system/recipes/data-toolbar.js.map +1 -0
  151. package/dist/styled-system/recipes/data-view.cjs +3 -0
  152. package/dist/styled-system/recipes/data-view.cjs.map +1 -1
  153. package/dist/styled-system/recipes/data-view.js +3 -0
  154. package/dist/styled-system/recipes/data-view.js.map +1 -1
  155. package/dist/styled-system/recipes/date-range-picker.cjs +52 -0
  156. package/dist/styled-system/recipes/date-range-picker.cjs.map +1 -0
  157. package/dist/styled-system/recipes/date-range-picker.js +52 -0
  158. package/dist/styled-system/recipes/date-range-picker.js.map +1 -0
  159. package/dist/styled-system/recipes/list.cjs +7 -1
  160. package/dist/styled-system/recipes/list.cjs.map +1 -1
  161. package/dist/styled-system/recipes/list.js +7 -1
  162. package/dist/styled-system/recipes/list.js.map +1 -1
  163. package/dist/styled-system/recipes/pagination.cjs +9 -1
  164. package/dist/styled-system/recipes/pagination.cjs.map +1 -1
  165. package/dist/styled-system/recipes/pagination.js +9 -1
  166. package/dist/styled-system/recipes/pagination.js.map +1 -1
  167. package/dist/styled-system/recipes/pin-input.cjs +39 -0
  168. package/dist/styled-system/recipes/pin-input.cjs.map +1 -0
  169. package/dist/styled-system/recipes/pin-input.js +39 -0
  170. package/dist/styled-system/recipes/pin-input.js.map +1 -0
  171. package/dist/styled-system/recipes/select.cjs +5 -1
  172. package/dist/styled-system/recipes/select.cjs.map +1 -1
  173. package/dist/styled-system/recipes/select.js +5 -1
  174. package/dist/styled-system/recipes/select.js.map +1 -1
  175. package/dist/styled-system/recipes/table.cjs +15 -2
  176. package/dist/styled-system/recipes/table.cjs.map +1 -1
  177. package/dist/styled-system/recipes/table.js +15 -2
  178. package/dist/styled-system/recipes/table.js.map +1 -1
  179. package/dist/styled-system/recipes/tree-view.cjs +4 -1
  180. package/dist/styled-system/recipes/tree-view.cjs.map +1 -1
  181. package/dist/styled-system/recipes/tree-view.js +4 -1
  182. package/dist/styled-system/recipes/tree-view.js.map +1 -1
  183. package/dist/styled-system/recipes/upload.cjs +2 -0
  184. package/dist/styled-system/recipes/upload.cjs.map +1 -1
  185. package/dist/styled-system/recipes/upload.js +2 -0
  186. package/dist/styled-system/recipes/upload.js.map +1 -1
  187. package/dist/styles.css +995 -95
  188. package/package.json +3 -2
@@ -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,mBAAmB,EAAE,CAAC;AAC3D;;;;;;AAmBA,SAAgBA,eAA2E,EACzF,UACA,WACA,QACA,SACA,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,SAAS,KAAA,IAAY,CAAC,IAAI,EAAE,KAAK;IACjE;GACgB,CAAA;EACd,CAAA;CACqB,CAAA;AAElC;AAIA,MAAa,gBAAgB,WAA4C,SAAS,cAChF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAACC,MAAU,OAAX;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,kBAAkB,CAA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AAd;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,kBAAkB,CAAC,CAAC,OAAO,SAAS;EACnE,aAAU;CACX,CAAA;AAEL,CAAC;AAGD,MAAa,gBAAgB,WAC3B,SAAS,cAAc,EAAE,WAAW,KAAK,WAAW,GAAG,SAAS,KAAK;CACnE,OACE,oBAACA,SAAa,OAAd;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,kBAAkB,CAAC,CAAC,OAAO,SAAS;EACnE,aAAU;EACV,cAAY,MAAM,iBAAiB;EAElC;CACiB,CAAA;AAExB,CACF;AAGA,MAAa,iBAAiB,WAC5B,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CACpD,OACE,oBAACA,SAAa,QAAd;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,kBAAkB,CAAC,CAAC,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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AW,GAAG,kBAAkB,CAAC,CAAC,SAAS,SAAS;EACpD,aAAU;EAET;CACE,CAAA;AAET,CACF;AAGA,MAAa,iBAAiB,WAC5B,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CACpD,OACE,oBAACA,SAAa,QAAd;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,kBAAkB,CAAC,CAAC,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,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 };
@@ -17,7 +17,7 @@ function defaultFilter(value, search, keywords) {
17
17
  if (!query) return true;
18
18
  return [value, ...keywords].some((candidate) => candidate.toLocaleLowerCase().includes(query));
19
19
  }
20
- const CommandRoot = (0, react.forwardRef)(function CommandRoot({ children, className, defaultSearch = "", filter = defaultFilter, loading = false, onKeyDown, onSearchChange, search: controlledSearch, shouldFilter = true, loopFocus = true, ...props }, ref) {
20
+ const CommandRoot = (0, react.forwardRef)(function CommandRoot({ children, className, defaultSearch = "", disabled = false, filter = defaultFilter, loading = false, onKeyDown, onSearchChange, search: controlledSearch, shouldFilter = true, loopFocus = true, ...props }, ref) {
21
21
  const [uncontrolledSearch, setUncontrolledSearch] = (0, react.useState)(defaultSearch);
22
22
  const [highlighted, setHighlighted] = (0, react.useState)(null);
23
23
  const [, setVersion] = (0, react.useState)(0);
@@ -35,7 +35,7 @@ const CommandRoot = (0, react.forwardRef)(function CommandRoot({ children, class
35
35
  search,
36
36
  shouldFilter
37
37
  ]);
38
- const visibleItems = items.filter((item) => !item.disabled && matches(item));
38
+ const visibleItems = (0, react.useMemo)(() => items.filter((item) => !item.disabled && matches(item)), [items, matches]);
39
39
  const registerItem = (0, react.useCallback)((item) => {
40
40
  itemsRef.current.set(item.id, item);
41
41
  setVersion((current) => current + 1);
@@ -48,33 +48,43 @@ const CommandRoot = (0, react.forwardRef)(function CommandRoot({ children, class
48
48
  const item = itemsRef.current.get(id);
49
49
  if (item) item.element = element;
50
50
  }, []);
51
- const selectItem = (0, react.useCallback)((value) => {
52
- const item = itemsRef.current.get(value);
51
+ const selectItem = (0, react.useCallback)((id) => {
52
+ const item = itemsRef.current.get(id);
53
53
  if (item && !item.disabled && matches(item)) item.onSelect?.(item.value);
54
54
  }, [matches]);
55
55
  (0, react.useEffect)(() => {
56
- if (!visibleItems.some((item) => item.value === highlighted)) setHighlighted(visibleItems[0]?.value ?? null);
56
+ if (!visibleItems.some((item) => item.id === highlighted)) setHighlighted(visibleItems[0]?.id ?? null);
57
57
  }, [highlighted, visibleItems]);
58
- const handleKeyDown = (event) => {
58
+ const handleKeyDown = (0, react.useCallback)((event) => {
59
59
  onKeyDown?.(event);
60
60
  if (event.defaultPrevented) return;
61
- const currentIndex = visibleItems.findIndex((item) => item.value === highlighted);
61
+ if (disabled) return;
62
+ const currentIndex = visibleItems.findIndex((item) => item.id === highlighted);
62
63
  if ((event.key === "ArrowDown" || event.key === "ArrowUp") && visibleItems.length > 0) {
63
64
  event.preventDefault();
64
65
  let nextIndex = currentIndex + (event.key === "ArrowDown" ? 1 : -1);
65
66
  if (loopFocus) nextIndex = (nextIndex + visibleItems.length) % visibleItems.length;
66
- if (nextIndex >= 0 && nextIndex < visibleItems.length) setHighlighted(visibleItems[nextIndex]?.value ?? null);
67
+ if (nextIndex >= 0 && nextIndex < visibleItems.length) setHighlighted(visibleItems[nextIndex]?.id ?? null);
67
68
  } else if (event.key === "Home" || event.key === "End") {
68
69
  event.preventDefault();
69
- setHighlighted((event.key === "Home" ? visibleItems[0] : visibleItems.at(-1))?.value ?? null);
70
+ setHighlighted((event.key === "Home" ? visibleItems[0] : visibleItems.at(-1))?.id ?? null);
70
71
  } else if (event.key === "Enter" && highlighted) {
71
72
  event.preventDefault();
72
73
  selectItem(highlighted);
73
74
  } else if (event.key === "Escape") event.preventDefault();
74
- };
75
+ }, [
76
+ disabled,
77
+ highlighted,
78
+ loopFocus,
79
+ onKeyDown,
80
+ selectItem,
81
+ visibleItems
82
+ ]);
75
83
  const context = (0, react.useMemo)(() => ({
76
84
  search,
77
85
  setSearch,
86
+ disabled,
87
+ handleKeyDown,
78
88
  loading,
79
89
  shouldFilter,
80
90
  items,
@@ -87,6 +97,8 @@ const CommandRoot = (0, react.forwardRef)(function CommandRoot({ children, class
87
97
  selectItem
88
98
  }), [
89
99
  highlighted,
100
+ disabled,
101
+ handleKeyDown,
90
102
  items,
91
103
  listId,
92
104
  loading,
@@ -107,17 +119,16 @@ const CommandRoot = (0, react.forwardRef)(function CommandRoot({ children, class
107
119
  else if (ref) ref.current = node;
108
120
  },
109
121
  className: require_cx.cx(styles.root, className),
110
- "data-disabled": props["aria-disabled"] || void 0,
122
+ "data-disabled": disabled || void 0,
111
123
  "data-jaci-component": "command",
112
124
  "data-slot": "command",
113
- onKeyDown: handleKeyDown,
114
- role: "application",
125
+ "aria-disabled": disabled || void 0,
115
126
  children
116
127
  })
117
128
  });
118
129
  });
119
- const CommandInput = (0, react.forwardRef)(function CommandInput({ className, onChange, ...props }, ref) {
120
- const { highlighted, listId, search, setHighlighted, setSearch } = useCommandContext();
130
+ const CommandInput = (0, react.forwardRef)(function CommandInput({ className, onChange, onKeyDown, ...props }, ref) {
131
+ const { disabled, handleKeyDown, highlighted, listId, search, setHighlighted, setSearch } = useCommandContext();
121
132
  const handleChange = (event) => {
122
133
  onChange?.(event);
123
134
  const next = event.target.value;
@@ -127,43 +138,48 @@ const CommandInput = (0, react.forwardRef)(function CommandInput({ className, on
127
138
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
128
139
  ...props,
129
140
  ref,
130
- "aria-activedescendant": highlighted ? `command-item-${highlighted}` : void 0,
141
+ "aria-activedescendant": highlighted ?? void 0,
131
142
  "aria-controls": listId,
143
+ role: "combobox",
132
144
  "aria-haspopup": "listbox",
145
+ "aria-expanded": "true",
133
146
  className: require_cx.cx(require_command.command().input, className),
134
147
  "data-slot": "command-input",
148
+ disabled: disabled || props.disabled,
135
149
  onChange: (event) => {
136
150
  handleChange(event);
137
151
  },
152
+ onKeyDown: (event) => {
153
+ onKeyDown?.(event);
154
+ handleKeyDown(event);
155
+ },
138
156
  value: search
139
157
  });
140
158
  });
141
159
  const CommandList = (0, react.forwardRef)(function CommandList({ className, id, ...props }, ref) {
142
- const { items, listId, matches } = useCommandContext();
143
- const hasVisibleItems = items.some((item) => !item.disabled && matches(item));
160
+ const { listId } = useCommandContext();
144
161
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
145
162
  ...props,
146
163
  ref,
147
164
  id: id ?? listId,
148
165
  className: require_cx.cx(require_command.command().list, className),
149
166
  "data-slot": "command-list",
150
- role: hasVisibleItems ? "listbox" : void 0
167
+ role: "listbox"
151
168
  });
152
169
  });
153
170
  const CommandGroup = (0, react.forwardRef)(function CommandGroup({ children, className, heading, ...props }, ref) {
154
171
  const context = useCommandContext();
155
172
  const groupId = (0, react.useId)();
156
- const hasRegisteredItems = context.items.some((item) => item.groupId === groupId);
157
- const hasVisibleItems = context.items.some((item) => item.groupId === groupId && context.matches(item));
173
+ const hasVisibleItems = context.items.some((item) => item.groupId === groupId && !item.disabled && context.matches(item));
158
174
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CommandGroupContext.Provider, {
159
175
  value: groupId,
160
176
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
161
177
  ...props,
162
178
  ref,
163
- "aria-hidden": hasRegisteredItems && !hasVisibleItems ? true : void 0,
179
+ "aria-hidden": !hasVisibleItems || void 0,
164
180
  className: require_cx.cx(require_command.command().group, className),
165
181
  "data-slot": "command-group",
166
- hidden: hasRegisteredItems && !hasVisibleItems,
182
+ hidden: !hasVisibleItems,
167
183
  children: [heading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
168
184
  className: require_command.command().groupHeading,
169
185
  "data-slot": "command-group-heading",
@@ -175,14 +191,14 @@ const CommandGroup = (0, react.forwardRef)(function CommandGroup({ children, cla
175
191
  const CommandItem = (0, react.forwardRef)(function CommandItem({ children, className, disabled = false, keywords: itemKeywords, onClick, onMouseEnter, onSelect, value, ...props }, ref) {
176
192
  const context = useCommandContext();
177
193
  const groupId = (0, react.useContext)(CommandGroupContext);
178
- const id = `command-item-${value}`;
194
+ const id = `command-item-${(0, react.useId)().replace(/:/g, "")}`;
179
195
  const keywords = itemKeywords ?? EMPTY_KEYWORDS;
180
196
  const visible = context.matches({
181
197
  value,
182
198
  keywords
183
199
  });
184
200
  (0, react.useEffect)(() => context.registerItem({
185
- id: value,
201
+ id,
186
202
  value,
187
203
  keywords,
188
204
  disabled,
@@ -193,6 +209,7 @@ const CommandItem = (0, react.forwardRef)(function CommandItem({ children, class
193
209
  context.registerItem,
194
210
  disabled,
195
211
  groupId,
212
+ id,
196
213
  keywords,
197
214
  onSelect,
198
215
  value
@@ -206,29 +223,29 @@ const CommandItem = (0, react.forwardRef)(function CommandItem({ children, class
206
223
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
207
224
  ...props,
208
225
  ref: (node) => {
209
- context.setItemElement(value, node);
226
+ context.setItemElement(id, node);
210
227
  if (typeof ref === "function") ref(node);
211
228
  else if (ref) ref.current = node;
212
229
  },
213
230
  "aria-disabled": disabled || void 0,
214
- "aria-selected": context.highlighted === value,
231
+ "aria-selected": context.highlighted === id,
215
232
  className: require_cx.cx(require_command.command().item, className),
216
233
  "data-disabled": disabled || void 0,
217
- "data-highlighted": context.highlighted === value || void 0,
234
+ "data-highlighted": context.highlighted === id || void 0,
218
235
  "data-slot": "command-item",
219
236
  id,
220
237
  onClick: (event) => {
221
238
  onClick?.(event);
222
- if (!event.defaultPrevented && !disabled) context.selectItem(value);
239
+ if (!event.defaultPrevented && !disabled) context.selectItem(id);
223
240
  },
224
241
  onMouseEnter: (event) => {
225
242
  onMouseEnter?.(event);
226
- if (!disabled) context.setHighlighted(value);
243
+ if (!disabled) context.setHighlighted(id);
227
244
  },
228
245
  onKeyDown: (event) => {
229
246
  if ((event.key === "Enter" || event.key === " ") && !disabled) {
230
247
  event.preventDefault();
231
- context.selectItem(value);
248
+ context.selectItem(id);
232
249
  }
233
250
  },
234
251
  role: "option",
@@ -247,14 +264,16 @@ const CommandItemIndicator = (0, react.forwardRef)(function CommandItemIndicator
247
264
  });
248
265
  const CommandEmpty = (0, react.forwardRef)(function CommandEmpty({ className, ...props }, ref) {
249
266
  const context = useCommandContext();
250
- if (context.loading || context.items.length === 0 || context.items.some((item) => context.matches(item))) return null;
267
+ if (context.loading || context.items.some((item) => !item.disabled && context.matches(item))) return null;
251
268
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
252
269
  ...props,
253
270
  ref,
254
271
  className: require_cx.cx(require_command.command().empty, className),
255
272
  "aria-live": "polite",
273
+ "aria-disabled": "true",
256
274
  "data-slot": "command-empty",
257
- role: "presentation"
275
+ role: "option",
276
+ tabIndex: -1
258
277
  });
259
278
  });
260
279
  const CommandLoading = (0, react.forwardRef)(function CommandLoading({ className, ...props }, ref) {
@@ -264,8 +283,10 @@ const CommandLoading = (0, react.forwardRef)(function CommandLoading({ className
264
283
  ref,
265
284
  className: require_cx.cx(require_command.command().loading, className),
266
285
  "aria-live": "polite",
286
+ "aria-disabled": "true",
267
287
  "data-slot": "command-loading",
268
- role: "presentation"
288
+ role: "option",
289
+ tabIndex: -1
269
290
  });
270
291
  });
271
292
  const CommandSeparator = (0, react.forwardRef)(function CommandSeparator({ className, ...props }, ref) {
@@ -1 +1 @@
1
- {"version":3,"file":"command.cjs","names":["command","cx"],"sources":["../../../src/components/command/command.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { ChangeEvent, ComponentPropsWithoutRef, KeyboardEvent, ReactNode } from \"react\";\n\nimport { command } from \"../../styled-system/recipes\";\nimport { cx } from \"../../styled-system/css\";\n\nexport type CommandFilter = (value: string, search: string, keywords: readonly string[]) => boolean;\n\ninterface CommandItemRecord {\n id: string;\n value: string;\n keywords: readonly string[];\n disabled: boolean;\n groupId: string | undefined;\n onSelect: ((value: string) => void) | undefined;\n element: HTMLDivElement | null;\n}\n\ninterface CommandContextValue {\n search: string;\n setSearch: (search: string) => void;\n loading: boolean;\n shouldFilter: boolean;\n items: readonly CommandItemRecord[];\n highlighted: string | null;\n listId: string;\n matches: (item: Pick<CommandItemRecord, \"value\" | \"keywords\">) => boolean;\n registerItem: (item: CommandItemRecord) => () => void;\n setItemElement: (id: string, element: HTMLDivElement | null) => void;\n setHighlighted: (value: string | null) => void;\n selectItem: (value: string) => void;\n}\n\nconst CommandContext = createContext<CommandContextValue | null>(null);\nconst CommandGroupContext = createContext<string | undefined>(undefined);\nconst EMPTY_KEYWORDS: readonly string[] = [];\n\nfunction useCommandContext() {\n const context = useContext(CommandContext);\n if (!context) throw new Error(\"Command parts must be rendered inside Command.Root.\");\n return context;\n}\n\nfunction defaultFilter(value: string, search: string, keywords: readonly string[]) {\n const query = search.trim().toLocaleLowerCase();\n if (!query) return true;\n return [value, ...keywords].some((candidate) => candidate.toLocaleLowerCase().includes(query));\n}\n\nexport interface CommandRootProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n search?: string;\n defaultSearch?: string;\n onSearchChange?: (search: string) => void;\n filter?: CommandFilter;\n shouldFilter?: boolean;\n loopFocus?: boolean;\n loading?: boolean;\n children?: ReactNode;\n}\n\nexport const CommandRoot = forwardRef<HTMLDivElement, CommandRootProps>(function CommandRoot(\n {\n children,\n className,\n defaultSearch = \"\",\n filter = defaultFilter,\n loading = false,\n onKeyDown,\n onSearchChange,\n search: controlledSearch,\n shouldFilter = true,\n loopFocus = true,\n ...props\n },\n ref,\n) {\n const [uncontrolledSearch, setUncontrolledSearch] = useState(defaultSearch);\n const [highlighted, setHighlighted] = useState<string | null>(null);\n const [, setVersion] = useState(0);\n const itemsRef = useRef(new Map<string, CommandItemRecord>());\n const listId = useId();\n const search = controlledSearch ?? uncontrolledSearch;\n const styles = command();\n\n const items = Array.from(itemsRef.current.values());\n const setSearch = useCallback(\n (next: string) => {\n if (controlledSearch === undefined) setUncontrolledSearch(next);\n onSearchChange?.(next);\n },\n [controlledSearch, onSearchChange],\n );\n const matches = useCallback(\n (item: Pick<CommandItemRecord, \"value\" | \"keywords\">) =>\n !shouldFilter || filter(item.value, search, item.keywords),\n [filter, search, shouldFilter],\n );\n const visibleItems = items.filter((item) => !item.disabled && matches(item));\n\n const registerItem = useCallback((item: CommandItemRecord) => {\n itemsRef.current.set(item.id, item);\n setVersion((current) => current + 1);\n return () => {\n itemsRef.current.delete(item.id);\n setVersion((current) => current + 1);\n };\n }, []);\n\n const setItemElement = useCallback((id: string, element: HTMLDivElement | null) => {\n const item = itemsRef.current.get(id);\n if (item) item.element = element;\n }, []);\n\n const selectItem = useCallback(\n (value: string) => {\n const item = itemsRef.current.get(value);\n if (item && !item.disabled && matches(item)) item.onSelect?.(item.value);\n },\n [matches],\n );\n\n useEffect(() => {\n if (!visibleItems.some((item) => item.value === highlighted)) {\n setHighlighted(visibleItems[0]?.value ?? null);\n }\n }, [highlighted, visibleItems]);\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented) return;\n const currentIndex = visibleItems.findIndex((item) => item.value === highlighted);\n if ((event.key === \"ArrowDown\" || event.key === \"ArrowUp\") && visibleItems.length > 0) {\n event.preventDefault();\n const direction = event.key === \"ArrowDown\" ? 1 : -1;\n let nextIndex = currentIndex + direction;\n if (loopFocus) nextIndex = (nextIndex + visibleItems.length) % visibleItems.length;\n if (nextIndex >= 0 && nextIndex < visibleItems.length) {\n setHighlighted(visibleItems[nextIndex]?.value ?? null);\n }\n } else if (event.key === \"Home\" || event.key === \"End\") {\n event.preventDefault();\n setHighlighted((event.key === \"Home\" ? visibleItems[0] : visibleItems.at(-1))?.value ?? null);\n } else if (event.key === \"Enter\" && highlighted) {\n event.preventDefault();\n selectItem(highlighted);\n } else if (event.key === \"Escape\") {\n event.preventDefault();\n }\n };\n\n const context = useMemo<CommandContextValue>(\n () => ({\n search,\n setSearch,\n loading,\n shouldFilter,\n items,\n highlighted,\n listId,\n matches,\n registerItem,\n setItemElement,\n setHighlighted,\n selectItem,\n }),\n [\n highlighted,\n items,\n listId,\n loading,\n matches,\n registerItem,\n search,\n selectItem,\n setItemElement,\n setSearch,\n shouldFilter,\n ],\n );\n\n return (\n <CommandContext.Provider value={context}>\n <div\n {...props}\n ref={(node) => {\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n className={cx(styles.root, className)}\n data-disabled={props[\"aria-disabled\"] || undefined}\n data-jaci-component=\"command\"\n data-slot=\"command\"\n onKeyDown={handleKeyDown}\n role=\"application\"\n >\n {children}\n </div>\n </CommandContext.Provider>\n );\n});\n\nexport type CommandInputProps = ComponentPropsWithoutRef<\"input\">;\nexport const CommandInput = forwardRef<HTMLInputElement, CommandInputProps>(function CommandInput(\n { className, onChange, ...props },\n ref,\n) {\n const { highlighted, listId, search, setHighlighted, setSearch } = useCommandContext();\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n onChange?.(event);\n const next = event.target.value;\n setHighlighted(null);\n setSearch(next);\n };\n\n return (\n <input\n {...props}\n ref={ref}\n aria-activedescendant={highlighted ? `command-item-${highlighted}` : undefined}\n aria-controls={listId}\n aria-haspopup=\"listbox\"\n className={cx(command().input, className)}\n data-slot=\"command-input\"\n onChange={(event) => {\n handleChange(event);\n }}\n value={search}\n />\n );\n});\n\nexport type CommandListProps = ComponentPropsWithoutRef<\"div\">;\nexport const CommandList = forwardRef<HTMLDivElement, CommandListProps>(function CommandList(\n { className, id, ...props },\n ref,\n) {\n const { items, listId, matches } = useCommandContext();\n const hasVisibleItems = items.some((item) => !item.disabled && matches(item));\n return (\n <div\n {...props}\n ref={ref}\n id={id ?? listId}\n className={cx(command().list, className)}\n data-slot=\"command-list\"\n role={hasVisibleItems ? \"listbox\" : undefined}\n />\n );\n});\n\nexport interface CommandGroupProps extends ComponentPropsWithoutRef<\"div\"> {\n heading?: ReactNode;\n}\nexport const CommandGroup = forwardRef<HTMLDivElement, CommandGroupProps>(function CommandGroup(\n { children, className, heading, ...props },\n ref,\n) {\n const context = useCommandContext();\n const groupId = useId();\n const hasRegisteredItems = context.items.some((item) => item.groupId === groupId);\n const hasVisibleItems = context.items.some(\n (item) => item.groupId === groupId && context.matches(item),\n );\n return (\n <CommandGroupContext.Provider value={groupId}>\n <div\n {...props}\n ref={ref}\n aria-hidden={hasRegisteredItems && !hasVisibleItems ? true : undefined}\n className={cx(command().group, className)}\n data-slot=\"command-group\"\n hidden={hasRegisteredItems && !hasVisibleItems}\n >\n {heading ? (\n <div className={command().groupHeading} data-slot=\"command-group-heading\">\n {heading}\n </div>\n ) : null}\n {children}\n </div>\n </CommandGroupContext.Provider>\n );\n});\n\nexport interface CommandItemProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"onSelect\"> {\n value: string;\n keywords?: readonly string[];\n disabled?: boolean;\n onSelect?: (value: string) => void;\n}\nexport const CommandItem = forwardRef<HTMLDivElement, CommandItemProps>(function CommandItem(\n {\n children,\n className,\n disabled = false,\n keywords: itemKeywords,\n onClick,\n onMouseEnter,\n onSelect,\n value,\n ...props\n },\n ref,\n) {\n const context = useCommandContext();\n const groupId = useContext(CommandGroupContext);\n const id = `command-item-${value}`;\n const keywords = itemKeywords ?? EMPTY_KEYWORDS;\n const visible = context.matches({ value, keywords });\n\n useEffect(\n () =>\n context.registerItem({\n id: value,\n value,\n keywords,\n disabled,\n groupId,\n onSelect,\n element: null,\n }),\n [context.registerItem, disabled, groupId, keywords, onSelect, value],\n );\n\n if (!visible) {\n return <div aria-hidden=\"true\" hidden ref={ref} data-slot=\"command-item\" />;\n }\n\n return (\n <div\n {...props}\n ref={(node) => {\n context.setItemElement(value, node);\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n aria-disabled={disabled || undefined}\n aria-selected={context.highlighted === value}\n className={cx(command().item, className)}\n data-disabled={disabled || undefined}\n data-highlighted={context.highlighted === value || undefined}\n data-slot=\"command-item\"\n id={id}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented && !disabled) context.selectItem(value);\n }}\n onMouseEnter={(event) => {\n onMouseEnter?.(event);\n if (!disabled) context.setHighlighted(value);\n }}\n onKeyDown={(event) => {\n if ((event.key === \"Enter\" || event.key === \" \") && !disabled) {\n event.preventDefault();\n context.selectItem(value);\n }\n }}\n role=\"option\"\n tabIndex={-1}\n >\n {children}\n </div>\n );\n});\n\nexport type CommandItemIndicatorProps = ComponentPropsWithoutRef<\"span\">;\nexport const CommandItemIndicator = forwardRef<HTMLSpanElement, CommandItemIndicatorProps>(\n function CommandItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <span\n {...props}\n ref={ref}\n className={cx(command().itemIndicator, className)}\n data-slot=\"command-item-indicator\"\n >\n {children}\n </span>\n );\n },\n);\n\nexport type CommandEmptyProps = ComponentPropsWithoutRef<\"div\">;\nexport const CommandEmpty = forwardRef<HTMLDivElement, CommandEmptyProps>(function CommandEmpty(\n { className, ...props },\n ref,\n) {\n const context = useCommandContext();\n if (\n context.loading ||\n context.items.length === 0 ||\n context.items.some((item) => context.matches(item))\n )\n return null;\n return (\n <div\n {...props}\n ref={ref}\n className={cx(command().empty, className)}\n aria-live=\"polite\"\n data-slot=\"command-empty\"\n role=\"presentation\"\n />\n );\n});\n\nexport type CommandLoadingProps = ComponentPropsWithoutRef<\"div\">;\nexport const CommandLoading = forwardRef<HTMLDivElement, CommandLoadingProps>(\n function CommandLoading({ className, ...props }, ref) {\n const context = useCommandContext();\n if (!context.loading) return null;\n return (\n <div\n {...props}\n ref={ref}\n className={cx(command().loading, className)}\n aria-live=\"polite\"\n data-slot=\"command-loading\"\n role=\"presentation\"\n />\n );\n },\n);\n\nexport type CommandSeparatorProps = ComponentPropsWithoutRef<\"hr\">;\nexport const CommandSeparator = forwardRef<HTMLHRElement, CommandSeparatorProps>(\n function CommandSeparator({ className, ...props }, ref) {\n return (\n <hr\n {...props}\n ref={ref}\n role=\"presentation\"\n className={cx(command().separator, className)}\n data-slot=\"command-separator\"\n />\n );\n },\n);\n\nexport const Command = {\n Root: CommandRoot,\n Input: CommandInput,\n List: CommandList,\n Group: CommandGroup,\n Item: CommandItem,\n ItemIndicator: CommandItemIndicator,\n Empty: CommandEmpty,\n Loading: CommandLoading,\n Separator: CommandSeparator,\n};\n"],"mappings":";;;;;;AA6CA,MAAM,kBAAA,GAAA,MAAA,cAAA,CAA2D,IAAI;AACrE,MAAM,uBAAA,GAAA,MAAA,cAAA,CAAwD,KAAA,CAAS;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C,WAAAA,GAAGD,gBAAAA,QAAQ,CAAC,CAAC,SAAS,SAAS;EAC1C,aAAU;EACV,aAAU;EACV,MAAK;CACN,CAAA;AAEL,CACF;AAGA,MAAa,oBAAA,GAAA,MAAA,WAAA,CACX,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAS,KAAK;CACtD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;EACE,GAAI;EACC;EACL,MAAK;EACL,WAAWC,WAAAA,GAAGD,gBAAAA,QAAQ,CAAC,CAAC,WAAW,SAAS;EAC5C,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,UAAU;CACrB,MAAM;CACN,OAAO;CACP,MAAM;CACN,OAAO;CACP,MAAM;CACN,eAAe;CACf,OAAO;CACP,SAAS;CACT,WAAW;AACb"}
1
+ {"version":3,"file":"command.cjs","names":["command","cx"],"sources":["../../../src/components/command/command.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { ChangeEvent, ComponentPropsWithoutRef, KeyboardEvent, ReactNode } from \"react\";\n\nimport { command } from \"../../styled-system/recipes\";\nimport { cx } from \"../../styled-system/css\";\n\nexport type CommandFilter = (value: string, search: string, keywords: readonly string[]) => boolean;\n\ninterface CommandItemRecord {\n id: string;\n value: string;\n keywords: readonly string[];\n disabled: boolean;\n groupId: string | undefined;\n onSelect: ((value: string) => void) | undefined;\n element: HTMLDivElement | null;\n}\n\ninterface CommandContextValue {\n search: string;\n setSearch: (search: string) => void;\n loading: boolean;\n shouldFilter: boolean;\n items: readonly CommandItemRecord[];\n highlighted: string | null;\n listId: string;\n matches: (item: Pick<CommandItemRecord, \"value\" | \"keywords\">) => boolean;\n handleKeyDown: (event: KeyboardEvent<HTMLElement>) => void;\n registerItem: (item: CommandItemRecord) => () => void;\n setItemElement: (id: string, element: HTMLDivElement | null) => void;\n setHighlighted: (value: string | null) => void;\n selectItem: (id: string) => void;\n disabled: boolean;\n}\n\nconst CommandContext = createContext<CommandContextValue | null>(null);\nconst CommandGroupContext = createContext<string | undefined>(undefined);\nconst EMPTY_KEYWORDS: readonly string[] = [];\n\nfunction useCommandContext() {\n const context = useContext(CommandContext);\n if (!context) throw new Error(\"Command parts must be rendered inside Command.Root.\");\n return context;\n}\n\nfunction defaultFilter(value: string, search: string, keywords: readonly string[]) {\n const query = search.trim().toLocaleLowerCase();\n if (!query) return true;\n return [value, ...keywords].some((candidate) => candidate.toLocaleLowerCase().includes(query));\n}\n\nexport interface CommandRootProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n search?: string;\n defaultSearch?: string;\n onSearchChange?: (search: string) => void;\n filter?: CommandFilter;\n shouldFilter?: boolean;\n loopFocus?: boolean;\n disabled?: boolean;\n loading?: boolean;\n children?: ReactNode;\n}\n\nexport const CommandRoot = forwardRef<HTMLDivElement, CommandRootProps>(function CommandRoot(\n {\n children,\n className,\n defaultSearch = \"\",\n disabled = false,\n filter = defaultFilter,\n loading = false,\n onKeyDown,\n onSearchChange,\n search: controlledSearch,\n shouldFilter = true,\n loopFocus = true,\n ...props\n },\n ref,\n) {\n const [uncontrolledSearch, setUncontrolledSearch] = useState(defaultSearch);\n const [highlighted, setHighlighted] = useState<string | null>(null);\n const [, setVersion] = useState(0);\n const itemsRef = useRef(new Map<string, CommandItemRecord>());\n const listId = useId();\n const search = controlledSearch ?? uncontrolledSearch;\n const styles = command();\n\n const items = Array.from(itemsRef.current.values());\n const setSearch = useCallback(\n (next: string) => {\n if (controlledSearch === undefined) setUncontrolledSearch(next);\n onSearchChange?.(next);\n },\n [controlledSearch, onSearchChange],\n );\n const matches = useCallback(\n (item: Pick<CommandItemRecord, \"value\" | \"keywords\">) =>\n !shouldFilter || filter(item.value, search, item.keywords),\n [filter, search, shouldFilter],\n );\n const visibleItems = useMemo(\n () => items.filter((item) => !item.disabled && matches(item)),\n [items, matches],\n );\n\n const registerItem = useCallback((item: CommandItemRecord) => {\n itemsRef.current.set(item.id, item);\n setVersion((current) => current + 1);\n return () => {\n itemsRef.current.delete(item.id);\n setVersion((current) => current + 1);\n };\n }, []);\n\n const setItemElement = useCallback((id: string, element: HTMLDivElement | null) => {\n const item = itemsRef.current.get(id);\n if (item) item.element = element;\n }, []);\n\n const selectItem = useCallback(\n (id: string) => {\n const item = itemsRef.current.get(id);\n if (item && !item.disabled && matches(item)) item.onSelect?.(item.value);\n },\n [matches],\n );\n\n useEffect(() => {\n if (!visibleItems.some((item) => item.id === highlighted)) {\n setHighlighted(visibleItems[0]?.id ?? null);\n }\n }, [highlighted, visibleItems]);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLElement>) => {\n onKeyDown?.(event as KeyboardEvent<HTMLDivElement>);\n if (event.defaultPrevented) return;\n if (disabled) return;\n const currentIndex = visibleItems.findIndex((item) => item.id === highlighted);\n if ((event.key === \"ArrowDown\" || event.key === \"ArrowUp\") && visibleItems.length > 0) {\n event.preventDefault();\n const direction = event.key === \"ArrowDown\" ? 1 : -1;\n let nextIndex = currentIndex + direction;\n if (loopFocus) nextIndex = (nextIndex + visibleItems.length) % visibleItems.length;\n if (nextIndex >= 0 && nextIndex < visibleItems.length) {\n setHighlighted(visibleItems[nextIndex]?.id ?? null);\n }\n } else if (event.key === \"Home\" || event.key === \"End\") {\n event.preventDefault();\n setHighlighted((event.key === \"Home\" ? visibleItems[0] : visibleItems.at(-1))?.id ?? null);\n } else if (event.key === \"Enter\" && highlighted) {\n event.preventDefault();\n selectItem(highlighted);\n } else if (event.key === \"Escape\") {\n event.preventDefault();\n }\n },\n [disabled, highlighted, loopFocus, onKeyDown, selectItem, visibleItems],\n );\n\n const context = useMemo<CommandContextValue>(\n () => ({\n search,\n setSearch,\n disabled,\n handleKeyDown,\n loading,\n shouldFilter,\n items,\n highlighted,\n listId,\n matches,\n registerItem,\n setItemElement,\n setHighlighted,\n selectItem,\n }),\n [\n highlighted,\n disabled,\n handleKeyDown,\n items,\n listId,\n loading,\n matches,\n registerItem,\n search,\n selectItem,\n setItemElement,\n setSearch,\n shouldFilter,\n ],\n );\n\n return (\n <CommandContext.Provider value={context}>\n <div\n {...props}\n ref={(node) => {\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n className={cx(styles.root, className)}\n data-disabled={disabled || undefined}\n data-jaci-component=\"command\"\n data-slot=\"command\"\n aria-disabled={disabled || undefined}\n >\n {children}\n </div>\n </CommandContext.Provider>\n );\n});\n\nexport type CommandInputProps = ComponentPropsWithoutRef<\"input\">;\nexport const CommandInput = forwardRef<HTMLInputElement, CommandInputProps>(function CommandInput(\n { className, onChange, onKeyDown, ...props },\n ref,\n) {\n const { disabled, handleKeyDown, highlighted, listId, search, setHighlighted, setSearch } =\n useCommandContext();\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n onChange?.(event);\n const next = event.target.value;\n setHighlighted(null);\n setSearch(next);\n };\n\n return (\n <input\n {...props}\n ref={ref}\n aria-activedescendant={highlighted ?? undefined}\n aria-controls={listId}\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded=\"true\"\n className={cx(command().input, className)}\n data-slot=\"command-input\"\n disabled={disabled || props.disabled}\n onChange={(event) => {\n handleChange(event);\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n handleKeyDown(event);\n }}\n value={search}\n />\n );\n});\n\nexport type CommandListProps = ComponentPropsWithoutRef<\"div\">;\nexport const CommandList = forwardRef<HTMLDivElement, CommandListProps>(function CommandList(\n { className, id, ...props },\n ref,\n) {\n const { listId } = useCommandContext();\n return (\n <div\n {...props}\n ref={ref}\n id={id ?? listId}\n className={cx(command().list, className)}\n data-slot=\"command-list\"\n role=\"listbox\"\n />\n );\n});\n\nexport interface CommandGroupProps extends ComponentPropsWithoutRef<\"div\"> {\n heading?: ReactNode;\n}\nexport const CommandGroup = forwardRef<HTMLDivElement, CommandGroupProps>(function CommandGroup(\n { children, className, heading, ...props },\n ref,\n) {\n const context = useCommandContext();\n const groupId = useId();\n const hasVisibleItems = context.items.some(\n (item) => item.groupId === groupId && !item.disabled && context.matches(item),\n );\n return (\n <CommandGroupContext.Provider value={groupId}>\n <div\n {...props}\n ref={ref}\n aria-hidden={!hasVisibleItems || undefined}\n className={cx(command().group, className)}\n data-slot=\"command-group\"\n hidden={!hasVisibleItems}\n >\n {heading ? (\n <div className={command().groupHeading} data-slot=\"command-group-heading\">\n {heading}\n </div>\n ) : null}\n {children}\n </div>\n </CommandGroupContext.Provider>\n );\n});\n\nexport interface CommandItemProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"onSelect\"> {\n value: string;\n keywords?: readonly string[];\n disabled?: boolean;\n onSelect?: (value: string) => void;\n}\nexport const CommandItem = forwardRef<HTMLDivElement, CommandItemProps>(function CommandItem(\n {\n children,\n className,\n disabled = false,\n keywords: itemKeywords,\n onClick,\n onMouseEnter,\n onSelect,\n value,\n ...props\n },\n ref,\n) {\n const context = useCommandContext();\n const groupId = useContext(CommandGroupContext);\n const id = `command-item-${useId().replace(/:/g, \"\")}`;\n const keywords = itemKeywords ?? EMPTY_KEYWORDS;\n const visible = context.matches({ value, keywords });\n\n useEffect(\n () =>\n context.registerItem({\n id,\n value,\n keywords,\n disabled,\n groupId,\n onSelect,\n element: null,\n }),\n [context.registerItem, disabled, groupId, id, keywords, onSelect, value],\n );\n\n if (!visible) {\n return <div aria-hidden=\"true\" hidden ref={ref} data-slot=\"command-item\" />;\n }\n\n return (\n <div\n {...props}\n ref={(node) => {\n context.setItemElement(id, node);\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n aria-disabled={disabled || undefined}\n aria-selected={context.highlighted === id}\n className={cx(command().item, className)}\n data-disabled={disabled || undefined}\n data-highlighted={context.highlighted === id || undefined}\n data-slot=\"command-item\"\n id={id}\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented && !disabled) context.selectItem(id);\n }}\n onMouseEnter={(event) => {\n onMouseEnter?.(event);\n if (!disabled) context.setHighlighted(id);\n }}\n onKeyDown={(event) => {\n if ((event.key === \"Enter\" || event.key === \" \") && !disabled) {\n event.preventDefault();\n context.selectItem(id);\n }\n }}\n role=\"option\"\n tabIndex={-1}\n >\n {children}\n </div>\n );\n});\n\nexport type CommandItemIndicatorProps = ComponentPropsWithoutRef<\"span\">;\nexport const CommandItemIndicator = forwardRef<HTMLSpanElement, CommandItemIndicatorProps>(\n function CommandItemIndicator({ children = \"✓\", className, ...props }, ref) {\n return (\n <span\n {...props}\n ref={ref}\n className={cx(command().itemIndicator, className)}\n data-slot=\"command-item-indicator\"\n >\n {children}\n </span>\n );\n },\n);\n\nexport type CommandEmptyProps = ComponentPropsWithoutRef<\"div\">;\nexport const CommandEmpty = forwardRef<HTMLDivElement, CommandEmptyProps>(function CommandEmpty(\n { className, ...props },\n ref,\n) {\n const context = useCommandContext();\n if (context.loading || context.items.some((item) => !item.disabled && context.matches(item)))\n return null;\n return (\n <div\n {...props}\n ref={ref}\n className={cx(command().empty, className)}\n aria-live=\"polite\"\n aria-disabled=\"true\"\n data-slot=\"command-empty\"\n role=\"option\"\n tabIndex={-1}\n />\n );\n});\n\nexport type CommandLoadingProps = ComponentPropsWithoutRef<\"div\">;\nexport const CommandLoading = forwardRef<HTMLDivElement, CommandLoadingProps>(\n function CommandLoading({ className, ...props }, ref) {\n const context = useCommandContext();\n if (!context.loading) return null;\n return (\n <div\n {...props}\n ref={ref}\n className={cx(command().loading, className)}\n aria-live=\"polite\"\n aria-disabled=\"true\"\n data-slot=\"command-loading\"\n role=\"option\"\n tabIndex={-1}\n />\n );\n },\n);\n\nexport type CommandSeparatorProps = ComponentPropsWithoutRef<\"hr\">;\nexport const CommandSeparator = forwardRef<HTMLHRElement, CommandSeparatorProps>(\n function CommandSeparator({ className, ...props }, ref) {\n return (\n <hr\n {...props}\n ref={ref}\n role=\"presentation\"\n className={cx(command().separator, className)}\n data-slot=\"command-separator\"\n />\n );\n },\n);\n\nexport const Command = {\n Root: CommandRoot,\n Input: CommandInput,\n List: CommandList,\n Group: CommandGroup,\n Item: CommandItem,\n ItemIndicator: CommandItemIndicator,\n Empty: CommandEmpty,\n Loading: CommandLoading,\n Separator: CommandSeparator,\n};\n"],"mappings":";;;;;;AA+CA,MAAM,kBAAA,GAAA,MAAA,cAAA,CAA2D,IAAI;AACrE,MAAM,uBAAA,GAAA,MAAA,cAAA,CAAwD,KAAA,CAAS;AACvE,MAAM,iBAAoC,CAAC;AAE3C,SAAS,oBAAoB;CAC3B,MAAM,WAAA,GAAA,MAAA,WAAA,CAAqB,cAAc;CACzC,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,qDAAqD;CACnF,OAAO;AACT;AAEA,SAAS,cAAc,OAAe,QAAgB,UAA6B;CACjF,MAAM,QAAQ,OAAO,KAAK,CAAC,CAAC,kBAAkB;CAC9C,IAAI,CAAC,OAAO,OAAO;CACnB,OAAO,CAAC,OAAO,GAAG,QAAQ,CAAC,CAAC,MAAM,cAAc,UAAU,kBAAkB,CAAC,CAAC,SAAS,KAAK,CAAC;AAC/F;AAcA,MAAa,eAAA,GAAA,MAAA,WAAA,CAA2D,SAAS,YAC/E,EACE,UACA,WACA,gBAAgB,IAChB,WAAW,OACX,SAAS,eACT,UAAU,OACV,WACA,gBACA,QAAQ,kBACR,eAAe,MACf,YAAY,MACZ,GAAG,SAEL,KACA;CACA,MAAM,CAAC,oBAAoB,0BAAA,GAAA,MAAA,SAAA,CAAkC,aAAa;CAC1E,MAAM,CAAC,aAAa,mBAAA,GAAA,MAAA,SAAA,CAA0C,IAAI;CAClE,MAAM,GAAG,eAAA,GAAA,MAAA,SAAA,CAAuB,CAAC;CACjC,MAAM,YAAA,GAAA,MAAA,OAAA,iBAAkB,IAAI,IAA+B,CAAC;CAC5D,MAAM,UAAA,GAAA,MAAA,MAAA,CAAe;CACrB,MAAM,SAAS,oBAAoB;CACnC,MAAM,SAASA,gBAAAA,QAAQ;CAEvB,MAAM,QAAQ,MAAM,KAAK,SA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,GACzF,OAAO;CACT,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,WAAWC,WAAAA,GAAGD,gBAAAA,QAAQ,CAAC,CAAC,OAAO,SAAS;EACxC,aAAU;EACV,iBAAc;EACd,aAAU;EACV,MAAK;EACL,UAAU;CACX,CAAA;AAEL,CAAC;AAGD,MAAa,kBAAA,GAAA,MAAA,WAAA,CACX,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CAEpD,IAAI,CADY,kBACL,CAAC,CAAC,SAAS,OAAO;CAC7B,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,WAAWC,WAAAA,GAAGD,gBAAAA,QAAQ,CAAC,CAAC,SAAS,SAAS;EAC1C,aAAU;EACV,iBAAc;EACd,aAAU;EACV,MAAK;EACL,UAAU;CACX,CAAA;AAEL,CACF;AAGA,MAAa,oBAAA,GAAA,MAAA,WAAA,CACX,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAS,KAAK;CACtD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;EACE,GAAI;EACC;EACL,MAAK;EACL,WAAWC,WAAAA,GAAGD,gBAAAA,QAAQ,CAAC,CAAC,WAAW,SAAS;EAC5C,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,UAAU;CACrB,MAAM;CACN,OAAO;CACP,MAAM;CACN,OAAO;CACP,MAAM;CACN,eAAe;CACf,OAAO;CACP,SAAS;CACT,WAAW;AACb"}
@@ -8,6 +8,7 @@ interface CommandRootProps extends Omit<ComponentPropsWithoutRef<"div">, "childr
8
8
  filter?: CommandFilter;
9
9
  shouldFilter?: boolean;
10
10
  loopFocus?: boolean;
11
+ disabled?: boolean;
11
12
  loading?: boolean;
12
13
  children?: ReactNode;
13
14
  }
@@ -8,6 +8,7 @@ interface CommandRootProps extends Omit<ComponentPropsWithoutRef<"div">, "childr
8
8
  filter?: CommandFilter;
9
9
  shouldFilter?: boolean;
10
10
  loopFocus?: boolean;
11
+ disabled?: boolean;
11
12
  loading?: boolean;
12
13
  children?: ReactNode;
13
14
  }