@drivenets/design-system 0.3.0 → 0.4.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 (149) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +1 -1
  3. package/dist/components/ds-alert-banner/ds-alert-banner.d.cts +5 -5
  4. package/dist/components/ds-alert-banner/ds-alert-banner.d.cts.map +1 -1
  5. package/dist/components/ds-alert-banner/ds-alert-banner.d.ts +5 -5
  6. package/dist/components/ds-alert-banner/ds-alert-banner.d.ts.map +1 -1
  7. package/dist/components/ds-alert-banner/ds-alert-banner.types.d.cts.map +1 -1
  8. package/dist/components/ds-autocomplete/ds-autocomplete.cjs +218 -0
  9. package/dist/components/ds-autocomplete/ds-autocomplete.d.cts +22 -0
  10. package/dist/components/ds-autocomplete/ds-autocomplete.d.cts.map +1 -0
  11. package/dist/components/ds-autocomplete/ds-autocomplete.d.ts +22 -0
  12. package/dist/components/ds-autocomplete/ds-autocomplete.d.ts.map +1 -0
  13. package/dist/components/ds-autocomplete/ds-autocomplete.js +217 -0
  14. package/dist/components/ds-autocomplete/ds-autocomplete.js.map +1 -0
  15. package/dist/components/ds-autocomplete/ds-autocomplete.module.cjs +27 -0
  16. package/dist/components/ds-autocomplete/ds-autocomplete.module.js +27 -0
  17. package/dist/components/ds-autocomplete/ds-autocomplete.module.js.map +1 -0
  18. package/dist/components/ds-autocomplete/ds-autocomplete.types.d.cts +79 -0
  19. package/dist/components/ds-autocomplete/ds-autocomplete.types.d.cts.map +1 -0
  20. package/dist/components/ds-autocomplete/ds-autocomplete.types.d.ts +80 -0
  21. package/dist/components/ds-autocomplete/ds-autocomplete.types.d.ts.map +1 -0
  22. package/dist/components/ds-autocomplete/index.cjs +1 -0
  23. package/dist/components/ds-autocomplete/index.d.ts +2 -0
  24. package/dist/components/ds-autocomplete/index.js +1 -0
  25. package/dist/components/ds-avatar/ds-avatar.module.js.map +1 -1
  26. package/dist/components/ds-avatar-group/ds-avatar-group.module.js.map +1 -1
  27. package/dist/components/ds-button/ds-button.d.cts +2 -2
  28. package/dist/components/ds-button/ds-button.d.cts.map +1 -1
  29. package/dist/components/ds-confirmation/ds-confirmation.cjs +20 -221
  30. package/dist/components/ds-confirmation/ds-confirmation.d.cts +22 -27
  31. package/dist/components/ds-confirmation/ds-confirmation.d.cts.map +1 -1
  32. package/dist/components/ds-confirmation/ds-confirmation.d.ts +22 -27
  33. package/dist/components/ds-confirmation/ds-confirmation.d.ts.map +1 -1
  34. package/dist/components/ds-confirmation/ds-confirmation.js +21 -221
  35. package/dist/components/ds-confirmation/ds-confirmation.js.map +1 -1
  36. package/dist/components/ds-confirmation/ds-confirmation.types.d.cts +2 -1
  37. package/dist/components/ds-confirmation/ds-confirmation.types.d.cts.map +1 -1
  38. package/dist/components/ds-confirmation/ds-confirmation.types.d.ts +2 -1
  39. package/dist/components/ds-confirmation/ds-confirmation.types.d.ts.map +1 -1
  40. package/dist/components/ds-date-input/ds-date-input.cjs +1 -1
  41. package/dist/components/ds-date-input/ds-date-input.d.cts +2 -2
  42. package/dist/components/ds-date-input/ds-date-input.d.ts +2 -2
  43. package/dist/components/ds-date-input/ds-date-input.js +1 -1
  44. package/dist/components/ds-drawer/ds-drawer.cjs +1 -1
  45. package/dist/components/ds-drawer/ds-drawer.d.cts +9 -9
  46. package/dist/components/ds-drawer/ds-drawer.d.cts.map +1 -1
  47. package/dist/components/ds-drawer/ds-drawer.d.ts +9 -9
  48. package/dist/components/ds-drawer/ds-drawer.js +1 -1
  49. package/dist/components/ds-dropdown-menu/ds-dropdown-menu.cjs +1 -1
  50. package/dist/components/ds-dropdown-menu/ds-dropdown-menu.js +1 -1
  51. package/dist/components/ds-dropdown-menu/ds-dropdown-menu.module.cjs +20 -20
  52. package/dist/components/ds-dropdown-menu/ds-dropdown-menu.module.js +20 -20
  53. package/dist/components/ds-dropdown-menu/ds-dropdown-menu.module.js.map +1 -1
  54. package/dist/components/ds-expandable-text-input/ds-expandable-text-input.d.cts +2 -2
  55. package/dist/components/ds-expandable-text-input/ds-expandable-text-input.d.ts +2 -2
  56. package/dist/components/ds-form-control/ds-form-control.d.cts +8 -8
  57. package/dist/components/ds-form-control/ds-form-control.d.ts +8 -8
  58. package/dist/components/ds-loader/ds-loader.d.cts +2 -2
  59. package/dist/components/ds-loader/ds-loader.d.ts +2 -2
  60. package/dist/components/ds-modal/ds-modal.cjs +47 -48
  61. package/dist/components/ds-modal/ds-modal.d.cts +11 -10
  62. package/dist/components/ds-modal/ds-modal.d.cts.map +1 -1
  63. package/dist/components/ds-modal/ds-modal.d.ts +11 -10
  64. package/dist/components/ds-modal/ds-modal.d.ts.map +1 -1
  65. package/dist/components/ds-modal/ds-modal.js +47 -48
  66. package/dist/components/ds-modal/ds-modal.js.map +1 -1
  67. package/dist/components/ds-modal/ds-modal.module.cjs +24 -24
  68. package/dist/components/ds-modal/ds-modal.module.js +24 -24
  69. package/dist/components/ds-modal/ds-modal.module.js.map +1 -1
  70. package/dist/components/ds-modal/ds-modal.types.d.cts +10 -5
  71. package/dist/components/ds-modal/ds-modal.types.d.cts.map +1 -1
  72. package/dist/components/ds-modal/ds-modal.types.d.ts +10 -5
  73. package/dist/components/ds-modal/ds-modal.types.d.ts.map +1 -1
  74. package/dist/components/ds-panel/ds-panel.d.cts +2 -2
  75. package/dist/components/ds-panel/ds-panel.d.ts +2 -2
  76. package/dist/components/ds-select/ds-select.cjs +1 -1
  77. package/dist/components/ds-select/ds-select.d.cts +2 -2
  78. package/dist/components/ds-select/ds-select.js +1 -1
  79. package/dist/components/ds-skeleton/ds-skeleton-circle.d.cts +2 -2
  80. package/dist/components/ds-skeleton/ds-skeleton-circle.d.ts +2 -2
  81. package/dist/components/ds-skeleton/ds-skeleton-rect.d.cts +2 -2
  82. package/dist/components/ds-skeleton/ds-skeleton-rect.d.ts +2 -2
  83. package/dist/components/ds-skeleton/ds-skeleton-rect.d.ts.map +1 -1
  84. package/dist/components/ds-skeleton/ds-skeleton-text.d.cts +2 -2
  85. package/dist/components/ds-skeleton/ds-skeleton-text.d.ts +2 -2
  86. package/dist/components/ds-skeleton/ds-skeleton.d.cts +4 -4
  87. package/dist/components/ds-skeleton/ds-skeleton.d.ts +4 -4
  88. package/dist/components/ds-smart-tabs/ds-smart-tabs.d.cts +2 -2
  89. package/dist/components/ds-smart-tabs/ds-smart-tabs.d.ts +2 -2
  90. package/dist/components/ds-smart-tabs/ds-smart-tabs.d.ts.map +1 -1
  91. package/dist/components/ds-stepper/components/ds-step-content.d.cts +2 -2
  92. package/dist/components/ds-stepper/components/ds-step-content.d.ts +2 -2
  93. package/dist/components/ds-stepper/components/ds-step-next-button.d.cts +2 -2
  94. package/dist/components/ds-stepper/components/ds-step-next-button.d.ts +2 -2
  95. package/dist/components/ds-stepper/components/ds-step.d.cts +2 -2
  96. package/dist/components/ds-stepper/components/ds-step.d.ts +2 -2
  97. package/dist/components/ds-stepper/ds-stepper.d.cts +2 -2
  98. package/dist/components/ds-stepper/ds-stepper.d.ts +2 -2
  99. package/dist/components/ds-table/ds-table.d.ts +2 -2
  100. package/dist/components/ds-table/filters/hooks/index.d.ts +1 -1
  101. package/dist/components/ds-table/filters/hooks/use-table-filters.cjs +180 -185
  102. package/dist/components/ds-table/filters/hooks/use-table-filters.d.cts +58 -25
  103. package/dist/components/ds-table/filters/hooks/use-table-filters.d.cts.map +1 -1
  104. package/dist/components/ds-table/filters/hooks/use-table-filters.d.ts +58 -25
  105. package/dist/components/ds-table/filters/hooks/use-table-filters.d.ts.map +1 -1
  106. package/dist/components/ds-table/filters/hooks/use-table-filters.js +180 -185
  107. package/dist/components/ds-table/filters/hooks/use-table-filters.js.map +1 -1
  108. package/dist/components/ds-table/filters/index.d.ts +1 -1
  109. package/dist/components/ds-table/index.d.ts +1 -1
  110. package/dist/components/ds-tabs/components/ds-tabs-content/ds-tabs-content.module.cjs +2 -2
  111. package/dist/components/ds-tabs/components/ds-tabs-content/ds-tabs-content.module.js +2 -2
  112. package/dist/components/ds-tabs/components/ds-tabs-content/ds-tabs-content.module.js.map +1 -1
  113. package/dist/components/ds-tabs/ds-tabs.d.cts +5 -5
  114. package/dist/components/ds-tabs/ds-tabs.d.ts +5 -5
  115. package/dist/components/ds-tag/ds-tag.d.cts +2 -2
  116. package/dist/components/ds-tag/ds-tag.d.ts +2 -2
  117. package/dist/components/ds-tag-filter/ds-tag-filter.d.cts +2 -2
  118. package/dist/components/ds-tag-filter/ds-tag-filter.d.ts +2 -2
  119. package/dist/components/ds-toggle/ds-toggle.d.cts +2 -2
  120. package/dist/components/ds-toggle/ds-toggle.d.ts +2 -2
  121. package/dist/components/ds-vertical-tabs/ds-vertical-tabs.d.cts +5 -5
  122. package/dist/components/ds-vertical-tabs/ds-vertical-tabs.d.ts +5 -5
  123. package/dist/index.cjs +4 -1
  124. package/dist/index.d.cts +4 -2
  125. package/dist/index.d.ts +5 -2
  126. package/dist/index.js +4 -2
  127. package/dist/index.min.css +1 -1
  128. package/package.json +1 -1
  129. package/src/components/ds-autocomplete/ds-autocomplete.module.scss +257 -0
  130. package/src/components/ds-autocomplete/ds-autocomplete.tsx +130 -0
  131. package/src/components/ds-autocomplete/ds-autocomplete.types.tsx +76 -0
  132. package/src/components/ds-autocomplete/index.ts +2 -0
  133. package/src/components/ds-avatar/ds-avatar.module.scss +1 -1
  134. package/src/components/ds-avatar-group/ds-avatar-group.module.scss +1 -1
  135. package/src/components/ds-confirmation/ds-confirmation.tsx +11 -115
  136. package/src/components/ds-confirmation/ds-confirmation.types.tsx +2 -1
  137. package/src/components/ds-dropdown-menu/ds-dropdown-menu.module.scss +0 -1
  138. package/src/components/ds-modal/ds-modal.module.scss +123 -60
  139. package/src/components/ds-modal/ds-modal.tsx +5 -2
  140. package/src/components/ds-modal/ds-modal.types.tsx +14 -5
  141. package/src/components/ds-table/filters/hooks/index.ts +1 -1
  142. package/src/components/ds-table/filters/hooks/use-table-filters.ts +117 -116
  143. package/src/components/ds-tabs/components/ds-tabs-content/ds-tabs-content.module.scss +4 -0
  144. package/src/index.ts +1 -0
  145. package/src/styles/shared/_modal.scss +0 -123
  146. package/dist/components/ds-confirmation/ds-confirmation.module.cjs +0 -21
  147. package/dist/components/ds-confirmation/ds-confirmation.module.js +0 -21
  148. package/dist/components/ds-confirmation/ds-confirmation.module.js.map +0 -1
  149. package/src/components/ds-confirmation/ds-confirmation.module.scss +0 -58
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drivenets/design-system",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.cts",
@@ -0,0 +1,257 @@
1
+ @use '../../styles/shared/dropdown';
2
+ @use '../../styles/shared/input';
3
+
4
+ $autocomplete-input-height: 36px;
5
+ $autocomplete-max-visible-items: 4;
6
+ $autocomplete-item-height: 38px;
7
+ $autocomplete-dropdown-max-height: calc($autocomplete-max-visible-items * $autocomplete-item-height);
8
+ $autocomplete-trigger-size: 24px;
9
+ $autocomplete-trigger-border-radius: 4px;
10
+ $autocomplete-highlight-border-radius: 2px;
11
+ $autocomplete-animation-duration: 0.2s;
12
+ $autocomplete-animation-translate: -8px;
13
+ $autocomplete-outline-width: 2px;
14
+ $autocomplete-outline-offset: 2px;
15
+ $autocomplete-rotation-open: 180deg;
16
+ $autocomplete-opacity-hidden: 0;
17
+ $autocomplete-opacity-visible: 1;
18
+
19
+ .root {
20
+ position: relative;
21
+ width: 100%;
22
+ display: inline-flex;
23
+ flex-direction: column;
24
+ }
25
+
26
+ .control {
27
+ @include input.base-input-container;
28
+ @include input.input-container-states;
29
+ display: flex;
30
+ align-items: center;
31
+ gap: var(--spacing-3xs);
32
+ height: $autocomplete-input-height;
33
+ min-height: $autocomplete-input-height;
34
+ max-height: $autocomplete-input-height;
35
+
36
+ &[data-focus] {
37
+ border-color: var(--form-control-border-color, var(--color-border-action-primary)) !important;
38
+ }
39
+
40
+ &[data-invalid] {
41
+ border-color: var(--color-background-danger-strong);
42
+ }
43
+ }
44
+
45
+ .input {
46
+ @include input.base-input;
47
+ flex: 1;
48
+ min-width: 0;
49
+ outline: none;
50
+
51
+ &::placeholder {
52
+ color: var(--color-font-placeholder);
53
+ }
54
+ }
55
+
56
+ .startAdornment {
57
+ display: flex;
58
+ align-items: center;
59
+ justify-content: center;
60
+ color: var(--color-background-action);
61
+ flex-shrink: 0;
62
+ }
63
+
64
+ .iconContainer {
65
+ display: flex;
66
+ align-items: center;
67
+ gap: var(--spacing-3xs);
68
+ flex-shrink: 0;
69
+ }
70
+
71
+ .clearButton {
72
+ @include input.icon-button;
73
+ cursor: pointer;
74
+ opacity: $autocomplete-opacity-hidden;
75
+ visibility: hidden;
76
+ transition: opacity $autocomplete-animation-duration ease;
77
+
78
+ &:hover {
79
+ color: var(--color-background-action-hover);
80
+ }
81
+ }
82
+
83
+ .control:hover .clearButton,
84
+ .control[data-focus] .clearButton {
85
+ opacity: $autocomplete-opacity-visible;
86
+ visibility: visible;
87
+ }
88
+
89
+ .trigger {
90
+ display: flex;
91
+ align-items: center;
92
+ justify-content: center;
93
+ color: var(--color-background-deselected);
94
+ transition:
95
+ transform $autocomplete-animation-duration ease-in-out,
96
+ background-color $autocomplete-animation-duration ease,
97
+ color $autocomplete-animation-duration ease;
98
+ cursor: pointer;
99
+ background: transparent;
100
+ border: none;
101
+ padding: 0;
102
+ border-radius: $autocomplete-trigger-border-radius;
103
+ width: $autocomplete-trigger-size;
104
+ height: $autocomplete-trigger-size;
105
+
106
+ &:hover {
107
+ color: var(--color-background-deselected-hover);
108
+ background: var(--color-background-action-hover-weak);
109
+ }
110
+
111
+ &[data-state='open'] {
112
+ transform: rotate($autocomplete-rotation-open);
113
+ color: var(--color-background-deselected-hover);
114
+ background: var(--color-background-action-hover-weak);
115
+ }
116
+
117
+ &:focus-visible {
118
+ outline: $autocomplete-outline-width solid var(--color-focus);
119
+ outline-offset: $autocomplete-outline-offset;
120
+ }
121
+ }
122
+
123
+ .control[data-focus] .trigger {
124
+ color: var(--color-background-deselected-hover);
125
+ background: var(--color-background-action-hover-weak);
126
+ }
127
+
128
+ .positioner {
129
+ z-index: var(--z-index-dropdown, 9999);
130
+ width: var(--reference-width);
131
+ }
132
+
133
+ .content {
134
+ @include dropdown.dropdown-content;
135
+ overflow: hidden;
136
+ animation: expand $autocomplete-animation-duration ease;
137
+ width: 100%;
138
+ min-width: var(--reference-width);
139
+ max-height: $autocomplete-dropdown-max-height;
140
+
141
+ &[data-state='open'] {
142
+ animation: expand $autocomplete-animation-duration ease;
143
+ }
144
+
145
+ &[data-state='closed'] {
146
+ animation: collapse $autocomplete-animation-duration ease;
147
+ }
148
+ }
149
+
150
+ .itemGroup {
151
+ overflow-y: auto;
152
+ overflow-x: hidden;
153
+ max-height: $autocomplete-dropdown-max-height;
154
+ scrollbar-width: thin;
155
+ }
156
+
157
+ .item {
158
+ @include dropdown.dropdown-item;
159
+ display: flex;
160
+ align-items: center;
161
+ gap: var(--spacing-xs);
162
+ height: $autocomplete-item-height;
163
+ min-height: $autocomplete-item-height;
164
+
165
+ &[data-highlighted] {
166
+ background: var(--color-background-secondary-selected-weak);
167
+ }
168
+ }
169
+
170
+ .itemIcon {
171
+ color: var(--color-background-deselected);
172
+ flex-shrink: 0;
173
+ display: flex;
174
+ align-items: center;
175
+ }
176
+
177
+ .itemText {
178
+ flex: 1;
179
+ overflow: hidden;
180
+ text-overflow: ellipsis;
181
+ white-space: nowrap;
182
+
183
+ mark {
184
+ background-color: var(--color-data-yellow);
185
+ color: var(--color-font-main);
186
+ font-weight: var(--font-weight-medium);
187
+ padding: 0;
188
+ border-radius: $autocomplete-highlight-border-radius;
189
+ }
190
+ }
191
+
192
+ .noMatches {
193
+ padding: var(--spacing-xs);
194
+ color: var(--color-font-disabled);
195
+ text-align: center;
196
+ font-size: var(--font-size-sm);
197
+ }
198
+
199
+ .disabled {
200
+ .control {
201
+ color: var(--color-background-deselected);
202
+ background: var(--color-background-secondary);
203
+ border-color: var(--color-border-disabled);
204
+ cursor: not-allowed;
205
+
206
+ .input {
207
+ color: var(--color-font-disabled);
208
+ cursor: not-allowed;
209
+ }
210
+
211
+ .trigger {
212
+ color: var(--color-background-disable);
213
+ cursor: not-allowed;
214
+ background: transparent;
215
+
216
+ &:hover {
217
+ background: transparent;
218
+ color: var(--color-background-disable);
219
+ }
220
+ }
221
+ }
222
+ }
223
+
224
+ .invalid {
225
+ .control {
226
+ border-color: var(--color-background-danger-strong);
227
+
228
+ &:hover,
229
+ &[data-focus] {
230
+ border-color: var(--color-background-danger-strong) !important;
231
+ }
232
+ }
233
+ }
234
+
235
+ @keyframes expand {
236
+ 0% {
237
+ opacity: $autocomplete-opacity-hidden;
238
+ transform: translateY($autocomplete-animation-translate);
239
+ }
240
+
241
+ 100% {
242
+ opacity: $autocomplete-opacity-visible;
243
+ transform: translateY(0);
244
+ }
245
+ }
246
+
247
+ @keyframes collapse {
248
+ 0% {
249
+ opacity: $autocomplete-opacity-visible;
250
+ transform: translateY(0);
251
+ }
252
+
253
+ 100% {
254
+ opacity: $autocomplete-opacity-hidden;
255
+ transform: translateY($autocomplete-animation-translate);
256
+ }
257
+ }
@@ -0,0 +1,130 @@
1
+ import { Combobox, useListCollection } from '@ark-ui/react/combobox';
2
+ import { useFilter } from '@ark-ui/react/locale';
3
+ import { Highlight } from '@ark-ui/react/highlight';
4
+ import { Portal } from '@ark-ui/react/portal';
5
+ import classNames from 'classnames';
6
+ import styles from './ds-autocomplete.module.scss';
7
+ import type { DsAutocompleteProps } from './ds-autocomplete.types';
8
+ import { DsIcon } from '../ds-icon';
9
+
10
+ export const DsAutocomplete = ({
11
+ id,
12
+ options,
13
+ style,
14
+ className,
15
+ placeholder = 'Start typing to search...',
16
+ disabled = false,
17
+ invalid = false,
18
+ onValueChange,
19
+ onInputValueChange,
20
+ noMatchesMessage = 'No matches found',
21
+ highlightMatch = true,
22
+ showTrigger = true,
23
+ startAdornment,
24
+ }: DsAutocompleteProps) => {
25
+ const filterUtils = useFilter({ sensitivity: 'base' });
26
+
27
+ const { collection, filter } = useListCollection({
28
+ initialItems: options.map((opt) => opt.label),
29
+ filter: (item, query) => filterUtils.contains(item, query),
30
+ });
31
+
32
+ const handleInputValueChange = (details: Combobox.InputValueChangeDetails) => {
33
+ filter(details.inputValue);
34
+ onInputValueChange?.(details.inputValue);
35
+ };
36
+
37
+ const handleValueChange = (details: Combobox.ValueChangeDetails) => {
38
+ const selectedLabel = details.value[0];
39
+ if (!selectedLabel) {
40
+ return;
41
+ }
42
+
43
+ const selectedOption = options.find((opt) => opt.label === selectedLabel);
44
+
45
+ if (selectedOption) {
46
+ onValueChange?.(selectedOption.value);
47
+ }
48
+ };
49
+
50
+ const rootClass = classNames(
51
+ styles.root,
52
+ {
53
+ [styles.disabled]: disabled,
54
+ [styles.invalid]: invalid,
55
+ },
56
+ className,
57
+ );
58
+
59
+ return (
60
+ <Combobox.Root
61
+ id={id}
62
+ collection={collection}
63
+ className={rootClass}
64
+ style={style}
65
+ disabled={disabled}
66
+ invalid={invalid}
67
+ onInputValueChange={handleInputValueChange}
68
+ onValueChange={handleValueChange}
69
+ closeOnSelect
70
+ >
71
+ <Combobox.Control className={styles.control}>
72
+ {startAdornment && <span className={styles.startAdornment}>{startAdornment}</span>}
73
+
74
+ <Combobox.Input className={styles.input} placeholder={placeholder} />
75
+
76
+ <Combobox.Context>
77
+ {(context) => (
78
+ <div className={styles.iconContainer}>
79
+ {context.inputValue && !disabled && (
80
+ <Combobox.ClearTrigger className={styles.clearButton} aria-label="Clear">
81
+ <DsIcon icon="close" size="medium" />
82
+ </Combobox.ClearTrigger>
83
+ )}
84
+
85
+ {showTrigger && (
86
+ <Combobox.Trigger className={styles.trigger} aria-label="Toggle dropdown">
87
+ <DsIcon icon="keyboard_arrow_down" size="medium" />
88
+ </Combobox.Trigger>
89
+ )}
90
+ </div>
91
+ )}
92
+ </Combobox.Context>
93
+ </Combobox.Control>
94
+
95
+ <Portal>
96
+ <Combobox.Positioner className={styles.positioner}>
97
+ <Combobox.Content className={styles.content}>
98
+ {collection.items.length === 0 ? (
99
+ <div className={styles.noMatches}>{noMatchesMessage}</div>
100
+ ) : (
101
+ <Combobox.ItemGroup className={styles.itemGroup}>
102
+ <Combobox.Context>
103
+ {(context) =>
104
+ collection.items.map((item) => {
105
+ const option = options.find((opt) => opt.label === item);
106
+ return (
107
+ <Combobox.Item key={item} item={item} className={styles.item}>
108
+ {option?.icon && (
109
+ <DsIcon className={styles.itemIcon} icon={option.icon} aria-hidden="true" />
110
+ )}
111
+ <Combobox.ItemText className={styles.itemText}>
112
+ {highlightMatch ? (
113
+ <Highlight query={context.inputValue} text={item} ignoreCase />
114
+ ) : (
115
+ item
116
+ )}
117
+ </Combobox.ItemText>
118
+ </Combobox.Item>
119
+ );
120
+ })
121
+ }
122
+ </Combobox.Context>
123
+ </Combobox.ItemGroup>
124
+ )}
125
+ </Combobox.Content>
126
+ </Combobox.Positioner>
127
+ </Portal>
128
+ </Combobox.Root>
129
+ );
130
+ };
@@ -0,0 +1,76 @@
1
+ import type React from 'react';
2
+ import type { IconName } from '../ds-icon';
3
+
4
+ export interface DsAutocompleteOption {
5
+ /**
6
+ * Label to display in the autocomplete dropdown
7
+ */
8
+ label: string;
9
+ /**
10
+ * Value to return when the option is selected
11
+ */
12
+ value: string;
13
+ /**
14
+ * Optional icon to display next to the label
15
+ */
16
+ icon?: IconName;
17
+ }
18
+
19
+ export interface DsAutocompleteProps {
20
+ /**
21
+ * Unique identifier for the autocomplete component
22
+ */
23
+ id?: string;
24
+ /**
25
+ * Options to display in the dropdown
26
+ */
27
+ options: DsAutocompleteOption[];
28
+ /**
29
+ * Additional styles to apply to the component
30
+ */
31
+ style?: React.CSSProperties;
32
+ /**
33
+ * Additional CSS class names
34
+ */
35
+ className?: string;
36
+ /**
37
+ * Placeholder text to display when input is empty
38
+ */
39
+ placeholder?: string;
40
+ /**
41
+ * Whether the autocomplete is disabled
42
+ */
43
+ disabled?: boolean;
44
+ /**
45
+ * Whether the autocomplete is in an invalid state
46
+ */
47
+ invalid?: boolean;
48
+ /**
49
+ * Event handler called when the value changes (when an option is selected or custom value is entered)
50
+ */
51
+ onValueChange?: (value: string) => void;
52
+ /**
53
+ * Event handler called when the input value changes (on every keystroke)
54
+ */
55
+ onInputValueChange?: (value: string) => void;
56
+ /**
57
+ * Message to display when no options match the input
58
+ * @default 'No matches found'
59
+ */
60
+ noMatchesMessage?: string;
61
+ /**
62
+ * Whether to highlight the matching text in the dropdown options
63
+ * @default true
64
+ */
65
+ highlightMatch?: boolean;
66
+ /**
67
+ * Whether to show the dropdown trigger (arrow) button.
68
+ * If false, the dropdown will only open on typing.
69
+ * @default true
70
+ */
71
+ showTrigger?: boolean;
72
+ /**
73
+ * Content to display at the start of the input (e.g., a search icon).
74
+ */
75
+ startAdornment?: React.ReactNode;
76
+ }
@@ -0,0 +1,2 @@
1
+ export { DsAutocomplete } from './ds-autocomplete';
2
+ export * from './ds-autocomplete.types';
@@ -1,4 +1,4 @@
1
- @import './mixins';
1
+ @use './mixins' as *;
2
2
 
