@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,10 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Tokens } from '../../../types/tokens';
|
|
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;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { __makeTemplateObject } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
2
|
+
import { __assign, __makeTemplateObject } from '../../../vendor/tslib/tslib.es6.mjs';
|
|
3
3
|
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
7
|
|
|
8
|
-
// Exception to decision 0014: the gap props are typed as base
|
|
9
|
-
// so they are looked up in base
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
// Exception to decision 0014: the gap props are typed as base dimension keys (public API),
|
|
9
|
+
// so they are looked up in the base tier until they accept semantic keys.
|
|
10
|
+
var gapSpacing = __assign(__assign({}, tokens.base.dimension), {
|
|
11
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
12
|
+
auto: tokens.base.spacing.auto
|
|
13
|
+
});
|
|
12
14
|
// Breakpoints using base tokens
|
|
13
15
|
var breakpoints = {
|
|
14
16
|
xs: tokens.semantic.breakpoint.xs,
|
|
@@ -35,6 +35,11 @@ export interface AgentInputProps {
|
|
|
35
35
|
maxLength?: number;
|
|
36
36
|
disabled?: boolean;
|
|
37
37
|
isSubmitting?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Web Speech API voice capture, with a mic control in the field, where the browser supports it.
|
|
40
|
+
* Off by default from 3.0 (#266): a product turns it on when it handles voice.
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
38
43
|
enableVoice?: boolean;
|
|
39
44
|
autoSubmitOnVoiceFinal?: boolean;
|
|
40
45
|
voiceLanguage?: string;
|
|
@@ -35,6 +35,11 @@ export interface AgentInputProps {
|
|
|
35
35
|
maxLength?: number;
|
|
36
36
|
disabled?: boolean;
|
|
37
37
|
isSubmitting?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Web Speech API voice capture, with a mic control in the field, where the browser supports it.
|
|
40
|
+
* Off by default from 3.0 (#266): a product turns it on when it handles voice.
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
38
43
|
enableVoice?: boolean;
|
|
39
44
|
autoSubmitOnVoiceFinal?: boolean;
|
|
40
45
|
voiceLanguage?: string;
|
|
@@ -236,7 +236,7 @@ function AgentInputWithRef(_a, ref) {
|
|
|
236
236
|
disabled = _e === void 0 ? false : _e,
|
|
237
237
|
isSubmitting = _a.isSubmitting,
|
|
238
238
|
_f = _a.enableVoice,
|
|
239
|
-
enableVoice = _f === void 0 ?
|
|
239
|
+
enableVoice = _f === void 0 ? false : _f,
|
|
240
240
|
_g = _a.autoSubmitOnVoiceFinal,
|
|
241
241
|
autoSubmitOnVoiceFinal = _g === void 0 ? true : _g,
|
|
242
242
|
_h = _a.voiceLanguage,
|
|
@@ -41,14 +41,6 @@ export interface AlertProps {
|
|
|
41
41
|
* Optional action button or component, placed below the message and left-aligned with it
|
|
42
42
|
*/
|
|
43
43
|
action?: React.ReactNode;
|
|
44
|
-
/**
|
|
45
|
-
* Compact inline variant with reduced padding
|
|
46
|
-
* @default false
|
|
47
|
-
* @deprecated Use `InlineAlert` for a short, local message (decision 0019). `inline` keeps
|
|
48
|
-
* working until it is removed in 3.0. An inline alert that needs a title, action or dismiss
|
|
49
|
-
* button stays an Alert.
|
|
50
|
-
*/
|
|
51
|
-
inline?: boolean;
|
|
52
44
|
/**
|
|
53
45
|
* ARIA live region behavior
|
|
54
46
|
* - polite: Non-urgent announcements
|
|
@@ -63,6 +55,6 @@ export interface AlertProps {
|
|
|
63
55
|
'data-testid'?: string;
|
|
64
56
|
}
|
|
65
57
|
export declare const Alert: {
|
|
66
|
-
({ variant, appearance, children, title, dismissible, onDismiss, action,
|
|
58
|
+
({ variant, appearance, children, title, dismissible, onDismiss, action, ariaLive, "data-testid": dataTestId, ...restProps }: AlertProps): import("react/jsx-runtime").JSX.Element | null;
|
|
67
59
|
displayName: string;
|
|
68
60
|
};
|
|
@@ -41,14 +41,6 @@ export interface AlertProps {
|
|
|
41
41
|
* Optional action button or component, placed below the message and left-aligned with it
|
|
42
42
|
*/
|
|
43
43
|
action?: React.ReactNode;
|
|
44
|
-
/**
|
|
45
|
-
* Compact inline variant with reduced padding
|
|
46
|
-
* @default false
|
|
47
|
-
* @deprecated Use `InlineAlert` for a short, local message (decision 0019). `inline` keeps
|
|
48
|
-
* working until it is removed in 3.0. An inline alert that needs a title, action or dismiss
|
|
49
|
-
* button stays an Alert.
|
|
50
|
-
*/
|
|
51
|
-
inline?: boolean;
|
|
52
44
|
/**
|
|
53
45
|
* ARIA live region behavior
|
|
54
46
|
* - polite: Non-urgent announcements
|
|
@@ -63,6 +55,6 @@ export interface AlertProps {
|
|
|
63
55
|
'data-testid'?: string;
|
|
64
56
|
}
|
|
65
57
|
export declare const Alert: {
|
|
66
|
-
({ variant, appearance, children, title, dismissible, onDismiss, action,
|
|
58
|
+
({ variant, appearance, children, title, dismissible, onDismiss, action, ariaLive, "data-testid": dataTestId, ...restProps }: AlertProps): import("react/jsx-runtime").JSX.Element | null;
|
|
67
59
|
displayName: string;
|
|
68
60
|
};
|
|
@@ -62,13 +62,7 @@ var StyledAlert = /*#__PURE__*/styled.div.withConfig({
|
|
|
62
62
|
},
|
|
63
63
|
displayName: "Alert__StyledAlert",
|
|
64
64
|
componentId: "sc-18tq5d-0"
|
|
65
|
-
})(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n /* Items start at the top, so the icon and dismiss button line up with the first line */\n align-items: flex-start;\n gap: ", ";\n padding: ", ";\n border-radius: ", ";\n border: ", " solid;\n position: relative;\n width: 100%;\n \n /* Severity \xD7 appearance colours from Alert's component tokens (decision 0019). Borderless\n keeps a transparent border, so both appearances take the same space. */\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n \n /* Responsive adjustments */\n @media (min-width: ", ") {\n padding: ", ";\n }\n\n /* The exit is chosen once, when dismissed (not by a media query), so a reduced-motion\n preference that changes mid-exit can't swap animations and flash the faded alert back.\n Reduced motion: fade only; the space closes instantly afterwards. */\n ", "\n"], ["\n display: flex;\n /* Items start at the top, so the icon and dismiss button line up with the first line */\n align-items: flex-start;\n gap: ", ";\n padding: ", ";\n border-radius: ", ";\n border: ", " solid;\n position: relative;\n width: 100%;\n \n /* Severity \xD7 appearance colours from Alert's component tokens (decision 0019). Borderless\n keeps a transparent border, so both appearances take the same space. */\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n \n /* Responsive adjustments */\n @media (min-width: ", ") {\n padding: ", ";\n }\n\n /* The exit is chosen once, when dismissed (not by a media query), so a reduced-motion\n preference that changes mid-exit can't swap animations and flash the faded alert back.\n Reduced motion: fade only; the space closes instantly afterwards. */\n ", "\n"])), function (_a) {
|
|
66
|
-
var $inline = _a.$inline;
|
|
67
|
-
return $inline ? semantic.space[200] : semantic.space[300];
|
|
68
|
-
}, function (_a) {
|
|
69
|
-
var $inline = _a.$inline;
|
|
70
|
-
return $inline ? semantic.space[200] : semantic.space[300];
|
|
71
|
-
}, semantic.radius.sm, semantic.border.width.thin, function (_a) {
|
|
65
|
+
})(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n /* Items start at the top, so the icon and dismiss button line up with the first line */\n align-items: flex-start;\n gap: ", ";\n padding: ", ";\n border-radius: ", ";\n border: ", " solid;\n position: relative;\n width: 100%;\n \n /* Severity \xD7 appearance colours from Alert's component tokens (decision 0019). Borderless\n keeps a transparent border, so both appearances take the same space. */\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n \n /* Responsive adjustments */\n @media (min-width: ", ") {\n padding: ", ";\n }\n\n /* The exit is chosen once, when dismissed (not by a media query), so a reduced-motion\n preference that changes mid-exit can't swap animations and flash the faded alert back.\n Reduced motion: fade only; the space closes instantly afterwards. */\n ", "\n"], ["\n display: flex;\n /* Items start at the top, so the icon and dismiss button line up with the first line */\n align-items: flex-start;\n gap: ", ";\n padding: ", ";\n border-radius: ", ";\n border: ", " solid;\n position: relative;\n width: 100%;\n \n /* Severity \xD7 appearance colours from Alert's component tokens (decision 0019). Borderless\n keeps a transparent border, so both appearances take the same space. */\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n \n /* Responsive adjustments */\n @media (min-width: ", ") {\n padding: ", ";\n }\n\n /* The exit is chosen once, when dismissed (not by a media query), so a reduced-motion\n preference that changes mid-exit can't swap animations and flash the faded alert back.\n Reduced motion: fade only; the space closes instantly afterwards. */\n ", "\n"])), semantic.space[300], semantic.space[300], semantic.radius.sm, semantic.border.width.thin, function (_a) {
|
|
72
66
|
var _b = _a.$variant,
|
|
73
67
|
$variant = _b === void 0 ? 'info' : _b;
|
|
74
68
|
return alert.severity[$variant].background;
|
|
@@ -81,10 +75,7 @@ var StyledAlert = /*#__PURE__*/styled.div.withConfig({
|
|
|
81
75
|
$variant = _b === void 0 ? 'info' : _b,
|
|
82
76
|
$appearance = _a.$appearance;
|
|
83
77
|
return alert.appearance[$appearance].borderColor[$variant];
|
|
84
|
-
}, semantic.breakpoint.md, function (_a) {
|
|
85
|
-
var $inline = _a.$inline;
|
|
86
|
-
return $inline ? semantic.space[200] : semantic.space[400];
|
|
87
|
-
}, function (_a) {
|
|
78
|
+
}, semantic.breakpoint.md, semantic.space[400], function (_a) {
|
|
88
79
|
var $isExiting = _a.$isExiting,
|
|
89
80
|
$reducedExit = _a.$reducedExit;
|
|
90
81
|
return $isExiting && css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n overflow: hidden;\n pointer-events: none;\n animation: ", ";\n "], ["\n overflow: hidden;\n pointer-events: none;\n animation: ", ";\n "])), $reducedExit ? css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["", " ", " ", " forwards"], ["", " ", " ", " forwards"])), fadeOut, duration.fast, easing.accelerate) : css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["", " ", "ms ", " forwards"], ["", " ", "ms ", " forwards"])), fadeThenCollapse, EXIT_MS, easing.accelerate));
|
|
@@ -100,7 +91,7 @@ var StyledContent = /*#__PURE__*/styled.div.withConfig({
|
|
|
100
91
|
var StyledTitle = /*#__PURE__*/styled.span.withConfig({
|
|
101
92
|
displayName: "Alert__StyledTitle",
|
|
102
93
|
componentId: "sc-18tq5d-3"
|
|
103
|
-
})(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n font: ", ";\n
|
|
94
|
+
})(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n font: ", ";\n line-height: ", ";\n margin: 0;\n"], ["\n font: ", ";\n line-height: ", ";\n margin: 0;\n"])), alert.title.typography, alert.title.lineHeight);
|
|
104
95
|
var StyledMessage = /*#__PURE__*/styled.span.withConfig({
|
|
105
96
|
displayName: "Alert__StyledMessage",
|
|
106
97
|
componentId: "sc-18tq5d-4"
|
|
@@ -130,21 +121,16 @@ var StyledDismissSlot = /*#__PURE__*/styled.div.withConfig({
|
|
|
130
121
|
displayName: "Alert__StyledDismissSlot",
|
|
131
122
|
componentId: "sc-18tq5d-6"
|
|
132
123
|
})(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n flex-shrink: 0;\n height: ", ";\n"], ["\n display: flex;\n align-items: center;\n flex-shrink: 0;\n height: ", ";\n"
|
|
133
|
-
// The glyph sits on the padding edge, mirroring the severity icon on the left
|
|
134
|
-
// alert's padding is too small for that, so its button stays inside the padding.
|
|
124
|
+
// The glyph sits on the padding edge, mirroring the severity icon on the left
|
|
135
125
|
])), function (_a) {
|
|
136
126
|
var $lineHeight = _a.$lineHeight;
|
|
137
127
|
return $lineHeight;
|
|
138
128
|
});
|
|
139
|
-
// The glyph sits on the padding edge, mirroring the severity icon on the left
|
|
140
|
-
// alert's padding is too small for that, so its button stays inside the padding.
|
|
129
|
+
// The glyph sits on the padding edge, mirroring the severity icon on the left
|
|
141
130
|
var StyledDismissButton = /*#__PURE__*/styled(IconButton).withConfig({
|
|
142
131
|
displayName: "Alert__StyledDismissButton",
|
|
143
132
|
componentId: "sc-18tq5d-7"
|
|
144
|
-
})(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n margin-right: ", ";\n"], ["\n margin-right: ", ";\n"])),
|
|
145
|
-
var $inline = _a.$inline;
|
|
146
|
-
return $inline ? 0 : "calc((".concat(semantic.size.control.sm, " - ").concat(semantic.size.icon.sm, ") / -2)");
|
|
147
|
-
});
|
|
133
|
+
})(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n margin-right: calc((", " - ", ") / -2);\n"], ["\n margin-right: calc((", " - ", ") / -2);\n"])), semantic.size.control.sm, semantic.size.icon.sm);
|
|
148
134
|
var Alert = function Alert(_a) {
|
|
149
135
|
var _b = _a.variant,
|
|
150
136
|
variant = _b === void 0 ? 'info' : _b,
|
|
@@ -156,12 +142,15 @@ var Alert = function Alert(_a) {
|
|
|
156
142
|
dismissible = _d === void 0 ? false : _d,
|
|
157
143
|
onDismiss = _a.onDismiss,
|
|
158
144
|
action = _a.action,
|
|
159
|
-
_e = _a.
|
|
160
|
-
|
|
161
|
-
_f = _a.ariaLive,
|
|
162
|
-
ariaLive = _f === void 0 ? 'polite' : _f,
|
|
145
|
+
_e = _a.ariaLive,
|
|
146
|
+
ariaLive = _e === void 0 ? 'polite' : _e,
|
|
163
147
|
dataTestId = _a["data-testid"],
|
|
164
|
-
|
|
148
|
+
restProps = __rest(_a, ["variant", "appearance", "children", "title", "dismissible", "onDismiss", "action", "ariaLive", 'data-testid']);
|
|
149
|
+
// `inline` was removed in 3.0 (use InlineAlert, decision 0019); plain JavaScript that still
|
|
150
|
+
// passes it gets a block alert, with the prop kept off the DOM
|
|
151
|
+
var _f = restProps;
|
|
152
|
+
_f.inline;
|
|
153
|
+
var props = __rest(_f, ["inline"]);
|
|
165
154
|
var _g = React.useState('visible'),
|
|
166
155
|
phase = _g[0],
|
|
167
156
|
setPhase = _g[1];
|
|
@@ -237,7 +226,6 @@ var Alert = function Alert(_a) {
|
|
|
237
226
|
"aria-live": ariaLive,
|
|
238
227
|
"$variant": variant,
|
|
239
228
|
"$appearance": appearance,
|
|
240
|
-
"$inline": inline,
|
|
241
229
|
"$isExiting": isExiting,
|
|
242
230
|
"$reducedExit": reducedExit,
|
|
243
231
|
"data-testid": dataTestId
|
|
@@ -270,7 +258,6 @@ var Alert = function Alert(_a) {
|
|
|
270
258
|
iconName: "close",
|
|
271
259
|
size: "small",
|
|
272
260
|
variant: "naked",
|
|
273
|
-
"$inline": inline,
|
|
274
261
|
onClick: handleDismiss,
|
|
275
262
|
"aria-label": "Dismiss alert",
|
|
276
263
|
"data-testid": dataTestId ? "".concat(dataTestId, "-dismiss") : undefined
|
|
@@ -7,7 +7,6 @@ import '../../atoms/Avatar/Avatar.mjs';
|
|
|
7
7
|
import '../../atoms/Badge/Badge.mjs';
|
|
8
8
|
import '../../atoms/Box/Box.mjs';
|
|
9
9
|
import '../../atoms/Button/Button.mjs';
|
|
10
|
-
import '../../atoms/CategoryBadge/CategoryBadge.mjs';
|
|
11
10
|
import '../../atoms/CategoryLabel/CategoryLabel.mjs';
|
|
12
11
|
import { Chip } from '../../atoms/Chip/Chip.mjs';
|
|
13
12
|
import '../../atoms/Icon/Icon.mjs';
|
|
@@ -21,9 +20,9 @@ import '../../atoms/MoneyDisplay/MoneyDisplay.mjs';
|
|
|
21
20
|
import '../../atoms/ProgressBar/ProgressBar.mjs';
|
|
22
21
|
import '../../atoms/Divider/Divider.mjs';
|
|
23
22
|
import { Stack } from '../../atoms/Stack/Stack.mjs';
|
|
24
|
-
import '../../atoms/StatusBadge/StatusBadge.mjs';
|
|
25
23
|
import '../../atoms/StatusLabel/StatusLabel.mjs';
|
|
26
24
|
import '../../atoms/Tag/Tag.mjs';
|
|
25
|
+
import '../../atoms/Tooltip/Tooltip.mjs';
|
|
27
26
|
import '../../atoms/Typography/Typography.mjs';
|
|
28
27
|
import '../../atoms/AILabel/AILabel.mjs';
|
|
29
28
|
|
|
@@ -33,8 +32,6 @@ var ChipGroupWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
|
33
32
|
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n > div {\n display: flex;\n flex-wrap: wrap;\n }\n"], ["\n > div {\n display: flex;\n flex-wrap: wrap;\n }\n"])));
|
|
34
33
|
var ChipGroup = function ChipGroup(_a) {
|
|
35
34
|
var labels = _a.labels,
|
|
36
|
-
_b = _a.variant,
|
|
37
|
-
variant = _b === void 0 ? 'default' : _b,
|
|
38
35
|
dataTestId = _a["data-testid"];
|
|
39
36
|
return jsx(ChipGroupWrapper, {
|
|
40
37
|
"data-testid": dataTestId,
|
|
@@ -43,8 +40,7 @@ var ChipGroup = function ChipGroup(_a) {
|
|
|
43
40
|
gap: "sm",
|
|
44
41
|
children: labels && labels.map(function (title, index) {
|
|
45
42
|
return jsx(Chip, {
|
|
46
|
-
title: title
|
|
47
|
-
variant: variant
|
|
43
|
+
title: title
|
|
48
44
|
}, index);
|
|
49
45
|
})
|
|
50
46
|
})
|
|
@@ -6,8 +6,7 @@ export interface DateGroupProps {
|
|
|
6
6
|
/** Children to render under the date header (typically transactions) */
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
/**
|
|
9
|
-
* Format mode for the date header, passed to DateFormatter's `mode`.
|
|
10
|
-
* deprecated: it behaves exactly like `'smart'`, so use `'smart'` (#82).
|
|
9
|
+
* Format mode for the date header, passed to DateFormatter's `mode`.
|
|
11
10
|
*/
|
|
12
11
|
format?: DateFormatMode;
|
|
13
12
|
/** Whether to show total amount for this date group */
|
|
@@ -6,8 +6,7 @@ export interface DateGroupProps {
|
|
|
6
6
|
/** Children to render under the date header (typically transactions) */
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
/**
|
|
9
|
-
* Format mode for the date header, passed to DateFormatter's `mode`.
|
|
10
|
-
* deprecated: it behaves exactly like `'smart'`, so use `'smart'` (#82).
|
|
9
|
+
* Format mode for the date header, passed to DateFormatter's `mode`.
|
|
11
10
|
*/
|
|
12
11
|
format?: DateFormatMode;
|
|
13
12
|
/** Whether to show total amount for this date group */
|
|
@@ -13,6 +13,8 @@ export interface ListProps {
|
|
|
13
13
|
/**
|
|
14
14
|
* Density of the list's items: their padding. A ListItem's own `spacing` overrides it (#77).
|
|
15
15
|
* @default 'comfortable'
|
|
16
|
+
* @deprecated Set density on a region with `data-co-density` instead: rows follow it (P9,
|
|
17
|
+
* decision 0051). `spacing` still sets the padding, but not the height, until it's removed in 4.0.
|
|
16
18
|
*/
|
|
17
19
|
spacing?: ListSpacing;
|
|
18
20
|
/**
|
|
@@ -13,6 +13,8 @@ export interface ListProps {
|
|
|
13
13
|
/**
|
|
14
14
|
* Density of the list's items: their padding. A ListItem's own `spacing` overrides it (#77).
|
|
15
15
|
* @default 'comfortable'
|
|
16
|
+
* @deprecated Set density on a region with `data-co-density` instead: rows follow it (P9,
|
|
17
|
+
* decision 0051). `spacing` still sets the padding, but not the height, until it's removed in 4.0.
|
|
16
18
|
*/
|
|
17
19
|
spacing?: ListSpacing;
|
|
18
20
|
/**
|
|
@@ -59,6 +59,8 @@ export interface ListItemProps {
|
|
|
59
59
|
/**
|
|
60
60
|
* Density of this item. Defaults to the parent List's `spacing`, or `comfortable` outside a
|
|
61
61
|
* List; set it to override the List for this item (#77).
|
|
62
|
+
* @deprecated Set density on a region with `data-co-density` instead: rows follow it (P9,
|
|
63
|
+
* decision 0051). `spacing` still sets the padding, but not the height, until it's removed in 4.0.
|
|
62
64
|
*/
|
|
63
65
|
spacing?: ListSpacing;
|
|
64
66
|
/**
|
|
@@ -59,6 +59,8 @@ export interface ListItemProps {
|
|
|
59
59
|
/**
|
|
60
60
|
* Density of this item. Defaults to the parent List's `spacing`, or `comfortable` outside a
|
|
61
61
|
* List; set it to override the List for this item (#77).
|
|
62
|
+
* @deprecated Set density on a region with `data-co-density` instead: rows follow it (P9,
|
|
63
|
+
* decision 0051). `spacing` still sets the padding, but not the height, until it's removed in 4.0.
|
|
62
64
|
*/
|
|
63
65
|
spacing?: ListSpacing;
|
|
64
66
|
/**
|
|
@@ -20,7 +20,7 @@ var StyledListItem = /*#__PURE__*/styled.li.withConfig({
|
|
|
20
20
|
},
|
|
21
21
|
displayName: "ListItem__StyledListItem",
|
|
22
22
|
componentId: "sc-1wzzt21-0"
|
|
23
|
-
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n min-height: ", ";\n position: relative;\n \n /* Disable user selection for interactive items */\n ", "\n \n /* Disabled state */\n ", "\n \n /* Destructive state - apply error color to text */\n ", "\n"], ["\n display: flex;\n flex-direction: column;\n min-height: ", ";\n position: relative;\n \n /* Disable user selection for interactive items */\n ", "\n \n /* Disabled state */\n ", "\n \n /* Destructive state - apply error color to text */\n ", "\n"])), semantic.size.
|
|
23
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n min-height: ", ";\n position: relative;\n \n /* Disable user selection for interactive items */\n ", "\n \n /* Disabled state */\n ", "\n \n /* Destructive state - apply error color to text */\n ", "\n"], ["\n display: flex;\n flex-direction: column;\n min-height: ", ";\n position: relative;\n \n /* Disable user selection for interactive items */\n ", "\n \n /* Disabled state */\n ", "\n \n /* Destructive state - apply error color to text */\n ", "\n"])), semantic.size.row.md, function (_a) {
|
|
24
24
|
var $interactive = _a.$interactive;
|
|
25
25
|
return $interactive && 'user-select: none;';
|
|
26
26
|
}, function (_a) {
|
|
@@ -37,9 +37,9 @@ var StyledItemContent = /*#__PURE__*/styled.div.withConfig({
|
|
|
37
37
|
},
|
|
38
38
|
displayName: "ListItem__StyledItemContent",
|
|
39
39
|
componentId: "sc-1wzzt21-1"
|
|
40
|
-
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: flex-start;\n gap: ", ";\n padding: ", ";\n border-radius: ", ";\n transition: background-color ", " ", ", color ", " ", ";\n cursor: ", ";\n \n /* The shared row states (decision 0030). Only interactive, enabled rows respond to hover and\n press; the primary text is Typography, so the row colours it through a selector */\n ", "\n \n /* Focus visible */\n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n }\n"], ["\n display: flex;\n align-items: flex-start;\n gap: ", ";\n padding: ", ";\n border-radius: ", ";\n transition: background-color ", " ", ", color ", " ", ";\n cursor: ", ";\n \n /* The shared row states (decision 0030). Only interactive, enabled rows respond to hover and\n press; the primary text is Typography, so the row colours it through a selector */\n ", "\n \n /* Focus visible */\n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n }\n"])), semantic.space[300], function (_a) {
|
|
40
|
+
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: flex-start;\n gap: ", ";\n /* Insets, so the row's padding follows density with its height (decision 0051) */\n padding: ", ";\n border-radius: ", ";\n transition: background-color ", " ", ", color ", " ", ";\n cursor: ", ";\n \n /* The shared row states (decision 0030). Only interactive, enabled rows respond to hover and\n press; the primary text is Typography, so the row colours it through a selector */\n ", "\n \n /* Focus visible */\n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n }\n"], ["\n display: flex;\n align-items: flex-start;\n gap: ", ";\n /* Insets, so the row's padding follows density with its height (decision 0051) */\n padding: ", ";\n border-radius: ", ";\n transition: background-color ", " ", ", color ", " ", ";\n cursor: ", ";\n \n /* The shared row states (decision 0030). Only interactive, enabled rows respond to hover and\n press; the primary text is Typography, so the row colours it through a selector */\n ", "\n \n /* Focus visible */\n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n }\n"])), semantic.space[300], function (_a) {
|
|
41
41
|
var $spacing = _a.$spacing;
|
|
42
|
-
return $spacing === 'compact' ? "".concat(semantic.space
|
|
42
|
+
return $spacing === 'compact' ? "".concat(semantic.space.inset.sm, " ").concat(semantic.space.inset.md) : "".concat(semantic.space.inset.md, " ").concat(semantic.space.inset.lg);
|
|
43
43
|
}, semantic.radius.sm, duration.fast, easing.decelerate, duration.fast, easing.decelerate, function (_a) {
|
|
44
44
|
var $interactive = _a.$interactive,
|
|
45
45
|
$disabled = _a.$disabled;
|
|
@@ -84,7 +84,7 @@ var StyledExpandedContent = /*#__PURE__*/styled.div.withConfig({
|
|
|
84
84
|
},
|
|
85
85
|
displayName: "ListItem__StyledExpandedContent",
|
|
86
86
|
componentId: "sc-1wzzt21-6"
|
|
87
|
-
})(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n overflow: hidden;\n /* Padding collapses with the height, and visibility hides the content from\n keyboard and screen readers once the collapse finishes. */\n transition: max-height ", " ", ",\n padding ", " ", ",\n opacity ", " ", ",\n visibility ", " ", ";\n max-height: ", ";\n opacity: ", ";\n visibility: ", ";\n\n ", " {\n transition: opacity ", " ", ",\n visibility ", " ", ";\n }\n \n ", "\n"], ["\n overflow: hidden;\n /* Padding collapses with the height, and visibility hides the content from\n keyboard and screen readers once the collapse finishes. */\n transition: max-height ", " ", ",\n padding ", " ", ",\n opacity ", " ", ",\n visibility ", " ", ";\n max-height: ", ";\n opacity: ", ";\n visibility: ", ";\n\n ", " {\n transition: opacity ", " ", ",\n visibility ", " ", ";\n }\n \n ", "\n"])), duration.moderate, easing.decelerate, duration.moderate, easing.decelerate, duration.moderate, easing.decelerate, duration.moderate, easing.decelerate, function (_a) {
|
|
87
|
+
})(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n overflow: hidden;\n /* Padding collapses with the height, and visibility hides the content from\n keyboard and screen readers once the collapse finishes. */\n transition: max-height ", " ", ",\n padding ", " ", ",\n margin ", " ", ",\n opacity ", " ", ",\n visibility ", " ", ";\n max-height: ", ";\n opacity: ", ";\n visibility: ", ";\n\n ", " {\n transition: opacity ", " ", ",\n visibility ", " ", ";\n }\n \n ", "\n"], ["\n overflow: hidden;\n /* Padding collapses with the height, and visibility hides the content from\n keyboard and screen readers once the collapse finishes. */\n transition: max-height ", " ", ",\n padding ", " ", ",\n margin ", " ", ",\n opacity ", " ", ",\n visibility ", " ", ";\n max-height: ", ";\n opacity: ", ";\n visibility: ", ";\n\n ", " {\n transition: opacity ", " ", ",\n visibility ", " ", ";\n }\n \n ", "\n"])), duration.moderate, easing.decelerate, duration.moderate, easing.decelerate, duration.moderate, easing.decelerate, duration.moderate, easing.decelerate, duration.moderate, easing.decelerate, function (_a) {
|
|
88
88
|
var $expanded = _a.$expanded;
|
|
89
89
|
return $expanded ? '1000px' : '0';
|
|
90
90
|
}, function (_a) {
|
|
@@ -96,7 +96,7 @@ var StyledExpandedContent = /*#__PURE__*/styled.div.withConfig({
|
|
|
96
96
|
}, reducedMotion, duration.moderate, easing.decelerate, duration.moderate, easing.decelerate, function (_a) {
|
|
97
97
|
var $expanded = _a.$expanded,
|
|
98
98
|
$spacing = _a.$spacing;
|
|
99
|
-
return $expanded && "\n padding: ".concat($spacing === 'compact' ? "".concat(semantic.space[200], " ").concat(semantic.space[300], " ").concat(semantic.space[200], " ").concat(tokens.component.listItem.expandedIndent.compact) : "".concat(semantic.space[200], " ").concat(semantic.space[400], " ").concat(semantic.space[300], " ").concat(tokens.component.listItem.expandedIndent.comfortable), ";\n background-color: ").concat(semantic.surface.raised, ";\n border-radius: ").concat(semantic.radius.sm, ";\n margin: 0 ").concat($spacing === 'compact' ? semantic.space
|
|
99
|
+
return $expanded && "\n padding: ".concat($spacing === 'compact' ? "".concat(semantic.space[200], " ").concat(semantic.space[300], " ").concat(semantic.space[200], " ").concat(tokens.component.listItem.expandedIndent.compact) : "".concat(semantic.space[200], " ").concat(semantic.space[400], " ").concat(semantic.space[300], " ").concat(tokens.component.listItem.expandedIndent.comfortable), ";\n background-color: ").concat(semantic.surface.raised, ";\n border-radius: ").concat(semantic.radius.sm, ";\n /* The row's own insets, so the panel lines up with the row in every density (0051) */\n margin: 0 ").concat($spacing === 'compact' ? semantic.space.inset.md : semantic.space.inset.lg, " ").concat($spacing === 'compact' ? semantic.space.inset.sm : semantic.space.inset.md, ";\n ");
|
|
100
100
|
});
|
|
101
101
|
var ListItem = function ListItem(_a) {
|
|
102
102
|
var primary = _a.primary,
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FloatingAlign, type FloatingSide } from '../../../lib/floatingPosition.mjs';
|
|
3
|
+
export type MenuSide = FloatingSide;
|
|
4
|
+
export type MenuAlign = FloatingAlign;
|
|
5
|
+
export interface MenuProps {
|
|
6
|
+
/**
|
|
7
|
+
* The element that opens the menu, such as a Button or IconButton. Menu gives it
|
|
8
|
+
* `aria-haspopup`, `aria-expanded` and `aria-controls`, and the menu takes its name from it.
|
|
9
|
+
*/
|
|
10
|
+
trigger: React.ReactElement;
|
|
11
|
+
/** `MenuItem`, `MenuItemRadio`, `MenuItemCheckbox`, `MenuGroup` and `MenuDivider` */
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/** Whether the menu is open (controlled). Use with `onOpenChange`. */
|
|
14
|
+
open?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the menu starts open (uncontrolled).
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
defaultOpen?: boolean;
|
|
20
|
+
/** Called when the menu opens or closes */
|
|
21
|
+
onOpenChange?: (open: boolean) => void;
|
|
22
|
+
/**
|
|
23
|
+
* The side of the trigger it opens on. It flips when there's no room.
|
|
24
|
+
* @default 'bottom'
|
|
25
|
+
*/
|
|
26
|
+
side?: MenuSide;
|
|
27
|
+
/**
|
|
28
|
+
* Where it lines up along the trigger's edge.
|
|
29
|
+
* @default 'start'
|
|
30
|
+
*/
|
|
31
|
+
align?: MenuAlign;
|
|
32
|
+
/** Test identifier for the menu */
|
|
33
|
+
'data-testid'?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A menu of actions and choices that opens from a trigger (#329), following the WAI-ARIA menu
|
|
37
|
+
* button pattern. Not a select: for choosing a form value, use Dropdown.
|
|
38
|
+
*/
|
|
39
|
+
export declare const Menu: {
|
|
40
|
+
({ trigger, children, open: openProp, defaultOpen, onOpenChange, side, align, "data-testid": dataTestId, }: MenuProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
displayName: string;
|
|
42
|
+
};
|
|
43
|
+
interface ItemBaseProps {
|
|
44
|
+
/** The item's label */
|
|
45
|
+
children: React.ReactNode;
|
|
46
|
+
/** A leading Icon or Avatar. Decorative: the label names the item (decision 0028). */
|
|
47
|
+
icon?: React.ReactNode;
|
|
48
|
+
/** Secondary text under the label, such as a workspace's plan */
|
|
49
|
+
description?: React.ReactNode;
|
|
50
|
+
/**
|
|
51
|
+
* A keyboard shortcut shown at the end of the item: `label` is shown (such as "⌘K") and `keys` is
|
|
52
|
+
* exposed as `aria-keyshortcuts` (such as "Meta+K"). Display only: Menu doesn't bind the keys.
|
|
53
|
+
*/
|
|
54
|
+
shortcut?: {
|
|
55
|
+
label: string;
|
|
56
|
+
keys: string;
|
|
57
|
+
};
|
|
58
|
+
/** Whether the item can be activated. A disabled item can still be focused (WAI-ARIA). */
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
/** Text for typeahead, when the label isn't plain text */
|
|
61
|
+
textValue?: string;
|
|
62
|
+
/** Test identifier for the item */
|
|
63
|
+
'data-testid'?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface MenuItemProps extends ItemBaseProps {
|
|
66
|
+
/** Called when the item is activated. The menu then closes. */
|
|
67
|
+
onSelect?: () => void;
|
|
68
|
+
/**
|
|
69
|
+
* A destructive action, shown in the danger colour as ActionSheet's are.
|
|
70
|
+
* @default false
|
|
71
|
+
*/
|
|
72
|
+
destructive?: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface MenuItemRadioProps extends ItemBaseProps {
|
|
75
|
+
/** Whether this is the chosen item of its group */
|
|
76
|
+
checked: boolean;
|
|
77
|
+
/** Called when the item is chosen. The menu then closes. */
|
|
78
|
+
onSelect?: () => void;
|
|
79
|
+
}
|
|
80
|
+
export interface MenuItemCheckboxProps extends ItemBaseProps {
|
|
81
|
+
/** Whether the item is on */
|
|
82
|
+
checked: boolean;
|
|
83
|
+
/** Called with the new state when the item is toggled. The menu stays open. */
|
|
84
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
85
|
+
}
|
|
86
|
+
/** An action. Activating it closes the menu. */
|
|
87
|
+
export declare const MenuItem: {
|
|
88
|
+
({ onSelect, ...props }: MenuItemProps): import("react/jsx-runtime").JSX.Element;
|
|
89
|
+
displayName: string;
|
|
90
|
+
};
|
|
91
|
+
/** One choice of a set, inside a MenuGroup. Choosing it closes the menu. */
|
|
92
|
+
export declare const MenuItemRadio: {
|
|
93
|
+
({ onSelect, checked, ...props }: MenuItemRadioProps): import("react/jsx-runtime").JSX.Element;
|
|
94
|
+
displayName: string;
|
|
95
|
+
};
|
|
96
|
+
/** An on/off option, inside a MenuGroup. Toggling it keeps the menu open. */
|
|
97
|
+
export declare const MenuItemCheckbox: {
|
|
98
|
+
({ onCheckedChange, checked, ...props }: MenuItemCheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
99
|
+
displayName: string;
|
|
100
|
+
};
|
|
101
|
+
export interface MenuGroupProps {
|
|
102
|
+
/** A visible label for the group, which also names it for assistive technology */
|
|
103
|
+
label?: string;
|
|
104
|
+
/** The group's items */
|
|
105
|
+
children: React.ReactNode;
|
|
106
|
+
}
|
|
107
|
+
/** Groups related items. Radio and checkbox items always sit in a group. */
|
|
108
|
+
export declare const MenuGroup: {
|
|
109
|
+
({ label, children }: MenuGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
110
|
+
displayName: string;
|
|
111
|
+
};
|
|
112
|
+
/** Separates groups */
|
|
113
|
+
export declare const MenuDivider: {
|
|
114
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
115
|
+
displayName: string;
|
|
116
|
+
};
|
|
117
|
+
export {};
|