aidos-ui 3.0.29 → 3.0.31
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.
- package/.claude/settings.local.json +8 -0
- package/dist/Badge.d.ts +2 -2
- package/dist/Badge.js +3 -3
- package/dist/Badge.js.map +1 -1
- package/dist/BaseButton.d.ts +1 -1
- package/dist/BaseButton.js +5 -5
- package/dist/BaseButton.js.map +1 -1
- package/dist/BaseInput.d.ts +1 -1
- package/dist/BaseInput.js +4 -4
- package/dist/BaseInput.js.map +1 -1
- package/dist/BaseLink.d.ts +1 -1
- package/dist/BaseLink.js +4 -4
- package/dist/BaseLink.js.map +1 -1
- package/dist/BaseList.js +3 -3
- package/dist/BaseList.js.map +1 -1
- package/dist/BaseListItem.d.ts +1 -1
- package/dist/BaseListItem.js +4 -4
- package/dist/BaseListItem.js.map +1 -1
- package/dist/BaseView.d.ts +1 -1
- package/dist/BaseView.js +8 -8
- package/dist/BaseView.js.map +1 -1
- package/dist/Button.js +3 -3
- package/dist/Button.js.map +1 -1
- package/dist/Calendar.d.ts +1 -1
- package/dist/Calendar.js +3 -3
- package/dist/Calendar.js.map +1 -1
- package/dist/Card.d.ts +1 -1
- package/dist/Card.js +3 -3
- package/dist/Card.js.map +1 -1
- package/dist/Checkbox.js +3 -3
- package/dist/Checkbox.js.map +1 -1
- package/dist/Circle.d.ts +1 -1
- package/dist/Circle.js +3 -3
- package/dist/Circle.js.map +1 -1
- package/dist/DarkMode.js +1 -1
- package/dist/DarkMode.js.map +1 -1
- package/dist/DateInput.d.ts +1 -1
- package/dist/DateInput.js +4 -4
- package/dist/DateInput.js.map +1 -1
- package/dist/DatePicker.js +3 -3
- package/dist/DatePicker.js.map +1 -1
- package/dist/DatetimeInput.d.ts +1 -1
- package/dist/DatetimeInput.js +3 -3
- package/dist/DatetimeInput.js.map +1 -1
- package/dist/DesignBook.js +1 -1
- package/dist/DesignBook.js.map +1 -1
- package/dist/Dialog.js +4 -4
- package/dist/Dialog.js.map +1 -1
- package/dist/Dropdown.d.ts +3 -3
- package/dist/Dropdown.js +4 -4
- package/dist/Dropdown.js.map +1 -1
- package/dist/FlexLayout.js +3 -3
- package/dist/FlexLayout.js.map +1 -1
- package/dist/Icon.js +10 -10
- package/dist/Icon.js.map +1 -1
- package/dist/IconButton.js +3 -3
- package/dist/IconButton.js.map +1 -1
- package/dist/IconLink.js +1 -1
- package/dist/IconLink.js.map +1 -1
- package/dist/Interactable.js +10 -10
- package/dist/Interactable.js.map +1 -1
- package/dist/Link.js +4 -4
- package/dist/Link.js.map +1 -1
- package/dist/List.d.ts +1 -1
- package/dist/List.js +3 -3
- package/dist/List.js.map +1 -1
- package/dist/ListButtonItem.js +2 -2
- package/dist/ListButtonItem.js.map +1 -1
- package/dist/ListDivider.js +2 -2
- package/dist/ListDivider.js.map +1 -1
- package/dist/ListHeaderItem.js +1 -1
- package/dist/ListHeaderItem.js.map +1 -1
- package/dist/ListItem.js +1 -1
- package/dist/ListItem.js.map +1 -1
- package/dist/ListLinkItem.js +2 -2
- package/dist/ListLinkItem.js.map +1 -1
- package/dist/ListSpacer.js +2 -2
- package/dist/ListSpacer.js.map +1 -1
- package/dist/MenuIcon.js +6 -6
- package/dist/MenuIcon.js.map +1 -1
- package/dist/NextJSRouter.js +3 -3
- package/dist/NextJSRouter.js.map +1 -1
- package/dist/Popover.d.ts +2 -2
- package/dist/Popover.js +5 -5
- package/dist/Popover.js.map +1 -1
- package/dist/ProgressBar.d.ts +2 -2
- package/dist/ProgressBar.js +6 -6
- package/dist/ProgressBar.js.map +1 -1
- package/dist/ProgressCircle.js +2 -2
- package/dist/ProgressCircle.js.map +1 -1
- package/dist/RangeInput.js +4 -4
- package/dist/RangeInput.js.map +1 -1
- package/dist/RootView.js +1 -1
- package/dist/RootView.js.map +1 -1
- package/dist/Select.d.ts +1 -1
- package/dist/Select.js +4 -4
- package/dist/Select.js.map +1 -1
- package/dist/StaticCheckbox.js +3 -3
- package/dist/StaticCheckbox.js.map +1 -1
- package/dist/Sublist.d.ts +2 -2
- package/dist/Sublist.js +2 -2
- package/dist/Sublist.js.map +1 -1
- package/dist/SubmitIconInput.js +2 -2
- package/dist/SubmitIconInput.js.map +1 -1
- package/dist/Tabs.d.ts +5 -2
- package/dist/Tabs.js +31 -25
- package/dist/Tabs.js.map +1 -1
- package/dist/Text.d.ts +2 -2
- package/dist/Text.js +4 -4
- package/dist/Text.js.map +1 -1
- package/dist/TextArea.d.ts +1 -1
- package/dist/TextArea.js +4 -4
- package/dist/TextArea.js.map +1 -1
- package/dist/TextInput.js +5 -5
- package/dist/TextInput.js.map +1 -1
- package/dist/TextPairing.d.ts +2 -2
- package/dist/TextPairing.js +6 -6
- package/dist/TextPairing.js.map +1 -1
- package/dist/TimeInput.js +4 -4
- package/dist/TimeInput.js.map +1 -1
- package/dist/Tooltip.d.ts +2 -2
- package/dist/Tooltip.js +5 -5
- package/dist/Tooltip.js.map +1 -1
- package/dist/jss.d.ts +5 -5
- package/dist/jss.js +17 -17
- package/dist/jss.js.map +1 -1
- package/package.json +1 -1
- package/src/Badge.tsx +4 -4
- package/src/BaseButton.tsx +6 -6
- package/src/BaseInput.tsx +10 -5
- package/src/BaseLink.tsx +5 -5
- package/src/BaseList.tsx +3 -6
- package/src/BaseListItem.tsx +5 -5
- package/src/BaseView.tsx +9 -9
- package/src/Button.tsx +3 -3
- package/src/Calendar.tsx +4 -4
- package/src/Card.tsx +3 -3
- package/src/Checkbox.tsx +3 -3
- package/src/Circle.tsx +3 -3
- package/src/DarkMode.tsx +1 -1
- package/src/DateInput.tsx +5 -5
- package/src/DatePicker.tsx +3 -3
- package/src/DatetimeInput.tsx +5 -12
- package/src/DesignBook.tsx +1 -1
- package/src/Dialog.tsx +6 -6
- package/src/Dropdown.tsx +8 -8
- package/src/FlexLayout.tsx +3 -3
- package/src/Icon.tsx +10 -10
- package/src/IconButton.tsx +3 -11
- package/src/IconLink.tsx +1 -1
- package/src/Interactable.tsx +10 -10
- package/src/Link.tsx +4 -4
- package/src/List.tsx +3 -3
- package/src/ListButtonItem.tsx +3 -3
- package/src/ListDivider.tsx +2 -2
- package/src/ListHeaderItem.tsx +1 -1
- package/src/ListItem.tsx +1 -6
- package/src/ListLinkItem.tsx +3 -3
- package/src/ListSpacer.tsx +2 -2
- package/src/MenuIcon.tsx +6 -6
- package/src/NextJSRouter.tsx +3 -3
- package/src/Popover.tsx +6 -6
- package/src/ProgressBar.tsx +7 -7
- package/src/ProgressCircle.tsx +2 -2
- package/src/RangeInput.tsx +4 -4
- package/src/RootView.tsx +1 -1
- package/src/Select.tsx +5 -5
- package/src/StaticCheckbox.tsx +4 -6
- package/src/Sublist.tsx +4 -4
- package/src/SubmitIconInput.tsx +2 -2
- package/src/Tabs.tsx +55 -46
- package/src/Text.tsx +12 -5
- package/src/TextArea.tsx +5 -5
- package/src/TextInput.tsx +6 -6
- package/src/TextPairing.tsx +7 -7
- package/src/TimeInput.tsx +4 -4
- package/src/Tooltip.tsx +6 -6
- package/src/docs/mdx.tsx +6 -8
- package/src/docs/searchIndex.ts +1 -1
- package/src/jss.tsx +17 -17
- package/src/pages/Calendar.mdx +4 -4
- package/src/pages/Card.mdx +4 -4
- package/src/pages/FlexLayout.mdx +6 -6
- package/src/pages/Tabs.mdx +261 -4
- package/src/pages/TextPairing.mdx +2 -2
- package/src/pages/TimeInput.mdx +2 -2
- package/src/pages/_app.tsx +6 -6
- package/src/pages/css-in-js.mdx +2 -2
package/src/jss.tsx
CHANGED
|
@@ -137,23 +137,23 @@ const getCSS = (key: string, value): [string, string] => {
|
|
|
137
137
|
return [cssProp, cssValue];
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
-
const flattenJSStyle = (
|
|
141
|
-
if (!
|
|
140
|
+
const flattenJSStyle = (jss: JSStyle): Styles => {
|
|
141
|
+
if (!jss) {
|
|
142
142
|
return {};
|
|
143
|
-
} else if (Array.isArray(
|
|
143
|
+
} else if (Array.isArray(jss)) {
|
|
144
144
|
// @ts-ignore
|
|
145
|
-
return
|
|
146
|
-
return { ...acc, ...flattenJSStyle(
|
|
145
|
+
return jss.reduce((acc: Styles, jss: JSStyle) => {
|
|
146
|
+
return { ...acc, ...flattenJSStyle(jss) };
|
|
147
147
|
}, {});
|
|
148
148
|
} else {
|
|
149
|
-
return
|
|
149
|
+
return jss;
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
152
|
|
|
153
|
-
export const
|
|
154
|
-
|
|
153
|
+
export const toClassnames = (jss: JSStyle): string => {
|
|
154
|
+
jss = flattenJSStyle(jss);
|
|
155
155
|
|
|
156
|
-
const stylesStack = Object.entries(
|
|
156
|
+
const stylesStack = Object.entries(jss);
|
|
157
157
|
const classNames = [];
|
|
158
158
|
|
|
159
159
|
while (stylesStack.length) {
|
|
@@ -572,27 +572,27 @@ export const TABLET_MEDIA = `@media (min-width: ${MOBILE}px) and (max-width: ${T
|
|
|
572
572
|
export const LAPTOP_MEDIA = `@media (min-width: ${TABLET}px) and (max-width: ${LAPTOP}px)`;
|
|
573
573
|
export const DESKTOP_MEDIA = `@media (min-width: ${LAPTOP}px)`;
|
|
574
574
|
|
|
575
|
-
export function mobile(
|
|
575
|
+
export function mobile(jss: JSStyle): { [key: string]: JSStyle } {
|
|
576
576
|
return {
|
|
577
|
-
[MOBILE_MEDIA]:
|
|
577
|
+
[MOBILE_MEDIA]: jss,
|
|
578
578
|
};
|
|
579
579
|
}
|
|
580
580
|
|
|
581
|
-
export function tablet(
|
|
581
|
+
export function tablet(jss: JSStyle): { [key: string]: JSStyle } {
|
|
582
582
|
return {
|
|
583
|
-
[TABLET_MEDIA]:
|
|
583
|
+
[TABLET_MEDIA]: jss,
|
|
584
584
|
};
|
|
585
585
|
}
|
|
586
586
|
|
|
587
|
-
export function laptop(
|
|
587
|
+
export function laptop(jss: JSStyle): { [key: string]: JSStyle } {
|
|
588
588
|
return {
|
|
589
|
-
[LAPTOP_MEDIA]:
|
|
589
|
+
[LAPTOP_MEDIA]: jss,
|
|
590
590
|
};
|
|
591
591
|
}
|
|
592
592
|
|
|
593
|
-
export function desktop(
|
|
593
|
+
export function desktop(jss: JSStyle): { [key: string]: JSStyle } {
|
|
594
594
|
return {
|
|
595
|
-
[DESKTOP_MEDIA]:
|
|
595
|
+
[DESKTOP_MEDIA]: jss,
|
|
596
596
|
};
|
|
597
597
|
}
|
|
598
598
|
|
package/src/pages/Calendar.mdx
CHANGED
|
@@ -15,10 +15,10 @@ The calendar component is can be used to represent months, and is customisable t
|
|
|
15
15
|
</Box>
|
|
16
16
|
)}
|
|
17
17
|
cell={({ today, date, outOfMonth }) => (
|
|
18
|
-
<Box relative={true}
|
|
18
|
+
<Box relative={true} jss={{ opacity: outOfMonth ? 0.2 : 1 }}>
|
|
19
19
|
{today && (
|
|
20
20
|
<Badge
|
|
21
|
-
|
|
21
|
+
jss={{
|
|
22
22
|
position: "absolute",
|
|
23
23
|
top: "50%",
|
|
24
24
|
transform: "translateY(-50%) translateX(-75%)",
|
|
@@ -40,10 +40,10 @@ The calendar component is can be used to represent months, and is customisable t
|
|
|
40
40
|
</Box>
|
|
41
41
|
)}
|
|
42
42
|
cell={({ today, date, outOfMonth }) => (
|
|
43
|
-
<Box relative={true}
|
|
43
|
+
<Box relative={true} jss={{ opacity: outOfMonth ? 0.2 : 1 }}>
|
|
44
44
|
{today && (
|
|
45
45
|
<Badge
|
|
46
|
-
|
|
46
|
+
jss={{
|
|
47
47
|
position: "absolute",
|
|
48
48
|
top: "50%",
|
|
49
49
|
transform: "translateY(-50%) translateX(-75%)",
|
package/src/pages/Card.mdx
CHANGED
|
@@ -20,7 +20,7 @@ Cards can be used to make give cohesion to some UI elements, grouping them visua
|
|
|
20
20
|
onValueChange={() => {}}
|
|
21
21
|
/>
|
|
22
22
|
<TextArea
|
|
23
|
-
|
|
23
|
+
jss={{
|
|
24
24
|
resize: "vertical",
|
|
25
25
|
}}
|
|
26
26
|
name="message"
|
|
@@ -30,7 +30,7 @@ Cards can be used to make give cohesion to some UI elements, grouping them visua
|
|
|
30
30
|
onValueChange={() => {}}
|
|
31
31
|
/>
|
|
32
32
|
<Button
|
|
33
|
-
|
|
33
|
+
jss={{ animation: "all 1s ease-out" }}
|
|
34
34
|
onClick={() => {}}
|
|
35
35
|
type="submit"
|
|
36
36
|
label="Subscribe"
|
|
@@ -51,7 +51,7 @@ Cards can be used to make give cohesion to some UI elements, grouping them visua
|
|
|
51
51
|
onValueChange={() => {}}
|
|
52
52
|
/>
|
|
53
53
|
<TextArea
|
|
54
|
-
|
|
54
|
+
jss={{
|
|
55
55
|
resize: "vertical",
|
|
56
56
|
}}
|
|
57
57
|
name="message"
|
|
@@ -61,7 +61,7 @@ Cards can be used to make give cohesion to some UI elements, grouping them visua
|
|
|
61
61
|
onValueChange={() => {}}
|
|
62
62
|
/>
|
|
63
63
|
<Button
|
|
64
|
-
|
|
64
|
+
jss={{ animation: "all 1s ease-out" }}
|
|
65
65
|
onClick={() => {}}
|
|
66
66
|
type="submit"
|
|
67
67
|
label="Subscribe"
|
package/src/pages/FlexLayout.mdx
CHANGED
|
@@ -14,7 +14,7 @@ Because flex is so common there are a `Row` and a `Column` components, with a lo
|
|
|
14
14
|
|
|
15
15
|
<Column gap="medium">
|
|
16
16
|
<Row
|
|
17
|
-
|
|
17
|
+
jss={{ border: `1px solid ${cssVar("--highlight")}` }}
|
|
18
18
|
justify="space-around"
|
|
19
19
|
align="center"
|
|
20
20
|
>
|
|
@@ -23,7 +23,7 @@ Because flex is so common there are a `Row` and a `Column` components, with a lo
|
|
|
23
23
|
<Badge />
|
|
24
24
|
</Row>
|
|
25
25
|
<Row
|
|
26
|
-
|
|
26
|
+
jss={{ border: `1px solid ${cssVar("--highlight")}` }}
|
|
27
27
|
justify="space-evenly"
|
|
28
28
|
align="center"
|
|
29
29
|
>
|
|
@@ -32,7 +32,7 @@ Because flex is so common there are a `Row` and a `Column` components, with a lo
|
|
|
32
32
|
<Badge />
|
|
33
33
|
</Row>
|
|
34
34
|
<Row
|
|
35
|
-
|
|
35
|
+
jss={{ border: `1px solid ${cssVar("--highlight")}` }}
|
|
36
36
|
justify="space-between"
|
|
37
37
|
align="center"
|
|
38
38
|
>
|
|
@@ -45,7 +45,7 @@ Because flex is so common there are a `Row` and a `Column` components, with a lo
|
|
|
45
45
|
```js
|
|
46
46
|
<Column gap="medium">
|
|
47
47
|
<Row
|
|
48
|
-
|
|
48
|
+
jss={{ border: `1px solid ${cssVar("--highlight")}` }}
|
|
49
49
|
justify="space-around"
|
|
50
50
|
align="center"
|
|
51
51
|
>
|
|
@@ -54,7 +54,7 @@ Because flex is so common there are a `Row` and a `Column` components, with a lo
|
|
|
54
54
|
<Badge />
|
|
55
55
|
</Row>
|
|
56
56
|
<Row
|
|
57
|
-
|
|
57
|
+
jss={{ border: `1px solid ${cssVar("--highlight")}` }}
|
|
58
58
|
justify="space-evenly"
|
|
59
59
|
align="center"
|
|
60
60
|
>
|
|
@@ -63,7 +63,7 @@ Because flex is so common there are a `Row` and a `Column` components, with a lo
|
|
|
63
63
|
<Badge />
|
|
64
64
|
</Row>
|
|
65
65
|
<Row
|
|
66
|
-
|
|
66
|
+
jss={{ border: `1px solid ${cssVar("--highlight")}` }}
|
|
67
67
|
justify="space-between"
|
|
68
68
|
align="center"
|
|
69
69
|
>
|
package/src/pages/Tabs.mdx
CHANGED
|
@@ -45,7 +45,7 @@ The `Tabs` component is made of a horizontal container with the role `tablist`,
|
|
|
45
45
|
href: "/Tabs",
|
|
46
46
|
addOn: (
|
|
47
47
|
<Badge
|
|
48
|
-
|
|
48
|
+
jss={{ margin: cssVar("--spacing-m") }}
|
|
49
49
|
color="highlight"
|
|
50
50
|
size="medium"
|
|
51
51
|
/>
|
|
@@ -72,7 +72,7 @@ The `Tabs` component is made of a horizontal container with the role `tablist`,
|
|
|
72
72
|
href: "/Tabs",
|
|
73
73
|
addOn: (
|
|
74
74
|
<Badge
|
|
75
|
-
|
|
75
|
+
jss={{ margin: cssVar("--spacing-m") }}
|
|
76
76
|
color="highlight"
|
|
77
77
|
size="medium"
|
|
78
78
|
/>
|
|
@@ -124,7 +124,7 @@ The `Tabs` component is made of a horizontal container with the role `tablist`,
|
|
|
124
124
|
href: "/Tabs",
|
|
125
125
|
addOn: (
|
|
126
126
|
<Badge
|
|
127
|
-
|
|
127
|
+
jss={{ margin: cssVar("--spacing-m") }}
|
|
128
128
|
color="highlight"
|
|
129
129
|
size="medium"
|
|
130
130
|
/>
|
|
@@ -151,7 +151,7 @@ The `Tabs` component is made of a horizontal container with the role `tablist`,
|
|
|
151
151
|
href: "/Tabs",
|
|
152
152
|
addOn: (
|
|
153
153
|
<Badge
|
|
154
|
-
|
|
154
|
+
jss={{ margin: cssVar("--spacing-m") }}
|
|
155
155
|
color="highlight"
|
|
156
156
|
size="medium"
|
|
157
157
|
/>
|
|
@@ -166,3 +166,260 @@ The `Tabs` component is made of a horizontal container with the role `tablist`,
|
|
|
166
166
|
```
|
|
167
167
|
|
|
168
168
|
---
|
|
169
|
+
|
|
170
|
+
## Tabs as buttons
|
|
171
|
+
|
|
172
|
+
You can also use the `Tabs` component with buttons instead of links by omitting the `href` property in the tabs.
|
|
173
|
+
|
|
174
|
+
<Column gap="medium">
|
|
175
|
+
<Tabs
|
|
176
|
+
aria-controls="foo"
|
|
177
|
+
tabs={[
|
|
178
|
+
{
|
|
179
|
+
selected: true,
|
|
180
|
+
label: "Tab 1",
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
selected: false,
|
|
184
|
+
label: "Tab 2",
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
selected: false,
|
|
188
|
+
label: "Tab 3",
|
|
189
|
+
},
|
|
190
|
+
]}
|
|
191
|
+
/>
|
|
192
|
+
<Tabs
|
|
193
|
+
aria-controls="foo"
|
|
194
|
+
tabs={[
|
|
195
|
+
{
|
|
196
|
+
selected: false,
|
|
197
|
+
label: "Tab 1",
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
selected: true,
|
|
201
|
+
label: "Tab 2",
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
addOn: (
|
|
205
|
+
<Badge
|
|
206
|
+
jss={{ margin: cssVar("--spacing-m") }}
|
|
207
|
+
color="highlight"
|
|
208
|
+
size="medium"
|
|
209
|
+
/>
|
|
210
|
+
),
|
|
211
|
+
selected: false,
|
|
212
|
+
label: "Tab 3",
|
|
213
|
+
},
|
|
214
|
+
]}
|
|
215
|
+
/>
|
|
216
|
+
<Tabs
|
|
217
|
+
aria-controls="foo"
|
|
218
|
+
tabs={[
|
|
219
|
+
{
|
|
220
|
+
selected: false,
|
|
221
|
+
label: "Tab 1",
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
selected: false,
|
|
225
|
+
label: "Tab 2",
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
addOn: (
|
|
229
|
+
<Badge
|
|
230
|
+
jss={{ margin: cssVar("--spacing-m") }}
|
|
231
|
+
color="highlight"
|
|
232
|
+
size="medium"
|
|
233
|
+
/>
|
|
234
|
+
),
|
|
235
|
+
addOnPosition: "end",
|
|
236
|
+
selected: true,
|
|
237
|
+
label: "Tab 3",
|
|
238
|
+
},
|
|
239
|
+
]}
|
|
240
|
+
/>
|
|
241
|
+
</Column>
|
|
242
|
+
|
|
243
|
+
```js
|
|
244
|
+
<Column gap="medium">
|
|
245
|
+
<Tabs
|
|
246
|
+
aria-controls="foo"
|
|
247
|
+
tabs={[
|
|
248
|
+
{
|
|
249
|
+
selected: true,
|
|
250
|
+
label: "Tab 1",
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
selected: false,
|
|
254
|
+
label: "Tab 2",
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
selected: false,
|
|
258
|
+
label: "Tab 3",
|
|
259
|
+
},
|
|
260
|
+
]}
|
|
261
|
+
/>
|
|
262
|
+
<Tabs
|
|
263
|
+
aria-controls="foo"
|
|
264
|
+
tabs={[
|
|
265
|
+
{
|
|
266
|
+
selected: false,
|
|
267
|
+
label: "Tab 1",
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
selected: true,
|
|
271
|
+
label: "Tab 2",
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
addOn: (
|
|
275
|
+
<Badge
|
|
276
|
+
jss={{ margin: cssVar("--spacing-m") }}
|
|
277
|
+
color="highlight"
|
|
278
|
+
size="medium"
|
|
279
|
+
/>
|
|
280
|
+
),
|
|
281
|
+
selected: false,
|
|
282
|
+
label: "Tab 3",
|
|
283
|
+
},
|
|
284
|
+
]}
|
|
285
|
+
/>
|
|
286
|
+
<Tabs
|
|
287
|
+
aria-controls="foo"
|
|
288
|
+
tabs={[
|
|
289
|
+
{
|
|
290
|
+
selected: false,
|
|
291
|
+
label: "Tab 1",
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
selected: false,
|
|
295
|
+
label: "Tab 2",
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
addOn: (
|
|
299
|
+
<Badge
|
|
300
|
+
jss={{ margin: cssVar("--spacing-m") }}
|
|
301
|
+
color="highlight"
|
|
302
|
+
size="medium"
|
|
303
|
+
/>
|
|
304
|
+
),
|
|
305
|
+
addOnPosition: "end",
|
|
306
|
+
selected: true,
|
|
307
|
+
label: "Tab 3",
|
|
308
|
+
},
|
|
309
|
+
]}
|
|
310
|
+
/>
|
|
311
|
+
</Column>
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
## Label pre renderers
|
|
315
|
+
|
|
316
|
+
You can customize how tab labels are rendered by providing a `labelRenderer` function that takes the label value and returns a ReactNode.
|
|
317
|
+
|
|
318
|
+
<Column>
|
|
319
|
+
<Tabs
|
|
320
|
+
aria-controls="foo"
|
|
321
|
+
labelRenderer={(value) => value.split(" ").map((word, index) => index % 2 === 0 ? <strong key={index}>{word} </strong> : word + " ")}
|
|
322
|
+
tabs={[
|
|
323
|
+
{
|
|
324
|
+
href: "/Tabs",
|
|
325
|
+
selected: true,
|
|
326
|
+
label: "Bold Tab 1",
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
href: "/Tabs",
|
|
330
|
+
selected: false,
|
|
331
|
+
label: "Bold Tab 2",
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
href: "/Tabs",
|
|
335
|
+
selected: false,
|
|
336
|
+
label: "Bold Tab 3",
|
|
337
|
+
},
|
|
338
|
+
]}
|
|
339
|
+
/>
|
|
340
|
+
</Column>
|
|
341
|
+
|
|
342
|
+
```js
|
|
343
|
+
<Column>
|
|
344
|
+
<Tabs
|
|
345
|
+
aria-controls="foo"
|
|
346
|
+
labelRenderer={(value) => value.split(" ").map((word, index) => index % 2 === 0 ? <strong key={index}>{word} </strong> : word + " ")}
|
|
347
|
+
tabs={[
|
|
348
|
+
{
|
|
349
|
+
href: "/Tabs",
|
|
350
|
+
selected: true,
|
|
351
|
+
label: "Bold Tab 1",
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
href: "/Tabs",
|
|
355
|
+
selected: false,
|
|
356
|
+
label: "Bold Tab 2",
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
href: "/Tabs",
|
|
360
|
+
selected: false,
|
|
361
|
+
label: "Bold Tab 3",
|
|
362
|
+
},
|
|
363
|
+
]}
|
|
364
|
+
/>
|
|
365
|
+
</Column>
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
## Custom tab styles
|
|
370
|
+
|
|
371
|
+
You can provide custom styles to individual tabs using the `tabJSStyle` prop, which can either be a style object or a function that receives the tab's selected state.
|
|
372
|
+
|
|
373
|
+
<Column>
|
|
374
|
+
<Tabs
|
|
375
|
+
aria-controls="foo"
|
|
376
|
+
tabJSStyle={(data) => ({
|
|
377
|
+
borderBottom: data.selected ? "2px solid cyan" : "2px solid magenta",
|
|
378
|
+
})}
|
|
379
|
+
tabs={[
|
|
380
|
+
{
|
|
381
|
+
href: "/Tabs",
|
|
382
|
+
selected: true,
|
|
383
|
+
label: "Styled Tab 1",
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
href: "/Tabs",
|
|
387
|
+
selected: false,
|
|
388
|
+
label: "Styled Tab 2",
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
href: "/Tabs",
|
|
392
|
+
selected: false,
|
|
393
|
+
label: "Styled Tab 3",
|
|
394
|
+
},
|
|
395
|
+
]}
|
|
396
|
+
/>
|
|
397
|
+
</Column>
|
|
398
|
+
|
|
399
|
+
```js
|
|
400
|
+
<Column>
|
|
401
|
+
<Tabs
|
|
402
|
+
aria-controls="foo"
|
|
403
|
+
tabJSStyle={(data) => ({
|
|
404
|
+
borderBottom: data.selected ? "2px solid cyan" : "2px solid magenta",
|
|
405
|
+
})}
|
|
406
|
+
tabs={[
|
|
407
|
+
{
|
|
408
|
+
href: "/Tabs",
|
|
409
|
+
selected: true,
|
|
410
|
+
label: "Styled Tab 1",
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
href: "/Tabs",
|
|
414
|
+
selected: false,
|
|
415
|
+
label: "Styled Tab 2",
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
href: "/Tabs",
|
|
419
|
+
selected: false,
|
|
420
|
+
label: "Styled Tab 3",
|
|
421
|
+
},
|
|
422
|
+
]}
|
|
423
|
+
/>
|
|
424
|
+
</Column>
|
|
425
|
+
```
|
|
@@ -11,7 +11,7 @@ The `TextPairing` is a seemingly simple component that can be used to represent
|
|
|
11
11
|
In its simplest form a `TextPairing` is formed of two text elements (headline and body) laid out vertically. However it accepts multiple props to enable much more complex representations.
|
|
12
12
|
|
|
13
13
|
<Column
|
|
14
|
-
|
|
14
|
+
jss={{ [" > *"]: { borderBottom: `1px solid ${cssVar("--divider")}` } }}
|
|
15
15
|
>
|
|
16
16
|
<TextPairing headline="Headline" body="Body" />
|
|
17
17
|
<TextPairing headline="Headline" headlineBold body="Body" />
|
|
@@ -82,7 +82,7 @@ In its simplest form a `TextPairing` is formed of two text elements (headline an
|
|
|
82
82
|
|
|
83
83
|
```js
|
|
84
84
|
<Column
|
|
85
|
-
|
|
85
|
+
jss={{ [" > *"]: { borderBottom: `1px solid ${cssVar("--divider")}` } }}
|
|
86
86
|
>
|
|
87
87
|
<TextPairing headline="Headline" body="Body" />
|
|
88
88
|
<TextPairing headline="Headline" headlineBold body="Body" />
|
package/src/pages/TimeInput.mdx
CHANGED
|
@@ -6,7 +6,7 @@ import { Icon } from "../Icon";
|
|
|
6
6
|
|
|
7
7
|
The `TimeInput` component can be used to get the time (hour and minute) from the user.
|
|
8
8
|
|
|
9
|
-
<Column gap="medium"
|
|
9
|
+
<Column gap="medium" jss={{ maxWidth: 150 }}>
|
|
10
10
|
<TimeInput time={new Date()} onTimeChange={() => {}} />
|
|
11
11
|
<TimeInput
|
|
12
12
|
addOn={<Icon icon="fa-clock-o" color="primary" size="medium" />}
|
|
@@ -38,7 +38,7 @@ The `TimeInput` component can be used to get the time (hour and minute) from the
|
|
|
38
38
|
</Column>
|
|
39
39
|
|
|
40
40
|
```js
|
|
41
|
-
<Column gap="medium"
|
|
41
|
+
<Column gap="medium" jss={{ maxWidth: 150 }}>
|
|
42
42
|
<TimeInput time={new Date()} onTimeChange={() => {}} />
|
|
43
43
|
<TimeInput
|
|
44
44
|
addOn={<Icon icon="fa-clock-o" color="primary" size="medium" />}
|
package/src/pages/_app.tsx
CHANGED
|
@@ -241,7 +241,7 @@ export default function App({ Component, pageProps }: AppProps) {
|
|
|
241
241
|
<Providers themes={{ light: lightTheme, dark: darkTheme }}>
|
|
242
242
|
<DocsMDXProvider>
|
|
243
243
|
<BaseView
|
|
244
|
-
|
|
244
|
+
jss={[
|
|
245
245
|
{
|
|
246
246
|
height: "100%",
|
|
247
247
|
overflow: "hidden",
|
|
@@ -282,7 +282,7 @@ export default function App({ Component, pageProps }: AppProps) {
|
|
|
282
282
|
]}
|
|
283
283
|
>
|
|
284
284
|
<Row
|
|
285
|
-
|
|
285
|
+
jss={{
|
|
286
286
|
gridArea: "header",
|
|
287
287
|
borderBottom: `1px solid ${cssVar("--divider")}`,
|
|
288
288
|
}}
|
|
@@ -320,7 +320,7 @@ export default function App({ Component, pageProps }: AppProps) {
|
|
|
320
320
|
/>
|
|
321
321
|
<IconButton
|
|
322
322
|
aria-label={showList ? "Hide list" : "Open list"}
|
|
323
|
-
|
|
323
|
+
jss={[
|
|
324
324
|
laptop({ display: "none" }),
|
|
325
325
|
desktop({ display: "none" }),
|
|
326
326
|
]}
|
|
@@ -334,7 +334,7 @@ export default function App({ Component, pageProps }: AppProps) {
|
|
|
334
334
|
</Row>
|
|
335
335
|
<ListDivider />
|
|
336
336
|
<Column
|
|
337
|
-
|
|
337
|
+
jss={[
|
|
338
338
|
{
|
|
339
339
|
gridArea: "list",
|
|
340
340
|
zIndex: 1,
|
|
@@ -364,7 +364,7 @@ export default function App({ Component, pageProps }: AppProps) {
|
|
|
364
364
|
bare
|
|
365
365
|
id="main-list"
|
|
366
366
|
navigation={true}
|
|
367
|
-
|
|
367
|
+
jss={[{ overflow: "scroll" }]}
|
|
368
368
|
ariaLabel={"API"}
|
|
369
369
|
>
|
|
370
370
|
{(isQuerying ? queriedPages : pages).map((element, index) => {
|
|
@@ -424,7 +424,7 @@ export default function App({ Component, pageProps }: AppProps) {
|
|
|
424
424
|
</List>
|
|
425
425
|
</Column>
|
|
426
426
|
<BaseView
|
|
427
|
-
|
|
427
|
+
jss={[
|
|
428
428
|
{
|
|
429
429
|
borderLeft: `1px solid ${cssVar("--divider")}`,
|
|
430
430
|
gridArea: "content",
|
package/src/pages/css-in-js.mdx
CHANGED
|
@@ -106,7 +106,7 @@ For example:
|
|
|
106
106
|
|
|
107
107
|
<Row justify="center">
|
|
108
108
|
<Button
|
|
109
|
-
|
|
109
|
+
jss={{ border: `10px solid ${cssVar("--warning")}` }}
|
|
110
110
|
label="Hello"
|
|
111
111
|
color="positive"
|
|
112
112
|
onClick={() => {}}
|
|
@@ -116,7 +116,7 @@ For example:
|
|
|
116
116
|
```js
|
|
117
117
|
<Row justify="center">
|
|
118
118
|
<Button
|
|
119
|
-
|
|
119
|
+
jss={{ border: `10px solid ${cssVar("--warning")}` }}
|
|
120
120
|
label="Hello"
|
|
121
121
|
color="positive"
|
|
122
122
|
onClick={() => {}}
|