asheeui 0.6.2 → 0.6.5

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 (281) hide show
  1. package/dist/AsheeUIProvider.d.ts +34 -0
  2. package/dist/AsheeUIProvider.d.ts.map +1 -1
  3. package/dist/components/accordion/Accordion.d.ts +55 -44
  4. package/dist/components/accordion/Accordion.d.ts.map +1 -1
  5. package/dist/components/accordion/Accordion.js +27 -27
  6. package/dist/components/accordion/accordion-config.d.ts +41 -12
  7. package/dist/components/accordion/accordion-config.d.ts.map +1 -1
  8. package/dist/components/accordion/accordion-styles.d.ts +20 -0
  9. package/dist/components/accordion/accordion-styles.d.ts.map +1 -1
  10. package/dist/components/accordion/accordion-styles.js +1 -1
  11. package/dist/components/autocomplete/Autocomplete.d.ts +59 -39
  12. package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
  13. package/dist/components/autocomplete/Autocomplete.js +98 -91
  14. package/dist/components/autocomplete/autocomplete-config.d.ts +9 -62
  15. package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
  16. package/dist/components/autocomplete/autocomplete-config.js +6 -21
  17. package/dist/components/button/Button.d.ts +50 -51
  18. package/dist/components/button/Button.d.ts.map +1 -1
  19. package/dist/components/button/Button.js +19 -19
  20. package/dist/components/button/button-config.d.ts +23 -15
  21. package/dist/components/button/button-config.d.ts.map +1 -1
  22. package/dist/components/button/button-styles.d.ts +11 -1
  23. package/dist/components/button/button-styles.d.ts.map +1 -1
  24. package/dist/components/card/Card.d.ts +85 -43
  25. package/dist/components/card/Card.d.ts.map +1 -1
  26. package/dist/components/card/Card.js +49 -49
  27. package/dist/components/card/card-config.d.ts +35 -18
  28. package/dist/components/card/card-config.d.ts.map +1 -1
  29. package/dist/components/card/card-config.js +0 -2
  30. package/dist/components/card/card-styles.d.ts +17 -1
  31. package/dist/components/card/card-styles.d.ts.map +1 -1
  32. package/dist/components/carousel/Carousel.d.ts +107 -12
  33. package/dist/components/carousel/Carousel.d.ts.map +1 -1
  34. package/dist/components/carousel/Carousel.js +63 -64
  35. package/dist/components/carousel/carousel-config.d.ts +94 -7
  36. package/dist/components/carousel/carousel-config.d.ts.map +1 -1
  37. package/dist/components/carousel/carousel-config.js +6 -4
  38. package/dist/components/carousel/carousel-styles.d.ts +32 -1
  39. package/dist/components/carousel/carousel-styles.d.ts.map +1 -1
  40. package/dist/components/chip/Chip.d.ts +55 -34
  41. package/dist/components/chip/Chip.d.ts.map +1 -1
  42. package/dist/components/chip/Chip.js +71 -72
  43. package/dist/components/chip/chip-config.d.ts +29 -15
  44. package/dist/components/chip/chip-config.d.ts.map +1 -1
  45. package/dist/components/chip/chip-config.js +5 -6
  46. package/dist/components/chip/chip-styles.d.ts +21 -1
  47. package/dist/components/chip/chip-styles.d.ts.map +1 -1
  48. package/dist/components/date-picker/DatePicker.d.ts +166 -2
  49. package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
  50. package/dist/components/date-picker/DatePicker.js +110 -99
  51. package/dist/components/date-picker/date-picker-config.d.ts +31 -0
  52. package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
  53. package/dist/components/date-picker/date-picker-config.js +8 -16
  54. package/dist/components/date-picker/date-picker-styles.d.ts +21 -1
  55. package/dist/components/date-picker/date-picker-styles.d.ts.map +1 -1
  56. package/dist/components/date-picker/date-picker-styles.js +7 -11
  57. package/dist/components/drawer/Drawer.d.ts +97 -7
  58. package/dist/components/drawer/Drawer.d.ts.map +1 -1
  59. package/dist/components/drawer/Drawer.js +9 -9
  60. package/dist/components/drawer/drawer-config.d.ts +54 -1
  61. package/dist/components/drawer/drawer-config.d.ts.map +1 -1
  62. package/dist/components/drawer/drawer-styles.d.ts +21 -0
  63. package/dist/components/drawer/drawer-styles.d.ts.map +1 -1
  64. package/dist/components/field/FieldShell.d.ts +86 -0
  65. package/dist/components/field/FieldShell.d.ts.map +1 -1
  66. package/dist/components/field/field-config.d.ts +66 -3
  67. package/dist/components/field/field-config.d.ts.map +1 -1
  68. package/dist/components/field/field-config.js +2 -1
  69. package/dist/components/field/field-styles.d.ts +22 -0
  70. package/dist/components/field/field-styles.d.ts.map +1 -1
  71. package/dist/components/field/field-styles.js +10 -0
  72. package/dist/components/field/index.js +1 -0
  73. package/dist/components/image/Image.d.ts +35 -28
  74. package/dist/components/image/Image.d.ts.map +1 -1
  75. package/dist/components/image/Image.js +7 -7
  76. package/dist/components/image/image-config.d.ts +25 -7
  77. package/dist/components/image/image-config.d.ts.map +1 -1
  78. package/dist/components/image/image-styles.d.ts +9 -0
  79. package/dist/components/image/image-styles.d.ts.map +1 -1
  80. package/dist/components/input/Input.d.ts +117 -10
  81. package/dist/components/input/Input.d.ts.map +1 -1
  82. package/dist/components/input/Input.js +20 -20
  83. package/dist/components/input/PasswordInput.d.ts +48 -0
  84. package/dist/components/input/PasswordInput.d.ts.map +1 -1
  85. package/dist/components/input/input-config.d.ts +10 -1
  86. package/dist/components/input/input-config.d.ts.map +1 -1
  87. package/dist/components/input/input-config.js +5 -8
  88. package/dist/components/input/input-styles.d.ts +10 -0
  89. package/dist/components/input/input-styles.d.ts.map +1 -1
  90. package/dist/components/input/input-styles.js +5 -9
  91. package/dist/components/keyboard/OnScreenKeyboard.d.ts +58 -8
  92. package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
  93. package/dist/components/keyboard/OnScreenKeyboard.js +49 -48
  94. package/dist/components/keyboard/index.js +1 -1
  95. package/dist/components/keyboard/keyboard-config.d.ts +88 -3
  96. package/dist/components/keyboard/keyboard-config.d.ts.map +1 -1
  97. package/dist/components/keyboard/{default-keyboard-config.js → keyboard-config.js} +7 -1
  98. package/dist/components/keyboard/keyboard-context.d.ts +103 -13
  99. package/dist/components/keyboard/keyboard-context.d.ts.map +1 -1
  100. package/dist/components/keyboard/keyboard-context.js +66 -68
  101. package/dist/components/keyboard/use-keyboard-field.d.ts +37 -0
  102. package/dist/components/keyboard/use-keyboard-field.d.ts.map +1 -1
  103. package/dist/components/link/Link.d.ts +118 -9
  104. package/dist/components/link/Link.d.ts.map +1 -1
  105. package/dist/components/link/Link.js +29 -30
  106. package/dist/components/link/link-config.d.ts +58 -5
  107. package/dist/components/link/link-config.d.ts.map +1 -1
  108. package/dist/components/link/link-styles.d.ts +24 -4
  109. package/dist/components/link/link-styles.d.ts.map +1 -1
  110. package/dist/components/marquee/Marquee.d.ts +77 -8
  111. package/dist/components/marquee/Marquee.d.ts.map +1 -1
  112. package/dist/components/marquee/Marquee.js +5 -5
  113. package/dist/components/marquee/marquee-config.d.ts +74 -0
  114. package/dist/components/marquee/marquee-config.d.ts.map +1 -1
  115. package/dist/components/marquee/marquee-styles.d.ts +12 -0
  116. package/dist/components/marquee/marquee-styles.d.ts.map +1 -1
  117. package/dist/components/modal/Modal.d.ts +113 -25
  118. package/dist/components/modal/Modal.d.ts.map +1 -1
  119. package/dist/components/modal/Modal.js +75 -82
  120. package/dist/components/modal/modal-config.d.ts +59 -1
  121. package/dist/components/modal/modal-config.d.ts.map +1 -1
  122. package/dist/components/modal/modal-styles.d.ts +8 -1
  123. package/dist/components/modal/modal-styles.d.ts.map +1 -1
  124. package/dist/components/modal/modal-styles.js +4 -11
  125. package/dist/components/multi-select/MultiSelect.d.ts +152 -23
  126. package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
  127. package/dist/components/multi-select/MultiSelect.js +195 -217
  128. package/dist/components/multi-select/multi-select-config.d.ts +61 -23
  129. package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
  130. package/dist/components/multi-select/multi-select-config.js +16 -25
  131. package/dist/components/multi-select/multi-select-styles.d.ts +17 -0
  132. package/dist/components/multi-select/multi-select-styles.d.ts.map +1 -1
  133. package/dist/components/multi-select/multi-select-styles.js +9 -13
  134. package/dist/components/radio/Radio.d.ts +137 -13
  135. package/dist/components/radio/Radio.d.ts.map +1 -1
  136. package/dist/components/radio/Radio.js +66 -141
  137. package/dist/components/radio/RadioGroup.d.ts +88 -23
  138. package/dist/components/radio/RadioGroup.d.ts.map +1 -1
  139. package/dist/components/radio/RadioGroup.js +141 -66
  140. package/dist/components/radio/radio-config.d.ts +36 -11
  141. package/dist/components/radio/radio-config.d.ts.map +1 -1
  142. package/dist/components/radio/radio-config.js +9 -11
  143. package/dist/components/radio/radio-context.d.ts +44 -1
  144. package/dist/components/radio/radio-context.d.ts.map +1 -1
  145. package/dist/components/radio/radio-styles.d.ts +24 -1
  146. package/dist/components/radio/radio-styles.d.ts.map +1 -1
  147. package/dist/components/resizable-screen/ResizableScreen.d.ts +79 -32
  148. package/dist/components/resizable-screen/ResizableScreen.d.ts.map +1 -1
  149. package/dist/components/resizable-screen/ResizableScreen.js +77 -72
  150. package/dist/components/resizable-screen/resizable-screen-config.d.ts +62 -0
  151. package/dist/components/resizable-screen/resizable-screen-config.d.ts.map +1 -1
  152. package/dist/components/scrollbar/scrollbar-config.d.ts +44 -9
  153. package/dist/components/scrollbar/scrollbar-config.d.ts.map +1 -1
  154. package/dist/components/select/Select.d.ts +157 -17
  155. package/dist/components/select/Select.d.ts.map +1 -1
  156. package/dist/components/select/Select.js +141 -152
  157. package/dist/components/select/select-config.d.ts +26 -19
  158. package/dist/components/select/select-config.d.ts.map +1 -1
  159. package/dist/components/select/select-config.js +5 -21
  160. package/dist/components/select/select-styles.d.ts +10 -0
  161. package/dist/components/select/select-styles.d.ts.map +1 -1
  162. package/dist/components/select/select-styles.js +5 -9
  163. package/dist/components/select-menu/SelectMenu.d.ts +125 -8
  164. package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
  165. package/dist/components/select-menu/SelectMenu.js +107 -79
  166. package/dist/components/select-menu/index.d.ts +2 -0
  167. package/dist/components/select-menu/index.d.ts.map +1 -1
  168. package/dist/components/select-menu/index.js +1 -0
  169. package/dist/components/select-menu/select-menu-config.d.ts +82 -0
  170. package/dist/components/select-menu/select-menu-config.d.ts.map +1 -0
  171. package/dist/components/select-menu/select-menu-config.js +12 -0
  172. package/dist/components/sidebar/Sidebar.d.ts +151 -51
  173. package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
  174. package/dist/components/sidebar/Sidebar.js +211 -232
  175. package/dist/components/sidebar/sidebar-config.d.ts +140 -21
  176. package/dist/components/sidebar/sidebar-config.d.ts.map +1 -1
  177. package/dist/components/sidebar/sidebar-config.js +9 -12
  178. package/dist/components/sidebar/sidebar-styles.d.ts +24 -0
  179. package/dist/components/sidebar/sidebar-styles.d.ts.map +1 -1
  180. package/dist/components/spinner/spinner-config.d.ts +15 -9
  181. package/dist/components/spinner/spinner-config.d.ts.map +1 -1
  182. package/dist/components/spinner/spinner-styles.d.ts +10 -3
  183. package/dist/components/spinner/spinner-styles.d.ts.map +1 -1
  184. package/dist/components/spinner/spinner.d.ts +27 -20
  185. package/dist/components/spinner/spinner.d.ts.map +1 -1
  186. package/dist/components/spinner/spinner.js +18 -18
  187. package/dist/components/switch/Switch.d.ts +109 -9
  188. package/dist/components/switch/Switch.d.ts.map +1 -1
  189. package/dist/components/switch/Switch.js +19 -19
  190. package/dist/components/switch/switch-config.d.ts +20 -6
  191. package/dist/components/switch/switch-config.d.ts.map +1 -1
  192. package/dist/components/switch/switch-config.js +8 -16
  193. package/dist/components/switch/switch-styles.d.ts +17 -0
  194. package/dist/components/switch/switch-styles.d.ts.map +1 -1
  195. package/dist/components/table/Table.d.ts +101 -28
  196. package/dist/components/table/Table.d.ts.map +1 -1
  197. package/dist/components/table/Table.js +56 -56
  198. package/dist/components/table/table-config.d.ts +75 -8
  199. package/dist/components/table/table-config.d.ts.map +1 -1
  200. package/dist/components/table/table-styles.d.ts +25 -6
  201. package/dist/components/table/table-styles.d.ts.map +1 -1
  202. package/dist/components/tabs/Tabs.d.ts +84 -31
  203. package/dist/components/tabs/Tabs.d.ts.map +1 -1
  204. package/dist/components/tabs/Tabs.js +44 -44
  205. package/dist/components/tabs/tabs-config.d.ts +102 -9
  206. package/dist/components/tabs/tabs-config.d.ts.map +1 -1
  207. package/dist/components/tabs/tabs-styles.d.ts +16 -4
  208. package/dist/components/tabs/tabs-styles.d.ts.map +1 -1
  209. package/dist/components/textarea/Textarea.d.ts +105 -11
  210. package/dist/components/textarea/Textarea.d.ts.map +1 -1
  211. package/dist/components/textarea/Textarea.js +27 -24
  212. package/dist/components/textarea/textarea-config.d.ts +21 -0
  213. package/dist/components/textarea/textarea-config.d.ts.map +1 -1
  214. package/dist/components/textarea/textarea-config.js +8 -16
  215. package/dist/components/textarea/textarea-styles.d.ts +9 -0
  216. package/dist/components/textarea/textarea-styles.d.ts.map +1 -1
  217. package/dist/components/textarea/textarea-styles.js +5 -9
  218. package/dist/components/toast/ToastItem.d.ts +58 -4
  219. package/dist/components/toast/ToastItem.d.ts.map +1 -1
  220. package/dist/components/toast/ToastItem.js +18 -18
  221. package/dist/components/toast/toast-config.d.ts +104 -6
  222. package/dist/components/toast/toast-config.d.ts.map +1 -1
  223. package/dist/components/toast/toast-context.d.ts +123 -11
  224. package/dist/components/toast/toast-context.d.ts.map +1 -1
  225. package/dist/components/toast/toast-context.js +19 -19
  226. package/dist/components/toast/toast-styles.d.ts +27 -5
  227. package/dist/components/toast/toast-styles.d.ts.map +1 -1
  228. package/dist/components/toast/use-pausable-timeout.d.ts +29 -0
  229. package/dist/components/toast/use-pausable-timeout.d.ts.map +1 -1
  230. package/dist/components/tooltip/Tooltip.d.ts +76 -16
  231. package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
  232. package/dist/components/tooltip/Tooltip.js +25 -25
  233. package/dist/components/tooltip/tooltip-config.d.ts +73 -3
  234. package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
  235. package/dist/components/tooltip/tooltip-styles.d.ts +12 -0
  236. package/dist/components/tooltip/tooltip-styles.d.ts.map +1 -1
  237. package/dist/config/config.d.ts +50 -2
  238. package/dist/config/config.d.ts.map +1 -1
  239. package/dist/config/default-config.d.ts +5 -0
  240. package/dist/config/default-config.d.ts.map +1 -1
  241. package/dist/config/default-config.js +23 -0
  242. package/dist/config/define-config.d.ts +23 -0
  243. package/dist/config/define-config.d.ts.map +1 -1
  244. package/dist/config/resolve-color.d.ts +25 -0
  245. package/dist/config/resolve-color.d.ts.map +1 -1
  246. package/dist/config/resolve-config.d.ts +23 -0
  247. package/dist/config/resolve-config.d.ts.map +1 -1
  248. package/dist/index.css +43 -7
  249. package/dist/index.d.ts +30 -2
  250. package/dist/index.d.ts.map +1 -1
  251. package/dist/index.js +120 -115
  252. package/dist/libs/context.d.ts +50 -1
  253. package/dist/libs/context.d.ts.map +1 -1
  254. package/dist/libs/registry.d.ts +61 -5
  255. package/dist/libs/registry.d.ts.map +1 -1
  256. package/dist/libs/use-isomorphic-layout-effect.d.ts +18 -0
  257. package/dist/libs/use-isomorphic-layout-effect.d.ts.map +1 -1
  258. package/dist/shared/index.d.ts +3 -0
  259. package/dist/shared/index.d.ts.map +1 -0
  260. package/dist/shared/radius.d.ts +37 -1
  261. package/dist/shared/radius.d.ts.map +1 -1
  262. package/dist/shared/variant.d.ts +31 -0
  263. package/dist/shared/variant.d.ts.map +1 -1
  264. package/dist/shared/variant.js +132 -45
  265. package/dist/theme/color.d.ts +89 -1
  266. package/dist/theme/color.d.ts.map +1 -1
  267. package/dist/theme/controller.d.ts +121 -0
  268. package/dist/theme/controller.d.ts.map +1 -1
  269. package/dist/theme/controller.js +84 -0
  270. package/dist/theme/useTheme.d.ts +68 -0
  271. package/dist/theme/useTheme.d.ts.map +1 -1
  272. package/dist/theme/useTheme.js +23 -0
  273. package/dist/utils/index.d.ts +0 -7
  274. package/dist/utils/index.d.ts.map +1 -1
  275. package/dist/utils/resolve-token.d.ts +101 -0
  276. package/dist/utils/resolve-token.d.ts.map +1 -1
  277. package/package.json +1 -1
  278. package/dist/components/keyboard/default-keyboard-config.d.ts +0 -10
  279. package/dist/components/keyboard/default-keyboard-config.d.ts.map +0 -1
  280. package/dist/shared/size.d.ts +0 -2
  281. package/dist/shared/size.d.ts.map +0 -1
