@proyecto-viviana/solid-stately 0.2.4 → 0.3.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 (243) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +30 -283
  3. package/dist/autocomplete/createAutocompleteState.d.ts +3 -2
  4. package/dist/autocomplete/index.d.ts +1 -1
  5. package/dist/calendar/createCalendarState.d.ts +22 -7
  6. package/dist/calendar/createDateFieldState.d.ts +30 -7
  7. package/dist/calendar/createDatePickerState.d.ts +60 -0
  8. package/dist/calendar/createRangeCalendarState.d.ts +27 -8
  9. package/dist/calendar/createTimeFieldState.d.ts +34 -7
  10. package/dist/calendar/index.d.ts +7 -6
  11. package/dist/checkbox/createCheckboxGroupState.d.ts +12 -3
  12. package/dist/checkbox/index.d.ts +1 -1
  13. package/dist/collections/ListCollection.d.ts +1 -1
  14. package/dist/collections/createListState.d.ts +8 -8
  15. package/dist/collections/createMenuState.d.ts +7 -7
  16. package/dist/collections/createSelectionState.d.ts +5 -5
  17. package/dist/collections/index.d.ts +5 -5
  18. package/dist/collections/types.d.ts +23 -12
  19. package/dist/color/Color.d.ts +1 -1
  20. package/dist/color/createColorAreaState.d.ts +4 -2
  21. package/dist/color/createColorFieldState.d.ts +38 -12
  22. package/dist/color/createColorSliderState.d.ts +9 -2
  23. package/dist/color/createColorWheelState.d.ts +13 -2
  24. package/dist/color/getColorChannels.d.ts +20 -0
  25. package/dist/color/index.d.ts +6 -6
  26. package/dist/color/types.d.ts +4 -4
  27. package/dist/combobox/createComboBoxState.d.ts +27 -13
  28. package/dist/combobox/index.d.ts +1 -1
  29. package/dist/data/createAsyncList.d.ts +111 -0
  30. package/dist/data/createListData.d.ts +65 -0
  31. package/dist/data/createTreeData.d.ts +65 -0
  32. package/dist/data/index.d.ts +3 -0
  33. package/dist/datepicker/index.d.ts +8 -0
  34. package/dist/disclosure/createDisclosureState.d.ts +2 -2
  35. package/dist/disclosure/index.d.ts +1 -1
  36. package/dist/dnd/createDragState.d.ts +2 -2
  37. package/dist/dnd/createDraggableCollectionState.d.ts +2 -2
  38. package/dist/dnd/createDropState.d.ts +2 -2
  39. package/dist/dnd/createDroppableCollectionState.d.ts +3 -3
  40. package/dist/dnd/index.d.ts +5 -5
  41. package/dist/dnd/types.d.ts +16 -16
  42. package/dist/form/createFormValidationState.d.ts +3 -3
  43. package/dist/form/index.d.ts +1 -1
  44. package/dist/grid/createGridState.d.ts +2 -2
  45. package/dist/grid/index.d.ts +2 -2
  46. package/dist/grid/types.d.ts +17 -11
  47. package/dist/index.d.ts +31 -25
  48. package/dist/index.js +7990 -6264
  49. package/dist/index.js.map +1 -7
  50. package/dist/menu/index.d.ts +8 -0
  51. package/dist/numberfield/createNumberFieldState.d.ts +2 -2
  52. package/dist/numberfield/index.d.ts +1 -1
  53. package/dist/overlays/createOverlayTriggerState.d.ts +2 -2
  54. package/dist/overlays/index.d.ts +1 -1
  55. package/dist/radio/createRadioGroupState.d.ts +13 -4
  56. package/dist/radio/index.d.ts +1 -1
  57. package/dist/searchfield/createSearchFieldState.d.ts +2 -2
  58. package/dist/searchfield/index.d.ts +2 -2
  59. package/dist/select/createSelectState.d.ts +20 -3
  60. package/dist/select/index.d.ts +1 -1
  61. package/dist/selection/index.d.ts +11 -0
  62. package/dist/slider/createSliderState.d.ts +3 -3
  63. package/dist/slider/index.d.ts +2 -2
  64. package/dist/steplist/createStepListState.d.ts +48 -0
  65. package/dist/steplist/index.d.ts +1 -0
  66. package/dist/table/TableCollection.d.ts +3 -3
  67. package/dist/table/createTableColumnResizeState.d.ts +54 -0
  68. package/dist/table/createTableState.d.ts +2 -2
  69. package/dist/table/index.d.ts +5 -3
  70. package/dist/table/types.d.ts +10 -10
  71. package/dist/tabs/createTabListState.d.ts +5 -5
  72. package/dist/tabs/index.d.ts +1 -1
  73. package/dist/textfield/createTextFieldState.d.ts +2 -2
  74. package/dist/textfield/index.d.ts +1 -1
  75. package/dist/toast/createToastState.d.ts +15 -3
  76. package/dist/toast/index.d.ts +1 -1
  77. package/dist/toggle/createToggleGroupState.d.ts +45 -0
  78. package/dist/toggle/createToggleState.d.ts +2 -2
  79. package/dist/toggle/index.d.ts +2 -1
  80. package/dist/tooltip/createTooltipTriggerState.d.ts +2 -2
  81. package/dist/tooltip/index.d.ts +1 -1
  82. package/dist/tree/TreeCollection.d.ts +5 -4
  83. package/dist/tree/createTreeState.d.ts +2 -2
  84. package/dist/tree/index.d.ts +3 -3
  85. package/dist/tree/types.d.ts +19 -13
  86. package/dist/utils/index.d.ts +1 -1
  87. package/dist/utils/reactivity.d.ts +1 -1
  88. package/package.json +30 -30
  89. package/src/autocomplete/createAutocompleteState.d.ts +19 -17
  90. package/src/autocomplete/createAutocompleteState.ts +25 -32
  91. package/src/autocomplete/index.d.ts +6 -2
  92. package/src/autocomplete/index.ts +1 -1
  93. package/src/calendar/createCalendarState.d.ts +139 -117
  94. package/src/calendar/createCalendarState.ts +221 -74
  95. package/src/calendar/createDateFieldState.d.ts +130 -95
  96. package/src/calendar/createDateFieldState.ts +286 -151
  97. package/src/calendar/createDatePickerState.ts +347 -0
  98. package/src/calendar/createRangeCalendarState.d.ts +154 -129
  99. package/src/calendar/createRangeCalendarState.ts +293 -79
  100. package/src/calendar/createTimeFieldState.d.ts +81 -79
  101. package/src/calendar/createTimeFieldState.ts +187 -108
  102. package/src/calendar/index.d.ts +80 -7
  103. package/src/calendar/index.ts +21 -12
  104. package/src/checkbox/createCheckboxGroupState.d.ts +57 -55
  105. package/src/checkbox/createCheckboxGroupState.ts +57 -30
  106. package/src/checkbox/index.d.ts +6 -2
  107. package/src/checkbox/index.ts +1 -1
  108. package/src/collections/ListCollection.d.ts +25 -22
  109. package/src/collections/ListCollection.ts +152 -146
  110. package/src/collections/createListState.d.ts +73 -58
  111. package/src/collections/createListState.ts +267 -264
  112. package/src/collections/createMenuState.d.ts +36 -31
  113. package/src/collections/createMenuState.ts +112 -106
  114. package/src/collections/createSelectionState.d.ts +78 -65
  115. package/src/collections/createSelectionState.ts +340 -336
  116. package/src/collections/index.d.ts +38 -6
  117. package/src/collections/index.ts +41 -46
  118. package/src/collections/types.d.ts +101 -101
  119. package/src/collections/types.ts +181 -169
  120. package/src/color/Color.d.ts +20 -5
  121. package/src/color/Color.ts +1054 -951
  122. package/src/color/createColorAreaState.d.ts +67 -65
  123. package/src/color/createColorAreaState.ts +301 -293
  124. package/src/color/createColorFieldState.d.ts +46 -44
  125. package/src/color/createColorFieldState.ts +428 -292
  126. package/src/color/createColorSliderState.d.ts +58 -56
  127. package/src/color/createColorSliderState.ts +272 -241
  128. package/src/color/createColorWheelState.d.ts +42 -40
  129. package/src/color/createColorWheelState.ts +248 -211
  130. package/src/color/getColorChannels.ts +36 -0
  131. package/src/color/index.d.ts +36 -7
  132. package/src/color/index.ts +44 -47
  133. package/src/color/types.d.ts +68 -63
  134. package/src/color/types.ts +119 -127
  135. package/src/combobox/createComboBoxState.d.ts +107 -105
  136. package/src/combobox/createComboBoxState.ts +790 -703
  137. package/src/combobox/index.d.ts +10 -2
  138. package/src/combobox/index.ts +13 -13
  139. package/src/data/createAsyncList.ts +403 -0
  140. package/src/data/createListData.ts +298 -0
  141. package/src/data/createTreeData.ts +646 -0
  142. package/src/data/index.ts +25 -0
  143. package/src/datepicker/index.ts +32 -0
  144. package/src/disclosure/createDisclosureState.d.ts +47 -43
  145. package/src/disclosure/createDisclosureState.ts +9 -23
  146. package/src/disclosure/index.d.ts +10 -2
  147. package/src/disclosure/index.ts +1 -1
  148. package/src/dnd/createDragState.d.ts +51 -42
  149. package/src/dnd/createDragState.ts +151 -153
  150. package/src/dnd/createDraggableCollectionState.d.ts +52 -41
  151. package/src/dnd/createDraggableCollectionState.ts +158 -165
  152. package/src/dnd/createDropState.d.ts +64 -45
  153. package/src/dnd/createDropState.ts +202 -212
  154. package/src/dnd/createDroppableCollectionState.d.ts +88 -59
  155. package/src/dnd/createDroppableCollectionState.ts +354 -357
  156. package/src/dnd/index.d.ts +54 -6
  157. package/src/dnd/index.ts +63 -76
  158. package/src/dnd/types.d.ts +167 -156
  159. package/src/dnd/types.ts +316 -317
  160. package/src/form/createFormValidationState.d.ts +47 -45
  161. package/src/form/createFormValidationState.ts +356 -389
  162. package/src/form/index.d.ts +16 -2
  163. package/src/form/index.ts +15 -15
  164. package/src/grid/createGridState.d.ts +7 -4
  165. package/src/grid/createGridState.ts +44 -51
  166. package/src/grid/index.d.ts +3 -3
  167. package/src/grid/index.ts +2 -8
  168. package/src/grid/types.d.ts +136 -129
  169. package/src/grid/types.ts +24 -17
  170. package/src/index.d.ts +310 -26
  171. package/src/index.ts +87 -79
  172. package/src/menu/index.ts +17 -0
  173. package/src/numberfield/createNumberFieldState.d.ts +56 -54
  174. package/src/numberfield/createNumberFieldState.ts +422 -383
  175. package/src/numberfield/index.d.ts +6 -2
  176. package/src/numberfield/index.ts +5 -5
  177. package/src/overlays/createOverlayTriggerState.d.ts +22 -20
  178. package/src/overlays/createOverlayTriggerState.ts +66 -67
  179. package/src/overlays/index.d.ts +6 -2
  180. package/src/overlays/index.ts +5 -5
  181. package/src/radio/createRadioGroupState.d.ts +54 -52
  182. package/src/radio/createRadioGroupState.ts +66 -30
  183. package/src/radio/index.d.ts +7 -2
  184. package/src/radio/index.ts +1 -1
  185. package/src/searchfield/createSearchFieldState.d.ts +16 -14
  186. package/src/searchfield/createSearchFieldState.ts +56 -62
  187. package/src/searchfield/index.d.ts +3 -3
  188. package/src/searchfield/index.ts +2 -5
  189. package/src/select/createSelectState.d.ts +63 -61
  190. package/src/select/createSelectState.ts +290 -181
  191. package/src/select/index.d.ts +2 -2
  192. package/src/select/index.ts +1 -5
  193. package/src/selection/index.ts +27 -0
  194. package/src/slider/createSliderState.d.ts +60 -60
  195. package/src/slider/createSliderState.ts +233 -211
  196. package/src/slider/index.d.ts +3 -3
  197. package/src/slider/index.ts +2 -6
  198. package/src/ssr/index.d.ts +1 -1
  199. package/src/ssr/index.ts +2 -2
  200. package/src/steplist/createStepListState.ts +191 -0
  201. package/src/steplist/index.ts +5 -0
  202. package/src/table/TableCollection.d.ts +42 -40
  203. package/src/table/TableCollection.ts +61 -64
  204. package/src/table/createTableColumnResizeState.ts +242 -0
  205. package/src/table/createTableState.d.ts +7 -4
  206. package/src/table/createTableState.ts +10 -7
  207. package/src/table/index.d.ts +14 -4
  208. package/src/table/index.ts +10 -3
  209. package/src/table/types.d.ts +98 -92
  210. package/src/table/types.ts +17 -13
  211. package/src/tabs/createTabListState.d.ts +59 -57
  212. package/src/tabs/createTabListState.ts +58 -39
  213. package/src/tabs/index.d.ts +8 -2
  214. package/src/tabs/index.ts +1 -1
  215. package/src/textfield/createTextFieldState.d.ts +16 -14
  216. package/src/textfield/createTextFieldState.ts +7 -18
  217. package/src/textfield/index.d.ts +6 -2
  218. package/src/textfield/index.ts +1 -1
  219. package/src/toast/createToastState.d.ts +92 -81
  220. package/src/toast/createToastState.ts +56 -44
  221. package/src/toast/index.d.ts +12 -2
  222. package/src/toast/index.ts +1 -1
  223. package/src/toggle/createToggleGroupState.ts +117 -0
  224. package/src/toggle/createToggleState.d.ts +19 -19
  225. package/src/toggle/createToggleState.ts +2 -16
  226. package/src/toggle/index.d.ts +2 -2
  227. package/src/toggle/index.ts +6 -4
  228. package/src/tooltip/createTooltipTriggerState.d.ts +17 -17
  229. package/src/tooltip/createTooltipTriggerState.ts +184 -183
  230. package/src/tooltip/index.d.ts +7 -2
  231. package/src/tooltip/index.ts +6 -6
  232. package/src/tree/TreeCollection.d.ts +26 -23
  233. package/src/tree/TreeCollection.ts +215 -175
  234. package/src/tree/createTreeState.d.ts +7 -4
  235. package/src/tree/createTreeState.ts +390 -392
  236. package/src/tree/index.d.ts +10 -4
  237. package/src/tree/index.ts +13 -13
  238. package/src/tree/types.d.ts +131 -126
  239. package/src/tree/types.ts +183 -174
  240. package/src/utils/index.d.ts +2 -2
  241. package/src/utils/index.ts +1 -1
  242. package/src/utils/reactivity.d.ts +2 -2
  243. package/src/utils/reactivity.ts +3 -3
