@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.
Files changed (176) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/index.cjs +1182 -716
  3. package/dist/index.d.cts +1806 -636
  4. package/dist/index.d.cts.map +1 -1
  5. package/dist/index.d.ts +1809 -639
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1189 -726
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.min.css +1 -1
  10. package/package.json +11 -13
  11. package/src/components/ds-alert-banner/ds-alert-banner.module.scss +25 -25
  12. package/src/components/ds-autocomplete/ds-autocomplete.module.scss +29 -29
  13. package/src/components/ds-avatar/_mixins.scss +7 -7
  14. package/src/components/ds-avatar/ds-avatar.module.scss +2 -2
  15. package/src/components/ds-avatar-group/ds-avatar-group.module.scss +6 -6
  16. package/src/components/ds-breadcrumb/ds-breadcrumb.module.scss +14 -14
  17. package/src/components/ds-breadcrumb/ds-breadcrumb.types.ts +40 -6
  18. package/src/components/ds-button/ds-button.types.ts +13 -2
  19. package/src/components/ds-button/versions/ds-button-legacy/ds-button-legacy.module.scss +17 -17
  20. package/src/components/ds-button/versions/ds-button-new/ds-button-new.module.scss +135 -135
  21. package/src/components/ds-button-v3/ds-button-v3.module.scss +113 -114
  22. package/src/components/ds-button-v3/ds-button-v3.types.ts +7 -0
  23. package/src/components/ds-card/ds-card.module.scss +12 -12
  24. package/src/components/ds-card/ds-card.types.ts +3 -1
  25. package/src/components/ds-checkbox/ds-checkbox.module.scss +106 -123
  26. package/src/components/ds-checkbox/ds-checkbox.tsx +24 -35
  27. package/src/components/ds-checkbox/ds-checkbox.types.ts +12 -11
  28. package/src/components/ds-checkbox-group/ds-checkbox-group.module.scss +13 -0
  29. package/src/components/ds-checkbox-group/ds-checkbox-group.tsx +20 -0
  30. package/src/components/ds-checkbox-group/ds-checkbox-group.types.ts +8 -0
  31. package/src/components/ds-checkbox-group/hooks/index.ts +6 -0
  32. package/src/components/ds-checkbox-group/hooks/use-checkbox-select-all.ts +65 -0
  33. package/src/components/ds-checkbox-group/index.ts +3 -0
  34. package/src/components/ds-chip/ds-chip.module.scss +17 -17
  35. package/src/components/ds-chip-group/ds-chip-group.module.scss +12 -12
  36. package/src/components/ds-comment-bubble/components/ds-comment-thread/ds-comment-thread.module.scss +3 -3
  37. package/src/components/ds-comment-bubble/components/ds-comment-thread/ds-comment-thread.types.ts +26 -0
  38. package/src/components/ds-comment-bubble/components/ds-thread-item/ds-thread-item.module.scss +18 -18
  39. package/src/components/ds-comment-bubble/components/ds-thread-item/ds-thread-item.types.ts +38 -0
  40. package/src/components/ds-comment-bubble/ds-comment-bubble.module.scss +43 -43
  41. package/src/components/ds-comment-bubble/ds-comment-bubble.types.ts +78 -0
  42. package/src/components/ds-comment-card/ds-comment-card.module.scss +34 -34
  43. package/src/components/ds-comment-card/ds-comment-card.types.ts +114 -0
  44. package/src/components/ds-comment-indicator/ds-comment-indicator.module.scss +9 -9
  45. package/src/components/ds-comment-indicator/ds-comment-indicator.types.ts +26 -0
  46. package/src/components/ds-comments-drawer/comments-filters.types.ts +33 -0
  47. package/src/components/ds-comments-drawer/components/comments-filter-modal/comments-filter-modal.module.scss +10 -10
  48. package/src/components/ds-comments-drawer/components/comments-filter-modal/comments-filter-modal.types.ts +37 -1
  49. package/src/components/ds-comments-drawer/ds-comments-drawer.module.scss +11 -11
  50. package/src/components/ds-comments-drawer/ds-comments-drawer.types.ts +64 -0
  51. package/src/components/ds-date-input/ds-date-input.module.scss +42 -42
  52. package/src/components/ds-date-input/ds-date-input.types.ts +23 -0
  53. package/src/components/ds-date-picker/components/calendar-table.module.scss +17 -17
  54. package/src/components/ds-date-picker/components/calendar-view-control/calendar-view-control.module.scss +8 -8
  55. package/src/components/ds-date-picker/components/day-view/day-view.module.scss +1 -1
  56. package/src/components/ds-date-picker/ds-date-picker.module.scss +1 -1
  57. package/src/components/ds-date-picker/ds-date-picker.tsx +3 -0
  58. package/src/components/ds-date-picker/ds-date-picker.types.ts +20 -0
  59. package/src/components/ds-date-range-picker/ds-date-range-picker.module.scss +1 -1
  60. package/src/components/ds-date-range-picker/ds-date-range-picker.types.ts +28 -0
  61. package/src/components/ds-dialog/ds-dialog.module.scss +3 -3
  62. package/src/components/ds-dialog/ds-dialog.types.ts +10 -1
  63. package/src/components/ds-divider/ds-divider.module.scss +1 -1
  64. package/src/components/ds-drawer/ds-drawer.module.scss +12 -12
  65. package/src/components/ds-dropdown-menu/ds-dropdown-menu.module.scss +22 -14
  66. package/src/components/ds-dropdown-menu/ds-dropdown-menu.tsx +2 -0
  67. package/src/components/ds-dropdown-menu/ds-dropdown-menu.types.ts +33 -0
  68. package/src/components/ds-expandable-text-input/ds-expandable-text-input.module.scss +1 -1
  69. package/src/components/ds-file-upload/components/file-upload/file-upload.module.scss +22 -22
  70. package/src/components/ds-file-upload/components/file-upload/file-upload.types.ts +1 -0
  71. package/src/components/ds-file-upload/components/file-upload-item/file-upload-item.module.scss +23 -23
  72. package/src/components/ds-file-upload/ds-file-upload-api.types.ts +55 -0
  73. package/src/components/ds-filter-status-icon/ds-filter-status-icon.module.scss +5 -5
  74. package/src/components/ds-form-control/ds-form-control.module.scss +13 -13
  75. package/src/components/ds-form-control/ds-form-control.types.ts +3 -0
  76. package/src/components/ds-grid/ds-grid.tsx +29 -12
  77. package/src/components/ds-grid/ds-grid.types.ts +16 -13
  78. package/src/components/ds-grid/index.ts +10 -2
  79. package/src/components/ds-icon/custom-icons/index.ts +2 -0
  80. package/src/components/ds-icon/custom-icons/special-leading-icon.tsx +11 -0
  81. package/src/components/ds-icon/ds-icon.module.scss +8 -0
  82. package/src/components/ds-icon/ds-icon.tsx +10 -4
  83. package/src/components/ds-icon/ds-icon.types.ts +30 -0
  84. package/src/components/ds-key-value-pair/ds-key-value-pair.module.scss +7 -7
  85. package/src/components/ds-key-value-pair/ds-key-value-pair.types.ts +12 -2
  86. package/src/components/ds-modal/ds-modal.module.scss +9 -9
  87. package/src/components/ds-modal/ds-modal.types.ts +16 -0
  88. package/src/components/ds-panel/ds-panel.module.scss +16 -16
  89. package/src/components/ds-panel/ds-panel.types.ts +39 -0
  90. package/src/components/ds-popover/ds-popover.module.scss +2 -2
  91. package/src/components/ds-progress-arc/ds-progress-arc.module.scss +7 -7
  92. package/src/components/ds-progress-donut/ds-progress-donut.module.scss +7 -7
  93. package/src/components/ds-progress-linear/ds-progress-linear.module.scss +15 -15
  94. package/src/components/ds-radio-group/ds-radio-group.module.scss +58 -56
  95. package/src/components/ds-radio-group/ds-radio-group.tsx +35 -28
  96. package/src/components/ds-radio-group/ds-radio-group.types.ts +38 -7
  97. package/src/components/ds-segment-group/ds-segment-group.module.scss +18 -18
  98. package/src/components/ds-segment-group/ds-segment-group.types.ts +17 -0
  99. package/src/components/ds-select/ds-select.module.scss +8 -8
  100. package/src/components/ds-select/ds-select.types.ts +32 -0
  101. package/src/components/ds-skeleton/ds-skeleton.module.scss +1 -1
  102. package/src/components/ds-smart-tabs/ds-smart-tabs.module.scss +12 -12
  103. package/src/components/ds-smart-tabs/ds-smart-tabs.tsx +9 -9
  104. package/src/components/ds-spinner/ds-spinner.module.scss +1 -1
  105. package/src/components/ds-split-button/ds-split-button.module.scss +7 -7
  106. package/src/components/ds-split-button/ds-split-button.types.ts +28 -0
  107. package/src/components/ds-stack/ds-stack.types.ts +23 -0
  108. package/src/components/ds-status-badge/ds-status-badge.module.scss +21 -25
  109. package/src/components/ds-stepper/ds-stepper.module.scss +55 -55
  110. package/src/components/ds-stepper/ds-stepper.types.ts +34 -1
  111. package/src/components/ds-system-status/ds-system-status.module.scss +22 -22
  112. package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.types.ts +27 -0
  113. package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.module.scss +9 -9
  114. package/src/components/ds-table/components/ds-table-cell/ds-table-cell.module.scss +4 -4
  115. package/src/components/ds-table/components/ds-table-header/ds-table-header.module.scss +5 -10
  116. package/src/components/ds-table/components/ds-table-header/ds-table-header.tsx +6 -9
  117. package/src/components/ds-table/components/ds-table-row/ds-table-row.module.scss +13 -22
  118. package/src/components/ds-table/components/ds-table-row/ds-table-row.tsx +11 -18
  119. package/src/components/ds-table/components/ds-table-row-expandable-cell/ds-table-row-expandable-cell.module.scss +0 -7
  120. package/src/components/ds-table/components/ds-table-row-expandable-cell/ds-table-row-expandable-cell.tsx +19 -28
  121. package/src/components/ds-table/components/ds-table-row-expandable-cell/ds-table-row-expandable-cell.types.ts +7 -1
  122. package/src/components/ds-table/components/ds-table-row-selectable-cell/ds-table-row-selectable-cell.tsx +3 -8
  123. package/src/components/ds-table/components/ds-table-row-selectable-cell/ds-table-row-selectable-cell.types.ts +11 -0
  124. package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.module.scss +15 -11
  125. package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.tsx +9 -4
  126. package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.types.ts +27 -0
  127. package/src/components/ds-table/ds-table.module.scss +9 -2
  128. package/src/components/ds-table/ds-table.tsx +26 -4
  129. package/src/components/ds-table/filters/components/range-filter/range-filter.module.scss +1 -1
  130. package/src/components/ds-table/filters/types/filter-adapter.types.ts +6 -0
  131. package/src/components/ds-table/styles/_mixins.scss +1 -1
  132. package/src/components/ds-table/styles/_variables.scss +5 -6
  133. package/src/components/ds-table/utils/constants.ts +10 -0
  134. package/src/components/ds-tabs/components/ds-tabs-content/ds-tabs-content.module.scss +1 -1
  135. package/src/components/ds-tabs/components/ds-tabs-list/ds-tabs-indicator.module.scss +1 -1
  136. package/src/components/ds-tabs/components/ds-tabs-list/ds-tabs-list.module.scss +3 -3
  137. package/src/components/ds-tabs/components/ds-tabs-tab/ds-tabs-tab.module.scss +55 -55
  138. package/src/components/ds-tabs/ds-tabs.module.scss +1 -1
  139. package/src/components/ds-tag/ds-tag.module.scss +22 -22
  140. package/src/components/ds-tag/ds-tag.types.ts +6 -0
  141. package/src/components/ds-tag-filter/ds-tag-filter.module.scss +10 -10
  142. package/src/components/ds-tag-filter/ds-tag-filter.types.ts +16 -0
  143. package/src/components/ds-text-input/ds-text-input.module.scss +1 -1
  144. package/src/components/ds-text-input/ds-text-input.types.ts +3 -0
  145. package/src/components/ds-time-picker/components/time-item/time-item.module.scss +8 -8
  146. package/src/components/ds-time-picker/components/time-item/time-item.types.ts +19 -0
  147. package/src/components/ds-time-picker/components/time-scroller/time-scroller.module.scss +3 -3
  148. package/src/components/ds-time-picker/components/time-scroller/time-scroller.types.ts +29 -0
  149. package/src/components/ds-time-picker/ds-time-picker.module.scss +7 -0
  150. package/src/components/ds-time-picker/ds-time-picker.tsx +8 -1
  151. package/src/components/ds-time-picker/ds-time-picker.types.ts +80 -0
  152. package/src/components/ds-toast/ds-toast.module.scss +11 -11
  153. package/src/components/ds-toggle/ds-toggle.module.scss +18 -18
  154. package/src/components/ds-tooltip/ds-tooltip.module.scss +5 -5
  155. package/src/components/ds-tooltip/ds-tooltip.types.ts +6 -0
  156. package/src/components/ds-tree/ds-tree.module.scss +27 -27
  157. package/src/components/ds-tree/ds-tree.types.ts +84 -2
  158. package/src/components/ds-typography/ds-typography.config.ts +46 -27
  159. package/src/components/ds-typography/ds-typography.tsx +22 -7
  160. package/src/components/ds-typography/ds-typography.types.ts +15 -4
  161. package/src/components/ds-vertical-tabs/ds-vertical-tabs.module.scss +13 -13
  162. package/src/components/ds-workspace/ds-workspace.module.scss +55 -0
  163. package/src/components/ds-workspace/ds-workspace.tsx +37 -0
  164. package/src/components/ds-workspace/ds-workspace.types.ts +17 -0
  165. package/src/components/ds-workspace/index.ts +8 -0
  166. package/src/index.ts +2 -0
  167. package/src/styles/_grid.scss +2 -2
  168. package/src/styles/_root.scss +0 -18
  169. package/src/styles/_root_new.scss +449 -0
  170. package/src/styles/_scrollbars.scss +5 -5
  171. package/src/styles/_typography.scss +18 -14
  172. package/src/styles/mixins/_list.scss +8 -8
  173. package/src/styles/shared/_dropdown.scss +9 -9
  174. package/src/styles/shared/_input.scss +47 -49
  175. package/src/styles/styles.scss +1 -0
  176. package/src/styles/_root_updated.scss +0 -593
