@proyecto-viviana/solid-stately 0.2.7 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/README.md +30 -283
  2. package/dist/autocomplete/createAutocompleteState.d.ts +2 -2
  3. package/dist/autocomplete/index.d.ts +1 -1
  4. package/dist/calendar/IncompleteDate.d.ts +61 -0
  5. package/dist/calendar/createCalendarState.d.ts +41 -16
  6. package/dist/calendar/createDateFieldState.d.ts +39 -9
  7. package/dist/calendar/createDatePickerState.d.ts +60 -0
  8. package/dist/calendar/createRangeCalendarState.d.ts +37 -10
  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 +6 -6
  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 +11 -8
  15. package/dist/collections/createMenuState.d.ts +7 -7
  16. package/dist/collections/createSelectionState.d.ts +22 -10
  17. package/dist/collections/getChildNodes.d.ts +11 -0
  18. package/dist/collections/index.d.ts +6 -5
  19. package/dist/collections/types.d.ts +12 -12
  20. package/dist/color/Color.d.ts +1 -1
  21. package/dist/color/createColorAreaState.d.ts +4 -2
  22. package/dist/color/createColorFieldState.d.ts +38 -12
  23. package/dist/color/createColorSliderState.d.ts +9 -2
  24. package/dist/color/createColorWheelState.d.ts +13 -2
  25. package/dist/color/getColorChannels.d.ts +1 -1
  26. package/dist/color/index.d.ts +6 -6
  27. package/dist/color/types.d.ts +4 -4
  28. package/dist/combobox/createComboBoxState.d.ts +34 -13
  29. package/dist/combobox/index.d.ts +1 -1
  30. package/dist/data/createAsyncList.d.ts +4 -4
  31. package/dist/data/createListData.d.ts +2 -2
  32. package/dist/data/createTreeData.d.ts +6 -2
  33. package/dist/data/index.d.ts +3 -3
  34. package/dist/datepicker/index.d.ts +2 -4
  35. package/dist/disclosure/createDisclosureState.d.ts +2 -2
  36. package/dist/disclosure/index.d.ts +1 -1
  37. package/dist/dnd/createDragState.d.ts +2 -2
  38. package/dist/dnd/createDraggableCollectionState.d.ts +2 -2
  39. package/dist/dnd/createDropState.d.ts +2 -2
  40. package/dist/dnd/createDroppableCollectionState.d.ts +3 -3
  41. package/dist/dnd/index.d.ts +5 -5
  42. package/dist/dnd/types.d.ts +19 -17
  43. package/dist/form/createFormValidationState.d.ts +3 -3
  44. package/dist/form/index.d.ts +1 -1
  45. package/dist/grid/createGridState.d.ts +2 -2
  46. package/dist/grid/index.d.ts +2 -2
  47. package/dist/grid/types.d.ts +27 -11
  48. package/dist/index.d.ts +31 -30
  49. package/dist/index.js +9077 -7246
  50. package/dist/index.js.map +1 -1
  51. package/dist/menu/index.d.ts +2 -2
  52. package/dist/numberfield/createNumberFieldState.d.ts +2 -2
  53. package/dist/numberfield/index.d.ts +1 -1
  54. package/dist/overlays/createOverlayTriggerState.d.ts +2 -2
  55. package/dist/overlays/index.d.ts +1 -1
  56. package/dist/radio/createRadioGroupState.d.ts +7 -7
  57. package/dist/radio/index.d.ts +1 -1
  58. package/dist/searchfield/createSearchFieldState.d.ts +2 -2
  59. package/dist/searchfield/index.d.ts +2 -2
  60. package/dist/select/createSelectState.d.ts +14 -8
  61. package/dist/select/index.d.ts +1 -1
  62. package/dist/selection/Selection.d.ts +16 -0
  63. package/dist/selection/SelectionManager.d.ts +110 -0
  64. package/dist/selection/createMultipleSelectionState.d.ts +59 -0
  65. package/dist/selection/index.d.ts +6 -5
  66. package/dist/slider/createSliderState.d.ts +3 -3
  67. package/dist/slider/index.d.ts +2 -2
  68. package/dist/steplist/createStepListState.d.ts +48 -0
  69. package/dist/steplist/index.d.ts +1 -0
  70. package/dist/table/TableCollection.d.ts +33 -3
  71. package/dist/table/createTableColumnResizeState.d.ts +54 -0
  72. package/dist/table/createTableState.d.ts +2 -2
  73. package/dist/table/createTreeGridState.d.ts +15 -0
  74. package/dist/table/index.d.ts +6 -3
  75. package/dist/table/types.d.ts +68 -10
  76. package/dist/tabs/createTabListState.d.ts +5 -5
  77. package/dist/tabs/index.d.ts +1 -1
  78. package/dist/textfield/createTextFieldState.d.ts +2 -2
  79. package/dist/textfield/index.d.ts +1 -1
  80. package/dist/toast/createToastState.d.ts +24 -2
  81. package/dist/toast/index.d.ts +1 -1
  82. package/dist/toggle/createToggleGroupState.d.ts +4 -4
  83. package/dist/toggle/createToggleState.d.ts +2 -2
  84. package/dist/toggle/index.d.ts +2 -2
  85. package/dist/tooltip/createTooltipTriggerState.d.ts +2 -2
  86. package/dist/tooltip/index.d.ts +1 -1
  87. package/dist/tree/TreeCollection.d.ts +2 -2
  88. package/dist/tree/createTreeState.d.ts +2 -2
  89. package/dist/tree/index.d.ts +3 -3
  90. package/dist/tree/types.d.ts +27 -13
  91. package/dist/utils/index.d.ts +1 -1
  92. package/dist/utils/reactivity.d.ts +1 -1
  93. package/package.json +29 -30
  94. package/src/autocomplete/createAutocompleteState.d.ts +19 -17
  95. package/src/autocomplete/createAutocompleteState.ts +24 -30
  96. package/src/autocomplete/index.d.ts +6 -2
  97. package/src/autocomplete/index.ts +1 -1
  98. package/src/calendar/IncompleteDate.ts +430 -0
  99. package/src/calendar/createCalendarState.d.ts +139 -117
  100. package/src/calendar/createCalendarState.ts +308 -94
  101. package/src/calendar/createDateFieldState.d.ts +130 -95
  102. package/src/calendar/createDateFieldState.ts +447 -334
  103. package/src/calendar/createDatePickerState.ts +347 -0
  104. package/src/calendar/createRangeCalendarState.d.ts +154 -129
  105. package/src/calendar/createRangeCalendarState.ts +411 -85
  106. package/src/calendar/createTimeFieldState.d.ts +81 -79
  107. package/src/calendar/createTimeFieldState.ts +187 -108
  108. package/src/calendar/index.d.ts +80 -7
  109. package/src/calendar/index.ts +23 -12
  110. package/src/checkbox/createCheckboxGroupState.d.ts +57 -55
  111. package/src/checkbox/createCheckboxGroupState.ts +20 -29
  112. package/src/checkbox/index.d.ts +6 -2
  113. package/src/checkbox/index.ts +1 -1
  114. package/src/collections/ListCollection.d.ts +25 -22
  115. package/src/collections/ListCollection.ts +6 -6
  116. package/src/collections/createListState.d.ts +73 -58
  117. package/src/collections/createListState.ts +67 -35
  118. package/src/collections/createMenuState.d.ts +36 -31
  119. package/src/collections/createMenuState.ts +21 -12
  120. package/src/collections/createSelectionState.d.ts +78 -65
  121. package/src/collections/createSelectionState.ts +66 -52
  122. package/src/collections/getChildNodes.ts +98 -0
  123. package/src/collections/index.d.ts +38 -6
  124. package/src/collections/index.ts +14 -10
  125. package/src/collections/types.d.ts +101 -101
  126. package/src/collections/types.ts +12 -12
  127. package/src/color/Color.d.ts +20 -5
  128. package/src/color/Color.ts +357 -254
  129. package/src/color/createColorAreaState.d.ts +67 -65
  130. package/src/color/createColorAreaState.ts +21 -13
  131. package/src/color/createColorFieldState.d.ts +46 -44
  132. package/src/color/createColorFieldState.ts +285 -149
  133. package/src/color/createColorSliderState.d.ts +58 -56
  134. package/src/color/createColorSliderState.ts +45 -14
  135. package/src/color/createColorWheelState.d.ts +42 -40
  136. package/src/color/createColorWheelState.ts +101 -64
  137. package/src/color/getColorChannels.ts +7 -5
  138. package/src/color/index.d.ts +36 -7
  139. package/src/color/index.ts +6 -9
  140. package/src/color/types.d.ts +68 -63
  141. package/src/color/types.ts +11 -19
  142. package/src/combobox/createComboBoxState.d.ts +107 -105
  143. package/src/combobox/createComboBoxState.ts +184 -89
  144. package/src/combobox/index.d.ts +10 -2
  145. package/src/combobox/index.ts +1 -1
  146. package/src/data/createAsyncList.ts +89 -63
  147. package/src/data/createListData.ts +67 -67
  148. package/src/data/createTreeData.ts +304 -91
  149. package/src/data/index.ts +3 -3
  150. package/src/datepicker/index.ts +6 -10
  151. package/src/disclosure/createDisclosureState.d.ts +47 -43
  152. package/src/disclosure/createDisclosureState.ts +7 -21
  153. package/src/disclosure/index.d.ts +10 -2
  154. package/src/disclosure/index.ts +1 -1
  155. package/src/dnd/createDragState.d.ts +51 -42
  156. package/src/dnd/createDragState.ts +12 -14
  157. package/src/dnd/createDraggableCollectionState.d.ts +52 -41
  158. package/src/dnd/createDraggableCollectionState.ts +14 -21
  159. package/src/dnd/createDropState.d.ts +64 -45
  160. package/src/dnd/createDropState.ts +22 -32
  161. package/src/dnd/createDroppableCollectionState.d.ts +88 -59
  162. package/src/dnd/createDroppableCollectionState.ts +40 -43
  163. package/src/dnd/index.d.ts +55 -6
  164. package/src/dnd/index.ts +6 -18
  165. package/src/dnd/types.d.ts +170 -157
  166. package/src/dnd/types.ts +24 -22
  167. package/src/form/createFormValidationState.d.ts +47 -45
  168. package/src/form/createFormValidationState.ts +30 -63
  169. package/src/form/index.d.ts +16 -2
  170. package/src/form/index.ts +1 -1
  171. package/src/grid/createGridState.d.ts +7 -4
  172. package/src/grid/createGridState.ts +78 -51
  173. package/src/grid/index.d.ts +3 -3
  174. package/src/grid/index.ts +2 -8
  175. package/src/grid/types.d.ts +136 -129
  176. package/src/grid/types.ts +34 -18
  177. package/src/index.d.ts +311 -26
  178. package/src/index.ts +59 -89
  179. package/src/menu/index.ts +2 -4
  180. package/src/numberfield/createNumberFieldState.d.ts +56 -54
  181. package/src/numberfield/createNumberFieldState.ts +26 -31
  182. package/src/numberfield/index.d.ts +6 -2
  183. package/src/numberfield/index.ts +1 -1
  184. package/src/overlays/createOverlayTriggerState.d.ts +22 -20
  185. package/src/overlays/createOverlayTriggerState.ts +3 -4
  186. package/src/overlays/index.d.ts +6 -2
  187. package/src/overlays/index.ts +1 -1
  188. package/src/radio/createRadioGroupState.d.ts +54 -52
  189. package/src/radio/createRadioGroupState.ts +27 -29
  190. package/src/radio/index.d.ts +7 -2
  191. package/src/radio/index.ts +1 -1
  192. package/src/searchfield/createSearchFieldState.d.ts +16 -14
  193. package/src/searchfield/createSearchFieldState.ts +5 -11
  194. package/src/searchfield/index.d.ts +3 -3
  195. package/src/searchfield/index.ts +2 -5
  196. package/src/select/createSelectState.d.ts +63 -61
  197. package/src/select/createSelectState.ts +42 -29
  198. package/src/select/index.d.ts +2 -2
  199. package/src/select/index.ts +1 -5
  200. package/src/selection/Selection.ts +28 -0
  201. package/src/selection/SelectionManager.ts +526 -0
  202. package/src/selection/createMultipleSelectionState.ts +247 -0
  203. package/src/selection/index.ts +12 -7
  204. package/src/slider/createSliderState.d.ts +60 -60
  205. package/src/slider/createSliderState.ts +55 -33
  206. package/src/slider/index.d.ts +3 -3
  207. package/src/slider/index.ts +2 -6
  208. package/src/ssr/index.d.ts +1 -1
  209. package/src/ssr/index.ts +2 -2
  210. package/src/steplist/createStepListState.ts +191 -0
  211. package/src/steplist/index.ts +5 -0
  212. package/src/table/TableCollection.d.ts +42 -40
  213. package/src/table/TableCollection.ts +266 -99
  214. package/src/table/createTableColumnResizeState.ts +242 -0
  215. package/src/table/createTableState.d.ts +7 -4
  216. package/src/table/createTableState.ts +30 -7
  217. package/src/table/createTreeGridState.ts +146 -0
  218. package/src/table/index.d.ts +14 -4
  219. package/src/table/index.ts +13 -3
  220. package/src/table/types.d.ts +98 -92
  221. package/src/table/types.ts +83 -13
  222. package/src/tabs/createTabListState.d.ts +59 -57
  223. package/src/tabs/createTabListState.ts +34 -39
  224. package/src/tabs/index.d.ts +8 -2
  225. package/src/tabs/index.ts +1 -1
  226. package/src/textfield/createTextFieldState.d.ts +16 -14
  227. package/src/textfield/createTextFieldState.ts +7 -18
  228. package/src/textfield/index.d.ts +6 -2
  229. package/src/textfield/index.ts +1 -1
  230. package/src/toast/createToastState.d.ts +92 -86
  231. package/src/toast/createToastState.ts +90 -52
  232. package/src/toast/index.d.ts +12 -2
  233. package/src/toast/index.ts +2 -1
  234. package/src/toggle/createToggleGroupState.ts +11 -21
  235. package/src/toggle/createToggleState.d.ts +19 -19
  236. package/src/toggle/createToggleState.ts +2 -16
  237. package/src/toggle/index.d.ts +2 -2
  238. package/src/toggle/index.ts +2 -6
  239. package/src/tooltip/createTooltipTriggerState.d.ts +17 -17
  240. package/src/tooltip/createTooltipTriggerState.ts +12 -11
  241. package/src/tooltip/index.d.ts +7 -2
  242. package/src/tooltip/index.ts +1 -1
  243. package/src/tree/TreeCollection.d.ts +26 -23
  244. package/src/tree/TreeCollection.ts +29 -22
  245. package/src/tree/createTreeState.d.ts +7 -4
  246. package/src/tree/createTreeState.ts +70 -41
  247. package/src/tree/index.d.ts +10 -4
  248. package/src/tree/index.ts +3 -3
  249. package/src/tree/types.d.ts +131 -126
  250. package/src/tree/types.ts +30 -13
  251. package/src/utils/index.d.ts +2 -2
  252. package/src/utils/index.ts +1 -1
  253. package/src/utils/reactivity.d.ts +2 -2
  254. package/src/utils/reactivity.ts +3 -3
