aidos-ui 3.0.31 → 4.0.1

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 (157) hide show
  1. package/.claude/settings.local.json +14 -1
  2. package/CLAUDE.md +72 -0
  3. package/README.md +43 -29
  4. package/dist/Badge.d.ts +2 -2
  5. package/dist/Badge.js.map +1 -1
  6. package/dist/BaseButton.d.ts +2 -2
  7. package/dist/BaseButton.js +2 -2
  8. package/dist/BaseButton.js.map +1 -1
  9. package/dist/BaseInput.d.ts +2 -2
  10. package/dist/BaseInput.js.map +1 -1
  11. package/dist/BaseLink.d.ts +2 -2
  12. package/dist/BaseLink.js +2 -2
  13. package/dist/BaseLink.js.map +1 -1
  14. package/dist/BaseListItem.d.ts +3 -3
  15. package/dist/BaseListItem.js.map +1 -1
  16. package/dist/BaseView.d.ts +2 -2
  17. package/dist/BaseView.js.map +1 -1
  18. package/dist/Calendar.d.ts +4 -4
  19. package/dist/DarkMode.js.map +1 -1
  20. package/dist/DateInput.d.ts +2 -2
  21. package/dist/DatePicker.js.map +1 -1
  22. package/dist/DatetimeInput.d.ts +2 -2
  23. package/dist/Dialog.d.ts +3 -3
  24. package/dist/Dialog.js.map +1 -1
  25. package/dist/Dropdown.d.ts +3 -3
  26. package/dist/Dropdown.js.map +1 -1
  27. package/dist/Icon.d.ts +3 -3
  28. package/dist/Icon.js +2 -21
  29. package/dist/Icon.js.map +1 -1
  30. package/dist/IconLink.js +2 -1
  31. package/dist/IconLink.js.map +1 -1
  32. package/dist/Interactable.d.ts +4 -4
  33. package/dist/Interactable.js +2 -2
  34. package/dist/Interactable.js.map +1 -1
  35. package/dist/ListButtonItem.js +2 -2
  36. package/dist/ListButtonItem.js.map +1 -1
  37. package/dist/ListLinkItem.js +2 -2
  38. package/dist/ListLinkItem.js.map +1 -1
  39. package/dist/MenuIcon.js.map +1 -1
  40. package/dist/NextJSRouter.js.map +1 -1
  41. package/dist/NextJSRouterState.js.map +1 -1
  42. package/dist/OnVisible.d.ts +1 -1
  43. package/dist/OnVisible.js.map +1 -1
  44. package/dist/Popover.d.ts +7 -7
  45. package/dist/Popover.js +2 -2
  46. package/dist/Popover.js.map +1 -1
  47. package/dist/ProgressBar.d.ts +2 -2
  48. package/dist/ProgressBar.js.map +1 -1
  49. package/dist/Providers.d.ts +2 -2
  50. package/dist/Providers.js +2 -2
  51. package/dist/Providers.js.map +1 -1
  52. package/dist/RangeInput.d.ts +3 -3
  53. package/dist/RangeInput.js +2 -2
  54. package/dist/RangeInput.js.map +1 -1
  55. package/dist/RootView.js.map +1 -1
  56. package/dist/Select.d.ts +2 -3
  57. package/dist/Select.js.map +1 -1
  58. package/dist/StaticCheckbox.js.map +1 -1
  59. package/dist/Storage.d.ts +2 -1
  60. package/dist/Storage.js.map +1 -1
  61. package/dist/Stream.js.map +1 -1
  62. package/dist/Sublist.d.ts +2 -2
  63. package/dist/Tabs.d.ts +4 -4
  64. package/dist/Tabs.js +2 -4
  65. package/dist/Tabs.js.map +1 -1
  66. package/dist/Text.d.ts +2 -2
  67. package/dist/Text.js.map +1 -1
  68. package/dist/TextArea.d.ts +2 -2
  69. package/dist/TextArea.js.map +1 -1
  70. package/dist/TextInput.d.ts +4 -3
  71. package/dist/TextInput.js +14 -5
  72. package/dist/TextInput.js.map +1 -1
  73. package/dist/TextPairing.d.ts +2 -2
  74. package/dist/TextPairing.js.map +1 -1
  75. package/dist/Tooltip.d.ts +4 -4
  76. package/dist/Tooltip.js.map +1 -1
  77. package/dist/aria.js.map +1 -1
  78. package/dist/hash.js.map +1 -1
  79. package/dist/jss.d.ts +21 -21
  80. package/dist/jss.js +6 -6
  81. package/dist/jss.js.map +1 -1
  82. package/dist/numberToBase.js.map +1 -1
  83. package/dist/stateMachineContextFactory.js.map +1 -1
  84. package/dist/useCookie.js.map +1 -1
  85. package/dist/useKeyboard.js.map +1 -1
  86. package/dist/useNavigation.js.map +1 -1
  87. package/dist/useRefEffect.js.map +1 -1
  88. package/next-env.d.ts +2 -1
  89. package/next.config.js +2 -1
  90. package/package.json +27 -20
  91. package/src/Badge.tsx +2 -2
  92. package/src/BaseButton.tsx +4 -4
  93. package/src/BaseInput.tsx +2 -2
  94. package/src/BaseLink.tsx +4 -4
  95. package/src/BaseListItem.tsx +3 -3
  96. package/src/BaseView.tsx +3 -3
  97. package/src/Calendar.tsx +4 -4
  98. package/src/DateInput.tsx +2 -2
  99. package/src/DatetimeInput.tsx +2 -2
  100. package/src/Dialog.tsx +3 -3
  101. package/src/Dropdown.tsx +4 -4
  102. package/src/Icon.tsx +4 -30
  103. package/src/IconLink.tsx +2 -1
  104. package/src/Interactable.tsx +4 -4
  105. package/src/ListButtonItem.tsx +2 -2
  106. package/src/ListLinkItem.tsx +2 -2
  107. package/src/MenuIcon.tsx +2 -2
  108. package/src/NextJSRouter.tsx +2 -2
  109. package/src/Popover.tsx +9 -9
  110. package/src/ProgressBar.tsx +3 -3
  111. package/src/Providers.tsx +4 -4
  112. package/src/RangeInput.tsx +5 -5
  113. package/src/Select.tsx +2 -2
  114. package/src/StaticCheckbox.tsx +2 -2
  115. package/src/Storage.tsx +1 -1
  116. package/src/Sublist.tsx +2 -2
  117. package/src/Tabs.tsx +4 -6
  118. package/src/Text.tsx +2 -2
  119. package/src/TextArea.tsx +2 -2
  120. package/src/TextInput.tsx +20 -8
  121. package/src/TextPairing.tsx +2 -2
  122. package/src/Tooltip.tsx +5 -5
  123. package/src/docs/mdx.tsx +40 -0
  124. package/src/docs/searchIndex.ts +1 -1
  125. package/src/jss.tsx +18 -18
  126. package/src/pages/Badge.mdx +136 -14
  127. package/src/pages/Button.mdx +121 -63
  128. package/src/pages/Calendar.mdx +196 -2
  129. package/src/pages/Card.mdx +123 -47
  130. package/src/pages/Checkbox.mdx +103 -28
  131. package/src/pages/Dialog.mdx +172 -7
  132. package/src/pages/FlexLayout.mdx +185 -51
  133. package/src/pages/Hashing.mdx +199 -8
  134. package/src/pages/Icon.mdx +150 -42
  135. package/src/pages/IconButton.mdx +127 -116
  136. package/src/pages/Link.mdx +118 -47
  137. package/src/pages/List.mdx +167 -283
  138. package/src/pages/ListHeader.mdx +157 -27
  139. package/src/pages/Popover.mdx +177 -55
  140. package/src/pages/ProgressBar.mdx +186 -6
  141. package/src/pages/ProgressCircle.mdx +196 -13
  142. package/src/pages/RangeInput.mdx +189 -61
  143. package/src/pages/Tabs.mdx +202 -346
  144. package/src/pages/Text.mdx +102 -81
  145. package/src/pages/TextInput.mdx +169 -44
  146. package/src/pages/TextPairing.mdx +164 -115
  147. package/src/pages/TimeInput.mdx +142 -37
  148. package/src/pages/Tooltip.mdx +99 -12
  149. package/src/pages/_app.tsx +14 -4
  150. package/src/pages/css-in-js.mdx +196 -83
  151. package/src/pages/navigation.mdx +122 -20
  152. package/src/pages/useCookie.mdx +168 -7
  153. package/src/pages/useKeyboard.mdx +242 -5
  154. package/src/pages/useNavigation.mdx +244 -16
  155. package/src/pages/usePromise.mdx +271 -6
  156. package/src/pages/useRefEffect.mdx +230 -28
  157. package/tsconfig.json +13 -4
