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,74 +0,0 @@
1
- // Custom JSX dev runtime that injects <!-- ComponentName --> comments
2
- // into the DOM at component boundaries.
3
- //
4
- // Usage: in tsconfig.json, set "jsxImportSource": "aidos-ui/src"
5
- // (or wherever this file is importable from)
6
-
7
- export { Fragment } from "react/jsx-dev-runtime";
8
- import { jsxDEV as _jsxDEV, Fragment } from "react/jsx-dev-runtime";
9
- import { JSSComment } from "./JSSComment";
10
-
11
- const wrapCache = new WeakMap<Function, Function>();
12
-
13
- function getWrapped(type: Function): Function {
14
- let wrapped = wrapCache.get(type);
15
- if (wrapped) return wrapped;
16
-
17
- const name = (type as any).displayName || type.name;
18
-
19
- wrapped = function JSSBoundary(props: any) {
20
- return _jsxDEV(
21
- Fragment,
22
- {
23
- children: [
24
- _jsxDEV(JSSComment, { name }, undefined, false, undefined, undefined),
25
- _jsxDEV(type as any, props, undefined, false, undefined, undefined),
26
- ],
27
- },
28
- undefined,
29
- true,
30
- undefined,
31
- undefined
32
- );
33
- };
34
-
35
- (wrapped as any).displayName = name;
36
- wrapCache.set(type, wrapped);
37
-
38
- return wrapped;
39
- }
40
-
41
- // Skip our own wrapper components by name
42
- const SKIP_NAMES = new Set(["JSSComment", "JSSBoundary"]);
43
-
44
- function isUserComponent(type: any, source: any): boolean {
45
- if (typeof type !== "function") return false;
46
- const name = type.displayName || type.name;
47
- if (!name || !/^[A-Z]/.test(name)) return false;
48
- if (SKIP_NAMES.has(name)) return false;
49
- // Use the source fileName from the JSX transform to skip node_modules
50
- if (source?.fileName?.includes("node_modules")) return false;
51
- return true;
52
- }
53
-
54
- export function jsxDEV(
55
- type: any,
56
- props: any,
57
- key: any,
58
- isStaticChildren: boolean,
59
- source: any,
60
- self: any
61
- ) {
62
- if (isUserComponent(type, source)) {
63
- return _jsxDEV(
64
- getWrapped(type) as any,
65
- props,
66
- key,
67
- isStaticChildren,
68
- source,
69
- self
70
- );
71
- }
72
-
73
- return _jsxDEV(type, props, key, isStaticChildren, source, self);
74
- }
@@ -1,2 +0,0 @@
1
- // Production JSX runtime — straight passthrough, no component annotations.
2
- export { jsx, jsxs, Fragment } from "react/jsx-runtime";
@@ -1,52 +0,0 @@
1
- const LETTERS_26 = [
2
- "a",
3
- "b",
4
- "c",
5
- "d",
6
- "e",
7
- "f",
8
- "g",
9
- "h",
10
- "i",
11
- "j",
12
- "k",
13
- "l",
14
- "m",
15
- "n",
16
- "o",
17
- "p",
18
- "q",
19
- "r",
20
- "s",
21
- "t",
22
- "u",
23
- "v",
24
- "w",
25
- "x",
26
- "y",
27
- "z",
28
- ];
29
-
30
- export function numberToBase(
31
- number: number,
32
- base: Array<string> = LETTERS_26
33
- ): string {
34
- if (number <= -1) {
35
- return "";
36
- }
37
-
38
- let result = [];
39
-
40
- // To make numbers 1 indexed
41
- number += 1;
42
-
43
- while (number >= base.length) {
44
- const index = number % base.length;
45
- number = Math.floor(number / base.length) - 1;
46
- result.push(base[index]);
47
- }
48
-
49
- result.push(base[number]);
50
-
51
- return result.reverse().join("");
52
- }
@@ -1,152 +0,0 @@
1
- import { Badge } from "../Badge";
2
- import { Row } from "../Row";
3
- import { Column } from "../Column";
4
- import { Span } from "../Text";
5
- import { IconButton } from "../IconButton";
6
-
7
- # Badge
8
-
9
- A small circular indicator used to draw attention to specific UI elements. Common uses include notification counts, status indicators, and visual markers.
10
-
11
- ---
12
-
13
- ## Props
14
-
15
- | Prop | Type | Default | Description |
16
- |------|------|---------|-------------|
17
- | `size` | `Size` | `"medium"` | Badge size: `"xsmall"` (4px), `"small"` (6px), `"medium"` (12px), `"large"` (18px), `"xlarge"` (24px) |
18
- | `color` | `Color` | `"highlight"` | Background color from theme |
19
-
20
- ---
21
-
22
- ## Sizes
23
-
24
- <Row gap="large" align="center" justify="center" padding="medium">
25
- <Column align="center" gap="small">
26
- <Badge size="xsmall" />
27
- <Span size="small" color="secondary">xsmall</Span>
28
- </Column>
29
- <Column align="center" gap="small">
30
- <Badge size="small" />
31
- <Span size="small" color="secondary">small</Span>
32
- </Column>
33
- <Column align="center" gap="small">
34
- <Badge size="medium" />
35
- <Span size="small" color="secondary">medium</Span>
36
- </Column>
37
- <Column align="center" gap="small">
38
- <Badge size="large" />
39
- <Span size="small" color="secondary">large</Span>
40
- </Column>
41
- <Column align="center" gap="small">
42
- <Badge size="xlarge" />
43
- <Span size="small" color="secondary">xlarge</Span>
44
- </Column>
45
- </Row>
46
-
47
- ```js
48
- <Badge size="xsmall" /> // 4px
49
- <Badge size="small" /> // 6px
50
- <Badge size="medium" /> // 12px (default)
51
- <Badge size="large" /> // 18px
52
- <Badge size="xlarge" /> // 24px
53
- ```
54
-
55
- ---
56
-
57
- ## Colors
58
-
59
- <Row gap="large" align="center" justify="center" padding="medium">
60
- <Column align="center" gap="small">
61
- <Badge color="highlight" />
62
- <Span size="small" color="secondary">highlight</Span>
63
- </Column>
64
- <Column align="center" gap="small">
65
- <Badge color="negative" />
66
- <Span size="small" color="secondary">negative</Span>
67
- </Column>
68
- <Column align="center" gap="small">
69
- <Badge color="warning" />
70
- <Span size="small" color="secondary">warning</Span>
71
- </Column>
72
- <Column align="center" gap="small">
73
- <Badge color="divider" />
74
- <Span size="small" color="secondary">divider</Span>
75
- </Column>
76
- </Row>
77
-
78
- ```js
79
- <Badge color="highlight" /> // Accent/brand color
80
- <Badge color="negative" /> // Error/alert
81
- <Badge color="warning" /> // Warning
82
- <Badge color="divider" /> // Neutral/muted
83
- ```
84
-
85
- ---
86
-
87
- ## Common use cases
88
-
89
- ### Notification indicator
90
-
91
- <Row gap="medium" align="center" padding="medium">
92
- <Row jss={{ position: "relative" }}>
93
- <IconButton bare icon="fa-bell" size="large" color="secondary" onClick={() => {}} />
94
- <Badge size="small" color="negative" jss={{ position: "absolute", top: 0, right: 0 }} />
95
- </Row>
96
- <Span color="secondary">Unread notifications</Span>
97
- </Row>
98
-
99
- ```js
100
- <Row jss={{ position: "relative" }}>
101
- <IconButton bare icon="fa-bell" size="large" color="secondary" onClick={() => {}} />
102
- <Badge
103
- size="small"
104
- color="negative"
105
- jss={{ position: "absolute", top: 0, right: 0 }}
106
- />
107
- </Row>
108
- ```
109
-
110
- ### Status indicator
111
-
112
- <Column gap="small" padding="medium">
113
- <Row gap="small" align="center">
114
- <Badge size="small" color="highlight" />
115
- <Span>Online</Span>
116
- </Row>
117
- <Row gap="small" align="center">
118
- <Badge size="small" color="warning" />
119
- <Span>Away</Span>
120
- </Row>
121
- <Row gap="small" align="center">
122
- <Badge size="small" color="divider" />
123
- <Span>Offline</Span>
124
- </Row>
125
- </Column>
126
-
127
- ```js
128
- <Row gap="small" align="center">
129
- <Badge size="small" color="highlight" />
130
- <Span>Online</Span>
131
- </Row>
132
- ```
133
-
134
- ---
135
-
136
- ## Visual markers
137
-
138
- Use badges to highlight new or important items:
139
-
140
- <Row gap="medium" align="center" padding="medium">
141
- <Row gap="small" align="center">
142
- <Span>New feature</Span>
143
- <Badge size="xsmall" color="highlight" />
144
- </Row>
145
- </Row>
146
-
147
- ```js
148
- <Row gap="small" align="center">
149
- <Span>New feature</Span>
150
- <Badge size="xsmall" color="highlight" />
151
- </Row>
152
- ```
@@ -1,163 +0,0 @@
1
- import { Button } from "../Button";
2
- import { Row } from "../Row";
3
- import { Column } from "../Column";
4
- import { Icon } from "../Icon";
5
-
6
- # Button
7
-
8
- The `Button` component enables users to trigger actions with a single click. It supports multiple color variants for different semantic purposes and can include icons.
9
-
10
- ---
11
-
12
- ## Props
13
-
14
- | Prop | Type | Required | Default | Description |
15
- |------|------|----------|---------|-------------|
16
- | `children` | `string` | Yes | - | Button text label |
17
- | `color` | `InteractableColor` | Yes | - | `"positive"`, `"primary"`, `"negative"`, `"dark"`, `"light"` |
18
- | `onClick` | `function` | Yes | - | Click handler |
19
- | `bare` | `boolean` | No | `false` | Removes background for a lighter appearance |
20
- | `border` | `boolean` | No | `false` | Adds a border matching the text color |
21
- | `disabled` | `boolean` | No | `false` | Disables interaction |
22
- | `icon` | `IconType` | No | - | Icon to display alongside text |
23
- | `iconPosition` | `"left"` \| `"right"` | No | `"left"` | Icon placement relative to text |
24
- | `iconSize` | `Size` | No | `"medium"` | Icon size |
25
- | `size` | `Size` | No | `"medium"` | Text size |
26
- | `padding` | `Padding` | No | `"medium"` | Internal padding |
27
- | `bold` | `boolean` | No | `false` | Bold text |
28
-
29
- ---
30
-
31
- ## Color variants
32
-
33
- Each color variant communicates a different intent to users:
34
-
35
- - **Positive**: Confirmations, submissions, primary actions
36
- - **Primary**: Secondary or neutral actions
37
- - **Negative**: Destructive actions like delete or remove
38
- - **Dark/Light**: Theme-specific variants for special contexts
39
-
40
- <Row gap="large" align="center" padding="large" justify="center">
41
- <Button color="positive" onClick={() => {}}>Positive</Button>
42
- <Button color="primary" onClick={() => {}}>Primary</Button>
43
- <Button color="negative" onClick={() => {}}>Negative</Button>
44
- <Button color="dark" onClick={() => {}}>Dark</Button>
45
- <Button color="light" onClick={() => {}}>Light</Button>
46
- </Row>
47
-
48
- ```js
49
- <Button color="positive" onClick={() => {}}>Positive</Button>
50
- <Button color="primary" onClick={() => {}}>Primary</Button>
51
- <Button color="negative" onClick={() => {}}>Negative</Button>
52
- <Button color="dark" onClick={() => {}}>Dark</Button>
53
- <Button color="light" onClick={() => {}}>Light</Button>
54
- ```
55
-
56
- ---
57
-
58
- ## Bare variant
59
-
60
- The `bare` prop removes the background color, creating a lighter appearance that integrates well within complex layouts or when you need a less prominent action.
61
-
62
- <Row gap="large" align="center" padding="large" justify="center">
63
- <Button bare color="positive" onClick={() => {}}>Positive</Button>
64
- <Button bare color="primary" onClick={() => {}}>Primary</Button>
65
- <Button bare color="negative" onClick={() => {}}>Negative</Button>
66
- <Button bare color="dark" onClick={() => {}}>Dark</Button>
67
- <Button bare color="light" onClick={() => {}}>Light</Button>
68
- </Row>
69
-
70
- ```js
71
- <Button bare color="positive" onClick={() => {}}>Positive</Button>
72
- <Button bare color="primary" onClick={() => {}}>Primary</Button>
73
- <Button bare color="negative" onClick={() => {}}>Negative</Button>
74
- ```
75
-
76
- ---
77
-
78
- ## With border
79
-
80
- Add a `border` prop to give buttons a defined edge. Works well with `bare` for outlined button styles.
81
-
82
- <Row gap="large" align="center" padding="large" justify="center">
83
- <Button border bare color="positive" onClick={() => {}}>Positive</Button>
84
- <Button border bare color="primary" onClick={() => {}}>Primary</Button>
85
- <Button border bare color="negative" onClick={() => {}}>Negative</Button>
86
- </Row>
87
-
88
- ```js
89
- <Button border bare color="positive" onClick={() => {}}>Outlined</Button>
90
- <Button border bare color="primary" onClick={() => {}}>Outlined</Button>
91
- <Button border bare color="negative" onClick={() => {}}>Outlined</Button>
92
- ```
93
-
94
- ---
95
-
96
- ## With icon
97
-
98
- Buttons can include icons to reinforce their purpose. Use `icon` to specify the icon and `iconPosition` to place it on the left or right.
99
-
100
- <Row gap="large" align="center" padding="large" justify="center">
101
- <Button color="positive" icon="fa-check" onClick={() => {}}>Confirm</Button>
102
- <Button color="negative" icon="fa-trash" onClick={() => {}}>Delete</Button>
103
- <Button color="primary" icon="fa-arrow-right" iconPosition="right" onClick={() => {}}>Next</Button>
104
- </Row>
105
-
106
- ```js
107
- <Button color="positive" icon="fa-check" onClick={() => {}}>
108
- Confirm
109
- </Button>
110
-
111
- <Button color="negative" icon="fa-trash" onClick={() => {}}>
112
- Delete
113
- </Button>
114
-
115
- <Button color="primary" icon="fa-arrow-right" iconPosition="right" onClick={() => {}}>
116
- Next
117
- </Button>
118
- ```
119
-
120
- ---
121
-
122
- ## Disabled state
123
-
124
- Disabled buttons prevent interaction and display a muted appearance. The component uses `aria-disabled` for accessibility.
125
-
126
- <Row gap="large" align="center" padding="large" justify="center">
127
- <Button color="positive" disabled onClick={() => {}}>Disabled</Button>
128
- <Button bare color="positive" disabled onClick={() => {}}>Disabled bare</Button>
129
- <Button border bare color="positive" disabled onClick={() => {}}>Disabled outlined</Button>
130
- </Row>
131
-
132
- ```js
133
- <Button color="positive" disabled onClick={() => {}}>
134
- Disabled
135
- </Button>
136
- ```
137
-
138
- ---
139
-
140
- ## Sizes
141
-
142
- Control text size with the `size` prop. Available sizes: `"xsmall"`, `"small"`, `"medium"`, `"large"`, `"xlarge"`.
143
-
144
- <Row gap="large" align="center" padding="large" justify="center">
145
- <Button color="positive" size="small" onClick={() => {}}>Small</Button>
146
- <Button color="positive" size="medium" onClick={() => {}}>Medium</Button>
147
- <Button color="positive" size="large" onClick={() => {}}>Large</Button>
148
- </Row>
149
-
150
- ```js
151
- <Button color="positive" size="small" onClick={() => {}}>Small</Button>
152
- <Button color="positive" size="medium" onClick={() => {}}>Medium</Button>
153
- <Button color="positive" size="large" onClick={() => {}}>Large</Button>
154
- ```
155
-
156
- ---
157
-
158
- ## Accessibility
159
-
160
- - Buttons use semantic `<button>` elements
161
- - Disabled state is communicated via `aria-disabled` attribute
162
- - Focus states are clearly visible with outline styling
163
- - Click handlers are ignored when disabled, preventing accidental actions
@@ -1,254 +0,0 @@
1
- import { Calendar } from "../Calendar";
2
- import { Box } from "../Box";
3
- import { Row } from "../Row";
4
- import { Column } from "../Column";
5
- import { Badge } from "../Badge";
6
- import { Span, H3 } from "../Text";
7
- import { cssVar } from "../jss";
8
-
9
- # Calendar
10
-
11
- A flexible calendar grid component for displaying months. Fully customizable through render callbacks for both header cells (weekday names) and day cells.
12
-
13
- ---
14
-
15
- ## Props
16
-
17
- | Prop | Type | Default | Description |
18
- |------|------|---------|-------------|
19
- | `date` | `Date` | Required | The month to display (uses year and month from this date) |
20
- | `header` | `(props) => JSX.Element` | Required | Render function for weekday header cells |
21
- | `cell` | `(props) => JSX.Element` | Required | Render function for day cells |
22
- | `jss` | `JSS` | - | Custom styles for the calendar grid |
23
-
24
- ### Header render props
25
-
26
- | Property | Type | Description |
27
- |----------|------|-------------|
28
- | `weekday` | `string` | Localized weekday abbreviation (Mon, Tue, etc.) |
29
-
30
- ### Cell render props
31
-
32
- | Property | Type | Description |
33
- |----------|------|-------------|
34
- | `date` | `Date` | The date for this cell |
35
- | `today` | `boolean` | Whether this date is today |
36
- | `outOfMonth` | `boolean` | Whether this date is outside the current month |
37
- | `top` | `boolean` | Whether this cell is in the top row |
38
- | `bottom` | `boolean` | Whether this cell is in the bottom row |
39
- | `left` | `boolean` | Whether this cell is in the leftmost column |
40
- | `right` | `boolean` | Whether this cell is in the rightmost column |
41
-
42
- ---
43
-
44
- ## Basic usage
45
-
46
- <Calendar
47
- date={new Date()}
48
- header={({ weekday }) => (
49
- <Box padding="small" jss={{ textAlign: "center" }}>
50
- <Span bold color="secondary" size="small">{weekday}</Span>
51
- </Box>
52
- )}
53
- cell={({ today, date, outOfMonth }) => (
54
- <Box padding="small" relative={true} jss={{ opacity: outOfMonth ? 0.3 : 1, textAlign: "center" }}>
55
- {today && (
56
- <Badge
57
- size="xlarge"
58
- color="highlight"
59
- jss={{
60
- position: "absolute",
61
- top: "50%",
62
- left: "50%",
63
- transform: "translate(-50%, -50%)",
64
- zIndex: 0,
65
- }}
66
- />
67
- )}
68
- <Span jss={{ position: "relative", zIndex: 1 }} color={today ? "light" : "primary"}>
69
- {date.getDate()}
70
- </Span>
71
- </Box>
72
- )}
73
- />
74
-
75
- ```js
76
- <Calendar
77
- date={new Date()}
78
- header={({ weekday }) => (
79
- <Box padding="small" jss={{ textAlign: "center" }}>
80
- <Span bold color="secondary" size="small">{weekday}</Span>
81
- </Box>
82
- )}
83
- cell={({ today, date, outOfMonth }) => (
84
- <Box padding="small" jss={{ opacity: outOfMonth ? 0.3 : 1 }}>
85
- {today && <Badge color="highlight" />}
86
- <Span>{date.getDate()}</Span>
87
- </Box>
88
- )}
89
- />
90
- ```
91
-
92
- ---
93
-
94
- ## With today indicator
95
-
96
- <Calendar
97
- date={new Date()}
98
- header={({ weekday }) => (
99
- <Box>
100
- <H3>{weekday}</H3>
101
- </Box>
102
- )}
103
- cell={({ today, date, outOfMonth }) => (
104
- <Box relative={true} jss={{ opacity: outOfMonth ? 0.2 : 1 }}>
105
- {today && (
106
- <Badge
107
- jss={{
108
- position: "absolute",
109
- top: "50%",
110
- transform: "translateY(-50%) translateX(-75%)",
111
- right: "50%",
112
- }}
113
- />
114
- )}
115
- <Span>{date.getDate()}</Span>
116
- </Box>
117
- )}
118
- />
119
-
120
- ```js
121
- <Calendar
122
- date={new Date()}
123
- header={({ weekday }) => (
124
- <Box>
125
- <H3>{weekday}</H3>
126
- </Box>
127
- )}
128
- cell={({ today, date, outOfMonth }) => (
129
- <Box relative={true} jss={{ opacity: outOfMonth ? 0.2 : 1 }}>
130
- {today && (
131
- <Badge
132
- jss={{
133
- position: "absolute",
134
- top: "50%",
135
- transform: "translateY(-50%) translateX(-75%)",
136
- right: "50%",
137
- }}
138
- />
139
- )}
140
- <Span>{date.getDate()}</Span>
141
- </Box>
142
- )}
143
- />
144
- ```
145
-
146
- ---
147
-
148
- ## Using position props
149
-
150
- The cell render props include position information for styling borders and corners:
151
-
152
- ```js
153
- <Calendar
154
- date={new Date()}
155
- header={({ weekday }) => <Span>{weekday}</Span>}
156
- cell={({ date, outOfMonth, top, bottom, left, right }) => (
157
- <Box
158
- jss={{
159
- opacity: outOfMonth ? 0.3 : 1,
160
- borderTop: top ? "1px solid var(--divider)" : "none",
161
- borderBottom: bottom ? "1px solid var(--divider)" : "none",
162
- borderLeft: left ? "1px solid var(--divider)" : "none",
163
- borderRight: right ? "1px solid var(--divider)" : "none",
164
- borderTopLeftRadius: top && left ? 8 : 0,
165
- borderTopRightRadius: top && right ? 8 : 0,
166
- borderBottomLeftRadius: bottom && left ? 8 : 0,
167
- borderBottomRightRadius: bottom && right ? 8 : 0,
168
- }}
169
- >
170
- <Span>{date.getDate()}</Span>
171
- </Box>
172
- )}
173
- />
174
- ```
175
-
176
- ---
177
-
178
- ## Interactive calendar
179
-
180
- Create a date picker by adding click handlers:
181
-
182
- ```js
183
- function DatePicker() {
184
- const [selected, setSelected] = useState(null);
185
- const [month, setMonth] = useState(new Date());
186
-
187
- return (
188
- <Column gap="medium">
189
- <Row justify="space-between" align="center">
190
- <IconButton
191
- icon="fa-chevron-left"
192
- onClick={() => setMonth(new Date(month.getFullYear(), month.getMonth() - 1))}
193
- />
194
- <Span bold>
195
- {month.toLocaleDateString("en-US", { month: "long", year: "numeric" })}
196
- </Span>
197
- <IconButton
198
- icon="fa-chevron-right"
199
- onClick={() => setMonth(new Date(month.getFullYear(), month.getMonth() + 1))}
200
- />
201
- </Row>
202
- <Calendar
203
- date={month}
204
- header={({ weekday }) => <Span size="small">{weekday}</Span>}
205
- cell={({ date, outOfMonth, today }) => {
206
- const isSelected = selected?.toDateString() === date.toDateString();
207
- return (
208
- <BaseButton
209
- bare
210
- onClick={() => !outOfMonth && setSelected(date)}
211
- jss={{
212
- opacity: outOfMonth ? 0.3 : 1,
213
- backgroundColor: isSelected ? "var(--highlight)" : "transparent",
214
- borderRadius: "50%",
215
- }}
216
- >
217
- <Span color={isSelected ? "light" : "primary"}>
218
- {date.getDate()}
219
- </Span>
220
- </BaseButton>
221
- );
222
- }}
223
- />
224
- </Column>
225
- );
226
- }
227
- ```
228
-
229
- ---
230
-
231
- ## Grid layout
232
-
233
- The Calendar uses CSS Grid with 7 columns (Mon-Sun). The header row and day cells flow naturally into the grid:
234
-
235
- ```js
236
- // Custom grid styling
237
- <Calendar
238
- date={new Date()}
239
- jss={{
240
- gap: 4,
241
- padding: 16,
242
- backgroundColor: "var(--secondary-background)",
243
- borderRadius: 12,
244
- }}
245
- header={...}
246
- cell={...}
247
- />
248
- ```
249
-
250
- ---
251
-
252
- ## Localization
253
-
254
- Weekday names are automatically localized using `Intl.DateTimeFormat` with UK English locale (week starts Monday). The calendar always displays Monday through Sunday.