@@ -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
@@ -3,32 +3,32 @@
3
3
  * Simplified from @react-stately/collections for SolidJS.
4
4
  */
5
5
 
6
- import type { JSX } from 'solid-js';
6
+ import type { JSX } from "solid-js";
7
7
 
8
8
  /** A unique identifier for an item in a collection. */
9
9
  export type Key = string | number;
10
10
 
11
11
  /** The type of selection allowed in a collection. */
12
- export type SelectionMode = 'none' | 'single' | 'multiple';
12
+ export type SelectionMode = "none" | "single" | "multiple";
13
13
 
14
14
  /** How selection behaves when clicking on items. */
15
- export type SelectionBehavior = 'toggle' | 'replace';
15
+ export type SelectionBehavior = "toggle" | "replace";
16
16
 
17
17
  /** Represents the current selection state. */
18
- export type Selection = 'all' | Set<Key>;
18
+ export type Selection = "all" | Set<Key>;
19
19
 
20
20
  /** Strategy for focusing first or last item. */
21
- export type FocusStrategy = 'first' | 'last';
21
+ export type FocusStrategy = "first" | "last";
22
22
 
23
23
  /** Whether disabled keys affect selection, actions, or both. */
24
- export type DisabledBehavior = 'selection' | 'all';
24
+ export type DisabledBehavior = "selection" | "all";
25
25
 