@@ -1,9 +1,77 @@
1
1
  import { ThemeSelection } from './controller';
2
+ /**
3
+ * React hook that provides access to the current theme state and controls.
4
+ *
5
+ * This hook subscribes to the theme controller and returns the current
6
+ * theme selection, resolved theme name, and functions for changing the theme.
7
+ * Components using this hook will re-render automatically when the theme changes.
8
+ *
9
+ * The hook uses useSyncExternalStore to safely subscribe to the theme
10
+ * controller's state, making it compatible with React's concurrent rendering.
11
+ *
12
+ * @returns An object containing the current theme state and control functions.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * function ThemeToggle() {
17
+ * const { theme, setTheme, availableThemes } = useTheme();
18
+ *
19
+ * return (
20
+ * <select value={theme} onChange={(e) => setTheme(e.target.value as ThemeSelection)}>
21
+ * {availableThemes.map(t => (
22
+ * <option key={t} value={t}>{t}</option>
23
+ * ))}
24
+ * <option value="system">System</option>
25
+ * </select>
26
+ * );
27
+ * }
28
+ * ```
29
+ *
30
+ * @example
31
+ * ```tsx
32
+ * function ThemedComponent() {
33
+ * const { resolvedTheme } = useTheme();
34
+ *
35
+ * return (
36
+ * <div className={resolvedTheme === 'dark' ? 'dark-styles' : 'light-styles'}>
37
+ * Current theme: {resolvedTheme}
38
+ * </div>
39
+ * );
40
+ * }
41
+ * ```
42
+ *
43
+ * @see ThemeController - The underlying class that manages theme state.
44
+ * @see ThemeSelection - The type for theme selections including "system".
45
+ * @see ThemeName - The type for resolved theme names.
46
+ */
2
47
  export declare function useTheme(): {
48
+ /**
49
+ * The user's current theme selection.
50
+ * This can be either a specific theme name or "system".
51
+ */
3
52
  theme: ThemeSelection;
53
+ /**
54
+ * The resolved theme name after applying the selection.
55
+ * If the selection is "system", this resolves to either "light" or "dark"
56
+ * based on the system preference.
57
+ */
4
58
  resolvedTheme: keyof import('./color').AsheeColorRegistry;
59
+ /**
60
+ * Function to set the theme selection.
61
+ * This persists the selection to localStorage and applies the theme.
62
+ * @param selection - The theme to select, either "system" or a theme name.
63
+ */
5
64
  setTheme: (selection: ThemeSelection) => void;
65
+ /**
66
+ * Function to cycle to the next available theme.
67
+ * This cycles through all available theme names, excluding "system".
68
+ * Loops back to the start when reaching the end of the list.
69
+ */
6
70
  toggleTheme: () => void;
71
+ /**
72
+ * The list of available theme names in the application.
73
+ * This does not include "system" as it is not a theme name.
74
+ */
7
75
  availableThemes: readonly string[];
8
76
  };
