aidos-ui 3.0.28 → 3.0.30

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 (188) hide show
  1. package/.claude/settings.local.json +8 -0
  2. package/dist/Badge.d.ts +2 -2
  3. package/dist/Badge.js +3 -3
  4. package/dist/Badge.js.map +1 -1
  5. package/dist/BaseButton.d.ts +1 -1
  6. package/dist/BaseButton.js +5 -5
  7. package/dist/BaseButton.js.map +1 -1
  8. package/dist/BaseInput.d.ts +1 -1
  9. package/dist/BaseInput.js +4 -4
  10. package/dist/BaseInput.js.map +1 -1
  11. package/dist/BaseLink.d.ts +1 -1
  12. package/dist/BaseLink.js +4 -4
  13. package/dist/BaseLink.js.map +1 -1
  14. package/dist/BaseList.js +3 -3
  15. package/dist/BaseList.js.map +1 -1
  16. package/dist/BaseListItem.d.ts +1 -1
  17. package/dist/BaseListItem.js +4 -4
  18. package/dist/BaseListItem.js.map +1 -1
  19. package/dist/BaseView.d.ts +1 -1
  20. package/dist/BaseView.js +8 -8
  21. package/dist/BaseView.js.map +1 -1
  22. package/dist/Button.js +3 -3
  23. package/dist/Button.js.map +1 -1
  24. package/dist/Calendar.d.ts +1 -1
  25. package/dist/Calendar.js +3 -3
  26. package/dist/Calendar.js.map +1 -1
  27. package/dist/Card.d.ts +1 -1
  28. package/dist/Card.js +3 -3
  29. package/dist/Card.js.map +1 -1
  30. package/dist/Checkbox.js +3 -3
  31. package/dist/Checkbox.js.map +1 -1
  32. package/dist/Circle.d.ts +1 -1
  33. package/dist/Circle.js +3 -3
  34. package/dist/Circle.js.map +1 -1
  35. package/dist/DarkMode.js +1 -1
  36. package/dist/DarkMode.js.map +1 -1
  37. package/dist/DateInput.d.ts +1 -1
  38. package/dist/DateInput.js +4 -4
  39. package/dist/DateInput.js.map +1 -1
  40. package/dist/DatePicker.js +3 -3
  41. package/dist/DatePicker.js.map +1 -1
  42. package/dist/DatetimeInput.d.ts +1 -1
  43. package/dist/DatetimeInput.js +3 -3
  44. package/dist/DatetimeInput.js.map +1 -1
  45. package/dist/DesignBook.js +1 -1
  46. package/dist/DesignBook.js.map +1 -1
  47. package/dist/Dialog.js +4 -4
  48. package/dist/Dialog.js.map +1 -1
  49. package/dist/Dropdown.d.ts +3 -3
  50. package/dist/Dropdown.js +4 -4
  51. package/dist/Dropdown.js.map +1 -1
  52. package/dist/FlexLayout.js +3 -3
  53. package/dist/FlexLayout.js.map +1 -1
  54. package/dist/Icon.js +10 -10
  55. package/dist/Icon.js.map +1 -1
  56. package/dist/IconButton.js +3 -3
  57. package/dist/IconButton.js.map +1 -1
  58. package/dist/IconLink.js +1 -1
  59. package/dist/IconLink.js.map +1 -1
  60. package/dist/Interactable.js +10 -10
  61. package/dist/Interactable.js.map +1 -1
  62. package/dist/Link.js +4 -4
  63. package/dist/Link.js.map +1 -1
  64. package/dist/List.d.ts +1 -1
  65. package/dist/List.js +3 -3
  66. package/dist/List.js.map +1 -1
  67. package/dist/ListButtonItem.js +2 -2
  68. package/dist/ListButtonItem.js.map +1 -1
  69. package/dist/ListDivider.js +2 -2
  70. package/dist/ListDivider.js.map +1 -1
  71. package/dist/ListHeaderItem.js +1 -1
  72. package/dist/ListHeaderItem.js.map +1 -1
  73. package/dist/ListItem.js +1 -1
  74. package/dist/ListItem.js.map +1 -1
  75. package/dist/ListLinkItem.js +2 -2
  76. package/dist/ListLinkItem.js.map +1 -1
  77. package/dist/ListSpacer.js +2 -2
  78. package/dist/ListSpacer.js.map +1 -1
  79. package/dist/MenuIcon.js +6 -6
  80. package/dist/MenuIcon.js.map +1 -1
  81. package/dist/NextJSRouter.js +3 -3
  82. package/dist/NextJSRouter.js.map +1 -1
  83. package/dist/Popover.d.ts +2 -2
  84. package/dist/Popover.js +5 -5
  85. package/dist/Popover.js.map +1 -1
  86. package/dist/ProgressBar.d.ts +2 -2
  87. package/dist/ProgressBar.js +6 -6
  88. package/dist/ProgressBar.js.map +1 -1
  89. package/dist/ProgressCircle.js +2 -2
  90. package/dist/ProgressCircle.js.map +1 -1
  91. package/dist/RangeInput.js +4 -4
  92. package/dist/RangeInput.js.map +1 -1
  93. package/dist/RootView.js +1 -1
  94. package/dist/RootView.js.map +1 -1
  95. package/dist/Select.d.ts +1 -1
  96. package/dist/Select.js +4 -4
  97. package/dist/Select.js.map +1 -1
  98. package/dist/StaticCheckbox.js +3 -3
  99. package/dist/StaticCheckbox.js.map +1 -1
  100. package/dist/Sublist.d.ts +2 -2
  101. package/dist/Sublist.js +2 -2
  102. package/dist/Sublist.js.map +1 -1
  103. package/dist/SubmitIconInput.js +2 -2
  104. package/dist/SubmitIconInput.js.map +1 -1
  105. package/dist/Tabs.d.ts +2 -1
  106. package/dist/Tabs.js +29 -25
  107. package/dist/Tabs.js.map +1 -1
  108. package/dist/Text.d.ts +2 -2
  109. package/dist/Text.js +11 -11
  110. package/dist/Text.js.map +1 -1
  111. package/dist/TextArea.d.ts +1 -1
  112. package/dist/TextArea.js +4 -4
  113. package/dist/TextArea.js.map +1 -1
  114. package/dist/TextInput.js +5 -5
  115. package/dist/TextInput.js.map +1 -1
  116. package/dist/TextPairing.d.ts +2 -2
  117. package/dist/TextPairing.js +6 -6
  118. package/dist/TextPairing.js.map +1 -1
  119. package/dist/TimeInput.js +4 -4
  120. package/dist/TimeInput.js.map +1 -1
  121. package/dist/Tooltip.d.ts +2 -2
  122. package/dist/Tooltip.js +5 -5
  123. package/dist/Tooltip.js.map +1 -1
  124. package/dist/jss.d.ts +5 -5
  125. package/dist/jss.js +31 -31
  126. package/dist/jss.js.map +1 -1
  127. package/package.json +1 -1
  128. package/src/Badge.tsx +4 -4
  129. package/src/BaseButton.tsx +6 -6
  130. package/src/BaseInput.tsx +10 -5
  131. package/src/BaseLink.tsx +5 -5
  132. package/src/BaseList.tsx +3 -6
  133. package/src/BaseListItem.tsx +5 -5
  134. package/src/BaseView.tsx +9 -9
  135. package/src/Button.tsx +3 -3
  136. package/src/Calendar.tsx +4 -4
  137. package/src/Card.tsx +3 -3
  138. package/src/Checkbox.tsx +3 -3
  139. package/src/Circle.tsx +3 -3
  140. package/src/DarkMode.tsx +1 -1
  141. package/src/DateInput.tsx +5 -5
  142. package/src/DatePicker.tsx +3 -3
  143. package/src/DatetimeInput.tsx +5 -12
  144. package/src/DesignBook.tsx +1 -1
  145. package/src/Dialog.tsx +6 -6
  146. package/src/Dropdown.tsx +8 -8
  147. package/src/FlexLayout.tsx +3 -3
  148. package/src/Icon.tsx +10 -10
  149. package/src/IconButton.tsx +3 -11
  150. package/src/IconLink.tsx +1 -1
  151. package/src/Interactable.tsx +10 -10
  152. package/src/Link.tsx +4 -4
  153. package/src/List.tsx +3 -3
  154. package/src/ListButtonItem.tsx +3 -3
  155. package/src/ListDivider.tsx +2 -2
  156. package/src/ListHeaderItem.tsx +1 -1
  157. package/src/ListItem.tsx +1 -6
  158. package/src/ListLinkItem.tsx +3 -3
  159. package/src/ListSpacer.tsx +2 -2
  160. package/src/MenuIcon.tsx +6 -6
  161. package/src/NextJSRouter.tsx +3 -3
  162. package/src/Popover.tsx +6 -6
  163. package/src/ProgressBar.tsx +7 -7
  164. package/src/ProgressCircle.tsx +2 -2
  165. package/src/RangeInput.tsx +4 -4
  166. package/src/RootView.tsx +1 -1
  167. package/src/Select.tsx +5 -5
  168. package/src/StaticCheckbox.tsx +4 -6
  169. package/src/Sublist.tsx +4 -4
  170. package/src/SubmitIconInput.tsx +2 -2
  171. package/src/Tabs.tsx +52 -45
  172. package/src/Text.tsx +19 -12
  173. package/src/TextArea.tsx +5 -5
  174. package/src/TextInput.tsx +6 -6
  175. package/src/TextPairing.tsx +7 -7
  176. package/src/TimeInput.tsx +4 -4
  177. package/src/Tooltip.tsx +6 -6
  178. package/src/docs/mdx.tsx +6 -8
  179. package/src/docs/searchIndex.ts +1 -1
  180. package/src/jss.tsx +31 -31
  181. package/src/pages/Calendar.mdx +4 -4
  182. package/src/pages/Card.mdx +4 -4
  183. package/src/pages/FlexLayout.mdx +6 -6
  184. package/src/pages/Tabs.mdx +202 -4
  185. package/src/pages/TextPairing.mdx +2 -2
  186. package/src/pages/TimeInput.mdx +2 -2
  187. package/src/pages/_app.tsx +6 -6
  188. package/src/pages/css-in-js.mdx +2 -2
