@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.viewport-nOzLZ {
|
|
1
|
+
.ui0-7-0-viewport-nOzLZ {
|
|
2
2
|
padding: var(--space-4);
|
|
3
3
|
place-items: center;
|
|
4
4
|
display: grid;
|
|
@@ -6,46 +6,93 @@
|
|
|
6
6
|
inset: 0;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
.viewport-nOzLZ[data-variant="sheet"] {
|
|
9
|
+
.ui0-7-0-viewport-nOzLZ[data-variant="sheet"] {
|
|
10
10
|
place-items: end center;
|
|
11
11
|
padding: 0;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.viewport-nOzLZ[data-side="end"] {
|
|
14
|
+
.ui0-7-0-viewport-nOzLZ[data-side="end"] {
|
|
15
15
|
place-items: center end;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.header-KgP3n {
|
|
19
|
-
align-items:
|
|
18
|
+
.ui0-7-0-header-KgP3n {
|
|
19
|
+
align-items: center;
|
|
20
20
|
gap: var(--space-3);
|
|
21
21
|
display: flex;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.heading-EfBAx {
|
|
24
|
+
.ui0-7-0-heading-EfBAx {
|
|
25
25
|
min-width: 0;
|
|
26
26
|
color: var(--color-text);
|
|
27
|
-
font-size: var(--text-h3);
|
|
28
|
-
font-
|
|
29
|
-
|
|
27
|
+
font-size: var(--dialog-heading-size, var(--text-h3));
|
|
28
|
+
font-family: var(--font-display);
|
|
29
|
+
font-weight: var(--font-weight-display);
|
|
30
|
+
font-stretch: var(--font-stretch-display);
|
|
31
|
+
text-transform: var(--text-transform-display);
|
|
32
|
+
letter-spacing: var(--dialog-heading-tracking, var(--tracking-heading));
|
|
33
|
+
line-height: var(--dialog-heading-leading, var(--leading-snug));
|
|
30
34
|
flex: auto;
|
|
31
35
|
}
|
|
32
36
|
|
|
33
|
-
.
|
|
37
|
+
h4.ui0-7-0-heading-EfBAx {
|
|
38
|
+
letter-spacing: var(--dialog-heading-tracking, normal);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.ui0-7-0-headerEnd-sEInd {
|
|
42
|
+
align-items: center;
|
|
43
|
+
gap: var(--space-2);
|
|
44
|
+
margin-inline-start: auto;
|
|
45
|
+
display: flex;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.ui0-7-0-handle-z1dbF {
|
|
49
|
+
width: var(--sheet-handle-width, 2.5rem);
|
|
50
|
+
height: var(--sheet-handle-height, .3125rem);
|
|
51
|
+
border-radius: var(--radius-full);
|
|
52
|
+
background: var(--color-sheet-handle);
|
|
53
|
+
flex: none;
|
|
54
|
+
align-self: center;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.ui0-7-0-description-ZV1a4 {
|
|
34
58
|
color: var(--color-text-muted);
|
|
59
|
+
font-family: var(--font-body);
|
|
60
|
+
font-weight: var(--font-weight-body);
|
|
35
61
|
font-size: var(--text-sm);
|
|
36
62
|
line-height: var(--leading-prose);
|
|
37
63
|
}
|
|
38
64
|
|
|
39
|
-
.body-mavCB {
|
|
40
|
-
|
|
65
|
+
.ui0-7-0-body-mavCB {
|
|
66
|
+
--dialog-body-ring-room: calc(var(--focus-ring-width) + var(--focus-ring-offset));
|
|
67
|
+
--dialog-body-ring-reach: calc(var(--dialog-body-ring-room) * -1);
|
|
41
68
|
min-height: 0;
|
|
69
|
+
margin: var(--dialog-body-ring-reach);
|
|
70
|
+
padding: var(--dialog-body-ring-room);
|
|
71
|
+
overscroll-behavior: contain;
|
|
42
72
|
overflow-y: auto;
|
|
43
73
|
}
|
|
44
74
|
|
|
45
|
-
.
|
|
75
|
+
.ui0-7-0-body-mavCB:focus-visible {
|
|
76
|
+
outline-offset: calc(-1 * var(--focus-ring-width));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ui0-7-0-footer-CAuV7 {
|
|
46
80
|
justify-content: flex-end;
|
|
47
81
|
gap: var(--space-2);
|
|
48
82
|
flex-wrap: wrap;
|
|
49
83
|
display: flex;
|
|
50
84
|
}
|
|
51
85
|
|
|
86
|
+
[data-popup="sheet"] > .ui0-7-0-header-KgP3n, [data-popup="sheet"] > .ui0-7-0-description-ZV1a4, [data-popup="sheet"] > .ui0-7-0-footer-CAuV7 {
|
|
87
|
+
flex: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
[data-popup="sheet"] > .ui0-7-0-body-mavCB {
|
|
91
|
+
flex: auto;
|
|
92
|
+
min-height: 0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
[data-popup="sheet"] > .ui0-7-0-footer-CAuV7 {
|
|
96
|
+
margin-top: auto;
|
|
97
|
+
}
|
|
98
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface EmptyStateProps {
|
|
3
|
+
/**
|
|
4
|
+
* A picture ahead of the heading. It is decorative and the slot is hidden from assistive
|
|
5
|
+
* technology, so anything that must be read or operated belongs in `heading`, `children` or
|
|
6
|
+
* `actions` instead. The slot lays several in-flow children out in a row, so pass one element
|
|
7
|
+
* or wrap them. The root is `position: relative`, so an absolutely positioned child is placed
|
|
8
|
+
* against the card and may spill over its edge.
|
|
9
|
+
*
|
|
10
|
+
* The slot keeps its place in the card's column even when its picture is positioned, so the
|
|
11
|
+
* heading still starts one gap (`--space-3`) below the padding: 36 px from the card's top at the
|
|
12
|
+
* default spacing, where a card with no illustration starts it at 24. To spill a picture over
|
|
13
|
+
* the card with the heading at the top, leave `illustration` out and position the picture from a
|
|
14
|
+
* wrapper of your own around the `EmptyState`, marked `aria-hidden` there.
|
|
15
|
+
*/
|
|
16
|
+
illustration?: ReactNode;
|
|
17
|
+
/** The headline, on the display type. Its tag is `headingLevel`. */
|
|
18
|
+
heading: ReactNode;
|
|
19
|
+
/** The tag of the heading, `h2` unless the page's outline needs another. */
|
|
20
|
+
headingLevel?: 2 | 3 | 4;
|
|
21
|
+
/** The sentence or two under the heading. Nothing is drawn when it is empty. */
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
/** Buttons or links under the body, in a row that wraps. */
|
|
24
|
+
actions?: ReactNode;
|
|
25
|
+
/** `selected` paints the selected colour with its own text colour. */
|
|
26
|
+
tone?: 'neutral' | 'selected';
|
|
27
|
+
/** Where the content sits: the centre of the card, or its start edge. */
|
|
28
|
+
align?: 'center' | 'start';
|
|
29
|
+
/**
|
|
30
|
+
* A class for the root, joined after the component's own. It is how a consumer sets the one size
|
|
31
|
+
* hook, `--empty-state-heading-size`, which resizes the heading (default `--text-h3`). Like any
|
|
32
|
+
* custom property the hook inherits, so a wrapper that sets it resizes every empty state inside
|
|
33
|
+
* it.
|
|
34
|
+
*/
|
|
35
|
+
className?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* What a list or a screen shows when it has nothing to list: an optional picture, a headline, a
|
|
39
|
+
* sentence and the next step. It is a plain box, not a landmark.
|
|
40
|
+
*/
|
|
41
|
+
export declare function EmptyState({ illustration, heading, headingLevel, children, actions, tone, align, className, }: EmptyStateProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { hasContent } from "../../utils/hasContent.js";
|
|
3
|
+
import EmptyState_module from "./EmptyState.module.js";
|
|
4
|
+
const headingTags = {
|
|
5
|
+
2: 'h2',
|
|
6
|
+
3: 'h3',
|
|
7
|
+
4: 'h4'
|
|
8
|
+
};
|
|
9
|
+
function EmptyState({ illustration, heading, headingLevel = 2, children, actions, tone = 'neutral', align = 'center', className }) {
|
|
10
|
+
const Heading = headingTags[headingLevel] ?? 'h2';
|
|
11
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
12
|
+
className: [
|
|
13
|
+
EmptyState_module.root,
|
|
14
|
+
className
|
|
15
|
+
].filter(Boolean).join(' '),
|
|
16
|
+
"data-tone": tone,
|
|
17
|
+
"data-align": align,
|
|
18
|
+
children: [
|
|
19
|
+
hasContent(illustration) ? /*#__PURE__*/ jsx("div", {
|
|
20
|
+
className: EmptyState_module.illustration,
|
|
21
|
+
"aria-hidden": "true",
|
|
22
|
+
children: illustration
|
|
23
|
+
}) : null,
|
|
24
|
+
/*#__PURE__*/ jsx(Heading, {
|
|
25
|
+
className: EmptyState_module.heading,
|
|
26
|
+
children: heading
|
|
27
|
+
}),
|
|
28
|
+
hasContent(children) ? /*#__PURE__*/ jsx("div", {
|
|
29
|
+
className: EmptyState_module.body,
|
|
30
|
+
children: children
|
|
31
|
+
}) : null,
|
|
32
|
+
hasContent(actions) ? /*#__PURE__*/ jsx("div", {
|
|
33
|
+
className: EmptyState_module.actions,
|
|
34
|
+
children: actions
|
|
35
|
+
}) : null
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
export { EmptyState };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./EmptyState_module.css";
|
|
2
|
+
const EmptyState_module = {
|
|
3
|
+
root: "ui0-7-0-root-Gqpml",
|
|
4
|
+
illustration: "ui0-7-0-illustration-gt1N5",
|
|
5
|
+
heading: "ui0-7-0-heading-aF5X5",
|
|
6
|
+
body: "ui0-7-0-body-uj_Dd",
|
|
7
|
+
actions: "ui0-7-0-actions-AwsGn"
|
|
8
|
+
};
|
|
9
|
+
export default EmptyState_module;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
.ui0-7-0-root-Gqpml {
|
|
2
|
+
gap: var(--space-3);
|
|
3
|
+
padding: var(--space-5);
|
|
4
|
+
border-radius: var(--radius-card);
|
|
5
|
+
background: var(--color-surface-raised);
|
|
6
|
+
box-shadow: var(--shadow-soft);
|
|
7
|
+
color: var(--color-text);
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
display: flex;
|
|
10
|
+
position: relative;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ui0-7-0-root-Gqpml[data-align="center"] {
|
|
14
|
+
text-align: center;
|
|
15
|
+
align-items: center;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ui0-7-0-root-Gqpml[data-align="start"] {
|
|
19
|
+
text-align: start;
|
|
20
|
+
align-items: flex-start;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ui0-7-0-root-Gqpml[data-tone="selected"] {
|
|
24
|
+
background: var(--color-selected);
|
|
25
|
+
color: var(--color-selected-text);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.ui0-7-0-illustration-gt1N5 {
|
|
29
|
+
display: flex;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ui0-7-0-heading-aF5X5 {
|
|
33
|
+
font-size: var(--empty-state-heading-size, var(--text-h3));
|
|
34
|
+
font-family: var(--font-display);
|
|
35
|
+
font-weight: var(--font-weight-display);
|
|
36
|
+
font-stretch: var(--font-stretch-display);
|
|
37
|
+
text-transform: var(--text-transform-display);
|
|
38
|
+
letter-spacing: var(--tracking-heading);
|
|
39
|
+
line-height: var(--leading-display);
|
|
40
|
+
margin: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ui0-7-0-body-uj_Dd {
|
|
44
|
+
max-width: 28ch;
|
|
45
|
+
font-size: var(--text-md);
|
|
46
|
+
font-family: var(--font-body);
|
|
47
|
+
font-weight: var(--font-weight-body);
|
|
48
|
+
line-height: var(--leading-prose);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ui0-7-0-root-Gqpml[data-tone="neutral"] .ui0-7-0-body-uj_Dd {
|
|
52
|
+
color: var(--color-text-muted);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.ui0-7-0-actions-AwsGn {
|
|
56
|
+
gap: var(--space-2);
|
|
57
|
+
margin-top: var(--space-2);
|
|
58
|
+
flex-wrap: wrap;
|
|
59
|
+
display: flex;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.ui0-7-0-root-Gqpml[data-align="center"] .ui0-7-0-actions-AwsGn {
|
|
63
|
+
justify-content: center;
|
|
64
|
+
}
|
|
65
|
+
|
|
@@ -17,8 +17,11 @@ export interface ErrorBoundaryProps {
|
|
|
17
17
|
resetKeys?: readonly unknown[];
|
|
18
18
|
/** The default fallback's heading. */
|
|
19
19
|
heading?: string;
|
|
20
|
-
/**
|
|
21
|
-
|
|
20
|
+
/**
|
|
21
|
+
* The heading's level. Match it to where the alert sits in the page's outline. Use 1 only when
|
|
22
|
+
* the boundary is the page's main heading, e.g. a full-page error.
|
|
23
|
+
*/
|
|
24
|
+
headingLevel?: 1 | 2 | 3 | 4;
|
|
22
25
|
/** The default fallback's retry control. */
|
|
23
26
|
retryLabel?: string;
|
|
24
27
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Input as BaseInput } from '@base-ui/react/input';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
export interface AffixInputProps extends Omit<BaseInput.Props, 'className' | 'ref'> {
|
|
4
|
+
/**
|
|
5
|
+
* A glyph before the text, decorative: the wrapper marks it `aria-hidden`, and the field's label
|
|
6
|
+
* names the input. Absent (or `null`, `false`), there is no wrapper and the input wears the skin
|
|
7
|
+
* itself.
|
|
8
|
+
*/
|
|
9
|
+
startIcon?: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* With `startIcon`, the browser's own picker button is hidden (the icon sits where it would be
|
|
12
|
+
* looked for) and a press on the icon opens the picker instead. `TimePicker` asks for it; typing
|
|
13
|
+
* in the input is unchanged.
|
|
14
|
+
*/
|
|
15
|
+
iconOpensPicker?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The `Input` that `TextInput` and `TimePicker` share, with room for a leading icon. Internal: not
|
|
19
|
+
* exported from `src/index.ts`.
|
|
20
|
+
*
|
|
21
|
+
* With an icon, the skin moves to a pill around the icon and the input (`.control` and `.affix`),
|
|
22
|
+
* and the input drops to `.affixInput`: borderless and stretched across what the icon leaves. Every
|
|
23
|
+
* other prop reaches the input exactly as it does without an icon, so the surrounding `Field`'s
|
|
24
|
+
* label, `aria-describedby`, `aria-invalid` and `data-invalid` land on the input and not on the
|
|
25
|
+
* pill. The pill reads the input's `data-invalid` and `data-disabled` through `:has`, because the
|
|
26
|
+
* state Base UI writes is on the input.
|
|
27
|
+
*/
|
|
28
|
+
export declare function AffixInput({ startIcon, iconOpensPicker, ...inputProps }: AffixInputProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Input } from "@base-ui/react/input";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
import field_module from "../../styles/field.module.js";
|
|
5
|
+
import { focusInputFromPill } from "../../utils/focusInputFromPill.js";
|
|
6
|
+
const PICKER_REFUSALS = new Set([
|
|
7
|
+
'NotAllowedError',
|
|
8
|
+
'InvalidStateError',
|
|
9
|
+
'SecurityError'
|
|
10
|
+
]);
|
|
11
|
+
function showPickerOf(input) {
|
|
12
|
+
try {
|
|
13
|
+
input.showPicker?.();
|
|
14
|
+
} catch (error) {
|
|
15
|
+
if (!(error instanceof DOMException) || !PICKER_REFUSALS.has(error.name)) throw error;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function AffixInput({ startIcon, iconOpensPicker = false, ...inputProps }) {
|
|
19
|
+
const inputRef = useRef(null);
|
|
20
|
+
if (!startIcon) return /*#__PURE__*/ jsx(Input, {
|
|
21
|
+
...inputProps,
|
|
22
|
+
className: field_module.control
|
|
23
|
+
});
|
|
24
|
+
function handlePillMouseDown(event) {
|
|
25
|
+
const input = inputRef.current;
|
|
26
|
+
if (!focusInputFromPill(event, input)) return;
|
|
27
|
+
if (iconOpensPicker && input instanceof HTMLInputElement && event.target instanceof Element && null !== event.target.closest(`.${field_module.affixIcon}`)) showPickerOf(input);
|
|
28
|
+
}
|
|
29
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
30
|
+
className: [
|
|
31
|
+
field_module.control,
|
|
32
|
+
field_module.affix
|
|
33
|
+
].join(' '),
|
|
34
|
+
"data-icon-opens-picker": iconOpensPicker ? '' : void 0,
|
|
35
|
+
onMouseDown: handlePillMouseDown,
|
|
36
|
+
children: [
|
|
37
|
+
/*#__PURE__*/ jsx("span", {
|
|
38
|
+
className: field_module.affixIcon,
|
|
39
|
+
"aria-hidden": "true",
|
|
40
|
+
children: startIcon
|
|
41
|
+
}),
|
|
42
|
+
/*#__PURE__*/ jsx(Input, {
|
|
43
|
+
...inputProps,
|
|
44
|
+
ref: inputRef,
|
|
45
|
+
className: field_module.affixInput
|
|
46
|
+
})
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
export { AffixInput };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface GroupFrameProps {
|
|
3
|
+
/** The legend's id. The group inside points its `aria-labelledby` at it. */
|
|
4
|
+
labelId: string;
|
|
5
|
+
label: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
error?: string;
|
|
9
|
+
required: boolean;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
/** The group itself, and anything that sits between it and the messages. */
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Internal, not exported from `src/index.ts`. The frame of a field whose control is a group of
|
|
16
|
+
* options (`RadioGroup`, `ChoiceCard`, `ToggleChipGroup`): the `Field.Root`, a legend naming the
|
|
17
|
+
* group, the group, then the description and error.
|
|
18
|
+
*/
|
|
19
|
+
export declare function GroupFrame({ labelId, label, name, description, error, required, disabled, children, }: GroupFrameProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Field } from "@base-ui/react/field";
|
|
3
|
+
import field_module from "../../styles/field.module.js";
|
|
4
|
+
import { FieldMessages, RequiredMark } from "./Field.js";
|
|
5
|
+
function GroupFrame({ labelId, label, name, description, error, required, disabled, children }) {
|
|
6
|
+
return /*#__PURE__*/ jsxs(Field.Root, {
|
|
7
|
+
className: field_module.frame,
|
|
8
|
+
name: name,
|
|
9
|
+
disabled: disabled,
|
|
10
|
+
invalid: void 0 !== error,
|
|
11
|
+
children: [
|
|
12
|
+
/*#__PURE__*/ jsxs("span", {
|
|
13
|
+
className: field_module.legend,
|
|
14
|
+
id: labelId,
|
|
15
|
+
"data-disabled": disabled ? '' : void 0,
|
|
16
|
+
children: [
|
|
17
|
+
label,
|
|
18
|
+
/*#__PURE__*/ jsx(RequiredMark, {
|
|
19
|
+
when: required
|
|
20
|
+
})
|
|
21
|
+
]
|
|
22
|
+
}),
|
|
23
|
+
children,
|
|
24
|
+
/*#__PURE__*/ jsx(FieldMessages, {
|
|
25
|
+
description: description,
|
|
26
|
+
error: error
|
|
27
|
+
})
|
|
28
|
+
]
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export { GroupFrame };
|
|
@@ -7,8 +7,14 @@ export interface PickerFieldProps extends FieldFrameProps {
|
|
|
7
7
|
value: string | null;
|
|
8
8
|
/** The trigger's words: the value as it reads, or the placeholder. */
|
|
9
9
|
valueText: string;
|
|
10
|
-
/** Sits at the end of the trigger
|
|
10
|
+
/** Sits at the end of the trigger, or at the start with `iconPlacement`. */
|
|
11
11
|
icon: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Which end of the trigger the icon sits at. `start` puts its wrapper before the value and writes
|
|
14
|
+
* `data-icon-placement="start"` on the trigger, which then packs both to the start; `end` is the
|
|
15
|
+
* trigger as it was, with no attribute.
|
|
16
|
+
*/
|
|
17
|
+
iconPlacement?: 'start' | 'end';
|
|
12
18
|
/** Added to the icon's wrapper, for a picker whose icon reacts to the popup. */
|
|
13
19
|
iconClassName?: string;
|
|
14
20
|
/** Joins the trigger's accessible name when the field is `required`. */
|
|
@@ -38,4 +44,4 @@ export interface PickerFieldProps extends FieldFrameProps {
|
|
|
38
44
|
* element gets the name, the description, `aria-invalid`, `Form`'s focus and the clearing of a
|
|
39
45
|
* `Form` error as any Base UI control does, none of which a hidden input could use.
|
|
40
46
|
*/
|
|
41
|
-
export declare function PickerField({ label, name, description, error, required, disabled, value, valueText, icon, iconClassName, requiredWord, validate, onReset, clearable, clearLabel, onClear, onBlur, onTriggerKeyDown, open, onOpenChange, modal, children, }: PickerFieldProps): import("react").JSX.Element;
|
|
47
|
+
export declare function PickerField({ label, name, description, error, required, disabled, value, valueText, icon, iconPlacement, iconClassName, requiredWord, validate, onReset, clearable, clearLabel, onClear, onBlur, onTriggerKeyDown, open, onOpenChange, modal, children, }: PickerFieldProps): import("react").JSX.Element;
|
|
@@ -9,12 +9,20 @@ import { useFormValue } from "../Form/FormContext.js";
|
|
|
9
9
|
import { IconButton } from "../IconButton/IconButton.js";
|
|
10
10
|
import { FieldMessages, RequiredMark } from "./Field.js";
|
|
11
11
|
import PickerField_module from "./PickerField.module.js";
|
|
12
|
-
function PickerField({ label, name, description, error, required = false, disabled = false, value, valueText, icon, iconClassName, requiredWord, validate, onReset, clearable, clearLabel, onClear, onBlur, onTriggerKeyDown, open, onOpenChange, modal, children }) {
|
|
12
|
+
function PickerField({ label, name, description, error, required = false, disabled = false, value, valueText, icon, iconPlacement = 'end', iconClassName, requiredWord, validate, onReset, clearable, clearLabel, onClear, onBlur, onTriggerKeyDown, open, onOpenChange, modal, children }) {
|
|
13
13
|
const labelId = useId();
|
|
14
14
|
const valueId = useId();
|
|
15
15
|
const requiredId = useId();
|
|
16
16
|
const triggerRef = useRef(null);
|
|
17
|
+
const iconAtStart = 'start' === iconPlacement;
|
|
17
18
|
const hiddenInputRef = useRef(null);
|
|
19
|
+
const iconSpan = /*#__PURE__*/ jsx("span", {
|
|
20
|
+
className: [
|
|
21
|
+
PickerField_module.icon,
|
|
22
|
+
iconClassName
|
|
23
|
+
].filter(Boolean).join(' '),
|
|
24
|
+
children: icon
|
|
25
|
+
});
|
|
18
26
|
useFormValue(disabled ? void 0 : name, value);
|
|
19
27
|
useFormReset(hiddenInputRef, onReset);
|
|
20
28
|
return /*#__PURE__*/ jsxs(Field.Root, {
|
|
@@ -60,24 +68,20 @@ function PickerField({ label, name, description, error, required = false, disabl
|
|
|
60
68
|
required ? requiredId : null,
|
|
61
69
|
valueId
|
|
62
70
|
].filter(Boolean).join(' '),
|
|
71
|
+
"data-icon-placement": iconAtStart ? 'start' : void 0,
|
|
63
72
|
render: /*#__PURE__*/ jsx("button", {
|
|
64
73
|
type: "button"
|
|
65
74
|
})
|
|
66
75
|
}),
|
|
67
76
|
children: [
|
|
77
|
+
iconAtStart ? iconSpan : null,
|
|
68
78
|
/*#__PURE__*/ jsx("span", {
|
|
69
79
|
id: valueId,
|
|
70
80
|
className: PickerField_module.value,
|
|
71
81
|
"data-placeholder": null === value ? '' : void 0,
|
|
72
82
|
children: valueText
|
|
73
83
|
}),
|
|
74
|
-
|
|
75
|
-
className: [
|
|
76
|
-
PickerField_module.icon,
|
|
77
|
-
iconClassName
|
|
78
|
-
].filter(Boolean).join(' '),
|
|
79
|
-
children: icon
|
|
80
|
-
})
|
|
84
|
+
iconAtStart ? null : iconSpan
|
|
81
85
|
]
|
|
82
86
|
}),
|
|
83
87
|
children
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./PickerField_module.css";
|
|
2
2
|
const PickerField_module = {
|
|
3
|
-
row: "row-nA5dt",
|
|
4
|
-
trigger: "trigger-EkNQz",
|
|
5
|
-
value: "value-iJ2rA",
|
|
6
|
-
icon: "icon-fNz5y"
|
|
3
|
+
row: "ui0-7-0-row-nA5dt",
|
|
4
|
+
trigger: "ui0-7-0-trigger-EkNQz",
|
|
5
|
+
value: "ui0-7-0-value-iJ2rA",
|
|
6
|
+
icon: "ui0-7-0-icon-fNz5y"
|
|
7
7
|
};
|
|
8
8
|
export default PickerField_module;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
.row-nA5dt {
|
|
1
|
+
.ui0-7-0-row-nA5dt {
|
|
2
2
|
align-items: center;
|
|
3
3
|
gap: var(--space-2);
|
|
4
4
|
display: flex;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.trigger-EkNQz {
|
|
7
|
+
.ui0-7-0-trigger-EkNQz {
|
|
8
8
|
justify-content: space-between;
|
|
9
9
|
gap: var(--space-3);
|
|
10
10
|
text-align: start;
|
|
@@ -13,23 +13,28 @@
|
|
|
13
13
|
min-width: 0;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.
|
|
16
|
+
.ui0-7-0-trigger-EkNQz[data-icon-placement="start"] {
|
|
17
|
+
justify-content: flex-start;
|
|
18
|
+
gap: var(--space-2);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.ui0-7-0-value-iJ2rA {
|
|
17
22
|
white-space: nowrap;
|
|
18
23
|
text-overflow: ellipsis;
|
|
19
24
|
overflow: hidden;
|
|
20
25
|
}
|
|
21
26
|
|
|
22
|
-
.value-iJ2rA[data-placeholder] {
|
|
27
|
+
.ui0-7-0-value-iJ2rA[data-placeholder] {
|
|
23
28
|
color: var(--color-text-muted);
|
|
24
29
|
}
|
|
25
30
|
|
|
26
|
-
.icon-fNz5y {
|
|
31
|
+
.ui0-7-0-icon-fNz5y {
|
|
27
32
|
color: var(--color-text-muted);
|
|
28
33
|
flex: none;
|
|
29
34
|
display: inline-flex;
|
|
30
35
|
}
|
|
31
36
|
|
|
32
|
-
.icon-fNz5y > svg {
|
|
37
|
+
.ui0-7-0-icon-fNz5y > svg {
|
|
33
38
|
width: 1rem;
|
|
34
39
|
height: 1rem;
|
|
35
40
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "./FilterBar_module.css";
|
|
2
2
|
const FilterBar_module = {
|
|
3
|
-
root: "root-qnTXQ",
|
|
4
|
-
controls: "controls-UYZLG",
|
|
5
|
-
search: "search-tu3RA",
|
|
6
|
-
summary: "summary-CSd_P",
|
|
7
|
-
count: "count-dGqXH",
|
|
8
|
-
chips: "chips-BHcAD",
|
|
9
|
-
chip: "chip-wCX2N",
|
|
10
|
-
chipLabel: "chipLabel-lhx4e",
|
|
11
|
-
remove: "remove-RNUMA"
|
|
3
|
+
root: "ui0-7-0-root-qnTXQ",
|
|
4
|
+
controls: "ui0-7-0-controls-UYZLG",
|
|
5
|
+
search: "ui0-7-0-search-tu3RA",
|
|
6
|
+
summary: "ui0-7-0-summary-CSd_P",
|
|
7
|
+
count: "ui0-7-0-count-dGqXH",
|
|
8
|
+
chips: "ui0-7-0-chips-BHcAD",
|
|
9
|
+
chip: "ui0-7-0-chip-wCX2N",
|
|
10
|
+
chipLabel: "ui0-7-0-chipLabel-lhx4e",
|
|
11
|
+
remove: "ui0-7-0-remove-RNUMA"
|
|
12
12
|
};
|
|
13
13
|
export default FilterBar_module;
|