26
26
  /**
27
27
  * Represents a node in a collection (item or section).
28
28
  */
29
29
  export interface CollectionNode<T = unknown> {
30
30
  /** The type of node: 'item' or 'section'. */
31
- type: 'item' | 'section';
31
+ type: "item" | "section";
32
32
  /** A unique key for the node. */
33
33
  key: Key;
34
34
  /** The original value/data for this node. */
@@ -50,7 +50,7 @@ export interface CollectionNode<T = unknown> {
50
50
  /** Whether this item is disabled. */
51
51
  isDisabled?: boolean;
52
52
  /** ARIA label for this node. */
53
- 'aria-label'?: string;
53
+ "aria-label"?: string;
54
54
  /** Additional props for the node. */
55
55
  props?: Record<string, unknown>;
56
56
  }
@@ -115,7 +115,7 @@ export interface ItemProps<T = unknown> {
115
115
  /** The rendered content of the item. */
116
116
  children?: JSX.Element;
117
117
  /** ARIA label for the item. */
118
- 'aria-label'?: string;
118
+ "aria-label"?: string;
119
119
  /** The original value for dynamic collections. */
120
120
  value?: T;
121
121
  }
@@ -129,7 +129,7 @@ export interface SectionProps<T = unknown> {
129
129
  /** The section header/title. */
130
130
  title?: JSX.Element;
131
131
  /** ARIA label for the section. */
132
- 'aria-label'?: string;
132
+ "aria-label"?: string;
133
133
  /** The items in this section. */
134
134
  children?: JSX.Element;
135
135
  /** Items for dynamic rendering. */
@@ -171,9 +171,9 @@ export interface MultipleSelection {
171
171
  /** Whether empty selection is allowed. */
172
172
  disallowEmptySelection?: boolean;
173
173
  /** The currently selected keys (controlled). */
174
- selectedKeys?: 'all' | Iterable<Key>;
174
+ selectedKeys?: "all" | Iterable<Key>;
175
175
  /** The default selected keys (uncontrolled). */
176
- defaultSelectedKeys?: 'all' | Iterable<Key>;
176
+ defaultSelectedKeys?: "all" | Iterable<Key>;
177
177
  /** Handler called when selection changes. */
178
178
  onSelectionChange?: (keys: Selection) => void;
179
179
  /** Keys of disabled items. */
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * Provides color manipulation, conversion, and formatting.
6
6
  */
7
- import type { Color } from './types';
7
+ import type { Color } from "./types";
8
8
  /**
9
9
  * Parse a color string into a Color object.
10
10
  */
@@ -12,17 +12,32 @@ export declare function parseColor(value: string): Color;
12
12
  /**
13
13
  * Create an RGB color.
14
14
  */
15
- export declare function createRGBColor(red: number, green: number, blue: number, alpha?: number): Color;
15
+ export declare function createRGBColor(
16
+ red: number,
17
+ green: number,
18
+ blue: number,
19
+ alpha?: number,
20
+ ): Color;
16
21
  /**
17
22
  * Create an HSL color.
18
23
  */
19
- export declare function createHSLColor(hue: number, saturation: number, lightness: number, alpha?: number): Color;
24
+ export declare function createHSLColor(
25
+ hue: number,
26
+ saturation: number,
27
+ lightness: number,
28
+ alpha?: number,
29
+ ): Color;
20
30
  /**
21
31
  * Create an HSB color.
22
32
  */
23
- export declare function createHSBColor(hue: number, saturation: number, brightness: number, alpha?: number): Color;
33
+ export declare function createHSBColor(
34
+ hue: number,
35
+ saturation: number,
36
+ brightness: number,
37
+ alpha?: number,
38
+ ): Color;
24
39
  /**
25
40
  * Normalize a color value (string or Color) to a Color object.
26
41
  */
27
42
  export declare function normalizeColor(value: string | Color): Color;
28
- //# sourceMappingURL=Color.d.ts.map
43
+ //# sourceMappingURL=Color.d.ts.map