@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
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
position: sticky;
|
|
23
23
|
top: 0;
|
|
24
24
|
z-index: 1;
|
|
25
|
-
padding: var(--
|
|
26
|
-
border-bottom: 1px solid var(--
|
|
27
|
-
background-color: var(--
|
|
25
|
+
padding: var(--3xs);
|
|
26
|
+
border-bottom: 1px solid var(--border-secondary);
|
|
27
|
+
background-color: var(--background);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.item {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
.triggerItem {
|
|
34
34
|
display: flex;
|
|
35
35
|
align-items: center;
|
|
36
|
-
gap: var(--
|
|
36
|
+
gap: var(--xs);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
&.selected {
|
|
@@ -45,10 +45,18 @@
|
|
|
45
45
|
|
|
46
46
|
&:hover {
|
|
47
47
|
.indicator {
|
|
48
|
-
color: var(--
|
|
48
|
+
color: var(--background-primary);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
+
|
|
53
|
+
&.variant-error {
|
|
54
|
+
color: var(--font-error);
|
|
55
|
+
|
|
56
|
+
&[data-highlighted] {
|
|
57
|
+
background: var(--background-error-secondary-hover);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
52
60
|
}
|
|
53
61
|
|
|
54
62
|
.itemIcon {
|
|
@@ -61,8 +69,8 @@
|
|
|
61
69
|
|
|
62
70
|
.separator {
|
|
63
71
|
height: 1px;
|
|
64
|
-
background-color: var(--
|
|
65
|
-
margin: var(--
|
|
72
|
+
background-color: var(--border-secondary);
|
|
73
|
+
margin: var(--4xs) var(--xs);
|
|
66
74
|
}
|
|
67
75
|
|
|
68
76
|
.actions {
|
|
@@ -72,17 +80,17 @@
|
|
|
72
80
|
display: flex;
|
|
73
81
|
align-items: center;
|
|
74
82
|
justify-content: flex-end;
|
|
75
|
-
gap: var(--
|
|
76
|
-
padding: var(--
|
|
77
|
-
border-top: 1px solid var(--
|
|
78
|
-
background-color: var(--
|
|
83
|
+
gap: var(--xs);
|
|
84
|
+
padding: var(--3xs) var(--xs);
|
|
85
|
+
border-top: 1px solid var(--border-secondary);
|
|
86
|
+
background-color: var(--background);
|
|
79
87
|
}
|
|
80
88
|
|
|
81
89
|
.groupLabel {
|
|
82
90
|
display: flex;
|
|
83
91
|
align-items: center;
|
|
84
|
-
padding: var(--
|
|
85
|
-
background-color: var(--
|
|
92
|
+
padding: var(--3xs) var(--xs);
|
|
93
|
+
background-color: var(--background);
|
|
86
94
|
outline-offset: -1px;
|
|
87
95
|
|
|
88
96
|
&Collapsible {
|
|
@@ -94,7 +102,7 @@
|
|
|
94
102
|
transition: background-color 0.15s ease;
|
|
95
103
|
|
|
96
104
|
&:hover {
|
|
97
|
-
background-color: var(--
|
|
105
|
+
background-color: var(--background-action-hover-weak);
|
|
98
106
|
}
|
|
99
107
|
}
|
|
100
108
|
}
|
|
@@ -104,6 +104,7 @@ const Content: React.FC<DsDropdownMenuContentProps> = ({
|
|
|
104
104
|
const Item: React.FC<DsDropdownMenuItemProps> = ({
|
|
105
105
|
disabled,
|
|
106
106
|
selected,
|
|
107
|
+
variant = 'default',
|
|
107
108
|
value,
|
|
108
109
|
asChild,
|
|
109
110
|
onClick,
|
|
@@ -120,6 +121,7 @@ const Item: React.FC<DsDropdownMenuItemProps> = ({
|
|
|
120
121
|
{
|
|
121
122
|
[styles.selected]: selected,
|
|
122
123
|
},
|
|
124
|
+
variant === 'error' && styles['variant-error'],
|
|
123
125
|
className,
|
|
124
126
|
)}
|
|
125
127
|
style={style}
|
|
@@ -2,6 +2,9 @@ import type { CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
|
2
2
|
import type { Menu } from '@ark-ui/react/menu';
|
|
3
3
|
import type { IconType } from '../ds-icon';
|
|
4
4
|
|
|
5
|
+
export const dropdownMenuItemVariants = ['default', 'error'] as const;
|
|
6
|
+
export type DropdownMenuItemVariant = (typeof dropdownMenuItemVariants)[number];
|
|
7
|
+
|
|
5
8
|
/**
|
|
6
9
|
* Base positioning type
|
|
7
10
|
*/
|
|
@@ -162,10 +165,40 @@ export interface DsDropdownMenuItemProps extends Pick<
|
|
|
162
165
|
Menu.ItemProps,
|
|
163
166
|
'disabled' | 'asChild' | 'className' | 'style' | 'onSelect' | 'onClick' | 'value' | 'children'
|
|
164
167
|
> {
|
|
168
|
+
/**
|
|
169
|
+
* Underlying value reported to the root's `onSelect` when this item is chosen.
|
|
170
|
+
*/
|
|
171
|
+
value: Menu.ItemProps['value'];
|
|
172
|
+
/**
|
|
173
|
+
* Whether this item is disabled and cannot be selected.
|
|
174
|
+
* @default false
|
|
175
|
+
*/
|
|
176
|
+
disabled?: Menu.ItemProps['disabled'];
|
|
177
|
+
/**
|
|
178
|
+
* Render the item as its direct child via Radix-style slot forwarding. Useful
|
|
179
|
+
* for wrapping links (`<a>`) as dropdown items.
|
|
180
|
+
* @default false
|
|
181
|
+
*/
|
|
182
|
+
asChild?: Menu.ItemProps['asChild'];
|
|
183
|
+
/**
|
|
184
|
+
* Called when the item is selected via click or keyboard activation.
|
|
185
|
+
*/
|
|
186
|
+
onSelect?: Menu.ItemProps['onSelect'];
|
|
187
|
+
/**
|
|
188
|
+
* Called when the item is clicked. Fires before `onSelect` and runs even when
|
|
189
|
+
* keyboard-activated via Space/Enter.
|
|
190
|
+
*/
|
|
191
|
+
onClick?: Menu.ItemProps['onClick'];
|
|
165
192
|
/**
|
|
166
193
|
* Whether the item is selected (applies selected styling)
|
|
167
194
|
*/
|
|
168
195
|
selected?: boolean;
|
|
196
|
+
/**
|
|
197
|
+
* Status variant that applies colored text to convey item state.
|
|
198
|
+
* `error` renders text in danger color.
|
|
199
|
+
* @default 'default'
|
|
200
|
+
*/
|
|
201
|
+
variant?: DropdownMenuItemVariant;
|
|
169
202
|
}
|
|
170
203
|
|
|
171
204
|
/**
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
flex-direction: column;
|
|
12
12
|
align-items: center;
|
|
13
13
|
justify-content: center;
|
|
14
|
-
padding: var(--
|
|
15
|
-
border:
|
|
16
|
-
border-radius: var(--
|
|
17
|
-
background-color: var(--
|
|
14
|
+
padding: var(--sm) var(--standard);
|
|
15
|
+
border: 1px dashed var(--border);
|
|
16
|
+
border-radius: var(--3xs);
|
|
17
|
+
background-color: var(--background);
|
|
18
18
|
transition: all 0.2s ease;
|
|
19
19
|
cursor: pointer;
|
|
20
20
|
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.dropzoneIcon {
|
|
35
|
-
color: var(--
|
|
35
|
+
color: var(--icon-action-secondary);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.dropzoneText {
|
|
39
|
-
color: var(--
|
|
39
|
+
color: var(--background-deselected);
|
|
40
40
|
text-align: center;
|
|
41
|
-
padding: var(--
|
|
41
|
+
padding: var(--3xs) 0 var(--sm) 0;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
[data-part='trigger'] {
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
&:hover:not([data-disabled]) {
|
|
49
|
-
border-color: var(--
|
|
50
|
-
background-color: var(--
|
|
49
|
+
border-color: var(--background-primary);
|
|
50
|
+
background-color: var(--background-secondary-hover);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
&[data-dragging] {
|
|
54
|
-
border-color: var(--
|
|
55
|
-
background-color: var(--
|
|
54
|
+
border-color: var(--background-primary);
|
|
55
|
+
background-color: var(--background-secondary-hover);
|
|
56
56
|
border-style: solid;
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
|
|
62
62
|
.dropzoneIcon,
|
|
63
63
|
.dropzoneText {
|
|
64
|
-
color: var(--
|
|
64
|
+
color: var(--background-disable);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -69,22 +69,22 @@
|
|
|
69
69
|
.fileList {
|
|
70
70
|
display: flex;
|
|
71
71
|
flex-direction: column;
|
|
72
|
-
gap: var(--
|
|
73
|
-
margin-top: var(--
|
|
74
|
-
padding: var(--
|
|
75
|
-
border-radius: var(--
|
|
76
|
-
background: var(--
|
|
72
|
+
gap: var(--xs);
|
|
73
|
+
margin-top: var(--xs);
|
|
74
|
+
padding: var(--xs);
|
|
75
|
+
border-radius: var(--3xs);
|
|
76
|
+
background: var(--background-secondary);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
.infoText {
|
|
80
|
-
color: var(--
|
|
81
|
-
margin-top: var(--
|
|
80
|
+
color: var(--font-secondary);
|
|
81
|
+
margin-top: var(--2xs);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
.errorText {
|
|
85
|
-
color: var(--
|
|
85
|
+
color: var(--background-error);
|
|
86
86
|
display: flex;
|
|
87
87
|
align-items: center;
|
|
88
|
-
gap: var(--
|
|
89
|
-
margin-top: var(--
|
|
88
|
+
gap: var(--3xs);
|
|
89
|
+
margin-top: var(--2xs);
|
|
90
90
|
}
|
package/src/components/ds-file-upload/components/file-upload-item/file-upload-item.module.scss
CHANGED
|
@@ -7,16 +7,16 @@
|
|
|
7
7
|
.fileItemContent {
|
|
8
8
|
display: flex;
|
|
9
9
|
align-items: center;
|
|
10
|
-
gap: var(--
|
|
10
|
+
gap: var(--2xs);
|
|
11
11
|
width: 100%;
|
|
12
|
-
background-color: var(--
|
|
13
|
-
padding: var(--
|
|
12
|
+
background-color: var(--background);
|
|
13
|
+
padding: var(--4xs) var(--xs);
|
|
14
14
|
border: 1px solid transparent;
|
|
15
|
-
border-radius: var(--
|
|
15
|
+
border-radius: var(--3xs);
|
|
16
16
|
transition: all 0.2s ease;
|
|
17
17
|
|
|
18
18
|
&:hover {
|
|
19
|
-
border-color: var(--
|
|
19
|
+
border-color: var(--border-secondary);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
&[data-disabled] {
|
|
@@ -24,41 +24,41 @@
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
&.fileItemError {
|
|
27
|
-
background-color: var(--
|
|
27
|
+
background-color: var(--background-error-secondary-hover);
|
|
28
28
|
|
|
29
29
|
.progressRange {
|
|
30
|
-
background: var(--
|
|
30
|
+
background: var(--background-error);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
&.fileItemCompleted {
|
|
35
35
|
.progressRange {
|
|
36
|
-
background: var(--
|
|
36
|
+
background: var(--background-success-strong);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
&.fileItemUploading {
|
|
41
41
|
.progressRange {
|
|
42
|
-
background: var(--
|
|
42
|
+
background: var(--background-primary);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
&.fileItemInterrupted {
|
|
47
47
|
.progressRange {
|
|
48
|
-
background: var(--
|
|
48
|
+
background: var(--background-warning-strong);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
.filePreview {
|
|
55
|
-
color: var(--
|
|
55
|
+
color: var(--background-deselected);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
.fileInfo {
|
|
59
59
|
display: flex;
|
|
60
60
|
align-items: center;
|
|
61
|
-
gap: var(--
|
|
61
|
+
gap: var(--2xs);
|
|
62
62
|
flex: 1;
|
|
63
63
|
min-width: 0;
|
|
64
64
|
}
|
|
@@ -66,14 +66,14 @@
|
|
|
66
66
|
.fileName {
|
|
67
67
|
@include typography.body-sm-reg;
|
|
68
68
|
@include typography.ellipsis;
|
|
69
|
-
color: var(--
|
|
69
|
+
color: var(--font-main);
|
|
70
70
|
flex: 1 0 75%;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
.progressContainer {
|
|
74
74
|
display: flex;
|
|
75
75
|
flex-direction: column;
|
|
76
|
-
gap: var(--
|
|
76
|
+
gap: var(--xs);
|
|
77
77
|
width: 100%;
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -85,14 +85,14 @@
|
|
|
85
85
|
.progressTrack {
|
|
86
86
|
width: 100%;
|
|
87
87
|
height: 100%;
|
|
88
|
-
background-color: var(--
|
|
89
|
-
border-radius: var(--
|
|
88
|
+
background-color: var(--background-tertiary);
|
|
89
|
+
border-radius: var(--3xs);
|
|
90
90
|
overflow: hidden;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
.progressRange {
|
|
94
94
|
height: 100%;
|
|
95
|
-
background-color: var(--
|
|
95
|
+
background-color: var(--background-primary);
|
|
96
96
|
border-radius: 2px;
|
|
97
97
|
transition: width 0.3s ease;
|
|
98
98
|
}
|
|
@@ -100,26 +100,26 @@
|
|
|
100
100
|
@mixin infoText {
|
|
101
101
|
@include typography.body-xs-reg;
|
|
102
102
|
display: flex;
|
|
103
|
-
gap: var(--
|
|
104
|
-
padding: var(--
|
|
103
|
+
gap: var(--3xs);
|
|
104
|
+
padding: var(--3xs) var(--sm);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
.progressText {
|
|
108
108
|
@include infoText;
|
|
109
|
-
color: var(--
|
|
109
|
+
color: var(--font-secondary);
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
.completedText {
|
|
113
113
|
@include infoText;
|
|
114
|
-
color: var(--
|
|
114
|
+
color: var(--background-success-strong);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
.interruptedText {
|
|
118
118
|
@include infoText;
|
|
119
|
-
color: var(--
|
|
119
|
+
color: var(--font-warning);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
.errorMessage {
|
|
123
123
|
@include infoText;
|
|
124
|
-
color: var(--
|
|
124
|
+
color: var(--background-error);
|
|
125
125
|
}
|
|
@@ -5,23 +5,65 @@ export type UploadFileStatus = 'pending' | 'uploading' | 'interrupted' | 'comple
|
|
|
5
5
|
export type FileMetadata = Record<string, unknown>;
|
|
6
6
|
|
|
7
7
|
export interface UploadedFile extends File {
|
|
8
|
+
/**
|
|
9
|
+
* Stable identifier assigned by the uploader. Used to correlate progress
|
|
10
|
+
* updates, retries, and deletions with this specific file.
|
|
11
|
+
*/
|
|
8
12
|
id: string;
|
|
13
|
+
/**
|
|
14
|
+
* Current upload progress as a number between `0` and `1`.
|
|
15
|
+
*/
|
|
9
16
|
progress: number;
|
|
17
|
+
/**
|
|
18
|
+
* Current lifecycle state of the upload.
|
|
19
|
+
*/
|
|
10
20
|
status: UploadFileStatus;
|
|
21
|
+
/**
|
|
22
|
+
* Validation or upload errors associated with this file. Present when
|
|
23
|
+
* `status` is `error` or when the file fails client-side validation.
|
|
24
|
+
*/
|
|
11
25
|
errors?: FileError[];
|
|
26
|
+
/**
|
|
27
|
+
* Native `File` the user selected. Kept alongside so consumers can access
|
|
28
|
+
* the original binary even after `UploadedFile` has been enriched.
|
|
29
|
+
*/
|
|
12
30
|
originalFile: File;
|
|
13
31
|
}
|
|
14
32
|
|
|
15
33
|
export interface FileUploadOptions {
|
|
34
|
+
/**
|
|
35
|
+
* The file to upload.
|
|
36
|
+
*/
|
|
16
37
|
file: File;
|
|
38
|
+
/**
|
|
39
|
+
* Stable identifier for this upload. Must match the `id` on the corresponding
|
|
40
|
+
* `UploadedFile` so progress and cancellation are routed correctly.
|
|
41
|
+
*/
|
|
17
42
|
fileId: string;
|
|
43
|
+
/**
|
|
44
|
+
* Optional custom metadata forwarded by the consumer (e.g., tags, parent ids).
|
|
45
|
+
*/
|
|
18
46
|
metadata?: FileMetadata;
|
|
47
|
+
/**
|
|
48
|
+
* Called by the adapter with upload progress updates as a number between `0`
|
|
49
|
+
* and `1`.
|
|
50
|
+
*/
|
|
19
51
|
onProgress?: (progress: number) => void;
|
|
52
|
+
/**
|
|
53
|
+
* AbortSignal that fires when the consumer cancels the upload. Adapters should
|
|
54
|
+
* observe this and abort any in-flight network request.
|
|
55
|
+
*/
|
|
20
56
|
signal?: AbortSignal;
|
|
21
57
|
}
|
|
22
58
|
|
|
23
59
|
export interface FileUploadResult {
|
|
60
|
+
/**
|
|
61
|
+
* URL of the successfully uploaded file, returned by the backend.
|
|
62
|
+
*/
|
|
24
63
|
url: string;
|
|
64
|
+
/**
|
|
65
|
+
* Optional metadata returned by the backend alongside the URL.
|
|
66
|
+
*/
|
|
25
67
|
metadata?: FileMetadata;
|
|
26
68
|
}
|
|
27
69
|
|
|
@@ -33,7 +75,20 @@ export interface FileUploadResult {
|
|
|
33
75
|
* - reject with FatalFileUploadError for permanent failures
|
|
34
76
|
*/
|
|
35
77
|
export interface FileUploadAdapter {
|
|
78
|
+
/**
|
|
79
|
+
* Uploads a single file. Resolve with `FileUploadResult` on success; reject
|
|
80
|
+
* with `RetryableFileUploadError` for transient failures (will be retried) or
|
|
81
|
+
* `FatalFileUploadError` for permanent failures (surfaces to the user).
|
|
82
|
+
*/
|
|
36
83
|
upload: (options: FileUploadOptions) => FileUploadResult | Promise<FileUploadResult>;
|
|
84
|
+
/**
|
|
85
|
+
* Optional hook called when the user cancels an in-flight upload. Implementations
|
|
86
|
+
* should abort any pending network work for the given `fileId`.
|
|
87
|
+
*/
|
|
37
88
|
cancel?: (fileId: string) => void | Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Optional hook called when the user removes a previously uploaded file. Typically
|
|
91
|
+
* issues a delete request to the backend so stored files can be cleaned up.
|
|
92
|
+
*/
|
|
38
93
|
delete?: (fileId: string) => void | Promise<void>;
|
|
39
94
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
.running {
|
|
2
|
-
color: var(--
|
|
2
|
+
color: var(--primary-700-default);
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.warning {
|
|
6
|
-
color: var(--
|
|
6
|
+
color: var(--warning-400);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.failed {
|
|
10
|
-
color: var(--
|
|
10
|
+
color: var(--negative-400-default);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.paused {
|
|
14
|
-
color: var(--color-purple-600);
|
|
14
|
+
color: var(--color-dap-purple-600);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.inactive {
|
|
18
|
-
color: var(--
|
|
18
|
+
color: var(--font-disabled);
|
|
19
19
|
}
|
|
@@ -9,26 +9,26 @@ $form-control-description-max-height: calc(
|
|
|
9
9
|
.container {
|
|
10
10
|
display: flex;
|
|
11
11
|
flex-direction: column;
|
|
12
|
-
gap: var(--
|
|
12
|
+
gap: var(--4xs);
|
|
13
13
|
|
|
14
14
|
&.success {
|
|
15
15
|
.message {
|
|
16
|
-
color: var(--
|
|
16
|
+
color: var(--background-success-strong);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
&.warning {
|
|
21
21
|
.message {
|
|
22
|
-
color: var(--
|
|
22
|
+
color: var(--font-warning);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
&.error {
|
|
27
|
-
--form-control-border-color: var(--
|
|
28
|
-
--form-control-selection-color: var(--
|
|
27
|
+
--form-control-border-color: var(--background-error);
|
|
28
|
+
--form-control-selection-color: var(--background-error-secondary-hover);
|
|
29
29
|
|
|
30
30
|
.message {
|
|
31
|
-
color: var(--
|
|
31
|
+
color: var(--background-error);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -36,12 +36,12 @@ $form-control-description-max-height: calc(
|
|
|
36
36
|
.labelContainer {
|
|
37
37
|
display: flex;
|
|
38
38
|
align-items: center;
|
|
39
|
-
gap: var(--
|
|
39
|
+
gap: var(--4xs);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.label {
|
|
43
43
|
@include typography.body-sm-reg;
|
|
44
|
-
color: var(--
|
|
44
|
+
color: var(--font-main);
|
|
45
45
|
|
|
46
46
|
&.required::after {
|
|
47
47
|
@include typography.body-sm-reg;
|
|
@@ -49,14 +49,14 @@ $form-control-description-max-height: calc(
|
|
|
49
49
|
position: relative;
|
|
50
50
|
top: -1px;
|
|
51
51
|
right: -1px;
|
|
52
|
-
color: var(--
|
|
52
|
+
color: var(--icon-error);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
&.disabled {
|
|
56
56
|
color: var(--color-background-disabled);
|
|
57
57
|
|
|
58
58
|
&::after {
|
|
59
|
-
color: var(--
|
|
59
|
+
color: var(--font-disabled);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -69,7 +69,7 @@ $form-control-description-max-height: calc(
|
|
|
69
69
|
|
|
70
70
|
.description {
|
|
71
71
|
@include typography.p-s;
|
|
72
|
-
color: var(--
|
|
72
|
+
color: var(--color-dap-gray-600);
|
|
73
73
|
line-height: $form-control-description-line-height;
|
|
74
74
|
max-height: $form-control-description-max-height;
|
|
75
75
|
overflow: hidden;
|
|
@@ -117,7 +117,7 @@ $form-control-description-max-height: calc(
|
|
|
117
117
|
.icon {
|
|
118
118
|
position: absolute;
|
|
119
119
|
pointer-events: none;
|
|
120
|
-
color: var(--
|
|
120
|
+
color: var(--color-dap-gray-500);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
.icon {
|
|
@@ -127,7 +127,7 @@ $form-control-description-max-height: calc(
|
|
|
127
127
|
|
|
128
128
|
.message {
|
|
129
129
|
@include typography.body-xs-reg;
|
|
130
|
-
color: var(--
|
|
130
|
+
color: var(--font-secondary);
|
|
131
131
|
display: flex;
|
|
132
132
|
align-items: center;
|
|
133
133
|
gap: 4px;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import type { DsGridItemProps, DsGridProps } from './ds-grid.types';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import type { DsGridBaseProps, DsGridItemBaseProps } from './ds-grid.types';
|
|
5
|
+
|
|
6
|
+
export const DsGridBase = ({
|
|
7
|
+
children,
|
|
8
|
+
columns,
|
|
9
|
+
rows,
|
|
10
|
+
gutter,
|
|
11
|
+
margin,
|
|
12
|
+
className,
|
|
13
|
+
style,
|
|
14
|
+
}: DsGridBaseProps) => {
|
|
9
15
|
const gridClass = classNames(
|
|
10
16
|
'ds-grid',
|
|
11
17
|
{
|
|
@@ -15,20 +21,31 @@ export const DsGrid: React.FC<DsGridProps> = ({ children, columns, rows, classNa
|
|
|
15
21
|
className,
|
|
16
22
|
);
|
|
17
23
|
|
|
18
|
-
|
|
24
|
+
const cssVars: Record<string, string> = {};
|
|
25
|
+
|
|
26
|
+
if (gutter !== undefined) {
|
|
27
|
+
cssVars['--ds-grid-gutter'] = typeof gutter === 'number' ? `${String(gutter)}px` : gutter;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (margin !== undefined) {
|
|
31
|
+
cssVars['--ds-grid-margin'] = typeof margin === 'number' ? `${String(margin)}px` : margin;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div className={gridClass} style={{ ...style, ...cssVars } as CSSProperties}>
|
|
36
|
+
{children}
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
19
39
|
};
|
|
20
40
|
|
|
21
|
-
|
|
22
|
-
* Design system GridItem component
|
|
23
|
-
*/
|
|
24
|
-
export const DsGridItem: React.FC<DsGridItemProps> = ({
|
|
41
|
+
export const DsGridItemBase = ({
|
|
25
42
|
children,
|
|
26
43
|
colSpan,
|
|
27
44
|
colStart,
|
|
28
45
|
rowSpan,
|
|
29
46
|
rowStart,
|
|
30
47
|
className,
|
|
31
|
-
}) => {
|
|
48
|
+
}: DsGridItemBaseProps) => {
|
|
32
49
|
const gridItemClass = classNames(
|
|
33
50
|
{
|
|
34
51
|
[`ds-grid-col-span-${String(colSpan)}`]: colSpan,
|