@common-origin/design-system 2.23.0 → 3.0.0
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/README.md +2 -2
- package/dist/client.js +184 -479
- package/dist/client.js.map +1 -1
- package/dist/components/atoms/Badge/Badge.d.mts +5 -12
- package/dist/components/atoms/Badge/Badge.d.ts +5 -12
- package/dist/components/atoms/Badge/Badge.mjs +0 -7
- package/dist/components/atoms/Badge/index.d.mts +1 -1
- package/dist/components/atoms/Badge/index.d.ts +1 -1
- package/dist/components/atoms/Box/Box.d.mts +22 -34
- package/dist/components/atoms/Box/Box.d.ts +22 -34
- package/dist/components/atoms/Box/Box.mjs +8 -11
- package/dist/components/atoms/Button/Button.d.mts +1 -4
- package/dist/components/atoms/Button/Button.d.ts +1 -4
- package/dist/components/atoms/Button/Button.mjs +3 -10
- package/dist/components/atoms/CategoryLabel/CategoryLabel.d.mts +4 -12
- package/dist/components/atoms/CategoryLabel/CategoryLabel.d.ts +4 -12
- package/dist/components/atoms/CategoryLabel/CategoryLabel.mjs +5 -16
- package/dist/components/atoms/Chip/Chip.d.mts +8 -20
- package/dist/components/atoms/Chip/Chip.d.ts +8 -20
- package/dist/components/atoms/Chip/Chip.mjs +20 -46
- package/dist/components/atoms/Chip/Chip.mjs.map +1 -1
- package/dist/components/atoms/Chip/FilterChip.d.mts +22 -10
- package/dist/components/atoms/Chip/FilterChip.d.ts +22 -10
- package/dist/components/atoms/Chip/FilterChip.mjs +66 -6
- package/dist/components/atoms/Chip/FilterChip.mjs.map +1 -1
- package/dist/components/atoms/Chip/InputChip.mjs +4 -6
- package/dist/components/atoms/Chip/InputChip.mjs.map +1 -1
- package/dist/components/atoms/Chip/index.d.mts +0 -1
- package/dist/components/atoms/Chip/index.d.ts +0 -1
- package/dist/components/atoms/Chip/shared/types.d.mts +9 -19
- package/dist/components/atoms/Chip/shared/types.d.ts +9 -19
- package/dist/components/atoms/Chip/shared/utils.d.mts +3 -3
- package/dist/components/atoms/Chip/shared/utils.d.ts +3 -3
- package/dist/components/atoms/Chip/shared/utils.mjs +4 -8
- package/dist/components/atoms/Chip/shared/utils.mjs.map +1 -1
- package/dist/components/atoms/DateFormatter/DateFormatter.d.mts +2 -5
- package/dist/components/atoms/DateFormatter/DateFormatter.d.ts +2 -5
- package/dist/components/atoms/DateFormatter/DateFormatter.mjs +0 -1
- package/dist/components/atoms/StatusLabel/StatusLabel.mjs +1 -4
- package/dist/components/atoms/StatusLabel/StatusLabel.mjs.map +1 -1
- package/dist/components/atoms/StatusLabel/StatusLabelBase.d.mts +5 -7
- package/dist/components/atoms/StatusLabel/StatusLabelBase.d.ts +5 -7
- package/dist/components/atoms/StatusLabel/StatusLabelBase.mjs +10 -12
- package/dist/components/atoms/Tag/Tag.d.mts +2 -4
- package/dist/components/atoms/Tag/Tag.d.ts +2 -4
- package/dist/components/atoms/Tag/Tag.mjs +0 -24
- package/dist/components/atoms/index.d.mts +0 -2
- package/dist/components/atoms/index.d.ts +0 -2
- package/dist/components/layout/GridSystem/GridSystem.d.mts +23 -18
- package/dist/components/layout/GridSystem/GridSystem.d.ts +23 -18
- package/dist/components/layout/GridSystem/GridSystem.mjs +7 -5
- package/dist/components/molecules/AgentInput/AgentInput.d.mts +5 -0
- package/dist/components/molecules/AgentInput/AgentInput.d.ts +5 -0
- package/dist/components/molecules/AgentInput/AgentInput.mjs +1 -1
- package/dist/components/molecules/Alert/Alert.d.mts +1 -9
- package/dist/components/molecules/Alert/Alert.d.ts +1 -9
- package/dist/components/molecules/Alert/Alert.mjs +13 -26
- package/dist/components/molecules/ChipGroup/ChipGroup.d.mts +0 -1
- package/dist/components/molecules/ChipGroup/ChipGroup.d.ts +0 -1
- package/dist/components/molecules/ChipGroup/ChipGroup.mjs +1 -6
- package/dist/components/molecules/DateGroup/DateGroup.d.mts +1 -2
- package/dist/components/molecules/DateGroup/DateGroup.d.ts +1 -2
- package/dist/components/molecules/Modal/Modal.d.mts +0 -1
- package/dist/components/molecules/Modal/Modal.d.ts +0 -1
- package/dist/components/molecules/TabBar/TabBar.d.mts +0 -13
- package/dist/components/molecules/TabBar/TabBar.d.ts +0 -13
- package/dist/components/molecules/TabBar/TabBar.mjs +2 -4
- package/dist/components/molecules/TabBar/index.d.mts +1 -1
- package/dist/components/molecules/TabBar/index.d.ts +1 -1
- package/dist/components/molecules/index.d.mts +0 -1
- package/dist/components/molecules/index.d.ts +0 -1
- package/dist/data.js +13 -556
- package/dist/data.js.map +1 -1
- package/dist/index.js +0 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -5
- package/dist/index.mjs.map +1 -1
- package/dist/lib/tokenAliases.d.mts +11 -11
- package/dist/lib/tokenAliases.d.ts +11 -11
- package/dist/lib/tokenAliases.mjs +13 -88
- package/dist/lib/tokenAliases.mjs.map +1 -1
- package/dist/styles/tokens.d.mts +3 -2347
- package/dist/styles/tokens.d.ts +3 -2347
- package/dist/styles/tokens.json +13 -556
- package/dist/styles/tokens.json.mjs +13 -556
- package/dist/styles/tokens.json.mjs.map +1 -1
- package/dist/tokens/index.js +13 -556
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/index.mjs +13 -556
- package/dist/tokens/index.mjs.map +1 -1
- package/dist/tokens/styles/tokens.d.mts +3 -2347
- package/dist/tokens/styles/tokens.d.ts +3 -2347
- package/dist/tokens.css +6 -478
- package/package.json +2 -2
- package/dist/components/atoms/CategoryBadge/CategoryBadge.d.mts +0 -29
- package/dist/components/atoms/CategoryBadge/CategoryBadge.d.ts +0 -29
- package/dist/components/atoms/CategoryBadge/CategoryBadge.mjs +0 -29
- package/dist/components/atoms/CategoryBadge/CategoryBadge.mjs.map +0 -1
- package/dist/components/atoms/CategoryBadge/index.d.mts +0 -2
- package/dist/components/atoms/CategoryBadge/index.d.ts +0 -2
- package/dist/components/atoms/Chip/BooleanChip.d.mts +0 -28
- package/dist/components/atoms/Chip/BooleanChip.d.ts +0 -28
- package/dist/components/atoms/Chip/BooleanChip.mjs +0 -76
- package/dist/components/atoms/Chip/BooleanChip.mjs.map +0 -1
- package/dist/components/atoms/StatusBadge/StatusBadge.d.mts +0 -24
- package/dist/components/atoms/StatusBadge/StatusBadge.d.ts +0 -24
- package/dist/components/atoms/StatusBadge/StatusBadge.mjs +0 -18
- package/dist/components/atoms/StatusBadge/StatusBadge.mjs.map +0 -1
- package/dist/components/atoms/StatusBadge/index.d.mts +0 -2
- package/dist/components/atoms/StatusBadge/index.d.ts +0 -2
- package/dist/components/molecules/PageTitle/PageTitle.d.mts +0 -21
- package/dist/components/molecules/PageTitle/PageTitle.d.ts +0 -21
- package/dist/components/molecules/PageTitle/PageTitle.mjs +0 -77
- package/dist/components/molecules/PageTitle/PageTitle.mjs.map +0 -1
- package/dist/components/molecules/PageTitle/index.d.mts +0 -1
- package/dist/components/molecules/PageTitle/index.d.ts +0 -1
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* Badge variants: `default
|
|
3
|
+
* Badge variants: `default`, the near-black count, and `accent`, the blue highlight (decision 0045).
|
|
4
4
|
*/
|
|
5
|
-
export type BadgeVariant = 'default' | 'accent'
|
|
6
|
-
/**
|
|
7
|
-
* Deprecated Badge variants, each rendered as `accent` until 3.0 (decisions 0029, 0045).
|
|
8
|
-
* @deprecated Use `accent`. For a count of items with a status, use StatusLabel.
|
|
9
|
-
*/
|
|
10
|
-
export type DeprecatedBadgeVariant = 'primary' | 'error' | 'warning' | 'success';
|
|
5
|
+
export type BadgeVariant = 'default' | 'accent';
|
|
11
6
|
export interface BadgeProps {
|
|
12
7
|
/** Content to wrap with the badge */
|
|
13
8
|
children: React.ReactNode;
|
|
@@ -17,11 +12,9 @@ export interface BadgeProps {
|
|
|
17
12
|
max?: number;
|
|
18
13
|
/**
|
|
19
14
|
* Visual variant of the badge. A badge means new or unread items (decision 0045): `accent` is
|
|
20
|
-
* the blue highlight, and `default` the near-black count.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* a count of items with a status uses the status pattern instead ("3 failed" with StatusLabel).
|
|
24
|
-
* All four keep working until they are removed in 3.0.
|
|
15
|
+
* the blue highlight, and `default` the near-black count. A badge's colour alone can't carry a
|
|
16
|
+
* status, so a count of items with a status uses the status pattern instead ("3 failed" with
|
|
17
|
+
* StatusLabel).
|
|
25
18
|
* @default 'default'
|
|
26
19
|
*/
|
|
27
20
|
variant?: BadgeVariant;
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* Badge variants: `default
|
|
3
|
+
* Badge variants: `default`, the near-black count, and `accent`, the blue highlight (decision 0045).
|
|
4
4
|
*/
|
|
5
|
-
export type BadgeVariant = 'default' | 'accent'
|
|
6
|
-
/**
|
|
7
|
-
* Deprecated Badge variants, each rendered as `accent` until 3.0 (decisions 0029, 0045).
|
|
8
|
-
* @deprecated Use `accent`. For a count of items with a status, use StatusLabel.
|
|
9
|
-
*/
|
|
10
|
-
export type DeprecatedBadgeVariant = 'primary' | 'error' | 'warning' | 'success';
|
|
5
|
+
export type BadgeVariant = 'default' | 'accent';
|
|
11
6
|
export interface BadgeProps {
|
|
12
7
|
/** Content to wrap with the badge */
|
|
13
8
|
children: React.ReactNode;
|
|
@@ -17,11 +12,9 @@ export interface BadgeProps {
|
|
|
17
12
|
max?: number;
|
|
18
13
|
/**
|
|
19
14
|
* Visual variant of the badge. A badge means new or unread items (decision 0045): `accent` is
|
|
20
|
-
* the blue highlight, and `default` the near-black count.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* a count of items with a status uses the status pattern instead ("3 failed" with StatusLabel).
|
|
24
|
-
* All four keep working until they are removed in 3.0.
|
|
15
|
+
* the blue highlight, and `default` the near-black count. A badge's colour alone can't carry a
|
|
16
|
+
* status, so a count of items with a status uses the status pattern instead ("3 failed" with
|
|
17
|
+
* StatusLabel).
|
|
25
18
|
* @default 'default'
|
|
26
19
|
*/
|
|
27
20
|
variant?: BadgeVariant;
|
|
@@ -37,14 +37,7 @@ var BadgeIndicator = /*#__PURE__*/styled.span.withConfig({
|
|
|
37
37
|
return props.$isDot ? "".concat(forcedColors, " { forced-color-adjust: none; background-color: CanvasText; }") : "".concat(forcedColors, " { border: ").concat(semantic.border.width.thin, " solid currentColor; }");
|
|
38
38
|
}, function (props) {
|
|
39
39
|
switch (props.$variant) {
|
|
40
|
-
// 'primary', 'error', 'warning' and 'success' are deprecated aliases for 'accent', removed in
|
|
41
|
-
// 3.0: 'primary' (#169), and the status colours, because a badge's colour alone can't carry a
|
|
42
|
-
// status (decision 0045, #263)
|
|
43
40
|
case 'accent':
|
|
44
|
-
case 'primary':
|
|
45
|
-
case 'error':
|
|
46
|
-
case 'warning':
|
|
47
|
-
case 'success':
|
|
48
41
|
return "\n background-color: ".concat(color.fill.accent, ";\n color: ").concat(color.text.inverse, ";\n ");
|
|
49
42
|
default:
|
|
50
43
|
return "\n background-color: ".concat(color.fill.emphasis, ";\n color: ").concat(color.text.inverse, ";\n ");
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Badge } from './Badge.mjs';
|
|
2
|
-
export type { BadgeProps, BadgeVariant
|
|
2
|
+
export type { BadgeProps, BadgeVariant } from './Badge.mjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Badge } from './Badge';
|
|
2
|
-
export type { BadgeProps, BadgeVariant
|
|
2
|
+
export type { BadgeProps, BadgeVariant } from './Badge';
|
|
@@ -1,45 +1,34 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Tokens } from '../../../types/tokens.mjs';
|
|
3
|
-
import type { BackgroundPath } from '../../../lib/tokenAliases.mjs';
|
|
3
|
+
import type { BackgroundPath, BoxRadius, BoxSpace } from '../../../lib/tokenAliases.mjs';
|
|
4
|
+
export type { BoxRadius, BoxSpace };
|
|
4
5
|
/**
|
|
5
6
|
* Box's background: a semantic token's path below `semantic` (decision 0031), such as
|
|
6
|
-
* `surface.base`, `surface.raised` or `color.fill.muted`.
|
|
7
|
+
* `surface.base`, `surface.raised` or `color.fill.muted`. The old `semantic.color.background`
|
|
8
|
+
* keys (`default`, `subtle`, `surface`…) were removed in 3.0 (#304).
|
|
7
9
|
*/
|
|
8
|
-
export type BoxBackground = BackgroundPath
|
|
9
|
-
/**
|
|
10
|
-
* The old `semantic.color.background` keys, removed in 3.0 with those tokens (#99, #304).
|
|
11
|
-
* @deprecated Use the token path: `default` and `page` → `surface.base`; `subtle` → `surface.raised`;
|
|
12
|
-
* `overlay` → `surface.scrim`; `surface` → `color.fill.muted`; `transparent` → `color.fill.none`;
|
|
13
|
-
* `progressTrack` → `color.fill.default`; `hover-overlay`, `active-overlay` and `inverse-overlay` →
|
|
14
|
-
* `color.fill.none-hover`, `none-pressed` and `inverse-none-hover`. The rest become `color.fill.*`
|
|
15
|
-
* with `interactive` → `accent`, `error` → `danger`, `neutral` → `default`, `-subtle` → `-muted`
|
|
16
|
-
* and `-active` → `-pressed`: `interactive-subtle` → `color.fill.accent-muted`, `emphasis` →
|
|
17
|
-
* `color.fill.emphasis`. `emphasis-hover`
|
|
18
|
-
* and `emphasis-active` have no static replacement: a strong fill's states belong to the control
|
|
19
|
-
* that has them (decision 0048).
|
|
20
|
-
*/
|
|
21
|
-
export type DeprecatedBoxBackground = keyof Tokens['semantic']['color']['background'];
|
|
10
|
+
export type BoxBackground = BackgroundPath;
|
|
22
11
|
export interface BoxProps {
|
|
23
12
|
display?: 'block' | 'inline' | 'inline-block' | 'flex' | 'inline-flex' | 'none';
|
|
24
13
|
flexDirection?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
25
14
|
justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
|
|
26
15
|
alignItems?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
|
|
27
16
|
flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
28
|
-
gap?:
|
|
29
|
-
m?:
|
|
30
|
-
mt?:
|
|
31
|
-
mr?:
|
|
32
|
-
mb?:
|
|
33
|
-
ml?:
|
|
34
|
-
mx?:
|
|
35
|
-
my?:
|
|
36
|
-
p?:
|
|
37
|
-
pt?:
|
|
38
|
-
pr?:
|
|
39
|
-
pb?:
|
|
40
|
-
pl?:
|
|
41
|
-
px?:
|
|
42
|
-
py?:
|
|
17
|
+
gap?: BoxSpace;
|
|
18
|
+
m?: BoxSpace;
|
|
19
|
+
mt?: BoxSpace;
|
|
20
|
+
mr?: BoxSpace;
|
|
21
|
+
mb?: BoxSpace;
|
|
22
|
+
ml?: BoxSpace;
|
|
23
|
+
mx?: BoxSpace;
|
|
24
|
+
my?: BoxSpace;
|
|
25
|
+
p?: BoxSpace;
|
|
26
|
+
pt?: BoxSpace;
|
|
27
|
+
pr?: BoxSpace;
|
|
28
|
+
pb?: BoxSpace;
|
|
29
|
+
pl?: BoxSpace;
|
|
30
|
+
px?: BoxSpace;
|
|
31
|
+
py?: BoxSpace;
|
|
43
32
|
width?: string;
|
|
44
33
|
height?: string;
|
|
45
34
|
maxWidth?: string;
|
|
@@ -51,7 +40,7 @@ export interface BoxProps {
|
|
|
51
40
|
right?: string;
|
|
52
41
|
bottom?: string;
|
|
53
42
|
left?: string;
|
|
54
|
-
borderRadius?:
|
|
43
|
+
borderRadius?: BoxRadius;
|
|
55
44
|
border?: keyof Tokens['semantic']['color']['border'];
|
|
56
45
|
borderTop?: keyof Tokens['semantic']['color']['border'];
|
|
57
46
|
borderRight?: keyof Tokens['semantic']['color']['border'];
|
|
@@ -59,8 +48,7 @@ export interface BoxProps {
|
|
|
59
48
|
borderLeft?: keyof Tokens['semantic']['color']['border'];
|
|
60
49
|
/**
|
|
61
50
|
* Background colour, as a semantic token path: `surface.base` (page), `surface.raised` (cards,
|
|
62
|
-
* sheets), `surface.scrim`, or a `color.fill.*` fill such as `color.fill.muted`.
|
|
63
|
-
* background keys (`default`, `subtle`, `surface`…) are deprecated and removed in 3.0.
|
|
51
|
+
* sheets), `surface.scrim`, or a `color.fill.*` fill such as `color.fill.muted`.
|
|
64
52
|
*/
|
|
65
53
|
bg?: BoxBackground;
|
|
66
54
|
color?: keyof Tokens['semantic']['color']['text'];
|
|
@@ -1,45 +1,34 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Tokens } from '../../../types/tokens';
|
|
3
|
-
import type { BackgroundPath } from '../../../lib/tokenAliases';
|
|
3
|
+
import type { BackgroundPath, BoxRadius, BoxSpace } from '../../../lib/tokenAliases';
|
|
4
|
+
export type { BoxRadius, BoxSpace };
|
|
4
5
|
/**
|
|
5
6
|
* Box's background: a semantic token's path below `semantic` (decision 0031), such as
|
|
6
|
-
* `surface.base`, `surface.raised` or `color.fill.muted`.
|
|
7
|
+
* `surface.base`, `surface.raised` or `color.fill.muted`. The old `semantic.color.background`
|
|
8
|
+
* keys (`default`, `subtle`, `surface`…) were removed in 3.0 (#304).
|
|
7
9
|
*/
|
|
8
|
-
export type BoxBackground = BackgroundPath
|
|
9
|
-
/**
|
|
10
|
-
* The old `semantic.color.background` keys, removed in 3.0 with those tokens (#99, #304).
|
|
11
|
-
* @deprecated Use the token path: `default` and `page` → `surface.base`; `subtle` → `surface.raised`;
|
|
12
|
-
* `overlay` → `surface.scrim`; `surface` → `color.fill.muted`; `transparent` → `color.fill.none`;
|
|
13
|
-
* `progressTrack` → `color.fill.default`; `hover-overlay`, `active-overlay` and `inverse-overlay` →
|
|
14
|
-
* `color.fill.none-hover`, `none-pressed` and `inverse-none-hover`. The rest become `color.fill.*`
|
|
15
|
-
* with `interactive` → `accent`, `error` → `danger`, `neutral` → `default`, `-subtle` → `-muted`
|
|
16
|
-
* and `-active` → `-pressed`: `interactive-subtle` → `color.fill.accent-muted`, `emphasis` →
|
|
17
|
-
* `color.fill.emphasis`. `emphasis-hover`
|
|
18
|
-
* and `emphasis-active` have no static replacement: a strong fill's states belong to the control
|
|
19
|
-
* that has them (decision 0048).
|
|
20
|
-
*/
|
|
21
|
-
export type DeprecatedBoxBackground = keyof Tokens['semantic']['color']['background'];
|
|
10
|
+
export type BoxBackground = BackgroundPath;
|
|
22
11
|
export interface BoxProps {
|
|
23
12
|
display?: 'block' | 'inline' | 'inline-block' | 'flex' | 'inline-flex' | 'none';
|
|
24
13
|
flexDirection?: 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
25
14
|
justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
|
|
26
15
|
alignItems?: 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
|
|
27
16
|
flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
28
|
-
gap?:
|
|
29
|
-
m?:
|
|
30
|
-
mt?:
|
|
31
|
-
mr?:
|
|
32
|
-
mb?:
|
|
33
|
-
ml?:
|
|
34
|
-
mx?:
|
|
35
|
-
my?:
|
|
36
|
-
p?:
|
|
37
|
-
pt?:
|
|
38
|
-
pr?:
|
|
39
|
-
pb?:
|
|
40
|
-
pl?:
|
|
41
|
-
px?:
|
|
42
|
-
py?:
|
|
17
|
+
gap?: BoxSpace;
|
|
18
|
+
m?: BoxSpace;
|
|
19
|
+
mt?: BoxSpace;
|
|
20
|
+
mr?: BoxSpace;
|
|
21
|
+
mb?: BoxSpace;
|
|
22
|
+
ml?: BoxSpace;
|
|
23
|
+
mx?: BoxSpace;
|
|
24
|
+
my?: BoxSpace;
|
|
25
|
+
p?: BoxSpace;
|
|
26
|
+
pt?: BoxSpace;
|
|
27
|
+
pr?: BoxSpace;
|
|
28
|
+
pb?: BoxSpace;
|
|
29
|
+
pl?: BoxSpace;
|
|
30
|
+
px?: BoxSpace;
|
|
31
|
+
py?: BoxSpace;
|
|
43
32
|
width?: string;
|
|
44
33
|
height?: string;
|
|
45
34
|
maxWidth?: string;
|
|
@@ -51,7 +40,7 @@ export interface BoxProps {
|
|
|
51
40
|
right?: string;
|
|
52
41
|
bottom?: string;
|
|
53
42
|
left?: string;
|
|
54
|
-
borderRadius?:
|
|
43
|
+
borderRadius?: BoxRadius;
|
|
55
44
|
border?: keyof Tokens['semantic']['color']['border'];
|
|
56
45
|
borderTop?: keyof Tokens['semantic']['color']['border'];
|
|
57
46
|
borderRight?: keyof Tokens['semantic']['color']['border'];
|
|
@@ -59,8 +48,7 @@ export interface BoxProps {
|
|
|
59
48
|
borderLeft?: keyof Tokens['semantic']['color']['border'];
|
|
60
49
|
/**
|
|
61
50
|
* Background colour, as a semantic token path: `surface.base` (page), `surface.raised` (cards,
|
|
62
|
-
* sheets), `surface.scrim`, or a `color.fill.*` fill such as `color.fill.muted`.
|
|
63
|
-
* background keys (`default`, `subtle`, `surface`…) are deprecated and removed in 3.0.
|
|
51
|
+
* sheets), `surface.scrim`, or a `color.fill.*` fill such as `color.fill.muted`.
|
|
64
52
|
*/
|
|
65
53
|
bg?: BoxBackground;
|
|
66
54
|
color?: keyof Tokens['semantic']['color']['text'];
|
|
@@ -4,12 +4,9 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import styled$module, { css } from 'styled-components';
|
|
5
5
|
const styled = styled$module.default || styled$module;
|
|
6
6
|
import tokens from '../../../lib/cssTokens.mjs';
|
|
7
|
-
import { spaceByLayoutKey, radiusByKey, borderColorByKey,
|
|
7
|
+
import { spaceByLayoutKey, radiusByKey, borderColorByKey, backgroundByPath, textColorByKey } from '../../../lib/tokenAliases.mjs';
|
|
8
8
|
import { reducedMotion } from '../../../lib/styleUtils.mjs';
|
|
9
9
|
|
|
10
|
-
var backgroundColor = function backgroundColor(bg) {
|
|
11
|
-
return bg in backgroundByPath ? backgroundByPath[bg] : backgroundByKey[bg];
|
|
12
|
-
};
|
|
13
10
|
var StyledBox = /*#__PURE__*/styled.div.withConfig({
|
|
14
11
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
15
12
|
return !prop.startsWith('$');
|
|
@@ -83,19 +80,19 @@ var StyledBox = /*#__PURE__*/styled.div.withConfig({
|
|
|
83
80
|
}, function (props) {
|
|
84
81
|
return props.$borderRadius && css(templateObject_32 || (templateObject_32 = __makeTemplateObject(["border-radius: ", ";"], ["border-radius: ", ";"])), radiusByKey[props.$borderRadius]);
|
|
85
82
|
}, function (props) {
|
|
86
|
-
return props.$border && css(templateObject_33 || (templateObject_33 = __makeTemplateObject(["border: ", " solid ", ";"], ["border: ", " solid ", ";"])), tokens.semantic.border.width.thin, borderColorByKey[props.$border]);
|
|
83
|
+
return props.$border && borderColorByKey[props.$border] && css(templateObject_33 || (templateObject_33 = __makeTemplateObject(["border: ", " solid ", ";"], ["border: ", " solid ", ";"])), tokens.semantic.border.width.thin, borderColorByKey[props.$border]);
|
|
87
84
|
}, function (props) {
|
|
88
|
-
return props.$borderTop && css(templateObject_34 || (templateObject_34 = __makeTemplateObject(["border-top: ", " solid ", ";"], ["border-top: ", " solid ", ";"])), tokens.semantic.border.width.thin, borderColorByKey[props.$borderTop]);
|
|
85
|
+
return props.$borderTop && borderColorByKey[props.$borderTop] && css(templateObject_34 || (templateObject_34 = __makeTemplateObject(["border-top: ", " solid ", ";"], ["border-top: ", " solid ", ";"])), tokens.semantic.border.width.thin, borderColorByKey[props.$borderTop]);
|
|
89
86
|
}, function (props) {
|
|
90
|
-
return props.$borderRight && css(templateObject_35 || (templateObject_35 = __makeTemplateObject(["border-right: ", " solid ", ";"], ["border-right: ", " solid ", ";"])), tokens.semantic.border.width.thin, borderColorByKey[props.$borderRight]);
|
|
87
|
+
return props.$borderRight && borderColorByKey[props.$borderRight] && css(templateObject_35 || (templateObject_35 = __makeTemplateObject(["border-right: ", " solid ", ";"], ["border-right: ", " solid ", ";"])), tokens.semantic.border.width.thin, borderColorByKey[props.$borderRight]);
|
|
91
88
|
}, function (props) {
|
|
92
|
-
return props.$borderBottom && css(templateObject_36 || (templateObject_36 = __makeTemplateObject(["border-bottom: ", " solid ", ";"], ["border-bottom: ", " solid ", ";"])), tokens.semantic.border.width.thin, borderColorByKey[props.$borderBottom]);
|
|
89
|
+
return props.$borderBottom && borderColorByKey[props.$borderBottom] && css(templateObject_36 || (templateObject_36 = __makeTemplateObject(["border-bottom: ", " solid ", ";"], ["border-bottom: ", " solid ", ";"])), tokens.semantic.border.width.thin, borderColorByKey[props.$borderBottom]);
|
|
93
90
|
}, function (props) {
|
|
94
|
-
return props.$borderLeft && css(templateObject_37 || (templateObject_37 = __makeTemplateObject(["border-left: ", " solid ", ";"], ["border-left: ", " solid ", ";"])), tokens.semantic.border.width.thin, borderColorByKey[props.$borderLeft]);
|
|
91
|
+
return props.$borderLeft && borderColorByKey[props.$borderLeft] && css(templateObject_37 || (templateObject_37 = __makeTemplateObject(["border-left: ", " solid ", ";"], ["border-left: ", " solid ", ";"])), tokens.semantic.border.width.thin, borderColorByKey[props.$borderLeft]);
|
|
95
92
|
}, function (props) {
|
|
96
|
-
return props.$bg && css(templateObject_38 || (templateObject_38 = __makeTemplateObject(["background-color: ", ";"], ["background-color: ", ";"])),
|
|
93
|
+
return props.$bg && backgroundByPath[props.$bg] && css(templateObject_38 || (templateObject_38 = __makeTemplateObject(["background-color: ", ";"], ["background-color: ", ";"])), backgroundByPath[props.$bg]);
|
|
97
94
|
}, function (props) {
|
|
98
|
-
return props.$color && css(templateObject_39 || (templateObject_39 = __makeTemplateObject(["color: ", ";"], ["color: ", ";"])), textColorByKey[props.$color]);
|
|
95
|
+
return props.$color && textColorByKey[props.$color] && css(templateObject_39 || (templateObject_39 = __makeTemplateObject(["color: ", ";"], ["color: ", ";"])), textColorByKey[props.$color]);
|
|
99
96
|
}, function (props) {
|
|
100
97
|
return props.$shadow && css(templateObject_40 || (templateObject_40 = __makeTemplateObject(["box-shadow: ", ";"], ["box-shadow: ", ";"])), tokens.semantic.elevation[props.$shadow]);
|
|
101
98
|
}, function (props) {
|
|
@@ -4,13 +4,10 @@ import { type IconName } from '../Icon/index.mjs';
|
|
|
4
4
|
* Button variants. `accent` is the blue call to action one level above `primary`;
|
|
5
5
|
* use at most one per view (decision 0016).
|
|
6
6
|
*/
|
|
7
|
-
export type ButtonVariant = 'primary' | 'secondary' | 'naked' | 'accent'
|
|
8
|
-
/** @deprecated Use `accent`. `emphasis` will be removed in 3.0. */
|
|
9
|
-
| 'emphasis' | 'danger';
|
|
7
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'naked' | 'accent' | 'danger';
|
|
10
8
|
export interface BaseButtonProps {
|
|
11
9
|
/**
|
|
12
10
|
* Visual style. `accent` is the blue call to action above `primary` (at most one per view).
|
|
13
|
-
* `emphasis` is a deprecated alias for `accent` and will be removed in 3.0.
|
|
14
11
|
* @default 'primary'
|
|
15
12
|
*/
|
|
16
13
|
variant?: ButtonVariant;
|
|
@@ -4,13 +4,10 @@ import { type IconName } from '../Icon';
|
|
|
4
4
|
* Button variants. `accent` is the blue call to action one level above `primary`;
|
|
5
5
|
* use at most one per view (decision 0016).
|
|
6
6
|
*/
|
|
7
|
-
export type ButtonVariant = 'primary' | 'secondary' | 'naked' | 'accent'
|
|
8
|
-
/** @deprecated Use `accent`. `emphasis` will be removed in 3.0. */
|
|
9
|
-
| 'emphasis' | 'danger';
|
|
7
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'naked' | 'accent' | 'danger';
|
|
10
8
|
export interface BaseButtonProps {
|
|
11
9
|
/**
|
|
12
10
|
* Visual style. `accent` is the blue call to action above `primary` (at most one per view).
|
|
13
|
-
* `emphasis` is a deprecated alias for `accent` and will be removed in 3.0.
|
|
14
11
|
* @default 'primary'
|
|
15
12
|
*/
|
|
16
13
|
variant?: ButtonVariant;
|
|
@@ -18,6 +18,7 @@ var control = semantic.size.control;
|
|
|
18
18
|
var baseButtonStyles = "\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: ".concat(tokens.semantic.space[100], ";\n height: max-content;\n cursor: pointer;\n border: none;\n text-decoration: none;\n transition: ").concat(semantic.motion.transition.feedback, ";\n white-space: nowrap;\n user-select: none;\n \n &:focus {\n outline: ").concat(button.focus.outline, ";\n outline-offset: ").concat(semantic.border.focusOffset, ";\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n\n ").concat(forcedColorsEdge, "\n");
|
|
19
19
|
// Dynamic variant styles using component tokens
|
|
20
20
|
var getVariantStyles = function getVariantStyles(_a) {
|
|
21
|
+
var _b;
|
|
21
22
|
var $variant = _a.$variant;
|
|
22
23
|
var variantConfig = {
|
|
23
24
|
primary: {
|
|
@@ -52,15 +53,6 @@ var getVariantStyles = function getVariantStyles(_a) {
|
|
|
52
53
|
disabledBg: button.variants.accent.disabled.backgroundColor,
|
|
53
54
|
disabledText: button.variants.accent.disabled.textColor
|
|
54
55
|
},
|
|
55
|
-
// Deprecated alias for accent; removed in 3.0
|
|
56
|
-
emphasis: {
|
|
57
|
-
bg: button.variants.emphasis.backgroundColor,
|
|
58
|
-
text: button.variants.emphasis.textColor,
|
|
59
|
-
hoverBg: button.variants.emphasis.hover.backgroundColor,
|
|
60
|
-
activeBg: button.variants.emphasis.active.backgroundColor,
|
|
61
|
-
disabledBg: button.variants.emphasis.disabled.backgroundColor,
|
|
62
|
-
disabledText: button.variants.emphasis.disabled.textColor
|
|
63
|
-
},
|
|
64
56
|
danger: {
|
|
65
57
|
bg: button.variants.danger.backgroundColor,
|
|
66
58
|
text: button.variants.danger.textColor,
|
|
@@ -70,7 +62,8 @@ var getVariantStyles = function getVariantStyles(_a) {
|
|
|
70
62
|
disabledText: button.variants.danger.disabled.textColor
|
|
71
63
|
}
|
|
72
64
|
};
|
|
73
|
-
|
|
65
|
+
// A removed variant (such as `emphasis`) passed from plain JavaScript renders as primary
|
|
66
|
+
var config = (_b = variantConfig[$variant]) !== null && _b !== void 0 ? _b : variantConfig.primary;
|
|
74
67
|
return "\n background-color: ".concat(config.bg, ";\n color: ").concat(config.text, ";\n \n &:hover:not(:disabled) {\n background-color: ").concat(config.hoverBg, ";\n }\n\n &:active:not(:disabled) {\n background-color: ").concat(config.activeBg, ";\n }\n\n &:disabled {\n background-color: ").concat(config.disabledBg, ";\n color: ").concat(config.disabledText, ";\n }\n ");
|
|
75
68
|
};
|
|
76
69
|
// Dynamic size styles: font from component tokens, height from size.control (decision 0034)
|
|
@@ -6,17 +6,10 @@ import type { IconName } from '../../../types/icons.mjs';
|
|
|
6
6
|
*/
|
|
7
7
|
export type CategoryDisplayColor = 'olive' | 'periwinkle' | 'rose' | 'magenta' | 'gray';
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* (
|
|
11
|
-
* green are olive.
|
|
12
|
-
* @deprecated Use a CategoryDisplayColor: 'olive', 'periwinkle', 'rose', 'magenta' or 'gray'.
|
|
9
|
+
* Category color options for CategoryLabel: the display colours (decision 0043). The old hue names
|
|
10
|
+
* (blue, purple, pink, yellow, green, red, orange) were removed in 3.0.
|
|
13
11
|
*/
|
|
14
|
-
export type
|
|
15
|
-
/**
|
|
16
|
-
* Category color options for CategoryLabel. The old hue names still work, as aliases of the
|
|
17
|
-
* nearest display colour, until 3.0.
|
|
18
|
-
*/
|
|
19
|
-
export type CategoryColor = CategoryDisplayColor | DeprecatedCategoryColor;
|
|
12
|
+
export type CategoryColor = CategoryDisplayColor;
|
|
20
13
|
/**
|
|
21
14
|
* Visual variant options for CategoryLabel
|
|
22
15
|
*/
|
|
@@ -34,8 +27,7 @@ export interface CategoryLabelProps {
|
|
|
34
27
|
*/
|
|
35
28
|
children: ReactNode;
|
|
36
29
|
/**
|
|
37
|
-
* Category colour: 'olive', 'periwinkle', 'rose', 'magenta' or 'gray'
|
|
38
|
-
* deprecated aliases (decision 0043).
|
|
30
|
+
* Category colour: 'olive', 'periwinkle', 'rose', 'magenta' or 'gray' (decision 0043).
|
|
39
31
|
* @default 'periwinkle'
|
|
40
32
|
*/
|
|
41
33
|
color?: CategoryColor;
|
|
@@ -6,17 +6,10 @@ import type { IconName } from '../../../types/icons';
|
|
|
6
6
|
*/
|
|
7
7
|
export type CategoryDisplayColor = 'olive' | 'periwinkle' | 'rose' | 'magenta' | 'gray';
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* (
|
|
11
|
-
* green are olive.
|
|
12
|
-
* @deprecated Use a CategoryDisplayColor: 'olive', 'periwinkle', 'rose', 'magenta' or 'gray'.
|
|
9
|
+
* Category color options for CategoryLabel: the display colours (decision 0043). The old hue names
|
|
10
|
+
* (blue, purple, pink, yellow, green, red, orange) were removed in 3.0.
|
|
13
11
|
*/
|
|
14
|
-
export type
|
|
15
|
-
/**
|
|
16
|
-
* Category color options for CategoryLabel. The old hue names still work, as aliases of the
|
|
17
|
-
* nearest display colour, until 3.0.
|
|
18
|
-
*/
|
|
19
|
-
export type CategoryColor = CategoryDisplayColor | DeprecatedCategoryColor;
|
|
12
|
+
export type CategoryColor = CategoryDisplayColor;
|
|
20
13
|
/**
|
|
21
14
|
* Visual variant options for CategoryLabel
|
|
22
15
|
*/
|
|
@@ -34,8 +27,7 @@ export interface CategoryLabelProps {
|
|
|
34
27
|
*/
|
|
35
28
|
children: ReactNode;
|
|
36
29
|
/**
|
|
37
|
-
* Category colour: 'olive', 'periwinkle', 'rose', 'magenta' or 'gray'
|
|
38
|
-
* deprecated aliases (decision 0043).
|
|
30
|
+
* Category colour: 'olive', 'periwinkle', 'rose', 'magenta' or 'gray' (decision 0043).
|
|
39
31
|
* @default 'periwinkle'
|
|
40
32
|
*/
|
|
41
33
|
color?: CategoryColor;
|
|
@@ -14,20 +14,7 @@ var category = color.category;
|
|
|
14
14
|
var radius = semantic.radius;
|
|
15
15
|
var space = semantic.space;
|
|
16
16
|
var labelHeight = semantic.size.label;
|
|
17
|
-
var
|
|
18
|
-
olive: 'olive',
|
|
19
|
-
periwinkle: 'periwinkle',
|
|
20
|
-
rose: 'rose',
|
|
21
|
-
magenta: 'magenta',
|
|
22
|
-
gray: 'gray',
|
|
23
|
-
blue: 'periwinkle',
|
|
24
|
-
purple: 'magenta',
|
|
25
|
-
pink: 'rose',
|
|
26
|
-
yellow: 'olive',
|
|
27
|
-
green: 'olive',
|
|
28
|
-
red: 'rose',
|
|
29
|
-
orange: 'rose'
|
|
30
|
-
};
|
|
17
|
+
var displayColors = ['olive', 'periwinkle', 'rose', 'magenta', 'gray'];
|
|
31
18
|
// Text on white or the -muted fill (outlined and minimal), at least 4.5:1 (#115)
|
|
32
19
|
var categoryText = {
|
|
33
20
|
olive: category['olive-text'],
|
|
@@ -140,8 +127,10 @@ var CategoryLabel = function CategoryLabel(_a) {
|
|
|
140
127
|
var iconSize = size === 'medium' ? 'xs' : 'sm';
|
|
141
128
|
// A blank aria-label is no label at all, so it falls back like a missing one
|
|
142
129
|
var accessibleLabel = (ariaLabel === null || ariaLabel === void 0 ? void 0 : ariaLabel.trim()) ? ariaLabel : undefined;
|
|
143
|
-
return jsxs(StyledCategoryLabel
|
|
144
|
-
|
|
130
|
+
return jsxs(StyledCategoryLabel
|
|
131
|
+
// A removed hue name passed from plain JavaScript renders as the default, periwinkle
|
|
132
|
+
, {
|
|
133
|
+
"$color": displayColors.includes(color) ? color : 'periwinkle',
|
|
145
134
|
"$variant": variant,
|
|
146
135
|
"$size": size,
|
|
147
136
|
"data-testid": dataTestId,
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BaseChipProps, ChipVariant
|
|
2
|
+
import { BaseChipProps, ChipVariant } from './shared/types.mjs';
|
|
3
3
|
export interface ChipProps extends BaseChipProps {
|
|
4
4
|
/**
|
|
5
|
-
* Visual style.
|
|
6
|
-
* and `dark` are deprecated and will be removed (decision 0016).
|
|
5
|
+
* Visual style. The static Chip has one, `default` (decision 0016).
|
|
7
6
|
* @default 'default'
|
|
8
7
|
*/
|
|
9
|
-
variant?: ChipVariant
|
|
10
|
-
/**
|
|
11
|
-
* Click handler.
|
|
12
|
-
* @deprecated Removed in 3.0: the static Chip is not interactive. For a clickable action use a
|
|
13
|
-
* Button; for a toggle use `BooleanChip` (`FilterChip` in 3.0).
|
|
14
|
-
*/
|
|
15
|
-
onClick?: () => void;
|
|
8
|
+
variant?: ChipVariant;
|
|
16
9
|
/** Custom ARIA role override */
|
|
17
10
|
role?: string;
|
|
18
11
|
/** Legacy title prop for backward compatibility */
|
|
@@ -22,16 +15,11 @@ export interface ChipProps extends BaseChipProps {
|
|
|
22
15
|
* Chip - a static, non-interactive label for tags, categories and metadata.
|
|
23
16
|
*
|
|
24
17
|
* Chips are classified by job (decision 0016):
|
|
25
|
-
* - Chip: a static label
|
|
26
|
-
* -
|
|
27
|
-
* -
|
|
18
|
+
* - Chip: a static label
|
|
19
|
+
* - FilterChip: toggles a filter on and off
|
|
20
|
+
* - InputChip: a removable value, such as an applied filter
|
|
21
|
+
* - SuggestionChip: fills the agent input with a suggestion
|
|
28
22
|
*
|
|
29
|
-
*
|
|
30
|
-
* deprecated and will be removed in 3.0.
|
|
23
|
+
* For a clickable action, use a Button.
|
|
31
24
|
*/
|
|
32
25
|
export declare const Chip: React.FC<ChipProps>;
|
|
33
|
-
export interface LegacyChipProps {
|
|
34
|
-
title: string;
|
|
35
|
-
variant?: LegacyVariant;
|
|
36
|
-
}
|
|
37
|
-
export declare const LegacyChip: React.FC<LegacyChipProps>;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BaseChipProps, ChipVariant
|
|
2
|
+
import { BaseChipProps, ChipVariant } from './shared/types';
|
|
3
3
|
export interface ChipProps extends BaseChipProps {
|
|
4
4
|
/**
|
|
5
|
-
* Visual style.
|
|
6
|
-
* and `dark` are deprecated and will be removed (decision 0016).
|
|
5
|
+
* Visual style. The static Chip has one, `default` (decision 0016).
|
|
7
6
|
* @default 'default'
|
|
8
7
|
*/
|
|
9
|
-
variant?: ChipVariant
|
|
10
|
-
/**
|
|
11
|
-
* Click handler.
|
|
12
|
-
* @deprecated Removed in 3.0: the static Chip is not interactive. For a clickable action use a
|
|
13
|
-
* Button; for a toggle use `BooleanChip` (`FilterChip` in 3.0).
|
|
14
|
-
*/
|
|
15
|
-
onClick?: () => void;
|
|
8
|
+
variant?: ChipVariant;
|
|
16
9
|
/** Custom ARIA role override */
|
|
17
10
|
role?: string;
|
|
18
11
|
/** Legacy title prop for backward compatibility */
|
|
@@ -22,16 +15,11 @@ export interface ChipProps extends BaseChipProps {
|
|
|
22
15
|
* Chip - a static, non-interactive label for tags, categories and metadata.
|
|
23
16
|
*
|
|
24
17
|
* Chips are classified by job (decision 0016):
|
|
25
|
-
* - Chip: a static label
|
|
26
|
-
* -
|
|
27
|
-
* -
|
|
18
|
+
* - Chip: a static label
|
|
19
|
+
* - FilterChip: toggles a filter on and off
|
|
20
|
+
* - InputChip: a removable value, such as an applied filter
|
|
21
|
+
* - SuggestionChip: fills the agent input with a suggestion
|
|
28
22
|
*
|
|
29
|
-
*
|
|
30
|
-
* deprecated and will be removed in 3.0.
|
|
23
|
+
* For a clickable action, use a Button.
|
|
31
24
|
*/
|
|
32
25
|
export declare const Chip: React.FC<ChipProps>;
|
|
33
|
-
export interface LegacyChipProps {
|
|
34
|
-
title: string;
|
|
35
|
-
variant?: LegacyVariant;
|
|
36
|
-
}
|
|
37
|
-
export declare const LegacyChip: React.FC<LegacyChipProps>;
|