package/src/Tabs.tsx CHANGED
@@ -4,6 +4,7 @@ import { JSStyle, Padding, Size, cssVar, getPadding } from "./jss";
4
4
  import { useNavigation } from "./useNavigation";
5
5
  import { Text } from "./Text";
6
6
  import { ReactNode } from "react";
7
+ import { BaseButton } from "./BaseButton";
7
8
 
8
9
  export type Tab = {
9
10
  label: string;
@@ -21,6 +22,7 @@ export interface TabsProps extends RowProps {
21
22
  bare?: boolean;
22
23
  tabPadding?: Padding;
23
24
  tabJSStyle?: JSStyle;
25
+ labelRenderer?: (label: string) => ReactNode;
24
26
  }
25
27
 
26
28
  export function Tabs({
@@ -29,8 +31,9 @@ export function Tabs({
29
31
  padding = "none",
30
32
  tabPadding = "medium",
31
33
  labelSize = "large",
32
- jsStyle,
34
+ jss,
33
35
  tabJSStyle,
36
+ labelRenderer,
34
37
  ["aria-controls"]: ariaControls,
35
38
  ...otherProps
36
39
  }: TabsProps) {
@@ -39,7 +42,7 @@ export function Tabs({
39
42
  return (
40
43
  <Row
41
44
  role="tablist"
42
- jsStyle={jsStyle}
45
+ jss={jss}
43
46
  gap={gap}
44
47
  padding={padding}
45
48
  ref={root}
@@ -53,50 +56,54 @@ export function Tabs({
53
56
  selected,
54
57
  addOn,
55
58
  addOnPosition = "start",
56
- }) => (
57
- <BaseLink
58
- aria-controls={ariaControls}
59
- role="tab"
60
- aria-selected={selected ? "true" : undefined}
61
- key={label}
62
- bare
63
- color={selected ? "positive" : "primary"}
64
- href={href}
65
- onClick={onClick}
66
- animateInteraction={false}
67
- jsStyle={[
68
- {
69
- textDecoration: "none",
70
- borderBottom: selected
71
- ? `3px solid ${cssVar("--highlight")}`
72
- : `3px solid transparent`,
73
- ":active span": {
74
- transform: "scale(0.97)",
75
- },
76
- ":first-child": {
77
- borderTopLeftRadius: cssVar("--border-radius-m"),
78
- },
79
- ":last-child": {
80
- borderTopRightRadius: cssVar("--border-radius-m"),
81
- },
82
- ":hover": {
83
- backgroundColor: cssVar("--hovered-background"),
84
- },
85
- ":active:hover": {
86
- backgroundColor: cssVar("--pressed-background"),
59
+ }) => {
60
+ const BaseComponent = href != null ? BaseLink : BaseButton;
61
+
62
+ return (
63
+ <BaseComponent
64
+ aria-controls={ariaControls}
65
+ role="tab"
66
+ aria-selected={selected ? "true" : undefined}
67
+ key={label}
68
+ bare
69
+ color={selected ? "positive" : "primary"}
70
+ href={href}
71
+ onClick={onClick}
72
+ animateInteraction={false}
73
+ jss={[
74
+ {
75
+ textDecoration: "none",
76
+ borderBottom: selected
77
+ ? `3px solid ${cssVar("--highlight")}`
78
+ : `3px solid transparent`,
79
+ ":active span": {
80
+ transform: "scale(0.97)",
81
+ },
82
+ ":first-child": {
83
+ borderTopLeftRadius: cssVar("--border-radius-m"),
84
+ },
85
+ ":last-child": {
86
+ borderTopRightRadius: cssVar("--border-radius-m"),
87
+ },
88
+ ":hover": {
89
+ backgroundColor: cssVar("--hovered-background"),
90
+ },
91
+ ":active:hover": {
92
+ backgroundColor: cssVar("--pressed-background"),
93
+ },
87
94
  },
88
- },
89
- getPadding(tabPadding),
90
- tabJSStyle,
91
- ]}
92
- >
93
- {addOnPosition === "start" && addOn}
94
- <Text size={labelSize} color={selected ? "primary" : "secondary"}>
95
- {label}
96
- </Text>
97
- {addOnPosition === "end" && addOn}
98
- </BaseLink>
99
- )
95
+ getPadding(tabPadding),
96
+ tabJSStyle,
97
+ ]}
98
+ >
99
+ {addOnPosition === "start" && addOn}
100
+ <Text size={labelSize} color={selected ? "primary" : "secondary"}>
101
+ {labelRenderer ? labelRenderer(label) : label}
102
+ </Text>
103
+ {addOnPosition === "end" && addOn}
104
+ </BaseComponent>
105
+ );
106
+ }
100
107
  )}
101
108
  </Row>
102
109
  );
package/src/Text.tsx CHANGED
@@ -1,5 +1,12 @@
1
1
  import React, { ReactNode } from "react";
2
- import { JSStyle, Size, TextColor, cssVar, getTextColor, jss } from "./jss";
2
+ import {
3
+ JSStyle,
4
+ Size,
5
+ TextColor,
6
+ cssVar,
7
+ getTextColor,
8
+ toClassnames,
9
+ } from "./jss";
3
10
 
4
11
  const fontSize = {
5
12
  xsmall: cssVar("--font-xsmall"),
@@ -22,7 +29,7 @@ export interface TextProps {
22
29
  align?: "center" | "none";
23
30
  type?: TextType;
24
31
  grow?: boolean;
25
- jsStyle?: JSStyle;
32
+ jss?: JSStyle;
26
33
  id?: string;
27
34
  htmlFor?: string;
28
35
  }
@@ -46,7 +53,7 @@ export function Text({
46
53
  ellipsis = "default",
47
54
  grow,
48
55
  type: Type = "span",
49
- jsStyle,
56
+ jss,
50
57
  id,
51
58
  htmlFor,
52
59
  }: TextProps) {
@@ -54,7 +61,7 @@ export function Text({
54
61
  ellipsis = Type === "span" || Type === "label";
55
62
  }
56
63
 
57
- const className = jss([
64
+ const className = toClassnames([
58
65
  getTextColor(color),
59
66
  { fontSize: fontSize[size], padding: 0, margin: 0 },
60
67
  bold && { fontWeight: "bold" },
@@ -65,7 +72,7 @@ export function Text({
65
72
  whiteSpace: "nowrap",
66
73
  },
67
74
  grow && { flexGrow: 1 },
68
- jsStyle,
75
+ jss,
69
76
  ]);
70
77
 
71
78
  return (
@@ -75,30 +82,30 @@ export function Text({
75
82
  );
76
83
  }
77
84
 
78
- export function Label({ size = "small", type = "label", ...rest }: TextProps) {
85
+ export function Label({ size = "medium", type = "label", ...rest }: TextProps) {
79
86
  return <Text size={size} type={type} {...rest} />;
80
87
  }
81
88
 
82
- export function Span({ size = "small", type = "span", ...rest }: TextProps) {
89
+ export function Span({ size = "medium", type = "span", ...rest }: TextProps) {
83
90
  return <Text size={size} type={type} {...rest} />;
84
91
  }
85
92
 
86
- export function P({ size = "small", type = "p", ...rest }: TextProps) {
93
+ export function P({ size = "medium", type = "p", ...rest }: TextProps) {
87
94
  return <Text size={size} type={type} {...rest} />;
88
95
  }
89
96
 
90
- export function H1({ size = "xlarge", type = "h1", ...rest }: TextProps) {
97
+ export function H1({ size = "xxlarge", type = "h1", ...rest }: TextProps) {
91
98
  return <Text size={size} type={type} {...rest} />;
92
99
  }
93
100
 
94
- export function H2({ size = "large", type = "h2", ...rest }: TextProps) {
101
+ export function H2({ size = "xlarge", type = "h2", ...rest }: TextProps) {
95
102
  return <Text size={size} type={type} {...rest} />;
96
103
  }
97
104
 
98
- export function H3({ size = "medium", type = "h3", ...rest }: TextProps) {
105
+ export function H3({ size = "large", type = "h3", ...rest }: TextProps) {
99
106
  return <Text size={size} type={type} {...rest} />;
100
107
  }
101
108
 
102
- export function Li({ size = "small", type = "li", ...rest }: TextProps) {
109
+ export function Li({ size = "medium", type = "li", ...rest }: TextProps) {
103
110
  return <Text size={size} type={type} {...rest} />;
104
111
  }
package/src/TextArea.tsx CHANGED
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
- import { JSStyle, Padding, cssVar, getPadding, jss } from "./jss";
2
+ import { JSStyle, Padding, cssVar, getPadding, toClassnames } from "./jss";
3
3
 
4
4
  export interface TextAreaProps
5
5
  extends React.InputHTMLAttributes<HTMLTextAreaElement> {
6
- jsStyle?: JSStyle;
6
+ jss?: JSStyle;
7
7
  onValueChange?: (value: string) => void;
8
8
  value?: string;
9
9
  className?: undefined;
@@ -14,7 +14,7 @@ export interface TextAreaProps
14
14
  export const TextArea = React.forwardRef(
15
15
  (
16
16
  {
17
- jsStyle,
17
+ jss,
18
18
  onValueChange,
19
19
  value,
20
20
  onChange,
@@ -27,7 +27,7 @@ export const TextArea = React.forwardRef(
27
27
  <textarea
28
28
  {...otherProps}
29
29
  ref={ref}
30
- className={jss([
30
+ className={toClassnames([
31
31
  {
32
32
  flexGrow: 1,
33
33
  color: cssVar("--primary-text"),
@@ -46,7 +46,7 @@ export const TextArea = React.forwardRef(
46
46
  },
47
47
  },
48
48
  getPadding(padding),
49
- jsStyle,
49
+ jss,
50
50
  ])}
51
51
  value={value}
52
52
  onChange={
package/src/TextInput.tsx CHANGED
@@ -21,7 +21,7 @@ export const TextInput = React.forwardRef(
21
21
  value,
22
22
  onValueChange,
23
23
  rootJSStyle,
24
- jsStyle,
24
+ jss,
25
25
  addOn,
26
26
  gap = "small",
27
27
  addOnPosition = "start",
@@ -34,7 +34,7 @@ export const TextInput = React.forwardRef(
34
34
  return (
35
35
  <Row
36
36
  gap={gap}
37
- jsStyle={[
37
+ jss={[
38
38
  {
39
39
  borderRadius: cssVar("--border-radius-m"),
40
40
  overflow: "hidden",
@@ -61,7 +61,7 @@ export const TextInput = React.forwardRef(
61
61
  <Column
62
62
  justify="center"
63
63
  align="center"
64
- jsStyle={[getPadding(padding), { paddingRight: 0 }]}
64
+ jss={[getPadding(padding), { paddingRight: 0 }]}
65
65
  >
66
66
  {addOn}
67
67
  </Column>
@@ -73,7 +73,7 @@ export const TextInput = React.forwardRef(
73
73
  onChange={
74
74
  onValueChange ? (e) => onValueChange(e.target.value) : undefined
75
75
  }
76
- jsStyle={[
76
+ jss={[
77
77
  {
78
78
  minWidth: 0,
79
79
  flexGrow: 1,
@@ -93,14 +93,14 @@ export const TextInput = React.forwardRef(
93
93
  getPadding(padding),
94
94
  addOn && addOnPosition === "start" ? { paddingLeft: 0 } : null,
95
95
  addOn && addOnPosition === "end" ? { paddingRight: 0 } : null,
96
- jsStyle,
96
+ jss,
97
97
  ]}
98
98
  />
99
99
  {addOnPosition === "end" && addOn && (
100
100
  <Column
101
101
  justify="center"
102
102
  align="center"
103
- jsStyle={[getPadding(padding), { paddingLeft: 0 }]}
103
+ jss={[getPadding(padding), { paddingLeft: 0 }]}
104
104
  >
105
105
  {addOn}
106
106
  </Column>
@@ -31,7 +31,7 @@ export interface TextPairingProps {
31
31
  grow?: boolean;
32
32
  shrink?: boolean;
33
33
  headlineBold?: boolean;
34
- jsStyle?: JSStyle;
34
+ jss?: JSStyle;
35
35
  }
36
36
 
37
37
  export function TextPairing({
@@ -50,7 +50,7 @@ export function TextPairing({
50
50
  shrink,
51
51
  headlineBold,
52
52
  padding,
53
- jsStyle,
53
+ jss,
54
54
  }: TextPairingProps) {
55
55
  const textElement = (
56
56
  <Column
@@ -58,16 +58,16 @@ export function TextPairing({
58
58
  shrink={shrink}
59
59
  padding={addOn ? undefined : padding}
60
60
  align={align}
61
- jsStyle={[
61
+ jss={[
62
62
  {
63
63
  overflow: "hidden",
64
64
  },
65
- jsStyle,
65
+ jss,
66
66
  ]}
67
67
  >
68
68
  <Row
69
69
  align="center"
70
- jsStyle={{
70
+ jss={{
71
71
  textAlign: "start",
72
72
  }}
73
73
  >
@@ -79,7 +79,7 @@ export function TextPairing({
79
79
  {body && (
80
80
  <Row
81
81
  align="center"
82
- jsStyle={{
82
+ jss={{
83
83
  marginTop: cssVar("--spacing-xs"),
84
84
  textAlign: "start",
85
85
  }}
@@ -100,7 +100,7 @@ export function TextPairing({
100
100
  gap={gap}
101
101
  align="center"
102
102
  padding={padding}
103
- jsStyle={{
103
+ jss={{
104
104
  overflow: "hidden",
105
105
  }}
106
106
  >
package/src/TimeInput.tsx CHANGED
@@ -23,7 +23,7 @@ function TimeInputInternal(
23
23
  {
24
24
  time: date,
25
25
  onTimeChange: onDateChange,
26
- jsStyle,
26
+ jss,
27
27
  addOn,
28
28
  padding = "small",
29
29
  gap = "none",
@@ -38,7 +38,7 @@ function TimeInputInternal(
38
38
  padding={padding}
39
39
  gap={gap}
40
40
  align="center"
41
- jsStyle={[
41
+ jss={[
42
42
  {
43
43
  borderRadius: cssVar("--border-radius-m"),
44
44
  overflow: "hidden",
@@ -79,7 +79,7 @@ function TimeInputInternal(
79
79
  )
80
80
  );
81
81
  }}
82
- jsStyle={[
82
+ jss={[
83
83
  {
84
84
  flexGrow: 1,
85
85
  backgroundColor: "inherit",
@@ -98,7 +98,7 @@ function TimeInputInternal(
98
98
  backgroundColor: "none",
99
99
  },
100
100
  },
101
- jsStyle,
101
+ jss,
102
102
  ]}
103
103
  />
104
104
  {addOnPosition === "end" && addOn}
package/src/Tooltip.tsx CHANGED
@@ -3,9 +3,9 @@ import React, { useRef, useState } from "react";
3
3
  import { BaseView } from "./BaseView";
4
4
  import { useRefEffect } from "./useRefEffect";
5
5
  import { Text } from "./Text";
6
- import { JSStyle, cssVar, jss } from "./jss";
6
+ import { JSStyle, cssVar, toClassnames } from "./jss";
7
7
 
8
- const jsStyles: { [key: string]: JSStyle } = {
8
+ const jsss: { [key: string]: JSStyle } = {
9
9
  tooltip: {
10
10
  top: "-100%",
11
11
  transform: "translateY(50%)",
@@ -20,13 +20,13 @@ const jsStyles: { [key: string]: JSStyle } = {
20
20
 
21
21
  interface TooltipProps {
22
22
  content: string;
23
- jsStyle?: JSStyle;
23
+ jss?: JSStyle;
24
24
  className?: undefined;
25
25
  tag?: keyof HTMLElementTagNameMap;
26
26
  children: JSX.Element;
27
27
  }
28
28
 
29
- export function Tooltip({ content, jsStyle, tag, children }: TooltipProps) {
29
+ export function Tooltip({ content, jss, tag, children }: TooltipProps) {
30
30
  const [tooltip, setTooltip] = useState<JSX.Element>(null);
31
31
  const dialogRef = useRef(null);
32
32
  const focusTrapRoot = useRefEffect((root: HTMLDialogElement) => {
@@ -66,7 +66,7 @@ export function Tooltip({ content, jsStyle, tag, children }: TooltipProps) {
66
66
  dialogRef.current = ref;
67
67
  focusTrapRoot(ref);
68
68
  }}
69
- className={jss(jsStyles.tooltip)}
69
+ className={toClassnames(jsss.tooltip)}
70
70
  onClose={() => {
71
71
  setTooltip(null);
72
72
  }}
@@ -89,7 +89,7 @@ export function Tooltip({ content, jsStyle, tag, children }: TooltipProps) {
89
89
  <BaseView
90
90
  tag={tag}
91
91
  relative={true}
92
- jsStyle={[{ display: "inline-block" }, jsStyle]}
92
+ jss={[{ display: "inline-block" }, jss]}
93
93
  onMouseEnter={() => {
94
94
  if (tooltip == null) {
95
95
  toggle();
package/src/docs/mdx.tsx CHANGED
@@ -12,31 +12,29 @@ const monospace = Roboto({ weight: "400", subsets: ["latin"] });
12
12
 
13
13
  const components: any = {
14
14
  h1: (props) => (
15
- <H1 jsStyle={{ marginBottom: cssVar("--spacing-xl") }} {...props} />
15
+ <H1 jss={{ marginBottom: cssVar("--spacing-xl") }} {...props} />
16
16
  ),
17
17
  h2: (props) => (
18
18
  <H2
19
19
  id={labelToID(props.children)}
20
- jsStyle={{ marginBottom: cssVar("--spacing-l") }}
20
+ jss={{ marginBottom: cssVar("--spacing-l") }}
21
21
  {...props}
22
22
  />
23
23
  ),
24
24
  h3: (props) => {
25
25
  return <H3 id={labelToID(props.children)} {...props} />;
26
26
  },
27
- p: (props) => (
28
- <P jsStyle={{ marginBottom: cssVar("--spacing-m") }} {...props} />
29
- ),
27
+ p: (props) => <P jss={{ marginBottom: cssVar("--spacing-m") }} {...props} />,
30
28
  span: (props) => <Span {...props} />,
31
29
  li: (props) => (
32
- <Li jsStyle={{ marginBottom: cssVar("--spacing-s") }} {...props} />
30
+ <Li jss={{ marginBottom: cssVar("--spacing-s") }} {...props} />
33
31
  ),
34
32
  a: (props) => {
35
33
  return (
36
34
  <BaseLink
37
35
  bare
38
36
  color="positive"
39
- jsStyle={{
37
+ jss={{
40
38
  display: "inline-block",
41
39
  paddingBottom: cssVar("--spacing-s"),
42
40
  paddingTop: cssVar("--spacing-s"),
@@ -49,7 +47,7 @@ const components: any = {
49
47
  },
50
48
  hr: () => (
51
49
  <BaseView
52
- jsStyle={{
50
+ jss={{
53
51
  marginBottom: cssVar("--spacing-xxl"),
54
52
  marginTop: cssVar("--spacing-xxl"),
55
53
  }}