@drivenets/design-system 0.9.1 → 0.11.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/CHANGELOG.md +33 -0
- package/dist/index.cjs +1182 -716
- package/dist/index.d.cts +1806 -636
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1809 -639
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1189 -726
- package/dist/index.js.map +1 -1
- package/dist/index.min.css +1 -1
- package/package.json +11 -13
- package/src/components/ds-alert-banner/ds-alert-banner.module.scss +25 -25
- package/src/components/ds-autocomplete/ds-autocomplete.module.scss +29 -29
- package/src/components/ds-avatar/_mixins.scss +7 -7
- package/src/components/ds-avatar/ds-avatar.module.scss +2 -2
- package/src/components/ds-avatar-group/ds-avatar-group.module.scss +6 -6
- package/src/components/ds-breadcrumb/ds-breadcrumb.module.scss +14 -14
- package/src/components/ds-breadcrumb/ds-breadcrumb.types.ts +40 -6
- package/src/components/ds-button/ds-button.types.ts +13 -2
- package/src/components/ds-button/versions/ds-button-legacy/ds-button-legacy.module.scss +17 -17
- package/src/components/ds-button/versions/ds-button-new/ds-button-new.module.scss +135 -135
- package/src/components/ds-button-v3/ds-button-v3.module.scss +113 -114
- package/src/components/ds-button-v3/ds-button-v3.types.ts +7 -0
- package/src/components/ds-card/ds-card.module.scss +12 -12
- package/src/components/ds-card/ds-card.types.ts +3 -1
- package/src/components/ds-checkbox/ds-checkbox.module.scss +106 -123
- package/src/components/ds-checkbox/ds-checkbox.tsx +24 -35
- package/src/components/ds-checkbox/ds-checkbox.types.ts +12 -11
- package/src/components/ds-checkbox-group/ds-checkbox-group.module.scss +13 -0
- package/src/components/ds-checkbox-group/ds-checkbox-group.tsx +20 -0
- package/src/components/ds-checkbox-group/ds-checkbox-group.types.ts +8 -0
- package/src/components/ds-checkbox-group/hooks/index.ts +6 -0
- package/src/components/ds-checkbox-group/hooks/use-checkbox-select-all.ts +65 -0
- package/src/components/ds-checkbox-group/index.ts +3 -0
- package/src/components/ds-chip/ds-chip.module.scss +17 -17
- package/src/components/ds-chip-group/ds-chip-group.module.scss +12 -12
- package/src/components/ds-comment-bubble/components/ds-comment-thread/ds-comment-thread.module.scss +3 -3
- package/src/components/ds-comment-bubble/components/ds-comment-thread/ds-comment-thread.types.ts +26 -0
- package/src/components/ds-comment-bubble/components/ds-thread-item/ds-thread-item.module.scss +18 -18
- package/src/components/ds-comment-bubble/components/ds-thread-item/ds-thread-item.types.ts +38 -0
- package/src/components/ds-comment-bubble/ds-comment-bubble.module.scss +43 -43
- package/src/components/ds-comment-bubble/ds-comment-bubble.types.ts +78 -0
- package/src/components/ds-comment-card/ds-comment-card.module.scss +34 -34
- package/src/components/ds-comment-card/ds-comment-card.types.ts +114 -0
- package/src/components/ds-comment-indicator/ds-comment-indicator.module.scss +9 -9
- package/src/components/ds-comment-indicator/ds-comment-indicator.types.ts +26 -0
- package/src/components/ds-comments-drawer/comments-filters.types.ts +33 -0
- package/src/components/ds-comments-drawer/components/comments-filter-modal/comments-filter-modal.module.scss +10 -10
- package/src/components/ds-comments-drawer/components/comments-filter-modal/comments-filter-modal.types.ts +37 -1
- package/src/components/ds-comments-drawer/ds-comments-drawer.module.scss +11 -11
- package/src/components/ds-comments-drawer/ds-comments-drawer.types.ts +64 -0
- package/src/components/ds-date-input/ds-date-input.module.scss +42 -42
- package/src/components/ds-date-input/ds-date-input.types.ts +23 -0
- package/src/components/ds-date-picker/components/calendar-table.module.scss +17 -17
- package/src/components/ds-date-picker/components/calendar-view-control/calendar-view-control.module.scss +8 -8
- package/src/components/ds-date-picker/components/day-view/day-view.module.scss +1 -1
- package/src/components/ds-date-picker/ds-date-picker.module.scss +1 -1
- package/src/components/ds-date-picker/ds-date-picker.tsx +3 -0
- package/src/components/ds-date-picker/ds-date-picker.types.ts +20 -0
- package/src/components/ds-date-range-picker/ds-date-range-picker.module.scss +1 -1
- package/src/components/ds-date-range-picker/ds-date-range-picker.types.ts +28 -0
- package/src/components/ds-dialog/ds-dialog.module.scss +3 -3
- package/src/components/ds-dialog/ds-dialog.types.ts +10 -1
- package/src/components/ds-divider/ds-divider.module.scss +1 -1
- package/src/components/ds-drawer/ds-drawer.module.scss +12 -12
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.module.scss +22 -14
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.tsx +2 -0
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.types.ts +33 -0
- package/src/components/ds-expandable-text-input/ds-expandable-text-input.module.scss +1 -1
- package/src/components/ds-file-upload/components/file-upload/file-upload.module.scss +22 -22
- package/src/components/ds-file-upload/components/file-upload/file-upload.types.ts +1 -0
- package/src/components/ds-file-upload/components/file-upload-item/file-upload-item.module.scss +23 -23
- package/src/components/ds-file-upload/ds-file-upload-api.types.ts +55 -0
- package/src/components/ds-filter-status-icon/ds-filter-status-icon.module.scss +5 -5
- package/src/components/ds-form-control/ds-form-control.module.scss +13 -13
- package/src/components/ds-form-control/ds-form-control.types.ts +3 -0
- package/src/components/ds-grid/ds-grid.tsx +29 -12
- package/src/components/ds-grid/ds-grid.types.ts +16 -13
- package/src/components/ds-grid/index.ts +10 -2
- package/src/components/ds-icon/custom-icons/index.ts +2 -0
- package/src/components/ds-icon/custom-icons/special-leading-icon.tsx +11 -0
- package/src/components/ds-icon/ds-icon.module.scss +8 -0
- package/src/components/ds-icon/ds-icon.tsx +10 -4
- package/src/components/ds-icon/ds-icon.types.ts +30 -0
- package/src/components/ds-key-value-pair/ds-key-value-pair.module.scss +7 -7
- package/src/components/ds-key-value-pair/ds-key-value-pair.types.ts +12 -2
- package/src/components/ds-modal/ds-modal.module.scss +9 -9
- package/src/components/ds-modal/ds-modal.types.ts +16 -0
- package/src/components/ds-panel/ds-panel.module.scss +16 -16
- package/src/components/ds-panel/ds-panel.types.ts +39 -0
- package/src/components/ds-popover/ds-popover.module.scss +2 -2
- package/src/components/ds-progress-arc/ds-progress-arc.module.scss +7 -7
- package/src/components/ds-progress-donut/ds-progress-donut.module.scss +7 -7
- package/src/components/ds-progress-linear/ds-progress-linear.module.scss +15 -15
- package/src/components/ds-radio-group/ds-radio-group.module.scss +58 -56
- package/src/components/ds-radio-group/ds-radio-group.tsx +35 -28
- package/src/components/ds-radio-group/ds-radio-group.types.ts +38 -7
- package/src/components/ds-segment-group/ds-segment-group.module.scss +18 -18
- package/src/components/ds-segment-group/ds-segment-group.types.ts +17 -0
- package/src/components/ds-select/ds-select.module.scss +8 -8
- package/src/components/ds-select/ds-select.types.ts +32 -0
- package/src/components/ds-skeleton/ds-skeleton.module.scss +1 -1
- package/src/components/ds-smart-tabs/ds-smart-tabs.module.scss +12 -12
- package/src/components/ds-smart-tabs/ds-smart-tabs.tsx +9 -9
- package/src/components/ds-spinner/ds-spinner.module.scss +1 -1
- package/src/components/ds-split-button/ds-split-button.module.scss +7 -7
- package/src/components/ds-split-button/ds-split-button.types.ts +28 -0
- package/src/components/ds-stack/ds-stack.types.ts +23 -0
- package/src/components/ds-status-badge/ds-status-badge.module.scss +21 -25
- package/src/components/ds-stepper/ds-stepper.module.scss +55 -55
- package/src/components/ds-stepper/ds-stepper.types.ts +34 -1
- package/src/components/ds-system-status/ds-system-status.module.scss +22 -22
- package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.types.ts +27 -0
- package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.module.scss +9 -9
- package/src/components/ds-table/components/ds-table-cell/ds-table-cell.module.scss +4 -4
- package/src/components/ds-table/components/ds-table-header/ds-table-header.module.scss +5 -10
- package/src/components/ds-table/components/ds-table-header/ds-table-header.tsx +6 -9
- package/src/components/ds-table/components/ds-table-row/ds-table-row.module.scss +13 -22
- package/src/components/ds-table/components/ds-table-row/ds-table-row.tsx +11 -18
- package/src/components/ds-table/components/ds-table-row-expandable-cell/ds-table-row-expandable-cell.module.scss +0 -7
- package/src/components/ds-table/components/ds-table-row-expandable-cell/ds-table-row-expandable-cell.tsx +19 -28
- package/src/components/ds-table/components/ds-table-row-expandable-cell/ds-table-row-expandable-cell.types.ts +7 -1
- package/src/components/ds-table/components/ds-table-row-selectable-cell/ds-table-row-selectable-cell.tsx +3 -8
- package/src/components/ds-table/components/ds-table-row-selectable-cell/ds-table-row-selectable-cell.types.ts +11 -0
- package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.module.scss +15 -11
- package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.tsx +9 -4
- package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.types.ts +27 -0
- package/src/components/ds-table/ds-table.module.scss +9 -2
- package/src/components/ds-table/ds-table.tsx +26 -4
- package/src/components/ds-table/filters/components/range-filter/range-filter.module.scss +1 -1
- package/src/components/ds-table/filters/types/filter-adapter.types.ts +6 -0
- package/src/components/ds-table/styles/_mixins.scss +1 -1
- package/src/components/ds-table/styles/_variables.scss +5 -6
- package/src/components/ds-table/utils/constants.ts +10 -0
- package/src/components/ds-tabs/components/ds-tabs-content/ds-tabs-content.module.scss +1 -1
- package/src/components/ds-tabs/components/ds-tabs-list/ds-tabs-indicator.module.scss +1 -1
- package/src/components/ds-tabs/components/ds-tabs-list/ds-tabs-list.module.scss +3 -3
- package/src/components/ds-tabs/components/ds-tabs-tab/ds-tabs-tab.module.scss +55 -55
- package/src/components/ds-tabs/ds-tabs.module.scss +1 -1
- package/src/components/ds-tag/ds-tag.module.scss +22 -22
- package/src/components/ds-tag/ds-tag.types.ts +6 -0
- package/src/components/ds-tag-filter/ds-tag-filter.module.scss +10 -10
- package/src/components/ds-tag-filter/ds-tag-filter.types.ts +16 -0
- package/src/components/ds-text-input/ds-text-input.module.scss +1 -1
- package/src/components/ds-text-input/ds-text-input.types.ts +3 -0
- package/src/components/ds-time-picker/components/time-item/time-item.module.scss +8 -8
- package/src/components/ds-time-picker/components/time-item/time-item.types.ts +19 -0
- package/src/components/ds-time-picker/components/time-scroller/time-scroller.module.scss +3 -3
- package/src/components/ds-time-picker/components/time-scroller/time-scroller.types.ts +29 -0
- package/src/components/ds-time-picker/ds-time-picker.module.scss +7 -0
- package/src/components/ds-time-picker/ds-time-picker.tsx +8 -1
- package/src/components/ds-time-picker/ds-time-picker.types.ts +80 -0
- package/src/components/ds-toast/ds-toast.module.scss +11 -11
- package/src/components/ds-toggle/ds-toggle.module.scss +18 -18
- package/src/components/ds-tooltip/ds-tooltip.module.scss +5 -5
- package/src/components/ds-tooltip/ds-tooltip.types.ts +6 -0
- package/src/components/ds-tree/ds-tree.module.scss +27 -27
- package/src/components/ds-tree/ds-tree.types.ts +84 -2
- package/src/components/ds-typography/ds-typography.config.ts +46 -27
- package/src/components/ds-typography/ds-typography.tsx +22 -7
- package/src/components/ds-typography/ds-typography.types.ts +15 -4
- package/src/components/ds-vertical-tabs/ds-vertical-tabs.module.scss +13 -13
- package/src/components/ds-workspace/ds-workspace.module.scss +55 -0
- package/src/components/ds-workspace/ds-workspace.tsx +37 -0
- package/src/components/ds-workspace/ds-workspace.types.ts +17 -0
- package/src/components/ds-workspace/index.ts +8 -0
- package/src/index.ts +2 -0
- package/src/styles/_grid.scss +2 -2
- package/src/styles/_root.scss +0 -18
- package/src/styles/_root_new.scss +449 -0
- package/src/styles/_scrollbars.scss +5 -5
- package/src/styles/_typography.scss +18 -14
- package/src/styles/mixins/_list.scss +8 -8
- package/src/styles/shared/_dropdown.scss +9 -9
- package/src/styles/shared/_input.scss +47 -49
- package/src/styles/styles.scss +1 -0
- package/src/styles/_root_updated.scss +0 -593
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
width: 10px;
|
|
17
17
|
height: 10px;
|
|
18
18
|
border-radius: 50%;
|
|
19
|
-
border: 1px solid var(--
|
|
19
|
+
border: 1px solid var(--color-dap-gray-050);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.label {
|
|
@@ -24,64 +24,64 @@
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.healthy {
|
|
27
|
-
background: var(--
|
|
28
|
-
color: var(--
|
|
27
|
+
background: var(--color-dap-data-light-green);
|
|
28
|
+
color: var(--color-dap-data-green);
|
|
29
29
|
|
|
30
30
|
.dot {
|
|
31
|
-
background: var(--
|
|
31
|
+
background: var(--color-dap-data-green);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.neutral {
|
|
36
|
-
background: var(--
|
|
37
|
-
color: var(--
|
|
36
|
+
background: var(--color-dap-blue-200);
|
|
37
|
+
color: var(--color-dap-blue-600);
|
|
38
38
|
|
|
39
39
|
.dot {
|
|
40
|
-
background: var(--
|
|
40
|
+
background: var(--color-dap-blue-600);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.error {
|
|
45
|
-
background: var(--
|
|
46
|
-
color: var(--
|
|
45
|
+
background: var(--color-dap-red-100);
|
|
46
|
+
color: var(--background-error);
|
|
47
47
|
|
|
48
48
|
.dot {
|
|
49
|
-
background: var(--
|
|
49
|
+
background: var(--background-error);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.in-progress {
|
|
54
|
-
background: var(--
|
|
55
|
-
color: var(--
|
|
54
|
+
background: var(--schema-light-blue);
|
|
55
|
+
color: var(--color-dap-blue-800);
|
|
56
56
|
|
|
57
57
|
.dot {
|
|
58
|
-
background: var(--
|
|
58
|
+
background: var(--color-dap-blue-800);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
.pending {
|
|
63
|
-
background: var(--
|
|
64
|
-
color: var(--
|
|
63
|
+
background: var(--background-pending);
|
|
64
|
+
color: var(--color-dap-data-deep-fuchsia);
|
|
65
65
|
|
|
66
66
|
.dot {
|
|
67
|
-
background: var(--
|
|
67
|
+
background: var(--color-dap-data-deep-fuchsia);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
.alert {
|
|
72
|
-
background: var(--
|
|
73
|
-
color: var(--
|
|
72
|
+
background: var(--schema-light-amber);
|
|
73
|
+
color: var(--color-dap-orange-600);
|
|
74
74
|
|
|
75
75
|
.dot {
|
|
76
|
-
background: var(--
|
|
76
|
+
background: var(--color-dap-orange-600);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
.disabled {
|
|
81
|
-
background: var(--
|
|
82
|
-
color: var(--
|
|
81
|
+
background: var(--color-dap-gray-200);
|
|
82
|
+
color: var(--color-dap-gray-600);
|
|
83
83
|
|
|
84
84
|
.dot {
|
|
85
|
-
background: var(--
|
|
85
|
+
background: var(--color-dap-gray-600);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -2,12 +2,39 @@ import { type RefObject, type ReactNode } from 'react';
|
|
|
2
2
|
import { type RowSelectionState, type Table } from '@tanstack/react-table';
|
|
3
3
|
|
|
4
4
|
export interface DsTableBodyVirtualizedProps<TData> {
|
|
5
|
+
/**
|
|
6
|
+
* TanStack Table instance driving the body. Provides row models, visible rows,
|
|
7
|
+
* and column state.
|
|
8
|
+
*/
|
|
5
9
|
table: Table<TData>;
|
|
10
|
+
/**
|
|
11
|
+
* Ref to the scrollable container that hosts the virtualized rows. Required by
|
|
12
|
+
* the virtualizer to measure viewport size and listen for scroll events.
|
|
13
|
+
*/
|
|
6
14
|
tableContainerRef: RefObject<HTMLDivElement | null>;
|
|
15
|
+
/**
|
|
16
|
+
* Optional content rendered in place of rows when the table has no data.
|
|
17
|
+
*/
|
|
7
18
|
emptyState?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Initial estimated row height in pixels. Used before actual rows are measured
|
|
21
|
+
* to compute the virtual scroll size.
|
|
22
|
+
*/
|
|
8
23
|
estimateSize: number;
|
|
24
|
+
/**
|
|
25
|
+
* Number of rows to render above and below the visible viewport to reduce
|
|
26
|
+
* flicker during fast scrolling.
|
|
27
|
+
* @default 5
|
|
28
|
+
*/
|
|
9
29
|
overscan?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Called on every scroll event with the current scroll metrics. Useful for
|
|
32
|
+
* infinite-scroll hooks and scroll-position indicators.
|
|
33
|
+
*/
|
|
10
34
|
onScroll?: (params: ScrollParams) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Current row selection state from TanStack Table. Used to style selected rows.
|
|
37
|
+
*/
|
|
11
38
|
rowSelection: RowSelectionState;
|
|
12
39
|
}
|
|
13
40
|
|
package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.module.scss
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
bottom: 20px;
|
|
6
6
|
left: 50%;
|
|
7
7
|
transform: translateX(-50%);
|
|
8
|
-
background-color: var(--
|
|
8
|
+
background-color: var(--color-dap-gray-050);
|
|
9
9
|
border-radius: 8px;
|
|
10
10
|
box-shadow: 0 4px 12px #0445cc66;
|
|
11
11
|
z-index: 1000;
|
|
@@ -34,19 +34,19 @@
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.selectedCountContainer {
|
|
37
|
-
background-color: var(--
|
|
37
|
+
background-color: var(--color-dap-blue-600);
|
|
38
38
|
display: flex;
|
|
39
39
|
align-items: center;
|
|
40
40
|
padding: 6px 22px;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.selectedCountBadge {
|
|
44
|
-
color: var(--
|
|
44
|
+
color: var(--color-dap-gray-050);
|
|
45
45
|
margin: 0;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
.bulkActionsInfo {
|
|
49
|
-
color: var(--
|
|
49
|
+
color: var(--color-dap-gray-600);
|
|
50
50
|
text-wrap: nowrap;
|
|
51
51
|
padding-left: 8px;
|
|
52
52
|
padding-right: 56px;
|
|
@@ -62,15 +62,15 @@
|
|
|
62
62
|
flex-direction: column;
|
|
63
63
|
align-items: center;
|
|
64
64
|
justify-content: center;
|
|
65
|
-
gap: var(--
|
|
66
|
-
border-right: 1px solid var(--
|
|
65
|
+
gap: var(--3xs);
|
|
66
|
+
border-right: 1px solid var(--color-dap-gray-400);
|
|
67
67
|
width: 68px;
|
|
68
68
|
height: 48px;
|
|
69
69
|
border-radius: 0;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
> .actionButton:first-child {
|
|
73
|
-
border-left: 1px solid var(--
|
|
73
|
+
border-left: 1px solid var(--color-dap-gray-400);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
@@ -79,13 +79,13 @@
|
|
|
79
79
|
flex-direction: column;
|
|
80
80
|
justify-content: center;
|
|
81
81
|
align-items: center;
|
|
82
|
-
color: var(--
|
|
82
|
+
color: var(--color-dap-gray-600);
|
|
83
83
|
gap: 2px !important;
|
|
84
84
|
width: 36px;
|
|
85
85
|
padding-left: 4px;
|
|
86
86
|
|
|
87
87
|
&:hover {
|
|
88
|
-
color: var(--
|
|
88
|
+
color: var(--color-dap-gray-500);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
cursor: pointer;
|
|
36
36
|
outline: none;
|
|
37
37
|
transition: background 0.15s;
|
|
38
|
-
color: var(--
|
|
38
|
+
color: var(--icon-action-secondary);
|
|
39
39
|
|
|
40
40
|
&.disabled {
|
|
41
41
|
opacity: 0.5;
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
|
|
46
46
|
&:hover,
|
|
47
47
|
&[data-state='open'] {
|
|
48
|
-
background: var(--
|
|
49
|
-
color: var(--
|
|
48
|
+
background: var(--background-action-hover-weak);
|
|
49
|
+
color: var(--font-action);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.secondaryActionsTrigger {
|
|
54
|
-
margin-inline-start: var(--
|
|
54
|
+
margin-inline-start: var(--sm);
|
|
55
55
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
position: sticky;
|
|
6
6
|
top: 0;
|
|
7
7
|
z-index: 10;
|
|
8
|
-
background-color: var(--
|
|
8
|
+
background-color: var(--background);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.virtualizedHeader {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
.headerRow {
|
|
16
16
|
.headerCell {
|
|
17
|
-
border-bottom: 1px solid var(--
|
|
17
|
+
border-bottom: 1px solid var(--color-dap-gray-400);
|
|
18
18
|
|
|
19
19
|
&.selectColumn {
|
|
20
20
|
width: vars.$select-column-width;
|
|
@@ -38,16 +38,11 @@
|
|
|
38
38
|
width: vars.$reorder-column-width;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
.expandColumn {
|
|
42
|
-
width: vars.$expand-column-width;
|
|
43
|
-
padding: 0;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
41
|
.headerCell {
|
|
47
42
|
@include typography.body-sm-md;
|
|
48
|
-
color: var(--
|
|
43
|
+
color: var(--font-main);
|
|
49
44
|
text-align: left;
|
|
50
|
-
padding: 0 var(--
|
|
45
|
+
padding: 0 var(--standard);
|
|
51
46
|
height: var(--ds-table-header-height);
|
|
52
47
|
|
|
53
48
|
&.sortableHeader {
|
|
@@ -63,7 +58,7 @@
|
|
|
63
58
|
height: 24px;
|
|
64
59
|
|
|
65
60
|
&.pageButtonIcon {
|
|
66
|
-
color: var(--
|
|
61
|
+
color: var(--color-dap-gray-500);
|
|
67
62
|
transition: transform 0.2s ease-in-out;
|
|
68
63
|
}
|
|
69
64
|
}
|
|
@@ -10,7 +10,7 @@ import { useDsTableContext } from '../../context/ds-table-context';
|
|
|
10
10
|
import { getColumnSizeStyle } from '../../utils/column-size';
|
|
11
11
|
|
|
12
12
|
const DsTableHeader = <TData,>({ table }: DsTableHeaderProps<TData>) => {
|
|
13
|
-
const { stickyHeader, bordered,
|
|
13
|
+
const { stickyHeader, bordered, selectable, reorderable, showSelectAllCheckbox, virtualized } =
|
|
14
14
|
useDsTableContext<TData, unknown>();
|
|
15
15
|
|
|
16
16
|
return (
|
|
@@ -38,33 +38,30 @@ const DsTableHeader = <TData,>({ table }: DsTableHeaderProps<TData>) => {
|
|
|
38
38
|
? 'indeterminate'
|
|
39
39
|
: false
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const toggleHandler = table.getToggleAllRowsSelectedHandler();
|
|
44
|
-
toggleHandler(e);
|
|
45
|
-
}}
|
|
41
|
+
onCheckedChange={(checked) => table.toggleAllRowsSelected(!!checked)}
|
|
42
|
+
onClick={(e) => e.stopPropagation()}
|
|
46
43
|
/>
|
|
47
44
|
)}
|
|
48
45
|
</TableHead>
|
|
49
46
|
)}
|
|
50
|
-
{expandable && <TableHead className={classnames(styles.headerCell, styles.expandColumn)} />}
|
|
51
47
|
{reorderable && (
|
|
52
48
|
<TableHead className={classnames(styles.headerCell, styles.reorderColumn)}>Order</TableHead>
|
|
53
49
|
)}
|
|
54
50
|
{headerGroup.headers.map((header) => {
|
|
55
51
|
const headerStyle = getColumnSizeStyle(header.column.getSize(), virtualized);
|
|
52
|
+
const canSort = header.column.getCanSort();
|
|
56
53
|
|
|
57
54
|
return (
|
|
58
55
|
<TableHead
|
|
59
56
|
key={header.id}
|
|
60
|
-
className={classnames(styles.headerCell,
|
|
57
|
+
className={classnames(styles.headerCell, canSort && styles.sortableHeader)}
|
|
61
58
|
onClick={header.column.getToggleSortingHandler()}
|
|
62
59
|
style={headerStyle}
|
|
63
60
|
>
|
|
64
61
|
{header.isPlaceholder ? null : (
|
|
65
62
|
<div className={styles.headerSortContainer}>
|
|
66
63
|
<div>{flexRender(header.column.columnDef.header, header.getContext())}</div>
|
|
67
|
-
{
|
|
64
|
+
{canSort && (
|
|
68
65
|
<div className={styles.pageButtonIconContainer}>
|
|
69
66
|
{{
|
|
70
67
|
asc: (
|
|
@@ -7,20 +7,20 @@
|
|
|
7
7
|
.tableCell,
|
|
8
8
|
.selectableCell,
|
|
9
9
|
.expandableCell {
|
|
10
|
-
border-bottom: vars.$border-width solid var(--
|
|
10
|
+
border-bottom: vars.$border-width solid var(--border-secondary);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
&:hover {
|
|
15
|
-
background-color: var(--
|
|
15
|
+
background-color: var(--background-secondary);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
&[data-state='selected'] {
|
|
19
|
-
background-color: var(--
|
|
19
|
+
background-color: var(--background-secondary-hover);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
&[data-state='active'] {
|
|
23
|
-
background-color: var(--
|
|
23
|
+
background-color: var(--background-secondary-hover);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
&.clickableRow {
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.expandedRow {
|
|
52
|
-
background-color: var(--
|
|
52
|
+
background-color: var(--background-secondary);
|
|
53
53
|
|
|
54
54
|
& > td {
|
|
55
|
-
padding: var(--
|
|
55
|
+
padding: var(--standard);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
@include table-mixins.expanded-row-border('bottom');
|
|
@@ -63,35 +63,26 @@
|
|
|
63
63
|
text-align: center;
|
|
64
64
|
|
|
65
65
|
&.isDragging {
|
|
66
|
-
background: var(--
|
|
66
|
+
background: var(--background-action);
|
|
67
67
|
|
|
68
68
|
.rowDragHandle {
|
|
69
|
-
color: var(--
|
|
69
|
+
color: var(--secondary-050);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
.tableCell,
|
|
75
|
-
.selectableCell
|
|
76
|
-
.expandableCell {
|
|
75
|
+
.selectableCell {
|
|
77
76
|
@include typography.body-sm-reg;
|
|
78
77
|
vertical-align: middle;
|
|
79
|
-
color: var(--
|
|
78
|
+
color: var(--font-main);
|
|
80
79
|
}
|
|
81
80
|
|
|
82
81
|
.tableCell {
|
|
83
|
-
padding: 0 var(--
|
|
82
|
+
padding: 0 var(--standard);
|
|
84
83
|
}
|
|
85
84
|
|
|
86
|
-
.
|
|
87
|
-
background: none;
|
|
88
|
-
border: none;
|
|
85
|
+
.expandableCell {
|
|
89
86
|
padding: 0;
|
|
90
|
-
|
|
91
|
-
cursor: pointer;
|
|
92
|
-
display: inline-flex;
|
|
93
|
-
align-items: center;
|
|
94
|
-
justify-content: center;
|
|
95
|
-
opacity: 1;
|
|
96
|
-
transition-property: opacity, background-color;
|
|
87
|
+
text-align: center;
|
|
97
88
|
}
|
|
@@ -6,12 +6,12 @@ import { DsIcon } from '../../../ds-icon';
|
|
|
6
6
|
import { TableCell, TableRow } from '../core-table';
|
|
7
7
|
import { DsTableCell } from '../ds-table-cell';
|
|
8
8
|
import { DsTableRowSelectableCell } from '../ds-table-row-selectable-cell';
|
|
9
|
-
import { DsTableRowExpandableCell } from '../ds-table-row-expandable-cell';
|
|
10
9
|
import type { DsTableRowProps } from './ds-table-row.types';
|
|
11
10
|
import styles from './ds-table-row.module.scss';
|
|
12
11
|
import { useDsTableContext } from '../../context/ds-table-context';
|
|
13
12
|
import { mergeRefs } from '../../../../utils/merge-refs';
|
|
14
13
|
import { getColumnSizeStyle } from '../../utils/column-size';
|
|
14
|
+
import { EXPANDER_COLUMN_ID } from '../../utils/constants';
|
|
15
15
|
|
|
16
16
|
interface DsRowDragHandleProps {
|
|
17
17
|
isDragging: boolean;
|
|
@@ -40,7 +40,6 @@ const DsRowDragHandle = ({ isDragging, attributes, listeners }: DsRowDragHandleP
|
|
|
40
40
|
|
|
41
41
|
const DsTableRow = <TData,>({ ref, row, isSelected }: DsTableRowProps<TData>) => {
|
|
42
42
|
const {
|
|
43
|
-
expandable,
|
|
44
43
|
selectable,
|
|
45
44
|
reorderable,
|
|
46
45
|
onRowClick,
|
|
@@ -53,7 +52,6 @@ const DsTableRow = <TData,>({ ref, row, isSelected }: DsTableRowProps<TData>) =>
|
|
|
53
52
|
activeRowId,
|
|
54
53
|
} = useDsTableContext<TData, unknown>();
|
|
55
54
|
const isExpanded = row.getIsExpanded();
|
|
56
|
-
const isExpandable = typeof expandable === 'function' ? expandable(row.original) : expandable;
|
|
57
55
|
const isActive = activeRowId === row.id;
|
|
58
56
|
|
|
59
57
|
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({
|
|
@@ -67,7 +65,7 @@ const DsTableRow = <TData,>({ ref, row, isSelected }: DsTableRowProps<TData>) =>
|
|
|
67
65
|
transition,
|
|
68
66
|
...(isDragging
|
|
69
67
|
? {
|
|
70
|
-
background: 'var(--
|
|
68
|
+
background: 'var(--color-dap-purple-200)',
|
|
71
69
|
boxShadow: '0 0 12px 0 rgba(0, 102, 250, 0.60)',
|
|
72
70
|
zIndex: 1,
|
|
73
71
|
}
|
|
@@ -99,13 +97,6 @@ const DsTableRow = <TData,>({ ref, row, isSelected }: DsTableRowProps<TData>) =>
|
|
|
99
97
|
{selectable && (
|
|
100
98
|
<DsTableRowSelectableCell row={row} isSelected={isSelected} className={styles.selectableCell} />
|
|
101
99
|
)}
|
|
102
|
-
{expandable && (
|
|
103
|
-
<DsTableRowExpandableCell
|
|
104
|
-
row={row}
|
|
105
|
-
className={styles.expandableCell}
|
|
106
|
-
buttonClassName={styles.expandToggleButton}
|
|
107
|
-
/>
|
|
108
|
-
)}
|
|
109
100
|
{reorderable && (
|
|
110
101
|
<DsRowDragHandle isDragging={isDragging} attributes={attributes} listeners={listeners} />
|
|
111
102
|
)}
|
|
@@ -114,7 +105,14 @@ const DsTableRow = <TData,>({ ref, row, isSelected }: DsTableRowProps<TData>) =>
|
|
|
114
105
|
const cellStyle = getColumnSizeStyle(cell.column.getSize());
|
|
115
106
|
|
|
116
107
|
return (
|
|
117
|
-
<TableCell
|
|
108
|
+
<TableCell
|
|
109
|
+
key={cell.id}
|
|
110
|
+
className={classnames(
|
|
111
|
+
styles.tableCell,
|
|
112
|
+
cell.column.id === EXPANDER_COLUMN_ID && styles.expandableCell,
|
|
113
|
+
)}
|
|
114
|
+
style={cellStyle}
|
|
115
|
+
>
|
|
118
116
|
{isLastColumn ? (
|
|
119
117
|
<DsTableCell
|
|
120
118
|
row={row}
|
|
@@ -133,12 +131,7 @@ const DsTableRow = <TData,>({ ref, row, isSelected }: DsTableRowProps<TData>) =>
|
|
|
133
131
|
{isExpanded && renderExpandedRow && (
|
|
134
132
|
<TableRow className={styles.expandedRow}>
|
|
135
133
|
<TableCell
|
|
136
|
-
colSpan={
|
|
137
|
-
row.getVisibleCells().length +
|
|
138
|
-
(selectable ? 1 : 0) +
|
|
139
|
-
(isExpandable ? 1 : 0) +
|
|
140
|
-
(reorderable ? 1 : 0)
|
|
141
|
-
}
|
|
134
|
+
colSpan={row.getVisibleCells().length + (selectable ? 1 : 0) + (reorderable ? 1 : 0)}
|
|
142
135
|
className={styles.tableCell}
|
|
143
136
|
>
|
|
144
137
|
{renderExpandedRow(row.original)}
|
|
@@ -1,45 +1,36 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
|
-
import { TableCell } from '../core-table';
|
|
4
3
|
import { DsButton } from '../../../ds-button';
|
|
5
4
|
import { DsIcon } from '../../../ds-icon';
|
|
6
5
|
import stylesShared from '../../styles/shared/ds-table-shared.module.scss';
|
|
7
|
-
import { useDsTableContext } from '../../context/ds-table-context';
|
|
8
6
|
import type { DsTableRowExpandableCellProps } from './ds-table-row-expandable-cell.types';
|
|
9
7
|
import styles from './ds-table-row-expandable-cell.module.scss';
|
|
10
8
|
|
|
11
9
|
export const DsTableRowExpandableCell = <TData,>({
|
|
12
10
|
row,
|
|
13
|
-
className,
|
|
14
11
|
buttonClassName,
|
|
15
12
|
}: DsTableRowExpandableCellProps<TData>) => {
|
|
16
|
-
const { expandable } = useDsTableContext<TData, unknown>();
|
|
17
13
|
const isExpanded = row.getIsExpanded();
|
|
18
|
-
const isExpandable = typeof expandable === 'function' ? expandable(row.original) : expandable;
|
|
19
14
|
|
|
20
15
|
return (
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
/>
|
|
41
|
-
</DsButton>
|
|
42
|
-
)}
|
|
43
|
-
</TableCell>
|
|
16
|
+
<DsButton
|
|
17
|
+
design="v1.2"
|
|
18
|
+
buttonType="tertiary"
|
|
19
|
+
size="small"
|
|
20
|
+
className={classnames(styles.button, buttonClassName)}
|
|
21
|
+
onClick={(e: React.MouseEvent) => {
|
|
22
|
+
e.stopPropagation();
|
|
23
|
+
row.toggleExpanded();
|
|
24
|
+
}}
|
|
25
|
+
onDoubleClick={(e: React.MouseEvent) => {
|
|
26
|
+
e.stopPropagation();
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
<DsIcon
|
|
30
|
+
icon="chevron_right"
|
|
31
|
+
size="small"
|
|
32
|
+
className={classnames(stylesShared.pageButtonIcon, isExpanded && 'rotate-90')}
|
|
33
|
+
/>
|
|
34
|
+
</DsButton>
|
|
44
35
|
);
|
|
45
36
|
};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type { Row } from '@tanstack/react-table';
|
|
2
2
|
|
|
3
3
|
export interface DsTableRowExpandableCellProps<TData> {
|
|
4
|
+
/**
|
|
5
|
+
* TanStack Table row model for the parent row. Used to toggle the row's
|
|
6
|
+
* expanded state when the button is clicked.
|
|
7
|
+
*/
|
|
4
8
|
row: Row<TData>;
|
|
5
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Additional CSS class name applied to the expand/collapse button.
|
|
11
|
+
*/
|
|
6
12
|
buttonClassName?: string;
|
|
7
13
|
}
|
|
@@ -17,14 +17,9 @@ export const DsTableRowSelectableCell = <TData,>({
|
|
|
17
17
|
className={stylesShared.checkboxContainer}
|
|
18
18
|
checked={isSelected}
|
|
19
19
|
disabled={!row.getCanSelect()}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
toggleHandler(e);
|
|
24
|
-
}}
|
|
25
|
-
onDoubleClick={(e: React.MouseEvent) => {
|
|
26
|
-
e.stopPropagation();
|
|
27
|
-
}}
|
|
20
|
+
onCheckedChange={(checked) => row.toggleSelected(!!checked)}
|
|
21
|
+
onClick={(e) => e.stopPropagation()}
|
|
22
|
+
onDoubleClick={(e: React.MouseEvent) => e.stopPropagation()}
|
|
28
23
|
/>
|
|
29
24
|
</TableCell>
|
|
30
25
|
);
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import type { Row } from '@tanstack/react-table';
|
|
2
2
|
|
|
3
3
|
export interface DsTableRowSelectableCellProps<TData> {
|
|
4
|
+
/**
|
|
5
|
+
* TanStack Table row model for the parent row. Used to toggle the row's
|
|
6
|
+
* selection state when the checkbox is clicked.
|
|
7
|
+
*/
|
|
4
8
|
row: Row<TData>;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the parent row is currently selected. Drives the checkbox's
|
|
11
|
+
* checked state.
|
|
12
|
+
*/
|
|
5
13
|
isSelected: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Additional CSS class name applied to the cell element.
|
|
16
|
+
*/
|
|
6
17
|
className?: string;
|
|
7
18
|
}
|
|
@@ -8,20 +8,20 @@
|
|
|
8
8
|
width: 100%;
|
|
9
9
|
|
|
10
10
|
&:hover {
|
|
11
|
-
background-color: var(--
|
|
11
|
+
background-color: var(--background-secondary);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
&[data-state='selected'] {
|
|
15
|
-
background-color: var(--
|
|
15
|
+
background-color: var(--background-secondary-hover);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
&[data-state='active'] {
|
|
19
|
-
background-color: var(--
|
|
19
|
+
background-color: var(--background-secondary-hover);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
&:not(:last-child):not(.expandedRowContent) {
|
|
23
23
|
> td {
|
|
24
|
-
border-bottom: vars.$border-width solid var(--
|
|
24
|
+
border-bottom: vars.$border-width solid var(--border-secondary);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -53,27 +53,31 @@
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.cell,
|
|
56
|
-
.selectableCell
|
|
57
|
-
.expandableCell {
|
|
56
|
+
.selectableCell {
|
|
58
57
|
display: flex;
|
|
59
58
|
align-items: center;
|
|
60
59
|
@include typography.body-sm-reg;
|
|
61
|
-
color: var(--
|
|
60
|
+
color: var(--font-main);
|
|
62
61
|
}
|
|
63
62
|
|
|
64
63
|
.cell {
|
|
65
|
-
padding: 0 var(--
|
|
64
|
+
padding: 0 var(--standard);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.expandableCell {
|
|
68
|
+
padding: 0;
|
|
69
|
+
justify-content: center;
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
.expandedRowContent {
|
|
69
|
-
background-color: var(--
|
|
73
|
+
background-color: var(--background-secondary);
|
|
70
74
|
|
|
71
75
|
& > td {
|
|
72
76
|
display: flex;
|
|
73
77
|
flex-direction: column;
|
|
74
78
|
flex: 1;
|
|
75
|
-
padding: var(--
|
|
76
|
-
background-color: var(--
|
|
79
|
+
padding: var(--standard);
|
|
80
|
+
background-color: var(--background-secondary);
|
|
77
81
|
}
|
|
78
82
|
|
|
79
83
|
@include table-mixins.expanded-row-border('bottom');
|