3
3
  .avatar {
4
4
  display: inline-flex;
@@ -1,4 +1,4 @@
1
- @import '../ds-avatar/mixins';
1
+ @use '../ds-avatar/mixins' as *;
2
2
 
3
3
  .avatarGroup {
4
4
  display: flex;
@@ -1,121 +1,17 @@
1
- import type { CSSProperties, ReactNode } from 'react';
2
- import { Dialog } from '@ark-ui/react/dialog';
3
- import { Portal } from '@ark-ui/react/portal';
4
- import classNames from 'classnames';
5
- import { DsIcon } from '../ds-icon';
1
+ import DsModal from '../ds-modal/ds-modal';
6
2
  import type { DsConfirmationProps } from './ds-confirmation.types';
7
- import styles from './ds-confirmation.module.scss';
8
- import DsTypography from '../ds-typography/ds-typography';
9
3
 
10
4
  /**
11
- * Composable confirmation modal dialog.
5
+ * @deprecated DsConfirmation is deprecated. Use DsModal instead.
6
+ * @see {@link ../ds-modal} for the replacement component.
12
7
  */
13
- export const DsConfirmation = ({ open, onOpenChange, style, className, children }: DsConfirmationProps) => {
14
- const handleOpenChange = (details: { open: boolean }) => {
15
- onOpenChange(details.open);
16
- };
17
-
18
- return (
19
- <Dialog.Root
20
- open={open}
21
- onOpenChange={handleOpenChange}
22
- modal={true}
23
- closeOnEscape={true}
24
- closeOnInteractOutside={true}
25
- >
26
- <Portal>
27
- <Dialog.Backdrop className={styles.overlay} />
28
- <Dialog.Positioner>
29
- <Dialog.Content className={classNames(styles.modal, className)}>
30
- <div style={style} className={styles.content}>
31
- {children}
32
- </div>
33
- </Dialog.Content>
34
- </Dialog.Positioner>
35
- </Portal>
36
- </Dialog.Root>
37
- );
38
- };
39
-
40
- const Header = ({
41
- style,
42
- className,
43
- children,
44
- }: {
45
- style?: CSSProperties;
46
- className?: string;
47
- children: ReactNode;
48
- }) => (
49
- <div style={style} className={classNames(styles.header, className)}>
50
- {children}
51
- </div>
52
- );
53
-
54
- const Title = ({
55
- style,
56
- className,
57
- children,
58
- }: {
59
- style?: CSSProperties;
60
- className?: string;
61
- children: ReactNode;
62
- }) => (
63
- <Dialog.Title className={classNames(styles.title, className)} style={style} asChild>
64
- <DsTypography variant="heading4">{children}</DsTypography>
65
- </Dialog.Title>
66
- );
67
-
68
- const CloseTrigger = ({ style, className }: { style?: CSSProperties; className?: string }) => (
69
- <Dialog.CloseTrigger style={style} className={className}>
70
- <DsIcon icon="close" size="small"></DsIcon>
71
- </Dialog.CloseTrigger>
72
- );
73
-
74
- const Body = ({
75
- style,
76
- className,
77
- children,
78
- }: {
79
- style?: CSSProperties;
80
- className?: string;
81
- children: ReactNode;
82
- }) => (
83
- <div style={style} className={classNames(styles.body, className)}>
84
- {children}
85
- </div>
86
- );
87
-
88
- const Footer = ({
89
- style,
90
- className,
91
- children,
92
- }: {
93
- style?: CSSProperties;
94
- className?: string;
95
- children: ReactNode;
96
- }) => (
97
- <div style={style} className={classNames(styles.footer, className)}>
98
- {children}
99
- </div>
100
- );
101
-
102
- const Actions = ({
103
- style,
104
- className,
105
- children,
106
- }: {
107
- style?: CSSProperties;
108
- className?: string;
109
- children: ReactNode;
110
- }) => (
111
- <div style={style} className={classNames(styles.actions, className)}>
112
- {children}
113
- </div>
8
+ export const DsConfirmation = (props: DsConfirmationProps) => (
9
+ <DsModal columns={4} closeOnEscape closeOnInteractOutside {...props} />
114
10
  );
115
11
 
116
- DsConfirmation.Header = Header;
117
- DsConfirmation.Title = Title;
118
- DsConfirmation.CloseTrigger = CloseTrigger;
119
- DsConfirmation.Body = Body;
120
- DsConfirmation.Footer = Footer;
121
- DsConfirmation.Actions = Actions;
12
+ DsConfirmation.Header = DsModal.Header;
13
+ DsConfirmation.Title = DsModal.Title;
14
+ DsConfirmation.CloseTrigger = DsModal.CloseTrigger;
15
+ DsConfirmation.Body = DsModal.Body;
16
+ DsConfirmation.Footer = DsModal.Footer;
17
+ DsConfirmation.Actions = DsModal.Actions;
@@ -1,7 +1,8 @@
1
1
  import type { CSSProperties, ReactNode } from 'react';
2
2
 
3
3
  /**
4
- * Props for the DsConfirmation component
4
+ * @deprecated DsConfirmationProps is deprecated. Use DsModal with variant="info" instead.
5
+ * @see {@link ../ds-modal/ds-modal} for the replacement.
5
6
  */
6
7
  export interface DsConfirmationProps {
7
8
  /**
@@ -8,7 +8,6 @@
8
8
  max-height: var(--available-height, 400px);
9
9
  overflow-y: auto;
10
10
  width: auto;
11
- z-index: var(--layer-index);
12
11
 
13
12
  &:focus-visible {
14
13
  outline-offset: 2px;