@calcifer-design/ui 0.5.0 → 0.7.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/dist/components/Alert/Alert.d.ts +5 -2
- package/dist/components/Alert/Alert.js +1 -0
- package/dist/components/Alert/Alert.module.js +5 -5
- package/dist/components/Alert/Alert_module.css +20 -17
- package/dist/components/Avatar/Avatar.d.ts +16 -2
- package/dist/components/Avatar/Avatar.js +23 -7
- package/dist/components/Avatar/Avatar.module.js +3 -3
- package/dist/components/Avatar/Avatar_module.css +58 -17
- package/dist/components/Avatar/avatarColor.d.ts +12 -0
- package/dist/components/Avatar/avatarColor.js +12 -0
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +37 -0
- package/dist/components/AvatarGroup/AvatarGroup.js +52 -0
- package/dist/components/AvatarGroup/AvatarGroup.module.js +8 -0
- package/dist/components/AvatarGroup/AvatarGroup_module.css +67 -0
- package/dist/components/Breadcrumb/Breadcrumb.module.js +6 -6
- package/dist/components/Breadcrumb/Breadcrumb_module.css +7 -7
- package/dist/components/Button/Button.d.ts +40 -4
- package/dist/components/Button/Button.js +48 -11
- package/dist/components/Button/Button.module.js +6 -2
- package/dist/components/Button/Button_module.css +143 -17
- package/dist/components/Button/LinkButton.d.ts +10 -3
- package/dist/components/Button/LinkButton.js +16 -5
- package/dist/components/Card/Card.module.js +5 -5
- package/dist/components/Card/Card_module.css +15 -9
- package/dist/components/CardList/CardList.module.js +3 -3
- package/dist/components/CardList/CardList_module.css +5 -3
- package/dist/components/Checkbox/Checkbox.module.js +2 -2
- package/dist/components/Checkbox/Checkbox_module.css +3 -3
- package/dist/components/ChoiceCard/ChoiceCard.d.ts +34 -0
- package/dist/components/ChoiceCard/ChoiceCard.js +81 -0
- package/dist/components/ChoiceCard/ChoiceCard.module.js +12 -0
- package/dist/components/ChoiceCard/ChoiceCard_module.css +161 -0
- package/dist/components/Collapsible/Collapsible.d.ts +39 -0
- package/dist/components/Collapsible/Collapsible.js +63 -0
- package/dist/components/Collapsible/Collapsible.module.js +10 -0
- package/dist/components/Collapsible/Collapsible_module.css +80 -0
- package/dist/components/DataGrid/DataGrid.d.ts +3 -0
- package/dist/components/DataGrid/DataGrid.js +436 -0
- package/dist/components/DataGrid/DataGrid.module.js +36 -0
- package/dist/components/DataGrid/DataGrid_module.css +372 -0
- package/dist/components/DataGrid/GridCardHeader.d.ts +16 -0
- package/dist/components/DataGrid/GridCardHeader.js +40 -0
- package/dist/components/DataGrid/GridCheckbox.d.ts +15 -0
- package/dist/components/DataGrid/GridCheckbox.js +25 -0
- package/dist/components/DataGrid/GridHeaderCell.d.ts +14 -0
- package/dist/components/DataGrid/GridHeaderCell.js +29 -0
- package/dist/components/DataGrid/GridHeaderRow.d.ts +35 -0
- package/dist/components/DataGrid/GridHeaderRow.js +56 -0
- package/dist/components/DataGrid/GridRow.d.ts +69 -0
- package/dist/components/DataGrid/GridRow.js +139 -0
- package/dist/components/DataGrid/GridStateRows.d.ts +24 -0
- package/dist/components/DataGrid/GridStateRows.js +59 -0
- package/dist/components/DataGrid/columns.d.ts +40 -0
- package/dist/components/DataGrid/columns.js +37 -0
- package/dist/components/DataGrid/labels.d.ts +20 -0
- package/dist/components/DataGrid/labels.js +25 -0
- package/dist/components/DataGrid/types.d.ts +88 -0
- package/dist/components/DataGrid/types.js +0 -0
- package/dist/components/DataGrid/useGridEntries.d.ts +17 -0
- package/dist/components/DataGrid/useGridEntries.js +40 -0
- package/dist/components/DataGrid/useGridHighlight.d.ts +16 -0
- package/dist/components/DataGrid/useGridHighlight.js +24 -0
- package/dist/components/DataGrid/useGridKeyboard.d.ts +50 -0
- package/dist/components/DataGrid/useGridKeyboard.js +242 -0
- package/dist/components/DataGrid/useGridMetrics.d.ts +13 -0
- package/dist/components/DataGrid/useGridMetrics.js +35 -0
- package/dist/components/DataGrid/useLatest.d.ts +7 -0
- package/dist/components/DataGrid/useLatest.js +9 -0
- package/dist/components/DataGrid/useLoadMore.d.ts +30 -0
- package/dist/components/DataGrid/useLoadMore.js +39 -0
- package/dist/components/DataGrid/useRowExpansion.d.ts +14 -0
- package/dist/components/DataGrid/useRowExpansion.js +21 -0
- package/dist/components/DataGrid/useRowSelection.d.ts +43 -0
- package/dist/components/DataGrid/useRowSelection.js +107 -0
- package/dist/components/DataTable/DataTable.module.js +9 -9
- package/dist/components/DataTable/DataTable_module.css +24 -21
- package/dist/components/DatePicker/DatePicker.d.ts +15 -1
- package/dist/components/DatePicker/DatePicker.js +30 -5
- package/dist/components/DatePicker/DatePicker.module.js +10 -10
- package/dist/components/DatePicker/DatePicker_module.css +22 -21
- package/dist/components/Descriptions/Descriptions.module.js +4 -4
- package/dist/components/Descriptions/Descriptions_module.css +12 -8
- package/dist/components/Dialog/Dialog.d.ts +30 -2
- package/dist/components/Dialog/Dialog.js +52 -11
- package/dist/components/Dialog/Dialog.module.js +8 -6
- package/dist/components/Dialog/Dialog_module.css +60 -13
- package/dist/components/EmptyState/EmptyState.d.ts +41 -0
- package/dist/components/EmptyState/EmptyState.js +39 -0
- package/dist/components/EmptyState/EmptyState.module.js +9 -0
- package/dist/components/EmptyState/EmptyState_module.css +65 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +5 -2
- package/dist/components/ErrorBoundary/ErrorBoundary.module.js +1 -1
- package/dist/components/ErrorBoundary/ErrorBoundary_module.css +1 -1
- package/dist/components/Field/AffixInput.d.ts +28 -0
- package/dist/components/Field/AffixInput.js +50 -0
- package/dist/components/Field/GroupFrame.d.ts +19 -0
- package/dist/components/Field/GroupFrame.js +31 -0
- package/dist/components/Field/PickerField.d.ts +8 -2
- package/dist/components/Field/PickerField.js +12 -8
- package/dist/components/Field/PickerField.module.js +4 -4
- package/dist/components/Field/PickerField_module.css +11 -6
- package/dist/components/FilterBar/FilterBar.module.js +9 -9
- package/dist/components/FilterBar/FilterBar_module.css +13 -13
- package/dist/components/Form/Form.d.ts +9 -7
- package/dist/components/Form/Form.module.js +1 -1
- package/dist/components/Form/Form_module.css +1 -1
- package/dist/components/IconButton/IconButton.d.ts +1 -1
- package/dist/components/IconButton/IconButton.module.js +2 -2
- package/dist/components/IconButton/IconButton_module.css +28 -17
- package/dist/components/Menu/Menu.js +3 -0
- package/dist/components/Menu/Menu.module.js +2 -2
- package/dist/components/Menu/Menu_module.css +5 -4
- package/dist/components/NavMenu/NavMenu.d.ts +27 -4
- package/dist/components/NavMenu/NavMenu.js +10 -8
- package/dist/components/NavMenu/NavMenu.module.js +6 -6
- package/dist/components/NavMenu/NavMenu_module.css +37 -19
- package/dist/components/NavMenu/currentPath.d.ts +9 -0
- package/dist/components/NavMenu/currentPath.js +5 -0
- package/dist/components/PageHeading/PageHeading.module.js +3 -3
- package/dist/components/PageHeading/PageHeading_module.css +12 -9
- package/dist/components/PageShell/PageShell.module.js +5 -5
- package/dist/components/PageShell/PageShell_module.css +9 -9
- package/dist/components/Popover/Popover.js +3 -0
- package/dist/components/Popover/Popover.module.js +2 -2
- package/dist/components/Popover/Popover_module.css +6 -3
- package/dist/components/ProgressBar/ProgressBar.d.ts +55 -0
- package/dist/components/ProgressBar/ProgressBar.js +76 -0
- package/dist/components/ProgressBar/ProgressBar.module.js +12 -0
- package/dist/components/ProgressBar/ProgressBar_module.css +120 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +35 -49
- package/dist/components/RadioGroup/RadioGroup.module.js +2 -2
- package/dist/components/RadioGroup/RadioGroup_module.css +2 -2
- package/dist/components/SearchField/SearchField.d.ts +32 -0
- package/dist/components/SearchField/SearchField.js +100 -0
- package/dist/components/SearchField/SearchField.module.js +8 -0
- package/dist/components/SearchField/SearchField_module.css +34 -0
- package/dist/components/Segmented/Segmented.d.ts +23 -6
- package/dist/components/Segmented/Segmented.js +37 -20
- package/dist/components/Segmented/Segmented.module.js +4 -3
- package/dist/components/Segmented/Segmented_module.css +46 -20
- package/dist/components/Select/Select.js +3 -0
- package/dist/components/Select/Select.module.js +5 -5
- package/dist/components/Select/Select_module.css +12 -11
- package/dist/components/Skeleton/Skeleton.module.js +3 -3
- package/dist/components/Skeleton/Skeleton_module.css +9 -9
- package/dist/components/SkipLink/SkipLink.module.js +1 -1
- package/dist/components/SkipLink/SkipLink_module.css +4 -4
- package/dist/components/Spinner/Spinner.module.js +3 -3
- package/dist/components/Spinner/Spinner_module.css +7 -7
- package/dist/components/StatusDot/StatusDot.module.js +5 -5
- package/dist/components/StatusDot/StatusDot_module.css +11 -11
- package/dist/components/Steps/Steps.module.js +6 -6
- package/dist/components/Steps/Steps_module.css +19 -19
- package/dist/components/Switch/Switch.module.js +2 -2
- package/dist/components/Switch/Switch_module.css +5 -5
- package/dist/components/TabBar/TabBar.d.ts +26 -0
- package/dist/components/TabBar/TabBar.js +52 -0
- package/dist/components/TabBar/TabBar.module.js +11 -0
- package/dist/components/TabBar/TabBar_module.css +100 -0
- package/dist/components/Tabs/Tabs.module.js +4 -4
- package/dist/components/Tabs/Tabs_module.css +9 -8
- package/dist/components/Tag/Tag.module.js +1 -1
- package/dist/components/Tag/Tag_module.css +3 -2
- package/dist/components/TextArea/TextArea.module.js +1 -1
- package/dist/components/TextArea/TextArea_module.css +6 -2
- package/dist/components/TextInput/TextInput.d.ts +14 -2
- package/dist/components/TextInput/TextInput.js +4 -5
- package/dist/components/ThemeScope/PortalContainerContext.d.ts +17 -0
- package/dist/components/ThemeScope/PortalContainerContext.js +6 -0
- package/dist/components/ThemeScope/ThemeScope.d.ts +23 -0
- package/dist/components/ThemeScope/ThemeScope.js +29 -0
- package/dist/components/ThemeScope/ThemeScope.module.js +6 -0
- package/dist/components/ThemeScope/ThemeScope_module.css +10 -0
- package/dist/components/TimePicker/TimePicker.d.ts +15 -2
- package/dist/components/TimePicker/TimePicker.js +5 -5
- package/dist/components/Timeline/Timeline.module.js +8 -8
- package/dist/components/Timeline/Timeline_module.css +15 -13
- package/dist/components/ToastRegion/ToastRegion.js +3 -0
- package/dist/components/ToastRegion/ToastRegion.module.js +6 -6
- package/dist/components/ToastRegion/ToastRegion_module.css +23 -19
- package/dist/components/ToggleChip/ToggleChip.d.ts +49 -0
- package/dist/components/ToggleChip/ToggleChip.js +45 -0
- package/dist/components/ToggleChip/ToggleChip.module.js +9 -0
- package/dist/components/ToggleChip/ToggleChipGroup.d.ts +57 -0
- package/dist/components/ToggleChip/ToggleChipGroup.js +93 -0
- package/dist/components/ToggleChip/ToggleChip_module.css +97 -0
- package/dist/components/Toolbar/Toolbar.module.js +3 -3
- package/dist/components/Toolbar/Toolbar_module.css +5 -5
- package/dist/components/Tooltip/Tooltip.js +3 -0
- package/dist/components/Tree/Tree.module.js +8 -8
- package/dist/components/Tree/Tree_module.css +20 -20
- package/dist/components/TreeSelect/TreeSelect.js +3 -0
- package/dist/components/TreeSelect/TreeSelect.module.js +3 -3
- package/dist/components/TreeSelect/TreeSelect_module.css +4 -4
- package/dist/components/Upload/Upload.module.js +8 -8
- package/dist/components/Upload/Upload_module.css +16 -16
- package/dist/components/ViewField/ViewField.module.js +2 -2
- package/dist/components/ViewField/ViewField_module.css +3 -3
- package/dist/hooks/useControllable.d.ts +11 -0
- package/dist/hooks/useControllable.js +13 -0
- package/dist/hooks/useIndexedToggleGroup.d.ts +30 -0
- package/dist/hooks/useIndexedToggleGroup.js +26 -0
- package/dist/hooks/useOverflowFocusable.d.ts +17 -0
- package/dist/hooks/useOverflowFocusable.js +36 -0
- package/dist/icons/ChevronRightIcon.d.ts +6 -0
- package/dist/icons/ChevronRightIcon.js +17 -0
- package/dist/icons/RefreshIcon.d.ts +6 -0
- package/dist/icons/RefreshIcon.js +22 -0
- package/dist/icons/SearchIcon.d.ts +9 -0
- package/dist/icons/SearchIcon.js +23 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +14 -0
- package/dist/styles/a11y.module.js +1 -1
- package/dist/styles/a11y_module.css +1 -1
- package/dist/styles/base.css +17 -0
- package/dist/styles/closeCircle.module.js +5 -0
- package/dist/styles/closeCircle_module.css +12 -0
- package/dist/styles/field.module.js +14 -11
- package/dist/styles/field_module.css +92 -23
- package/dist/styles/pair.module.js +2 -2
- package/dist/styles/pair_module.css +5 -3
- package/dist/styles/popup.module.js +5 -5
- package/dist/styles/popup_module.css +35 -28
- package/dist/utils/focusInputFromPill.d.ts +12 -0
- package/dist/utils/focusInputFromPill.js +7 -0
- package/dist/utils/hasContent.d.ts +8 -0
- package/dist/utils/hasContent.js +4 -0
- package/package.json +4 -3
|
@@ -4,8 +4,11 @@ export interface AlertProps {
|
|
|
4
4
|
tone?: AlertTone;
|
|
5
5
|
/** Rendered above the body as a heading. */
|
|
6
6
|
heading?: ReactNode;
|
|
7
|
-
/**
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* The heading's level. Match it to where the alert sits in the page's outline. Use 1 only when
|
|
9
|
+
* the alert is the page's main heading, e.g. a full-page error.
|
|
10
|
+
*/
|
|
11
|
+
headingLevel?: 1 | 2 | 3 | 4;
|
|
9
12
|
children: ReactNode;
|
|
10
13
|
/**
|
|
11
14
|
* Announce this alert to assistive technology. Off by default and deliberately so: an alert
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "./Alert_module.css";
|
|
2
2
|
const Alert_module = {
|
|
3
|
-
root: "root-k99cj",
|
|
4
|
-
icon: "icon-GCaka",
|
|
5
|
-
body: "body-ZvhIH",
|
|
6
|
-
heading: "heading-kAg49",
|
|
7
|
-
dismiss: "dismiss-KQOWr"
|
|
3
|
+
root: "ui0-7-0-root-k99cj",
|
|
4
|
+
icon: "ui0-7-0-icon-GCaka",
|
|
5
|
+
body: "ui0-7-0-body-ZvhIH",
|
|
6
|
+
heading: "ui0-7-0-heading-kAg49",
|
|
7
|
+
dismiss: "ui0-7-0-dismiss-KQOWr"
|
|
8
8
|
};
|
|
9
9
|
export default Alert_module;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
.root-k99cj {
|
|
1
|
+
.ui0-7-0-root-k99cj {
|
|
2
2
|
align-items: flex-start;
|
|
3
3
|
gap: var(--space-3);
|
|
4
4
|
padding: var(--space-3) var(--space-4);
|
|
5
5
|
border: 1px solid var(--color-border);
|
|
6
6
|
border-inline-start: var(--border-width-strong) solid var(--color-neutral);
|
|
7
|
-
border-radius: var(--radius-
|
|
7
|
+
border-radius: var(--radius-panel);
|
|
8
8
|
background: var(--color-surface-2);
|
|
9
9
|
color: var(--color-text);
|
|
10
10
|
font-size: var(--text-sm);
|
|
@@ -12,67 +12,70 @@
|
|
|
12
12
|
display: flex;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.root-k99cj[data-tone="info"] {
|
|
15
|
+
.ui0-7-0-root-k99cj[data-tone="info"] {
|
|
16
16
|
border-inline-start-color: var(--color-accent);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.root-k99cj[data-tone="success"] {
|
|
19
|
+
.ui0-7-0-root-k99cj[data-tone="success"] {
|
|
20
20
|
border-inline-start-color: var(--color-success);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.root-k99cj[data-tone="warning"] {
|
|
23
|
+
.ui0-7-0-root-k99cj[data-tone="warning"] {
|
|
24
24
|
border-inline-start-color: var(--color-warning);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
.root-k99cj[data-tone="danger"] {
|
|
27
|
+
.ui0-7-0-root-k99cj[data-tone="danger"] {
|
|
28
28
|
border-color: var(--color-danger-border);
|
|
29
29
|
border-inline-start-color: var(--color-danger);
|
|
30
30
|
background: var(--color-danger-surface);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
.icon-GCaka {
|
|
33
|
+
.ui0-7-0-icon-GCaka {
|
|
34
34
|
color: var(--color-neutral);
|
|
35
35
|
flex: none;
|
|
36
36
|
margin-block-start: var(--space-1);
|
|
37
37
|
display: flex;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
.icon-GCaka > svg {
|
|
40
|
+
.ui0-7-0-icon-GCaka > svg {
|
|
41
41
|
width: 1rem;
|
|
42
42
|
height: 1rem;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
.root-k99cj[data-tone="info"] .icon-GCaka {
|
|
45
|
+
.ui0-7-0-root-k99cj[data-tone="info"] .ui0-7-0-icon-GCaka {
|
|
46
46
|
color: var(--color-accent);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.root-k99cj[data-tone="success"] .icon-GCaka {
|
|
49
|
+
.ui0-7-0-root-k99cj[data-tone="success"] .ui0-7-0-icon-GCaka {
|
|
50
50
|
color: var(--color-success);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
.root-k99cj[data-tone="warning"] .icon-GCaka {
|
|
53
|
+
.ui0-7-0-root-k99cj[data-tone="warning"] .ui0-7-0-icon-GCaka {
|
|
54
54
|
color: var(--color-warning);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
.root-k99cj[data-tone="danger"] .icon-GCaka {
|
|
57
|
+
.ui0-7-0-root-k99cj[data-tone="danger"] .ui0-7-0-icon-GCaka {
|
|
58
58
|
color: var(--color-danger);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
.body-ZvhIH {
|
|
61
|
+
.ui0-7-0-body-ZvhIH {
|
|
62
62
|
gap: var(--space-1);
|
|
63
|
+
min-width: 0;
|
|
64
|
+
font-family: var(--font-body);
|
|
65
|
+
font-weight: var(--font-weight-body);
|
|
63
66
|
flex-direction: column;
|
|
64
67
|
flex: auto;
|
|
65
|
-
min-width: 0;
|
|
66
68
|
display: flex;
|
|
67
69
|
}
|
|
68
70
|
|
|
69
|
-
.heading-kAg49 {
|
|
71
|
+
.ui0-7-0-heading-kAg49 {
|
|
72
|
+
font-family: var(--font-sans);
|
|
70
73
|
font-size: var(--text-sm);
|
|
71
|
-
font-weight:
|
|
74
|
+
font-weight: var(--font-weight-heading);
|
|
72
75
|
line-height: var(--leading-snug);
|
|
73
76
|
}
|
|
74
77
|
|
|
75
|
-
.dismiss-KQOWr {
|
|
78
|
+
.ui0-7-0-dismiss-KQOWr {
|
|
76
79
|
flex: none;
|
|
77
80
|
align-self: flex-start;
|
|
78
81
|
}
|
|
@@ -1,8 +1,22 @@
|
|
|
1
|
+
export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
1
2
|
export interface AvatarProps {
|
|
2
3
|
/** The person or thing this stands for. Used as the image's alt text and as the initials source. */
|
|
3
4
|
name: string;
|
|
4
5
|
src?: string;
|
|
5
|
-
size?:
|
|
6
|
+
size?: AvatarSize;
|
|
6
7
|
shape?: 'circle' | 'square';
|
|
8
|
+
/**
|
|
9
|
+
* A class for the root, joined after the component's own. It is how a consumer sets the two size
|
|
10
|
+
* hooks, `--avatar-size` and `--avatar-font-size`, for a size the five presets do not draw. Like
|
|
11
|
+
* any custom property the hooks inherit, so a wrapper that sets `--avatar-size` resizes every
|
|
12
|
+
* avatar inside it.
|
|
13
|
+
*/
|
|
14
|
+
className?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Colours the box from a seed, a stable id for the person (`avatarColorIndex(colorSeed)`, one of
|
|
17
|
+
* six theme colours), by writing `data-color` on the root. The colour fills the box behind the
|
|
18
|
+
* initials, and behind a photo while it loads. Left out, the avatar keeps its neutral fill.
|
|
19
|
+
*/
|
|
20
|
+
colorSeed?: string;
|
|
7
21
|
}
|
|
8
|
-
export declare function Avatar({ name, src, size, shape }: AvatarProps): import("react").JSX.Element;
|
|
22
|
+
export declare function Avatar({ name, src, size, shape, className, colorSeed, }: AvatarProps): import("react").JSX.Element;
|
|
@@ -2,22 +2,38 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Avatar } from "@base-ui/react/avatar";
|
|
3
3
|
import a11y_module from "../../styles/a11y.module.js";
|
|
4
4
|
import Avatar_module from "./Avatar.module.js";
|
|
5
|
+
import { avatarColorIndex } from "./avatarColor.js";
|
|
5
6
|
function leadingCharacters(word, count) {
|
|
6
7
|
return Array.from(word).slice(0, count).join('');
|
|
7
8
|
}
|
|
9
|
+
function fromFirstLetterOrDigit(word) {
|
|
10
|
+
const start = word.search(/[\p{L}\p{N}]/u);
|
|
11
|
+
return -1 === start ? word : word.slice(start);
|
|
12
|
+
}
|
|
13
|
+
function isPunctuationOnly(word) {
|
|
14
|
+
return /^\p{P}+$/u.test(word);
|
|
15
|
+
}
|
|
8
16
|
function initialsFrom(name) {
|
|
9
17
|
const words = name.normalize('NFC').trim().split(/\s+/).filter(Boolean);
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
if (
|
|
14
|
-
|
|
18
|
+
const wordsThatName = words.filter((word)=>!isPunctuationOnly(word));
|
|
19
|
+
const namingWords = 0 === wordsThatName.length ? words : wordsThatName;
|
|
20
|
+
const firstWord = namingWords.at(0);
|
|
21
|
+
if (void 0 === firstWord) return '';
|
|
22
|
+
const first = fromFirstLetterOrDigit(firstWord);
|
|
23
|
+
if (1 === words.length) return leadingCharacters(first, 2).toUpperCase();
|
|
24
|
+
const lastWord = namingWords.length > 1 ? namingWords.at(-1) : void 0;
|
|
25
|
+
const last = void 0 === lastWord ? '' : fromFirstLetterOrDigit(lastWord);
|
|
26
|
+
return `${leadingCharacters(first, 1)}${leadingCharacters(last, 1)}`.toUpperCase();
|
|
15
27
|
}
|
|
16
|
-
function Avatar_Avatar({ name, src, size = 'md', shape = 'circle' }) {
|
|
28
|
+
function Avatar_Avatar({ name, src, size = 'md', shape = 'circle', className, colorSeed }) {
|
|
17
29
|
return /*#__PURE__*/ jsxs(Avatar.Root, {
|
|
18
|
-
className:
|
|
30
|
+
className: [
|
|
31
|
+
Avatar_module.root,
|
|
32
|
+
className
|
|
33
|
+
].filter(Boolean).join(' '),
|
|
19
34
|
"data-size": size,
|
|
20
35
|
"data-shape": shape,
|
|
36
|
+
"data-color": void 0 === colorSeed ? void 0 : avatarColorIndex(colorSeed),
|
|
21
37
|
"data-testid": "avatar",
|
|
22
38
|
children: [
|
|
23
39
|
void 0 !== src ? /*#__PURE__*/ jsx(Avatar.Image, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./Avatar_module.css";
|
|
2
2
|
const Avatar_module = {
|
|
3
|
-
root: "root-uFk_6",
|
|
4
|
-
image: "image-i3BrF",
|
|
5
|
-
fallback: "fallback-r0pag"
|
|
3
|
+
root: "ui0-7-0-root-uFk_6",
|
|
4
|
+
image: "ui0-7-0-image-i3BrF",
|
|
5
|
+
fallback: "ui0-7-0-fallback-r0pag"
|
|
6
6
|
};
|
|
7
7
|
export default Avatar_module;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
.root-uFk_6 {
|
|
1
|
+
.ui0-7-0-root-uFk_6 {
|
|
2
|
+
inline-size: var(--avatar-size, var(--avatar-preset));
|
|
3
|
+
block-size: var(--avatar-size, var(--avatar-preset));
|
|
2
4
|
border-radius: var(--radius-full);
|
|
3
5
|
background: var(--color-surface-3);
|
|
4
6
|
color: var(--color-text-muted);
|
|
5
|
-
font-
|
|
6
|
-
font-
|
|
7
|
+
font-family: var(--font-sans);
|
|
8
|
+
font-size: var(--avatar-font-size, var(--avatar-preset-font));
|
|
9
|
+
font-weight: var(--font-weight-heading);
|
|
7
10
|
line-height: var(--leading-tight);
|
|
8
11
|
-webkit-user-select: none;
|
|
9
12
|
user-select: none;
|
|
@@ -14,34 +17,72 @@
|
|
|
14
17
|
overflow: hidden;
|
|
15
18
|
}
|
|
16
19
|
|
|
17
|
-
.root-uFk_6[data-shape="square"] {
|
|
20
|
+
.ui0-7-0-root-uFk_6[data-shape="square"] {
|
|
18
21
|
border-radius: var(--radius-md);
|
|
19
22
|
}
|
|
20
23
|
|
|
21
|
-
.root-uFk_6[data-size="
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
font-size: var(--text-2xs);
|
|
24
|
+
.ui0-7-0-root-uFk_6[data-size="xs"] {
|
|
25
|
+
--avatar-preset: 1.5rem;
|
|
26
|
+
--avatar-preset-font: var(--text-2xs);
|
|
25
27
|
}
|
|
26
28
|
|
|
27
|
-
.root-uFk_6[data-size="
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
.ui0-7-0-root-uFk_6[data-size="sm"] {
|
|
30
|
+
--avatar-preset: 1.75rem;
|
|
31
|
+
--avatar-preset-font: var(--text-2xs);
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
.root-uFk_6[data-size="
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
font-size: var(--text-lg);
|
|
34
|
+
.ui0-7-0-root-uFk_6[data-size="md"] {
|
|
35
|
+
--avatar-preset: 2.5rem;
|
|
36
|
+
--avatar-preset-font: var(--text-sm);
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
.
|
|
39
|
+
.ui0-7-0-root-uFk_6[data-size="lg"] {
|
|
40
|
+
--avatar-preset: 4rem;
|
|
41
|
+
--avatar-preset-font: var(--text-lg);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ui0-7-0-root-uFk_6[data-size="xl"] {
|
|
45
|
+
--avatar-preset: 6rem;
|
|
46
|
+
--avatar-preset-font: var(--text-h3);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ui0-7-0-root-uFk_6[data-color="1"] {
|
|
50
|
+
background: var(--color-avatar-fill-1);
|
|
51
|
+
color: var(--color-avatar-ink-1);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ui0-7-0-root-uFk_6[data-color="2"] {
|
|
55
|
+
background: var(--color-avatar-fill-2);
|
|
56
|
+
color: var(--color-avatar-ink-2);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ui0-7-0-root-uFk_6[data-color="3"] {
|
|
60
|
+
background: var(--color-avatar-fill-3);
|
|
61
|
+
color: var(--color-avatar-ink-3);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.ui0-7-0-root-uFk_6[data-color="4"] {
|
|
65
|
+
background: var(--color-avatar-fill-4);
|
|
66
|
+
color: var(--color-avatar-ink-4);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.ui0-7-0-root-uFk_6[data-color="5"] {
|
|
70
|
+
background: var(--color-avatar-fill-5);
|
|
71
|
+
color: var(--color-avatar-ink-5);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.ui0-7-0-root-uFk_6[data-color="6"] {
|
|
75
|
+
background: var(--color-avatar-fill-6);
|
|
76
|
+
color: var(--color-avatar-ink-6);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ui0-7-0-image-i3BrF {
|
|
39
80
|
object-fit: cover;
|
|
40
81
|
width: 100%;
|
|
41
82
|
height: 100%;
|
|
42
83
|
}
|
|
43
84
|
|
|
44
|
-
.fallback-r0pag {
|
|
85
|
+
.ui0-7-0-fallback-r0pag {
|
|
45
86
|
justify-content: center;
|
|
46
87
|
align-items: center;
|
|
47
88
|
display: inline-flex;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type AvatarColorIndex = 1 | 2 | 3 | 4 | 5 | 6;
|
|
2
|
+
/** How many fill and ink pairs the theme defines (`--color-avatar-fill-1` to `-6`). */
|
|
3
|
+
export declare const AVATAR_COLOR_COUNT = 6;
|
|
4
|
+
/**
|
|
5
|
+
* Which of the six avatar colours a seed gets: FNV-1a 32-bit over the seed's UTF-16 code units,
|
|
6
|
+
* taken as an unsigned number, modulo six, plus one. The same seed gives the same colour on every
|
|
7
|
+
* screen and in every release, so a person keeps their colour.
|
|
8
|
+
*
|
|
9
|
+
* Changing this function is a breaking change: the consuming app's `src/components/hash.ts`
|
|
10
|
+
* reproduces it (contract §3.9), and a drift would colour one person two ways.
|
|
11
|
+
*/
|
|
12
|
+
export declare function avatarColorIndex(seed: string): AvatarColorIndex;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const AVATAR_COLOR_COUNT = 6;
|
|
2
|
+
const FNV_OFFSET_BASIS = 0x811c9dc5;
|
|
3
|
+
const FNV_PRIME = 0x01000193;
|
|
4
|
+
function avatarColorIndex(seed) {
|
|
5
|
+
let hash = FNV_OFFSET_BASIS;
|
|
6
|
+
for(let index = 0; index < seed.length; index += 1){
|
|
7
|
+
hash ^= seed.charCodeAt(index);
|
|
8
|
+
hash = Math.imul(hash, FNV_PRIME) >>> 0;
|
|
9
|
+
}
|
|
10
|
+
return hash % AVATAR_COLOR_COUNT + 1;
|
|
11
|
+
}
|
|
12
|
+
export { AVATAR_COLOR_COUNT, avatarColorIndex };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { AvatarSize } from '../Avatar/Avatar.js';
|
|
2
|
+
export interface AvatarGroupItem {
|
|
3
|
+
/** What tells one person from another across renders. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** The person's name: the avatar's text for a screen reader, and its initials source. */
|
|
6
|
+
name: string;
|
|
7
|
+
src?: string;
|
|
8
|
+
/** A stable id for the person, which `Avatar` turns into one of the theme's six colours. */
|
|
9
|
+
colorSeed?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface AvatarGroupProps {
|
|
12
|
+
items: readonly AvatarGroupItem[];
|
|
13
|
+
/**
|
|
14
|
+
* How many avatars show before the rest fold into a `+N` chip. Defaults to 4. A value below 1
|
|
15
|
+
* reads as 1, and the chip is drawn only when there are more items than this.
|
|
16
|
+
*/
|
|
17
|
+
max?: number;
|
|
18
|
+
/**
|
|
19
|
+
* One of `Avatar`'s five sizes. Defaults to `sm`. The chip is drawn at the same size. Like the
|
|
20
|
+
* avatars', it follows `--avatar-size` and `--avatar-font-size` when a wrapper sets them.
|
|
21
|
+
*/
|
|
22
|
+
size?: AvatarSize;
|
|
23
|
+
/** Names the list. */
|
|
24
|
+
label: string;
|
|
25
|
+
/**
|
|
26
|
+
* What a screen reader hears for the chip, given how many are hidden. A library English default,
|
|
27
|
+
* `3 more`; pass a function for another wording or language. The chip's visible `+3` is
|
|
28
|
+
* decorative, so this text is the chip's whole meaning.
|
|
29
|
+
*/
|
|
30
|
+
overflowLabel?: (count: number) => string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Avatars laid edge to edge, each overlapping the one before it and ringed in the ground colour so
|
|
34
|
+
* the overlap reads as a stack. Past `max`, a `+N` chip stands for the rest. An empty `items`
|
|
35
|
+
* draws nothing: a list must own its items, so there is no empty list to name.
|
|
36
|
+
*/
|
|
37
|
+
export declare function AvatarGroup({ items, max, size, label, overflowLabel, }: AvatarGroupProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import a11y_module from "../../styles/a11y.module.js";
|
|
3
|
+
import { Avatar } from "../Avatar/Avatar.js";
|
|
4
|
+
import AvatarGroup_module from "./AvatarGroup.module.js";
|
|
5
|
+
const DEFAULT_MAX = 4;
|
|
6
|
+
function defaultOverflowLabel(count) {
|
|
7
|
+
return `${count} more`;
|
|
8
|
+
}
|
|
9
|
+
function shownCountFor(max) {
|
|
10
|
+
return Math.max(1, Math.trunc(max) || 1);
|
|
11
|
+
}
|
|
12
|
+
function AvatarGroup({ items, max = DEFAULT_MAX, size = 'sm', label, overflowLabel = defaultOverflowLabel }) {
|
|
13
|
+
if (0 === items.length) return null;
|
|
14
|
+
const shownItems = items.slice(0, shownCountFor(max));
|
|
15
|
+
const hiddenCount = items.length - shownItems.length;
|
|
16
|
+
return /*#__PURE__*/ jsxs("ul", {
|
|
17
|
+
role: "list",
|
|
18
|
+
"aria-label": label,
|
|
19
|
+
className: AvatarGroup_module.list,
|
|
20
|
+
"data-size": size,
|
|
21
|
+
children: [
|
|
22
|
+
shownItems.map((item)=>/*#__PURE__*/ jsx("li", {
|
|
23
|
+
className: AvatarGroup_module.item,
|
|
24
|
+
children: /*#__PURE__*/ jsx(Avatar, {
|
|
25
|
+
name: item.name,
|
|
26
|
+
src: item.src,
|
|
27
|
+
colorSeed: item.colorSeed,
|
|
28
|
+
size: size,
|
|
29
|
+
className: AvatarGroup_module.ring
|
|
30
|
+
})
|
|
31
|
+
}, item.id)),
|
|
32
|
+
hiddenCount > 0 ? /*#__PURE__*/ jsxs("li", {
|
|
33
|
+
className: AvatarGroup_module.item,
|
|
34
|
+
children: [
|
|
35
|
+
/*#__PURE__*/ jsxs("span", {
|
|
36
|
+
className: AvatarGroup_module.overflow,
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
children: [
|
|
39
|
+
"+",
|
|
40
|
+
hiddenCount
|
|
41
|
+
]
|
|
42
|
+
}),
|
|
43
|
+
/*#__PURE__*/ jsx("span", {
|
|
44
|
+
className: a11y_module.visuallyHidden,
|
|
45
|
+
children: overflowLabel(hiddenCount)
|
|
46
|
+
})
|
|
47
|
+
]
|
|
48
|
+
}) : null
|
|
49
|
+
]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
export { AvatarGroup };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
.ui0-7-0-list-YkUB5 {
|
|
2
|
+
--avatar-group-overlap: calc(-1 * var(--space-2));
|
|
3
|
+
align-items: center;
|
|
4
|
+
margin: 0;
|
|
5
|
+
padding: 0;
|
|
6
|
+
list-style: none;
|
|
7
|
+
display: flex;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ui0-7-0-list-YkUB5[data-size="xs"] {
|
|
11
|
+
--avatar-group-size: 1.5rem;
|
|
12
|
+
--avatar-group-font-size: var(--text-2xs);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ui0-7-0-list-YkUB5[data-size="sm"] {
|
|
16
|
+
--avatar-group-size: 1.75rem;
|
|
17
|
+
--avatar-group-font-size: var(--text-2xs);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ui0-7-0-list-YkUB5[data-size="md"] {
|
|
21
|
+
--avatar-group-size: 2.5rem;
|
|
22
|
+
--avatar-group-font-size: var(--text-sm);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ui0-7-0-list-YkUB5[data-size="lg"] {
|
|
26
|
+
--avatar-group-size: 4rem;
|
|
27
|
+
--avatar-group-font-size: var(--text-lg);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ui0-7-0-list-YkUB5[data-size="xl"] {
|
|
31
|
+
--avatar-group-size: 6rem;
|
|
32
|
+
--avatar-group-font-size: var(--text-h3);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ui0-7-0-item-Gz769 {
|
|
36
|
+
flex: none;
|
|
37
|
+
display: flex;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ui0-7-0-item-Gz769 + .ui0-7-0-item-Gz769 {
|
|
41
|
+
margin-inline-start: var(--avatar-group-overlap);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ui0-7-0-ring-UcY6L {
|
|
45
|
+
box-shadow: 0 0 0 var(--border-width-emphasis) var(--color-avatar-ring);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.ui0-7-0-overflow-WA2Lm {
|
|
49
|
+
--avatar-group-chip-shadow: 0 0 0 var(--border-width-emphasis) var(--color-avatar-ring), var(--shadow-chip);
|
|
50
|
+
min-width: var(--avatar-size, var(--avatar-group-size));
|
|
51
|
+
height: var(--avatar-size, var(--avatar-group-size));
|
|
52
|
+
padding-inline: var(--space-1);
|
|
53
|
+
border-radius: var(--radius-full);
|
|
54
|
+
background: var(--color-surface-3);
|
|
55
|
+
box-shadow: var(--avatar-group-chip-shadow);
|
|
56
|
+
color: var(--color-text-muted);
|
|
57
|
+
font-family: var(--font-sans);
|
|
58
|
+
font-size: var(--avatar-font-size, var(--avatar-group-font-size));
|
|
59
|
+
font-weight: var(--font-weight-heading);
|
|
60
|
+
line-height: var(--leading-tight);
|
|
61
|
+
-webkit-user-select: none;
|
|
62
|
+
user-select: none;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
align-items: center;
|
|
65
|
+
display: inline-flex;
|
|
66
|
+
}
|
|
67
|
+
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "./Breadcrumb_module.css";
|
|
2
2
|
const Breadcrumb_module = {
|
|
3
|
-
list: "list-eDbWY",
|
|
4
|
-
item: "item-yKtE5",
|
|
5
|
-
separator: "separator-pHrdE",
|
|
6
|
-
link: "link-l4Wbt",
|
|
7
|
-
text: "text-F4Upa",
|
|
8
|
-
current: "current-rfbM_"
|
|
3
|
+
list: "ui0-7-0-list-eDbWY",
|
|
4
|
+
item: "ui0-7-0-item-yKtE5",
|
|
5
|
+
separator: "ui0-7-0-separator-pHrdE",
|
|
6
|
+
link: "ui0-7-0-link-l4Wbt",
|
|
7
|
+
text: "ui0-7-0-text-F4Upa",
|
|
8
|
+
current: "ui0-7-0-current-rfbM_"
|
|
9
9
|
};
|
|
10
10
|
export default Breadcrumb_module;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.list-eDbWY {
|
|
1
|
+
.ui0-7-0-list-eDbWY {
|
|
2
2
|
align-items: center;
|
|
3
3
|
gap: var(--space-1) var(--space-2);
|
|
4
4
|
font-size: var(--text-sm);
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
display: flex;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.item-yKtE5 {
|
|
13
|
+
.ui0-7-0-item-yKtE5 {
|
|
14
14
|
align-items: center;
|
|
15
15
|
gap: var(--space-2);
|
|
16
16
|
overflow-wrap: anywhere;
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
display: inline-flex;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
.separator-pHrdE {
|
|
21
|
+
.ui0-7-0-separator-pHrdE {
|
|
22
22
|
color: var(--color-text-subtle);
|
|
23
23
|
flex: none;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.link-l4Wbt {
|
|
26
|
+
.ui0-7-0-link-l4Wbt {
|
|
27
27
|
border-radius: var(--radius-sm);
|
|
28
28
|
min-height: 1.5rem;
|
|
29
29
|
color: var(--color-link);
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
@media (hover: hover) {
|
|
36
|
-
.link-l4Wbt:hover {
|
|
36
|
+
.ui0-7-0-link-l4Wbt:hover {
|
|
37
37
|
text-decoration: none;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
.text-F4Upa {
|
|
41
|
+
.ui0-7-0-text-F4Upa {
|
|
42
42
|
color: var(--color-text-muted);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
.current-rfbM_ {
|
|
45
|
+
.ui0-7-0-current-rfbM_ {
|
|
46
46
|
color: var(--color-text);
|
|
47
47
|
font-weight: 500;
|
|
48
48
|
}
|
|
@@ -1,12 +1,48 @@
|
|
|
1
1
|
import { Button as BaseButton } from '@base-ui/react/button';
|
|
2
|
-
import type { ComponentPropsWithoutRef } from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* `row` is a list row: as wide as the box it sits in, start-aligned, with no fill or border at rest
|
|
5
|
+
* and a quiet surface on hover and press. Pair it with `endIcon` for a trailing chevron. A row keeps
|
|
6
|
+
* a 44 px floor and its own padding whatever `size` says; `size` changes only its type. Like ghost,
|
|
7
|
+
* it has no tone rule, so a `tone` on a row is ignored.
|
|
8
|
+
*/
|
|
9
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'row';
|
|
10
|
+
export type ButtonSize = 'md' | 'sm' | 'lg';
|
|
11
|
+
/**
|
|
12
|
+
* The colour family a filled button draws from. `accent` is the house look; `inverse` is the
|
|
13
|
+
* high-contrast fill for a button that sits on an accent or photo surface; `selected` is the chosen
|
|
14
|
+
* state's colour. Ghost and row have no tone rule, so a tone on either is ignored.
|
|
15
|
+
*/
|
|
16
|
+
export type ButtonTone = 'accent' | 'inverse' | 'selected';
|
|
5
17
|
export interface ButtonProps extends Omit<ComponentPropsWithoutRef<typeof BaseButton>, 'className'> {
|
|
6
18
|
variant?: ButtonVariant;
|
|
7
19
|
size?: ButtonSize;
|
|
20
|
+
tone?: ButtonTone;
|
|
21
|
+
/**
|
|
22
|
+
* A count or short status shown after the label, such as the `2` in "Suggestions 2". It is part
|
|
23
|
+
* of the button's accessible name.
|
|
24
|
+
*/
|
|
25
|
+
badge?: ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* A decorative glyph before the label, such as a check or a plus. It is hidden from assistive
|
|
28
|
+
* technology and never part of the accessible name. While the button is `pending`, a spinner
|
|
29
|
+
* takes its place.
|
|
30
|
+
*/
|
|
31
|
+
startIcon?: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* A decorative glyph after the label (and after the badge), such as a row's chevron. It is hidden
|
|
34
|
+
* from assistive technology and never part of the accessible name; a count goes in `badge`.
|
|
35
|
+
*/
|
|
36
|
+
endIcon?: ReactNode;
|
|
8
37
|
/** Shows a busy state, keeps the button focusable, and blocks activation. */
|
|
9
38
|
loading?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Shows a spinner in place of the leading icon and keeps the label, so the accessible name never
|
|
41
|
+
* changes. Sets `aria-busy` and `aria-disabled` and blocks activation, while the button stays
|
|
42
|
+
* focusable, so focus never drops to the page. A button that is also `disabled` keeps the
|
|
43
|
+
* disabled look, with its icon and label as they are and no spinner.
|
|
44
|
+
*/
|
|
45
|
+
pending?: boolean;
|
|
10
46
|
className?: string;
|
|
11
47
|
}
|
|
12
|
-
export declare function Button({ variant, size, loading, disabled, className, children, nativeButton, ...rest }: ButtonProps): import("react").JSX.Element;
|
|
48
|
+
export declare function Button({ variant, size, tone, badge, startIcon, endIcon, loading, pending, disabled, className, children, nativeButton, ...rest }: ButtonProps): import("react").JSX.Element;
|