aidos-ui 4.0.4 → 4.0.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 (376) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +23 -3
  3. package/dist/index.d.ts +797 -68
  4. package/dist/index.js +3868 -68
  5. package/dist/index.js.map +1 -1
  6. package/dist/jsx-dev-runtime.d.ts +6 -2
  7. package/dist/jsx-dev-runtime.js +87 -42
  8. package/dist/jsx-dev-runtime.js.map +1 -1
  9. package/dist/jsx-runtime.d.ts +1 -1
  10. package/dist/jsx-runtime.js +2 -2
  11. package/dist/jsx-runtime.js.map +1 -1
  12. package/dist/vite-plugin-jss-debug.d.ts +3 -1
  13. package/dist/vite-plugin-jss-debug.js +57 -74
  14. package/dist/vite-plugin-jss-debug.js.map +1 -1
  15. package/package.json +58 -27
  16. package/.prettierrc +0 -4
  17. package/CLAUDE.md +0 -72
  18. package/dist/Badge.d.ts +0 -6
  19. package/dist/Badge.js +0 -22
  20. package/dist/Badge.js.map +0 -1
  21. package/dist/BaseButton.d.ts +0 -14
  22. package/dist/BaseButton.js +0 -23
  23. package/dist/BaseButton.js.map +0 -1
  24. package/dist/BaseInput.d.ts +0 -14
  25. package/dist/BaseInput.js +0 -15
  26. package/dist/BaseInput.js.map +0 -1
  27. package/dist/BaseLink.d.ts +0 -18
  28. package/dist/BaseLink.js +0 -29
  29. package/dist/BaseLink.js.map +0 -1
  30. package/dist/BaseList.d.ts +0 -6
  31. package/dist/BaseList.js +0 -14
  32. package/dist/BaseList.js.map +0 -1
  33. package/dist/BaseListAddOn.d.ts +0 -5
  34. package/dist/BaseListAddOn.js +0 -7
  35. package/dist/BaseListAddOn.js.map +0 -1
  36. package/dist/BaseListItem.d.ts +0 -26
  37. package/dist/BaseListItem.js +0 -29
  38. package/dist/BaseListItem.js.map +0 -1
  39. package/dist/BaseView.d.ts +0 -12
  40. package/dist/BaseView.js +0 -26
  41. package/dist/BaseView.js.map +0 -1
  42. package/dist/Box.d.ts +0 -4
  43. package/dist/Box.js +0 -6
  44. package/dist/Box.js.map +0 -1
  45. package/dist/Button.d.ts +0 -20
  46. package/dist/Button.js +0 -19
  47. package/dist/Button.js.map +0 -1
  48. package/dist/Calendar.d.ts +0 -18
  49. package/dist/Calendar.js +0 -57
  50. package/dist/Calendar.js.map +0 -1
  51. package/dist/Card.d.ts +0 -4
  52. package/dist/Card.js +0 -14
  53. package/dist/Card.js.map +0 -1
  54. package/dist/Checkbox.d.ts +0 -11
  55. package/dist/Checkbox.js +0 -32
  56. package/dist/Checkbox.js.map +0 -1
  57. package/dist/Circle.d.ts +0 -5
  58. package/dist/Circle.js +0 -12
  59. package/dist/Circle.js.map +0 -1
  60. package/dist/Column.d.ts +0 -6
  61. package/dist/Column.js +0 -7
  62. package/dist/Column.js.map +0 -1
  63. package/dist/DarkMode.d.ts +0 -13
  64. package/dist/DarkMode.js +0 -62
  65. package/dist/DarkMode.js.map +0 -1
  66. package/dist/DateInput.d.ts +0 -13
  67. package/dist/DateInput.js +0 -29
  68. package/dist/DateInput.js.map +0 -1
  69. package/dist/DatePicker.d.ts +0 -11
  70. package/dist/DatePicker.js +0 -34
  71. package/dist/DatePicker.js.map +0 -1
  72. package/dist/DatetimeInput.d.ts +0 -13
  73. package/dist/DatetimeInput.js +0 -31
  74. package/dist/DatetimeInput.js.map +0 -1
  75. package/dist/DesignBook.d.ts +0 -1
  76. package/dist/DesignBook.js +0 -55
  77. package/dist/DesignBook.js.map +0 -1
  78. package/dist/Dialog.d.ts +0 -17
  79. package/dist/Dialog.js +0 -92
  80. package/dist/Dialog.js.map +0 -1
  81. package/dist/Dropdown.d.ts +0 -14
  82. package/dist/Dropdown.js +0 -65
  83. package/dist/Dropdown.js.map +0 -1
  84. package/dist/Emitter.d.ts +0 -6
  85. package/dist/Emitter.js +0 -19
  86. package/dist/Emitter.js.map +0 -1
  87. package/dist/FlexLayout.d.ts +0 -11
  88. package/dist/FlexLayout.js +0 -18
  89. package/dist/FlexLayout.js.map +0 -1
  90. package/dist/Icon.d.ts +0 -12
  91. package/dist/Icon.js +0 -60
  92. package/dist/Icon.js.map +0 -1
  93. package/dist/IconButton.d.ts +0 -11
  94. package/dist/IconButton.js +0 -34
  95. package/dist/IconButton.js.map +0 -1
  96. package/dist/IconLink.d.ts +0 -9
  97. package/dist/IconLink.js +0 -32
  98. package/dist/IconLink.js.map +0 -1
  99. package/dist/IconType.d.ts +0 -1
  100. package/dist/IconType.js +0 -2
  101. package/dist/IconType.js.map +0 -1
  102. package/dist/Interactable.d.ts +0 -50
  103. package/dist/Interactable.js +0 -169
  104. package/dist/Interactable.js.map +0 -1
  105. package/dist/JSSComment.d.ts +0 -10
  106. package/dist/JSSComment.js +0 -52
  107. package/dist/JSSComment.js.map +0 -1
  108. package/dist/Link.d.ts +0 -22
  109. package/dist/Link.js +0 -29
  110. package/dist/Link.js.map +0 -1
  111. package/dist/List.d.ts +0 -15
  112. package/dist/List.js +0 -29
  113. package/dist/List.js.map +0 -1
  114. package/dist/ListButtonItem.d.ts +0 -14
  115. package/dist/ListButtonItem.js +0 -11
  116. package/dist/ListButtonItem.js.map +0 -1
  117. package/dist/ListDivider.d.ts +0 -1
  118. package/dist/ListDivider.js +0 -12
  119. package/dist/ListDivider.js.map +0 -1
  120. package/dist/ListHeaderItem.d.ts +0 -10
  121. package/dist/ListHeaderItem.js +0 -15
  122. package/dist/ListHeaderItem.js.map +0 -1
  123. package/dist/ListItem.d.ts +0 -9
  124. package/dist/ListItem.js +0 -9
  125. package/dist/ListItem.js.map +0 -1
  126. package/dist/ListLinkItem.d.ts +0 -16
  127. package/dist/ListLinkItem.js +0 -11
  128. package/dist/ListLinkItem.js.map +0 -1
  129. package/dist/ListSpacer.d.ts +0 -1
  130. package/dist/ListSpacer.js +0 -13
  131. package/dist/ListSpacer.js.map +0 -1
  132. package/dist/MenuIcon.d.ts +0 -5
  133. package/dist/MenuIcon.js +0 -31
  134. package/dist/MenuIcon.js.map +0 -1
  135. package/dist/NextJSRouter.d.ts +0 -1
  136. package/dist/NextJSRouter.js +0 -37
  137. package/dist/NextJSRouter.js.map +0 -1
  138. package/dist/NextJSRouterState.d.ts +0 -38
  139. package/dist/NextJSRouterState.js +0 -111
  140. package/dist/NextJSRouterState.js.map +0 -1
  141. package/dist/OnVisible.d.ts +0 -5
  142. package/dist/OnVisible.js +0 -28
  143. package/dist/OnVisible.js.map +0 -1
  144. package/dist/Popover.d.ts +0 -22
  145. package/dist/Popover.js +0 -90
  146. package/dist/Popover.js.map +0 -1
  147. package/dist/ProgressBar.d.ts +0 -7
  148. package/dist/ProgressBar.js +0 -42
  149. package/dist/ProgressBar.js.map +0 -1
  150. package/dist/ProgressCircle.d.ts +0 -5
  151. package/dist/ProgressCircle.js +0 -12
  152. package/dist/ProgressCircle.js.map +0 -1
  153. package/dist/Providers.d.ts +0 -9
  154. package/dist/Providers.js +0 -16
  155. package/dist/Providers.js.map +0 -1
  156. package/dist/RangeInput.d.ts +0 -14
  157. package/dist/RangeInput.js +0 -32
  158. package/dist/RangeInput.js.map +0 -1
  159. package/dist/ResultOrError.d.ts +0 -13
  160. package/dist/ResultOrError.js +0 -7
  161. package/dist/ResultOrError.js.map +0 -1
  162. package/dist/RootView.d.ts +0 -5
  163. package/dist/RootView.js +0 -35
  164. package/dist/RootView.js.map +0 -1
  165. package/dist/Row.d.ts +0 -6
  166. package/dist/Row.js +0 -7
  167. package/dist/Row.js.map +0 -1
  168. package/dist/Select.d.ts +0 -9
  169. package/dist/Select.js +0 -17
  170. package/dist/Select.js.map +0 -1
  171. package/dist/StackContext.d.ts +0 -8
  172. package/dist/StackContext.js +0 -25
  173. package/dist/StackContext.js.map +0 -1
  174. package/dist/StaticCheckbox.d.ts +0 -16
  175. package/dist/StaticCheckbox.js +0 -48
  176. package/dist/StaticCheckbox.js.map +0 -1
  177. package/dist/Storage.d.ts +0 -13
  178. package/dist/Storage.js +0 -146
  179. package/dist/Storage.js.map +0 -1
  180. package/dist/Stream.d.ts +0 -9
  181. package/dist/Stream.js +0 -36
  182. package/dist/Stream.js.map +0 -1
  183. package/dist/Sublist.d.ts +0 -12
  184. package/dist/Sublist.js +0 -18
  185. package/dist/Sublist.js.map +0 -1
  186. package/dist/SubmitIconInput.d.ts +0 -8
  187. package/dist/SubmitIconInput.js +0 -25
  188. package/dist/SubmitIconInput.js.map +0 -1
  189. package/dist/Tabs.d.ts +0 -23
  190. package/dist/Tabs.js +0 -39
  191. package/dist/Tabs.js.map +0 -1
  192. package/dist/Text.d.ts +0 -25
  193. package/dist/Text.js +0 -52
  194. package/dist/Text.js.map +0 -1
  195. package/dist/TextArea.d.ts +0 -11
  196. package/dist/TextArea.js +0 -27
  197. package/dist/TextArea.js.map +0 -1
  198. package/dist/TextInput.d.ts +0 -15
  199. package/dist/TextInput.js +0 -61
  200. package/dist/TextInput.js.map +0 -1
  201. package/dist/TextInputWithState.d.ts +0 -8
  202. package/dist/TextInputWithState.js +0 -14
  203. package/dist/TextInputWithState.js.map +0 -1
  204. package/dist/TextPairing.d.ts +0 -21
  205. package/dist/TextPairing.js +0 -26
  206. package/dist/TextPairing.js.map +0 -1
  207. package/dist/TimeInput.d.ts +0 -15
  208. package/dist/TimeInput.js +0 -58
  209. package/dist/TimeInput.js.map +0 -1
  210. package/dist/Tooltip.d.ts +0 -11
  211. package/dist/Tooltip.js +0 -73
  212. package/dist/Tooltip.js.map +0 -1
  213. package/dist/aria.d.ts +0 -8
  214. package/dist/aria.js +0 -42
  215. package/dist/aria.js.map +0 -1
  216. package/dist/guid.d.ts +0 -1
  217. package/dist/guid.js +0 -7
  218. package/dist/guid.js.map +0 -1
  219. package/dist/hash.d.ts +0 -1
  220. package/dist/hash.js +0 -20
  221. package/dist/hash.js.map +0 -1
  222. package/dist/isServer.d.ts +0 -1
  223. package/dist/isServer.js +0 -4
  224. package/dist/isServer.js.map +0 -1
  225. package/dist/jss.d.ts +0 -122
  226. package/dist/jss.js +0 -515
  227. package/dist/jss.js.map +0 -1
  228. package/dist/numberToBase.d.ts +0 -1
  229. package/dist/numberToBase.js +0 -44
  230. package/dist/numberToBase.js.map +0 -1
  231. package/dist/stateMachineContextFactory.d.ts +0 -36
  232. package/dist/stateMachineContextFactory.js +0 -48
  233. package/dist/stateMachineContextFactory.js.map +0 -1
  234. package/dist/useCookie.d.ts +0 -9
  235. package/dist/useCookie.js +0 -67
  236. package/dist/useCookie.js.map +0 -1
  237. package/dist/useKeyboard.d.ts +0 -8
  238. package/dist/useKeyboard.js +0 -26
  239. package/dist/useKeyboard.js.map +0 -1
  240. package/dist/useNavigation.d.ts +0 -5
  241. package/dist/useNavigation.js +0 -79
  242. package/dist/useNavigation.js.map +0 -1
  243. package/dist/usePromise.d.ts +0 -1
  244. package/dist/usePromise.js +0 -12
  245. package/dist/usePromise.js.map +0 -1
  246. package/dist/useRefEffect.d.ts +0 -1
  247. package/dist/useRefEffect.js +0 -15
  248. package/dist/useRefEffect.js.map +0 -1
  249. package/jss-debug-loader.mjs +0 -44
  250. package/next-env.d.ts +0 -6
  251. package/next.config.js +0 -33
  252. package/scripts/embeddings.js +0 -93
  253. package/scripts/openai_embeddings.js +0 -100
  254. package/scripts/publish.js +0 -28
  255. package/scripts/test_embeddings.js +0 -47
  256. package/src/Badge.tsx +0 -36
  257. package/src/BaseButton.tsx +0 -62
  258. package/src/BaseInput.tsx +0 -63
  259. package/src/BaseLink.tsx +0 -80
  260. package/src/BaseList.tsx +0 -26
  261. package/src/BaseListAddOn.tsx +0 -10
  262. package/src/BaseListItem.tsx +0 -119
  263. package/src/BaseView.tsx +0 -57
  264. package/src/Box.tsx +0 -20
  265. package/src/Button.tsx +0 -90
  266. package/src/Calendar.tsx +0 -123
  267. package/src/Card.tsx +0 -30
  268. package/src/Checkbox.tsx +0 -63
  269. package/src/Circle.tsx +0 -24
  270. package/src/Column.tsx +0 -12
  271. package/src/DarkMode.tsx +0 -100
  272. package/src/DateInput.tsx +0 -63
  273. package/src/DatePicker.tsx +0 -67
  274. package/src/DatetimeInput.tsx +0 -64
  275. package/src/DesignBook.tsx +0 -677
  276. package/src/Dialog.tsx +0 -150
  277. package/src/Dropdown.tsx +0 -146
  278. package/src/Emitter.ts +0 -26
  279. package/src/FlexLayout.tsx +0 -53
  280. package/src/Icon.tsx +0 -80
  281. package/src/IconButton.tsx +0 -81
  282. package/src/IconLink.tsx +0 -59
  283. package/src/IconType.ts +0 -787
  284. package/src/Interactable.tsx +0 -210
  285. package/src/JSSComment.tsx +0 -56
  286. package/src/Link.tsx +0 -110
  287. package/src/List.tsx +0 -58
  288. package/src/ListButtonItem.tsx +0 -69
  289. package/src/ListDivider.tsx +0 -13
  290. package/src/ListHeaderItem.tsx +0 -45
  291. package/src/ListItem.tsx +0 -24
  292. package/src/ListLinkItem.tsx +0 -76
  293. package/src/ListSpacer.tsx +0 -14
  294. package/src/MenuIcon.tsx +0 -50
  295. package/src/NextJSRouter.tsx +0 -60
  296. package/src/NextJSRouterState.tsx +0 -154
  297. package/src/OnVisible.tsx +0 -42
  298. package/src/Popover.tsx +0 -145
  299. package/src/ProgressBar.tsx +0 -63
  300. package/src/ProgressCircle.tsx +0 -38
  301. package/src/Providers.tsx +0 -33
  302. package/src/RangeInput.tsx +0 -82
  303. package/src/ResultOrError.ts +0 -15
  304. package/src/RootView.tsx +0 -55
  305. package/src/Row.tsx +0 -12
  306. package/src/Select.tsx +0 -39
  307. package/src/StackContext.tsx +0 -52
  308. package/src/StaticCheckbox.tsx +0 -72
  309. package/src/Storage.tsx +0 -198
  310. package/src/Stream.tsx +0 -50
  311. package/src/Sublist.tsx +0 -61
  312. package/src/SubmitIconInput.tsx +0 -45
  313. package/src/Tabs.tsx +0 -110
  314. package/src/Text.tsx +0 -111
  315. package/src/TextArea.tsx +0 -58
  316. package/src/TextInput.tsx +0 -123
  317. package/src/TextInputWithState.tsx +0 -32
  318. package/src/TextPairing.tsx +0 -115
  319. package/src/TimeInput.tsx +0 -109
  320. package/src/Tooltip.tsx +0 -109
  321. package/src/aria.ts +0 -72
  322. package/src/docs/mdx.tsx +0 -137
  323. package/src/docs/pages.ts +0 -115
  324. package/src/docs/searchIndex.ts +0 -1
  325. package/src/examples/ExampleDialog.tsx +0 -28
  326. package/src/guid.ts +0 -7
  327. package/src/hash.ts +0 -21
  328. package/src/index.ts +0 -68
  329. package/src/isServer.ts +0 -3
  330. package/src/jss.tsx +0 -712
  331. package/src/jsx-dev-runtime.ts +0 -74
  332. package/src/jsx-runtime.ts +0 -2
  333. package/src/numberToBase.ts +0 -52
  334. package/src/pages/Badge.mdx +0 -152
  335. package/src/pages/Button.mdx +0 -163
  336. package/src/pages/Calendar.mdx +0 -254
  337. package/src/pages/Card.mdx +0 -147
  338. package/src/pages/Checkbox.mdx +0 -131
  339. package/src/pages/Dialog.mdx +0 -197
  340. package/src/pages/FlexLayout.mdx +0 -211
  341. package/src/pages/Hashing.mdx +0 -211
  342. package/src/pages/Icon.mdx +0 -171
  343. package/src/pages/IconButton.mdx +0 -155
  344. package/src/pages/Link.mdx +0 -160
  345. package/src/pages/List.mdx +0 -262
  346. package/src/pages/ListHeader.mdx +0 -220
  347. package/src/pages/Popover.mdx +0 -223
  348. package/src/pages/ProgressBar.mdx +0 -200
  349. package/src/pages/ProgressCircle.mdx +0 -218
  350. package/src/pages/RangeInput.mdx +0 -237
  351. package/src/pages/Tabs.mdx +0 -281
  352. package/src/pages/Text.mdx +0 -154
  353. package/src/pages/TextInput.mdx +0 -235
  354. package/src/pages/TextPairing.mdx +0 -204
  355. package/src/pages/TimeInput.mdx +0 -178
  356. package/src/pages/Tooltip.mdx +0 -115
  357. package/src/pages/_app.tsx +0 -466
  358. package/src/pages/_document.tsx +0 -30
  359. package/src/pages/css-in-js.mdx +0 -240
  360. package/src/pages/index.mdx +0 -58
  361. package/src/pages/navigation.mdx +0 -158
  362. package/src/pages/prism.css +0 -3
  363. package/src/pages/useCookie.mdx +0 -176
  364. package/src/pages/useKeyboard.mdx +0 -257
  365. package/src/pages/useNavigation.mdx +0 -258
  366. package/src/pages/usePromise.mdx +0 -280
  367. package/src/pages/useRefEffect.mdx +0 -251
  368. package/src/stateMachineContextFactory.tsx +0 -111
  369. package/src/useCookie.tsx +0 -95
  370. package/src/useKeyboard.tsx +0 -43
  371. package/src/useNavigation.tsx +0 -89
  372. package/src/usePromise.tsx +0 -18
  373. package/src/useRefEffect.tsx +0 -18
  374. package/src/vite-plugin-jss-debug.ts +0 -77
  375. package/tsconfig.build.json +0 -23
  376. package/tsconfig.json +0 -38
