aidos-ui 4.0.4 → 4.0.6

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 +801 -68
  4. package/dist/index.js +3934 -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 +61 -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,62 +0,0 @@
1
- import React from "react";
2
- import { InteractableColor, getInteractableJSS } from "./Interactable";
3
- import { JSS, Padding, toClassnames } from "./jss";
4
-
5
- export interface BaseButtonProps
6
- extends React.ButtonHTMLAttributes<HTMLButtonElement> {
7
- onClick: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
8
- jss?: JSS;
9
- color: InteractableColor;
10
- bare?: boolean;
11
- border?: boolean;
12
- className?: undefined;
13
- animateInteraction?: boolean;
14
- padding?: Padding;
15
- }
16
-
17
- export const BaseButton = React.forwardRef(
18
- (
19
- {
20
- onClick,
21
- children,
22
- jss,
23
- color,
24
- bare = false,
25
- border = false,
26
- disabled,
27
- animateInteraction = true,
28
- padding,
29
- ...otherProps
30
- }: BaseButtonProps,
31
- ref?: React.Ref<HTMLButtonElement>
32
- ) => {
33
- return (
34
- <button
35
- type="button"
36
- {...otherProps}
37
- aria-disabled={disabled ? true : undefined}
38
- ref={ref}
39
- onClick={(event) => {
40
- if (disabled) {
41
- return;
42
- }
43
-
44
- onClick?.(event);
45
- }}
46
- className={toClassnames([
47
- ...getInteractableJSS({
48
- color,
49
- bare,
50
- border,
51
- disabled,
52
- animateInteraction,
53
- padding,
54
- }),
55
- jss,
56
- ])}
57
- >
58
- {children}
59
- </button>
60
- );
61
- }
62
- );
package/src/BaseInput.tsx DELETED
@@ -1,63 +0,0 @@
1
- import React, { ReactNode, useId } from "react";
2
- import { JSS, Size, TextColor, toClassnames } from "./jss";
3
- import { Label } from "./Text";
4
-
5
- export interface BaseInputProps
6
- extends React.InputHTMLAttributes<HTMLInputElement> {
7
- jss?: JSS;
8
- className?: undefined;
9
- size?: undefined;
10
- children?: undefined;
11
- label?: ReactNode;
12
- labelSize?: Size;
13
- labelColor?: TextColor;
14
- labelBold?: boolean;
15
- labelPosition?: "start" | "end";
16
- }
17
-
18
- export const BaseInput = React.forwardRef(
19
- (
20
- {
21
- jss,
22
- label,
23
- labelPosition = "end",
24
- labelSize,
25
- labelColor,
26
- labelBold,
27
- id: propId,
28
- ...otherProps
29
- }: BaseInputProps,
30
- ref?: React.Ref<HTMLInputElement>
31
- ) => {
32
- const hookid = useId();
33
- const id = propId ?? hookid;
34
- const labelElement = (
35
- <Label
36
- size={labelSize}
37
- bold={labelBold}
38
- color={labelColor}
39
- jss={{
40
- display: "flex",
41
- alignItems: "center",
42
- justifyContent: "center",
43
- }}
44
- htmlFor={id}
45
- >
46
- {label}
47
- </Label>
48
- );
49
-
50
- return (
51
- <>
52
- {label && labelPosition === "start" && labelElement}
53
- <input
54
- id={id}
55
- ref={ref}
56
- className={toClassnames(jss)}
57
- {...otherProps}
58
- />
59
- {label && labelPosition === "end" && labelElement}
60
- </>
61
- );
62
- }
63
- );
package/src/BaseLink.tsx DELETED
@@ -1,80 +0,0 @@
1
- import React, { useContext } from "react";
2
- import { InteractableColor, getInteractableJSS } from "./Interactable";
3
- import { JSS, Padding, toClassnames } from "./jss";
4
-
5
- export interface BaseLinkProps
6
- extends React.LinkHTMLAttributes<HTMLAnchorElement> {
7
- onClick?: (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
8
- target?: string;
9
- jss?: JSS;
10
- color: InteractableColor;
11
- href: string;
12
- disabled?: boolean;
13
- bare?: boolean;
14
- border?: boolean;
15
- className?: undefined;
16
- animateInteraction?: boolean;
17
- padding?: Padding;
18
- }
19
-
20
- // This only exists to make NextJS happy, it should not be used in any other case
21
- export const BaseLinkComponentOverrideContext = React.createContext((props) => (
22
- <a {...props} />
23
- ));
24
-
25
- export const BaseLink = React.forwardRef(
26
- (
27
- {
28
- onClick,
29
- children,
30
- jss,
31
- color,
32
- bare = false,
33
- disabled,
34
- animateInteraction = true,
35
- padding,
36
- href,
37
- border,
38
- role = "link",
39
- ...otherProps
40
- }: BaseLinkProps,
41
- ref?: React.Ref<HTMLAnchorElement>
42
- ) => {
43
- const Link = useContext(BaseLinkComponentOverrideContext);
44
-
45
- return (
46
- <Link
47
- {...otherProps}
48
- aria-disabled={disabled ? true : undefined}
49
- href={href}
50
- role={role}
51
- ref={ref}
52
- onClick={
53
- onClick
54
- ? (event) => {
55
- if (disabled) {
56
- return;
57
- }
58
-
59
- onClick(event);
60
- }
61
- : undefined
62
- }
63
- className={toClassnames([
64
- ...getInteractableJSS({
65
- color,
66
- border,
67
- bare,
68
- disabled,
69
- animateInteraction,
70
- padding,
71
- }),
72
- disabled && { pointerEvents: "none" },
73
- jss,
74
- ])}
75
- >
76
- {children}
77
- </Link>
78
- );
79
- }
80
- );
package/src/BaseList.tsx DELETED
@@ -1,26 +0,0 @@
1
- import React from "react";
2
- import { Column, ColumnProps } from "./Column";
3
-
4
- export interface BaseListProps extends ColumnProps {
5
- tag?: undefined;
6
- }
7
-
8
- export const BaseList = React.forwardRef(
9
- ({ jss, ...otherProps }: BaseListProps, ref?: React.Ref<HTMLDivElement>) => {
10
- return (
11
- <Column
12
- {...otherProps}
13
- tag="ul"
14
- jss={[
15
- {
16
- listStyle: "none",
17
- margin: 0,
18
- padding: 0,
19
- },
20
- jss,
21
- ]}
22
- ref={ref}
23
- />
24
- );
25
- }
26
- );
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import { BaseView, BaseViewProps } from "./BaseView";
3
-
4
- export interface BaseListAddOnProps extends BaseViewProps {}
5
-
6
- export const BaseListAddOn = React.forwardRef(
7
- (props: BaseListAddOnProps, ref?: React.Ref<HTMLDivElement>) => {
8
- return <BaseView {...props} ref={ref} />;
9
- }
10
- );
@@ -1,119 +0,0 @@
1
- import React, { ReactNode } from "react";
2
-
3
- import { ListDivider } from "./ListDivider";
4
- import { Row, RowProps } from "./Row";
5
- import { JSS, Size, Position, Spacing, TextColor, cssVar } from "./jss";
6
- import { InteractableColor } from "./Interactable";
7
- import { TextPairing } from "./TextPairing";
8
- import { BaseView } from "./BaseView";
9
- import { useListContext } from "./List";
10
-
11
- // @ts-ignore
12
- export interface BaseListItemProps extends RowProps {
13
- children: (elements: { content: React.JSX.Element }) => ReactNode;
14
- jss?: JSS;
15
- withDivider?: boolean;
16
- headline: string;
17
- headlineSize?: Size;
18
- headlineColor?: TextColor;
19
- headlineAddOn?: ReactNode;
20
- headlineBold?: boolean;
21
- body?: string;
22
- bodySize?: Size;
23
- bodyColor?: TextColor;
24
- addOn?: ReactNode;
25
- addOnPosition?: Position;
26
- outerAddOn?: ReactNode;
27
- disabled?: boolean;
28
- role?: undefined;
29
- gap?: Spacing;
30
- selected?: boolean;
31
- }
32
-
33
- export const BaseListItem = React.forwardRef(
34
- (
35
- {
36
- children,
37
- jss,
38
- withDivider = true,
39
- headline,
40
- headlineSize = "medium",
41
- headlineColor = "primary",
42
- headlineAddOn,
43
- body,
44
- bodySize = "small",
45
- bodyColor = "secondary",
46
- addOn,
47
- addOnPosition,
48
- outerAddOn,
49
- disabled = false,
50
- padding = "medium",
51
- gap = "medium",
52
- selected,
53
- headlineBold,
54
- ...otherProps
55
- }: BaseListItemProps,
56
- ref?: React.Ref<HTMLElement>
57
- ) => {
58
- const { bare, carded } = useListContext();
59
-
60
- const content = (
61
- <TextPairing
62
- headlineBold={headlineBold}
63
- padding={padding}
64
- gap={gap}
65
- addOn={addOn}
66
- addOnPosition={addOnPosition}
67
- headline={headline}
68
- headlineSize={headlineSize}
69
- headlineColor={
70
- disabled ? "subtle" : bare && selected ? "highlight" : headlineColor
71
- }
72
- headlineAddOn={headlineAddOn}
73
- body={body}
74
- bodySize={bodySize}
75
- bodyColor={disabled ? "subtle" : bodyColor}
76
- grow={true}
77
- shrink={false}
78
- />
79
- );
80
-
81
- return (
82
- <>
83
- <Row
84
- {...otherProps}
85
- ref={ref}
86
- relative
87
- tag="li"
88
- role="row"
89
- jss={[
90
- !bare &&
91
- carded && {
92
- [":first-child *"]: {
93
- borderTopLeftRadius: cssVar("--border-radius-l"),
94
- borderTopRightRadius: cssVar("--border-radius-l"),
95
- },
96
- [":last-child *"]: {
97
- borderBottomLeftRadius: cssVar("--border-radius-l"),
98
- borderBottomRightRadius: cssVar("--border-radius-l"),
99
- },
100
- },
101
- jss,
102
- ]}
103
- >
104
- <Row
105
- grow
106
- role="gridcell"
107
- jss={{
108
- overflow: "hidden",
109
- }}
110
- >
111
- {children({ content })}
112
- </Row>
113
- {outerAddOn && <BaseView role="gridcell">{outerAddOn}</BaseView>}
114
- </Row>
115
- {withDivider && <ListDivider />}
116
- </>
117
- );
118
- }
119
- );
package/src/BaseView.tsx DELETED
@@ -1,57 +0,0 @@
1
- import React from "react";
2
- import { JSS, toClassnames } from "./jss";
3
-
4
- const styles: { [key: string]: JSS } = {
5
- relative: {
6
- position: "relative",
7
- },
8
- grow: {
9
- flexGrow: 1,
10
- },
11
- shrink: {
12
- flexShrink: 1,
13
- },
14
- };
15
-
16
- export interface BaseViewProps extends React.HTMLAttributes<HTMLElement> {
17
- jss?: JSS;
18
- ref?: React.Ref<HTMLDivElement>;
19
- className?: undefined;
20
- grow?: boolean;
21
- shrink?: boolean;
22
- relative?: boolean;
23
- tag?: keyof HTMLElementTagNameMap;
24
- }
25
-
26
- export const BaseView = React.forwardRef(
27
- (
28
- {
29
- jss,
30
- children,
31
- tag,
32
- grow,
33
- shrink,
34
- relative,
35
- ...otherProps
36
- }: BaseViewProps,
37
- ref?: React.Ref<HTMLElement>
38
- ) => {
39
- const Tag: string = tag ?? "div";
40
-
41
- return (
42
- // @ts-ignore
43
- <Tag
44
- ref={ref}
45
- className={toClassnames([
46
- jss,
47
- grow && styles.grow,
48
- shrink && styles.shrink,
49
- relative && styles.relative,
50
- ])}
51
- {...otherProps}
52
- >
53
- {children}
54
- </Tag>
55
- );
56
- }
57
- );
package/src/Box.tsx DELETED
@@ -1,20 +0,0 @@
1
- import React from "react";
2
- import { FlexLayout, FlexLayoutProps } from "./FlexLayout";
3
-
4
- export interface BoxProps extends FlexLayoutProps {}
5
-
6
- export function Box({
7
- padding = "medium",
8
- align = "center",
9
- justify = "center",
10
- ...otherProps
11
- }: BoxProps) {
12
- return (
13
- <FlexLayout
14
- padding={padding}
15
- align={align}
16
- justify={justify}
17
- {...otherProps}
18
- />
19
- );
20
- }
package/src/Button.tsx DELETED
@@ -1,90 +0,0 @@
1
- import React from "react";
2
-
3
- import { BaseButton, BaseButtonProps } from "./BaseButton";
4
- import { Text } from "./Text";
5
- import { IconType } from "./IconType";
6
- import { Row } from "./Row";
7
- import { Icon } from "./Icon";
8
- import { FlexLayoutProps } from "./FlexLayout";
9
- import { InteractableColor, getGlyphColor } from "./Interactable";
10
- import { Align, Gap, Justify, Size, cssVar, getPadding } from "./jss";
11
-
12
- export interface ButtonProps extends BaseButtonProps {
13
- children: string;
14
- color: InteractableColor;
15
- size?: Size;
16
- icon?: IconType;
17
- iconSize?: Size;
18
- iconPosition?: "left" | "right";
19
- rowProps?: FlexLayoutProps;
20
- align?: Align;
21
- gap?: Gap;
22
- justify?: Justify;
23
- bold?: boolean;
24
- }
25
-
26
- export const Button = React.forwardRef(
27
- (
28
- {
29
- children,
30
- color,
31
- bare,
32
- disabled,
33
- icon,
34
- iconSize = "medium",
35
- iconPosition = "left",
36
- align = "center",
37
- gap = "small",
38
- justify = "center",
39
- jss,
40
- size = "medium",
41
- bold,
42
- padding = "medium",
43
- ...otherProps
44
- }: ButtonProps,
45
- ref?: React.Ref<HTMLButtonElement>
46
- ) => {
47
- return (
48
- <BaseButton
49
- {...otherProps}
50
- bare={bare}
51
- ref={ref}
52
- color={color}
53
- disabled={disabled}
54
- padding={padding}
55
- jss={[
56
- {
57
- borderRadius: cssVar("--border-radius-m"),
58
- justifyContent: "center",
59
- userSelect: "none",
60
- },
61
- jss,
62
- ]}
63
- >
64
- <Row grow={true} align={align} gap={gap} justify={justify}>
65
- {icon && iconPosition === "left" && (
66
- <Icon
67
- icon={icon}
68
- size={iconSize}
69
- color={getGlyphColor(color, disabled, bare)}
70
- />
71
- )}
72
- <Text
73
- bold={bold}
74
- size={size}
75
- color={getGlyphColor(color, disabled, bare)}
76
- >
77
- {children}
78
- </Text>
79
- {icon && iconPosition === "right" && (
80
- <Icon
81
- icon={icon}
82
- size={iconSize}
83
- color={getGlyphColor(color, disabled, bare)}
84
- />
85
- )}
86
- </Row>
87
- </BaseButton>
88
- );
89
- }
90
- );
package/src/Calendar.tsx DELETED
@@ -1,123 +0,0 @@
1
- import React, { cloneElement, useMemo } from "react";
2
- import { BaseView } from "./BaseView";
3
- import { JSS } from "./jss";
4
-
5
- const dateFormatter = Intl.DateTimeFormat("en-UK", {
6
- weekday: "short",
7
- });
8
-
9
- const MON = dateFormatter.format(new Date(2000, 1, 7));
10
- const TUE = dateFormatter.format(new Date(2000, 1, 8));
11
- const WED = dateFormatter.format(new Date(2000, 1, 9));
12
- const THU = dateFormatter.format(new Date(2000, 1, 10));
13
- const FRI = dateFormatter.format(new Date(2000, 1, 11));
14
- const SAT = dateFormatter.format(new Date(2000, 1, 12));
15
- const SUN = dateFormatter.format(new Date(2000, 1, 13));
16
-
17
- export const Calendar = React.forwardRef(
18
- (
19
- {
20
- date,
21
- cell,
22
- header,
23
- jss,
24
- }: {
25
- date: Date;
26
- header: (props: { weekday: string }) => React.JSX.Element;
27
- jss?: JSS;
28
- cell: (props: {
29
- today?: boolean;
30
- date: Date;
31
- outOfMonth: boolean;
32
- top: boolean;
33
- left: boolean;
34
- right: boolean;
35
- bottom: boolean;
36
- }) => React.JSX.Element;
37
- },
38
- ref?: React.Ref<HTMLElement>
39
- ) => {
40
- const year = date.getFullYear();
41
- const month = date.getMonth();
42
-
43
- const daysInMonth = new Date(year, month + 1, 0).getDate();
44
-
45
- const firstDayOfTheMonth = new Date(year, month, 1).getDay();
46
- const offset = firstDayOfTheMonth === 0 ? 6 : firstDayOfTheMonth - 1;
47
- const headers = useMemo(() => {
48
- return (
49
- <>
50
- {header({ weekday: MON })}
51
- {header({ weekday: TUE })}
52
- {header({ weekday: WED })}
53
- {header({ weekday: THU })}
54
- {header({ weekday: FRI })}
55
- {header({ weekday: SAT })}
56
- {header({ weekday: SUN })}
57
- </>
58
- );
59
- }, []);
60
-
61
- return (
62
- <BaseView
63
- ref={ref}
64
- jss={[
65
- {
66
- display: "grid",
67
- gridTemplateColumns: "1fr 1fr 1fr 1fr 1fr 1fr 1fr",
68
- gridTemplateRows: "1fr",
69
- },
70
- jss,
71
- ]}
72
- >
73
- {headers}
74
- {Array.from(Array(offset).keys()).map((index) => {
75
- const dayDate = new Date(
76
- date.getFullYear(),
77
- date.getMonth(),
78
- index + 1 - offset
79
- );
80
-
81
- return cloneElement(
82
- cell({
83
- date: dayDate,
84
- today: false,
85
- top: true,
86
- left: index % 7 === 0,
87
- outOfMonth: true,
88
- right: false,
89
- bottom: false,
90
- }),
91
- { key: dayDate.toISOString() }
92
- );
93
- })}
94
-
95
- {Array.from(Array(daysInMonth).keys()).map((index) => {
96
- const dayDate = new Date(
97
- date.getFullYear(),
98
- date.getMonth(),
99
- index + 1,
100
- 12 // If we do not add this the ISO string would be from the day before at midnight
101
- );
102
-
103
- return cloneElement(
104
- cell({
105
- date: dayDate,
106
- top: index + offset < 7,
107
- left: (index + offset) % 7 === 0,
108
- right:
109
- (index + offset) % 7 === 7 - 1 || index === daysInMonth - 1,
110
- bottom: index > daysInMonth - 7 - 1,
111
- outOfMonth: false,
112
- today:
113
- dayDate.getDate() == new Date().getDate() &&
114
- dayDate.getMonth() == new Date().getMonth() &&
115
- dayDate.getFullYear() == new Date().getFullYear(),
116
- }),
117
- { key: dayDate.toISOString() }
118
- );
119
- })}
120
- </BaseView>
121
- );
122
- }
123
- );
package/src/Card.tsx DELETED
@@ -1,30 +0,0 @@
1
- import { FlexLayout, FlexLayoutProps } from "./FlexLayout";
2
- import { cssVar } from "./jss";
3
-
4
- export interface CardProps extends FlexLayoutProps {}
5
-
6
- export function Card({
7
- children,
8
- jss,
9
- padding = "large",
10
- gap = "large",
11
- ...otherProps
12
- }: CardProps) {
13
- return (
14
- <FlexLayout
15
- {...otherProps}
16
- padding={padding}
17
- gap={gap}
18
- jss={[
19
- {
20
- backgroundColor: cssVar("--overlay-background"),
21
- borderRadius: cssVar("--border-radius-l"),
22
- boxShadow: cssVar("--shadow-sm"),
23
- },
24
- jss,
25
- ]}
26
- >
27
- {children}
28
- </FlexLayout>
29
- );
30
- }