@@ -1,6 +1,38 @@
1
- export type { Key, SelectionMode, SelectionBehavior, Selection, FocusStrategy, DisabledBehavior, CollectionNode, Collection, ItemProps, SectionProps, CollectionBase, SingleSelection, MultipleSelection, } from './types';
2
- export { ListCollection, createListCollection } from './ListCollection';
3
- export { createSelectionState, type SelectionStateProps, type SelectionState, } from './createSelectionState';
4
- export { createListState, createSingleSelectListState, type ListStateProps, type ListState, type SingleSelectListStateProps, type SingleSelectListState, } from './createListState';
5
- export { createMenuState, createMenuTriggerState, type MenuStateProps, type MenuState, type MenuTriggerStateProps, type MenuTriggerState, } from './createMenuState';
6
- //# sourceMappingURL=index.d.ts.map
1
+ export type {
2
+ Key,
3
+ SelectionMode,
4
+ SelectionBehavior,
5
+ Selection,
6
+ FocusStrategy,
7
+ DisabledBehavior,
8
+ CollectionNode,
9
+ Collection,
10
+ ItemProps,
11
+ SectionProps,
12
+ CollectionBase,
13
+ SingleSelection,
14
+ MultipleSelection,
15
+ } from "./types";
16
+ export { ListCollection, createListCollection } from "./ListCollection";
17
+ export {
18
+ createSelectionState,
19
+ type SelectionStateProps,
20
+ type SelectionState,
21
+ } from "./createSelectionState";
22
+ export {
23
+ createListState,
24
+ createSingleSelectListState,
25
+ type ListStateProps,
26
+ type ListState,
27
+ type SingleSelectListStateProps,
28
+ type SingleSelectListState,
29
+ } from "./createListState";
30
+ export {
31
+ createMenuState,
32
+ createMenuTriggerState,
33
+ type MenuStateProps,
34
+ type MenuState,
35
+ type MenuTriggerStateProps,
36
+ type MenuTriggerState,
37
+ } from "./createMenuState";
38
+ //# sourceMappingURL=index.d.ts.map
@@ -1,46 +1,41 @@
1
- // Types
2
- export type {
3
- Key,
4
- SelectionMode,
5
- SelectionBehavior,
6
- Selection,
7
- FocusStrategy,
8
- DisabledBehavior,
9
- CollectionNode,
10
- Collection,
11
- ItemProps,
12
- SectionProps,
13
- CollectionBase,
14
- SingleSelection,
15
- MultipleSelection,
16
- } from './types';
17
-
18
- // List Collection
19
- export { ListCollection, createListCollection } from './ListCollection';
20
-
21
- // Selection State
22
- export {
23
- createSelectionState,
24
- type SelectionStateProps,
25
- type SelectionState,
26
- } from './createSelectionState';
27
-
28
- // List State
29
- export {
30
- createListState,
31
- createSingleSelectListState,
32
- type ListStateProps,
33
- type ListState,
34
- type SingleSelectListStateProps,
35
- type SingleSelectListState,
36
- } from './createListState';
37
-
38
- // Menu State
39
- export {
40
- createMenuState,
41
- createMenuTriggerState,
42
- type MenuStateProps,
43
- type MenuState,
44
- type MenuTriggerStateProps,
45
- type MenuTriggerState,
46
- } from './createMenuState';
1
+ export type {
2
+ Key,
3
+ SelectionMode,
4
+ SelectionBehavior,
5
+ Selection,
6
+ FocusStrategy,
7
+ DisabledBehavior,
8
+ CollectionNode,
9
+ Collection,
10
+ ItemProps,
11
+ SectionProps,
12
+ CollectionBase,
13
+ SingleSelection,
14
+ MultipleSelection,
15
+ } from "./types";
16
+
17
+ export { ListCollection, createListCollection } from "./ListCollection";
18
+
19
+ export {
20
+ createSelectionState,
21
+ type SelectionStateProps,
22
+ type SelectionState,
23
+ } from "./createSelectionState";
24
+
25
+ export {
26
+ createListState,
27
+ createSingleSelectListState,
28
+ type ListStateProps,
29
+ type ListState,
30
+ type SingleSelectListStateProps,
31
+ type SingleSelectListState,
32
+ } from "./createListState";
33
+
34
+ export {
35
+ createMenuState,
36
+ createMenuTriggerState,
37
+ type MenuStateProps,
38
+ type MenuState,
39
+ type MenuTriggerStateProps,
40
+ type MenuTriggerState,
41
+ } from "./createMenuState";
@@ -2,146 +2,146 @@
2
2
  * Core types for collection state management.
