@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
|
@@ -1,161 +1,144 @@
|
|
|
1
|
+
@use '../../styles/root_new';
|
|
1
2
|
@use '../../styles/typography';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
$checkbox-size: 16px;
|
|
5
|
+
$checkbox-border-radius: 2px;
|
|
6
|
+
$checkbox-focus-ring-width: 2px;
|
|
7
|
+
$transition-duration: 0.2s;
|
|
8
|
+
|
|
9
|
+
.root {
|
|
4
10
|
position: relative;
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items:
|
|
7
|
-
gap:
|
|
8
|
-
padding
|
|
9
|
-
border:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
&:has([data-disabled]) {
|
|
13
|
-
cursor: not-allowed;
|
|
14
|
-
pointer-events: none;
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
align-items: flex-start;
|
|
13
|
+
gap: var(--3xs);
|
|
14
|
+
padding: var(--4xs);
|
|
15
|
+
border-radius: $checkbox-border-radius;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
transition: background-color $transition-duration ease-in-out;
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
&:hover,
|
|
20
|
+
&[data-hover],
|
|
21
|
+
&[data-focus-visible] {
|
|
22
|
+
background-color: var(--background-secondary-hover);
|
|
19
23
|
}
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
&[data-focus-visible] {
|
|
26
|
+
outline: $checkbox-focus-ring-width solid var(--background-primary-hover);
|
|
27
|
+
outline-offset: 0;
|
|
23
28
|
}
|
|
24
29
|
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
.control {
|
|
31
|
+
display: inline-flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
flex-shrink: 0;
|
|
35
|
+
width: $checkbox-size;
|
|
36
|
+
height: $checkbox-size;
|
|
37
|
+
border: 1px solid var(--secondary-400);
|
|
38
|
+
border-radius: $checkbox-border-radius;
|
|
39
|
+
background-color: transparent;
|
|
40
|
+
transition:
|
|
41
|
+
background-color $transition-duration ease-in-out,
|
|
42
|
+
border-color $transition-duration ease-in-out;
|
|
27
43
|
}
|
|
28
|
-
}
|
|
29
44
|
|
|
30
|
-
.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
border-radius: 2px;
|
|
34
|
-
display: flex;
|
|
35
|
-
align-items: center;
|
|
36
|
-
justify-content: center;
|
|
37
|
-
transition: all 0.2s ease-in-out;
|
|
38
|
-
cursor: pointer;
|
|
39
|
-
|
|
40
|
-
&[data-disabled] {
|
|
41
|
-
border-color: var(--color-background-disable);
|
|
42
|
-
pointer-events: none;
|
|
43
|
-
|
|
44
|
-
&[data-state='unchecked'] {
|
|
45
|
-
.checkboxWrapper {
|
|
46
|
-
border-color: var(--color-background-disable);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
45
|
+
.indicator {
|
|
46
|
+
line-height: 0;
|
|
47
|
+
color: var(--icon-inverse);
|
|
49
48
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
border-color: var(--color-background-disable);
|
|
54
|
-
background-color: var(--color-background-disable);
|
|
55
|
-
}
|
|
49
|
+
svg {
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 100%;
|
|
56
52
|
}
|
|
57
53
|
}
|
|
58
54
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
&:hover,
|
|
66
|
-
&:focus-visible {
|
|
67
|
-
background: var(--color-background-action-secondary-hover);
|
|
68
|
-
}
|
|
55
|
+
.labelColumn {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
gap: var(--4xs);
|
|
59
|
+
min-width: 0;
|
|
69
60
|
}
|
|
70
61
|
|
|
71
|
-
|
|
72
|
-
.
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
.label {
|
|
63
|
+
@include typography.body-sm-reg;
|
|
64
|
+
line-height: normal;
|
|
65
|
+
color: var(--font-main);
|
|
66
|
+
}
|
|
75
67
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
68
|
+
.labelInfo {
|
|
69
|
+
@include typography.body-xs-reg;
|
|
70
|
+
@include typography.ellipsis;
|
|
71
|
+
color: var(--font-secondary);
|
|
80
72
|
}
|
|
81
73
|
|
|
74
|
+
&[data-state='checked'],
|
|
82
75
|
&[data-state='indeterminate'] {
|
|
83
|
-
.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
&:hover,
|
|
89
|
-
&:focus-visible {
|
|
90
|
-
background: var(--color-background-action-secondary-hover);
|
|
76
|
+
.control {
|
|
77
|
+
background-color: var(--background-primary);
|
|
78
|
+
border-color: var(--background-primary);
|
|
91
79
|
}
|
|
92
80
|
}
|
|
93
81
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
justify-content: center;
|
|
98
|
-
align-items: center;
|
|
99
|
-
height: 16px;
|
|
100
|
-
width: 16px;
|
|
101
|
-
margin: var(--spacing-4xs);
|
|
102
|
-
border: 2px solid transparent;
|
|
103
|
-
border-radius: 2px;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
82
|
+
&[data-disabled] {
|
|
83
|
+
cursor: not-allowed;
|
|
84
|
+
background-color: transparent;
|
|
106
85
|
|
|
107
|
-
.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
display: flex;
|
|
111
|
-
align-items: center;
|
|
112
|
-
justify-content: center;
|
|
86
|
+
.label {
|
|
87
|
+
color: var(--font-disabled);
|
|
88
|
+
}
|
|
113
89
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
}
|
|
90
|
+
.labelInfo {
|
|
91
|
+
color: var(--font-disabled);
|
|
92
|
+
}
|
|
119
93
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
94
|
+
&[data-state='checked'],
|
|
95
|
+
&[data-state='indeterminate'] {
|
|
96
|
+
.label {
|
|
97
|
+
color: var(--font-disabled);
|
|
98
|
+
}
|
|
125
99
|
|
|
126
|
-
.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
width: 100%;
|
|
100
|
+
.control {
|
|
101
|
+
background-color: var(--background-disable);
|
|
102
|
+
border-color: var(--background-disable);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
133
106
|
}
|
|
134
107
|
|
|
135
|
-
|
|
136
|
-
|
|
108
|
+
// Overlay the native input over the control so `getByRole('checkbox')` clicks
|
|
109
|
+
// land on a real interactive surface. Ark applies `visuallyHiddenStyle` inline
|
|
110
|
+
// (1x1, clipped, off-screen) which Playwright refuses to click; `!important`
|
|
111
|
+
// is required to beat inline-style specificity.
|
|
112
|
+
.hiddenInput {
|
|
113
|
+
position: absolute !important;
|
|
114
|
+
inset-block-start: var(--4xs) !important;
|
|
115
|
+
inset-inline-start: var(--4xs) !important;
|
|
116
|
+
width: $checkbox-size !important;
|
|
117
|
+
height: $checkbox-size !important;
|
|
118
|
+
margin: 0 !important;
|
|
119
|
+
padding: 0 !important;
|
|
120
|
+
clip: auto !important;
|
|
121
|
+
overflow: visible !important;
|
|
122
|
+
opacity: 0 !important;
|
|
123
|
+
cursor: inherit !important;
|
|
137
124
|
}
|
|
138
125
|
|
|
139
126
|
.warning {
|
|
140
|
-
&:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
127
|
+
&:hover,
|
|
128
|
+
&[data-hover],
|
|
129
|
+
&[data-focus-visible] {
|
|
130
|
+
background-color: var(--background-warning);
|
|
145
131
|
}
|
|
146
132
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
background-color: var(--color-background-warning-strong);
|
|
153
|
-
}
|
|
133
|
+
&[data-state='checked'],
|
|
134
|
+
&[data-state='indeterminate'] {
|
|
135
|
+
.label {
|
|
136
|
+
color: var(--font-warning);
|
|
137
|
+
}
|
|
154
138
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
139
|
+
.control {
|
|
140
|
+
background-color: var(--background-warning-strong);
|
|
141
|
+
border-color: var(--background-warning-strong);
|
|
159
142
|
}
|
|
160
143
|
}
|
|
161
144
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useId } from 'react';
|
|
3
|
-
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
1
|
+
import { Checkbox } from '@ark-ui/react/checkbox';
|
|
4
2
|
import classNames from 'classnames';
|
|
5
3
|
import styles from './ds-checkbox.module.scss';
|
|
6
4
|
import type { DsCheckboxProps } from './ds-checkbox.types';
|
|
@@ -9,47 +7,38 @@ import { DsIcon } from '../ds-icon';
|
|
|
9
7
|
/**
|
|
10
8
|
* Design system Checkbox component
|
|
11
9
|
*/
|
|
12
|
-
const DsCheckbox
|
|
13
|
-
id,
|
|
10
|
+
const DsCheckbox = ({
|
|
14
11
|
variant = 'default',
|
|
15
12
|
label,
|
|
16
13
|
labelInfo,
|
|
17
14
|
className,
|
|
18
|
-
checked,
|
|
19
|
-
defaultChecked,
|
|
20
15
|
onCheckedChange,
|
|
16
|
+
value,
|
|
21
17
|
...props
|
|
22
|
-
}) => {
|
|
23
|
-
const generatedId = useId();
|
|
24
|
-
const checkboxId = id || generatedId;
|
|
25
|
-
|
|
18
|
+
}: DsCheckboxProps) => {
|
|
26
19
|
return (
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
</CheckboxPrimitive.Root>
|
|
46
|
-
{label && (
|
|
47
|
-
<label className={styles.label} htmlFor={checkboxId}>
|
|
48
|
-
{label}
|
|
20
|
+
<Checkbox.Root
|
|
21
|
+
className={classNames(styles.root, variant === 'warning' && styles.warning, className)}
|
|
22
|
+
onCheckedChange={(details) => onCheckedChange?.(details.checked)}
|
|
23
|
+
{...props}
|
|
24
|
+
value={value === undefined ? undefined : String(value)}
|
|
25
|
+
>
|
|
26
|
+
<Checkbox.Control className={styles.control}>
|
|
27
|
+
<Checkbox.Indicator className={styles.indicator}>
|
|
28
|
+
<DsIcon icon="check_small" size="tiny" variant="rounded" />
|
|
29
|
+
</Checkbox.Indicator>
|
|
30
|
+
<Checkbox.Indicator className={styles.indicator} indeterminate>
|
|
31
|
+
<DsIcon icon="check_indeterminate_small" size="tiny" variant="rounded" />
|
|
32
|
+
</Checkbox.Indicator>
|
|
33
|
+
</Checkbox.Control>
|
|
34
|
+
<Checkbox.HiddenInput className={styles.hiddenInput} />
|
|
35
|
+
{(label || labelInfo) && (
|
|
36
|
+
<div className={styles.labelColumn}>
|
|
37
|
+
{label && <Checkbox.Label className={styles.label}>{label}</Checkbox.Label>}
|
|
49
38
|
{labelInfo && <div className={styles.labelInfo}>{labelInfo}</div>}
|
|
50
|
-
</
|
|
39
|
+
</div>
|
|
51
40
|
)}
|
|
52
|
-
</
|
|
41
|
+
</Checkbox.Root>
|
|
53
42
|
);
|
|
54
43
|
};
|
|
55
44
|
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
-
import type
|
|
2
|
+
import { type Checkbox } from '@ark-ui/react/checkbox';
|
|
3
3
|
|
|
4
4
|
export const checkboxVariants = ['default', 'warning'] as const;
|
|
5
5
|
export type CheckboxVariant = (typeof checkboxVariants)[number];
|
|
6
6
|
|
|
7
|
-
export interface DsCheckboxProps extends
|
|
7
|
+
export interface DsCheckboxProps extends Omit<
|
|
8
|
+
ComponentPropsWithoutRef<typeof Checkbox.Root>,
|
|
9
|
+
'onCheckedChange' | 'value'
|
|
10
|
+
> {
|
|
11
|
+
/**
|
|
12
|
+
* Value when used in a group or for form submission. Coerced to string for the native control.
|
|
13
|
+
*/
|
|
14
|
+
value?: string | number;
|
|
8
15
|
/**
|
|
9
16
|
* Visual variant of the checkbox
|
|
10
17
|
*/
|
|
@@ -18,17 +25,11 @@ export interface DsCheckboxProps extends ComponentPropsWithoutRef<typeof Root> {
|
|
|
18
25
|
*/
|
|
19
26
|
labelInfo?: ReactNode;
|
|
20
27
|
/**
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
checked?: boolean | 'indeterminate';
|
|
24
|
-
/**
|
|
25
|
-
* The default checked state of the checkbox
|
|
28
|
+
* Disables the checkbox, preventing user interaction
|
|
26
29
|
*/
|
|
27
|
-
|
|
30
|
+
disabled?: boolean;
|
|
28
31
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* @param checked
|
|
32
|
+
* Callback invoked when the checked state changes
|
|
32
33
|
*/
|
|
33
34
|
onCheckedChange?: (checked: boolean | 'indeterminate') => void;
|
|
34
35
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { Checkbox } from '@ark-ui/react/checkbox';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import styles from './ds-checkbox-group.module.scss';
|
|
5
|
+
import type { DsCheckboxGroupProps } from './ds-checkbox-group.types';
|
|
6
|
+
|
|
7
|
+
const DsCheckboxGroup: React.FC<DsCheckboxGroupProps> = ({
|
|
8
|
+
orientation = 'vertical',
|
|
9
|
+
className,
|
|
10
|
+
children,
|
|
11
|
+
...props
|
|
12
|
+
}) => {
|
|
13
|
+
return (
|
|
14
|
+
<Checkbox.Group className={classNames(styles.root, styles[orientation], className)} {...props}>
|
|
15
|
+
{children}
|
|
16
|
+
</Checkbox.Group>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default DsCheckboxGroup;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { type Checkbox } from '@ark-ui/react/checkbox';
|
|
3
|
+
|
|
4
|
+
export type DsCheckboxGroupOrientation = 'vertical' | 'horizontal';
|
|
5
|
+
|
|
6
|
+
export interface DsCheckboxGroupProps extends ComponentPropsWithoutRef<typeof Checkbox.Group> {
|
|
7
|
+
orientation?: DsCheckboxGroupOrientation;
|
|
8
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export type CheckedState = boolean | 'indeterminate';
|
|
2
|
+
|
|
3
|
+
export interface UseCheckboxSelectAllOptions<T> {
|
|
4
|
+
/** Currently selected values. */
|
|
5
|
+
value: T[];
|
|
6
|
+
/** Full set of values represented by the group. */
|
|
7
|
+
allValues: readonly T[];
|
|
8
|
+
/** Callback to update selected values. */
|
|
9
|
+
onValueChange: (next: T[]) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Optional predicate to exclude values from bulk select/deselect.
|
|
12
|
+
* Non-selectable values that are already in `value` are preserved on toggle.
|
|
13
|
+
*/
|
|
14
|
+
isSelectable?: (value: T) => boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface UseCheckboxSelectAllResult {
|
|
18
|
+
/** Tri-state value for the select-all checkbox. */
|
|
19
|
+
selectAllState: CheckedState;
|
|
20
|
+
/** Count of selected values that are also selectable. */
|
|
21
|
+
selectedCount: number;
|
|
22
|
+
/** Count of selectable values. */
|
|
23
|
+
selectableCount: number;
|
|
24
|
+
/** Handler for the select-all checkbox's `onCheckedChange`. */
|
|
25
|
+
onSelectAllChange: (checked: CheckedState) => void;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Headless helper for a "select all" checkbox bound to a checkbox group.
|
|
30
|
+
*
|
|
31
|
+
* - Derives tri-state (`true` / `false` / `'indeterminate'`) from current selection.
|
|
32
|
+
* - Toggling selects or clears only selectable values; preserves any already-selected
|
|
33
|
+
* non-selectable values so bulk actions don't silently mutate protected items.
|
|
34
|
+
*/
|
|
35
|
+
export function useCheckboxSelectAll<T>({
|
|
36
|
+
value,
|
|
37
|
+
allValues,
|
|
38
|
+
onValueChange,
|
|
39
|
+
isSelectable,
|
|
40
|
+
}: UseCheckboxSelectAllOptions<T>): UseCheckboxSelectAllResult {
|
|
41
|
+
const selectableValues = isSelectable ? allValues.filter(isSelectable) : [...allValues];
|
|
42
|
+
const selectableSet = new Set(selectableValues);
|
|
43
|
+
const selectedCount = value.reduce((count, v) => (selectableSet.has(v) ? count + 1 : count), 0);
|
|
44
|
+
const selectableCount = selectableValues.length;
|
|
45
|
+
|
|
46
|
+
let selectAllState: CheckedState = 'indeterminate';
|
|
47
|
+
|
|
48
|
+
if (selectableCount === 0 || selectedCount === 0) {
|
|
49
|
+
selectAllState = false;
|
|
50
|
+
} else if (selectedCount === selectableCount) {
|
|
51
|
+
selectAllState = true;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const onSelectAllChange = (checked: CheckedState) => {
|
|
55
|
+
const preserved = value.filter((v) => !selectableSet.has(v));
|
|
56
|
+
onValueChange(checked === true ? [...preserved, ...selectableValues] : preserved);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
selectAllState,
|
|
61
|
+
selectedCount,
|
|
62
|
+
selectableCount,
|
|
63
|
+
onSelectAllChange,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
.chip {
|
|
4
4
|
display: inline-flex;
|
|
5
5
|
align-items: center;
|
|
6
|
-
gap: var(--
|
|
7
|
-
padding: 1px var(--
|
|
8
|
-
background: var(--
|
|
9
|
-
border: 1px solid var(--
|
|
6
|
+
gap: var(--3xs);
|
|
7
|
+
padding: 1px var(--3xs) 1px var(--xs);
|
|
8
|
+
background: var(--background);
|
|
9
|
+
border: 1px solid var(--border-contrast);
|
|
10
10
|
border-radius: 100vmax;
|
|
11
|
-
color: var(--
|
|
11
|
+
color: var(--font-main);
|
|
12
12
|
cursor: default;
|
|
13
13
|
overflow: hidden;
|
|
14
14
|
transition:
|
|
@@ -20,31 +20,31 @@
|
|
|
20
20
|
cursor: pointer;
|
|
21
21
|
|
|
22
22
|
&:hover {
|
|
23
|
-
background: var(--
|
|
24
|
-
border-color: var(--
|
|
23
|
+
background: var(--background-action-hover-weak);
|
|
24
|
+
border-color: var(--border-action-secondary-hover);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
&:focus-visible {
|
|
28
|
-
outline: 2px solid var(--
|
|
28
|
+
outline: 2px solid var(--background-primary);
|
|
29
29
|
outline-offset: 2px;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
&.small {
|
|
34
|
-
padding: 0 var(--
|
|
35
|
-
gap: var(--
|
|
34
|
+
padding: 0 var(--4xs) 0 var(--3xs);
|
|
35
|
+
gap: var(--4xs);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
&[aria-pressed='true'] {
|
|
39
|
-
background: var(--
|
|
40
|
-
border-color: var(--
|
|
41
|
-
color: var(--
|
|
39
|
+
background: var(--background-secondary-hover);
|
|
40
|
+
border-color: var(--border-action-primary);
|
|
41
|
+
color: var(--font-action);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.label {
|
|
46
46
|
@include typography.ellipsis;
|
|
47
|
-
padding: var(--
|
|
47
|
+
padding: var(--4xs) var(--3xs);
|
|
48
48
|
flex: 1;
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
justify-content: center;
|
|
55
55
|
border: none;
|
|
56
56
|
background: transparent;
|
|
57
|
-
color: var(--
|
|
57
|
+
color: var(--icon-information-main);
|
|
58
58
|
cursor: pointer;
|
|
59
59
|
transition:
|
|
60
60
|
background-color 0.2s,
|
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
flex-shrink: 0;
|
|
63
63
|
|
|
64
64
|
&:hover {
|
|
65
|
-
color: var(--
|
|
65
|
+
color: var(--icon-action-secondary);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
.chip.small & {
|
|
69
|
-
padding: 1px var(--
|
|
69
|
+
padding: 1px var(--4xs);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
.container {
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
|
-
gap: var(--
|
|
5
|
-
padding: var(--
|
|
6
|
-
background: var(--
|
|
7
|
-
border: 1px solid var(--
|
|
8
|
-
border-radius: var(--
|
|
4
|
+
gap: var(--standard);
|
|
5
|
+
padding: var(--xs) var(--standard);
|
|
6
|
+
background: var(--background-secondary-hover);
|
|
7
|
+
border: 1px solid var(--outline-weak);
|
|
8
|
+
border-radius: var(--3xs);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.chipsWrapper {
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
flex: 1;
|
|
14
14
|
flex-wrap: wrap;
|
|
15
15
|
align-items: center;
|
|
16
|
-
gap: var(--
|
|
17
|
-
max-height: var(--
|
|
16
|
+
gap: var(--xs);
|
|
17
|
+
max-height: var(--3xl);
|
|
18
18
|
overflow: hidden;
|
|
19
19
|
|
|
20
20
|
.hidden {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.label {
|
|
28
|
-
color: var(--
|
|
28
|
+
color: var(--font-secondary);
|
|
29
29
|
white-space: nowrap;
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
|
|
36
36
|
.dialog {
|
|
37
37
|
position: fixed;
|
|
38
|
-
background: var(--
|
|
39
|
-
border: 1px solid var(--
|
|
40
|
-
border-radius: var(--
|
|
38
|
+
background: var(--background);
|
|
39
|
+
border: 1px solid var(--border-secondary);
|
|
40
|
+
border-radius: var(--3xs);
|
|
41
41
|
box-shadow: 0 5px 15px 0 rgba(0, 0, 0, 0.15);
|
|
42
|
-
padding: var(--
|
|
42
|
+
padding: var(--xs);
|
|
43
43
|
max-height: 80vh;
|
|
44
44
|
overflow-y: auto;
|
|
45
45
|
z-index: 1001;
|
package/src/components/ds-comment-bubble/components/ds-comment-thread/ds-comment-thread.module.scss
CHANGED
|
@@ -22,11 +22,11 @@ $transition-duration: 0.2s;
|
|
|
22
22
|
.followingComments {
|
|
23
23
|
display: flex;
|
|
24
24
|
flex-direction: column;
|
|
25
|
-
gap: var(--
|
|
25
|
+
gap: var(--sm);
|
|
26
26
|
flex: 1;
|
|
27
27
|
overflow-y: auto;
|
|
28
28
|
min-height: 0;
|
|
29
|
-
padding: var(--
|
|
29
|
+
padding: var(--sm) 0;
|
|
30
30
|
|
|
31
31
|
&::-webkit-scrollbar {
|
|
32
32
|
width: $scrollbar-width;
|
|
@@ -37,7 +37,7 @@ $transition-duration: 0.2s;
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
&::-webkit-scrollbar-thumb {
|
|
40
|
-
background: var(--
|
|
40
|
+
background: var(--background-tertiary);
|
|
41
41
|
border-radius: $scrollbar-border-radius-pill;
|
|
42
42
|
width: $scrollbar-thumb-width;
|
|
43
43
|
}
|