@@ -8,12 +8,12 @@ $border-radius: 4px;
8
8
  width: 100%;
9
9
 
10
10
  &.sizeSmall {
11
- gap: var(--spacing-4xs);
11
+ gap: var(--4xs);
12
12
  }
13
13
 
14
14
  &.sizeMedium,
15
15
  &.sizeLarge {
16
- gap: var(--spacing-3xs);
16
+ gap: var(--3xs);
17
17
  }
18
18
  }
19
19
 
@@ -25,18 +25,18 @@ $border-radius: 4px;
25
25
 
26
26
  .label {
27
27
  @include typography.body-sm-md;
28
- color: var(--color-font-main);
28
+ color: var(--font-main);
29
29
  }
30
30
 
31
31
  .valueText {
32
32
  @include typography.body-sm-reg;
33
- color: var(--color-font-main);
33
+ color: var(--font-main);
34
34
  flex-shrink: 0;
35
35
  }
36
36
 
37
37
  .track {
38
38
  width: 100%;
39
- background-color: var(--color-background-tertiary);
39
+ background-color: var(--background-tertiary);
40
40
  border-radius: $border-radius;
41
41
  overflow: hidden;
42
42
  }
@@ -60,41 +60,41 @@ $border-radius: 4px;
60
60
  }
61
61
 