3
3
  * Simplified from @react-stately/collections for SolidJS.
4
4
  */
5
- import type { JSX } from 'solid-js';
5
+ import type { JSX } from "solid-js";
6
6
  /** A unique identifier for an item in a collection. */
7
7
  export type Key = string | number;
8
8
  /** The type of selection allowed in a collection. */
9
- export type SelectionMode = 'none' | 'single' | 'multiple';
9
+ export type SelectionMode = "none" | "single" | "multiple";
10
10
  /** How selection behaves when clicking on items. */
11
- export type SelectionBehavior = 'toggle' | 'replace';
11
+ export type SelectionBehavior = "toggle" | "replace";
12
12
  /** Represents the current selection state. */
13
- export type Selection = 'all' | Set<Key>;
13
+ export type Selection = "all" | Set<Key>;
14
14
  /** Strategy for focusing first or last item. */
15
- export type FocusStrategy = 'first' | 'last';
15
+ export type FocusStrategy = "first" | "last";
16
16
  /** Whether disabled keys affect selection, actions, or both. */
17
- export type DisabledBehavior = 'selection' | 'all';
17
+ export type DisabledBehavior = "selection" | "all";
18
18
  /**
19
19
  * Represents a node in a collection (item or section).
20
20
  */
21
21
  export interface CollectionNode<T = unknown> {
22
- /** The type of node: 'item' or 'section'. */
23
- type: 'item' | 'section';
24
- /** A unique key for the node. */
25
- key: Key;
26
- /** The original value/data for this node. */
27
- value: T | null;
28
- /** The text content for accessibility and typeahead. */
29
- textValue: string;
30
- /** The rendered content (JSX). */
31
- rendered: JSX.Element;
32
- /** The level of nesting (0 for top-level). */
33
- level: number;
34
- /** The index within the parent. */
35
- index: number;
36
- /** The key of the parent node, if any. */
37
- parentKey: Key | null;
38
- /** Whether this node has child nodes. */
39
- hasChildNodes: boolean;
40
- /** Child nodes, if any. */
41
- childNodes: CollectionNode<T>[];
42
- /** Whether this item is disabled. */
43
- isDisabled?: boolean;
44
- /** ARIA label for this node. */
45
- 'aria-label'?: string;
46
- /** Additional props for the node. */
47
- props?: Record<string, unknown>;
22
+ /** The type of node: 'item' or 'section'. */
23
+ type: "item" | "section";
24
+ /** A unique key for the node. */
25
+ key: Key;
26
+ /** The original value/data for this node. */
27
+ value: T | null;
28
+ /** The text content for accessibility and typeahead. */
29
+ textValue: string;
30
+ /** The rendered content (JSX). */
31
+ rendered: JSX.Element;
32
+ /** The level of nesting (0 for top-level). */
33
+ level: number;
34
+ /** The index within the parent. */
35
+ index: number;
36
+ /** The key of the parent node, if any. */
37
+ parentKey: Key | null;
38
+ /** Whether this node has child nodes. */
39
+ hasChildNodes: boolean;
40
+ /** Child nodes, if any. */
41
+ childNodes: CollectionNode<T>[];
42
+ /** Whether this item is disabled. */
43
+ isDisabled?: boolean;
44
+ /** ARIA label for this node. */
45
+ "aria-label"?: string;
46
+ /** Additional props for the node. */
47
+ props?: Record<string, unknown>;
48
48
  }