9
77
  //# sourceMappingURL=useTheme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/theme/useTheme.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,cAAc,EAAmB,MAAM,cAAc,CAAC;AAEpE,wBAAgB,QAAQ;;;;;;EAoBvB"}
1
+ {"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/theme/useTheme.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,cAAc,EAAmB,MAAM,cAAc,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,QAAQ;IAcpB;;;OAGG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;;OAGG;;EAGN"}
@@ -12,10 +12,33 @@ function r() {
12
12
  () => "light"
13
13
  );
14
14
  return {
15
+ /**
16
+ * The user's current theme selection.
17
+ * This can be either a specific theme name or "system".
18
+ */
15
19
  theme: o,
20
+ /**
21
+ * The resolved theme name after applying the selection.
22
+ * If the selection is "system", this resolves to either "light" or "dark"
23
+ * based on the system preference.
24
+ */
16
25
  resolvedTheme: l,
26
+ /**
27
+ * Function to set the theme selection.
28
+ * This persists the selection to localStorage and applies the theme.
29
+ * @param selection - The theme to select, either "system" or a theme name.
30
+ */
17
31
  setTheme: e.setTheme,
32
+ /**
33
+ * Function to cycle to the next available theme.
34
+ * This cycles through all available theme names, excluding "system".
35
+ * Loops back to the start when reaching the end of the list.
36
+ */
18
37
  toggleTheme: e.toggleTheme,
38
+ /**
39
+ * The list of available theme names in the application.
40
+ * This does not include "system" as it is not a theme name.
41
+ */
19
42
  availableThemes: e.getAvailableThemes()
20
43
  };