62
62
  .variantProgress {
63
- background-color: var(--color-background-selected);
63
+ background-color: var(--background-primary);
64
64
  }
65
65
 
66
66
  .variantInterrupted {
67
- background-color: var(--color-background-warning-strong);
67
+ background-color: var(--background-warning-strong);
68
68
  }
69
69
 
70
70
  .variantSuccess {
71
- background-color: var(--color-background-success-strong);
71
+ background-color: var(--background-success-strong);
72
72
  }
73
73
 
74
74
  .variantError {
75
- background-color: var(--color-background-danger-strong);
75
+ background-color: var(--background-error);
76
76
  }
77
77
 
78
78
  .caption {
79
79
  @include typography.body-xs-reg;
80
80
  display: flex;
81
81
  align-items: center;
82
- gap: var(--spacing-3xs);
83
- padding-top: var(--spacing-4xs);
82
+ gap: var(--3xs);
83
+ padding-top: var(--4xs);
84
84
  }
85
85
 
86
86
  .captionDefault {
87
- color: var(--color-font-secondary);
87
+ color: var(--font-secondary);
88
88
  }
89
89
 
90
90
  .captionSuccess {
91
- color: var(--color-background-success-strong);
91
+ color: var(--background-success-strong);
92
92
  }
93
93
 