49
49
  /**
50
50
  * A collection of nodes with methods to traverse and query.
51
51
  */
52
52
  export interface Collection<T = unknown> extends Iterable<CollectionNode<T>> {
53
- /** The number of items in the collection. */
54
- readonly size: number;
55
- /** Get all keys in the collection. */
56
- getKeys(): Iterable<Key>;
57
- /** Get a node by its key. */
58
- getItem(key: Key): CollectionNode<T> | null;
59
- /** Get a node by index. */
60
- at(index: number): CollectionNode<T> | null;
61
- /** Get the key before the given key. */
62
- getKeyBefore(key: Key): Key | null;
63
- /** Get the key after the given key. */
64
- getKeyAfter(key: Key): Key | null;
65
- /** Get the first key in the collection. */
66
- getFirstKey(): Key | null;
67
- /** Get the last key in the collection. */
68
- getLastKey(): Key | null;
69
- /** Get the children of a node. */
70
- getChildren(key: Key): Iterable<CollectionNode<T>>;
71
- /** Get the text value for a key. */
72
- getTextValue(key: Key): string;
53
+ /** The number of items in the collection. */
54
+ readonly size: number;
55
+ /** Get all keys in the collection. */
56
+ getKeys(): Iterable<Key>;
57
+ /** Get a node by its key. */
58
+ getItem(key: Key): CollectionNode<T> | null;
59
+ /** Get a node by index. */
60
+ at(index: number): CollectionNode<T> | null;
61
+ /** Get the key before the given key. */
62
+ getKeyBefore(key: Key): Key | null;
63
+ /** Get the key after the given key. */
64
+ getKeyAfter(key: Key): Key | null;
65
+ /** Get the first key in the collection. */
66
+ getFirstKey(): Key | null;
67
+ /** Get the last key in the collection. */
68
+ getLastKey(): Key | null;
69
+ /** Get the children of a node. */
70
+ getChildren(key: Key): Iterable<CollectionNode<T>>;
71
+ /** Get the text value for a key. */
72
+ getTextValue(key: Key): string;
73
73
  }