21
44
  }
@@ -1,10 +1,3 @@
1
- /**
2
- * AsheeUI shared utilities.
3
- *
4
- * Client-safe helpers (`cn`, `mergeObject`) plus the `DeepPartial` type,
5
- * migrated from the former `@asheeui/utils` package. Node-only helpers
6
- * (config discovery) live under `./node`.
7
- */
8
1
  export { cn } from './cn';
9
2
  export { mergeObject } from './merge-object';
10
3
  export type { DeepPartial } from './types';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
@@ -1,5 +1,106 @@
1
+ /**
2
+ * Utility functions for resolving cascade values in AsheeUI.
3
+ * This file provides helper functions that implement the configuration
4
+ * precedence hierarchy: instance prop > component config > theme default > hard fallback.
5
+ * These utilities are used throughout the component library to resolve
6
+ * values like variant, color, size, and radius.
7
+ */
8
+ /**
9
+ * Resolves a value using the standard cascade precedence order.
10
+ * Follows the hierarchy: instance prop > component config > global default > hard fallback.
11
+ * This is the primary resolver for most component props.
12
+ *
13
+ * @param instance - The prop value passed directly to the component instance.
14
+ * @param section - The value from the component's configuration section.
15
+ * @param globalDefault - The global default value from the theme configuration.
16
+ * @param hardFallback - The final fallback value if all others are undefined.
17
+ * @returns The resolved value.
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * const variant = resolveCascade(
22
+ * props.variant, // 'ghost'
23
+ * config.Button.variant, // 'solid'
24
+ * theme.defaultVariant, // 'faded'
25
+ * 'solid' // hard fallback
26
+ * );
27
+ * // Returns 'ghost' because instance prop takes precedence
28
+ * ```
29
+ */
1
30
  export declare function resolveCascade<T>(instance: T | undefined, section: T | undefined, globalDefault: T | undefined, hardFallback: T): T;
