@common-origin/design-system 2.15.0 → 2.17.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 +1 -1
- package/dist/client.esm.js +949 -649
- package/dist/client.esm.js.map +1 -1
- package/dist/client.js +951 -647
- package/dist/client.js.map +1 -1
- package/dist/components/atoms/Button/Button.d.ts +13 -1
- package/dist/components/atoms/CategoryBadge/CategoryBadge.d.ts +12 -52
- package/dist/components/atoms/CategoryBadge/index.d.ts +1 -1
- package/dist/components/atoms/CategoryLabel/CategoryLabel.d.ts +69 -0
- package/dist/components/atoms/CategoryLabel/index.d.ts +2 -0
- package/dist/components/atoms/Chip/BooleanChip.d.ts +6 -1
- package/dist/components/atoms/Chip/Chip.d.ts +17 -12
- package/dist/components/atoms/Chip/FilterChip.d.ts +10 -24
- package/dist/components/atoms/Chip/InputChip.d.ts +27 -0
- package/dist/components/atoms/Chip/index.d.ts +1 -0
- package/dist/components/atoms/Chip/shared/types.d.ts +15 -1
- package/dist/components/atoms/Chip/shared/utils.d.ts +1 -85
- package/dist/components/atoms/DateFormatter/DateFormatter.d.ts +11 -1
- package/dist/components/atoms/Icon/Icon.d.ts +11 -0
- package/dist/components/atoms/StatusBadge/StatusBadge.d.ts +9 -55
- package/dist/components/atoms/StatusBadge/index.d.ts +1 -1
- package/dist/components/atoms/StatusLabel/StatusLabel.d.ts +17 -0
- package/dist/components/atoms/StatusLabel/StatusLabelBase.d.ts +49 -0
- package/dist/components/atoms/StatusLabel/index.d.ts +2 -0
- package/dist/components/atoms/Tag/Tag.d.ts +5 -0
- package/dist/components/atoms/index.d.ts +2 -0
- package/dist/components/molecules/Alert/Alert.d.ts +15 -2
- package/dist/components/molecules/DateGroup/DateGroup.d.ts +4 -1
- package/dist/components/molecules/InlineAlert/InlineAlert.d.ts +54 -0
- package/dist/components/molecules/InlineAlert/index.d.ts +2 -0
- package/dist/components/molecules/List/List.d.ts +3 -2
- package/dist/components/molecules/List/ListContext.d.ts +6 -0
- package/dist/components/molecules/List/ListItem.d.ts +5 -4
- package/dist/components/molecules/Modal/Modal.d.ts +6 -2
- package/dist/components/molecules/TabBar/TabBar.d.ts +8 -5
- package/dist/components/molecules/index.d.ts +1 -0
- package/dist/data.esm.js +89 -11
- package/dist/data.esm.js.map +1 -1
- package/dist/data.js +89 -11
- package/dist/data.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/styles/tokens.json +89 -11
- package/dist/tokens/index.esm.js +89 -11
- package/dist/tokens/index.esm.js.map +1 -1
- package/dist/tokens/index.js +89 -11
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/types/tokens.d.ts +81 -3
- package/dist/tokens.css +769 -0
- package/dist/tokens.css.d.ts +4 -0
- package/dist/types/tokens.d.ts +81 -3
- package/package.json +18 -6
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type IconName } from '../Icon';
|
|
3
|
+
/**
|
|
4
|
+
* Button variants. `accent` is the blue call to action one level above `primary`;
|
|
5
|
+
* use at most one per view (decision 0016).
|
|
6
|
+
*/
|
|
7
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'naked' | 'accent'
|
|
8
|
+
/** @deprecated Use `accent`. `emphasis` will be removed in 3.0. */
|
|
9
|
+
| 'emphasis' | 'danger';
|
|
3
10
|
export interface BaseButtonProps {
|
|
4
|
-
|
|
11
|
+
/**
|
|
12
|
+
* 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
|
+
* @default 'primary'
|
|
15
|
+
*/
|
|
16
|
+
variant?: ButtonVariant;
|
|
5
17
|
size?: 'small' | 'medium' | 'large';
|
|
6
18
|
url?: string;
|
|
7
19
|
purpose?: 'button' | 'link';
|
|
@@ -1,69 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type
|
|
3
|
-
|
|
4
|
-
* Category color options for CategoryBadge
|
|
5
|
-
*/
|
|
6
|
-
export type CategoryColor = 'blue' | 'purple' | 'pink' | 'yellow' | 'green' | 'red' | 'orange' | 'gray';
|
|
7
|
-
/**
|
|
8
|
-
* Visual variant options for CategoryBadge
|
|
9
|
-
*/
|
|
10
|
-
export type CategoryVariant = 'filled' | 'outlined' | 'minimal';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type CategoryLabelProps } from '../CategoryLabel/CategoryLabel';
|
|
3
|
+
export type { CategoryColor, CategoryVariant } from '../CategoryLabel/CategoryLabel';
|
|
11
4
|
/**
|
|
12
5
|
* Size options for CategoryBadge
|
|
6
|
+
* @deprecated Use `CategoryLabelSize`: CategoryBadge `small` is CategoryLabel `medium`, and
|
|
7
|
+
* `medium` is `large` (decision 0018).
|
|
13
8
|
*/
|
|
14
9
|
export type CategorySize = 'small' | 'medium';
|
|
15
10
|
/**
|
|
16
11
|
* Props for the CategoryBadge component
|
|
12
|
+
* @deprecated Use `CategoryLabelProps`. CategoryBadge is renamed CategoryLabel and is removed in
|
|
13
|
+
* 3.0 (decision 0018).
|
|
17
14
|
*/
|
|
18
|
-
export interface CategoryBadgeProps {
|
|
19
|
-
/**
|
|
20
|
-
* The category text to display
|
|
21
|
-
*/
|
|
22
|
-
children: ReactNode;
|
|
23
|
-
/**
|
|
24
|
-
* Color scheme for the badge
|
|
25
|
-
* @default 'blue'
|
|
26
|
-
*/
|
|
27
|
-
color?: CategoryColor;
|
|
28
|
-
/**
|
|
29
|
-
* Visual variant of the badge
|
|
30
|
-
* @default 'filled'
|
|
31
|
-
*/
|
|
32
|
-
variant?: CategoryVariant;
|
|
15
|
+
export interface CategoryBadgeProps extends Omit<CategoryLabelProps, 'size'> {
|
|
33
16
|
/**
|
|
34
17
|
* Size of the badge
|
|
35
18
|
* @default 'medium'
|
|
36
19
|
*/
|
|
37
20
|
size?: CategorySize;
|
|
38
|
-
/**
|
|
39
|
-
* Optional icon name to display
|
|
40
|
-
*/
|
|
41
|
-
icon?: IconName;
|
|
42
|
-
/**
|
|
43
|
-
* Test identifier for automated testing
|
|
44
|
-
*/
|
|
45
|
-
'data-testid'?: string;
|
|
46
|
-
/**
|
|
47
|
-
* Accessible label for the badge
|
|
48
|
-
*/
|
|
49
|
-
'aria-label'?: string;
|
|
50
21
|
}
|
|
51
22
|
/**
|
|
52
|
-
* CategoryBadge
|
|
53
|
-
*
|
|
54
|
-
* A static label for categorizing content with support for 8 color options,
|
|
55
|
-
* 3 visual variants, and optional icons. Perfect for categorizing
|
|
56
|
-
* financial transactions or content types.
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* ```tsx
|
|
60
|
-
* <CategoryBadge color="orange" icon="restaurant">
|
|
61
|
-
* Food & Dining
|
|
62
|
-
* </CategoryBadge>
|
|
23
|
+
* CategoryBadge displays a category label.
|
|
63
24
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* ```
|
|
25
|
+
* @deprecated Renamed to `CategoryLabel` (same `color` and `variant`). Map `size="small"` to
|
|
26
|
+
* `"medium"`, and `size="medium"` (or no size) to `"large"`, CategoryLabel's default.
|
|
27
|
+
* CategoryBadge is removed in 3.0 (decision 0018).
|
|
68
28
|
*/
|
|
69
29
|
export declare const CategoryBadge: React.FC<CategoryBadgeProps>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { CategoryBadge } from './CategoryBadge';
|
|
2
|
-
export type { CategoryBadgeProps,
|
|
2
|
+
export type { CategoryBadgeProps, CategorySize } from './CategoryBadge';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import type { IconName } from '../../../types/icons';
|
|
3
|
+
/**
|
|
4
|
+
* Category color options for CategoryLabel
|
|
5
|
+
*/
|
|
6
|
+
export type CategoryColor = 'blue' | 'purple' | 'pink' | 'yellow' | 'green' | 'red' | 'orange' | 'gray';
|
|
7
|
+
/**
|
|
8
|
+
* Visual variant options for CategoryLabel
|
|
9
|
+
*/
|
|
10
|
+
export type CategoryVariant = 'filled' | 'outlined' | 'minimal';
|
|
11
|
+
/**
|
|
12
|
+
* Size options for CategoryLabel: medium (24px) or large (32px), on the decision 0018 scale
|
|
13
|
+
*/
|
|
14
|
+
export type CategoryLabelSize = 'medium' | 'large';
|
|
15
|
+
/**
|
|
16
|
+
* Props for the CategoryLabel component
|
|
17
|
+
*/
|
|
18
|
+
export interface CategoryLabelProps {
|
|
19
|
+
/**
|
|
20
|
+
* The category text to display
|
|
21
|
+
*/
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Color scheme for the label
|
|
25
|
+
* @default 'blue'
|
|
26
|
+
*/
|
|
27
|
+
color?: CategoryColor;
|
|
28
|
+
/**
|
|
29
|
+
* Visual variant of the label
|
|
30
|
+
* @default 'filled'
|
|
31
|
+
*/
|
|
32
|
+
variant?: CategoryVariant;
|
|
33
|
+
/**
|
|
34
|
+
* Size: medium (24px) or large (32px)
|
|
35
|
+
* @default 'large'
|
|
36
|
+
*/
|
|
37
|
+
size?: CategoryLabelSize;
|
|
38
|
+
/**
|
|
39
|
+
* Optional icon name to display
|
|
40
|
+
*/
|
|
41
|
+
icon?: IconName;
|
|
42
|
+
/**
|
|
43
|
+
* Test identifier for automated testing
|
|
44
|
+
*/
|
|
45
|
+
'data-testid'?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Accessible label, announced instead of the visible text (for example "Category: Food & Dining").
|
|
48
|
+
* Rendered as visually hidden text, because a plain label has no role that can be named (#78).
|
|
49
|
+
*/
|
|
50
|
+
'aria-label'?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* CategoryLabel colour-codes an item's category, such as a transaction's (decision 0018).
|
|
54
|
+
*
|
|
55
|
+
* A static, chip-like label with 8 category colours, 3 visual variants and an optional icon.
|
|
56
|
+
* Category colours carry no status meaning; for status use StatusLabel.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* <CategoryLabel color="orange" icon="creditCard">
|
|
61
|
+
* Shopping
|
|
62
|
+
* </CategoryLabel>
|
|
63
|
+
*
|
|
64
|
+
* <CategoryLabel color="blue" variant="outlined" size="medium">
|
|
65
|
+
* Travel
|
|
66
|
+
* </CategoryLabel>
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export declare const CategoryLabel: React.FC<CategoryLabelProps>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseChipProps } from './shared/types';
|
|
3
|
+
/** @deprecated Becomes `FilterChipProps` in 3.0 (decision 0016). */
|
|
3
4
|
export interface BooleanChipProps extends BaseChipProps {
|
|
4
5
|
/** Whether the chip is in selected state */
|
|
5
6
|
selected: boolean;
|
|
@@ -18,6 +19,10 @@ export interface BooleanChipProps extends BaseChipProps {
|
|
|
18
19
|
* - Entire chip is clickable to toggle
|
|
19
20
|
* - Keyboard activation with Space or Enter
|
|
20
21
|
* - Uses checkbox role with aria-checked
|
|
21
|
-
* -
|
|
22
|
+
* - Light-blue fill and blue text when selected and enabled; disabled colours when disabled
|
|
23
|
+
*
|
|
24
|
+
* @deprecated Becomes `FilterChip` in 3.0, with the same props. Keep using `BooleanChip`
|
|
25
|
+
* until you upgrade; in 3.0, replace `FilterChip` with `InputChip` first, then
|
|
26
|
+
* `BooleanChip` with `FilterChip` (decision 0016).
|
|
22
27
|
*/
|
|
23
28
|
export declare const BooleanChip: React.FC<BooleanChipProps>;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseChipProps, ChipVariant, LegacyVariant } from './shared/types';
|
|
3
3
|
export interface ChipProps extends BaseChipProps {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Visual style. Only `default` stays in 3.0. `emphasis`, `subtle`, `interactive`, `light`
|
|
6
|
+
* and `dark` are deprecated and will be removed (decision 0016).
|
|
7
|
+
* @default 'default'
|
|
8
|
+
*/
|
|
5
9
|
variant?: ChipVariant | LegacyVariant;
|
|
6
|
-
/**
|
|
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
|
+
*/
|
|
7
15
|
onClick?: () => void;
|
|
8
16
|
/** Custom ARIA role override */
|
|
9
17
|
role?: string;
|
|
@@ -11,18 +19,15 @@ export interface ChipProps extends BaseChipProps {
|
|
|
11
19
|
title?: string;
|
|
12
20
|
}
|
|
13
21
|
/**
|
|
14
|
-
* Chip -
|
|
22
|
+
* Chip - a static, non-interactive label for tags, categories and metadata.
|
|
15
23
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* -
|
|
19
|
-
* - BooleanChip:
|
|
24
|
+
* Chips are classified by job (decision 0016):
|
|
25
|
+
* - Chip: a static label (`default` variant only)
|
|
26
|
+
* - InputChip: a removable value, such as an applied filter (formerly `FilterChip`)
|
|
27
|
+
* - BooleanChip: toggles a filter on and off (becomes `FilterChip` in 3.0)
|
|
20
28
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* - emphasis: High-contrast dark background
|
|
24
|
-
* - subtle: Light background for secondary info
|
|
25
|
-
* - interactive: Blue background with hover states
|
|
29
|
+
* The `emphasis`, `subtle`, `interactive`, `light` and `dark` variants and `onClick` are
|
|
30
|
+
* deprecated and will be removed in 3.0.
|
|
26
31
|
*/
|
|
27
32
|
export declare const Chip: React.FC<ChipProps>;
|
|
28
33
|
export interface LegacyChipProps {
|
|
@@ -1,27 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { BaseChipProps } from './shared/types';
|
|
3
|
-
export interface FilterChipProps extends BaseChipProps {
|
|
4
|
-
/** Whether the filter is in selected/applied state */
|
|
5
|
-
selected?: boolean;
|
|
6
|
-
/** Callback function when the chip is dismissed via close button or keyboard */
|
|
7
|
-
onDismiss?: () => void;
|
|
8
|
-
/** Custom ARIA role override */
|
|
9
|
-
role?: string;
|
|
10
|
-
}
|
|
1
|
+
import { type InputChipProps } from './InputChip';
|
|
11
2
|
/**
|
|
12
|
-
*
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*
|
|
3
|
+
* @deprecated Renamed to `InputChipProps`. In 3.0 `FilterChipProps` becomes the props of the toggle chip.
|
|
4
|
+
*/
|
|
5
|
+
export type FilterChipProps = InputChipProps;
|
|
6
|
+
/**
|
|
7
|
+
* FilterChip - a removable chip with an optional selected state.
|
|
17
8
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* - Optional close (×) button when onDismiss is provided
|
|
22
|
-
* - Keyboard dismissal with Delete or Backspace keys (when dismissible)
|
|
23
|
-
* - Non-clickable body (only close button is interactive when present)
|
|
24
|
-
* - Uses subtle/interactive background styling based on selected state
|
|
25
|
-
* - Announces as "status" to screen readers
|
|
9
|
+
* @deprecated Renamed to `InputChip`; in 3.0 `FilterChip` becomes the toggle chip (today's
|
|
10
|
+
* `BooleanChip`). Replace `FilterChip` with `InputChip` first, then `BooleanChip` with
|
|
11
|
+
* `FilterChip` when you upgrade to 3.0 (decision 0016).
|
|
26
12
|
*/
|
|
27
|
-
export declare const FilterChip:
|
|
13
|
+
export declare const FilterChip: import("react").FC<InputChipProps>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseChipProps } from './shared/types';
|
|
3
|
+
export interface InputChipProps extends BaseChipProps {
|
|
4
|
+
/** Whether the filter is in selected/applied state */
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
/** Callback function when the chip is dismissed via close button or keyboard */
|
|
7
|
+
onDismiss?: () => void;
|
|
8
|
+
/** Custom ARIA role override */
|
|
9
|
+
role?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* InputChip - A removable value, such as an applied filter, with an optional selected state
|
|
13
|
+
*
|
|
14
|
+
* Use this component to show values the user has entered or applied, such as filters.
|
|
15
|
+
* When selected, displays a checkmark on the light-blue selected treatment (decision 0016).
|
|
16
|
+
* A selected disabled chip uses the disabled colours and keeps its checkmark.
|
|
17
|
+
* Optionally dismissible when onDismiss is provided.
|
|
18
|
+
*
|
|
19
|
+
* Features:
|
|
20
|
+
* - Shows checkmark icon when selected
|
|
21
|
+
* - Light-blue fill and blue text when selected and enabled; disabled colours when disabled
|
|
22
|
+
* - Optional close (×) button when onDismiss is provided
|
|
23
|
+
* - Keyboard dismissal with Delete or Backspace keys (when dismissible)
|
|
24
|
+
* - Non-clickable body (only close button is interactive when present)
|
|
25
|
+
* - Announces as "status" to screen readers
|
|
26
|
+
*/
|
|
27
|
+
export declare const InputChip: React.FC<InputChipProps>;
|
|
@@ -7,7 +7,17 @@ export interface BaseChipProps {
|
|
|
7
7
|
'aria-label'?: string;
|
|
8
8
|
'aria-describedby'?: string;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Visual variants for the static Chip. Only `default` stays in 3.0 (decision 0016):
|
|
12
|
+
* chips are classified by job, not emphasis.
|
|
13
|
+
*/
|
|
14
|
+
export type ChipVariant = 'default'
|
|
15
|
+
/** @deprecated Removed in 3.0. Chips have no emphasis levels; use `default`. */
|
|
16
|
+
| 'emphasis'
|
|
17
|
+
/** @deprecated Removed in 3.0. Use `default`. */
|
|
18
|
+
| 'subtle'
|
|
19
|
+
/** @deprecated Removed in 3.0. For a clickable action use a Button; for a toggle use `BooleanChip` (`FilterChip` in 3.0). */
|
|
20
|
+
| 'interactive';
|
|
11
21
|
export interface InternalStyledProps {
|
|
12
22
|
$variant: ChipVariant;
|
|
13
23
|
$size: BaseChipProps['size'];
|
|
@@ -15,4 +25,8 @@ export interface InternalStyledProps {
|
|
|
15
25
|
$clickable?: boolean;
|
|
16
26
|
$selected?: boolean;
|
|
17
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Legacy Chip variants.
|
|
30
|
+
* @deprecated Removed in 3.0. `light` is the same as `default`; `dark` maps to the deprecated `emphasis`. Use `default`.
|
|
31
|
+
*/
|
|
18
32
|
export type LegacyVariant = 'light' | 'dark';
|
|
@@ -1,88 +1,4 @@
|
|
|
1
1
|
import { ChipVariant, BaseChipProps } from './types';
|
|
2
|
-
declare const chip: {
|
|
3
|
-
closeButton: {
|
|
4
|
-
size: string;
|
|
5
|
-
};
|
|
6
|
-
default: {
|
|
7
|
-
backgroundColor: string;
|
|
8
|
-
textColor: string;
|
|
9
|
-
borderRadius: string;
|
|
10
|
-
padding: string;
|
|
11
|
-
font: string;
|
|
12
|
-
};
|
|
13
|
-
hover: {
|
|
14
|
-
backgroundColor: string;
|
|
15
|
-
};
|
|
16
|
-
active: {
|
|
17
|
-
backgroundColor: string;
|
|
18
|
-
};
|
|
19
|
-
focus: {
|
|
20
|
-
outline: string;
|
|
21
|
-
outlineOffset: string;
|
|
22
|
-
};
|
|
23
|
-
disabled: {
|
|
24
|
-
backgroundColor: string;
|
|
25
|
-
textColor: string;
|
|
26
|
-
};
|
|
27
|
-
variants: {
|
|
28
|
-
emphasis: {
|
|
29
|
-
backgroundColor: string;
|
|
30
|
-
textColor: string;
|
|
31
|
-
hover: {
|
|
32
|
-
backgroundColor: string;
|
|
33
|
-
};
|
|
34
|
-
active: {
|
|
35
|
-
backgroundColor: string;
|
|
36
|
-
};
|
|
37
|
-
disabled: {
|
|
38
|
-
backgroundColor: string;
|
|
39
|
-
textColor: string;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
subtle: {
|
|
43
|
-
backgroundColor: string;
|
|
44
|
-
textColor: string;
|
|
45
|
-
hover: {
|
|
46
|
-
backgroundColor: string;
|
|
47
|
-
};
|
|
48
|
-
active: {
|
|
49
|
-
backgroundColor: string;
|
|
50
|
-
};
|
|
51
|
-
disabled: {
|
|
52
|
-
backgroundColor: string;
|
|
53
|
-
textColor: string;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
interactive: {
|
|
57
|
-
backgroundColor: string;
|
|
58
|
-
textColor: string;
|
|
59
|
-
hover: {
|
|
60
|
-
backgroundColor: string;
|
|
61
|
-
};
|
|
62
|
-
active: {
|
|
63
|
-
backgroundColor: string;
|
|
64
|
-
};
|
|
65
|
-
disabled: {
|
|
66
|
-
backgroundColor: string;
|
|
67
|
-
textColor: string;
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
sizes: {
|
|
72
|
-
small: {
|
|
73
|
-
padding: string;
|
|
74
|
-
font: string;
|
|
75
|
-
};
|
|
76
|
-
medium: {
|
|
77
|
-
padding: string;
|
|
78
|
-
font: string;
|
|
79
|
-
};
|
|
80
|
-
large: {
|
|
81
|
-
padding: string;
|
|
82
|
-
font: string;
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
2
|
interface StyledChipProps {
|
|
87
3
|
$variant: ChipVariant;
|
|
88
4
|
$size: BaseChipProps['size'];
|
|
@@ -92,4 +8,4 @@ interface StyledChipProps {
|
|
|
92
8
|
}
|
|
93
9
|
export declare const getVariantStyles: ({ $variant, $selected, $clickable, $disabled }: StyledChipProps) => string;
|
|
94
10
|
export declare const getSizeStyles: ({ $size }: StyledChipProps) => string;
|
|
95
|
-
export {
|
|
11
|
+
export {};
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* How DateFormatter shows a date. `'relative'` is deprecated: it has always behaved exactly like
|
|
4
|
+
* `'smart'`, so use `'smart'`. It keeps working until it is removed in 3.0 (#82).
|
|
5
|
+
*/
|
|
2
6
|
export type DateFormatMode = 'absolute' | 'relative' | 'smart';
|
|
3
7
|
export interface DateFormatterProps {
|
|
4
8
|
/** ISO date string to format */
|
|
5
9
|
dateString: string;
|
|
6
10
|
/** Format pattern (defaults to 'yyyy') */
|
|
7
11
|
formatString?: string;
|
|
8
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* `'absolute'` always uses `formatString`. `'smart'` shows "Today", "Yesterday" or the day name
|
|
14
|
+
* 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
|
+
* @default 'absolute'
|
|
18
|
+
*/
|
|
9
19
|
mode?: DateFormatMode;
|
|
10
20
|
/** Optional data-testid for testing */
|
|
11
21
|
'data-testid'?: string;
|
|
@@ -5,6 +5,17 @@ export interface IconProps {
|
|
|
5
5
|
name: IconName;
|
|
6
6
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
7
7
|
iconColor?: 'default' | 'emphasis' | 'subdued' | 'disabled' | 'inverse' | 'interactive' | 'error' | 'success' | 'warning' | 'inherit';
|
|
8
|
+
/**
|
|
9
|
+
* Makes the icon meaningful: it's announced as an image with this name. Without `aria-label`
|
|
10
|
+
* or `title`, the icon is decorative and hidden from assistive technology (#85). Use a
|
|
11
|
+
* human-readable name, never the internal icon name; `icons.json`'s `ariaLabelDefault` is a
|
|
12
|
+
* starting point.
|
|
13
|
+
*/
|
|
14
|
+
'aria-label'?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Like `aria-label`, and also shown as a tooltip. `aria-label` wins if both are given.
|
|
17
|
+
*/
|
|
18
|
+
title?: string;
|
|
8
19
|
'data-testid'?: string;
|
|
9
20
|
}
|
|
10
21
|
export declare const Icon: FC<IconProps>;
|
|
@@ -1,69 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
export type StatusType = 'pending' | 'completed' | 'failed' | 'cancelled' | 'processing' | 'scheduled';
|
|
6
|
-
/**
|
|
7
|
-
* Size options for StatusBadge
|
|
8
|
-
*/
|
|
9
|
-
export type StatusSize = 'small' | 'medium';
|
|
2
|
+
import { type StatusLabelProps } from '../StatusLabel/StatusLabelBase';
|
|
3
|
+
export type { StatusType, StatusSize } from '../StatusLabel/StatusLabelBase';
|
|
10
4
|
/**
|
|
11
5
|
* Props for the StatusBadge component
|
|
6
|
+
* @deprecated Use `StatusLabelProps`. StatusBadge is renamed StatusLabel and is removed in 3.0
|
|
7
|
+
* (decision 0018).
|
|
12
8
|
*/
|
|
13
|
-
export interface StatusBadgeProps {
|
|
14
|
-
/**
|
|
15
|
-
* The status type to display
|
|
16
|
-
*/
|
|
17
|
-
status: StatusType;
|
|
18
|
-
/**
|
|
19
|
-
* Optional custom label (defaults to status name)
|
|
20
|
-
*/
|
|
21
|
-
label?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Size of the badge
|
|
24
|
-
* @default 'medium'
|
|
25
|
-
*/
|
|
26
|
-
size?: StatusSize;
|
|
9
|
+
export interface StatusBadgeProps extends StatusLabelProps {
|
|
27
10
|
/**
|
|
28
11
|
* Whether to show the icon
|
|
29
12
|
* @default true
|
|
13
|
+
* @deprecated StatusLabel always shows the icon, so status is never conveyed by colour alone.
|
|
30
14
|
*/
|
|
31
15
|
showIcon?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Whether status changes should be announced to screen readers
|
|
34
|
-
* @default true
|
|
35
|
-
*/
|
|
36
|
-
liveRegion?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Test identifier for automated testing
|
|
39
|
-
*/
|
|
40
|
-
'data-testid'?: string;
|
|
41
|
-
/**
|
|
42
|
-
* Accessible label override
|
|
43
|
-
*/
|
|
44
|
-
'aria-label'?: string;
|
|
45
16
|
}
|
|
46
17
|
/**
|
|
47
|
-
* StatusBadge
|
|
48
|
-
*
|
|
49
|
-
* Displays status with appropriate color, icon, and supports live updates for screen readers.
|
|
50
|
-
* Maps to 6 common status types with semantic color tokens.
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* ```tsx
|
|
54
|
-
* <StatusBadge status="completed" />
|
|
55
|
-
*
|
|
56
|
-
* <StatusBadge
|
|
57
|
-
* status="pending"
|
|
58
|
-
* label="Awaiting approval"
|
|
59
|
-
* size="small"
|
|
60
|
-
* />
|
|
18
|
+
* StatusBadge displays a transaction or task status.
|
|
61
19
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* showIcon={false}
|
|
65
|
-
* liveRegion={true}
|
|
66
|
-
* />
|
|
67
|
-
* ```
|
|
20
|
+
* @deprecated Renamed to `StatusLabel` (same `status`, `size`, `label`, `liveRegion`), which always
|
|
21
|
+
* shows the icon. StatusBadge is removed in 3.0 (decision 0018).
|
|
68
22
|
*/
|
|
69
23
|
export declare const StatusBadge: React.FC<StatusBadgeProps>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { StatusBadge } from './StatusBadge';
|
|
2
|
-
export type { StatusBadgeProps
|
|
2
|
+
export type { StatusBadgeProps } from './StatusBadge';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StatusLabelProps } from './StatusLabelBase';
|
|
3
|
+
export type { StatusLabelProps, StatusType, StatusSize } from './StatusLabelBase';
|
|
4
|
+
/**
|
|
5
|
+
* StatusLabel conveys the status of something, such as a transaction or task (decision 0018).
|
|
6
|
+
*
|
|
7
|
+
* Uses only the status colour tokens and always shows an icon with its text, so status is never
|
|
8
|
+
* conveyed by colour alone. Not interactive. Announces changes politely to screen readers.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <StatusLabel status="completed" />
|
|
13
|
+
*
|
|
14
|
+
* <StatusLabel status="pending" label="Awaiting approval" size="small" />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const StatusLabel: React.FC<StatusLabelProps>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Status type options for StatusLabel
|
|
4
|
+
*/
|
|
5
|
+
export type StatusType = 'pending' | 'completed' | 'failed' | 'cancelled' | 'processing' | 'scheduled';
|
|
6
|
+
/**
|
|
7
|
+
* Size options for StatusLabel
|
|
8
|
+
*/
|
|
9
|
+
export type StatusSize = 'small' | 'medium';
|
|
10
|
+
/**
|
|
11
|
+
* Props shared by StatusLabel and the deprecated StatusBadge
|
|
12
|
+
*/
|
|
13
|
+
export interface StatusLabelProps {
|
|
14
|
+
/**
|
|
15
|
+
* The status type to display
|
|
16
|
+
*/
|
|
17
|
+
status: StatusType;
|
|
18
|
+
/**
|
|
19
|
+
* Optional custom label (defaults to status name)
|
|
20
|
+
*/
|
|
21
|
+
label?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Size: small (20px) or medium (24px)
|
|
24
|
+
* @default 'medium'
|
|
25
|
+
*/
|
|
26
|
+
size?: StatusSize;
|
|
27
|
+
/**
|
|
28
|
+
* Whether status changes should be announced to screen readers
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
liveRegion?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Test identifier for automated testing
|
|
34
|
+
*/
|
|
35
|
+
'data-testid'?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Accessible label override. Used as the status's name and announced instead of the visible
|
|
38
|
+
* text and icon (#78).
|
|
39
|
+
*/
|
|
40
|
+
'aria-label'?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Shared implementation of StatusLabel and the deprecated StatusBadge. Internal: not exported
|
|
44
|
+
* from the package. `showIcon` exists only for StatusBadge; StatusLabel always shows the icon
|
|
45
|
+
* (decision 0018).
|
|
46
|
+
*/
|
|
47
|
+
export declare const StatusLabelBase: React.FC<StatusLabelProps & {
|
|
48
|
+
showIcon?: boolean;
|
|
49
|
+
}>;
|
|
@@ -14,6 +14,11 @@ export interface TagProps {
|
|
|
14
14
|
* @default true
|
|
15
15
|
*/
|
|
16
16
|
border?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Size: small (20px) for dense layouts, or medium (24px). Decision 0018 size scale.
|
|
19
|
+
* @default 'medium'
|
|
20
|
+
*/
|
|
21
|
+
size?: 'small' | 'medium';
|
|
17
22
|
/**
|
|
18
23
|
* Test identifier for automated testing
|
|
19
24
|
*/
|