@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
@@ -23,6 +23,9 @@ export interface DsTagProps {
23
23
  * Locale object (you can pass custom strings for localization)
24
24
  */
25
25
  locale?: {
26
+ /**
27
+ * aria-label for the delete button (shown when `onDelete` is provided).
28
+ */
26
29
  deleteAriaLabel?: string;
27
30
  };
28
31
  /**
@@ -58,6 +61,9 @@ export interface DsTagProps {
58
61
  */
59
62
  disabled?: boolean;
60
63
 
64
+ /**
65
+ * Optional render slots for customizing parts of the tag.
66
+ */
61
67
  slots?: {
62
68
  /**
63
69
  * Icon to display at the start of the input
@@ -1,11 +1,11 @@
1
1
  .container {
2
2
  display: flex;
3
3
  flex-direction: column;
4
- gap: var(--spacing-xs);
5
- padding: var(--spacing-xs) var(--spacing-standard);
6
- background: var(--color-background-selected-weak);
7
- border: 1px solid var(--color-outline-weak);
8
- border-radius: var(--spacing-3xs);
4
+ gap: var(--xs);
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
  overflow: hidden;
10
10
 
11
11
  &.expanded {
@@ -17,14 +17,14 @@
17
17
  display: flex;
18
18
  align-items: center;
19
19
  width: 100%;
20
- gap: var(--spacing-xs);
20
+ gap: var(--xs);
21
21
  flex-shrink: 0;
22
22
  }
23
23
 
24
24
  .headerActions {
25
25
  display: flex;
26
26
  align-items: center;
27
- gap: var(--spacing-xs);
27
+ gap: var(--xs);
28
28
  flex-shrink: 0;
29
29
  margin-left: auto;
30
30
  }
@@ -33,12 +33,12 @@
33
33
  display: flex;
34
34
  align-items: center;
35
35
  width: 100%;
36
- gap: var(--spacing-xs);
36
+ gap: var(--xs);
37
37
  flex-wrap: wrap;
38
38
  }
39
39
 
40
40
  .label {
41
- color: var(--color-font-secondary);
41
+ color: var(--font-secondary);
42
42
  white-space: nowrap;
43
43
  flex-shrink: 0;
44
44
  }
@@ -62,7 +62,7 @@
62
62
  pointer-events: none;
63
63
  display: flex;
64
64
  align-items: center;
65
- gap: var(--spacing-xs);
65
+ gap: var(--xs);
66
66
  height: 0;
67
67
  overflow: hidden;
68
68
  position: absolute;
@@ -22,6 +22,10 @@ export interface TagFilterItem {
22
22
  * Additional props to pass to the components
23
23
  */
24
24
  slotProps?: {
25
+ /**
26
+ * Props forwarded to the underlying `DsTag` rendered for this item. Useful
27
+ * for per-item overrides such as `variant` or `size`.
28
+ */
25
29
  tag?: Partial<DsTagProps>;
26
30
  };
27
31
  }
@@ -35,9 +39,21 @@ export interface DsTagFilterProps {
35
39
  * Locale object (you can pass custom strings for localization)
36
40
  */
37
41
  locale?: {
42
+ /**
43
+ * Heading label shown above the tag list (e.g., "Filters").
44
+ */
38
45
  label?: string;
46
+ /**
47
+ * Label for the "Clear all" button.
48
+ */
39
49
  clearButton?: string;
50
+ /**
51
+ * Label for the button that reveals hidden tags when the list overflows.
52
+ */
40
53
  showMore?: string;
54
+ /**
55
+ * Label for the button that collapses the expanded list back to the preview.
56
+ */
41
57
  showLess?: string;
42
58
  };
43
59
  /**
@@ -2,7 +2,7 @@
2
2
 
3
3
  .textInputContainer {
4
4
  @include input.inputContainer;
5
- gap: var(--spacing-xs);
5
+ gap: var(--xs);
6
6
  }
7
7
 
8
8
  .input {
@@ -99,6 +99,9 @@ export interface DsTextInputProps {
99
99
  */
100
100
  tabIndex?: number;
101
101
 
102
+ /**
103
+ * Optional render slots for customizing parts of the input.
104
+ */
102
105
  slots?: {
103
106
  /**
104
107
  * Custom component to wrap the input element
@@ -11,27 +11,27 @@ $time-item-width: 48px;
11
11
  align-items: center;
12
12
  border-radius: 8px;
13
13
  background: transparent;
14
- color: var(--color-font-main);
14
+ color: var(--font-main);
15
15
 
16
16
  &.selected {
17
- background: var(--color-background-selected);
18
- color: var(--color-font-on-action);
17
+ background: var(--background-primary);
18
+ color: var(--font-on-action);
19
19
  }
20
20
 
21
21
  &.disabled {
22
- color: var(--color-font-disabled);
22
+ color: var(--font-disabled);
23
23
  pointer-events: none;
24
24
  }
25
25
 
26
26
  &:not(.selected, .disabled) {
27
27
  &:hover {
28
- border: 1px solid var(--color-border);
29
- background: var(--color-background-action-hover-weak);
28
+ border: 1px solid var(--border);
29
+ background: var(--background-action-hover-weak);
30
30
  }
31
31
 
32
32
  &:focus-visible {
33
- border: 2px solid var(--color-border-action-secondary);
34
- background: var(--color-background-action-hover-weak);
33
+ border: 2px solid var(--border-action-secondary);
34
+ background: var(--background-action-hover-weak);
35
35
  }
36
36
  }
37
37
  }
@@ -1,10 +1,29 @@
1
1
  import type { RefObject } from 'react';
2
2
 
3
3
  export interface TimeItemProps {
4
+ /**
5
+ * Ref forwarded to the item button element
6
+ */
4
7
  ref?: RefObject<HTMLButtonElement | null>;
8
+ /**
9
+ * Additional CSS class name applied to the item button
10
+ */
5
11
  className?: string;
12
+ /**
13
+ * Text displayed in the item button (e.g., "03", "15", "AM").
14
+ */
6
15
  label: string;
16
+ /**
17
+ * Whether this item is the currently selected value on its scroller.
18
+ */
7
19
  selected: boolean;
20
+ /**
21
+ * Whether the item is disabled and cannot be selected.
22
+ * @default false
23
+ */
8
24
  disabled?: boolean;
25
+ /**
26
+ * Called when the item button is clicked.
27
+ */
9
28
  onClick: () => void;
10
29
  }
@@ -3,8 +3,8 @@ $column-max-height: 280px;
3
3
 
4
4
  .container {
5
5
  display: flex;
6
- padding: var(--spacing-xs);
7
- background: var(--color-background);
6
+ padding: var(--xs);
7
+ background: var(--background);
8
8
  box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.22);
9
9
  }
10
10
 
@@ -13,7 +13,7 @@ $column-max-height: 280px;
13
13
  flex-direction: column;
14
14
  align-items: center;
15
15
  width: $column-width;
16
- gap: var(--spacing-xs);
16
+ gap: var(--xs);
17
17
  max-height: $column-max-height;
18
18
  overflow-y: auto;
19
19
  scroll-snap-type: y mandatory;
@@ -1,17 +1,46 @@
1
1
  export type TimePeriod = 'AM' | 'PM';
2
2
 
3
3
  export interface TimeScrollerProps {
4
+ /**
5
+ * Additional CSS class name applied to the scroller wrapper.
6
+ */
4
7
  className?: string;
8
+ /**
9
+ * Whether the parent popover is open. Used to snap the scrollers to their
10
+ * selected values when the popover is shown.
11
+ */
5
12
  open: boolean;
13
+ /**
14
+ * Props for each scroller sub-slot (hour, minute, period).
15
+ */
6
16
  slotProps: {
17
+ /**
18
+ * Hour scroller state and handlers.
19
+ */
7
20
  hour: TimeScrollerSlotProps<number>;
21
+ /**
22
+ * Minute scroller state and handlers.
23
+ */
8
24
  minute: TimeScrollerSlotProps<number>;
25
+ /**
26
+ * AM/PM period scroller state and handlers.
27
+ */
9
28
  period: TimeScrollerSlotProps<TimePeriod>;
10
29
  };
11
30
  }
12
31
 
13
32
  export interface TimeScrollerSlotProps<TValue> {
33
+ /**
34
+ * Currently selected value on this scroller.
35
+ */
14
36
  value?: TValue;
37
+ /**
38
+ * Called when the user changes the selection. Receives the new value.
39
+ */
15
40
  onChange?: (value: TValue) => void;
41
+ /**
42
+ * Predicate that marks a value as disabled. Receives the candidate value and
43
+ * returns `true` to disable selecting it.
44
+ */
16
45
  isDisabled?: (value: TValue) => boolean;
17
46
  }
@@ -1,3 +1,5 @@
1
+ @use '../../styles/shared/dropdown';
2
+
1
3
  .root {
2
4
  &:where(:hover, :focus-within) {
3
5
  .clearTrigger {
@@ -9,3 +11,8 @@
9
11
  .clearTrigger {
10
12
  visibility: hidden;
11
13
  }
14
+
15
+ .content {
16
+ @include dropdown.dropdown-content;
17
+ width: auto;
18
+ }
@@ -25,6 +25,7 @@ const DsTimePicker = (props: DsTimePickerProps) => {
25
25
  disablePortal = false,
26
26
  locale,
27
27
  slotProps,
28
+ onBlur,
28
29
  } = props;
29
30
  const [value, setValue] = useControlled(props.value, props.onChange, props.defaultValue ?? null);
30
31
  const [isOpen, setIsOpen] = useControlled(props.open, props.onOpenChange, props.defaultOpen ?? false);
@@ -84,6 +85,7 @@ const DsTimePicker = (props: DsTimePickerProps) => {
84
85
 
85
86
  if (!inputVal) {
86
87
  setValue(null);
88
+ onBlur?.();
87
89
  return;
88
90
  }
89
91
 
@@ -96,6 +98,8 @@ const DsTimePicker = (props: DsTimePickerProps) => {
96
98
  } else {
97
99
  resetInput();
98
100
  }
101
+
102
+ onBlur?.();
99
103
  };
100
104
 
101
105
  const handleOpenChange = (details: Popover.OpenChangeDetails) => {
@@ -166,7 +170,10 @@ const DsTimePicker = (props: DsTimePickerProps) => {
166
170
 
167
171
  <Wrapper>
168
172
  <Popover.Positioner>
169
- <Popover.Content {...slotProps?.popover}>
173
+ <Popover.Content
174
+ {...slotProps?.popover}
175
+ className={classNames(styles.content, slotProps?.popover?.className)}
176
+ >
170
177
  <TimeScroller open={isOpen} {...timeScrollerAdapter(value, setValue, min, max)} />
171
178
  </Popover.Content>
172
179
  </Popover.Positioner>
@@ -3,22 +3,63 @@ import type { DsTextInputProps } from '../ds-text-input';
3
3
  import type { PopoverContentProps } from '@ark-ui/react/popover';
4
4
 
5
5
  export interface DsTimePickerProps {
6
+ /**
7
+ * Unique identifier for the input field
8
+ */
6
9
  id?: string;
10
+ /**
11
+ * Ref forwarded to the time picker root element
12
+ */
7
13
  ref?: RefObject<HTMLDivElement>;
14
+ /**
15
+ * Additional CSS class name applied to the root element
16
+ */
8
17
  className?: string;
9
18
 
19
+ /**
20
+ * Current selected time (controlled). Use `null` to represent no selection.
21
+ * Pair with `onChange`.
22
+ */
10
23
  value?: Date | null;
24
+ /**
25
+ * Initial time when uncontrolled.
26
+ */
11
27
  defaultValue?: Date;
12
28
 
29
+ /**
30
+ * Whether the popover is open (controlled). Pair with `onOpenChange`.
31
+ */
13
32
  open?: boolean;
33
+ /**
34
+ * Whether the popover is initially open when uncontrolled.
35
+ * @default false
36
+ */
14
37
  defaultOpen?: boolean;
15
38
 
39
+ /**
40
+ * Placeholder text shown in the input when no time is selected.
41
+ */
16
42
  placeholder?: string;
17
43
 
44
+ /**
45
+ * Earliest selectable time. Times before this are disabled.
46
+ */
18
47
  min?: Date;
48
+ /**
49
+ * Latest selectable time. Times after this are disabled.
50
+ */
19
51
  max?: Date;
20
52
 
53
+ /**
54
+ * Whether the picker is disabled and cannot be interacted with.
55
+ * @default false
56
+ */
21
57
  disabled?: boolean;
58
+ /**
59
+ * Whether the picker is read-only. The input is focusable but the value cannot
60
+ * be changed.
61
+ * @default false
62
+ */
22
63
  readOnly?: boolean;
23
64
 
24
65
  /**
@@ -33,22 +74,61 @@ export interface DsTimePickerProps {
33
74
  */
34
75
  disablePortal?: boolean;
35
76
 
77
+ /**
78
+ * Localized labels used in the picker UI and for accessibility.
79
+ */
36
80
  locale?: DsTimePickerLocale;
81
+ /**
82
+ * Props forwarded to the internal input and popover slots.
83
+ */
37
84
  slotProps?: DsTimePickerSlotProps;
38
85
 
86
+ /**
87
+ * Called when the selected time changes. Receives the new Date or `null` when
88
+ * cleared.
89
+ */
39
90
  onChange?: (value: Date | null) => void;
91
+ /**
92
+ * Called when the popover opens or closes. Receives the next `open` state.
93
+ */
40
94
  onOpenChange?: (open: boolean) => void;
95
+
96
+ /**
97
+ * Called when the input is blurred
98
+ */
99
+ onBlur?: () => void;
41
100
  }
42
101
 
43
102
  export interface DsTimePickerLocale {
103
+ /**
104
+ * aria-label for the button that opens the popover
105
+ */
44
106
  openLabel?: string;
107
+ /**
108
+ * aria-label for the clear button
109
+ */
45
110
  clearLabel?: string;
111
+ /**
112
+ * aria-label for the hour scroller
113
+ */
46
114
  hourLabel?: string;
115
+ /**
116
+ * aria-label for the minute scroller
117
+ */
47
118
  minuteLabel?: string;
119
+ /**
120
+ * aria-label for the AM/PM period scroller
121
+ */
48
122
  periodLabel?: string;
49
123
  }
50
124
 
51
125
  export interface DsTimePickerSlotProps {
126
+ /**
127
+ * Props forwarded to the underlying `DsTextInput` that displays the selected time.
128
+ */
52
129
  input?: DsTextInputProps;
130
+ /**
131
+ * Props forwarded to the Ark popover content that hosts the time scrollers.
132
+ */
53
133
  popover?: PopoverContentProps;
54
134
  }
@@ -7,11 +7,11 @@
7
7
  'description description description'
8
8
  'actions actions actions';
9
9
  align-items: start;
10
- padding: var(--spacing-standard);
10
+ padding: var(--standard);
11
11
  border-radius: 4px;
12
- column-gap: var(--spacing-xs);
13
- row-gap: var(--spacing-4xs);
14
- color: var(--color-font-on-action);
12
+ column-gap: var(--xs);
13
+ row-gap: var(--4xs);
14
+ color: var(--font-on-action);
15
15
  box-shadow: 0 1.25px 4px 0 rgba(0, 0, 0, 0.25);
16
16
  // approx. 6 columns (64 * 2)
17
17
  min-width: 384px;
@@ -33,19 +33,19 @@
33
33
  }
34
34
 
35
35
  &[data-type='success'] {
36
- background: var(--color-background-success-strong);
36
+ background: var(--background-success-strong);
37
37
  }
38
38
 
39
39
  &[data-type='info'] {
40
- background: var(--color-background-info-strong);
40
+ background: var(--background-info-strong);
41
41
  }
42
42
 
43
43
  &[data-type='warning'] {
44
- background: var(--color-background-warning-strong);
44
+ background: var(--background-warning-strong);
45
45
  }
46
46
 
47
47
  &[data-type='error'] {
48
- background: var(--color-background-danger-strong);
48
+ background: var(--background-error);
49
49
  }
50
50
 
51
51
  &:not(:has([data-scope='toast'][data-part='title'])) {
@@ -64,7 +64,7 @@
64
64
  display: flex;
65
65
  align-items: center;
66
66
  justify-content: center;
67
- border-radius: var(--spacing-4xs);
67
+ border-radius: var(--4xs);
68
68
 
69
69
  &:hover {
70
70
  background: rgba(0, 0, 0, 0.05);
@@ -86,12 +86,12 @@
86
86
 
87
87
  .icon {
88
88
  grid-area: icon;
89
- color: var(--color-icon-inverse);
89
+ color: var(--icon-inverse);
90
90
  }
91
91
 
92
92
  .actions {
93
93
  grid-area: actions;
94
- margin-top: var(--spacing-sm);
94
+ margin-top: var(--sm);
95
95
  }
96
96
 
97
97
  @media (max-width: 640px) {
@@ -34,15 +34,15 @@
34
34
  height: var(--thumb-size);
35
35
 
36
36
  &[data-state='unchecked'] {
37
- background: var(--color-background-deselected);
37
+ background: var(--background-deselected);
38
38
 
39
39
  &[data-hover] {
40
- background: var(--color-background-deselected-hover);
40
+ background: var(--background-deselected-hover);
41
41
  }
42
42
 
43
43
  &[data-focus-visible] {
44
- outline-color: var(--color-background-action-hover);
45
- background: var(--color-background-deselected-hover);
44
+ outline-color: var(--background-action-hover);
45
+ background: var(--background-deselected-hover);
46
46
  }
47
47
 
48
48
  .iconCheck {
@@ -55,15 +55,15 @@
55
55
  }
56
56
 
57
57
  &[data-state='checked'] {
58
- background: var(--color-background-selected);
58
+ background: var(--background-primary);
59
59
 
60
60
  &[data-hover] {
61
- background: var(--color-background-selected-hover);
61
+ background: var(--background-primary-hover);
62
62
  }
63
63
 
64
64
  &[data-focus-visible] {
65
- outline-color: var(--color-background-selected);
66
- background: var(--color-background-selected-hover);
65
+ outline-color: var(--background-primary);
66
+ background: var(--background-primary-hover);
67
67
  }
68
68
 
69
69
  .iconCheck {
@@ -77,15 +77,15 @@
77
77
 
78
78
  &[data-disabled] {
79
79
  cursor: not-allowed;
80
- background: var(--color-background-disable);
80
+ background: var(--background-disable);
81
81
 
82
82
  &[data-hover] {
83
- background: var(--color-background-deselected-hover);
83
+ background: var(--background-deselected-hover);
84
84
  }
85
85
 
86
86
  &[data-focus-visible] {
87
- outline-color: var(--color-background-action-hover);
88
- background: var(--color-background-deselected-hover);
87
+ outline-color: var(--background-action-hover);
88
+ background: var(--background-deselected-hover);
89
89
  }
90
90
  }
91
91
  }
@@ -94,7 +94,7 @@
94
94
  border-radius: 9999px;
95
95
  position: relative;
96
96
  transition-property: transform;
97
- background: var(--color-background);
97
+ background: var(--background);
98
98
  transition-duration: var(--transition-duration);
99
99
  height: 100%;
100
100
  aspect-ratio: 1/1;
@@ -119,25 +119,25 @@
119
119
  cursor: pointer;
120
120
  display: flex;
121
121
  flex-direction: column;
122
- margin-left: var(--spacing-xs);
122
+ margin-left: var(--xs);
123
123
 
124
124
  .labelInfo {
125
125
  width: 100%;
126
- color: var(--color-font-secondary);
126
+ color: var(--font-secondary);
127
127
  }
128
128
 
129
129
  &[data-disabled] {
130
- color: var(--color-font-disabled);
130
+ color: var(--font-disabled);
131
131
  cursor: default;
132
132
 
133
133
  .labelInfo {
134
- color: var(--color-background-disable);
134
+ color: var(--background-disable);
135
135
  }
136
136
  }
137
137
  }
138
138
 
139
139
  .icon {
140
- color: var(--color-icon-inverse);
140
+ color: var(--icon-inverse);
141
141
  position: absolute;
142
142
  top: 50%;
143
143
  transform: translateY(-50%);
@@ -1,13 +1,13 @@
1
1
  .tooltip {
2
- color: var(--color-font-on-action);
3
- background-color: var(--color-background-brand);
4
- padding: var(--spacing-xs) var(--spacing-sm);
5
- border-radius: var(--exo-spacing-2x-small);
2
+ color: var(--font-on-action);
3
+ background-color: var(--background-brand);
4
+ padding: var(--xs) var(--sm);
5
+ border-radius: var(--3xs);
6
6
  max-width: 384px;
7
7
  overflow-wrap: break-word;
8
8
  z-index: 9999;
9
9
  }
10
10
 
11
11
  .arrow {
12
- fill: var(--neutral-1);
12
+ fill: var(--color-dap-gray-700);
13
13
  }
@@ -9,7 +9,13 @@ export interface DsTooltipProps {
9
9
  * The content to be rendered inside the tooltip
10
10
  */
11
11
  children: ReactNode;
12
+ /**
13
+ * Props forwarded to nested sub-components.
14
+ */
12
15
  slotProps?: {
16
+ /**
17
+ * Props forwarded to the tooltip content popover (className / inline styles).
18
+ */
13
19
  content?: {
14
20
  className?: string;
15
21
  style?: CSSProperties;