31
+ /**
32
+ * Resolves a value for animation or transition contexts.
33
+ * Similar to resolveCascade but without the global default tier.
34
+ * This is useful for values that should not inherit from theme defaults.
35
+ *
36
+ * @param instance - The prop value passed directly to the component instance.
37
+ * @param section - The value from the component's configuration section.
38
+ * @param hardFallback - The final fallback value if all others are undefined.
39
+ * @returns The resolved value.
40
+ *
41
+ * @example
42
+ * ```tsx
43
+ * const animate = resolveAnimate(
44
+ * props.animate, // false
45
+ * config.Button.animate, // true
46
+ * true // hard fallback
47
+ * );
48
+ * // Returns false because instance prop takes precedence
49
+ * ```
50
+ */
2
51
  export declare function resolveAnimate<T>(instance: T | undefined, section: T | undefined, hardFallback: T): T;
52
+ /**
53
+ * Resolves a radius value using the standard cascade precedence order.
54
+ * This is a specialized version of resolveCascade that provides a default
55
+ * hard fallback of "md" for radius values.
56
+ *
57
+ * @param instanceProp - The radius prop passed directly to the component instance.
58
+ * @param sectionConfig - The radius from the component's configuration section.
59
+ * @param globalDefaultRadius - The global default radius from the theme.
60
+ * @param hardFallback - Optional custom fallback, defaults to "md".
61
+ * @returns The resolved radius key.
62
+ *
63
+ * @example
64
+ * ```tsx
65
+ * const radius = resolveRadiusKey(
66
+ * props.radius, // 'lg'
67
+ * config.Button.radius, // 'md'
68
+ * theme.defaultRadius, // 'sm'
69
+ * );
70
+ * // Returns 'lg' because instance prop takes precedence
71
+ * ```
72
+ */
3
73
  export declare function resolveRadiusKey<TKey>(instanceProp: TKey | undefined, sectionConfig: TKey | undefined, globalDefaultRadius: TKey | undefined, hardFallback?: TKey): TKey;
