@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
|
@@ -7,51 +7,51 @@ $transition-duration: 0.2s;
|
|
|
7
7
|
@mixin node-row {
|
|
8
8
|
display: flex;
|
|
9
9
|
align-items: center;
|
|
10
|
-
gap: var(--
|
|
10
|
+
gap: var(--3xs);
|
|
11
11
|
border-radius: 4px;
|
|
12
12
|
cursor: pointer;
|
|
13
13
|
user-select: none;
|
|
14
14
|
width: 100%;
|
|
15
15
|
background: transparent;
|
|
16
|
-
color: var(--
|
|
16
|
+
color: var(--font-secondary);
|
|
17
17
|
|
|
18
18
|
--ds-tree-depth: calc(var(--depth) - 1);
|
|
19
19
|
--ds-tree-indent-offset: calc(#{$indent-per-level} * var(--ds-tree-depth));
|
|
20
20
|
--ds-tree-icon-offset: calc(#{$half-icon} * var(--ds-tree-depth));
|
|
21
|
-
--ds-tree-offset: calc(var(--
|
|
21
|
+
--ds-tree-offset: calc(var(--3xs) + var(--ds-tree-indent-offset) + var(--ds-tree-icon-offset));
|
|
22
22
|
|
|
23
23
|
padding-inline-start: var(--ds-tree-offset);
|
|
24
|
-
padding-inline-end: var(--
|
|
24
|
+
padding-inline-end: var(--3xs);
|
|
25
25
|
|
|
26
26
|
&:hover {
|
|
27
|
-
background: var(--
|
|
27
|
+
background: var(--background-action-hover-weak);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
&[data-focus] {
|
|
31
31
|
position: relative;
|
|
32
32
|
outline: none;
|
|
33
|
-
background: var(--
|
|
33
|
+
background: var(--background-action-hover-weak);
|
|
34
34
|
|
|
35
35
|
&::after {
|
|
36
36
|
content: '';
|
|
37
37
|
position: absolute;
|
|
38
38
|
inset: 0;
|
|
39
39
|
z-index: 2;
|
|
40
|
-
border: 2px solid var(--
|
|
40
|
+
border: 2px solid var(--border-action-primary-hover);
|
|
41
41
|
border-radius: inherit;
|
|
42
42
|
pointer-events: none;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
&[data-selected] {
|
|
47
|
-
background: var(--
|
|
47
|
+
background: var(--background-action-secondary-hover);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
&[data-disabled] {
|
|
51
51
|
cursor: not-allowed;
|
|
52
52
|
pointer-events: none;
|
|
53
53
|
.itemText {
|
|
54
|
-
color: var(--
|
|
54
|
+
color: var(--secondary-300);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -65,7 +65,7 @@ $transition-duration: 0.2s;
|
|
|
65
65
|
flex: 1;
|
|
66
66
|
display: inline-flex;
|
|
67
67
|
align-items: center;
|
|
68
|
-
gap: var(--
|
|
68
|
+
gap: var(--xs);
|
|
69
69
|
min-width: 0;
|
|
70
70
|
|
|
71
71
|
@include typography.ellipsis;
|
|
@@ -79,7 +79,7 @@ $transition-duration: 0.2s;
|
|
|
79
79
|
&[data-size='medium'] {
|
|
80
80
|
.branchControl,
|
|
81
81
|
.item {
|
|
82
|
-
padding-block: var(--
|
|
82
|
+
padding-block: var(--xs);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
.branchText,
|
|
@@ -91,7 +91,7 @@ $transition-duration: 0.2s;
|
|
|
91
91
|
&[data-size='small'] {
|
|
92
92
|
.branchControl,
|
|
93
93
|
.item {
|
|
94
|
-
padding-block: var(--
|
|
94
|
+
padding-block: var(--2xs);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
.branchText,
|
|
@@ -121,7 +121,7 @@ $transition-duration: 0.2s;
|
|
|
121
121
|
flex-shrink: 0;
|
|
122
122
|
width: var(--icon-width-tiny);
|
|
123
123
|
height: var(--icon-width-tiny);
|
|
124
|
-
color: var(--
|
|
124
|
+
color: var(--font-main);
|
|
125
125
|
transform-origin: center;
|
|
126
126
|
transition: transform $transition-duration;
|
|
127
127
|
|
|
@@ -132,7 +132,7 @@ $transition-duration: 0.2s;
|
|
|
132
132
|
|
|
133
133
|
.branchText {
|
|
134
134
|
@include node-text;
|
|
135
|
-
color: var(--
|
|
135
|
+
color: var(--font-secondary);
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
.branchContent {
|
|
@@ -153,11 +153,11 @@ $transition-duration: 0.2s;
|
|
|
153
153
|
z-index: 1;
|
|
154
154
|
width: 1px;
|
|
155
155
|
height: 100%;
|
|
156
|
-
background: var(--
|
|
156
|
+
background: var(--border-secondary);
|
|
157
157
|
|
|
158
158
|
--ds-tree-depth: calc(var(--depth) - 1);
|
|
159
159
|
--ds-tree-indent-offset: calc(#{$indent-per-level} * var(--ds-tree-depth));
|
|
160
|
-
--ds-tree-guide-offset: calc(var(--
|
|
160
|
+
--ds-tree-guide-offset: calc(var(--3xs) + var(--ds-tree-indent-offset));
|
|
161
161
|
--ds-tree-icon-offset: calc(#{$half-icon} * var(--depth));
|
|
162
162
|
|
|
163
163
|
inset-inline-start: calc(var(--ds-tree-guide-offset) + var(--ds-tree-icon-offset));
|
|
@@ -169,7 +169,7 @@ $transition-duration: 0.2s;
|
|
|
169
169
|
|
|
170
170
|
.itemText {
|
|
171
171
|
@include node-text;
|
|
172
|
-
color: var(--
|
|
172
|
+
color: var(--font-secondary);
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
.itemIndicator {
|
|
@@ -185,7 +185,7 @@ $transition-duration: 0.2s;
|
|
|
185
185
|
width: 4px;
|
|
186
186
|
height: 4px;
|
|
187
187
|
border-radius: 50%;
|
|
188
|
-
background-color: var(--
|
|
188
|
+
background-color: var(--font-main);
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
.itemAction {
|
|
@@ -198,11 +198,11 @@ $transition-duration: 0.2s;
|
|
|
198
198
|
padding: 0;
|
|
199
199
|
opacity: 0;
|
|
200
200
|
cursor: pointer;
|
|
201
|
-
color: var(--
|
|
201
|
+
color: var(--font-secondary);
|
|
202
202
|
transition: opacity $transition-duration;
|
|
203
203
|
|
|
204
204
|
&:hover {
|
|
205
|
-
color: var(--
|
|
205
|
+
color: var(--font-main);
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
|
|
@@ -216,8 +216,8 @@ $transition-duration: 0.2s;
|
|
|
216
216
|
&[data-state='checked'],
|
|
217
217
|
&[data-state='indeterminate'] {
|
|
218
218
|
.nodeCheckboxBox {
|
|
219
|
-
background-color: var(--
|
|
220
|
-
border-color: var(--
|
|
219
|
+
background-color: var(--background-primary);
|
|
220
|
+
border-color: var(--background-primary);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
|
|
@@ -225,13 +225,13 @@ $transition-duration: 0.2s;
|
|
|
225
225
|
cursor: not-allowed;
|
|
226
226
|
|
|
227
227
|
.nodeCheckboxBox {
|
|
228
|
-
border-color: var(--
|
|
228
|
+
border-color: var(--background-disable);
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
&[data-state='checked'] .nodeCheckboxBox,
|
|
232
232
|
&[data-state='indeterminate'] .nodeCheckboxBox {
|
|
233
|
-
background-color: var(--
|
|
234
|
-
border-color: var(--
|
|
233
|
+
background-color: var(--background-disable);
|
|
234
|
+
border-color: var(--background-disable);
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
}
|
|
@@ -243,9 +243,9 @@ $transition-duration: 0.2s;
|
|
|
243
243
|
align-items: center;
|
|
244
244
|
width: 16px;
|
|
245
245
|
height: 16px;
|
|
246
|
-
border: 1.5px solid var(--
|
|
246
|
+
border: 1.5px solid var(--background-deselected);
|
|
247
247
|
border-radius: 2px;
|
|
248
|
-
color: var(--
|
|
248
|
+
color: var(--secondary-050);
|
|
249
249
|
transition:
|
|
250
250
|
background-color $transition-duration,
|
|
251
251
|
border-color $transition-duration;
|
|
@@ -4,11 +4,31 @@ import type { IconType } from '../ds-icon';
|
|
|
4
4
|
import type { FilterStatus } from '../ds-filter-status-icon';
|
|
5
5
|
|
|
6
6
|
export interface DsTreeNode {
|
|
7
|
+
/**
|
|
8
|
+
* Stable identifier for the node. Used as the key in selection, expansion, and
|
|
9
|
+
* checked-state arrays.
|
|
10
|
+
*/
|
|
7
11
|
id: string;
|
|
12
|
+
/**
|
|
13
|
+
* Display name rendered for the node
|
|
14
|
+
*/
|
|
8
15
|
name: string;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the node is disabled and cannot be selected, expanded, or checked.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
9
20
|
disabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Optional icon rendered before the node name
|
|
23
|
+
*/
|
|
10
24
|
icon?: IconType;
|
|
25
|
+
/**
|
|
26
|
+
* Optional status indicator shown next to the node (e.g., active/inactive filter).
|
|
27
|
+
*/
|
|
11
28
|
status?: FilterStatus;
|
|
29
|
+
/**
|
|
30
|
+
* Child nodes rendered under this node when it is expanded. Leaf nodes omit this.
|
|
31
|
+
*/
|
|
12
32
|
children?: DsTreeNode[];
|
|
13
33
|
}
|
|
14
34
|
|
|
@@ -25,32 +45,88 @@ export interface DsTreeBasePropsWithChildren extends DsTreeBaseProps {
|
|
|
25
45
|
}
|
|
26
46
|
|
|
27
47
|
export interface DsTreeRootProps<T extends DsTreeNode = DsTreeNode> extends DsTreeBasePropsWithChildren {
|
|
48
|
+
/**
|
|
49
|
+
* Ark UI tree collection describing the node hierarchy. Build it with
|
|
50
|
+
* `createTreeCollection` and pass the resulting collection in.
|
|
51
|
+
*/
|
|
28
52
|
collection: ArkTreeView.RootProps<T>['collection'];
|
|
53
|
+
/**
|
|
54
|
+
* Controls visual density of tree rows.
|
|
55
|
+
* @default medium
|
|
56
|
+
*/
|
|
29
57
|
size?: DsTreeSize;
|
|
58
|
+
/**
|
|
59
|
+
* Ref forwarded to the tree root element
|
|
60
|
+
*/
|
|
30
61
|
ref?: Ref<HTMLDivElement>;
|
|
31
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Ids of currently selected nodes (controlled). Use with `onSelectionChange`.
|
|
65
|
+
*/
|
|
32
66
|
selectedValue?: string[];
|
|
67
|
+
/**
|
|
68
|
+
* Ids of nodes selected initially when uncontrolled.
|
|
69
|
+
*/
|
|
33
70
|
defaultSelectedValue?: string[];
|
|
71
|
+
/**
|
|
72
|
+
* Called when node selection changes. Receives the Ark selection details
|
|
73
|
+
* including the new `selectedValue` array.
|
|
74
|
+
*/
|
|
34
75
|
onSelectionChange?: ArkTreeView.RootProps<T>['onSelectionChange'];
|
|
76
|
+
/**
|
|
77
|
+
* Whether only one node can be selected at a time (`single`) or multiple
|
|
78
|
+
* selections are allowed (`multiple`).
|
|
79
|
+
* @default single
|
|
80
|
+
*/
|
|
35
81
|
selectionMode?: 'single' | 'multiple';
|
|
36
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Ids of currently expanded branch nodes (controlled). Use with `onExpandedChange`.
|
|
85
|
+
*/
|
|
37
86
|
expandedValue?: string[];
|
|
87
|
+
/**
|
|
88
|
+
* Ids of branch nodes expanded initially when uncontrolled.
|
|
89
|
+
*/
|
|
38
90
|
defaultExpandedValue?: string[];
|
|
91
|
+
/**
|
|
92
|
+
* Called when the set of expanded nodes changes. Receives the Ark expansion
|
|
93
|
+
* details including the new `expandedValue` array.
|
|
94
|
+
*/
|
|
39
95
|
onExpandedChange?: ArkTreeView.RootProps<T>['onExpandedChange'];
|
|
96
|
+
/**
|
|
97
|
+
* Whether clicking anywhere on a branch row toggles its expansion in addition
|
|
98
|
+
* to clicking the branch indicator.
|
|
99
|
+
* @default false
|
|
100
|
+
*/
|
|
40
101
|
expandOnClick?: boolean;
|
|
41
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Ids of nodes currently in the "checked" state (for checkbox trees). Use with
|
|
105
|
+
* `onCheckedChange`.
|
|
106
|
+
*/
|
|
42
107
|
checkedValue?: string[];
|
|
108
|
+
/**
|
|
109
|
+
* Ids of nodes initially checked when uncontrolled.
|
|
110
|
+
*/
|
|
43
111
|
defaultCheckedValue?: string[];
|
|
112
|
+
/**
|
|
113
|
+
* Called when the set of checked nodes changes. Receives the Ark checked-change
|
|
114
|
+
* details including the new `checkedValue` array.
|
|
115
|
+
*/
|
|
44
116
|
onCheckedChange?: ArkTreeView.RootProps<T>['onCheckedChange'];
|
|
45
117
|
|
|
46
118
|
/**
|
|
47
|
-
* Whether to enable typeahead navigation — typing characters focuses matching nodes
|
|
119
|
+
* Whether to enable typeahead navigation — typing characters focuses matching nodes.
|
|
48
120
|
*/
|
|
49
121
|
typeahead?: boolean;
|
|
50
122
|
/**
|
|
51
|
-
* Whether to defer mounting of branch content until a branch is first expanded
|
|
123
|
+
* Whether to defer mounting of branch content until a branch is first expanded.
|
|
52
124
|
*/
|
|
53
125
|
lazyMount?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Whether to unmount branch content when the branch is collapsed (vs. hiding it).
|
|
128
|
+
* Pair with `lazyMount` to control mounting strategy.
|
|
129
|
+
*/
|
|
54
130
|
unmountOnExit?: boolean;
|
|
55
131
|
}
|
|
56
132
|
|
|
@@ -69,6 +145,9 @@ export type DsTreeBranchContentProps = DsTreeBasePropsWithChildren;
|
|
|
69
145
|
export type DsTreeBranchIndentGuideProps = DsTreeBaseProps;
|
|
70
146
|
|
|
71
147
|
export interface DsTreeItemProps extends DsTreeBasePropsWithChildren {
|
|
148
|
+
/**
|
|
149
|
+
* Called when the leaf item is clicked. Receives the native mouse event.
|
|
150
|
+
*/
|
|
72
151
|
onClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
73
152
|
}
|
|
74
153
|
|
|
@@ -79,5 +158,8 @@ export type DsTreeItemIndicatorProps = DsTreeBaseProps;
|
|
|
79
158
|
export type DsTreeNodeCheckboxProps = DsTreeBaseProps;
|
|
80
159
|
|
|
81
160
|
export interface DsTreeItemActionProps extends DsTreeBasePropsWithChildren {
|
|
161
|
+
/**
|
|
162
|
+
* Called when the row action button is clicked. Receives the native mouse event.
|
|
163
|
+
*/
|
|
82
164
|
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
83
165
|
}
|
|
@@ -1,32 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
// Body variants
|
|
3
|
-
'body-md-reg': 'p',
|
|
4
|
-
'body-md-md': 'p',
|
|
5
|
-
'body-md-semi-bold': 'p',
|
|
6
|
-
'body-md-bold': 'p',
|
|
7
|
-
'body-md-link': 'a',
|
|
1
|
+
import { ark } from '@ark-ui/react';
|
|
8
2
|
|
|
9
|
-
|
|
10
|
-
'body-
|
|
11
|
-
'body-
|
|
12
|
-
'body-
|
|
13
|
-
'body-
|
|
3
|
+
export const typographyVariantConfig = {
|
|
4
|
+
'body-md-reg': { element: 'p', component: ark.p },
|
|
5
|
+
'body-md-md': { element: 'p', component: ark.p },
|
|
6
|
+
'body-md-semi-bold': { element: 'p', component: ark.p },
|
|
7
|
+
'body-md-bold': { element: 'p', component: ark.p },
|
|
8
|
+
'body-md-link': { element: 'a', component: ark.a },
|
|
14
9
|
|
|
15
|
-
'body-
|
|
16
|
-
'body-
|
|
17
|
-
'body-
|
|
18
|
-
'body-
|
|
19
|
-
'body-
|
|
10
|
+
'body-sm-reg': { element: 'span', component: ark.span },
|
|
11
|
+
'body-sm-md': { element: 'span', component: ark.span },
|
|
12
|
+
'body-sm-semi-bold': { element: 'span', component: ark.span },
|
|
13
|
+
'body-sm-bold': { element: 'span', component: ark.span },
|
|
14
|
+
'body-sm-link': { element: 'a', component: ark.a },
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
16
|
+
'body-xs-reg': { element: 'span', component: ark.span },
|
|
17
|
+
'body-xs-md': { element: 'span', component: ark.span },
|
|
18
|
+
'body-xs-semi-bold': { element: 'span', component: ark.span },
|
|
19
|
+
'body-xs-bold': { element: 'span', component: ark.span },
|
|
20
|
+
'body-xs-link': { element: 'a', component: ark.a },
|
|
26
21
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
'code-sm-reg': { element: 'code', component: ark.code },
|
|
23
|
+
'code-sm-semi-bold': { element: 'code', component: ark.code },
|
|
24
|
+
'code-xs-reg': { element: 'code', component: ark.code },
|
|
25
|
+
'code-xs-semi-bold': { element: 'code', component: ark.code },
|
|
26
|
+
|
|
27
|
+
heading1: { element: 'h1', component: ark.h1 },
|
|
28
|
+
heading2: { element: 'h2', component: ark.h2 },
|
|
29
|
+
heading3: { element: 'h3', component: ark.h3 },
|
|
30
|
+
heading4: { element: 'h4', component: ark.h4 },
|
|
32
31
|
} as const;
|
|
32
|
+
|
|
33
|
+
/** Semantic text colors backed by `--font-*` tokens in `_root_new.scss`. */
|
|
34
|
+
export const typographyColors = [
|
|
35
|
+
'main',
|
|
36
|
+
'secondary',
|
|
37
|
+
'action',
|
|
38
|
+
'action-hover',
|
|
39
|
+
'action-secondary',
|
|
40
|
+
'action-secondary-hover',
|
|
41
|
+
'disabled',
|
|
42
|
+
'light-disabled',
|
|
43
|
+
'on-action',
|
|
44
|
+
'on-disabled',
|
|
45
|
+
'placeholder',
|
|
46
|
+
'highlight',
|
|
47
|
+
'success',
|
|
48
|
+
'warning',
|
|
49
|
+
'error',
|
|
50
|
+
'code',
|
|
51
|
+
] as const;
|
|
@@ -1,24 +1,39 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
1
|
import classNames from 'classnames';
|
|
4
2
|
import type { DsTypographyProps } from './ds-typography.types';
|
|
5
|
-
import {
|
|
3
|
+
import { typographyColors, typographyVariantConfig } from './ds-typography.config';
|
|
6
4
|
import styles from './ds-typography.module.scss';
|
|
7
5
|
|
|
6
|
+
const semanticColorSet = new Set<string>(typographyColors);
|
|
7
|
+
|
|
8
|
+
const resolveColor = (color: string): string =>
|
|
9
|
+
semanticColorSet.has(color) ? `var(--font-${color})` : color;
|
|
10
|
+
|
|
8
11
|
/*
|
|
9
12
|
* Design system Typography component that provides consistent text styling
|
|
10
13
|
*/
|
|
11
|
-
const DsTypography
|
|
14
|
+
const DsTypography = ({
|
|
12
15
|
ref,
|
|
13
16
|
variant,
|
|
14
17
|
asChild = false,
|
|
15
18
|
className,
|
|
19
|
+
style,
|
|
20
|
+
color,
|
|
16
21
|
children,
|
|
17
22
|
...props
|
|
18
|
-
}) => {
|
|
19
|
-
const Component
|
|
23
|
+
}: DsTypographyProps) => {
|
|
24
|
+
const Component = typographyVariantConfig[variant].component;
|
|
25
|
+
|
|
20
26
|
return (
|
|
21
|
-
<Component
|
|
27
|
+
<Component
|
|
28
|
+
// very dynamic ref in here
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
30
|
+
// @ts-expect-error
|
|
31
|
+
ref={ref}
|
|
32
|
+
asChild={asChild}
|
|
33
|
+
className={classNames(styles[variant], className)}
|
|
34
|
+
style={color ? { color: resolveColor(color), ...style } : style}
|
|
35
|
+
{...props}
|
|
36
|
+
>
|
|
22
37
|
{children}
|
|
23
38
|
</Component>
|
|
24
39
|
);
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type {
|
|
1
|
+
import type { Ref } from 'react';
|
|
2
|
+
import type { typographyColors, typographyVariantConfig } from './ds-typography.config';
|
|
3
3
|
|
|
4
|
-
export type SemanticVariant = keyof typeof
|
|
4
|
+
export type SemanticVariant = keyof typeof typographyVariantConfig;
|
|
5
|
+
export type TypographyColor = (typeof typographyColors)[number];
|
|
5
6
|
|
|
6
7
|
export interface DsTypographyProps {
|
|
8
|
+
/**
|
|
9
|
+
* Ref to the rendered element.
|
|
10
|
+
*/
|
|
11
|
+
ref?: Ref<HTMLElement>;
|
|
7
12
|
/**
|
|
8
13
|
* The semantic variant of the component
|
|
9
14
|
*/
|
|
10
15
|
variant: SemanticVariant;
|
|
16
|
+
/**
|
|
17
|
+
* Text color. Semantic names map to `--font-*` tokens; raw CSS color values
|
|
18
|
+
* (hex, rgb, hsl, CSS variables, named colors) pass through unchanged.
|
|
19
|
+
* Omit to inherit.
|
|
20
|
+
*/
|
|
21
|
+
color?: TypographyColor | (string & {});
|
|
11
22
|
/**
|
|
12
23
|
* Additional CSS class names
|
|
13
24
|
*/
|
|
@@ -17,7 +28,7 @@ export interface DsTypographyProps {
|
|
|
17
28
|
*/
|
|
18
29
|
style?: React.CSSProperties;
|
|
19
30
|
/**
|
|
20
|
-
* When true,
|
|
31
|
+
* When true, composes typography styles onto the child element without extra DOM nodes
|
|
21
32
|
*/
|
|
22
33
|
asChild?: boolean;
|
|
23
34
|
/**
|
|
@@ -19,41 +19,41 @@
|
|
|
19
19
|
display: flex;
|
|
20
20
|
align-items: center;
|
|
21
21
|
justify-content: space-between;
|
|
22
|
-
padding: 0 var(--
|
|
23
|
-
min-height: var(--
|
|
24
|
-
height: var(--
|
|
22
|
+
padding: 0 var(--lg);
|
|
23
|
+
min-height: var(--3xl);
|
|
24
|
+
height: var(--3xl);
|
|
25
25
|
flex-shrink: 0;
|
|
26
26
|
border: none;
|
|
27
|
-
border-bottom: 1px solid var(--
|
|
28
|
-
background: var(--
|
|
27
|
+
border-bottom: 1px solid var(--border);
|
|
28
|
+
background: var(--background-secondary);
|
|
29
29
|
cursor: pointer;
|
|
30
30
|
text-align: left;
|
|
31
|
-
color: var(--
|
|
31
|
+
color: var(--font-secondary);
|
|
32
32
|
transition:
|
|
33
33
|
background-color 0.2s,
|
|
34
34
|
color 0.2s;
|
|
35
|
-
gap: var(--
|
|
35
|
+
gap: var(--xs);
|
|
36
36
|
|
|
37
37
|
&:hover:not(:disabled):not(.selected):not([data-disabled]) {
|
|
38
|
-
background: var(--
|
|
39
|
-
color: var(--
|
|
38
|
+
background: var(--background-action-tertiary-hover);
|
|
39
|
+
color: var(--font-main);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
&.selected,
|
|
43
43
|
&[data-state='active'] {
|
|
44
|
-
background: var(--
|
|
45
|
-
color: var(--
|
|
44
|
+
background: var(--background-action-secondary-hover);
|
|
45
|
+
color: var(--font-main);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
&:disabled,
|
|
49
49
|
&[data-disabled] {
|
|
50
50
|
cursor: not-allowed;
|
|
51
|
-
color: var(--
|
|
51
|
+
color: var(--font-secondary);
|
|
52
52
|
opacity: 0.5;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
&:focus-visible {
|
|
56
|
-
outline: 2px solid var(--
|
|
56
|
+
outline: 2px solid var(--background-primary);
|
|
57
57
|
outline-offset: -2px;
|
|
58
58
|
z-index: 1;
|
|
59
59
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
--ds-workspace-header-height: 54px;
|
|
3
|
+
--ds-workspace-header-gradient: radial-gradient(
|
|
4
|
+
ellipse at left bottom,
|
|
5
|
+
rgba(1, 75, 253, 1) 0%,
|
|
6
|
+
rgba(10, 60, 194, 1) 78%,
|
|
7
|
+
rgba(16, 51, 160, 1) 89%,
|
|
8
|
+
rgba(21, 42, 126, 1) 100%
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
height: 100vh;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
background: var(--background);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.fillParent {
|
|
19
|
+
height: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.header {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
flex-shrink: 0;
|
|
26
|
+
height: var(--ds-workspace-header-height);
|
|
27
|
+
padding: 0 var(--sm) 0 var(--lg);
|
|
28
|
+
background: var(--ds-workspace-header-gradient);
|
|
29
|
+
color: var(--font-on-action);
|
|
30
|
+
overflow: clip;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.subHeader {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
flex-shrink: 0;
|
|
37
|
+
padding: var(--xs) var(--standard);
|
|
38
|
+
border-bottom: 1px solid var(--border);
|
|
39
|
+
background: var(--background);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.content {
|
|
43
|
+
position: relative;
|
|
44
|
+
flex: 1;
|
|
45
|
+
overflow: auto;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.footer {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
flex-shrink: 0;
|
|
52
|
+
padding: var(--xs) var(--standard);
|
|
53
|
+
border-top: 1px solid var(--border);
|
|
54
|
+
background: var(--background);
|
|
55
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import styles from './ds-workspace.module.scss';
|
|
3
|
+
import type {
|
|
4
|
+
DsWorkspaceProps,
|
|
5
|
+
DsWorkspaceHeaderProps,
|
|
6
|
+
DsWorkspaceSubHeaderProps,
|
|
7
|
+
DsWorkspaceContentProps,
|
|
8
|
+
DsWorkspaceFooterProps,
|
|
9
|
+
} from './ds-workspace.types';
|
|
10
|
+
|
|
11
|
+
const DsWorkspace = ({ className, fillParent = false, ...rest }: DsWorkspaceProps) => (
|
|
12
|
+
<div {...rest} className={classNames(styles.root, { [styles.fillParent]: fillParent }, className)} />
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const Header = ({ className, ...rest }: DsWorkspaceHeaderProps) => (
|
|
16
|
+
<header {...rest} className={classNames(styles.header, className)} />
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const SubHeader = ({ className, ...rest }: DsWorkspaceSubHeaderProps) => (
|
|
20
|
+
<div {...rest} className={classNames(styles.subHeader, className)} />
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
/** Stacking context for non-portal drawer containment. */
|
|
24
|
+
const Content = ({ className, ...rest }: DsWorkspaceContentProps) => (
|
|
25
|
+
<div {...rest} className={classNames(styles.content, className)} />
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const Footer = ({ className, ...rest }: DsWorkspaceFooterProps) => (
|
|
29
|
+
<footer {...rest} className={classNames(styles.footer, className)} />
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
DsWorkspace.Header = Header;
|
|
33
|
+
DsWorkspace.SubHeader = SubHeader;
|
|
34
|
+
DsWorkspace.Content = Content;
|
|
35
|
+
DsWorkspace.Footer = Footer;
|
|
36
|
+
|
|
37
|
+
export default DsWorkspace;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface DsWorkspaceProps extends ComponentPropsWithRef<'div'> {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the workspace should fill its parent height (`100%`) instead of the viewport (`100vh`).
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
fillParent?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type DsWorkspaceHeaderProps = ComponentPropsWithRef<'header'>;
|
|
12
|
+
|
|
13
|
+
export type DsWorkspaceSubHeaderProps = ComponentPropsWithRef<'div'>;
|
|
14
|
+
|
|
15
|
+
export type DsWorkspaceContentProps = ComponentPropsWithRef<'div'>;
|
|
16
|
+
|
|
17
|
+
export type DsWorkspaceFooterProps = ComponentPropsWithRef<'footer'>;
|
package/src/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './components/ds-button';
|
|
|
7
7
|
export * from './components/ds-button-v3';
|
|
8
8
|
export * from './components/ds-card';
|
|
9
9
|
export * from './components/ds-checkbox';
|
|
10
|
+
export * from './components/ds-checkbox-group';
|
|
10
11
|
export * from './components/ds-chip';
|
|
11
12
|
export * from './components/ds-chip-group';
|
|
12
13
|
export * from './components/ds-comment-bubble';
|
|
@@ -61,4 +62,5 @@ export * from './components/ds-tooltip';
|
|
|
61
62
|
export * from './components/ds-tree';
|
|
62
63
|
export * from './components/ds-typography';
|
|
63
64
|
export * from './components/ds-vertical-tabs';
|
|
65
|
+
export * from './components/ds-workspace';
|
|
64
66
|
export * from './utils/responsive';
|