package/src/Calendar.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import React, { useMemo } from "react";
2
2
  import { BaseView } from "./BaseView";
3
- import { JSStyle } from "./jss";
3
+ import { JSS } from "./jss";
4
4
 
5
5
  const dateFormatter = Intl.DateTimeFormat("en-UK", {
6
6
  weekday: "short",
@@ -23,8 +23,8 @@ export const Calendar = React.forwardRef(
23
23
  jss,
24
24
  }: {
25
25
  date: Date;
26
- header: (props: { weekday: string }) => JSX.Element;
27
- jss?: JSStyle;
26
+ header: (props: { weekday: string }) => React.JSX.Element;
27
+ jss?: JSS;
28
28
  cell: (props: {
29
29
  today?: boolean;
30
30
  date: Date;
@@ -33,7 +33,7 @@ export const Calendar = React.forwardRef(
33
33
  left: boolean;
34
34
  right: boolean;
35
35
  bottom: boolean;
36
- }) => JSX.Element;
36
+ }) => React.JSX.Element;
37
37
  },
38
38
  ref?: React.Ref<HTMLElement>
39
39
  ) => {
package/src/DateInput.tsx CHANGED
@@ -4,7 +4,7 @@ import { Box } from "./Box";
4
4
  import { Icon } from "./Icon";
5
5
  import { IconType } from "./IconType";
6
6
  import { Row } from "./Row";
7
- import { JSStyle } from "./jss";
7
+ import { JSS } from "./jss";
8
8
 
9
9
  export interface DateInputProps extends BaseInputProps {
10
10
  onDateChange: (date: Date) => void;
@@ -12,7 +12,7 @@ export interface DateInputProps extends BaseInputProps {
12
12
  icon?: IconType;
13
13
  addOn?: ReactNode;
14
14
  onChange?: undefined;
15
- jsss?: JSStyle;
15
+ jsss?: JSS;
16
16
  }
17
17
 
18
18
  export const DateInput = React.forwardRef(
@@ -4,7 +4,7 @@ import { Box } from "./Box";
4
4
  import { Icon } from "./Icon";
5
5
  import { IconType } from "./IconType";
6
6
  import { Row } from "./Row";
7
- import { JSStyle } from "./jss";
7
+ import { JSS } from "./jss";
8
8
 
9
9
  export interface DatetimeInputProps extends BaseInputProps {
10
10
  onDateChange: (date: Date) => void;
@@ -12,7 +12,7 @@ export interface DatetimeInputProps extends BaseInputProps {
12
12
  icon?: IconType;
13
13
  addOn?: ReactNode;
14
14
  onChange?: undefined;
15
- jss?: JSStyle;
15
+ jss?: JSS;
16
16
  }
17
17
 
18
18
  const jsss = {
package/src/Dialog.tsx CHANGED
@@ -40,7 +40,7 @@ export const Dialog = ({
40
40
  close,
41
41
  }: {
42
42
  label: string;
43
- children: JSX.Element;
43
+ children: React.JSX.Element;
44
44
  close: () => void;
45
45
  }) => {
46
46
  return (
@@ -71,7 +71,7 @@ const DialogContext = React.createContext<{ setDialog: React.Dispatch<any> }>({
71
71
  });
72
72
 
73
73
  export function DialogProvider({ children }) {
74
- const [dialog, setDialog] = useState<JSX.Element>(null);
74
+ const [dialog, setDialog] = useState<React.JSX.Element>(null);
75
75
  const value = useMemo(() => ({ setDialog }), []);
76
76
 
77
77
  return (
@@ -83,7 +83,7 @@ export function DialogProvider({ children }) {
83
83
  }
84
84
 
85
85
  export function useDialog<Input>(
86
- DialogComponent: (props: { close: () => void } & Input) => JSX.Element,
86
+ DialogComponent: (props: { close: () => void } & Input) => React.JSX.Element,
87
87
  options: { closeOnOutsideClick: boolean }
88
88
  ) {
89
89
  const { setDialog } = useContext(DialogContext);
package/src/Dropdown.tsx CHANGED
@@ -6,9 +6,9 @@ import { Button } from "./Button";
6
6
  import { Column } from "./Column";
7
7
  import { useNavigation } from "./useNavigation";
8
8
  import { useRefEffect } from "./useRefEffect";
9
- import { Gap, JSStyle, Padding, Size, getBackground } from "./jss";
9
+ import { Gap, JSS, Padding, Size, getBackground } from "./jss";
10
10
 
11
- const jsss: { [key: string]: JSStyle } = {
11
+ const jsss: { [key: string]: JSS } = {
12
12
  root: {
13
13
  position: "relative",
14
14
  display: "flex",
@@ -47,8 +47,8 @@ export function Dropdown<T extends string | number>({
47
47
  options: Set<T>;
48
48
  setSelection: (selection: T) => void;
49
49
  selection: T;
50
- jss?: JSStyle;
51
- jssButton?: JSStyle;
50
+ jss?: JSS;
51
+ jssButton?: JSS;
52
52
  optionLabel: (option: T) => string;
53
53
  padding?: Padding;
54
54
  gap?: Gap;
package/src/Icon.tsx CHANGED
@@ -1,4 +1,5 @@
1
- import React, { useEffect } from "react";
1
+ import React from "react";
2
+ import { Icon as IconifyIcon } from "@iconify/react";
2
3
  import { BaseView } from "./BaseView";
3
4
  import { IconType } from "./IconType";
4
5
  import { Size, TextColor, getTextColor } from "./jss";
@@ -43,33 +44,7 @@ const jsss = {
43
44
  },
44
45
  };
45
46
 
46
- let initialized = false;
47
-
48
- const initializeIcons = () => {
49
- if (initialized) {
50
- return;
51
- }
52
-
53
- const hasIconify = document.getElementById("iconify");
54
-
55
- if (hasIconify) {
56
- initialized = true;
57
- return;
58
- }
59
-
60
- const script = document.createElement("script");
61
- script.src = "https://code.iconify.design/3/3.1.1/iconify.min.js";
62
- script.id = "iconify";
63
- document.head.appendChild(script);
64
-
65
- initialized = true;
66
- };
67
-
68
- export function IconProvider({ children }: { children: JSX.Element }) {
69
- useEffect(() => {
70
- initializeIcons();
71
- }, []);
72
-
47
+ export function IconProvider({ children }: { children: React.JSX.Element }) {
73
48
  return children;
74
49
  }
75
50
 
@@ -86,7 +61,6 @@ export function Icon({
86
61
  }) {
87
62
  return (
88
63
  <BaseView
89
- key={icon}
90
64
  aria-label={ariaLabel}
91
65
  jss={[
92
66
  jsss.root,
@@ -100,7 +74,7 @@ export function Icon({
100
74
  getTextColor(color),
101
75
  ]}
102
76
  >
103
- <span className="iconify" data-icon={icon}></span>
77
+ <IconifyIcon icon={icon} width="100%" height="100%" />
104
78
  </BaseView>
105
79
  );
106
80
  }
package/src/IconLink.tsx CHANGED
@@ -20,7 +20,7 @@ export interface IconLinkProps extends BaseLinkProps {
20
20
 
21
21
  export const IconLink = React.forwardRef(
22
22
  (
23
- { icon, size, color, bare, disabled, ...otherProps }: IconLinkProps,
23
+ { icon, size, color, bare, disabled, jss, ...otherProps }: IconLinkProps,
24
24
  ref?: React.Ref<HTMLAnchorElement>
25
25
  ) => {
26
26
  return (
@@ -42,6 +42,7 @@ export const IconLink = React.forwardRef(
42
42
  transform: "scale(0.92)",
43
43
  },
44
44
  },
45
+ jss,
45
46
  ]}
46
47
  color={color}
47
48
  ref={ref}
@@ -1,4 +1,4 @@
1
- import { JSStyle, Padding, TextColor, cssVar, getPadding } from "./jss";
1
+ import { JSS, Padding, TextColor, cssVar, getPadding } from "./jss";
2
2
 
3
3
  export type InteractableColor =
4
4
  | "positive"
@@ -78,7 +78,7 @@ const jsss = {
78
78
  colorHover: {},
79
79
  };
80
80
 
81
- export function getInteractableJSStyles({
81
+ export function getInteractableJSS({
82
82
  color,
83
83
  bare,
84
84
  disabled,
@@ -92,7 +92,7 @@ export function getInteractableJSStyles({
92
92
  animateInteraction: boolean;
93
93
  padding: Padding;
94
94
  border: boolean;
95
- }): Array<JSStyle> {
95
+ }): Array<JSS> {
96
96
  return [
97
97
  jsss.root,
98
98
  color === "dark" && jsss.dark,
@@ -168,7 +168,7 @@ export const getCSSColor = (
168
168
  }
169
169
  };
170
170
 
171
- export const getInteractableListItemJSStyles = ({
171
+ export const getInteractableListItemJSS = ({
172
172
  bare,
173
173
  selected,
174
174
  }: {
@@ -4,7 +4,7 @@ import { BaseListItem, BaseListItemProps } from "./BaseListItem";
4
4
  import {
5
5
  InteractableColor,
6
6
  getGlyphColor,
7
- getInteractableListItemJSStyles,
7
+ getInteractableListItemJSS,
8
8
  } from "./Interactable";
9
9
  import { BaseButton } from "./BaseButton";
10
10
  import { useListContext } from "./List";
@@ -57,7 +57,7 @@ export const ListButtonItem = React.forwardRef(
57
57
  bare={true}
58
58
  color={bare ? "primary" : color}
59
59
  ref={ref}
60
- jss={getInteractableListItemJSStyles({ bare, selected })}
60
+ jss={getInteractableListItemJSS({ bare, selected })}
61
61
  onClick={onClick}
62
62
  >
63
63
  {content}
@@ -4,7 +4,7 @@ import { BaseListItem, BaseListItemProps } from "./BaseListItem";
4
4
  import {
5
5
  InteractableColor,
6
6
  getGlyphColor,
7
- getInteractableListItemJSStyles,
7
+ getInteractableListItemJSS,
8
8
  } from "./Interactable";
9
9
  import { BaseLink } from "./BaseLink";
10
10
  import { useListContext } from "./List";
@@ -64,7 +64,7 @@ export const ListLinkItem = React.forwardRef(
64
64
  color={color}
65
65
  href={href}
66
66
  ref={ref}
67
- jss={getInteractableListItemJSStyles({ bare, selected })}
67
+ jss={getInteractableListItemJSS({ bare, selected })}
68
68
  onClick={onClick}
69
69
  >
70
70
  {content}
package/src/MenuIcon.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import { BaseView } from "./BaseView";
2
2
  import { Column } from "./Column";
3
- import { Color, JSStyle, getBackground } from "./jss";
3
+ import { Color, JSS, getBackground } from "./jss";
4
4
 
5
5
  export function MenuIcon({ open, color }: { open: boolean; color: Color }) {
6
6
  return (
@@ -31,7 +31,7 @@ export function MenuIcon({ open, color }: { open: boolean; color: Color }) {
31
31
  );
32
32
  }
33
33
 
34
- function Bar({ jss, color }: { jss: JSStyle; color: Color }) {
34
+ function Bar({ jss, color }: { jss: JSS; color: Color }) {
35
35
  return (
36
36
  <BaseView
37
37
  jss={[
@@ -5,9 +5,9 @@ import { Column } from "./Column";
5
5
  import { ListDivider } from "./ListDivider";
6
6
  import { BaseView } from "./BaseView";
7
7
  import { useRouterState } from "./NextJSRouterState";
8
- import { JSStyle } from "./jss";
8
+ import { JSS } from "./jss";
9
9
 
10
- const jsss: { [key: string]: JSStyle } = {
10
+ const jsss: { [key: string]: JSS } = {
11
11
  root: {
12
12
  display: "flex",
13
13
  flexDirection: "column",
package/src/Popover.tsx CHANGED
@@ -3,9 +3,9 @@ import { queryFocusables } from "./aria";
3
3
 
4
4
  import { BaseView } from "./BaseView";
5
5
  import { useRefEffect } from "./useRefEffect";
6
- import { JSStyle, toClassnames } from "./jss";
6
+ import { JSS, toClassnames } from "./jss";
7
7
 
8
- const jsss: { [key: string]: JSStyle } = {
8
+ const jsss: { [key: string]: JSS } = {
9
9
  popover: {
10
10
  padding: 0,
11
11
  zIndex: 1,
@@ -76,26 +76,26 @@ export function Popover({ children, close }) {
76
76
  }
77
77
 
78
78
  interface PopoverTriggerProps<Input> {
79
- PopoverComponent: (props: { close: () => void } & Input) => JSX.Element;
80
- jss?: JSStyle;
81
- dialogJSStyle?: JSStyle;
79
+ PopoverComponent: (props: { close: () => void } & Input) => React.JSX.Element;
80
+ jss?: JSS;
81
+ jssDialog?: JSS;
82
82
  className?: undefined;
83
83
  grow?: boolean;
84
84
  shrink?: boolean;
85
85
  tag?: keyof HTMLElementTagNameMap;
86
- children: (props: { toggle: (input: Input) => void }) => JSX.Element;
86
+ children: (props: { toggle: (input: Input) => void }) => React.JSX.Element;
87
87
  }
88
88
 
89
89
  export function PopoverTrigger<Input>({
90
90
  PopoverComponent,
91
91
  jss,
92
- dialogJSStyle,
92
+ jssDialog,
93
93
  grow,
94
94
  shrink,
95
95
  tag,
96
96
  children,
97
97
  }: PopoverTriggerProps<Input>) {
98
- const [popover, setPopover] = useState<JSX.Element>(null);
98
+ const [popover, setPopover] = useState<React.JSX.Element>(null);
99
99
  const dialogRef = useRef<null | HTMLDialogElement>(null);
100
100
 
101
101
  const toggle = (input: Input) => {
@@ -127,7 +127,7 @@ export function PopoverTrigger<Input>({
127
127
  ref={(ref: null | HTMLDialogElement) => {
128
128
  dialogRef.current = ref;
129
129
  }}
130
- className={toClassnames([jsss.popover, dialogJSStyle])}
130
+ className={toClassnames([jsss.popover, jssDialog])}
131
131
  onClose={() => {
132
132
  setPopover(null);
133
133
  }}
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
2
  import { BaseView } from "./BaseView";
3
- import { Color, Size, JSStyle, getBackground } from "./jss";
3
+ import { Color, Size, JSS, getBackground } from "./jss";
4
4
 
5
- const jsss: { [key: string]: JSStyle } = {
5
+ const jsss: { [key: string]: JSS } = {
6
6
  root: {
7
7
  width: "100%",
8
8
  display: "flex",
@@ -40,7 +40,7 @@ export function ProgressBar({
40
40
  progress: number;
41
41
  color: Color;
42
42
  size: Size;
43
- jss?: JSStyle;
43
+ jss?: JSS;
44
44
  }) {
45
45
  return (
46
46
  <BaseView
package/src/Providers.tsx CHANGED
@@ -3,13 +3,13 @@ import { DarkModeProvider } from "./DarkMode";
3
3
  import { DialogProvider } from "./Dialog";
4
4
  import { IconProvider } from "./Icon";
5
5
  import { useCookie } from "./useCookie";
6
- import { JSStylesProvider, Theme } from "./jss";
6
+ import { JSSProvider, Theme } from "./jss";
7
7
 
8
8
  export function Providers({
9
9
  children,
10
10
  themes,
11
11
  }: {
12
- children: JSX.Element;
12
+ children: React.JSX.Element;
13
13
  themes: { light: Theme; dark: Theme };
14
14
  }) {
15
15
  const [darkModeEnabled, setDarkModeEnabled] = useCookie("dark-mode", {
@@ -22,12 +22,12 @@ export function Providers({
22
22
  );
23
23
 
24
24
  return (
25
- <JSStylesProvider themes={themes}>
25
+ <JSSProvider themes={themes}>
26
26
  <IconProvider>
27
27
  <DarkModeProvider enabled={darkModeEnabled} toggle={toggleDarkMode}>
28
28
  <DialogProvider>{children}</DialogProvider>
29
29
  </DarkModeProvider>
30
30
  </IconProvider>
31
- </JSStylesProvider>
31
+ </JSSProvider>
32
32
  );
33
33
  }
@@ -1,16 +1,16 @@
1
1
  import React from "react";
2
2
  import { BaseInput, BaseInputProps } from "./BaseInput";
3
3
  import { Row } from "./Row";
4
- import { Gap, JSStyle, Padding, cssVar } from "./jss";
4
+ import { Gap, JSS, Padding, cssVar } from "./jss";
5
5
 
6
6
  export interface RangeInputProps extends BaseInputProps {
7
7
  onValueChange: (value: number) => void;
8
8
  value: number;
9
- rootJSStyle?: JSStyle;
9
+ jssRoot?: JSS;
10
10
  onChange?: undefined;
11
11
  padding?: Padding;
12
12
  gap?: Gap;
13
- addOn?: JSX.Element;
13
+ addOn?: React.JSX.Element;
14
14
  addOnPosition?: "start" | "end";
15
15
  }
16
16
 
@@ -19,7 +19,7 @@ export const RangeInput = React.forwardRef(
19
19
  {
20
20
  value,
21
21
  onValueChange,
22
- rootJSStyle,
22
+ jssRoot,
23
23
  jss,
24
24
  gap = "medium",
25
25
  padding = "none",
@@ -45,7 +45,7 @@ export const RangeInput = React.forwardRef(
45
45
  backgroundColor: cssVar("--light-highlight"),
46
46
  },
47
47
  },
48
- rootJSStyle,
48
+ jssRoot,
49
49
  ]}
50
50
  >
51
51
  {addOnPosition === "start" && addOn}
package/src/Select.tsx CHANGED
@@ -1,10 +1,10 @@
1
1
  import { forwardRef } from "react";
2
- import { JSStyle, cssVar, toClassnames } from "./jss";
2
+ import { JSS, cssVar, toClassnames } from "./jss";
3
3
 
4
4
  export interface SelectProps extends React.HTMLAttributes<HTMLSelectElement> {
5
5
  value: string;
6
6
  onValueChange: (value: string) => void;
7
- jss?: JSStyle;
7
+ jss?: JSS;
8
8
  ref?: React.Ref<HTMLSelectElement>;
9
9
  className?: undefined;
10
10
  }
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { BaseView } from "./BaseView";
3
3
  import { Icon } from "./Icon";
4
- import { JSStyle, Size, cssVar } from "./jss";
4
+ import { JSS, Size, cssVar } from "./jss";
5
5
  import { IconType } from "./IconType";
6
6
 
7
7
  type StaticCheckboxProps = {
@@ -10,7 +10,7 @@ type StaticCheckboxProps = {
10
10
  icon?: IconType;
11
11
  };
12
12
 
13
- const jsss: { [key: string]: JSStyle } = {
13
+ const jsss: { [key: string]: JSS } = {
14
14
  border: {
15
15
  position: "absolute",
16
16
  top: "var(--spacing-xs)",
package/src/Storage.tsx CHANGED
@@ -36,7 +36,7 @@ export function createStorage<State>({
36
36
 
37
37
  const state = { current: initialState };
38
38
 
39
- function Storage({ children }: { children: ReactNode }): JSX.Element {
39
+ function Storage({ children }: { children: ReactNode }): React.JSX.Element {
40
40
  const emitterRef = useRef(createEmitter<State>());
41
41
 
42
42
  const subscribe = useCallback((callback: Callback<State>) => {
package/src/Sublist.tsx CHANGED
@@ -3,7 +3,7 @@ import { ListButtonItem } from "./ListButtonItem";
3
3
  import { Icon } from "./Icon";
4
4
  import { Box } from "./Box";
5
5
  import { Row } from "./Row";
6
- import { JSStyle } from "./jss";
6
+ import { JSS } from "./jss";
7
7
 
8
8
  export function Sublist({
9
9
  children,
@@ -19,7 +19,7 @@ export function Sublist({
19
19
  initialState?: {
20
20
  collapsed: boolean;
21
21
  };
22
- jss?: JSStyle;
22
+ jss?: JSS;
23
23
  secondaryAddOn?: ReactNode;
24
24
  }) {
25
25
  const [collapsed, setCollapsed] = React.useState(initialState.collapsed);
package/src/Tabs.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import { BaseLink } from "./BaseLink";
2
2
  import { Row, RowProps } from "./Row";
3
- import { JSStyle, Padding, Size, cssVar, getPadding } from "./jss";
3
+ import { JSS, Padding, Size, cssVar, getPadding } from "./jss";
4
4
  import { useNavigation } from "./useNavigation";
5
5
  import { Text } from "./Text";
6
6
  import { ReactNode } from "react";
@@ -21,7 +21,7 @@ export interface TabsProps extends RowProps {
21
21
  labelSize?: Size;
22
22
  bare?: boolean;
23
23
  tabPadding?: Padding;
24
- tabJSStyle?: JSStyle | ((data: { selected: boolean }) => JSStyle);
24
+ jssTab?: JSS | ((data: { selected: boolean }) => JSS);
25
25
  labelRenderer?: (label: string) => ReactNode;
26
26
  }
27
27
 
@@ -32,7 +32,7 @@ export function Tabs({
32
32
  tabPadding = "medium",
33
33
  labelSize = "large",
34
34
  jss,
35
- tabJSStyle,
35
+ jssTab,
36
36
  labelRenderer,
37
37
  ["aria-controls"]: ariaControls,
38
38
  ...otherProps
@@ -93,9 +93,7 @@ export function Tabs({
93
93
  },
94
94
  },
95
95
  getPadding(tabPadding),
96
- typeof tabJSStyle === "function"
97
- ? tabJSStyle({ selected })
98
- : tabJSStyle,
96
+ typeof jssTab === "function" ? jssTab({ selected }) : jssTab,
99
97
  ]}
100
98
  >
101
99
  {addOnPosition === "start" && addOn}
package/src/Text.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import React, { ReactNode } from "react";
2
2
  import {
3
- JSStyle,
3
+ JSS,
4
4
  Size,
5
5
  TextColor,
6
6
  cssVar,
@@ -29,7 +29,7 @@ export interface TextProps {
29
29
  align?: "center" | "none";
30
30
  type?: TextType;
31
31
  grow?: boolean;
32
- jss?: JSStyle;
32
+ jss?: JSS;
33
33
  id?: string;
34
34
  htmlFor?: string;
35
35
  }
package/src/TextArea.tsx CHANGED
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
- import { JSStyle, Padding, cssVar, getPadding, toClassnames } from "./jss";
2
+ import { JSS, Padding, cssVar, getPadding, toClassnames } from "./jss";
3
3
 
4
4
  export interface TextAreaProps
5
5
  extends React.InputHTMLAttributes<HTMLTextAreaElement> {
6
- jss?: JSStyle;
6
+ jss?: JSS;
7
7
  onValueChange?: (value: string) => void;
8
8
  value?: string;
9
9
  className?: undefined;
package/src/TextInput.tsx CHANGED
@@ -1,18 +1,29 @@
1
1
  import React, { ReactNode } from "react";
2
2
  import { BaseInput, BaseInputProps } from "./BaseInput";
3
- import { Row } from "./Row";
4
- import { Gap, JSStyle, Padding, cssVar, getPadding } from "./jss";
5
3
  import { Column } from "./Column";
4
+ import { Row } from "./Row";
5
+ import { Gap, JSS, Padding, Size, cssVar, getPadding } from "./jss";
6
+
7
+ const fontSize = {
8
+ xsmall: cssVar("--font-xsmall"),
9
+ small: cssVar("--font-small"),
10
+ medium: cssVar("--font-medium"),
11
+ large: cssVar("--font-large"),
12
+ xlarge: cssVar("--font-xlarge"),
13
+ xxlarge: cssVar("--font-xxlarge"),
14
+ xxxlarge: cssVar("--font-xxxlarge"),
15
+ };
6
16
 
7
- export interface TextInputProps extends BaseInputProps {
17
+ export interface TextInputProps extends Omit<BaseInputProps, "size"> {
8
18
  onValueChange?: (value: string) => void;
9
- rootJSStyle?: JSStyle;
19
+ jssRoot?: JSS;
10
20
  addOn?: ReactNode;
11
21
  addOnPosition?: "start" | "end";
12
22
  gap?: Gap;
13
23
  onChange?: undefined;
14
24
  padding?: Padding;
15
25
  bare?: boolean;
26
+ size?: Size;
16
27
  }
17
28
 
18
29
  export const TextInput = React.forwardRef(
@@ -20,13 +31,14 @@ export const TextInput = React.forwardRef(
20
31
  {
21
32
  value,
22
33
  onValueChange,
23
- rootJSStyle,
34
+ jssRoot,
24
35
  jss,
25
36
  addOn,
26
37
  gap = "small",
27
38
  addOnPosition = "start",
28
39
  padding = "medium",
29
40
  bare,
41
+ size = "medium",
30
42
  ...inputProps
31
43
  }: TextInputProps,
32
44
  ref?: React.Ref<HTMLInputElement>
@@ -54,7 +66,7 @@ export const TextInput = React.forwardRef(
54
66
  outlineOffset: -2,
55
67
  },
56
68
  },
57
- rootJSStyle,
69
+ jssRoot,
58
70
  ]}
59
71
  >
60
72
  {addOnPosition === "start" && addOn && (
@@ -81,8 +93,8 @@ export const TextInput = React.forwardRef(
81
93
  color: cssVar("--primary-text"),
82
94
  outline: "none",
83
95
  border: "none",
84
- fontSize: 20,
85
- lineHeight: 24 / 20,
96
+ fontSize: fontSize[size],
97
+ lineHeight: 1.2,
86
98
  "::placeholder": {
87
99
  color: cssVar("--subtle-text"),
88
100
  },
@@ -12,7 +12,7 @@ import {
12
12
  Padding,
13
13
  Align,
14
14
  cssVar,
15
- JSStyle,
15
+ JSS,
16
16
  } from "./jss";
17
17
 
18
18
  export interface TextPairingProps {
@@ -31,7 +31,7 @@ export interface TextPairingProps {
31
31
  grow?: boolean;
32
32
  shrink?: boolean;
33
33
  headlineBold?: boolean;
34
- jss?: JSStyle;
34
+ jss?: JSS;
35
35
  }
36
36
 
37
37
  export function TextPairing({