74
+ /**
75
+ * Resolves a CSS class from a class map based on a key.
76
+ * Returns the class string for the given key, falling back to the
77
+ * fallback key's class if the key is not found. Returns an empty
78
+ * string if neither the key nor the fallback key exist in the map.
79
+ *
80
+ * @param key - The key to look up in the class map.
81
+ * @param classMap - The record mapping keys to CSS class strings.
82
+ * @param fallbackKey - The fallback key to use if the primary key is not found.
83
+ * @returns The CSS class string.
84
+ *
85
+ * @example
86
+ * ```tsx
87
+ * const classes = resolveClassKey(
88
+ * 'lg', // key
89
+ * { sm: 'text-sm', lg: 'text-lg' }, // classMap
90
+ * 'sm' // fallbackKey
91
+ * );
92
+ * // Returns 'text-lg'
93
+ * ```
94
+ *
95
+ * @example
96
+ * ```tsx
97
+ * const classes = resolveClassKey(
98
+ * 'xl', // key not in map
99
+ * { sm: 'text-sm', lg: 'text-lg' }, // classMap
100
+ * 'sm' // fallbackKey
101
+ * );
102
+ * // Returns 'text-sm' from fallback key
103
+ * ```
104
+ */
4
105
  export declare function resolveClassKey<TKey extends PropertyKey>(key: TKey, classMap: Record<TKey, string>, fallbackKey: TKey): string;
