rift-ds 1.40.0 → 1.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/behaviors/LoadingImage.d.ts +2 -0
- package/behaviors/LoadingImage.js +34 -0
- package/behaviors/ScrollRegion.js +15 -2
- package/behaviors/VisuallyHidden.d.ts +30 -0
- package/behaviors/VisuallyHidden.js +17 -0
- package/behaviors/loading-image.css +30 -0
- package/behaviors/quietFocus.d.ts +4 -0
- package/behaviors/quietFocus.js +14 -0
- package/behaviors/shell.css +9 -11
- package/behaviors/useFocusScope.d.ts +3 -1
- package/behaviors/useFocusScope.js +4 -6
- package/bin/rift-ds.mjs +1 -0
- package/bin/templates/app/components/rift/ColorModeScript.tsx +3 -1
- package/bin/templates/app/components/rift/RiftRoot.tsx +40 -1
- package/bin/templates/blocks/app/dashboard/page.tsx +7 -5
- package/bin/templates/blocks/app/landing/page.tsx +1 -1
- package/bin/templates/blocks/app/pricing/page.module.css +15 -1
- package/bin/templates/blocks/app/pricing/page.tsx +8 -1
- package/bin/templates/blocks/app/sign-in/page.tsx +10 -2
- package/bin/templates/blocks/app/sign-up/page.module.css +83 -0
- package/bin/templates/blocks/app/sign-up/page.tsx +126 -0
- package/bin/templates/blocks/app/starter/page.tsx +1 -1
- package/bin/templates/blocks/components/blocks/AppShell.module.css +0 -10
- package/bin/templates/blocks/components/blocks/AppShell.tsx +41 -116
- package/bin/templates/blocks/components/blocks/DocsShell.tsx +5 -1
- package/bin/templates/blocks/registry.json +44 -6
- package/chat/ChatLauncher.d.ts +2 -2
- package/chat/ChatWidget.css +7 -7
- package/chat/ChatWidget.d.ts +1 -1
- package/components/AgentPlan/AgentPlan.css +1 -1
- package/components/AlertDialog/AlertDialog.css +14 -0
- package/components/AlertDialog/AlertDialog.d.ts +35 -3
- package/components/AlertDialog/AlertDialog.js +16 -5
- package/components/AppLayout/AppLayout.css +1 -1
- package/components/AppLayout/AppLayout.d.ts +2 -2
- package/components/AppSidebar/AppSidebar.css +25 -17
- package/components/AppSidebar/AppSidebar.d.ts +4 -4
- package/components/AppSidebar/AppSidebar.js +14 -5
- package/components/Attachment/AttachmentGroup.js +2 -1
- package/components/Attachment/AttachmentTile.js +2 -1
- package/components/Avatar/Avatar.css +18 -5
- package/components/Avatar/Avatar.d.ts +2 -0
- package/components/Avatar/Avatar.js +2 -1
- package/components/AvatarGroup/AvatarGroup.css +8 -1
- package/components/AvatarGroup/AvatarGroup.d.ts +6 -0
- package/components/AvatarGroup/AvatarGroup.js +2 -2
- package/components/Badge/Badge.css +6 -0
- package/components/Breadcrumb/Breadcrumb.css +4 -1
- package/components/Button/Button.css +20 -1
- package/components/Button/Button.js +6 -1
- package/components/Card/Card.css +11 -0
- package/components/Card/Card.d.ts +9 -3
- package/components/Card/Card.js +21 -2
- package/components/Chart/AreaChart.d.ts +7 -0
- package/components/Chart/AreaChart.js +51 -45
- package/components/Chart/BarChart.d.ts +7 -0
- package/components/Chart/BarChart.js +52 -46
- package/components/Chart/Chart.css +122 -1
- package/components/Chart/ChartSkeleton.d.ts +32 -0
- package/components/Chart/ChartSkeleton.js +149 -0
- package/components/Chart/ComboChart.d.ts +7 -0
- package/components/Chart/ComboChart.js +80 -74
- package/components/Chart/LineChart.d.ts +17 -3
- package/components/Chart/LineChart.js +61 -39
- package/components/Chart/PieChart.d.ts +7 -0
- package/components/Chart/PieChart.js +41 -34
- package/components/Chart/RadarChart.d.ts +7 -0
- package/components/Chart/RadarChart.js +38 -32
- package/components/Chart/RadialChart.d.ts +7 -0
- package/components/Chart/RadialChart.js +5 -1
- package/components/Chart/ScatterChart.d.ts +7 -0
- package/components/Chart/ScatterChart.js +46 -40
- package/components/Chart/StackedBarChart.d.ts +10 -1
- package/components/Chart/StackedBarChart.js +51 -43
- package/components/Chart/Treemap.d.ts +7 -0
- package/components/Chart/Treemap.js +17 -11
- package/components/Checkbox/Checkbox.css +25 -1
- package/components/Checkbox/Checkbox.d.ts +8 -4
- package/components/Checkbox/Checkbox.js +17 -8
- package/components/Chip/Chip.css +5 -3
- package/components/ContactCard/ContactCard.css +4 -3
- package/components/ContributionGraph/ContributionGraph.css +20 -0
- package/components/ContributionGraph/ContributionGraph.d.ts +4 -0
- package/components/ContributionGraph/ContributionGraph.js +11 -6
- package/components/DataTable/DataTable.css +91 -4
- package/components/DataTable/DataTable.d.ts +42 -4
- package/components/DataTable/DataTable.js +121 -90
- package/components/DateInput/DateInput.css +3 -1
- package/components/DatePicker/DatePicker.css +16 -0
- package/components/DatePicker/DatePicker.d.ts +13 -0
- package/components/DatePicker/DatePicker.js +21 -27
- package/components/DatePicker/MonthGrid.d.ts +2 -2
- package/components/DatePicker/MonthGrid.js +1 -1
- package/components/DatePicker/today.d.ts +15 -0
- package/components/DatePicker/today.js +17 -0
- package/components/DateRangePicker/DateRangePicker.d.ts +14 -1
- package/components/DateRangePicker/DateRangePicker.js +18 -7
- package/components/DescriptionList/DescriptionList.css +11 -0
- package/components/DescriptionList/DescriptionList.d.ts +5 -1
- package/components/DescriptionList/DescriptionList.js +21 -6
- package/components/Dialog/Dialog.css +9 -0
- package/components/Dialog/Dialog.d.ts +9 -0
- package/components/Dialog/Dialog.js +32 -19
- package/components/DocumentChip/DocumentChip.css +1 -1
- package/components/Drawer/Drawer.d.ts +9 -0
- package/components/Drawer/Drawer.js +8 -0
- package/components/DrillMenu/DrillMenu.d.ts +2 -1
- package/components/DrillMenu/DrillMenu.js +14 -3
- package/components/Dropdown/Dropdown.css +3 -1
- package/components/EmptyState/EmptyState.css +8 -1
- package/components/EntitySwitcher/EntitySwitcher.css +2 -1
- package/components/Field/Field.css +2 -2
- package/components/FileInput/FileInput.css +1 -1
- package/components/FilterBar/FilterBar.d.ts +6 -1
- package/components/FunnelChart/FunnelChart.d.ts +7 -0
- package/components/FunnelChart/FunnelChart.js +44 -30
- package/components/GanttChart/GanttChart.css +10 -0
- package/components/GanttChart/GanttChart.d.ts +4 -0
- package/components/GanttChart/GanttChart.js +66 -33
- package/components/Gauge/Gauge.css +23 -0
- package/components/Gauge/Gauge.d.ts +4 -0
- package/components/Gauge/Gauge.js +14 -8
- package/components/Icon/Icon.css +6 -1
- package/components/Icon/Icon.d.ts +3 -1
- package/components/Icon/Icon.js +2 -0
- package/components/ImageCompare/ImageCompare.js +2 -1
- package/components/Input/Input.css +3 -1
- package/components/List/List.css +1 -1
- package/components/NotificationCenter/NotificationCenter.css +16 -0
- package/components/NotificationCenter/NotificationCenter.d.ts +4 -0
- package/components/NotificationCenter/NotificationCenter.js +23 -1
- package/components/NumberInput/NumberInput.css +2 -0
- package/components/PageHeader/PageHeader.css +12 -4
- package/components/Panel/Panel.d.ts +1 -1
- package/components/PixelAvatar/PixelAvatar.css +7 -1
- package/components/PixelAvatar/PixelAvatar.d.ts +2 -0
- package/components/PixelAvatar/PixelAvatar.js +2 -1
- package/components/Prose/Prose.css +1 -1
- package/components/RadioButton/RadioButton.css +1 -1
- package/components/RadioButton/RadioButton.d.ts +4 -2
- package/components/RadioButton/RadioButton.js +5 -2
- package/components/ResourceTimeline/ResourceTimeline.css +12 -0
- package/components/ResourceTimeline/ResourceTimeline.d.ts +5 -1
- package/components/ResourceTimeline/ResourceTimeline.js +94 -52
- package/components/RichDropdown/RichDropdown.css +3 -1
- package/components/SelectionCard/SelectionCard.css +29 -0
- package/components/SelectionCard/SelectionCard.d.ts +7 -0
- package/components/SelectionCard/SelectionCard.js +25 -2
- package/components/ShaderField/useShaderField.js +2 -2
- package/components/ShaderScene/ShaderScene.js +2 -2
- package/components/SiteHeader/SiteHeader.css +0 -9
- package/components/SourceChip/SourceChip.css +2 -1
- package/components/Sparkline/Sparkline.css +20 -0
- package/components/Sparkline/Sparkline.d.ts +4 -0
- package/components/Sparkline/Sparkline.js +14 -8
- package/components/Stat/Stat.css +31 -0
- package/components/Stat/Stat.d.ts +23 -2
- package/components/Stat/Stat.js +21 -6
- package/components/SubNavPanel/SubNavPanel.css +10 -9
- package/components/Table/Table.css +409 -14
- package/components/Table/Table.d.ts +32 -2
- package/components/Table/Table.js +66 -34
- package/components/Textarea/Textarea.css +4 -2
- package/components/ThemeToggle/colorMode.d.ts +10 -2
- package/components/ThemeToggle/colorMode.js +4 -2
- package/components/ThreadHistory/ThreadHistory.css +11 -0
- package/components/ThreadHistory/ThreadHistory.d.ts +5 -1
- package/components/ThreadHistory/ThreadHistory.js +6 -1
- package/components/ThreadPanel/ThreadPanel.d.ts +4 -0
- package/components/ThreadPanel/ThreadPanel.js +5 -1
- package/components/TimePicker/TimePicker.css +3 -1
- package/components/TimePicker/TimePicker.d.ts +4 -2
- package/components/TimePicker/TimePicker.js +11 -3
- package/components/Timeline/Timeline.css +15 -0
- package/components/Timeline/Timeline.d.ts +8 -0
- package/components/Timeline/Timeline.js +21 -0
- package/components/Toast/Toast.css +16 -0
- package/components/Toast/Toast.d.ts +7 -2
- package/components/ToggleGroup/ToggleGroup.css +28 -2
- package/components/ToggleSwitch/ToggleSwitch.css +1 -1
- package/components/Tooltip/Tooltip.d.ts +9 -0
- package/components/Tooltip/Tooltip.js +34 -8
- package/components/TreeView/TreeView.css +12 -0
- package/components/TreeView/TreeView.d.ts +4 -0
- package/components/TreeView/TreeView.js +20 -0
- package/components/UsageCard/UsageCard.css +11 -0
- package/components/UsageCard/UsageCard.d.ts +4 -0
- package/components/UsageCard/UsageCard.js +25 -16
- package/components/Widget/Widget.css +7 -0
- package/components/Widget/Widget.d.ts +4 -0
- package/components/Widget/Widget.js +14 -2
- package/components/registry.json +5 -2
- package/components/registry.json.d.ts +5 -2
- package/components/registry.json.js +1 -1
- package/package.json +9 -3
- package/tokens/motion.d.ts +2 -0
- package/tokens/motion.js +2 -0
- package/tokens/presets/contrast.css +36 -3
- package/tokens/presets/coral.css +39 -3
- package/tokens/presets/forest.css +55 -3
- package/tokens/presets/gold.css +39 -4
- package/tokens/presets/marquee.css +42 -4
- package/tokens/presets/mono.css +107 -29
- package/tokens/presets/pink.css +41 -3
- package/tokens/presets/plum.css +41 -1
- package/tokens/presets/terminal.css +40 -4
- package/tokens/presets/violet.css +42 -3
- package/tokens/presets/warm.css +49 -5
- package/tokens/presets/zest.css +47 -3
- package/tokens/registry.json +2 -0
- package/tokens/registry.json.d.ts +2 -0
- package/tokens/registry.json.js +1 -1
- package/tokens/tokens-dark.css +5 -0
- package/tokens/tokens-light.css +9 -0
- package/tokens/values.d.ts +14 -1
- package/tokens/values.js +14 -1
- package/tokens/values.json.js +1 -1
|
@@ -9,6 +9,17 @@
|
|
|
9
9
|
|
|
10
10
|
@layer rift.tokens, rift.preset, rift.components;
|
|
11
11
|
|
|
12
|
+
/* A pinned cell paints its row tint through this property, inside a
|
|
13
|
+
gradient over its opaque body. Registered as a colour so it can fade:
|
|
14
|
+
unregistered, it switched at once while the rest of the row faded its
|
|
15
|
+
background, so the pinned cell lit up a beat before the row caught up.
|
|
16
|
+
Browsers without @property switch it at once, as before. */
|
|
17
|
+
@property --ds-dt-tint {
|
|
18
|
+
syntax: '<color>';
|
|
19
|
+
initial-value: transparent;
|
|
20
|
+
inherits: false;
|
|
21
|
+
}
|
|
22
|
+
|
|
12
23
|
@layer rift.components {
|
|
13
24
|
|
|
14
25
|
.ds-data-table {
|
|
@@ -18,6 +29,13 @@
|
|
|
18
29
|
width: 100%;
|
|
19
30
|
}
|
|
20
31
|
|
|
32
|
+
/* Round marks: the shared mark hook at a true circle, so every Avatar,
|
|
33
|
+
Icon tile, PixelAvatar tile and logo in the table draws round whatever
|
|
34
|
+
the theme's radius. */
|
|
35
|
+
.ds-data-table--round-marks {
|
|
36
|
+
--ds-mark-radius: 50%;
|
|
37
|
+
}
|
|
38
|
+
|
|
21
39
|
/* ============================================
|
|
22
40
|
TOOLBAR
|
|
23
41
|
============================================ */
|
|
@@ -152,7 +170,7 @@
|
|
|
152
170
|
columns; the panel clips its own body instead. */
|
|
153
171
|
.ds-data-table__grid--fixed
|
|
154
172
|
.ds-table__body
|
|
155
|
-
.ds-table__cell:not(.ds-data-table__cell--pinned-edge, .ds-data-table__detail-cell),
|
|
173
|
+
.ds-table__cell:not(.ds-data-table__cell--pinned-edge, .ds-data-table__detail-cell, .ds-data-table__group-cell),
|
|
156
174
|
.ds-data-table__grid--fixed .ds-data-table__cell--pinned-edge > .ds-table__cell-content {
|
|
157
175
|
overflow: hidden;
|
|
158
176
|
}
|
|
@@ -180,6 +198,9 @@
|
|
|
180
198
|
z-index: 1;
|
|
181
199
|
background-color: var(--color-table-body-bg);
|
|
182
200
|
background-image: linear-gradient(var(--ds-dt-tint), var(--ds-dt-tint));
|
|
201
|
+
/* The row's own fade (.ds-table__row in Table.css), so the pinned
|
|
202
|
+
cells and the rest of the row change together. */
|
|
203
|
+
transition: --ds-dt-tint var(--motion-duration-base) var(--motion-ease-standard);
|
|
183
204
|
}
|
|
184
205
|
|
|
185
206
|
/* Body rows only: the header row is a row too, and never takes a hover tint. */
|
|
@@ -187,7 +208,7 @@
|
|
|
187
208
|
--ds-dt-tint: var(--color-table-row-hover-bg);
|
|
188
209
|
}
|
|
189
210
|
|
|
190
|
-
.ds-table--striped .ds-table__body .ds-table__row:nth-child(even) > .ds-data-table__cell--pinned {
|
|
211
|
+
.ds-table--striped .ds-table__body .ds-table__row:nth-child(even of :where(:not([data-group-row]))) > .ds-data-table__cell--pinned {
|
|
191
212
|
--ds-dt-tint: var(--color-table-row-stripe-bg);
|
|
192
213
|
}
|
|
193
214
|
|
|
@@ -1026,12 +1047,25 @@
|
|
|
1026
1047
|
}
|
|
1027
1048
|
|
|
1028
1049
|
/* The group's label runs past its first column over the empty cells beside
|
|
1029
|
-
it, so a long value is never clipped to one column's width
|
|
1050
|
+
it, so a long value is never clipped to one column's width: the cell is
|
|
1051
|
+
left out of the fixed grid's clip above, and while the cell beside it is
|
|
1052
|
+
empty the label keeps its full width rather than shrinking to an
|
|
1053
|
+
ellipsis. A pinned group cell still clips (nothing may spill out from
|
|
1054
|
+
under a pinned edge), and beside a group total the value gives way. */
|
|
1030
1055
|
.ds-data-table__group-cell,
|
|
1031
1056
|
.ds-data-table__group-cell > .ds-table__cell-content {
|
|
1032
1057
|
overflow: visible;
|
|
1033
1058
|
}
|
|
1034
1059
|
|
|
1060
|
+
.ds-data-table__grid--fixed .ds-data-table__group-cell.ds-data-table__cell--pinned:not(.ds-data-table__cell--pinned-edge) {
|
|
1061
|
+
overflow: hidden;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
.ds-data-table__group-cell:not(.ds-data-table__cell--pinned):has(+ .ds-table__cell:empty) .ds-data-table__group-value {
|
|
1065
|
+
flex-shrink: 0;
|
|
1066
|
+
overflow: visible;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1035
1069
|
.ds-data-table__group-label {
|
|
1036
1070
|
display: flex;
|
|
1037
1071
|
align-items: center;
|
|
@@ -1363,7 +1397,60 @@
|
|
|
1363
1397
|
.ds-data-table__banner {
|
|
1364
1398
|
margin-block-end: var(--gap-300);
|
|
1365
1399
|
/* Banner is a page-wide strip; over a table it takes the frame's corner. */
|
|
1366
|
-
border-radius: var(--radius-
|
|
1400
|
+
border-radius: var(--radius-600);
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
/* ============================================
|
|
1404
|
+
FRAMELESS (`frameless`, `outerControl`)
|
|
1405
|
+
Table.css draws the frameless table and its outer control on the
|
|
1406
|
+
classes this table shares; this only fits DataTable's own frame and its
|
|
1407
|
+
sticky cells to it. The frame drops its outline and surface and reaches
|
|
1408
|
+
past its column by the tile's bleed, or by the outer control's 40px on
|
|
1409
|
+
the start side. A sticky cell (a pinned column, a sticky header) keeps
|
|
1410
|
+
an opaque base, the surface the table sits on rather than the bordered
|
|
1411
|
+
table's body (an app shell's surface inside one, else the page), and paints the frameless line and tile over it instead of
|
|
1412
|
+
its own tint.
|
|
1413
|
+
============================================ */
|
|
1414
|
+
|
|
1415
|
+
/* A side with a pinned column takes no scroll cue: the fade would wash
|
|
1416
|
+
the column that is holding still, and its scrolling-edge shadow already
|
|
1417
|
+
says something is under it. */
|
|
1418
|
+
.ds-table__wrapper:has(> .ds-table > .ds-table__head .ds-data-table__cell--pinned-start) {
|
|
1419
|
+
--ds-table-cue-start: 0px;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
.ds-table__wrapper:has(> .ds-table > .ds-table__head .ds-data-table__cell--pinned-end) {
|
|
1423
|
+
--ds-table-cue-end: 0px;
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
.ds-table__wrapper.ds-data-table__frame--frameless {
|
|
1427
|
+
margin-inline: calc(-1 * var(--padding-400));
|
|
1428
|
+
border: 0;
|
|
1429
|
+
border-radius: 0;
|
|
1430
|
+
background: transparent;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
.ds-table__wrapper.ds-data-table__frame--outer-control {
|
|
1434
|
+
margin-inline-start: -40px; /* ds-allow(spacing): the outer control column, UTILITY_COLUMN_WIDTH */
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
.ds-table.ds-table--frameless .ds-data-table__cell--pinned,
|
|
1438
|
+
.ds-table.ds-table--frameless.ds-data-table__grid--sticky .ds-table__head .ds-table__header-cell {
|
|
1439
|
+
--ds-table-base: var(--ds-table-surface, var(--ds-shell-surface, var(--color-bg-page-primary)));
|
|
1440
|
+
|
|
1441
|
+
background-color: var(--ds-table-base);
|
|
1442
|
+
background-image:
|
|
1443
|
+
linear-gradient(var(--ds-table-line), var(--ds-table-line)),
|
|
1444
|
+
linear-gradient(var(--ds-table-fill), var(--ds-table-fill));
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
/* The first row's tile draws its top edge on the header's line, one pixel
|
|
1448
|
+
above the row, where an opaque pinned header cell stacks over it. So
|
|
1449
|
+
while that row is lifted, a pinned header cell at either end runs its
|
|
1450
|
+
own line on to where the tile's corner starts, and the edge reads
|
|
1451
|
+
unbroken across the pinned column. */
|
|
1452
|
+
.ds-table.ds-table--frameless:has(.ds-table__body .ds-table__row:first-child:is(:hover, :has(:focus-visible))) .ds-table__head .ds-table__row > :is(:first-child, :last-child).ds-data-table__cell--pinned {
|
|
1453
|
+
--ds-table-line-size: calc(100% - var(--ds-table-radius));
|
|
1367
1454
|
}
|
|
1368
1455
|
|
|
1369
1456
|
} /* @layer rift.components */
|
|
@@ -14,7 +14,14 @@ export interface DataTableColumn<R extends DataTableRow = DataTableRow> {
|
|
|
14
14
|
header: React.ReactNode;
|
|
15
15
|
/** Whether clicking this header sorts by the column. */
|
|
16
16
|
sortable?: boolean;
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* The column's width, as any CSS width: `'200px'`, `'12rem'`, `'30%'`,
|
|
19
|
+
* `'auto'`. A table with a resizable or pinned column works in pixels: a
|
|
20
|
+
* pixel or rem width is taken as written, and any other value is laid out
|
|
21
|
+
* by the browser once and measured, so a percentage holds the share it had
|
|
22
|
+
* on that first layout. Either way the column is never narrower than its
|
|
23
|
+
* header's controls need (`minWidth` sets that floor yourself).
|
|
24
|
+
*/
|
|
18
25
|
width?: string;
|
|
19
26
|
/** Text alignment for cells in this column. `start` and `end` follow the reading direction (a typed column defaults to its type's: `end` for numbers, money and progress, `start` for text); `left` and `right` are screen sides. */
|
|
20
27
|
align?: 'start' | 'center' | 'end' | 'left' | 'right';
|
|
@@ -457,7 +464,14 @@ type DataTableOwnProps<R extends DataTableRow = DataTableRow> = {
|
|
|
457
464
|
searchable?: boolean;
|
|
458
465
|
/** Placeholder for the search field. */
|
|
459
466
|
searchPlaceholder?: string;
|
|
460
|
-
/**
|
|
467
|
+
/**
|
|
468
|
+
* The table's own control bar, drawn in the frame's head beside the
|
|
469
|
+
* search field. Pass `<TableToolbar />` for the standard one (search,
|
|
470
|
+
* filters as chips, the Columns panel, the density switch and the result
|
|
471
|
+
* count, reading and setting this table's state with no props), so the
|
|
472
|
+
* controls sit in the table rather than in a row above it; any other node
|
|
473
|
+
* is a slot for controls of your own.
|
|
474
|
+
*/
|
|
461
475
|
toolbar?: React.ReactNode;
|
|
462
476
|
/**
|
|
463
477
|
* The table's density, and the controls' with it: `default` rows with the
|
|
@@ -566,8 +580,32 @@ type DataTableOwnProps<R extends DataTableRow = DataTableRow> = {
|
|
|
566
580
|
onRowOrderChange?: (order: string[]) => void;
|
|
567
581
|
/** The column and row controls' words, merged over their English defaults. */
|
|
568
582
|
columnLabels?: Partial<DataTableColumnLabels>;
|
|
569
|
-
/** Draws a vertical line between columns, as well as the lines between rows. */
|
|
583
|
+
/** Draws a vertical line between columns, as well as the lines between rows. A frameless table draws none. */
|
|
570
584
|
columnDividers?: boolean;
|
|
585
|
+
/**
|
|
586
|
+
* Draws the table with no frame, as Table's `frameless` does: no outline,
|
|
587
|
+
* no header band and no column dividers, the first and last columns'
|
|
588
|
+
* content flush with the page, and a hovered row lifted into a raised
|
|
589
|
+
* tile that reaches past the columns. The page needs room for that reach
|
|
590
|
+
* on both sides (`--padding-400`). Narrower than a phone (the table's own
|
|
591
|
+
* width, under `BREAKPOINT_PHONE_PX`) it keeps its usual look.
|
|
592
|
+
*/
|
|
593
|
+
frameless?: boolean;
|
|
594
|
+
/**
|
|
595
|
+
* Draws every mark in the table (an Avatar, an AvatarGroup, an Icon tile,
|
|
596
|
+
* a PixelAvatar tile, a logo) as a true circle whatever the theme's radius,
|
|
597
|
+
* through the shared mark hook, `--ds-mark-radius`, as Table's `roundMarks`
|
|
598
|
+
* does. A wide picture is not a mark and keeps its corners.
|
|
599
|
+
*/
|
|
600
|
+
roundMarks?: boolean;
|
|
601
|
+
/**
|
|
602
|
+
* With `frameless`, hangs the first utility column (the row grip of
|
|
603
|
+
* `reorderableRows`, else the checkbox of `selectable`) as the row's outer
|
|
604
|
+
* control: inside the tile's start, showing on hover, on keyboard focus,
|
|
605
|
+
* when checked, or while any row is selected. The page needs 40px of room
|
|
606
|
+
* on the table's start side for it.
|
|
607
|
+
*/
|
|
608
|
+
outerControl?: boolean;
|
|
571
609
|
/** How every cell's text fits unless its column says otherwise: `wrap` (the default), `nowrap`, `truncate` or `lines-2`. */
|
|
572
610
|
cellText?: DataTableCellText;
|
|
573
611
|
/** The actions a row offers, in an actions column that sticks to the end edge: inline ones as icon buttons, the rest in a More menu. */
|
|
@@ -618,7 +656,7 @@ type DataTableOwnProps<R extends DataTableRow = DataTableRow> = {
|
|
|
618
656
|
};
|
|
619
657
|
export interface DataTableProps<R extends DataTableRow = DataTableRow> extends DataTableOwnProps<R>, Omit<React.ComponentPropsWithRef<'div'>, keyof DataTableOwnProps<R>> {
|
|
620
658
|
}
|
|
621
|
-
export declare function DataTable<R extends DataTableRow = DataTableRow>({ columns: columnsProp, rows: rowsProp, pageSize: pageSizeProp, defaultPageSize, onPageSizeChange, pageSizeOptions, page: pageProp, defaultPage, onPageChange, pageSizeLabel, phoneLayout, selectable, selectedIds, defaultSelectedIds, onSelectionChange, sort, defaultSort, onSortChange, sorts: sortsProp, defaultSorts, onSortsChange, multiSort, onViewChange, view: viewProp, defaultView, virtualize, onLoadMore, hasMore, renderDetail, expandedIds: expandedProp, defaultExpandedIds, onExpandedIdsChange, expandMode, grouping: groupingProp, defaultGrouping, onGroupingChange, totalsRow, totals: totalsProp, defaultTotals, onTotalsChange, linkComponent, rowHref, onRowClick, searchable, searchPlaceholder, toolbar, size: sizeProp, defaultSize, onSizeChange, filters: filtersProp, defaultFilters, onFiltersChange, search: searchProp, defaultSearch, onSearchChange, filterLabels: filterLabelsProp, striped, caption, emptyState, selectAllLabel, selectRowLabel, sortLabel, sortRankLabel, sortAnnouncement, pageAnnouncement, resultsLabel, selectedLabel, paginationLabels, emptyStateLabels, resizableColumns, reorderableColumns, columnMenu, reorderableRows, stickyHeader, maxHeight, navigation, columnWidths, defaultColumnWidths, onColumnWidthsChange, columnOrder, defaultColumnOrder, onColumnOrderChange, columnPinning, defaultColumnPinning, onColumnPinningChange, hiddenColumns, defaultHiddenColumns, onHiddenColumnsChange, rowOrder, defaultRowOrder, onRowOrderChange, columnLabels, columnDividers, cellText, rowActions, rowActionsVisibility, editMode, onCellEdit, onRowEdit, manual, rowCount: rowCountProp, loading, error, onRetry, loadLabels, locale: localeProp, className, ref, ...rest }: DataTableProps<R>): React.JSX.Element;
|
|
659
|
+
export declare function DataTable<R extends DataTableRow = DataTableRow>({ columns: columnsProp, rows: rowsProp, pageSize: pageSizeProp, defaultPageSize, onPageSizeChange, pageSizeOptions, page: pageProp, defaultPage, onPageChange, pageSizeLabel, phoneLayout, selectable, selectedIds, defaultSelectedIds, onSelectionChange, sort, defaultSort, onSortChange, sorts: sortsProp, defaultSorts, onSortsChange, multiSort, onViewChange, view: viewProp, defaultView, virtualize, onLoadMore, hasMore, renderDetail, expandedIds: expandedProp, defaultExpandedIds, onExpandedIdsChange, expandMode, grouping: groupingProp, defaultGrouping, onGroupingChange, totalsRow, totals: totalsProp, defaultTotals, onTotalsChange, linkComponent, rowHref, onRowClick, searchable, searchPlaceholder, toolbar, size: sizeProp, defaultSize, onSizeChange, filters: filtersProp, defaultFilters, onFiltersChange, search: searchProp, defaultSearch, onSearchChange, filterLabels: filterLabelsProp, striped, caption, emptyState, selectAllLabel, selectRowLabel, sortLabel, sortRankLabel, sortAnnouncement, pageAnnouncement, resultsLabel, selectedLabel, paginationLabels, emptyStateLabels, resizableColumns, reorderableColumns, columnMenu, reorderableRows, stickyHeader, maxHeight, navigation, columnWidths, defaultColumnWidths, onColumnWidthsChange, columnOrder, defaultColumnOrder, onColumnOrderChange, columnPinning, defaultColumnPinning, onColumnPinningChange, hiddenColumns, defaultHiddenColumns, onHiddenColumnsChange, rowOrder, defaultRowOrder, onRowOrderChange, columnLabels, columnDividers, frameless: framelessProp, roundMarks, outerControl, cellText, rowActions, rowActionsVisibility, editMode, onCellEdit, onRowEdit, manual, rowCount: rowCountProp, loading, error, onRetry, loadLabels, locale: localeProp, className, ref, ...rest }: DataTableProps<R>): React.JSX.Element;
|
|
622
660
|
/**
|
|
623
661
|
* A stored view made safe for a table's columns as they are now: columns
|
|
624
662
|
* that no longer exist drop out of every part of it, a filter whose
|
|
@@ -266,6 +266,9 @@ function DataTable({
|
|
|
266
266
|
onRowOrderChange,
|
|
267
267
|
columnLabels,
|
|
268
268
|
columnDividers = false,
|
|
269
|
+
frameless: framelessProp = false,
|
|
270
|
+
roundMarks = false,
|
|
271
|
+
outerControl = false,
|
|
269
272
|
cellText = "wrap",
|
|
270
273
|
rowActions,
|
|
271
274
|
rowActionsVisibility = "hover",
|
|
@@ -712,6 +715,11 @@ function DataTable({
|
|
|
712
715
|
tableEl.querySelectorAll("thead th[data-col]").forEach((th) => {
|
|
713
716
|
const key = th.dataset.col;
|
|
714
717
|
if (next[key] !== void 0 || declaredPixels(byKey.get(key)?.width) !== void 0) return;
|
|
718
|
+
const rems = byKey.get(key)?.width?.trim().match(/^(\d+(?:\.\d+)?)rem$/);
|
|
719
|
+
if (rems) {
|
|
720
|
+
next[key] = Math.round(Number(rems[1]) * parseFloat(getComputedStyle(document.documentElement).fontSize));
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
715
723
|
const natural = Math.round(th.getBoundingClientRect().width);
|
|
716
724
|
const truncates = (byKey.get(key)?.cellText ?? cellText) === "truncate";
|
|
717
725
|
next[key] = truncates ? Math.min(natural, TRUNCATE_START_WIDTH) : natural;
|
|
@@ -719,6 +727,9 @@ function DataTable({
|
|
|
719
727
|
setMeasured(next);
|
|
720
728
|
}, [needsMeasure, measured, tableEl, byKey, cellText]);
|
|
721
729
|
const layoutReady = fixedLayout && !needsMeasure;
|
|
730
|
+
const frameless = framelessProp && !narrow;
|
|
731
|
+
const outer = frameless && outerControl && utilityKeys.length > 0;
|
|
732
|
+
const withFiller = layoutReady || outer;
|
|
722
733
|
const minWidthOf = (col) => {
|
|
723
734
|
if (col.minWidth !== void 0) return col.minWidth;
|
|
724
735
|
const header2 = 2 * CELL_PADDING[size] + LABEL_MIN_WIDTH + (col.sortable ? SORT_GLYPH_WIDTH + (multiSort ? SORT_RANK_WIDTH : 0) : 0) + (columnMenu ? MENU_BUTTON_WIDTH : 0) + // A filterable column keeps room for its filter mark, so a filter never squeezes the label.
|
|
@@ -1912,7 +1923,7 @@ function DataTable({
|
|
|
1912
1923
|
key
|
|
1913
1924
|
);
|
|
1914
1925
|
}),
|
|
1915
|
-
|
|
1926
|
+
withFiller && /* @__PURE__ */ jsx("td", { className: `ds-table__cell ${baseClass}__filler`, role: "presentation", "aria-hidden": "true" }),
|
|
1916
1927
|
showActions && /* @__PURE__ */ jsx(
|
|
1917
1928
|
"td",
|
|
1918
1929
|
{
|
|
@@ -1969,7 +1980,7 @@ function DataTable({
|
|
|
1969
1980
|
key
|
|
1970
1981
|
);
|
|
1971
1982
|
}),
|
|
1972
|
-
|
|
1983
|
+
withFiller && /* @__PURE__ */ jsx("td", { className: `ds-table__cell ${baseClass}__filler`, role: "presentation", "aria-hidden": "true" }),
|
|
1973
1984
|
showActions && /* @__PURE__ */ jsx(
|
|
1974
1985
|
"td",
|
|
1975
1986
|
{
|
|
@@ -2213,7 +2224,7 @@ function DataTable({
|
|
|
2213
2224
|
key
|
|
2214
2225
|
);
|
|
2215
2226
|
}),
|
|
2216
|
-
|
|
2227
|
+
withFiller && /* @__PURE__ */ jsx("td", { className: `ds-table__cell ${baseClass}__filler`, role: "presentation", "aria-hidden": "true" }),
|
|
2217
2228
|
showActions && /* @__PURE__ */ jsx(
|
|
2218
2229
|
"td",
|
|
2219
2230
|
{
|
|
@@ -2351,17 +2362,23 @@ function DataTable({
|
|
|
2351
2362
|
const skeletonRows = Array.from({ length: pageSize ?? 5 }, (_, index) => /* @__PURE__ */ jsxs("tr", { className: `ds-table__row ${baseClass}__skeleton-row`, "aria-hidden": "true", children: [
|
|
2352
2363
|
utilityKeys.map((key) => /* @__PURE__ */ jsx("td", { className: "ds-table__cell" }, key)),
|
|
2353
2364
|
visibleKeys.map((key) => /* @__PURE__ */ jsx("td", { className: "ds-table__cell", children: /* @__PURE__ */ jsx("div", { className: `${baseClass}__skeleton`, children: /* @__PURE__ */ jsx(Skeleton, { variant: "text" }) }) }, key)),
|
|
2354
|
-
|
|
2365
|
+
withFiller && /* @__PURE__ */ jsx("td", { className: `ds-table__cell ${baseClass}__filler` }),
|
|
2355
2366
|
showActions && /* @__PURE__ */ jsx("td", { className: "ds-table__cell" })
|
|
2356
2367
|
] }, index));
|
|
2357
2368
|
const hasChrome = searchable || Boolean(toolbar);
|
|
2358
|
-
const classes = [
|
|
2369
|
+
const classes = [
|
|
2370
|
+
baseClass,
|
|
2371
|
+
refreshing ? `${baseClass}--refreshing` : "",
|
|
2372
|
+
roundMarks ? `${baseClass}--round-marks` : "",
|
|
2373
|
+
className
|
|
2374
|
+
].filter(Boolean).join(" ");
|
|
2359
2375
|
const tableClasses = [
|
|
2360
2376
|
"ds-table",
|
|
2361
2377
|
`ds-table--${size}`,
|
|
2362
2378
|
striped ? "ds-table--striped" : "",
|
|
2363
|
-
"ds-table--bordered",
|
|
2364
|
-
|
|
2379
|
+
frameless ? "ds-table--frameless" : "ds-table--bordered",
|
|
2380
|
+
outer ? "ds-table--outer-control" : "",
|
|
2381
|
+
columnDividers && !frameless ? "ds-table--column-dividers" : "",
|
|
2365
2382
|
layoutReady ? `${baseClass}__grid--fixed` : "",
|
|
2366
2383
|
stickyHeader || virtual ? `${baseClass}__grid--sticky` : "",
|
|
2367
2384
|
stacked ? `${baseClass}__grid--stacked` : "",
|
|
@@ -2392,95 +2409,109 @@ function DataTable({
|
|
|
2392
2409
|
] }),
|
|
2393
2410
|
error && rows.length > 0 && /* @__PURE__ */ jsx(Banner, { variant: "error", title: loadWords.errorTitle, action: retryButton || void 0, className: `${baseClass}__banner`, children: error }),
|
|
2394
2411
|
firstLoad && /* @__PURE__ */ jsx("span", { className: "ds-visually-hidden", role: "status", children: loadWords.loading }),
|
|
2395
|
-
visibleRows.length > 0 || firstLoad ? /* @__PURE__ */ jsxs(
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
"aria-hidden": "true"
|
|
2422
|
-
}
|
|
2423
|
-
),
|
|
2424
|
-
showActions && /* @__PURE__ */ jsx(
|
|
2425
|
-
"th",
|
|
2426
|
-
{
|
|
2427
|
-
"data-col": "ds-data-table-actions",
|
|
2428
|
-
scope: "col",
|
|
2429
|
-
className: `ds-table__header-cell ${baseClass}__actions ${baseClass}__cell--pinned ${baseClass}__cell--pinned-end${actionsEdge}`,
|
|
2430
|
-
style: { width: actionsWidth, insetInlineEnd: 0 },
|
|
2431
|
-
...tabProps("header", "ds-data-table-actions"),
|
|
2432
|
-
children: /* @__PURE__ */ jsx("span", { className: "ds-visually-hidden", children: labels.actionsColumn })
|
|
2433
|
-
}
|
|
2434
|
-
)
|
|
2435
|
-
] }) }),
|
|
2436
|
-
firstLoad ? /* @__PURE__ */ jsx("tbody", { className: "ds-table__body", children: skeletonRows }) : groups ? groups.map((group) => ({ group, onPage: group.rows.filter((row) => pageRowSet.has(row)) })).filter(({ onPage }) => onPage.length > 0).map(({ group, onPage }) => /* @__PURE__ */ jsxs(
|
|
2437
|
-
"tbody",
|
|
2438
|
-
{
|
|
2439
|
-
className: `ds-table__body ${baseClass}__group`,
|
|
2440
|
-
"data-collapsed": collapsedGroups.includes(group.key) || void 0,
|
|
2441
|
-
children: [
|
|
2442
|
-
groupRow(group),
|
|
2443
|
-
!collapsedGroups.includes(group.key) && onPage.map((row) => bodyRow(row))
|
|
2444
|
-
]
|
|
2412
|
+
visibleRows.length > 0 || firstLoad ? /* @__PURE__ */ jsxs(
|
|
2413
|
+
ScrollRegion,
|
|
2414
|
+
{
|
|
2415
|
+
className: [
|
|
2416
|
+
"ds-table__wrapper",
|
|
2417
|
+
`${baseClass}__frame`,
|
|
2418
|
+
frameless ? `${baseClass}__frame--frameless` : "",
|
|
2419
|
+
outer ? `${baseClass}__frame--outer-control` : ""
|
|
2420
|
+
].filter(Boolean).join(" "),
|
|
2421
|
+
style: frameStyle,
|
|
2422
|
+
onNode: setFrameEl,
|
|
2423
|
+
children: [
|
|
2424
|
+
(refreshing || searching) && /* @__PURE__ */ jsx("div", { className: `${baseClass}__progress`, role: "progressbar", "aria-label": loadWords.loading }),
|
|
2425
|
+
/* @__PURE__ */ jsxs(
|
|
2426
|
+
"table",
|
|
2427
|
+
{
|
|
2428
|
+
ref: setTableEl,
|
|
2429
|
+
"aria-busy": loading || commandLanding || searching || void 0,
|
|
2430
|
+
className: tableClasses,
|
|
2431
|
+
role: gridMode ? "grid" : stacked ? "table" : void 0,
|
|
2432
|
+
"aria-rowcount": virtual ? virtualItems.length + 1 : void 0,
|
|
2433
|
+
"aria-multiselectable": gridMode && selectable ? true : void 0,
|
|
2434
|
+
"data-selecting": selectable && currentSelection.length > 0 ? "" : void 0,
|
|
2435
|
+
style: {
|
|
2436
|
+
...layoutReady ? layoutVars(widthsState) : {},
|
|
2437
|
+
...showActions ? { "--ds-dt-actions": actionsCount } : {}
|
|
2445
2438
|
},
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2439
|
+
onKeyDown: onGridKeyDown,
|
|
2440
|
+
children: [
|
|
2441
|
+
caption && /* @__PURE__ */ jsx("caption", { className: "ds-table__caption ds-visually-hidden", children: caption }),
|
|
2442
|
+
/* @__PURE__ */ jsx("thead", { className: stacked ? "ds-table__head ds-visually-hidden" : "ds-table__head", children: /* @__PURE__ */ jsxs("tr", { className: "ds-table__row ds-table__row--header", children: [
|
|
2443
|
+
utilityKeys.map(utilityHeader),
|
|
2444
|
+
visibleKeys.map(header),
|
|
2445
|
+
withFiller && /* @__PURE__ */ jsx(
|
|
2446
|
+
"th",
|
|
2447
|
+
{
|
|
2448
|
+
className: `ds-table__header-cell ${baseClass}__filler`,
|
|
2449
|
+
role: "presentation",
|
|
2450
|
+
"aria-hidden": "true"
|
|
2451
|
+
}
|
|
2452
|
+
),
|
|
2453
|
+
showActions && /* @__PURE__ */ jsx(
|
|
2454
|
+
"th",
|
|
2455
|
+
{
|
|
2456
|
+
"data-col": "ds-data-table-actions",
|
|
2457
|
+
scope: "col",
|
|
2458
|
+
className: `ds-table__header-cell ${baseClass}__actions ${baseClass}__cell--pinned ${baseClass}__cell--pinned-end${actionsEdge}`,
|
|
2459
|
+
style: { width: actionsWidth, insetInlineEnd: 0 },
|
|
2460
|
+
...tabProps("header", "ds-data-table-actions"),
|
|
2461
|
+
children: /* @__PURE__ */ jsx("span", { className: "ds-visually-hidden", children: labels.actionsColumn })
|
|
2462
|
+
}
|
|
2463
|
+
)
|
|
2464
|
+
] }) }),
|
|
2465
|
+
firstLoad ? /* @__PURE__ */ jsx("tbody", { className: "ds-table__body", children: skeletonRows }) : groups ? groups.map((group) => ({ group, onPage: group.rows.filter((row) => pageRowSet.has(row)) })).filter(({ onPage }) => onPage.length > 0).map(({ group, onPage }) => /* @__PURE__ */ jsxs(
|
|
2466
|
+
"tbody",
|
|
2467
|
+
{
|
|
2468
|
+
className: `ds-table__body ${baseClass}__group`,
|
|
2469
|
+
"data-collapsed": collapsedGroups.includes(group.key) || void 0,
|
|
2470
|
+
children: [
|
|
2471
|
+
groupRow(group),
|
|
2472
|
+
!collapsedGroups.includes(group.key) && onPage.map((row) => bodyRow(row))
|
|
2473
|
+
]
|
|
2474
|
+
},
|
|
2475
|
+
group.key
|
|
2476
|
+
)) : virtual ? /* @__PURE__ */ jsxs("tbody", { className: "ds-table__body", children: [
|
|
2477
|
+
/* @__PURE__ */ jsx(
|
|
2478
|
+
VirtualRows,
|
|
2479
|
+
{
|
|
2480
|
+
count: virtualItems.length,
|
|
2481
|
+
itemKey: (index) => `${virtualItems[index]?.row.id}:${virtualItems[index]?.part}`,
|
|
2482
|
+
estimate: ESTIMATED_ROW_HEIGHT[size],
|
|
2483
|
+
overscan: VIRTUAL_OVERSCAN,
|
|
2484
|
+
frame: frameEl,
|
|
2485
|
+
frameHeight,
|
|
2486
|
+
columnCount,
|
|
2487
|
+
onScroller: setScroller,
|
|
2488
|
+
renderItem: (index, measure) => {
|
|
2489
|
+
const entry = virtualItems[index];
|
|
2490
|
+
return bodyRow(entry.row, { index, measure }, entry.part);
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2493
|
+
),
|
|
2494
|
+
hasMore && loadingRow
|
|
2495
|
+
] }) : /* @__PURE__ */ jsxs("tbody", { className: "ds-table__body", children: [
|
|
2496
|
+
visibleRows.map((row) => bodyRow(row)),
|
|
2497
|
+
hasMore && loadingRow
|
|
2498
|
+
] }),
|
|
2499
|
+
totalsRow && !stacked && totalsFooter()
|
|
2500
|
+
]
|
|
2501
|
+
}
|
|
2502
|
+
),
|
|
2503
|
+
/* @__PURE__ */ jsx("div", { ref: guideRef, className: `${baseClass}__guide`, hidden: true, "aria-hidden": "true" }),
|
|
2504
|
+
/* @__PURE__ */ jsx("div", { ref: dropRef, className: `${baseClass}__drop`, hidden: true, "aria-hidden": "true" })
|
|
2505
|
+
]
|
|
2506
|
+
}
|
|
2507
|
+
) : error ? /* @__PURE__ */ jsx(
|
|
2477
2508
|
EmptyState,
|
|
2478
2509
|
{
|
|
2479
2510
|
icon: "error",
|
|
2480
2511
|
title: loadWords.errorTitle,
|
|
2481
2512
|
description: error,
|
|
2482
2513
|
action: retryButton || void 0,
|
|
2483
|
-
variant: "bordered",
|
|
2514
|
+
variant: frameless ? "plain" : "bordered",
|
|
2484
2515
|
size: "compact",
|
|
2485
2516
|
role: "alert"
|
|
2486
2517
|
}
|
|
@@ -2490,7 +2521,7 @@ function DataTable({
|
|
|
2490
2521
|
icon: "search_off",
|
|
2491
2522
|
title: emptyStateLabels?.title ?? "No matching rows",
|
|
2492
2523
|
description: emptyStateLabels?.description ?? "Adjust the search or filters and try again.",
|
|
2493
|
-
variant: "bordered",
|
|
2524
|
+
variant: frameless ? "plain" : "bordered",
|
|
2494
2525
|
size: "compact"
|
|
2495
2526
|
}
|
|
2496
2527
|
),
|
|
@@ -113,7 +113,9 @@
|
|
|
113
113
|
ERROR STATE
|
|
114
114
|
============================================ */
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
/* The hover rule above is more specific, so the error border names it too. */
|
|
117
|
+
.ds-date-input--error .ds-date-input__field,
|
|
118
|
+
.ds-date-input--error .ds-date-input__field:hover:not(:focus):not(:disabled) {
|
|
117
119
|
border-color: var(--color-status-error-border);
|
|
118
120
|
}
|
|
119
121
|
|
|
@@ -22,6 +22,22 @@
|
|
|
22
22
|
box-sizing: border-box;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
/* Bare: a Popover, Panel or Dialog around it already draws the surface,
|
|
26
|
+
so the picker gives up its own frame and sits flush in theirs. */
|
|
27
|
+
.ds-date-picker--bare {
|
|
28
|
+
padding: 0;
|
|
29
|
+
border: none;
|
|
30
|
+
border-radius: 0;
|
|
31
|
+
background-color: transparent;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Pending: no value, no `today`, and the device's date not yet read. The
|
|
35
|
+
month holds its place unseen for that one paint, so no wrong month shows. */
|
|
36
|
+
.ds-date-picker--pending .ds-date-picker__month-year,
|
|
37
|
+
.ds-date-picker--pending .ds-date-picker__grid {
|
|
38
|
+
visibility: hidden;
|
|
39
|
+
}
|
|
40
|
+
|
|
25
41
|
/* ============================================
|
|
26
42
|
HEADER
|
|
27
43
|
============================================ */
|
|
@@ -57,6 +57,19 @@ type DatePickerOwnProps = {
|
|
|
57
57
|
* `de-DE`.
|
|
58
58
|
*/
|
|
59
59
|
weekStartsOn?: Weekday;
|
|
60
|
+
/**
|
|
61
|
+
* The date the calendar treats as today, as `YYYY-MM-DD`: it carries the today ring and
|
|
62
|
+
* picks the month shown first when no `value` is set. Pass it to pin today
|
|
63
|
+
* for a demo, a test, a time zone the device is not in, or a server render.
|
|
64
|
+
* Unset, today is the device's date, read in the browser only: a server
|
|
65
|
+
* render reads no clock and draws no today ring, and the browser adds it.
|
|
66
|
+
*/
|
|
67
|
+
today?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Drops the picker's own frame (border, fill, radius and padding), for a
|
|
70
|
+
* surface that already draws one: a Popover, a Panel, a Dialog.
|
|
71
|
+
*/
|
|
72
|
+
bare?: boolean;
|
|
60
73
|
/** Additional CSS classes */
|
|
61
74
|
className?: string;
|
|
62
75
|
};
|