@@ -1,240 +0,0 @@
1
- import { Button } from "../Button";
2
- import { Row } from "../Row";
3
- import { Column } from "../Column";
4
- import { BaseView } from "../BaseView";
5
- import { Span } from "../Text";
6
- import { cssVar, mobile, tablet } from "../jss";
7
-
8
- # CSS in JS
9
-
10
- Aidos UI uses a custom CSS-in-JS system called `jss`. Every component accepts a `jss` prop for styling, and the library includes utilities for theming, responsive design, and type-safe CSS variables.
11
-
12
- ---
13
-
14
- ## The jss prop
15
-
16
- All components accept a `jss` prop that works like inline styles but with additional capabilities:
17
-
18
- ```js
19
- <BaseView jss={{ backgroundColor: "red", padding: 12 }} />
20
- ```
21
-
22
- Internally, each property becomes an atomic CSS class with a deterministic hash, enabling server-side rendering and hydration:
23
-
24
- ```html
25
- <style>
26
- .x1uc1pme { background: red; }
27
- .x1kbdebd { padding: 12px; }
28
- </style>
29
- <div class="x1uc1pme x1kbdebd" />
30
- ```
31
-
32
- ---
33
-
34
- ## Arrays and conditionals
35
-
36
- The `jss` prop accepts arrays and falsy values for conditional styling:
37
-
38
- ```js
39
- <BaseView
40
- jss={[
41
- { padding: 16 },
42
- isActive && { backgroundColor: "blue" },
43
- isDisabled && { opacity: 0.5 },
44
- ]}
45
- />
46
- ```
47
-
48
- ---
49
-
50
- ## Automatic pixel conversion
51
-
52
- Numeric values are automatically converted to pixels for dimensional properties:
53
-
54
- ```js
55
- <BaseView jss={{ padding: 16, fontSize: 14, opacity: 0.5 }} />
56
- // Results in: padding: 16px; font-size: 14px; opacity: 0.5;
57
- ```
58
-
59
- ---
60
-
61
- ## Pseudo-selectors
62
-
63
- Use string keys for pseudo-classes and pseudo-elements:
64
-
65
- ```js
66
- // Hover state
67
- jss({ ":hover": { backgroundColor: "blue" } })
68
-
69
- // Focus state
70
- jss({ ":focus": { outline: "2px solid blue" } })
71
-
72
- // First child
73
- jss({ ":first-child": { marginTop: 0 } })
74
- ```
75
-
76
- ---
77
-
78
- ## Descendant selectors
79
-
80
- Target child elements with space-prefixed selectors:
81
-
82
- ```js
83
- // All child divs
84
- jss({ " div": { padding: 8 } })
85
-
86
- // Direct children
87
- jss({ " > span": { color: "red" } })
88
- ```
89
-
90
- ---
91
-
92
- ## Media queries
93
-
94
- Use media query strings as keys:
95
-
96
- ```js
97
- jss({
98
- padding: 8,
99
- "@media (min-width: 750px)": {
100
- padding: 16,
101
- },
102
- })
103
- ```
104
-
105
- ---
106
-
107
- ## Responsive helpers
108
-
109
- The library provides helper functions for common breakpoints:
110
-
111
- ```js
112
- import { mobile, tablet, laptop, desktop } from "aidos-ui";
113
-
114
- <BaseView
115
- jss={[
116
- { padding: 8 },
117
- tablet({ padding: 16 }),
118
- desktop({ padding: 24 }),
119
- ]}
120
- />
121
- ```
122
-
123
- | Helper | Breakpoint |
124
- |--------|------------|
125
- | `mobile()` | max-width: 479px |
126
- | `tablet()` | min-width: 480px |
127
- | `laptop()` | min-width: 1024px |
128
- | `desktop()` | min-width: 1280px |
129
-
130
- ---
131
-
132
- ## CSS variables
133
-
134
- Use the `cssVar()` helper for type-safe access to theme variables:
135
-
136
- <Row justify="center" padding="medium">
137
- <Button
138
- jss={{ border: `4px solid ${cssVar("--warning")}` }}
139
- color="positive"
140
- onClick={() => {}}
141
- >
142
- Styled button
143
- </Button>
144
- </Row>
145
-
146
- ```js
147
- import { cssVar } from "aidos-ui";
148
-
149
- <BaseView jss={{
150
- backgroundColor: cssVar("--primary-background"),
151
- color: cssVar("--primary-text"),
152
- padding: cssVar("--spacing-m"),
153
- }} />
154
- ```
155
-
156
- ---
157
-
158
- ## Available CSS variables
159
-
160
- ### Colors
161
-
162
- | Variable | Purpose |
163
- |----------|---------|
164
- | `--primary-background` | Main background |
165
- | `--secondary-background` | Alternate background |
166
- | `--overlay-background` | Modal/popover background |
167
- | `--divider` | Border/divider color |
168
- | `--highlight` | Accent/brand color |
169
- | `--warning` | Warning indicator |
170
-
171
- ### Text colors
172
-
173
- | Variable | Purpose |
174
- |----------|---------|
175
- | `--primary-text` | Main text |
176
- | `--secondary-text` | Supporting text |
177
- | `--subtle-text` | Muted/disabled text |
178
- | `--highlight-text` | Accent text |
179
- | `--negative-text` | Error/destructive text |
180
- | `--light-text` | Text on dark backgrounds |
181
-
182
- ### Interactive states
183
-
184
- | Variable | Purpose |
185
- |----------|---------|
186
- | `--hovered-background` | Hover state |
187
- | `--pressed-background` | Active/pressed state |
188
- | `--selected-background` | Selected item |
189
-
190
- ### Button backgrounds
191
-
192
- | Variable | Purpose |
193
- |----------|---------|
194
- | `--background-button-positive` | Positive action buttons |
195
- | `--background-button-secondary` | Secondary buttons |
196
- | `--background-button-negative` | Destructive buttons |
197
- | `--background-button-disabled` | Disabled buttons |
198
-
199
- ### Spacing
200
-
201
- | Variable | Size |
202
- |----------|------|
203
- | `--spacing-xs` | 4px |
204
- | `--spacing-s` | 8px |
205
- | `--spacing-m` | 12px |
206
- | `--spacing-l` | 16px |
207
- | `--spacing-xl` | 24px |
208
- | `--spacing-xxl` | 32px |
209
- | `--spacing-xxxl` | 48px |
210
-
211
- ### Border radius
212
-
213
- | Variable | Size |
214
- |----------|------|
215
- | `--border-radius-s` | 4px |
216
- | `--border-radius-m` | 8px |
217
- | `--border-radius-l` | 12px |
218
-
219
- ---
220
-
221
- ## Using toClassnames directly
222
-
223
- For custom components, use `toClassnames()` to convert style objects to class names:
224
-
225
- ```js
226
- import { toClassnames } from "aidos-ui";
227
-
228
- function CustomComponent({ active }) {
229
- return (
230
- <div
231
- className={toClassnames([
232
- { padding: 16, borderRadius: 8 },
233
- active && { backgroundColor: "blue" },
234
- ])}
235
- >
236
- Content
237
- </div>
238
- );
239
- }
240
- ```
@@ -1,58 +0,0 @@
1
- # Aidos UI
2
-
3
- This is a React design system library with many utilities and zero dependencies. It was built with the aim to be simple, lightweight and beautiful.
4
-
5
- - [Why](/#why)
6
- - [Who is this for](/#who-is-this-for)
7
- - [Design philosophy](/#design-philosophy)
8
- - [Installation](/#installation)
9
- - [How to use](/#how-to-use)
10
-
11
- ## Why?
12
-
13
- Over the years I have always have many side projects, and many of them needed a UI. I disliked every available library because they had so much code to support many cases I did not care about. Back in 2019 I thought, maybe I could make my own design system, with just enough javascript to do things exactly how I wanted them to be, and so I did. Since then it has changed quite a bit and it is now something I am more or less proud of. It has everything I have ever needed and it is done in the way I find simplest and least convoluted. This is all ultimately very subjective, and that is fine, because the first design decision of this library was that it would be extremely opinionated. With that said, although this library does not lend it self to modification, it does tend to be fairly easy to extend and compose with it. I am now making this documentation with the vague weak conviction that someone out there may benefit from it. I still dislike other design libraries not because they are not capable but becuse they are too general purpose. I wanted this library to be not-general purpose, but if this happens to fit your needs, it should be the lightest and simplest option available. This will not try to solve all your problems but it will solve a few problems really well.
14
-
15
- ---
16
-
17
- ## Who is this for?
18
-
19
- I initially only planned to use this myself so its features and design have so far reflected the things I have been working on. However I keep extending this library, and I think that with more users it may be possible to add more ideas and usecases so that this becomes a really complete system.
20
-
21
- ---
22
-
23
- ## Design philosophy
24
-
25
- 1. <b>Opinionated</b>
26
-
27
- First and foremost, this library is extremely opinionated. This is so because I believe HTML is too low level and error prone, CSS defaults are not beautiful enough, and the web in general too big a toolkit to make simple things work in the way you expect. So, for the sake of simplicity, this library imposes opinions at every step. These opinions will not fit everyone's needs, and that is a sacrifice that can be made for the sake of simplicity.
28
-
29
- 3. <b>Modular</b>
30
-
31
- There is no limit to the number of features and components that can be added, as long as every piece remains modular, or at most, composed out of its simpler parts. This is important to keep bundle sizes under control and also to keep the API sane. Modular components imply abstractions that do not depend on each other. This helps keep overall complexity low, so that it is simpler to extend the system.
32
-
33
- 3. <b>Accessible</b>
34
-
35
- By design every component should be accessible, paying attention to keyboard navigation, focusable elements, adding helpful aria properties and following wcag specificaitons as faithfully as possible.
36
-
37
- 4. <b>Dependency free</b>
38
-
39
- As few dependencies as possible, to keep things light and under control. The only dependency right now is [iconify](https://github.com/iconify/iconify) because I am not able to re-create all icons myself.
40
-
41
- ---
42
-
43
- ## Installation
44
-
45
- This library can be installed through npm
46
-
47
- ```bash
48
- npm install --save aidos-ui
49
- ```
50
-
51
- ---
52
-
53
- ## How to use
54
-
55
- - The `Providers` component somewhere in the application.
56
- - If the application is running in nextjs, the `JSServerStyles` component has to be used in the \_document `<Head />`, this enables jss to work also server side.
57
-
58
- ---
@@ -1,158 +0,0 @@
1
- import { List } from "../List";
2
- import { ListButtonItem } from "../ListButtonItem";
3
-
4
- # List Navigation
5
-
6
- Lists support built-in keyboard navigation using the `useNavigation` hook. This creates an accessible, keyboard-friendly experience following WAI-ARIA patterns.
7
-
8
- ---
9
-
10
- ## Enabling navigation
11
-
12
- Use the `navigation` prop to enable or disable keyboard navigation:
13
-
14
- <List ariaLabel="example" navigation={true}>
15
- <ListButtonItem color="secondary" headline="Headline 1" onClick={() => {}} />
16
- <ListButtonItem color="secondary" headline="Headline 2" onClick={() => {}} />
17
- <ListButtonItem
18
- withDivider={false}
19
- color="secondary"
20
- headline="Headline 3"
21
- onClick={() => {}}
22
- />
23
- </List>
24
-
25
- ```js
26
- <List ariaLabel="example" navigation={true}>
27
- <ListButtonItem headline="Headline 1" onClick={() => {}} />
28
- <ListButtonItem headline="Headline 2" onClick={() => {}} />
29
- <ListButtonItem headline="Headline 3" onClick={() => {}} />
30
- </List>
31
- ```
32
-
33
- ---
34
-
35
- ## Without navigation
36
-
37
- When `navigation` is `false`, each item is a separate tab stop:
38
-
39
- <List ariaLabel="example" navigation={false}>
40
- <ListButtonItem color="secondary" headline="Headline 1" onClick={() => {}} />
41
- <ListButtonItem color="secondary" headline="Headline 2" onClick={() => {}} />
42
- <ListButtonItem
43
- withDivider={false}
44
- color="secondary"
45
- headline="Headline 3"
46
- onClick={() => {}}
47
- />
48
- </List>
49
-
50
- ```js
51
- <List ariaLabel="example" navigation={false}>
52
- <ListButtonItem headline="Headline 1" onClick={() => {}} />
53
- <ListButtonItem headline="Headline 2" onClick={() => {}} />
54
- <ListButtonItem headline="Headline 3" onClick={() => {}} />
55
- </List>
56
- ```
57
-
58
- ---
59
-
60
- ## Keyboard controls
61
-
62
- When navigation is enabled:
63
-
64
- | Key | Action |
65
- |-----|--------|
66
- | **Arrow Down** | Move to next item |
67
- | **Arrow Up** | Move to previous item |
68
- | **Arrow Right** | Move to next item |
69
- | **Arrow Left** | Move to previous item |
70
- | **Enter / Space** | Activate the focused item |
71
- | **Tab** | Move focus out of the list |
72
-
73
- Navigation wraps around - pressing down on the last item moves to the first.
74
-
75
- ---
76
-
77
- ## How it works
78
-
79
- The navigation system uses `tabIndex` management:
80
-
81
- 1. **Single tab stop**: The entire list is one tab stop
82
- 2. **Active item**: Gets `tabIndex="0"` (focusable)
83
- 3. **Other items**: Get `tabIndex="-1"` (not in tab order)
84
- 4. **Arrow keys**: Move the active state between items
85
-
86
- This follows the [WAI-ARIA grid layout pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/examples/layout-grids/).
87
-
88
- ---
89
-
90
- ## Benefits
91
-
92
- **With navigation enabled:**
93
- - Faster keyboard navigation (single Tab to enter list)
94
- - Arrow keys to move between items
95
- - Better for long lists
96
- - More efficient for power users
97
-
98
- **With navigation disabled:**
99
- - Standard Tab behavior between items
100
- - Simpler mental model
101
- - Better for short lists (2-3 items)
102
- - Each item is independently focusable
103
-
104
- ---
105
-
106
- ## Accessibility considerations
107
-
108
- Always provide an `ariaLabel` for the list:
109
-
110
- ```js
111
- <List ariaLabel="Search results" navigation={true}>
112
- {/* items */}
113
- </List>
114
-
115
- <List ariaLabel="User menu options" navigation={true}>
116
- {/* items */}
117
- </List>
118
- ```
119
-
120
- This helps screen reader users understand the list's purpose.
121
-
122
- ---
123
-
124
- ## When to use navigation
125
-
126
- **Enable navigation for:**
127
- - Long lists (5+ items)
128
- - Menu-like interfaces
129
- - Search results
130
- - Option lists
131
- - File browsers
132
-
133
- **Disable navigation for:**
134
- - Short action lists (2-3 items)
135
- - Form field groups
136
- - Simple button groups
137
- - When each item needs independent focus
138
-
139
- ---
140
-
141
- ## Implementation
142
-
143
- Lists use the `useNavigation` hook internally:
144
-
145
- ```js
146
- // Simplified internal implementation
147
- function List({ navigation = true, children, ariaLabel }) {
148
- const rootRef = useNavigation({ enabled: navigation });
149
-
150
- return (
151
- <ul ref={rootRef} aria-label={ariaLabel}>
152
- {children}
153
- </ul>
154
- );
155
- }
156
- ```
157
-
158
- See the [useNavigation documentation](/useNavigation) for more details on the underlying hook.
@@ -1,3 +0,0 @@
1
- /* PrismJS 1.29.0
2
- https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+css+clike+javascript+jsx+tsx+typescript */
3
- code[class*=language-],pre[class*=language-]{color:#ccc;background:0 0;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}
@@ -1,176 +0,0 @@
1
- # useCookie
2
-
3
- A React hook for reading and writing browser cookies with React state-like API. Handles SSR gracefully and persists values across page reloads.
4
-
5
- ---
6
-
7
- ## Signature
8
-
9
- ```ts
10
- function useCookie<T, L>(
11
- key: string,
12
- options: {
13
- initialValue: T;
14
- loadingValue: L;
15
- serialize?: (value: T) => string;
16
- deserialize?: (value: string) => T;
17
- maxAge?: number;
18
- }
19
- ): [T | L, (value: T | ((prev: T | L) => T)) => void]
20
- ```
21
-
22
- ---
23
-
24
- ## Parameters
25
-
26
- | Parameter | Type | Default | Description |
27
- |-----------|------|---------|-------------|
28
- | `key` | `string` | Required | Cookie name |
29
- | `options.initialValue` | `T` | Required | Value to set if cookie doesn't exist |
30
- | `options.loadingValue` | `L` | Required | Value to use during SSR or initial load |
31
- | `options.serialize` | `(T) => string` | `JSON.stringify` | Custom serialization function |
32
- | `options.deserialize` | `(string) => T` | `JSON.parse` | Custom deserialization function |
33
- | `options.maxAge` | `number` | 1 year | Cookie expiration in seconds |
34
-
35
- ---
36
-
37
- ## Returns
38
-
39
- Returns a tuple similar to `useState`:
40
-
41
- 1. **Current value** - The cookie value (or `loadingValue` during SSR)
42
- 2. **Setter function** - Updates the cookie (accepts value or callback)
43
-
44
- ---
45
-
46
- ## Basic usage
47
-
48
- ```js
49
- import { useCookie } from "aidos-ui";
50
-
51
- function Settings() {
52
- const [theme, setTheme] = useCookie("theme", {
53
- initialValue: "light",
54
- loadingValue: "light",
55
- });
56
-
57
- return (
58
- <Button onClick={() => setTheme(theme === "light" ? "dark" : "light")}>
59
- Current: {theme}
60
- </Button>
61
- );
62
- }
63
- ```
64
-
65
- ---
66
-
67
- ## With callback setter
68
-
69
- Like `useState`, the setter accepts a callback function:
70
-
71
- ```js
72
- const [count, setCount] = useCookie("visit-count", {
73
- initialValue: 0,
74
- loadingValue: 0,
75
- });
76
-
77
- // Increment based on previous value
78
- setCount((prev) => prev + 1);
79
- ```
80
-
81
- ---
82
-
83
- ## SSR handling
84
-
85
- The `loadingValue` is used during server-side rendering when cookies aren't available:
86
-
87
- ```js
88
- const [user, setUser] = useCookie("user-preferences", {
89
- initialValue: { notifications: true },
90
- loadingValue: null, // Renders nothing during SSR
91
- });
92
-
93
- if (user === null) {
94
- return <Spinner />;
95
- }
96
-
97
- return <Settings preferences={user} />;
98
- ```
99
-
100
- ---
101
-
102
- ## Custom serialization
103
-
104
- For complex data or non-JSON formats:
105
-
106
- ```js
107
- const [date, setDate] = useCookie("last-visit", {
108
- initialValue: new Date(),
109
- loadingValue: null,
110
- serialize: (d) => d.toISOString(),
111
- deserialize: (s) => new Date(s),
112
- });
113
- ```
114
-
115
- ---
116
-
117
- ## Custom expiration
118
-
119
- Set cookie expiration with `maxAge` (in seconds):
120
-
121
- ```js
122
- // Expire in 1 hour
123
- const [session, setSession] = useCookie("session", {
124
- initialValue: null,
125
- loadingValue: null,
126
- maxAge: 60 * 60, // 1 hour
127
- });
128
-
129
- // Expire in 30 days
130
- const [preferences, setPreferences] = useCookie("prefs", {
131
- initialValue: {},
132
- loadingValue: {},
133
- maxAge: 60 * 60 * 24 * 30, // 30 days
134
- });
135
- ```
136
-
137
- ---
138
-
139
- ## Helper functions
140
-
141
- The module also exports utility functions:
142
-
143
- ```js
144
- import { hasCookie, getCookie } from "aidos-ui";
145
-
146
- // Check if cookie exists
147
- if (hasCookie("user-token")) {
148
- // ...
149
- }
150
-
151
- // Get cookie value directly
152
- const token = getCookie("user-token");
153
- ```
154
-
155
- ---
156
-
157
- ## Dark mode example
158
-
159
- ```js
160
- function App() {
161
- const [darkMode, setDarkMode] = useCookie("dark-mode", {
162
- initialValue: false,
163
- loadingValue: false,
164
- });
165
-
166
- useEffect(() => {
167
- document.body.classList.toggle("dark-mode", darkMode);
168
- }, [darkMode]);
169
-
170
- return (
171
- <Button onClick={() => setDarkMode(!darkMode)}>
172
- {darkMode ? "Light mode" : "Dark mode"}
173
- </Button>
174
- );
175
- }
176
- ```