5
106
  //# sourceMappingURL=resolve-token.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-token.d.ts","sourceRoot":"","sources":["../../src/utils/resolve-token.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,CAAC,EAC9B,QAAQ,EAAE,CAAC,GAAG,SAAS,EACvB,OAAO,EAAE,CAAC,GAAG,SAAS,EACtB,aAAa,EAAE,CAAC,GAAG,SAAS,EAC5B,YAAY,EAAE,CAAC,GACd,CAAC,CAEH;AAED,wBAAgB,cAAc,CAAC,CAAC,EAC9B,QAAQ,EAAE,CAAC,GAAG,SAAS,EACvB,OAAO,EAAE,CAAC,GAAG,SAAS,EACtB,YAAY,EAAE,CAAC,GACd,CAAC,CAEH;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EACnC,YAAY,EAAE,IAAI,GAAG,SAAS,EAC9B,aAAa,EAAE,IAAI,GAAG,SAAS,EAC/B,mBAAmB,EAAE,IAAI,GAAG,SAAS,EACrC,YAAY,GAAE,IAAmB,GAChC,IAAI,CAEN;AAED,wBAAgB,eAAe,CAAC,IAAI,SAAS,WAAW,EACtD,GAAG,EAAE,IAAI,EACT,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,EAC9B,WAAW,EAAE,IAAI,GAChB,MAAM,CAER"}