74
74
  /**
75
75
  * Props for items in a collection.
76
76
  */
77
77
  export interface ItemProps<T = unknown> {
78
- /** Unique key for the item. Required if items is used for dynamic collections. */
79
- key?: Key;
80
- /** The text value for accessibility and typeahead. If not provided, derived from children. */
81
- textValue?: string;
82
- /** Whether the item is disabled. */
83
- isDisabled?: boolean;
84
- /** The rendered content of the item. */
85
- children?: JSX.Element;
86
- /** ARIA label for the item. */
87
- 'aria-label'?: string;
88
- /** The original value for dynamic collections. */
89
- value?: T;
78
+ /** Unique key for the item. Required if items is used for dynamic collections. */
79
+ key?: Key;
80
+ /** The text value for accessibility and typeahead. If not provided, derived from children. */
81
+ textValue?: string;
82
+ /** Whether the item is disabled. */
83
+ isDisabled?: boolean;
84
+ /** The rendered content of the item. */
85
+ children?: JSX.Element;
86
+ /** ARIA label for the item. */
87
+ "aria-label"?: string;
88
+ /** The original value for dynamic collections. */
89
+ value?: T;
90
90
  }
91
91
  /**
92
92
  * Props for sections in a collection.
93
93
  */
94
94
  export interface SectionProps<T = unknown> {
95
- /** Unique key for the section. */
96
- key?: Key;
97
- /** The section header/title. */
98
- title?: JSX.Element;
99
- /** ARIA label for the section. */
100
- 'aria-label'?: string;
101
- /** The items in this section. */
102
- children?: JSX.Element;
103
- /** Items for dynamic rendering. */
104
- items?: Iterable<T>;
95
+ /** Unique key for the section. */
96
+ key?: Key;
97
+ /** The section header/title. */
98
+ title?: JSX.Element;
99
+ /** ARIA label for the section. */
100
+ "aria-label"?: string;
101
+ /** The items in this section. */
102
+ children?: JSX.Element;
103
+ /** Items for dynamic rendering. */
104
+ items?: Iterable<T>;
105
105
  }