94
94
  .captionError {
95
- color: var(--color-background-danger-strong);
95
+ color: var(--background-error);
96
96
  }
97
97
 
98
98
  .captionInterrupted {
99
- color: var(--color-font-warning);
99
+ color: var(--font-warning);
100
100
  }
@@ -1,90 +1,99 @@
1
1
  @use '../../styles/typography';
2
2
 
3
+ $radio-click-target: 20px;
4
+ $radio-circle-size: 16px;
5
+ $radio-dot-size: 8px;
6
+
3
7
  .radioGroupRoot {
4
8
  display: flex;
5
9
  flex-direction: column;
6
- gap: 12px;
10
+ gap: var(--standard);
7
11
  }
8
12
 
9
13
  .radioItemContainer {
10
- position: relative;
11
14
  display: flex;
15
+ flex-wrap: wrap;
12
16
  align-items: center;
13
- gap: 4px;
17
+ column-gap: var(--3xs);
14
18
  cursor: pointer;
15
- padding-right: 1px;
16
- border: 1px solid transparent;
17
- border-radius: 4px;
19
+ border-radius: var(--4xs);
20
+
21
+ &:has(.labelInfo) {
22
+ align-items: flex-start;
23
+
24
+ .radioLabel {
25
+ padding-bottom: var(--4xs);
26
+ padding-right: var(--4xs);
27
+ }
28
+ }
18
29
 
19
30
  &:has([data-disabled]) {
20
31
  cursor: not-allowed;
21
32
 
33
+ .radioLabel {
34
+ color: var(--font-disabled);
35
+ }
36
+
22
37
  .labelInfo {
23
- color: var(--color-secondary-500-net-4);
38
+ color: var(--font-disabled);
24
39
  }
25
40
  }
26
41
 
27
- &:has([data-state='checked']:focus-visible) {
28
- border-radius: 4px;
29
- border-color: var(--color-primary-700-net-1);
42
+ &:not(:has([data-disabled])):hover {
43
+ background-color: var(--background-secondary-hover);
30
44
  }
31
45
 
32
- &:has([data-state='unchecked']:focus-visible) {
33
- border-color: var(--color-primary-800);
34
- }
46
+ &:has([data-focus-visible]) {
47
+ position: relative;
48
+ background-color: var(--background-secondary-hover);
35
49
 
36
- &:has(.labelInfo) {
37
- margin-bottom: 4px;
50
+ &::after {
51
+ content: '';
52
+ position: absolute;
53
+ inset: calc(-1px - var(--4xs));
54
+ border: var(--4xs) solid var(--border-action-primary-hover);
55
+ border-radius: var(--3xs);
56
+ pointer-events: none;
57
+ }
38
58
  }
39
59
  }
40
60
 
41
61
  .radioItem {
42
62
  all: unset;
43
- position: relative;
44
63
  display: flex;
45
64
  align-items: center;
46
65
  justify-content: center;
47
- border: 2px solid transparent;
48
- border-radius: 50%;
49
- transition:
50
- background-color 0.2s ease-in-out,
51
- border-color 0.2s ease-in-out;
66
+ width: $radio-click-target;
67
+ height: $radio-click-target;
68
+ flex-shrink: 0;
52
69
 
53
70
  .radioItemWrapper {
54
71
  display: flex;
55
72
  align-items: center;
56
73
  justify-content: center;
57
- height: 16px;
58
- width: 16px;
59
- border: 2px solid var(--color-secondary-500-net-4);
60
- padding: 2px;
74
+ height: $radio-circle-size;
75
+ width: $radio-circle-size;
76
+ border: 1.5px solid var(--border-contrast);
61
77
  border-radius: 50%;
62
- background: none;
78
+ background: var(--background);
79
+ transition: border-color 0.2s;
63
80
  }
64
81
 
65
82
  &[data-state='checked'],
66
83
  [data-state='checked'] > & {
67
84
  .radioItemWrapper {
68
- border-color: var(--color-primary-700-default);
69
- }
70
-
71
- &:hover {
72
- border-color: var(--color-primary-100);
85
+ border-color: var(--border-action-primary);
73
86
  }
74
87
  }
75
88
 
76
89
  &[data-state='checked'][data-disabled],
77
90
  [data-state='checked'][data-disabled] > & {
78
- .radioIndicator {
79
- background: var(--color-secondary-300);
91
+ .radioItemWrapper {
92
+ border-color: var(--border-disabled);
80
93
  }
81
- }
82
94
 
83
- &[data-state='unchecked'],
84
- [data-state='unchecked'] > & {
85
- &:hover {
86
- border-color: var(--color-secondary-100);
87
- background-color: var(--color-secondary-100);
95
+ .radioIndicator {
96
+ background: var(--border-disabled);
88
97
  }
89
98
  }
90
99
 
@@ -92,20 +101,16 @@
92
101
  [data-disabled] > & {
93
102
  pointer-events: none;
94
103
 
95
- & + label {
96
- pointer-events: none;
97
- }
98
-
99
104
  .radioItemWrapper {
100
- border-color: var(--color-secondary-300);
105
+ border-color: var(--border-disabled);
101
106
  }
102
107
  }
103
108
  }
104
109
 
105
110
  .radioIndicator {
106
- width: 8px;
107
- height: 8px;
108
- background: var(--color-primary-700-default);
111
+ width: $radio-dot-size;
112
+ height: $radio-dot-size;
113
+ background: var(--background-primary);
109
114
  border-radius: 50%;
110
115
 
111
116
  &[data-part='indicator'] {
@@ -123,16 +128,13 @@
123
128
  }
124
129
 
125
130
  .radioLabel {
126
- @include typography.body-sm-reg;
127
- color: var(--color-secondary-800);
128
- cursor: pointer;
131
+ @include typography.body-sm-md;
132
+ color: var(--font-main);
129
133
  }
130
134
 
131
135
  .labelInfo {
132
- @include typography.body-xs-reg;
133
- @include typography.ellipsis;
134
- position: absolute;
135
- color: var(--color-secondary-600-net-2);
136
- cursor: pointer;
137
- width: 100%;
136
+ color: var(--font-secondary);
137
+ flex-basis: 100%;
138
+ padding-left: calc($radio-click-target + var(--xs));
139
+ padding-right: var(--4xs);
138
140
  }
@@ -1,7 +1,7 @@
1
1
  import type React from 'react';
2
- import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
3
2
  import { RadioGroup } from '@ark-ui/react/radio-group';
4
3
  import classNames from 'classnames';
4
+ import { DsTypography } from '../ds-typography';
5
5
  import styles from './ds-radio-group.module.scss';
6
6
  import type {
7
7
  DsRadioGroupItemProps,
@@ -47,13 +47,11 @@ const Item: React.FC<DsRadioGroupItemProps> = ({
47
47
  </div>
48
48
  </RadioGroup.ItemControl>
49
49
  <RadioGroup.ItemHiddenInput />
50
- {label ? (
51
- <RadioGroup.ItemText className={styles.radioLabel}>
52
- {label}
53
- {labelInfo && <div className={styles.labelInfo}>{labelInfo}</div>}
54
- </RadioGroup.ItemText>
55
- ) : (
56
- children
50
+ {label ? <RadioGroup.ItemText className={styles.radioLabel}>{label}</RadioGroup.ItemText> : children}
51
+ {!!labelInfo && (
52
+ <DsTypography variant="body-xs-reg" className={styles.labelInfo}>
53
+ {labelInfo}
54
+ </DsTypography>
57
55
  )}
58
56
  </RadioGroup.Item>
59
57
  );
@@ -70,35 +68,44 @@ export const DsRadioGroupLegacy: React.FC<DsRadioGroupLegacyProps> = ({
70
68
  value,
71
69
  defaultValue,
72
70
  onValueChange,
71
+ disabled,
73
72
  className,
74
- ...props
73
+ style,
75
74
  }) => (
76
- <RadioGroupPrimitive.Root
75
+ <RadioGroup.Root
77
76
  className={classNames(styles.radioGroupRoot, className)}
78
- value={value}
77
+ style={style}
78
+ value={value ?? undefined}
79
79
  defaultValue={defaultValue}
80
- onValueChange={onValueChange}
81
- {...props}
80
+ disabled={disabled}
81
+ onValueChange={(details) => {
82
+ if (details.value !== null) {
83
+ onValueChange?.(details.value);
84
+ }
85
+ }}
82
86
  >
83
87
  {options.map((option) => (
84
- <div key={option.value} className={styles.radioItemContainer}>
85
- <RadioGroupPrimitive.Item
86
- className={styles.radioItem}
87
- value={option.value}
88
- disabled={option.disabled}
89
- id={option.value}
90
- >
88
+ <RadioGroup.Item
89
+ key={option.value}
90
+ value={option.value}
91
+ disabled={option.disabled}
92
+ className={styles.radioItemContainer}
93
+ >
94
+ <RadioGroup.ItemControl className={styles.radioItem}>
91
95
  <div className={styles.radioItemWrapper}>
92
- <RadioGroupPrimitive.Indicator className={styles.radioIndicator} />
96
+ <div className={styles.radioIndicator} data-part="indicator" />
93
97
  </div>
94
- </RadioGroupPrimitive.Item>
95
- <label className={styles.radioLabel} htmlFor={option.value}>
96
- {option.label}
97
- {option.labelInfo && <div className={styles.labelInfo}>{option.labelInfo}</div>}
98
- </label>
99
- </div>
98
+ </RadioGroup.ItemControl>
99
+ <RadioGroup.ItemHiddenInput />
100
+ <RadioGroup.ItemText className={styles.radioLabel}>{option.label}</RadioGroup.ItemText>
101
+ {!!option.labelInfo && (
102
+ <DsTypography variant="body-xs-reg" className={styles.labelInfo}>
103
+ {option.labelInfo}
104
+ </DsTypography>
105
+ )}
106
+ </RadioGroup.Item>
100
107
  ))}
101
- </RadioGroupPrimitive.Root>
108
+ </RadioGroup.Root>
102
109
  );
103
110
  /* c8 ignore stop */
104
111
 
@@ -1,5 +1,4 @@
1
1
  import type React from 'react';
2
- import type * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
3
2
  import { type RadioGroupItemProps, type RadioGroupRootProps } from '@ark-ui/react/radio-group';
4
3
 
5
4
  /**
@@ -9,6 +8,28 @@ export interface DsRadioGroupRootProps extends Pick<
9
8
  RadioGroupRootProps,
10
9
  'id' | 'value' | 'defaultValue' | 'disabled' | 'name' | 'className' | 'style' | 'orientation' | 'children'
11
10
  > {
11
+ /**
12
+ * Currently selected radio value (controlled). Pair with `onValueChange`.
13
+ */
14
+ value?: RadioGroupRootProps['value'];
15
+ /**
16
+ * Initially selected radio value when uncontrolled.
17
+ */
18
+ defaultValue?: RadioGroupRootProps['defaultValue'];
19
+ /**
20
+ * Whether the entire radio group is disabled.
21
+ * @default false
22
+ */
23
+ disabled?: RadioGroupRootProps['disabled'];
24
+ /**
25
+ * HTML name attribute applied to each radio input, used in form submissions.
26
+ */
27
+ name?: RadioGroupRootProps['name'];
28
+ /**
29
+ * Layout orientation of the radio items.
30
+ * @default vertical
31
+ */
32
+ orientation?: RadioGroupRootProps['orientation'];
12
33
  /**
13
34
  * Event handler called when the selected value changes
14
35
  */
@@ -22,6 +43,16 @@ export interface DsRadioGroupItemProps extends Pick<
22
43
  RadioGroupItemProps,
23
44
  'value' | 'disabled' | 'className' | 'style' | 'children'
24
45
  > {
46
+ /**
47
+ * Underlying value submitted when this item is selected.
48
+ */
49
+ value: RadioGroupItemProps['value'];
50
+ /**
51
+ * Whether this radio item is disabled. Takes precedence over the group-level
52
+ * `disabled` when the group is enabled.
53
+ * @default false
54
+ */
55
+ disabled?: RadioGroupItemProps['disabled'];
25
56
  /**
26
57
  * Optional label text for the radio item
27
58
  */
@@ -61,9 +92,7 @@ export interface DsRadioOptionLegacy<ValueType = string> {
61
92
  * Use compound component pattern instead
62
93
  * @deprecated
63
94
  */
64
- export interface DsRadioGroupLegacyProps<
65
- TOption extends DsRadioOptionLegacy = DsRadioOptionLegacy,
66
- > extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> {
95
+ export interface DsRadioGroupLegacyProps<TOption extends DsRadioOptionLegacy = DsRadioOptionLegacy> {
67
96
  /**
68
97
  * The radio group options
69
98
  */
@@ -78,16 +107,18 @@ export interface DsRadioGroupLegacyProps<
78
107
  defaultValue?: TOption['value'];
79
108
  /**
80
109
  * Event handler called when the selected value changes
81
- *
82
- * @param value
83
110
  */
84
111
  onValueChange?: (value: TOption['value']) => void;
112
+ /**
113
+ * Whether the entire radio group is disabled.
114
+ */
115
+ disabled?: boolean;
85
116
  /**
86
117
  * Additional CSS class names
87
118
  */
88
119
  className?: string;
89
120
  /**
90
- * Additional styles to apply to the component
121
+ * Additional inline styles
91
122
  */
92
123
  style?: React.CSSProperties;
93
124
  }
@@ -2,19 +2,19 @@
2
2
  display: inline-flex;
3
3
  align-items: center;
4
4
  position: relative;
5
- background: var(--color-background-secondary);
6
- border: 1px solid var(--color-border-contrast);
5
+ background: var(--background-secondary);
6
+ border: 1px solid var(--border-contrast);
7
7
  border-radius: 4px;
8
- gap: var(--spacing-2xs);
8
+ gap: var(--2xs);
9
9
  height: 36px;
10
- padding: var(--spacing-3xs);
10
+ padding: var(--3xs);
11
11
 
12
12
  &.small {
13
13
  height: 28px;
14
- padding: var(--spacing-4xs);
14
+ padding: var(--4xs);
15
15
 
16
16
  .segmentItem {
17
- padding: var(--spacing-4xs) var(--spacing-xs);
17
+ padding: var(--4xs) var(--xs);
18
18
  }
19
19
  }
20
20
  }
@@ -24,8 +24,8 @@
24
24
  display: flex;
25
25
  align-items: center;
26
26
  justify-content: center;
27
- padding: var(--spacing-3xs) var(--spacing-sm);
28
- gap: var(--spacing-2xs);
27
+ padding: var(--3xs) var(--sm);
28
+ gap: var(--2xs);
29
29
  flex: 1;
30
30
  z-index: 1;
31
31
  cursor: pointer;
@@ -33,7 +33,7 @@
33
33
 
34
34
  &[data-state='checked'] {
35
35
  .segmentItemText {
36
- color: var(--color-font-main);
36
+ color: var(--font-main);
37
37
  font-weight: var(--font-weight-medium);
38
38
  }
39
39
  }
@@ -42,30 +42,30 @@
42
42
  background: transparent;
43
43
 
44
44
  .segmentItemText {
45
- color: var(--color-background-action);
45
+ color: var(--background-action);
46
46
  }
47
47
 
48
48
  &:hover:not([data-disabled]) {
49
- background: var(--color-background-action-secondary);
49
+ background: var(--background-action-secondary);
50
50
  }
51
51
 
52
52
  &:active:not([data-disabled]) {
53
- background: var(--color-background);
54
- border-color: var(--color-border-contrast);
53
+ background: var(--background);
54
+ border-color: var(--border-contrast);
55
55
  }
56
56
  }
57
57
 
58
58
  &[data-disabled] {
59
59
  cursor: not-allowed;
60
- background: var(--color-background-secondary);
60
+ background: var(--background-secondary);
61
61
 
62
62
  .segmentItemText {
63
- color: var(--color-font-disabled);
63
+ color: var(--font-disabled);
64
64
  }
65
65
  }
66
66
 
67
67
  &:focus-visible {
68
- outline: 2px solid var(--color-border-action-secondary);
68
+ outline: 2px solid var(--border-action-secondary);
69
69
  outline-offset: 2px;
70
70
  }
71
71
  }
@@ -86,8 +86,8 @@
86
86
 
87
87
  .segmentIndicator {
88
88
  position: absolute;
89
- background: var(--color-background);
90
- border: 1px solid var(--color-border-contrast);
89
+ background: var(--background);
90
+ border: 1px solid var(--border-contrast);
91
91
  border-radius: 4px;
92
92
  box-shadow: 0 1.25px 4px 0 rgba(0, 0, 0, 0.25);
93
93
  z-index: 0;
@@ -17,6 +17,23 @@ export interface DsSegmentGroupRootProps extends Pick<
17
17
  SegmentGroupRootProps,
18
18
  'value' | 'defaultValue' | 'disabled' | 'name' | 'className' | 'style' | 'children'
19
19
  > {
20
+ /**
21
+ * Currently selected segment value (controlled). Pair with `onValueChange`.
22
+ */
23
+ value?: SegmentGroupRootProps['value'];
24
+ /**
25
+ * Initially selected segment value when uncontrolled.
26
+ */
27
+ defaultValue?: SegmentGroupRootProps['defaultValue'];
28
+ /**
29
+ * Whether the entire segment group is disabled.
30
+ * @default false
31
+ */
32
+ disabled?: SegmentGroupRootProps['disabled'];
33
+ /**
34
+ * HTML name attribute used when the group participates in a form submission.
35
+ */
36
+ name?: SegmentGroupRootProps['name'];
20
37
  /**
21
38
  * Size variant of the segment group
22
39
  * @default 'default'
@@ -33,18 +33,18 @@
33
33
  display: flex;
34
34
  align-items: center;
35
35
  gap: 8px;
36
- color: var(--color-font-secondary);
37
- padding: var(--spacing-xs);
36
+ color: var(--font-secondary);
37
+ padding: var(--xs);
38
38
  border-radius: 2px;
39
39
  cursor: pointer;
40
40
  outline: none;
41
41
 
42
42
  &[data-highlighted],
43
43
  &:hover {
44
- background: var(--color-background-selected-weak);
44
+ background: var(--background-secondary-hover);
45
45
 
46
46
  .itemIcon {
47
- color: var(--color-background-selected);
47
+ color: var(--background-primary);
48
48
  }
49
49
  }
50
50
  }
@@ -56,14 +56,14 @@
56
56
  text-align: start;
57
57
 
58
58
  .trigger:not([data-disabled]) & {
59
- color: var(--color-font-secondary);
59
+ color: var(--font-secondary);
60
60
  }
61
61
  }
62
62
 
63
63
  .multiSelectItemsContainer {
64
64
  display: flex;
65
65
  flex-wrap: wrap;
66
- gap: var(--spacing-3xs);
67
- padding: var(--spacing-3xs);
68
- border-bottom: 1px solid var(--color-border-secondary);
66
+ gap: var(--3xs);
67
+ padding: var(--3xs);
68
+ border-bottom: 1px solid var(--border-secondary);
69
69
  }
@@ -65,18 +65,39 @@ export type DsSelectProps = {
65
65
  renderOption?: (option: DsSelectOption) => ReactNode;
66
66
  } & (
67
67
  | {
68
+ /**
69
+ * When `false` or omitted, the select cannot be cleared. `onClear` is not
70
+ * accepted in this branch.
71
+ * @default false
72
+ */
68
73
  clearable?: undefined | false;
69
74
  onClear?: never;
70
75
  }
71
76
  | {
77
+ /**
78
+ * When `true`, renders a clear affordance on the trigger. Pair with `onClear`.
79
+ */
72
80
  clearable: true;
81
+ /**
82
+ * Called when the user clicks the clear affordance.
83
+ */
73
84
  onClear?: () => void;
74
85
  }
75
86
  ) &
76
87
  (
77
88
  | {
89
+ /**
90
+ * Single-selection mode. When `false` or omitted, `value` is a single string.
91
+ * @default false
92
+ */
78
93
  multiple?: undefined | false;
94
+ /**
95
+ * Currently selected option value (controlled).
96
+ */
79
97
  value: SelectOptionValue;
98
+ /**
99
+ * Called when the selection changes. Receives the newly selected option value.
100
+ */
80
101
  onValueChange?: (value: SelectOptionValue) => void;
81
102
  /**
82
103
  * Custom render function for the selected value in the trigger.
@@ -86,8 +107,19 @@ export type DsSelectProps = {
86
107
  renderValue?: (selectedOption: DsSelectOption) => ReactNode;
87
108
  }
88
109
  | {
110
+ /**
111
+ * Multi-selection mode. When `true`, `value` is an array of selected option
112
+ * values and `onValueChange` receives the full updated array.
113
+ */
89
114
  multiple: true;
115
+ /**
116
+ * Currently selected option values (controlled).
117
+ */
90
118
  value: SelectOptionValue[];
119
+ /**
120
+ * Called when the selection changes. Receives the full updated array of
121
+ * selected values.
122
+ */
91
123
  onValueChange?: (value: SelectOptionValue[]) => void;
92
124
  /**
93
125
  * Custom render function for the selected value in the trigger.
@@ -34,7 +34,7 @@
34
34
 
35
35
  .text {
36
36
  display: block;
37
- margin-bottom: var(--spacing-xs);
37
+ margin-bottom: var(--xs);
38
38
 
39
39
  &:last-child {
40
40
  margin-bottom: 0;