@calcifer-design/ui 0.6.0 → 0.8.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.module.js +32 -32
- package/dist/components/DataGrid/DataGrid_module.css +67 -62
- 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 +33 -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 +53 -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/SearchIcon.d.ts +9 -0
- package/dist/icons/SearchIcon.js +23 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +12 -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 +94 -25
- 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 +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
.card-sKuGs {
|
|
1
|
+
.ui0-8-0-card-sKuGs {
|
|
2
2
|
background: var(--color-surface-raised);
|
|
3
3
|
border: 1px solid var(--color-card-border);
|
|
4
|
-
border-radius: var(--radius-
|
|
4
|
+
border-radius: var(--radius-popup);
|
|
5
5
|
min-width: 0;
|
|
6
6
|
box-shadow: var(--elevation-1);
|
|
7
7
|
flex-direction: column;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
overflow: hidden;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
.header-FnSmG {
|
|
12
|
+
.ui0-8-0-header-FnSmG {
|
|
13
13
|
justify-content: space-between;
|
|
14
14
|
align-items: center;
|
|
15
15
|
gap: var(--space-3);
|
|
@@ -18,15 +18,18 @@
|
|
|
18
18
|
display: flex;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
.heading-cO1_Q {
|
|
21
|
+
.ui0-8-0-heading-cO1_Q {
|
|
22
22
|
white-space: nowrap;
|
|
23
23
|
font-size: var(--text-md);
|
|
24
|
+
font-family: var(--font-display);
|
|
25
|
+
font-weight: var(--font-weight-display);
|
|
26
|
+
font-stretch: var(--font-stretch-display);
|
|
27
|
+
text-transform: var(--text-transform-display);
|
|
24
28
|
color: var(--color-text);
|
|
25
29
|
margin: 0;
|
|
26
|
-
font-weight: 600;
|
|
27
30
|
}
|
|
28
31
|
|
|
29
|
-
.cluster-FC5NS {
|
|
32
|
+
.ui0-8-0-cluster-FC5NS {
|
|
30
33
|
justify-content: flex-end;
|
|
31
34
|
align-items: center;
|
|
32
35
|
gap: var(--space-2);
|
|
@@ -35,43 +38,43 @@
|
|
|
35
38
|
display: flex;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
|
-
.actions-_1Hpt {
|
|
41
|
+
.ui0-8-0-actions-_1Hpt {
|
|
39
42
|
align-items: center;
|
|
40
43
|
gap: var(--space-2);
|
|
41
44
|
flex-wrap: wrap;
|
|
42
45
|
display: flex;
|
|
43
46
|
}
|
|
44
47
|
|
|
45
|
-
.scroll-FzUQa {
|
|
48
|
+
.ui0-8-0-scroll-FzUQa {
|
|
46
49
|
max-height: calc(100dvh - var(--space-10) * 2);
|
|
47
50
|
overflow: auto;
|
|
48
51
|
}
|
|
49
52
|
|
|
50
|
-
.fill-gnSOL {
|
|
53
|
+
.ui0-8-0-fill-gnSOL {
|
|
51
54
|
height: 100%;
|
|
52
55
|
}
|
|
53
56
|
|
|
54
|
-
.scrollFill-ouKju {
|
|
57
|
+
.ui0-8-0-scrollFill-ouKju {
|
|
55
58
|
flex: 1 1 0;
|
|
56
59
|
min-height: 0;
|
|
57
60
|
max-height: none;
|
|
58
61
|
}
|
|
59
62
|
|
|
60
|
-
.table-sZLxO {
|
|
63
|
+
.ui0-8-0-table-sZLxO {
|
|
61
64
|
border-collapse: collapse;
|
|
62
65
|
width: 100%;
|
|
63
66
|
font-size: var(--text-sm);
|
|
64
67
|
font-variant-numeric: tabular-nums;
|
|
65
68
|
}
|
|
66
69
|
|
|
67
|
-
.head-z5Rnq {
|
|
70
|
+
.ui0-8-0-head-z5Rnq {
|
|
68
71
|
z-index: 1;
|
|
69
72
|
background: var(--color-surface-1);
|
|
70
73
|
position: sticky;
|
|
71
74
|
inset-block-start: 0;
|
|
72
75
|
}
|
|
73
76
|
|
|
74
|
-
.headerCell-CgaE0 {
|
|
77
|
+
.ui0-8-0-headerCell-CgaE0 {
|
|
75
78
|
padding: var(--space-2) var(--space-3);
|
|
76
79
|
text-align: start;
|
|
77
80
|
font-size: var(--text-sm);
|
|
@@ -81,7 +84,7 @@
|
|
|
81
84
|
position: relative;
|
|
82
85
|
}
|
|
83
86
|
|
|
84
|
-
.headerCell-CgaE0:before, .headerCell-CgaE0:after {
|
|
87
|
+
.ui0-8-0-headerCell-CgaE0:before, .ui0-8-0-headerCell-CgaE0:after {
|
|
85
88
|
content: "";
|
|
86
89
|
border-block-start: 1px solid var(--color-border);
|
|
87
90
|
pointer-events: none;
|
|
@@ -89,144 +92,146 @@
|
|
|
89
92
|
inset-inline: 0;
|
|
90
93
|
}
|
|
91
94
|
|
|
92
|
-
.headerCell-CgaE0:before {
|
|
95
|
+
.ui0-8-0-headerCell-CgaE0:before {
|
|
93
96
|
inset-block-start: 0;
|
|
94
97
|
}
|
|
95
98
|
|
|
96
|
-
.headerCell-CgaE0:after {
|
|
99
|
+
.ui0-8-0-headerCell-CgaE0:after {
|
|
97
100
|
inset-block-end: 0;
|
|
98
101
|
}
|
|
99
102
|
|
|
100
|
-
.headerCell-CgaE0[data-sortable] {
|
|
103
|
+
.ui0-8-0-headerCell-CgaE0[data-sortable] {
|
|
101
104
|
cursor: pointer;
|
|
102
105
|
-webkit-user-select: none;
|
|
103
106
|
user-select: none;
|
|
104
107
|
}
|
|
105
108
|
|
|
106
|
-
.sortIcon-aw3qW {
|
|
109
|
+
.ui0-8-0-sortIcon-aw3qW {
|
|
107
110
|
margin-inline-start: var(--space-1);
|
|
108
111
|
}
|
|
109
112
|
|
|
110
|
-
.sortIcon-aw3qW:after {
|
|
113
|
+
.ui0-8-0-sortIcon-aw3qW:after {
|
|
111
114
|
content: "↕";
|
|
112
115
|
color: var(--color-text-subtle);
|
|
113
116
|
}
|
|
114
117
|
|
|
115
|
-
.sortIcon-aw3qW[data-direction="asc"]:after {
|
|
118
|
+
.ui0-8-0-sortIcon-aw3qW[data-direction="asc"]:after {
|
|
116
119
|
content: "↑";
|
|
117
120
|
color: var(--color-link);
|
|
118
121
|
}
|
|
119
122
|
|
|
120
|
-
.sortIcon-aw3qW[data-direction="desc"]:after {
|
|
123
|
+
.ui0-8-0-sortIcon-aw3qW[data-direction="desc"]:after {
|
|
121
124
|
content: "↓";
|
|
122
125
|
color: var(--color-link);
|
|
123
126
|
}
|
|
124
127
|
|
|
125
|
-
.row-OLZkz {
|
|
128
|
+
.ui0-8-0-row-OLZkz {
|
|
126
129
|
border-bottom: 1px solid var(--color-border);
|
|
127
130
|
transition-property: background-color;
|
|
128
131
|
transition-duration: var(--motion-duration-1);
|
|
129
132
|
transition-timing-function: var(--motion-ease);
|
|
130
133
|
}
|
|
131
134
|
|
|
132
|
-
.row-OLZkz:last-child {
|
|
135
|
+
.ui0-8-0-row-OLZkz:last-child {
|
|
133
136
|
border-bottom: 0;
|
|
134
137
|
}
|
|
135
138
|
|
|
136
139
|
@media (hover: hover) {
|
|
137
|
-
.row-OLZkz:hover {
|
|
140
|
+
.ui0-8-0-row-OLZkz:hover {
|
|
138
141
|
background: var(--color-surface-2);
|
|
139
142
|
}
|
|
140
143
|
}
|
|
141
144
|
|
|
142
|
-
.row-OLZkz[data-clickable] {
|
|
145
|
+
.ui0-8-0-row-OLZkz[data-clickable] {
|
|
143
146
|
cursor: pointer;
|
|
144
147
|
}
|
|
145
148
|
|
|
146
|
-
.row-OLZkz[data-highlighted], .row-OLZkz[aria-selected="true"] {
|
|
149
|
+
.ui0-8-0-row-OLZkz[data-highlighted], .ui0-8-0-row-OLZkz[aria-selected="true"] {
|
|
147
150
|
background: var(--color-accent-wash);
|
|
148
151
|
}
|
|
149
152
|
|
|
150
153
|
@media (hover: hover) {
|
|
151
|
-
.row-OLZkz[data-highlighted]:hover, .row-OLZkz[aria-selected="true"]:hover {
|
|
154
|
+
.ui0-8-0-row-OLZkz[data-highlighted]:hover, .ui0-8-0-row-OLZkz[aria-selected="true"]:hover {
|
|
152
155
|
background: var(--color-accent-soft);
|
|
153
156
|
}
|
|
154
157
|
}
|
|
155
158
|
|
|
156
159
|
@media (forced-colors: active) {
|
|
157
|
-
.row-OLZkz[data-highlighted], .row-OLZkz[aria-selected="true"] {
|
|
160
|
+
.ui0-8-0-row-OLZkz[data-highlighted], .ui0-8-0-row-OLZkz[aria-selected="true"] {
|
|
158
161
|
outline-style: solid;
|
|
159
162
|
outline-width: var(--focus-ring-width);
|
|
160
163
|
outline-offset: calc(var(--focus-ring-width) * -1);
|
|
161
164
|
}
|
|
162
165
|
}
|
|
163
166
|
|
|
164
|
-
.cell-TYnuY {
|
|
167
|
+
.ui0-8-0-cell-TYnuY {
|
|
165
168
|
min-width: calc(var(--space-3) * 5);
|
|
166
169
|
padding: var(--space-3);
|
|
167
170
|
vertical-align: middle;
|
|
168
171
|
color: var(--color-text);
|
|
172
|
+
font-family: var(--font-body);
|
|
173
|
+
font-weight: var(--font-weight-body);
|
|
169
174
|
overflow-wrap: anywhere;
|
|
170
175
|
}
|
|
171
176
|
|
|
172
|
-
.headerCell-CgaE0:first-child, .cell-TYnuY:first-child {
|
|
177
|
+
.ui0-8-0-headerCell-CgaE0:first-child, .ui0-8-0-cell-TYnuY:first-child {
|
|
173
178
|
padding-inline-start: var(--space-5);
|
|
174
179
|
}
|
|
175
180
|
|
|
176
|
-
.headerCell-CgaE0:last-child, .cell-TYnuY:last-child {
|
|
181
|
+
.ui0-8-0-headerCell-CgaE0:last-child, .ui0-8-0-cell-TYnuY:last-child {
|
|
177
182
|
padding-inline-end: var(--space-5);
|
|
178
183
|
}
|
|
179
184
|
|
|
180
|
-
.headerCell-CgaE0.pinnedHeader-b7R5T, .cell-TYnuY.pinnedCell-hktdQ {
|
|
185
|
+
.ui0-8-0-headerCell-CgaE0.ui0-8-0-pinnedHeader-b7R5T, .ui0-8-0-cell-TYnuY.ui0-8-0-pinnedCell-hktdQ {
|
|
181
186
|
text-align: center;
|
|
182
187
|
padding-inline: 0;
|
|
183
188
|
position: sticky;
|
|
184
189
|
}
|
|
185
190
|
|
|
186
|
-
.headerCell-CgaE0.pinnedHeader-b7R5T {
|
|
191
|
+
.ui0-8-0-headerCell-CgaE0.ui0-8-0-pinnedHeader-b7R5T {
|
|
187
192
|
z-index: 1;
|
|
188
193
|
background: var(--color-surface-1);
|
|
189
194
|
}
|
|
190
195
|
|
|
191
|
-
.cell-TYnuY.pinnedCell-hktdQ {
|
|
196
|
+
.ui0-8-0-cell-TYnuY.ui0-8-0-pinnedCell-hktdQ {
|
|
192
197
|
background-color: var(--color-surface-raised);
|
|
193
198
|
}
|
|
194
199
|
|
|
195
200
|
@media (hover: hover) {
|
|
196
|
-
.row-OLZkz:hover .cell-TYnuY.pinnedCell-hktdQ {
|
|
201
|
+
.ui0-8-0-row-OLZkz:hover .ui0-8-0-cell-TYnuY.ui0-8-0-pinnedCell-hktdQ {
|
|
197
202
|
background-image: linear-gradient(var(--color-surface-2), var(--color-surface-2));
|
|
198
203
|
}
|
|
199
204
|
}
|
|
200
205
|
|
|
201
|
-
.row-OLZkz[data-highlighted] .cell-TYnuY.pinnedCell-hktdQ, .row-OLZkz[aria-selected="true"] .cell-TYnuY.pinnedCell-hktdQ {
|
|
206
|
+
.ui0-8-0-row-OLZkz[data-highlighted] .ui0-8-0-cell-TYnuY.ui0-8-0-pinnedCell-hktdQ, .ui0-8-0-row-OLZkz[aria-selected="true"] .ui0-8-0-cell-TYnuY.ui0-8-0-pinnedCell-hktdQ {
|
|
202
207
|
background-image: linear-gradient(var(--color-accent-wash), var(--color-accent-wash));
|
|
203
208
|
}
|
|
204
209
|
|
|
205
210
|
@media (hover: hover) {
|
|
206
|
-
.row-OLZkz[data-highlighted]:hover .cell-TYnuY.pinnedCell-hktdQ, .row-OLZkz[aria-selected="true"]:hover .cell-TYnuY.pinnedCell-hktdQ {
|
|
211
|
+
.ui0-8-0-row-OLZkz[data-highlighted]:hover .ui0-8-0-cell-TYnuY.ui0-8-0-pinnedCell-hktdQ, .ui0-8-0-row-OLZkz[aria-selected="true"]:hover .ui0-8-0-cell-TYnuY.ui0-8-0-pinnedCell-hktdQ {
|
|
207
212
|
background-image: linear-gradient(var(--color-accent-soft), var(--color-accent-soft));
|
|
208
213
|
}
|
|
209
214
|
}
|
|
210
215
|
|
|
211
|
-
.headerCell-CgaE0.selectHeader-ysJFY, .cell-TYnuY.selectCell-WkrzU {
|
|
216
|
+
.ui0-8-0-headerCell-CgaE0.ui0-8-0-selectHeader-ysJFY, .ui0-8-0-cell-TYnuY.ui0-8-0-selectCell-WkrzU {
|
|
212
217
|
width: calc(var(--space-2) * 5);
|
|
213
218
|
min-width: calc(var(--space-2) * 5);
|
|
214
219
|
max-width: calc(var(--space-2) * 5);
|
|
215
220
|
inset-inline-start: 0;
|
|
216
221
|
}
|
|
217
222
|
|
|
218
|
-
.headerCell-CgaE0.expandHeader-xZuaw, .cell-TYnuY.expandCell-nB87K {
|
|
223
|
+
.ui0-8-0-headerCell-CgaE0.ui0-8-0-expandHeader-xZuaw, .ui0-8-0-cell-TYnuY.ui0-8-0-expandCell-nB87K {
|
|
219
224
|
width: calc(var(--space-5) + var(--space-1));
|
|
220
225
|
min-width: calc(var(--space-5) + var(--space-1));
|
|
221
226
|
max-width: calc(var(--space-5) + var(--space-1));
|
|
222
227
|
inset-inline-start: 0;
|
|
223
228
|
}
|
|
224
229
|
|
|
225
|
-
.selectHeader-ysJFY + .expandHeader-xZuaw, .selectCell-WkrzU + .expandCell-nB87K {
|
|
230
|
+
.ui0-8-0-selectHeader-ysJFY + .ui0-8-0-expandHeader-xZuaw, .ui0-8-0-selectCell-WkrzU + .ui0-8-0-expandCell-nB87K {
|
|
226
231
|
inset-inline-start: calc(var(--space-2) * 5);
|
|
227
232
|
}
|
|
228
233
|
|
|
229
|
-
.expandButton-gnwRu {
|
|
234
|
+
.ui0-8-0-expandButton-gnwRu {
|
|
230
235
|
width: var(--space-5);
|
|
231
236
|
height: var(--space-5);
|
|
232
237
|
border-radius: var(--radius-sm);
|
|
@@ -240,12 +245,12 @@
|
|
|
240
245
|
display: inline-flex;
|
|
241
246
|
}
|
|
242
247
|
|
|
243
|
-
.expandButton-gnwRu:focus-visible {
|
|
248
|
+
.ui0-8-0-expandButton-gnwRu:focus-visible {
|
|
244
249
|
outline: var(--focus-ring-width) solid var(--color-focus);
|
|
245
250
|
outline-offset: calc(var(--focus-ring-width) * -1);
|
|
246
251
|
}
|
|
247
252
|
|
|
248
|
-
.expandButton-gnwRu svg {
|
|
253
|
+
.ui0-8-0-expandButton-gnwRu svg {
|
|
249
254
|
width: var(--space-4);
|
|
250
255
|
height: var(--space-4);
|
|
251
256
|
transition-property: rotate;
|
|
@@ -253,32 +258,32 @@
|
|
|
253
258
|
transition-timing-function: var(--motion-ease);
|
|
254
259
|
}
|
|
255
260
|
|
|
256
|
-
.expandButton-gnwRu[aria-expanded="true"] svg {
|
|
261
|
+
.ui0-8-0-expandButton-gnwRu[aria-expanded="true"] svg {
|
|
257
262
|
rotate: 90deg;
|
|
258
263
|
}
|
|
259
264
|
|
|
260
|
-
.table-sZLxO[data-rtl] .expandButton-gnwRu svg {
|
|
265
|
+
.ui0-8-0-table-sZLxO[data-rtl] .ui0-8-0-expandButton-gnwRu svg {
|
|
261
266
|
scale: -1 1;
|
|
262
267
|
}
|
|
263
268
|
|
|
264
|
-
.table-sZLxO[data-rtl] .expandButton-gnwRu[aria-expanded="true"] svg {
|
|
269
|
+
.ui0-8-0-table-sZLxO[data-rtl] .ui0-8-0-expandButton-gnwRu[aria-expanded="true"] svg {
|
|
265
270
|
rotate: -90deg;
|
|
266
271
|
}
|
|
267
272
|
|
|
268
273
|
@media (prefers-reduced-motion: reduce) {
|
|
269
|
-
.expandButton-gnwRu svg {
|
|
274
|
+
.ui0-8-0-expandButton-gnwRu svg {
|
|
270
275
|
transition: none;
|
|
271
276
|
}
|
|
272
277
|
}
|
|
273
278
|
|
|
274
|
-
.headerCell-CgaE0.actionsHeader-DXNJS, .cell-TYnuY.actionsCell-XmWDR {
|
|
279
|
+
.ui0-8-0-headerCell-CgaE0.ui0-8-0-actionsHeader-DXNJS, .ui0-8-0-cell-TYnuY.ui0-8-0-actionsCell-XmWDR {
|
|
275
280
|
width: calc(var(--space-5) * 3);
|
|
276
281
|
min-width: calc(var(--space-5) * 3);
|
|
277
282
|
max-width: calc(var(--space-5) * 3);
|
|
278
283
|
inset-inline-end: 0;
|
|
279
284
|
}
|
|
280
285
|
|
|
281
|
-
.cell-TYnuY.actionsCell-XmWDR:before {
|
|
286
|
+
.ui0-8-0-cell-TYnuY.ui0-8-0-actionsCell-XmWDR:before {
|
|
282
287
|
content: "";
|
|
283
288
|
border-inline-start: 1px solid var(--color-border);
|
|
284
289
|
pointer-events: none;
|
|
@@ -287,29 +292,29 @@
|
|
|
287
292
|
inset-inline-start: 0;
|
|
288
293
|
}
|
|
289
294
|
|
|
290
|
-
.headerCell-CgaE0.actionsHeader-DXNJS:after {
|
|
295
|
+
.ui0-8-0-headerCell-CgaE0.ui0-8-0-actionsHeader-DXNJS:after {
|
|
291
296
|
border-inline-start: 1px solid var(--color-border);
|
|
292
297
|
border-block-end: 1px solid var(--color-border);
|
|
293
298
|
inset-block-start: 0;
|
|
294
299
|
}
|
|
295
300
|
|
|
296
|
-
.detailRow-WsOl1 {
|
|
301
|
+
.ui0-8-0-detailRow-WsOl1 {
|
|
297
302
|
border-block: 1px solid var(--color-border);
|
|
298
303
|
}
|
|
299
304
|
|
|
300
|
-
.detailCell-y4qyE {
|
|
305
|
+
.ui0-8-0-detailCell-y4qyE {
|
|
301
306
|
padding: var(--space-3) var(--space-4);
|
|
302
307
|
background: var(--color-surface-1);
|
|
303
308
|
color: var(--color-text);
|
|
304
309
|
}
|
|
305
310
|
|
|
306
|
-
.errorCell-m9Gxy {
|
|
311
|
+
.ui0-8-0-errorCell-m9Gxy {
|
|
307
312
|
padding: var(--space-3) var(--space-5);
|
|
308
313
|
text-align: center;
|
|
309
314
|
color: var(--color-text);
|
|
310
315
|
}
|
|
311
316
|
|
|
312
|
-
.errorContent-_tmon {
|
|
317
|
+
.ui0-8-0-errorContent-_tmon {
|
|
313
318
|
justify-content: center;
|
|
314
319
|
align-items: center;
|
|
315
320
|
gap: var(--space-3);
|
|
@@ -317,41 +322,41 @@
|
|
|
317
322
|
display: flex;
|
|
318
323
|
}
|
|
319
324
|
|
|
320
|
-
.headerCell-CgaE0:focus-visible, .cell-TYnuY:focus-visible, .detailCell-y4qyE:focus-visible, .errorCell-m9Gxy:focus-visible {
|
|
325
|
+
.ui0-8-0-headerCell-CgaE0:focus-visible, .ui0-8-0-cell-TYnuY:focus-visible, .ui0-8-0-detailCell-y4qyE:focus-visible, .ui0-8-0-errorCell-m9Gxy:focus-visible {
|
|
321
326
|
outline: var(--focus-ring-width) solid var(--color-focus);
|
|
322
327
|
outline-offset: calc(var(--focus-ring-width) * -1);
|
|
323
328
|
}
|
|
324
329
|
|
|
325
|
-
.table-sZLxO[data-density="compact"] .cell-TYnuY {
|
|
330
|
+
.ui0-8-0-table-sZLxO[data-density="compact"] .ui0-8-0-cell-TYnuY {
|
|
326
331
|
padding-block: var(--space-2);
|
|
327
332
|
}
|
|
328
333
|
|
|
329
|
-
.table-sZLxO[data-density="compact"] .cell-TYnuY:not(.pinnedCell-hktdQ) {
|
|
334
|
+
.ui0-8-0-table-sZLxO[data-density="compact"] .ui0-8-0-cell-TYnuY:not(.ui0-8-0-pinnedCell-hktdQ) {
|
|
330
335
|
text-overflow: ellipsis;
|
|
331
336
|
white-space: nowrap;
|
|
332
337
|
max-width: 0;
|
|
333
338
|
overflow: hidden;
|
|
334
339
|
}
|
|
335
340
|
|
|
336
|
-
.stateCell-_44Lv {
|
|
341
|
+
.ui0-8-0-stateCell-_44Lv {
|
|
337
342
|
padding: var(--space-8) var(--space-5);
|
|
338
343
|
text-align: center;
|
|
339
344
|
color: var(--color-text-muted);
|
|
340
345
|
}
|
|
341
346
|
|
|
342
|
-
.state-WLbKa {
|
|
347
|
+
.ui0-8-0-state-WLbKa {
|
|
343
348
|
justify-content: center;
|
|
344
349
|
align-items: center;
|
|
345
350
|
gap: var(--space-3);
|
|
346
351
|
display: flex;
|
|
347
352
|
}
|
|
348
353
|
|
|
349
|
-
.spacerCell-IoOYY {
|
|
354
|
+
.ui0-8-0-spacerCell-IoOYY {
|
|
350
355
|
border: 0;
|
|
351
356
|
padding: 0;
|
|
352
357
|
}
|
|
353
358
|
|
|
354
|
-
.footer-pI1Q7 {
|
|
359
|
+
.ui0-8-0-footer-pI1Q7 {
|
|
355
360
|
align-items: center;
|
|
356
361
|
gap: var(--space-3);
|
|
357
362
|
padding: var(--space-2) var(--space-5);
|
|
@@ -361,7 +366,7 @@
|
|
|
361
366
|
display: flex;
|
|
362
367
|
}
|
|
363
368
|
|
|
364
|
-
.rowCount-M_Nba {
|
|
369
|
+
.ui0-8-0-rowCount-M_Nba {
|
|
365
370
|
margin-inline-start: auto;
|
|
366
371
|
}
|
|
367
372
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "./DataTable_module.css";
|
|
2
2
|
const DataTable_module = {
|
|
3
|
-
scroll: "scroll-vHFjf",
|
|
4
|
-
table: "table-H20Eb",
|
|
5
|
-
caption: "caption-glW7e",
|
|
6
|
-
head: "head-KQpiR",
|
|
7
|
-
headerCell: "headerCell-Bm5aB",
|
|
8
|
-
sortButton: "sortButton-b2Ze6",
|
|
9
|
-
sortIcon: "sortIcon-sc98J",
|
|
10
|
-
row: "row-oItIj",
|
|
11
|
-
cell: "cell-L4VgS"
|
|
3
|
+
scroll: "ui0-8-0-scroll-vHFjf",
|
|
4
|
+
table: "ui0-8-0-table-H20Eb",
|
|
5
|
+
caption: "ui0-8-0-caption-glW7e",
|
|
6
|
+
head: "ui0-8-0-head-KQpiR",
|
|
7
|
+
headerCell: "ui0-8-0-headerCell-Bm5aB",
|
|
8
|
+
sortButton: "ui0-8-0-sortButton-b2Ze6",
|
|
9
|
+
sortIcon: "ui0-8-0-sortIcon-sc98J",
|
|
10
|
+
row: "ui0-8-0-row-oItIj",
|
|
11
|
+
cell: "ui0-8-0-cell-L4VgS"
|
|
12
12
|
};
|
|
13
13
|
export default DataTable_module;
|
|
@@ -1,40 +1,43 @@
|
|
|
1
|
-
.scroll-vHFjf {
|
|
1
|
+
.ui0-8-0-scroll-vHFjf {
|
|
2
2
|
border: 1px solid var(--color-border);
|
|
3
|
-
border-radius: var(--radius-
|
|
3
|
+
border-radius: var(--radius-popup);
|
|
4
4
|
background: var(--color-surface-raised);
|
|
5
5
|
overflow-x: auto;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
.scroll-vHFjf[data-bare] {
|
|
8
|
+
.ui0-8-0-scroll-vHFjf[data-bare] {
|
|
9
9
|
background: none;
|
|
10
10
|
border: 0;
|
|
11
11
|
border-radius: 0;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.table-H20Eb {
|
|
14
|
+
.ui0-8-0-table-H20Eb {
|
|
15
15
|
border-collapse: collapse;
|
|
16
16
|
width: 100%;
|
|
17
|
+
font-family: var(--font-body);
|
|
18
|
+
font-weight: var(--font-weight-body);
|
|
17
19
|
font-size: var(--text-sm);
|
|
18
20
|
font-variant-numeric: tabular-nums;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
.caption-glW7e {
|
|
23
|
+
.ui0-8-0-caption-glW7e {
|
|
22
24
|
padding: var(--space-3) var(--space-5);
|
|
23
25
|
text-align: left;
|
|
26
|
+
font-family: var(--font-sans);
|
|
27
|
+
font-weight: var(--font-weight-heading);
|
|
24
28
|
color: var(--color-text);
|
|
25
29
|
caption-side: top;
|
|
26
|
-
font-weight: 600;
|
|
27
30
|
}
|
|
28
31
|
|
|
29
|
-
.caption-glW7e[data-hidden] {
|
|
32
|
+
.ui0-8-0-caption-glW7e[data-hidden] {
|
|
30
33
|
padding: 0;
|
|
31
34
|
}
|
|
32
35
|
|
|
33
|
-
.head-KQpiR {
|
|
36
|
+
.ui0-8-0-head-KQpiR {
|
|
34
37
|
background: var(--color-surface-2);
|
|
35
38
|
}
|
|
36
39
|
|
|
37
|
-
.headerCell-Bm5aB {
|
|
40
|
+
.ui0-8-0-headerCell-Bm5aB {
|
|
38
41
|
padding: var(--space-1) var(--space-3);
|
|
39
42
|
border-block: 1px solid var(--color-border);
|
|
40
43
|
text-align: left;
|
|
@@ -47,7 +50,7 @@
|
|
|
47
50
|
font-weight: 500;
|
|
48
51
|
}
|
|
49
52
|
|
|
50
|
-
.sortButton-b2Ze6 {
|
|
53
|
+
.ui0-8-0-sortButton-b2Ze6 {
|
|
51
54
|
align-items: center;
|
|
52
55
|
gap: var(--space-1);
|
|
53
56
|
min-height: var(--size-touch);
|
|
@@ -62,22 +65,22 @@
|
|
|
62
65
|
display: inline-flex;
|
|
63
66
|
}
|
|
64
67
|
|
|
65
|
-
.sortIcon-sc98J:after {
|
|
68
|
+
.ui0-8-0-sortIcon-sc98J:after {
|
|
66
69
|
content: "↕";
|
|
67
70
|
color: var(--color-text-subtle);
|
|
68
71
|
}
|
|
69
72
|
|
|
70
|
-
.sortIcon-sc98J[data-direction="asc"]:after {
|
|
73
|
+
.ui0-8-0-sortIcon-sc98J[data-direction="asc"]:after {
|
|
71
74
|
content: "↑";
|
|
72
75
|
color: var(--color-link);
|
|
73
76
|
}
|
|
74
77
|
|
|
75
|
-
.sortIcon-sc98J[data-direction="desc"]:after {
|
|
78
|
+
.ui0-8-0-sortIcon-sc98J[data-direction="desc"]:after {
|
|
76
79
|
content: "↓";
|
|
77
80
|
color: var(--color-link);
|
|
78
81
|
}
|
|
79
82
|
|
|
80
|
-
.row-oItIj {
|
|
83
|
+
.ui0-8-0-row-oItIj {
|
|
81
84
|
border-bottom: 1px solid var(--color-border);
|
|
82
85
|
transition-property: background-color;
|
|
83
86
|
transition-duration: var(--motion-duration-1);
|
|
@@ -85,33 +88,33 @@
|
|
|
85
88
|
}
|
|
86
89
|
|
|
87
90
|
@media (hover: hover) {
|
|
88
|
-
.row-oItIj:hover {
|
|
91
|
+
.ui0-8-0-row-oItIj:hover {
|
|
89
92
|
background: var(--color-surface-2);
|
|
90
93
|
}
|
|
91
94
|
}
|
|
92
95
|
|
|
93
|
-
.cell-L4VgS {
|
|
96
|
+
.ui0-8-0-cell-L4VgS {
|
|
94
97
|
height: 2.75rem;
|
|
95
98
|
padding: var(--space-2) var(--space-3);
|
|
96
99
|
vertical-align: middle;
|
|
97
100
|
white-space: nowrap;
|
|
98
101
|
}
|
|
99
102
|
|
|
100
|
-
.headerCell-Bm5aB:first-child, .cell-L4VgS:first-child {
|
|
103
|
+
.ui0-8-0-headerCell-Bm5aB:first-child, .ui0-8-0-cell-L4VgS:first-child {
|
|
101
104
|
padding-inline-start: var(--space-5);
|
|
102
105
|
}
|
|
103
106
|
|
|
104
|
-
.headerCell-Bm5aB:last-child, .cell-L4VgS:last-child {
|
|
107
|
+
.ui0-8-0-headerCell-Bm5aB:last-child, .ui0-8-0-cell-L4VgS:last-child {
|
|
105
108
|
padding-inline-end: var(--space-5);
|
|
106
109
|
}
|
|
107
110
|
|
|
108
|
-
.table-H20Eb[data-stacked] .row-oItIj {
|
|
111
|
+
.ui0-8-0-table-H20Eb[data-stacked] .ui0-8-0-row-oItIj {
|
|
109
112
|
gap: var(--space-1);
|
|
110
113
|
padding: var(--space-3) var(--space-5);
|
|
111
114
|
display: grid;
|
|
112
115
|
}
|
|
113
116
|
|
|
114
|
-
.table-H20Eb[data-stacked] .cell-L4VgS {
|
|
117
|
+
.ui0-8-0-table-H20Eb[data-stacked] .ui0-8-0-cell-L4VgS {
|
|
115
118
|
gap: var(--space-2);
|
|
116
119
|
white-space: normal;
|
|
117
120
|
overflow-wrap: anywhere;
|
|
@@ -121,7 +124,7 @@
|
|
|
121
124
|
display: grid;
|
|
122
125
|
}
|
|
123
126
|
|
|
124
|
-
.table-H20Eb[data-stacked] .cell-L4VgS:before {
|
|
127
|
+
.ui0-8-0-table-H20Eb[data-stacked] .ui0-8-0-cell-L4VgS:before {
|
|
125
128
|
content: attr(data-label);
|
|
126
129
|
font-family: var(--font-mono);
|
|
127
130
|
font-size: var(--text-2xs);
|
|
@@ -62,6 +62,20 @@ export interface DatePickerProps extends FieldFrameProps {
|
|
|
62
62
|
clearable?: boolean;
|
|
63
63
|
/** Shown on the trigger while nothing is chosen. */
|
|
64
64
|
placeholder?: string;
|
|
65
|
+
/**
|
|
66
|
+
* How the chosen date reads on the trigger, in the picker's `locale`: the options of
|
|
67
|
+
* `Intl.DateTimeFormat`. Defaults to `{ dateStyle: 'medium' }`. The placeholder and the calendar's
|
|
68
|
+
* own labels do not follow it. The date is a calendar day, so `timeZone` and `calendar` are fixed
|
|
69
|
+
* (UTC and Gregorian) whatever the options say. `Intl` refuses `dateStyle` beside the individual
|
|
70
|
+
* fields (`weekday`, `month` and the rest), and a value it does not know: options it refuses fall
|
|
71
|
+
* back to the default, with a warning in development, so use one or the other.
|
|
72
|
+
*/
|
|
73
|
+
formatOptions?: Intl.DateTimeFormatOptions;
|
|
74
|
+
/**
|
|
75
|
+
* Which end of the trigger the calendar icon sits at. `start` puts it before the date and packs
|
|
76
|
+
* both to the start; `end` is the trigger as it was.
|
|
77
|
+
*/
|
|
78
|
+
iconPlacement?: 'start' | 'end';
|
|
65
79
|
/** The words the control says itself, for an app that is not in English. */
|
|
66
80
|
labels?: Partial<DatePickerLabels>;
|
|
67
81
|
}
|
|
@@ -69,4 +83,4 @@ export interface DatePickerProps extends FieldFrameProps {
|
|
|
69
83
|
* A date field: a button showing the formatted date opens the WAI-ARIA date picker dialog, whose
|
|
70
84
|
* grid is ours because Base UI has no public calendar. Submits `YYYY-MM-DD` through a hidden input.
|
|
71
85
|
*/
|
|
72
|
-
export declare function DatePicker({ label, name, description, error, required, disabled, value, defaultValue, onValueChange, onBlur, min, max, isDateDisabled, locale, weekStartsOn, clearable, placeholder, labels, }: DatePickerProps): import("react").JSX.Element;
|
|
86
|
+
export declare function DatePicker({ label, name, description, error, required, disabled, value, defaultValue, onValueChange, onBlur, min, max, isDateDisabled, locale, weekStartsOn, clearable, placeholder, formatOptions, iconPlacement, labels, }: DatePickerProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Popover } from "@base-ui/react/popover";
|
|
3
|
-
import { useRef, useState } from "react";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
4
|
import { CalendarIcon } from "../../icons/CalendarIcon.js";
|
|
5
|
+
import { usePortalContainer } from "../ThemeScope/PortalContainerContext.js";
|
|
5
6
|
import popup_module from "../../styles/popup.module.js";
|
|
6
7
|
import { Button } from "../Button/Button.js";
|
|
7
8
|
import { PickerField } from "../Field/PickerField.js";
|
|
@@ -16,8 +17,26 @@ const DEFAULT_LABELS = {
|
|
|
16
17
|
requiredMessage: 'Choose a date.',
|
|
17
18
|
unavailableMessage: 'Choose an available date.'
|
|
18
19
|
};
|
|
19
|
-
|
|
20
|
+
const DEFAULT_FORMAT_OPTIONS = {
|
|
21
|
+
dateStyle: 'medium'
|
|
22
|
+
};
|
|
23
|
+
function triggerFormatter(locale, options) {
|
|
24
|
+
try {
|
|
25
|
+
return {
|
|
26
|
+
formatter: dateFormatter(locale, options),
|
|
27
|
+
refused: false
|
|
28
|
+
};
|
|
29
|
+
} catch (error) {
|
|
30
|
+
if (!(error instanceof TypeError || error instanceof RangeError)) throw error;
|
|
31
|
+
return {
|
|
32
|
+
formatter: dateFormatter(locale, DEFAULT_FORMAT_OPTIONS),
|
|
33
|
+
refused: true
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function DatePicker({ label, name, description, error, required = false, disabled = false, value, defaultValue, onValueChange, onBlur, min, max, isDateDisabled, locale, weekStartsOn, clearable = false, placeholder = 'Choose a date', formatOptions = DEFAULT_FORMAT_OPTIONS, iconPlacement = 'end', labels }) {
|
|
20
38
|
const gridRef = useRef(null);
|
|
39
|
+
const container = usePortalContainer();
|
|
21
40
|
const [heldValue, setHeldValue] = useState(()=>parseIsoDate(defaultValue));
|
|
22
41
|
const [open, setOpen] = useState(false);
|
|
23
42
|
if (open && disabled) setOpen(false);
|
|
@@ -31,6 +50,12 @@ function DatePicker({ label, name, description, error, required = false, disable
|
|
|
31
50
|
const firstWeekday = weekStartsOn ?? weekStartOf(resolvedLocale);
|
|
32
51
|
const earliest = parseIsoDate(min);
|
|
33
52
|
const latest = parseIsoDate(max);
|
|
53
|
+
const { formatter, refused } = triggerFormatter(resolvedLocale, formatOptions);
|
|
54
|
+
useEffect(()=>{
|
|
55
|
+
if (refused && 'production' !== process.env.NODE_ENV) console.warn('DatePicker: Intl.DateTimeFormat refused formatOptions; the default { dateStyle: "medium" } is used instead.');
|
|
56
|
+
}, [
|
|
57
|
+
refused
|
|
58
|
+
]);
|
|
34
59
|
const commit = (nextValue)=>{
|
|
35
60
|
setHeldValue(nextValue);
|
|
36
61
|
if (nextValue !== chosen) onValueChange?.(nextValue);
|
|
@@ -43,10 +68,9 @@ function DatePicker({ label, name, description, error, required = false, disable
|
|
|
43
68
|
required: required,
|
|
44
69
|
disabled: disabled,
|
|
45
70
|
value: chosen,
|
|
46
|
-
valueText: null === chosen ? placeholder :
|
|
47
|
-
dateStyle: 'medium'
|
|
48
|
-
}).format(chosen),
|
|
71
|
+
valueText: null === chosen ? placeholder : formatter.format(chosen),
|
|
49
72
|
icon: /*#__PURE__*/ jsx(CalendarIcon, {}),
|
|
73
|
+
iconPlacement: iconPlacement,
|
|
50
74
|
requiredWord: words.required,
|
|
51
75
|
validate: ()=>{
|
|
52
76
|
if (null === chosen) return required ? words.requiredMessage : null;
|
|
@@ -67,10 +91,14 @@ function DatePicker({ label, name, description, error, required = false, disable
|
|
|
67
91
|
onOpenChange: setOpen,
|
|
68
92
|
modal: "trap-focus",
|
|
69
93
|
children: /*#__PURE__*/ jsx(Popover.Portal, {
|
|
94
|
+
container: container,
|
|
70
95
|
children: /*#__PURE__*/ jsx(Popover.Positioner, {
|
|
71
96
|
className: popup_module.layer,
|
|
72
97
|
align: "start",
|
|
73
98
|
sideOffset: 8,
|
|
99
|
+
collisionAvoidance: {
|
|
100
|
+
fallbackAxisSide: 'none'
|
|
101
|
+
},
|
|
74
102
|
children: /*#__PURE__*/ jsxs(Popover.Popup, {
|
|
75
103
|
className: [
|
|
76
104
|
popup_module.surface,
|