106
106
  /**
107
107
  * Base props for components that use collections.
108
108
  */
109
109
  export interface CollectionBase<T = unknown> {
110
- /** The items in the collection (for dynamic rendering). */
111
- items?: Iterable<T>;
112
- /** The children (static items or render function). */
113
- children?: JSX.Element | ((item: T) => JSX.Element);
114
- /** Keys of disabled items. */
115
- disabledKeys?: Iterable<Key>;
110
+ /** The items in the collection (for dynamic rendering). */
111
+ items?: Iterable<T>;
112
+ /** The children (static items or render function). */
113
+ children?: JSX.Element | ((item: T) => JSX.Element);
114
+ /** Keys of disabled items. */
115
+ disabledKeys?: Iterable<Key>;
116
116
  }
117
117
  /**
118
118
  * Props for single selection.
119
119
  */
120
120
  export interface SingleSelection {
121
- /** Whether empty selection is allowed. */
122
- disallowEmptySelection?: boolean;
123
- /** The currently selected key (controlled). */
124
- selectedKey?: Key | null;
125
- /** The default selected key (uncontrolled). */
126
- defaultSelectedKey?: Key;
127
- /** Handler called when selection changes. */
128
- onSelectionChange?: (key: Key | null) => void;
121
+ /** Whether empty selection is allowed. */
122
+ disallowEmptySelection?: boolean;
123
+ /** The currently selected key (controlled). */
124
+ selectedKey?: Key | null;
125
+ /** The default selected key (uncontrolled). */
126
+ defaultSelectedKey?: Key;
127
+ /** Handler called when selection changes. */
128
+ onSelectionChange?: (key: Key | null) => void;
129
129
  }
