@common-origin/design-system 2.23.0 → 3.1.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 +2219 -1026
- 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/Tooltip/Tooltip.d.mts +41 -0
- package/dist/components/atoms/Tooltip/Tooltip.d.ts +41 -0
- package/dist/components/atoms/Tooltip/Tooltip.mjs +204 -0
- package/dist/components/atoms/Tooltip/Tooltip.mjs.map +1 -0
- package/dist/components/atoms/Tooltip/index.d.mts +2 -0
- package/dist/components/atoms/Tooltip/index.d.ts +2 -0
- package/dist/components/atoms/index.d.mts +1 -2
- package/dist/components/atoms/index.d.ts +1 -2
- package/dist/components/index.d.mts +1 -0
- package/dist/components/index.d.ts +1 -0
- 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/ActionSheet/ActionSheet.mjs +1 -0
- 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 +14 -27
- 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 +2 -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/List/List.d.mts +2 -0
- package/dist/components/molecules/List/List.d.ts +2 -0
- package/dist/components/molecules/List/ListItem.d.mts +2 -0
- package/dist/components/molecules/List/ListItem.d.ts +2 -0
- package/dist/components/molecules/List/ListItem.mjs +5 -5
- package/dist/components/molecules/Menu/Menu.d.mts +117 -0
- package/dist/components/molecules/Menu/Menu.d.ts +117 -0
- package/dist/components/molecules/Menu/Menu.mjs +473 -0
- package/dist/components/molecules/Menu/Menu.mjs.map +1 -0
- package/dist/components/molecules/Menu/index.d.mts +2 -0
- package/dist/components/molecules/Menu/index.d.ts +2 -0
- package/dist/components/molecules/Modal/Modal.d.mts +0 -1
- package/dist/components/molecules/Modal/Modal.d.ts +0 -1
- package/dist/components/molecules/SearchField/SearchField.mjs +2 -0
- package/dist/components/molecules/SidebarNavItem/SidebarNavContext.d.mts +13 -0
- package/dist/components/molecules/SidebarNavItem/SidebarNavContext.d.ts +13 -0
- package/dist/components/molecules/SidebarNavItem/SidebarNavContext.mjs +13 -0
- package/dist/components/molecules/SidebarNavItem/SidebarNavContext.mjs.map +1 -0
- package/dist/components/molecules/SidebarNavItem/SidebarNavItem.d.mts +43 -0
- package/dist/components/molecules/SidebarNavItem/SidebarNavItem.d.ts +43 -0
- package/dist/components/molecules/SidebarNavItem/SidebarNavItem.mjs +148 -0
- package/dist/components/molecules/SidebarNavItem/SidebarNavItem.mjs.map +1 -0
- package/dist/components/molecules/SidebarNavItem/index.d.mts +2 -0
- package/dist/components/molecules/SidebarNavItem/index.d.ts +2 -0
- package/dist/components/molecules/SidebarNavSection/SidebarNavSection.d.mts +36 -0
- package/dist/components/molecules/SidebarNavSection/SidebarNavSection.d.ts +36 -0
- package/dist/components/molecules/SidebarNavSection/SidebarNavSection.mjs +188 -0
- package/dist/components/molecules/SidebarNavSection/SidebarNavSection.mjs.map +1 -0
- package/dist/components/molecules/SidebarNavSection/index.d.mts +2 -0
- package/dist/components/molecules/SidebarNavSection/index.d.ts +2 -0
- 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/TransactionListItem/TransactionListItem.mjs +1 -1
- package/dist/components/molecules/WorkspaceSwitcher/WorkspaceSwitcher.d.mts +39 -0
- package/dist/components/molecules/WorkspaceSwitcher/WorkspaceSwitcher.d.ts +39 -0
- package/dist/components/molecules/WorkspaceSwitcher/WorkspaceSwitcher.mjs +131 -0
- package/dist/components/molecules/WorkspaceSwitcher/WorkspaceSwitcher.mjs.map +1 -0
- package/dist/components/molecules/WorkspaceSwitcher/index.d.mts +2 -0
- package/dist/components/molecules/WorkspaceSwitcher/index.d.ts +2 -0
- package/dist/components/molecules/index.d.mts +4 -1
- package/dist/components/molecules/index.d.ts +4 -1
- package/dist/components/organisms/SidebarNav/SidebarNav.d.mts +52 -0
- package/dist/components/organisms/SidebarNav/SidebarNav.d.ts +52 -0
- package/dist/components/organisms/SidebarNav/SidebarNav.mjs +235 -0
- package/dist/components/organisms/SidebarNav/SidebarNav.mjs.map +1 -0
- package/dist/components/organisms/SidebarNav/index.d.mts +2 -0
- package/dist/components/organisms/SidebarNav/index.d.ts +2 -0
- package/dist/components/organisms/index.d.mts +1 -0
- package/dist/components/organisms/index.d.ts +1 -0
- package/dist/data.js +72 -565
- package/dist/data.js.map +1 -1
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -5
- package/dist/index.mjs.map +1 -1
- package/dist/lib/floatingPosition.d.mts +43 -0
- package/dist/lib/floatingPosition.d.ts +43 -0
- package/dist/lib/floatingPosition.mjs +86 -0
- package/dist/lib/floatingPosition.mjs.map +1 -0
- package/dist/lib/keyboardFocus.d.mts +6 -0
- package/dist/lib/keyboardFocus.d.ts +6 -0
- package/dist/lib/keyboardFocus.mjs +17 -0
- package/dist/lib/keyboardFocus.mjs.map +1 -0
- 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/lib/useFloatingLayer.d.mts +25 -0
- package/dist/lib/useFloatingLayer.d.ts +25 -0
- package/dist/lib/useFloatingLayer.mjs +86 -0
- package/dist/lib/useFloatingLayer.mjs.map +1 -0
- package/dist/styles/icons.json +30 -1
- package/dist/styles/icons.json.mjs +34 -3
- package/dist/styles/icons.json.mjs.map +1 -1
- package/dist/styles/tokens.d.mts +179 -2485
- package/dist/styles/tokens.d.ts +179 -2485
- package/dist/styles/tokens.json +39 -563
- package/dist/styles/tokens.json.mjs +39 -563
- package/dist/styles/tokens.json.mjs.map +1 -1
- package/dist/tokens/index.js +39 -563
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/index.mjs +39 -563
- package/dist/tokens/index.mjs.map +1 -1
- package/dist/tokens/styles/tokens.d.mts +179 -2485
- package/dist/tokens/styles/tokens.d.ts +179 -2485
- package/dist/tokens.css +41 -493
- package/dist/types/icons.d.mts +1 -1
- package/dist/types/icons.d.ts +1 -1
- package/dist/types/icons.mjs.map +1 -1
- 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,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* How DateFormatter shows a date. `'relative'
|
|
4
|
-
* `'smart'`, so use `'smart'`. It keeps working until it is removed in 3.0 (#82).
|
|
3
|
+
* How DateFormatter shows a date. `'relative'`, an alias of `'smart'`, was removed in 3.0 (#82).
|
|
5
4
|
*/
|
|
6
|
-
export type DateFormatMode = 'absolute' | '
|
|
5
|
+
export type DateFormatMode = 'absolute' | 'smart';
|
|
7
6
|
export interface DateFormatterProps {
|
|
8
7
|
/** ISO date string to format */
|
|
9
8
|
dateString: string;
|
|
@@ -12,8 +11,6 @@ export interface DateFormatterProps {
|
|
|
12
11
|
/**
|
|
13
12
|
* `'absolute'` always uses `formatString`. `'smart'` shows "Today", "Yesterday" or the day name
|
|
14
13
|
* for dates this week, and formats older dates with `formatString`.
|
|
15
|
-
* `'relative'` is deprecated: it behaves exactly like `'smart'`, so use `'smart'`. It keeps
|
|
16
|
-
* working until it is removed in 3.0 (#82).
|
|
17
14
|
* @default 'absolute'
|
|
18
15
|
*/
|
|
19
16
|
mode?: DateFormatMode;
|
|
@@ -41,7 +41,6 @@ var DateFormatter = function DateFormatter(_a) {
|
|
|
41
41
|
var date = parseISO(dateString);
|
|
42
42
|
var displayText;
|
|
43
43
|
switch (mode) {
|
|
44
|
-
case 'relative': // Deprecated alias for 'smart', removed in 3.0 (#82)
|
|
45
44
|
case 'smart':
|
|
46
45
|
// Today, Yesterday or the day name for recent dates; formatted for older ones
|
|
47
46
|
displayText = formatDateSmart(date, formatString);
|
|
@@ -19,11 +19,8 @@ import { StatusLabelBase } from './StatusLabelBase.mjs';
|
|
|
19
19
|
* <StatusLabel status="pending" label="Awaiting approval" size="small" />
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
-
// showIcon comes last so no caller (for example plain JavaScript) can hide the icon
|
|
23
22
|
var StatusLabel = function StatusLabel(props) {
|
|
24
|
-
return jsx(StatusLabelBase, __assign({}, props
|
|
25
|
-
showIcon: true
|
|
26
|
-
}));
|
|
23
|
+
return jsx(StatusLabelBase, __assign({}, props));
|
|
27
24
|
};
|
|
28
25
|
StatusLabel.displayName = 'StatusLabel';
|
|
29
26
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusLabel.mjs","sources":["../../../../src/components/atoms/StatusLabel/StatusLabel.tsx"],"sourcesContent":["import React from 'react'\nimport { StatusLabelBase, type StatusLabelProps } from './StatusLabelBase'\n\nexport type { StatusLabelProps, StatusType, StatusSize } from './StatusLabelBase'\n\n/**\n * StatusLabel conveys the status of something, such as a transaction or task (decision 0018).\n *\n * Uses only the status colour tokens and always shows its text, so status is never conveyed by\n * colour alone (decision 0045). Medium shows the status icon. Small shows the status shape for\n * completed, failed and processing, and text only for the neutral pending, scheduled and\n * cancelled, so keep the label visible. Not interactive. Announces changes politely to screen\n * readers.\n *\n * @example\n * ```tsx\n * <StatusLabel status=\"completed\" />\n *\n * <StatusLabel status=\"pending\" label=\"Awaiting approval\" size=\"small\" />\n * ```\n */\
|
|
1
|
+
{"version":3,"file":"StatusLabel.mjs","sources":["../../../../src/components/atoms/StatusLabel/StatusLabel.tsx"],"sourcesContent":["import React from 'react'\nimport { StatusLabelBase, type StatusLabelProps } from './StatusLabelBase'\n\nexport type { StatusLabelProps, StatusType, StatusSize } from './StatusLabelBase'\n\n/**\n * StatusLabel conveys the status of something, such as a transaction or task (decision 0018).\n *\n * Uses only the status colour tokens and always shows its text, so status is never conveyed by\n * colour alone (decision 0045). Medium shows the status icon. Small shows the status shape for\n * completed, failed and processing, and text only for the neutral pending, scheduled and\n * cancelled, so keep the label visible. Not interactive. Announces changes politely to screen\n * readers.\n *\n * @example\n * ```tsx\n * <StatusLabel status=\"completed\" />\n *\n * <StatusLabel status=\"pending\" label=\"Awaiting approval\" size=\"small\" />\n * ```\n */\nexport const StatusLabel: React.FC<StatusLabelProps> = (props) => <StatusLabelBase {...props} />\n\nStatusLabel.displayName = 'StatusLabel'\n"],"names":["StatusLabel","props","_jsx","StatusLabelBase","__assign","displayName"],"mappings":";;;;;AAKA;;;;;;;;;;;;;;;AAeG;IACUA,WAAW,GAA+B,SAA1CA,WAAWA,CAAgCC,KAAK,EAAA;EAAK,OAAAC,GAAA,CAACC,eAAe,EAAKC,QAAA,CAAA,EAAA,EAAAH,KAAK,CAAI,CAAA,CAAA;AAA9B,EAA8B;AAEhGD,WAAW,CAACK,WAAW,GAAG,aAAa;;;;"}
|
|
@@ -8,7 +8,7 @@ export type StatusType = 'pending' | 'completed' | 'failed' | 'cancelled' | 'pro
|
|
|
8
8
|
*/
|
|
9
9
|
export type StatusSize = 'small' | 'medium';
|
|
10
10
|
/**
|
|
11
|
-
* Props
|
|
11
|
+
* Props for StatusLabel
|
|
12
12
|
*/
|
|
13
13
|
export interface StatusLabelProps {
|
|
14
14
|
/**
|
|
@@ -40,10 +40,8 @@ export interface StatusLabelProps {
|
|
|
40
40
|
'aria-label'?: string;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
43
|
+
* StatusLabel's implementation. Internal: not exported from the package. It always shows the status
|
|
44
|
+
* icon at the medium size, and at the small size the shape for coloured statuses (decisions 0018,
|
|
45
|
+
* 0045).
|
|
46
46
|
*/
|
|
47
|
-
export declare const StatusLabelBase: React.FC<StatusLabelProps
|
|
48
|
-
showIcon?: boolean;
|
|
49
|
-
}>;
|
|
47
|
+
export declare const StatusLabelBase: React.FC<StatusLabelProps>;
|
|
@@ -8,7 +8,7 @@ export type StatusType = 'pending' | 'completed' | 'failed' | 'cancelled' | 'pro
|
|
|
8
8
|
*/
|
|
9
9
|
export type StatusSize = 'small' | 'medium';
|
|
10
10
|
/**
|
|
11
|
-
* Props
|
|
11
|
+
* Props for StatusLabel
|
|
12
12
|
*/
|
|
13
13
|
export interface StatusLabelProps {
|
|
14
14
|
/**
|
|
@@ -40,10 +40,8 @@ export interface StatusLabelProps {
|
|
|
40
40
|
'aria-label'?: string;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
43
|
+
* StatusLabel's implementation. Internal: not exported from the package. It always shows the status
|
|
44
|
+
* icon at the medium size, and at the small size the shape for coloured statuses (decisions 0018,
|
|
45
|
+
* 0045).
|
|
46
46
|
*/
|
|
47
|
-
export declare const StatusLabelBase: React.FC<StatusLabelProps
|
|
48
|
-
showIcon?: boolean;
|
|
49
|
-
}>;
|
|
47
|
+
export declare const StatusLabelBase: React.FC<StatusLabelProps>;
|
|
@@ -112,24 +112,22 @@ var VisibleContent = /*#__PURE__*/styled.span.withConfig({
|
|
|
112
112
|
componentId: "sc-1ye9xz5-2"
|
|
113
113
|
})(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: contents;\n"], ["\n display: contents;\n"
|
|
114
114
|
/**
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
115
|
+
* StatusLabel's implementation. Internal: not exported from the package. It always shows the status
|
|
116
|
+
* icon at the medium size, and at the small size the shape for coloured statuses (decisions 0018,
|
|
117
|
+
* 0045).
|
|
118
118
|
*/])));
|
|
119
119
|
/**
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
120
|
+
* StatusLabel's implementation. Internal: not exported from the package. It always shows the status
|
|
121
|
+
* icon at the medium size, and at the small size the shape for coloured statuses (decisions 0018,
|
|
122
|
+
* 0045).
|
|
123
123
|
*/
|
|
124
124
|
var StatusLabelBase = function StatusLabelBase(_a) {
|
|
125
125
|
var status = _a.status,
|
|
126
126
|
label = _a.label,
|
|
127
127
|
_b = _a.size,
|
|
128
128
|
size = _b === void 0 ? 'medium' : _b,
|
|
129
|
-
_c = _a.
|
|
130
|
-
|
|
131
|
-
_d = _a.liveRegion,
|
|
132
|
-
liveRegion = _d === void 0 ? true : _d,
|
|
129
|
+
_c = _a.liveRegion,
|
|
130
|
+
liveRegion = _c === void 0 ? true : _c,
|
|
133
131
|
dataTestId = _a["data-testid"],
|
|
134
132
|
ariaLabel = _a["aria-label"];
|
|
135
133
|
var statusConfig = getStatusConfig(status);
|
|
@@ -147,11 +145,11 @@ var StatusLabelBase = function StatusLabelBase(_a) {
|
|
|
147
145
|
"data-testid": dataTestId,
|
|
148
146
|
children: [jsxs(VisibleContent, {
|
|
149
147
|
"aria-hidden": accessibleLabel ? 'true' : undefined,
|
|
150
|
-
children: [
|
|
148
|
+
children: [size === 'medium' && jsx(Icon, {
|
|
151
149
|
name: statusConfig.icon,
|
|
152
150
|
size: sizeStyles.iconSize,
|
|
153
151
|
iconColor: "inherit"
|
|
154
|
-
}),
|
|
152
|
+
}), size === 'small' && statusConfig.shape && jsx(StatusShape, {
|
|
155
153
|
shape: statusConfig.shape
|
|
156
154
|
}), displayLabel, jsxs(ScreenReaderOnly, {
|
|
157
155
|
children: [status, " status"]
|
|
@@ -6,12 +6,10 @@ export interface TagProps {
|
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
/**
|
|
8
8
|
* Visual variant. Tag is neutral metadata: use `default`, or `emphasis` (near-black) to make a
|
|
9
|
-
* tag stand out.
|
|
10
|
-
* `StatusLabel`), and so is `interactive` (a blue fill on a static label is decoration).
|
|
11
|
-
* They keep working until they are removed in 3.0 (decision 0029).
|
|
9
|
+
* tag stand out. For a status, use `StatusLabel` (decision 0029).
|
|
12
10
|
* @default 'default'
|
|
13
11
|
*/
|
|
14
|
-
variant?: 'default' | '
|
|
12
|
+
variant?: 'default' | 'emphasis';
|
|
15
13
|
/**
|
|
16
14
|
* Whether to show a border
|
|
17
15
|
* @default true
|
|
@@ -6,12 +6,10 @@ export interface TagProps {
|
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
/**
|
|
8
8
|
* Visual variant. Tag is neutral metadata: use `default`, or `emphasis` (near-black) to make a
|
|
9
|
-
* tag stand out.
|
|
10
|
-
* `StatusLabel`), and so is `interactive` (a blue fill on a static label is decoration).
|
|
11
|
-
* They keep working until they are removed in 3.0 (decision 0029).
|
|
9
|
+
* tag stand out. For a status, use `StatusLabel` (decision 0029).
|
|
12
10
|
* @default 'default'
|
|
13
11
|
*/
|
|
14
|
-
variant?: 'default' | '
|
|
12
|
+
variant?: 'default' | 'emphasis';
|
|
15
13
|
/**
|
|
16
14
|
* Whether to show a border
|
|
17
15
|
* @default true
|
|
@@ -32,14 +32,6 @@ var StyledTag = /*#__PURE__*/styled.span.withConfig({
|
|
|
32
32
|
}, label.typography.small, label.fontWeight, function (_a) {
|
|
33
33
|
var $variant = _a.$variant;
|
|
34
34
|
switch ($variant) {
|
|
35
|
-
case 'interactive':
|
|
36
|
-
return color.fill['accent-muted'];
|
|
37
|
-
case 'success':
|
|
38
|
-
return color.fill['success-muted'];
|
|
39
|
-
case 'warning':
|
|
40
|
-
return color.fill['warning-muted'];
|
|
41
|
-
case 'error':
|
|
42
|
-
return color.fill['danger-muted'];
|
|
43
35
|
case 'emphasis':
|
|
44
36
|
return color.fill.emphasis;
|
|
45
37
|
default:
|
|
@@ -48,14 +40,6 @@ var StyledTag = /*#__PURE__*/styled.span.withConfig({
|
|
|
48
40
|
}, function (_a) {
|
|
49
41
|
var $variant = _a.$variant;
|
|
50
42
|
switch ($variant) {
|
|
51
|
-
case 'interactive':
|
|
52
|
-
return color.text.accent;
|
|
53
|
-
case 'success':
|
|
54
|
-
return color.text.success;
|
|
55
|
-
case 'warning':
|
|
56
|
-
return color.text.warning;
|
|
57
|
-
case 'error':
|
|
58
|
-
return color.text.danger;
|
|
59
43
|
case 'emphasis':
|
|
60
44
|
return color.text.inverse;
|
|
61
45
|
default:
|
|
@@ -66,14 +50,6 @@ var StyledTag = /*#__PURE__*/styled.span.withConfig({
|
|
|
66
50
|
$border = _a.$border;
|
|
67
51
|
if (!$border) return 'none';
|
|
68
52
|
switch ($variant) {
|
|
69
|
-
case 'interactive':
|
|
70
|
-
return "".concat(semantic.border.width.thin, " solid ").concat(color.border.accent);
|
|
71
|
-
case 'success':
|
|
72
|
-
return "".concat(semantic.border.width.thin, " solid ").concat(color.border.success);
|
|
73
|
-
case 'warning':
|
|
74
|
-
return "".concat(semantic.border.width.thin, " solid ").concat(color.border.warning);
|
|
75
|
-
case 'error':
|
|
76
|
-
return "".concat(semantic.border.width.thin, " solid ").concat(color.border.danger);
|
|
77
53
|
case 'emphasis':
|
|
78
54
|
return "".concat(semantic.border.width.thin, " solid ").concat(color.fill.emphasis);
|
|
79
55
|
default:
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FloatingAlign, type FloatingSide } from '../../../lib/floatingPosition.mjs';
|
|
3
|
+
export type TooltipSide = FloatingSide;
|
|
4
|
+
export type TooltipAlign = FloatingAlign;
|
|
5
|
+
export interface TooltipProps {
|
|
6
|
+
/** The tooltip's text. In `label` mode it repeats the trigger's existing accessible name. */
|
|
7
|
+
text: string;
|
|
8
|
+
/**
|
|
9
|
+
* `label` (default) shows the name the trigger already has, such as an IconButton's
|
|
10
|
+
* `aria-label`, and is hidden from assistive technology so the name isn't announced twice.
|
|
11
|
+
* `description` adds non-essential help, linked to the trigger with `aria-describedby`. Hover
|
|
12
|
+
* text can't be reached on touch screens, so anything a user needs must be visible text.
|
|
13
|
+
* @default 'label'
|
|
14
|
+
*/
|
|
15
|
+
kind?: 'label' | 'description';
|
|
16
|
+
/**
|
|
17
|
+
* The side of the trigger it opens on. It flips to the opposite side when there's no room.
|
|
18
|
+
* @default 'top'
|
|
19
|
+
*/
|
|
20
|
+
side?: TooltipSide;
|
|
21
|
+
/**
|
|
22
|
+
* Where it lines up along the trigger's edge.
|
|
23
|
+
* @default 'center'
|
|
24
|
+
*/
|
|
25
|
+
align?: TooltipAlign;
|
|
26
|
+
/** One focusable element: the trigger */
|
|
27
|
+
children: React.ReactElement;
|
|
28
|
+
/** Test identifier for the tooltip bubble */
|
|
29
|
+
'data-testid'?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A short label or hint that appears beside a control on hover or keyboard focus (#326).
|
|
33
|
+
*
|
|
34
|
+
* Opens after `motion.delay.hint` of hover, at once on keyboard focus, and at once when the pointer
|
|
35
|
+
* moves on from another tooltip. Stays open while the pointer is over it; closes on pointer leave,
|
|
36
|
+
* blur, scroll and Escape. Doesn't open on touch.
|
|
37
|
+
*/
|
|
38
|
+
export declare const Tooltip: {
|
|
39
|
+
({ text, kind, side, align, children, "data-testid": dataTestId, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
displayName: string;
|
|
41
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FloatingAlign, type FloatingSide } from '../../../lib/floatingPosition';
|
|
3
|
+
export type TooltipSide = FloatingSide;
|
|
4
|
+
export type TooltipAlign = FloatingAlign;
|
|
5
|
+
export interface TooltipProps {
|
|
6
|
+
/** The tooltip's text. In `label` mode it repeats the trigger's existing accessible name. */
|
|
7
|
+
text: string;
|
|
8
|
+
/**
|
|
9
|
+
* `label` (default) shows the name the trigger already has, such as an IconButton's
|
|
10
|
+
* `aria-label`, and is hidden from assistive technology so the name isn't announced twice.
|
|
11
|
+
* `description` adds non-essential help, linked to the trigger with `aria-describedby`. Hover
|
|
12
|
+
* text can't be reached on touch screens, so anything a user needs must be visible text.
|
|
13
|
+
* @default 'label'
|
|
14
|
+
*/
|
|
15
|
+
kind?: 'label' | 'description';
|
|
16
|
+
/**
|
|
17
|
+
* The side of the trigger it opens on. It flips to the opposite side when there's no room.
|
|
18
|
+
* @default 'top'
|
|
19
|
+
*/
|
|
20
|
+
side?: TooltipSide;
|
|
21
|
+
/**
|
|
22
|
+
* Where it lines up along the trigger's edge.
|
|
23
|
+
* @default 'center'
|
|
24
|
+
*/
|
|
25
|
+
align?: TooltipAlign;
|
|
26
|
+
/** One focusable element: the trigger */
|
|
27
|
+
children: React.ReactElement;
|
|
28
|
+
/** Test identifier for the tooltip bubble */
|
|
29
|
+
'data-testid'?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A short label or hint that appears beside a control on hover or keyboard focus (#326).
|
|
33
|
+
*
|
|
34
|
+
* Opens after `motion.delay.hint` of hover, at once on keyboard focus, and at once when the pointer
|
|
35
|
+
* moves on from another tooltip. Stays open while the pointer is over it; closes on pointer leave,
|
|
36
|
+
* blur, scroll and Escape. Doesn't open on touch.
|
|
37
|
+
*/
|
|
38
|
+
export declare const Tooltip: {
|
|
39
|
+
({ text, kind, side, align, children, "data-testid": dataTestId, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
displayName: string;
|
|
41
|
+
};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { __makeTemplateObject } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import React, { useId, useRef, useState, useCallback, useEffect } from 'react';
|
|
5
|
+
import styled$module, { keyframes, css } from 'styled-components';
|
|
6
|
+
const styled = styled$module.default || styled$module;
|
|
7
|
+
import tokens from '../../../lib/cssTokens.mjs';
|
|
8
|
+
import tokensJson from '../../../styles/tokens.json.mjs';
|
|
9
|
+
import { exitAnimation, forcedColorsEdge, visuallyHidden } from '../../../lib/styleUtils.mjs';
|
|
10
|
+
import { usePresence } from '../../../lib/usePresence.mjs';
|
|
11
|
+
import { useFloatingLayer } from '../../../lib/useFloatingLayer.mjs';
|
|
12
|
+
import { isKeyboardFocus } from '../../../lib/keyboardFocus.mjs';
|
|
13
|
+
|
|
14
|
+
var semantic = tokens.semantic;
|
|
15
|
+
var motion = tokensJson.semantic.motion;
|
|
16
|
+
// How long the pointer rests before the tooltip opens (#326)
|
|
17
|
+
var HINT_DELAY_MS = parseInt(motion.delay.hint, 10);
|
|
18
|
+
// Moving to another trigger within this window opens its tooltip at once, so a rail feels immediate
|
|
19
|
+
var SKIP_DELAY_MS = parseInt(motion.duration.slow, 10);
|
|
20
|
+
// The grace period for the pointer to cross from the trigger onto the tooltip (WCAG 1.4.13)
|
|
21
|
+
var CLOSE_GRACE_MS = parseInt(motion.duration.fast, 10);
|
|
22
|
+
// Shared by every Tooltip: only one is open at a time, and the next one opens at once while one
|
|
23
|
+
// is open or within the skip-delay window after it closed
|
|
24
|
+
var lastClosedAt = 0;
|
|
25
|
+
var active = null;
|
|
26
|
+
var fadeIn = keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n from { opacity: 0; }\n"], ["\n from { opacity: 0; }\n"
|
|
27
|
+
// A fade, so it needs no reduced-motion fallback (0015). Entrances decelerate (0037).
|
|
28
|
+
])));
|
|
29
|
+
// A fade, so it needs no reduced-motion fallback (0015). Entrances decelerate (0037).
|
|
30
|
+
var Bubble = /*#__PURE__*/styled.div.withConfig({
|
|
31
|
+
shouldForwardProp: function shouldForwardProp(prop) {
|
|
32
|
+
return !prop.startsWith('$');
|
|
33
|
+
},
|
|
34
|
+
displayName: "Tooltip__Bubble",
|
|
35
|
+
componentId: "sc-ajez94-0"
|
|
36
|
+
})(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n /* Reset the popover defaults: it's placed with top and left */\n position: fixed;\n inset: auto;\n top: 0;\n left: 0;\n margin: 0;\n overflow: visible;\n box-sizing: border-box;\n max-width: ", ";\n padding: ", " ", ";\n border: none;\n border-radius: ", ";\n background-color: ", ";\n color: ", ";\n font: ", ";\n overflow-wrap: break-word;\n pointer-events: auto;\n animation: ", " ", " ", "\n ", ";\n\n ", "\n"], ["\n /* Reset the popover defaults: it's placed with top and left */\n position: fixed;\n inset: auto;\n top: 0;\n left: 0;\n margin: 0;\n overflow: visible;\n box-sizing: border-box;\n max-width: ", ";\n padding: ", " ", ";\n border: none;\n border-radius: ", ";\n background-color: ", ";\n color: ", ";\n font: ", ";\n overflow-wrap: break-word;\n pointer-events: auto;\n animation: ", " ", " ", "\n ", ";\n\n ", "\n"])), semantic.size[7500], semantic.space.inset.xs, semantic.space.inset.sm, semantic.radius.sm, semantic.color.fill.inverse, semantic.color.text.inverse, semantic.typography.small, fadeIn, semantic.motion.duration.fast, semantic.motion.easing.decelerate, function (_a) {
|
|
37
|
+
var $exiting = _a.$exiting;
|
|
38
|
+
return $exiting ? exitAnimation : css(templateObject_2 || (templateObject_2 = __makeTemplateObject([""], [""])));
|
|
39
|
+
}, forcedColorsEdge);
|
|
40
|
+
var Description = /*#__PURE__*/styled.span.withConfig({
|
|
41
|
+
displayName: "Tooltip__Description",
|
|
42
|
+
componentId: "sc-ajez94-1"
|
|
43
|
+
})(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"
|
|
44
|
+
// The trigger's wrapper takes no box of its own, so the trigger lays out as if unwrapped
|
|
45
|
+
])), visuallyHidden);
|
|
46
|
+
// The trigger's wrapper takes no box of its own, so the trigger lays out as if unwrapped
|
|
47
|
+
var Anchor = /*#__PURE__*/styled.span.withConfig({
|
|
48
|
+
displayName: "Tooltip__Anchor",
|
|
49
|
+
componentId: "sc-ajez94-2"
|
|
50
|
+
})(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: contents;\n"], ["\n display: contents;\n"
|
|
51
|
+
/**
|
|
52
|
+
* A short label or hint that appears beside a control on hover or keyboard focus (#326).
|
|
53
|
+
*
|
|
54
|
+
* Opens after `motion.delay.hint` of hover, at once on keyboard focus, and at once when the pointer
|
|
55
|
+
* moves on from another tooltip. Stays open while the pointer is over it; closes on pointer leave,
|
|
56
|
+
* blur, scroll and Escape. Doesn't open on touch.
|
|
57
|
+
*/])));
|
|
58
|
+
/**
|
|
59
|
+
* A short label or hint that appears beside a control on hover or keyboard focus (#326).
|
|
60
|
+
*
|
|
61
|
+
* Opens after `motion.delay.hint` of hover, at once on keyboard focus, and at once when the pointer
|
|
62
|
+
* moves on from another tooltip. Stays open while the pointer is over it; closes on pointer leave,
|
|
63
|
+
* blur, scroll and Escape. Doesn't open on touch.
|
|
64
|
+
*/
|
|
65
|
+
var Tooltip = function Tooltip(_a) {
|
|
66
|
+
var text = _a.text,
|
|
67
|
+
_b = _a.kind,
|
|
68
|
+
kind = _b === void 0 ? 'label' : _b,
|
|
69
|
+
_c = _a.side,
|
|
70
|
+
side = _c === void 0 ? 'top' : _c,
|
|
71
|
+
_d = _a.align,
|
|
72
|
+
align = _d === void 0 ? 'center' : _d,
|
|
73
|
+
children = _a.children,
|
|
74
|
+
dataTestId = _a["data-testid"];
|
|
75
|
+
var descriptionId = useId();
|
|
76
|
+
var anchorRef = useRef(null);
|
|
77
|
+
var bubbleRef = useRef(null);
|
|
78
|
+
var openTimer = useRef(undefined);
|
|
79
|
+
var closeTimer = useRef(undefined);
|
|
80
|
+
var owner = useState(function () {
|
|
81
|
+
return {};
|
|
82
|
+
})[0];
|
|
83
|
+
// Set by a press, so the focus that follows a click or tap doesn't reopen the tooltip
|
|
84
|
+
var pressed = useRef(false);
|
|
85
|
+
var _e = useState(false),
|
|
86
|
+
isOpen = _e[0],
|
|
87
|
+
setIsOpen = _e[1];
|
|
88
|
+
var _f = usePresence(isOpen),
|
|
89
|
+
isPresent = _f.isPresent,
|
|
90
|
+
isExiting = _f.isExiting;
|
|
91
|
+
var clearTimers = function clearTimers() {
|
|
92
|
+
clearTimeout(openTimer.current);
|
|
93
|
+
clearTimeout(closeTimer.current);
|
|
94
|
+
};
|
|
95
|
+
var close = useCallback(function () {
|
|
96
|
+
clearTimers();
|
|
97
|
+
if ((active === null || active === void 0 ? void 0 : active.owner) === owner) {
|
|
98
|
+
active = null;
|
|
99
|
+
lastClosedAt = Date.now();
|
|
100
|
+
}
|
|
101
|
+
setIsOpen(false);
|
|
102
|
+
}, [owner]);
|
|
103
|
+
var open = useCallback(function () {
|
|
104
|
+
clearTimers();
|
|
105
|
+
if (active && active.owner !== owner) active.close();
|
|
106
|
+
active = {
|
|
107
|
+
owner: owner,
|
|
108
|
+
close: close
|
|
109
|
+
};
|
|
110
|
+
setIsOpen(true);
|
|
111
|
+
}, [owner, close]);
|
|
112
|
+
var scheduleOpen = function scheduleOpen() {
|
|
113
|
+
clearTimeout(closeTimer.current);
|
|
114
|
+
if (isOpen) return;
|
|
115
|
+
// Moving straight from one trigger to the next (another tooltip still open) or just after one
|
|
116
|
+
// closed skips the delay, so a rail feels immediate
|
|
117
|
+
if (active || Date.now() - lastClosedAt < SKIP_DELAY_MS) return open();
|
|
118
|
+
clearTimeout(openTimer.current);
|
|
119
|
+
openTimer.current = setTimeout(open, HINT_DELAY_MS);
|
|
120
|
+
};
|
|
121
|
+
var scheduleClose = function scheduleClose() {
|
|
122
|
+
clearTimeout(openTimer.current);
|
|
123
|
+
clearTimeout(closeTimer.current);
|
|
124
|
+
closeTimer.current = setTimeout(close, CLOSE_GRACE_MS);
|
|
125
|
+
};
|
|
126
|
+
useEffect(function () {
|
|
127
|
+
return function () {
|
|
128
|
+
clearTimers();
|
|
129
|
+
if ((active === null || active === void 0 ? void 0 : active.owner) === owner) active = null;
|
|
130
|
+
};
|
|
131
|
+
}, [owner]);
|
|
132
|
+
// While open: Escape closes it without moving focus, and before anything else hears the key
|
|
133
|
+
// (an Escape meant for the tooltip mustn't also close a Modal)
|
|
134
|
+
useEffect(function () {
|
|
135
|
+
if (!isOpen) return;
|
|
136
|
+
var onKeyDown = function onKeyDown(event) {
|
|
137
|
+
if (event.key !== 'Escape') return;
|
|
138
|
+
event.stopPropagation();
|
|
139
|
+
close();
|
|
140
|
+
};
|
|
141
|
+
window.addEventListener('keydown', onKeyDown, true);
|
|
142
|
+
return function () {
|
|
143
|
+
return window.removeEventListener('keydown', onKeyDown, true);
|
|
144
|
+
};
|
|
145
|
+
}, [isOpen, close]);
|
|
146
|
+
// In the top layer beside the trigger; scrolling or resizing closes it, since the trigger moves
|
|
147
|
+
useFloatingLayer({
|
|
148
|
+
isPresent: isPresent,
|
|
149
|
+
floatingRef: bubbleRef,
|
|
150
|
+
anchorRef: anchorRef,
|
|
151
|
+
side: side,
|
|
152
|
+
align: align,
|
|
153
|
+
onDetach: close
|
|
154
|
+
});
|
|
155
|
+
var child = React.Children.only(children);
|
|
156
|
+
var describedBy = [child.props['aria-describedby'], kind === 'description' ? descriptionId : undefined].filter(Boolean).join(' ') || undefined;
|
|
157
|
+
return jsxs(Anchor, {
|
|
158
|
+
ref: anchorRef,
|
|
159
|
+
onPointerEnter: function onPointerEnter(event) {
|
|
160
|
+
return event.pointerType !== 'touch' && scheduleOpen();
|
|
161
|
+
},
|
|
162
|
+
onPointerLeave: function onPointerLeave(event) {
|
|
163
|
+
return event.pointerType !== 'touch' && scheduleClose();
|
|
164
|
+
},
|
|
165
|
+
onFocus: function onFocus(event) {
|
|
166
|
+
// Keyboard focus opens it at once; a click's or tap's focus doesn't
|
|
167
|
+
if (pressed.current) {
|
|
168
|
+
pressed.current = false;
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (isKeyboardFocus(event.target)) open();
|
|
172
|
+
},
|
|
173
|
+
onBlur: function onBlur() {
|
|
174
|
+
// A press on an already focused trigger has no focus to skip; don't carry it over
|
|
175
|
+
pressed.current = false;
|
|
176
|
+
close();
|
|
177
|
+
},
|
|
178
|
+
// Pressing the trigger acts on it, so the hint has done its job
|
|
179
|
+
onPointerDown: function onPointerDown() {
|
|
180
|
+
pressed.current = true;
|
|
181
|
+
close();
|
|
182
|
+
},
|
|
183
|
+
children: [/*#__PURE__*/React.cloneElement(child, {
|
|
184
|
+
'aria-describedby': describedBy
|
|
185
|
+
}), kind === 'description' && jsx(Description, {
|
|
186
|
+
id: descriptionId,
|
|
187
|
+
children: text
|
|
188
|
+
}), isPresent &&
|
|
189
|
+
// Hidden from assistive technology: a label repeats the trigger's name, and a
|
|
190
|
+
// description reaches it through aria-describedby on the always-present text above
|
|
191
|
+
jsx(Bubble, {
|
|
192
|
+
ref: bubbleRef,
|
|
193
|
+
"aria-hidden": "true",
|
|
194
|
+
"$exiting": isExiting,
|
|
195
|
+
"data-testid": dataTestId,
|
|
196
|
+
children: text
|
|
197
|
+
})]
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
Tooltip.displayName = 'Tooltip';
|
|
201
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
202
|
+
|
|
203
|
+
export { Tooltip };
|
|
204
|
+
//# sourceMappingURL=Tooltip.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -2,7 +2,6 @@ export * from './Avatar/index.mjs';
|
|
|
2
2
|
export * from './Badge/index.mjs';
|
|
3
3
|
export * from './Box/index.mjs';
|
|
4
4
|
export * from './Button/index.mjs';
|
|
5
|
-
export * from './CategoryBadge/index.mjs';
|
|
6
5
|
export * from './CategoryLabel/index.mjs';
|
|
7
6
|
export * from './Chip/index.mjs';
|
|
8
7
|
export * from './Container/index.mjs';
|
|
@@ -14,8 +13,8 @@ export * from './MoneyDisplay/index.mjs';
|
|
|
14
13
|
export * from './ProgressBar/index.mjs';
|
|
15
14
|
export * from './Divider/index.mjs';
|
|
16
15
|
export * from './Stack/index.mjs';
|
|
17
|
-
export * from './StatusBadge/index.mjs';
|
|
18
16
|
export * from './StatusLabel/index.mjs';
|
|
19
17
|
export * from './Tag/index.mjs';
|
|
18
|
+
export * from './Tooltip/index.mjs';
|
|
20
19
|
export * from './Typography/index.mjs';
|
|
21
20
|
export * from './AILabel/index.mjs';
|
|
@@ -2,7 +2,6 @@ export * from './Avatar';
|
|
|
2
2
|
export * from './Badge';
|
|
3
3
|
export * from './Box';
|
|
4
4
|
export * from './Button';
|
|
5
|
-
export * from './CategoryBadge';
|
|
6
5
|
export * from './CategoryLabel';
|
|
7
6
|
export * from './Chip';
|
|
8
7
|
export * from './Container';
|
|
@@ -14,8 +13,8 @@ export * from './MoneyDisplay';
|
|
|
14
13
|
export * from './ProgressBar';
|
|
15
14
|
export * from './Divider';
|
|
16
15
|
export * from './Stack';
|
|
17
|
-
export * from './StatusBadge';
|
|
18
16
|
export * from './StatusLabel';
|
|
19
17
|
export * from './Tag';
|
|
18
|
+
export * from './Tooltip';
|
|
20
19
|
export * from './Typography';
|
|
21
20
|
export * from './AILabel';
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Tokens } from '../../../types/tokens.mjs';
|
|
3
|
+
/**
|
|
4
|
+
* A grid gap: a `base.dimension` step (the 4px scale, so `4` is 16px), or `auto`. Before 3.0 the
|
|
5
|
+
* gap props took `base.spacing` keys, which had the same values (#188).
|
|
6
|
+
*/
|
|
7
|
+
type GridGap = keyof Tokens['base']['dimension'] | 'auto';
|
|
3
8
|
interface GridProps {
|
|
4
9
|
cols?: number;
|
|
5
|
-
gap?:
|
|
6
|
-
gapX?:
|
|
7
|
-
gapY?:
|
|
10
|
+
gap?: GridGap;
|
|
11
|
+
gapX?: GridGap;
|
|
12
|
+
gapY?: GridGap;
|
|
8
13
|
className?: string;
|
|
9
14
|
/** Test identifier for automated testing */
|
|
10
15
|
'data-testid'?: string;
|
|
@@ -34,21 +39,21 @@ interface ResponsiveGridProps {
|
|
|
34
39
|
colsMd?: number;
|
|
35
40
|
colsLg?: number;
|
|
36
41
|
colsXl?: number;
|
|
37
|
-
gap?:
|
|
38
|
-
gapSm?:
|
|
39
|
-
gapMd?:
|
|
40
|
-
gapLg?:
|
|
41
|
-
gapXl?:
|
|
42
|
-
gapX?:
|
|
43
|
-
gapXSm?:
|
|
44
|
-
gapXMd?:
|
|
45
|
-
gapXLg?:
|
|
46
|
-
gapXXl?:
|
|
47
|
-
gapY?:
|
|
48
|
-
gapYSm?:
|
|
49
|
-
gapYMd?:
|
|
50
|
-
gapYLg?:
|
|
51
|
-
gapYXl?:
|
|
42
|
+
gap?: GridGap;
|
|
43
|
+
gapSm?: GridGap;
|
|
44
|
+
gapMd?: GridGap;
|
|
45
|
+
gapLg?: GridGap;
|
|
46
|
+
gapXl?: GridGap;
|
|
47
|
+
gapX?: GridGap;
|
|
48
|
+
gapXSm?: GridGap;
|
|
49
|
+
gapXMd?: GridGap;
|
|
50
|
+
gapXLg?: GridGap;
|
|
51
|
+
gapXXl?: GridGap;
|
|
52
|
+
gapY?: GridGap;
|
|
53
|
+
gapYSm?: GridGap;
|
|
54
|
+
gapYMd?: GridGap;
|
|
55
|
+
gapYLg?: GridGap;
|
|
56
|
+
gapYXl?: GridGap;
|
|
52
57
|
className?: string;
|
|
53
58
|
/** Test identifier for automated testing */
|
|
54
59
|
'data-testid'?: string;
|