1
+ {"version":3,"file":"resolve-token.d.ts","sourceRoot":"","sources":["../../src/utils/resolve-token.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,QAAQ,EAAE,CAAC,GAAG,SAAS,EACvB,OAAO,EAAE,CAAC,GAAG,SAAS,EACtB,aAAa,EAAE,CAAC,GAAG,SAAS,EAC5B,YAAY,EAAE,CAAC,GACd,CAAC,CAEH;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,QAAQ,EAAE,CAAC,GAAG,SAAS,EACvB,OAAO,EAAE,CAAC,GAAG,SAAS,EACtB,YAAY,EAAE,CAAC,GACd,CAAC,CAEH;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EACnC,YAAY,EAAE,IAAI,GAAG,SAAS,EAC9B,aAAa,EAAE,IAAI,GAAG,SAAS,EAC/B,mBAAmB,EAAE,IAAI,GAAG,SAAS,EACrC,YAAY,GAAE,IAAmB,GAChC,IAAI,CAEN;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,eAAe,CAAC,IAAI,SAAS,WAAW,EACtD,GAAG,EAAE,IAAI,EACT,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,EAC9B,WAAW,EAAE,IAAI,GAChB,MAAM,CAER"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asheeui",
3
- "version": "0.6.2",
3
+ "version": "0.6.5",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,10 +0,0 @@
1
- import { KeyboardConfig, KeyboardLayouts, KeyDisplayMap } from './keyboard-config';
2
- export declare const defaultKeyboardLayouts: KeyboardLayouts;
3
- export declare const defaultKeyDisplay: KeyDisplayMap;
4
- export declare const defaultKeyboardConfig: KeyboardConfig;
5
- declare module "../../libs/registry" {
6
- interface ComponentTypeConfigRegistry {
7
- keyboard: KeyboardConfig;
8
- }
9
- }
10
- //# sourceMappingURL=default-keyboard-config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"default-keyboard-config.d.ts","sourceRoot":"","sources":["../../../src/components/keyboard/default-keyboard-config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,aAAa,EACd,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,sBAAsB,EAAE,eAuBpC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,aAQ/B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,cAMnC,CAAC;AAEF,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,QAAQ,EAAE,cAAc,CAAC;KAC1B;CACF"}
@@ -1,2 +0,0 @@
1
- export type Size = "sm" | "md" | "lg";
2
- //# sourceMappingURL=size.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"size.d.ts","sourceRoot":"","sources":["../../src/shared/size.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC"}