130
130
  /**
131
131
  * Props for multiple selection.
132
132
  */
133
133
  export interface MultipleSelection {
134
- /** The selection mode. */
135
- selectionMode?: SelectionMode;
136
- /** Whether empty selection is allowed. */
137
- disallowEmptySelection?: boolean;
138
- /** The currently selected keys (controlled). */
139
- selectedKeys?: 'all' | Iterable<Key>;
140
- /** The default selected keys (uncontrolled). */
141
- defaultSelectedKeys?: 'all' | Iterable<Key>;
142
- /** Handler called when selection changes. */
143
- onSelectionChange?: (keys: Selection) => void;
144
- /** Keys of disabled items. */
145
- disabledKeys?: Iterable<Key>;
134
+ /** The selection mode. */
135
+ selectionMode?: SelectionMode;
136
+ /** Whether empty selection is allowed. */
137
+ disallowEmptySelection?: boolean;
138
+ /** The currently selected keys (controlled). */
139
+ selectedKeys?: "all" | Iterable<Key>;
140
+ /** The default selected keys (uncontrolled). */
141
+ defaultSelectedKeys?: "all" | Iterable<Key>;
142
+ /** Handler called when selection changes. */
143
+ onSelectionChange?: (keys: Selection) => void;
144
+ /** Keys of disabled items. */
145
+ disabledKeys?: Iterable<Key>;
146
146
  }
147
- //# sourceMappingURL=types.d.ts.map
147
+ //# sourceMappingURL=types.d.ts.map