@drivenets/design-system 0.9.0 → 0.10.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 (95) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/index.cjs +1076 -600
  3. package/dist/index.d.cts +1988 -528
  4. package/dist/index.d.cts.map +1 -1
  5. package/dist/index.d.ts +1991 -531
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1083 -609
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.min.css +1 -1
  10. package/package.json +16 -17
  11. package/src/components/ds-breadcrumb/ds-breadcrumb.types.ts +40 -6
  12. package/src/components/ds-button/ds-button.types.ts +13 -2
  13. package/src/components/ds-button-v3/ds-button-v3.module.scss +108 -109
  14. package/src/components/ds-button-v3/ds-button-v3.tsx +2 -2
  15. package/src/components/ds-button-v3/ds-button-v3.types.ts +19 -3
  16. package/src/components/ds-button-v3/index.ts +5 -1
  17. package/src/components/ds-card/ds-card.types.ts +3 -1
  18. package/src/components/ds-checkbox/ds-checkbox.module.scss +106 -123
  19. package/src/components/ds-checkbox/ds-checkbox.tsx +24 -35
  20. package/src/components/ds-checkbox/ds-checkbox.types.ts +12 -11
  21. package/src/components/ds-checkbox-group/ds-checkbox-group.module.scss +13 -0
  22. package/src/components/ds-checkbox-group/ds-checkbox-group.tsx +20 -0
  23. package/src/components/ds-checkbox-group/ds-checkbox-group.types.ts +8 -0
  24. package/src/components/ds-checkbox-group/hooks/index.ts +6 -0
  25. package/src/components/ds-checkbox-group/hooks/use-checkbox-select-all.ts +65 -0
  26. package/src/components/ds-checkbox-group/index.ts +3 -0
  27. package/src/components/ds-comment-bubble/components/ds-comment-thread/ds-comment-thread.types.ts +26 -0
  28. package/src/components/ds-comment-bubble/components/ds-thread-item/ds-thread-item.types.ts +38 -0
  29. package/src/components/ds-comment-bubble/ds-comment-bubble.types.ts +78 -0
  30. package/src/components/ds-comment-card/ds-comment-card.module.scss +2 -2
  31. package/src/components/ds-comment-card/ds-comment-card.types.ts +114 -0
  32. package/src/components/ds-comment-indicator/ds-comment-indicator.types.ts +26 -0
  33. package/src/components/ds-comments-drawer/comments-filters.types.ts +33 -0
  34. package/src/components/ds-comments-drawer/components/comments-filter-modal/comments-filter-modal.types.ts +37 -1
  35. package/src/components/ds-comments-drawer/ds-comments-drawer.types.ts +64 -0
  36. package/src/components/ds-date-input/ds-date-input.types.ts +23 -0
  37. package/src/components/ds-date-picker/ds-date-picker.tsx +3 -0
  38. package/src/components/ds-date-picker/ds-date-picker.types.ts +20 -0
  39. package/src/components/ds-date-range-picker/ds-date-range-picker.types.ts +28 -0
  40. package/src/components/ds-dialog/ds-dialog.types.ts +10 -1
  41. package/src/components/ds-dropdown-menu/ds-dropdown-menu.types.ts +24 -0
  42. package/src/components/ds-file-upload/components/file-upload/file-upload.types.ts +1 -0
  43. package/src/components/ds-file-upload/ds-file-upload-api.types.ts +55 -0
  44. package/src/components/ds-form-control/ds-form-control.types.ts +3 -0
  45. package/src/components/ds-grid/ds-grid.tsx +29 -12
  46. package/src/components/ds-grid/ds-grid.types.ts +16 -13
  47. package/src/components/ds-grid/index.ts +10 -2
  48. package/src/components/ds-icon/custom-icons/index.ts +2 -0
  49. package/src/components/ds-icon/custom-icons/special-leading-icon.tsx +11 -0
  50. package/src/components/ds-icon/ds-icon.tsx +10 -4
  51. package/src/components/ds-icon/ds-icon.types.ts +30 -0
  52. package/src/components/ds-key-value-pair/ds-key-value-pair.types.ts +12 -2
  53. package/src/components/ds-modal/ds-modal.types.ts +16 -0
  54. package/src/components/ds-panel/ds-panel.types.ts +39 -0
  55. package/src/components/ds-radio-group/ds-radio-group.module.scss +58 -56
  56. package/src/components/ds-radio-group/ds-radio-group.tsx +35 -28
  57. package/src/components/ds-radio-group/ds-radio-group.types.ts +38 -7
  58. package/src/components/ds-segment-group/ds-segment-group.types.ts +17 -0
  59. package/src/components/ds-select/ds-select.types.ts +32 -0
  60. package/src/components/ds-split-button/ds-split-button.module.scss +7 -7
  61. package/src/components/ds-split-button/ds-split-button.types.ts +28 -0
  62. package/src/components/ds-stack/ds-stack.types.ts +23 -0
  63. package/src/components/ds-stepper/ds-stepper.types.ts +34 -1
  64. package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.types.ts +27 -0
  65. package/src/components/ds-table/components/ds-table-cell/ds-table-cell.tsx +7 -4
  66. package/src/components/ds-table/components/ds-table-cell/ds-table-cell.types.ts +6 -0
  67. package/src/components/ds-table/components/ds-table-row-expandable-cell/ds-table-row-expandable-cell.types.ts +10 -0
  68. package/src/components/ds-table/components/ds-table-row-selectable-cell/ds-table-row-selectable-cell.types.ts +11 -0
  69. package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.types.ts +27 -0
  70. package/src/components/ds-table/filters/types/filter-adapter.types.ts +6 -0
  71. package/src/components/ds-tag/ds-tag.types.ts +6 -0
  72. package/src/components/ds-tag-filter/ds-tag-filter.types.ts +16 -0
  73. package/src/components/ds-text-input/ds-text-input.types.ts +3 -0
  74. package/src/components/ds-time-picker/components/time-item/time-item.types.ts +19 -0
  75. package/src/components/ds-time-picker/components/time-scroller/time-scroller.types.ts +29 -0
  76. package/src/components/ds-time-picker/ds-time-picker.module.scss +7 -0
  77. package/src/components/ds-time-picker/ds-time-picker.tsx +8 -1
  78. package/src/components/ds-time-picker/ds-time-picker.types.ts +80 -0
  79. package/src/components/ds-tooltip/ds-tooltip.types.ts +6 -0
  80. package/src/components/ds-tree/ds-tree.types.ts +86 -4
  81. package/src/components/ds-typography/ds-typography.config.ts +46 -27
  82. package/src/components/ds-typography/ds-typography.tsx +22 -7
  83. package/src/components/ds-typography/ds-typography.types.ts +15 -4
  84. package/src/components/ds-workspace/ds-workspace.module.scss +55 -0
  85. package/src/components/ds-workspace/ds-workspace.tsx +37 -0
  86. package/src/components/ds-workspace/ds-workspace.types.ts +17 -0
  87. package/src/components/ds-workspace/index.ts +8 -0
  88. package/src/index.ts +2 -0
  89. package/src/styles/_grid.scss +7 -3
  90. package/src/styles/_mixin.scss +2 -2
  91. package/src/styles/_root_new.scss +449 -0
  92. package/src/styles/_scrollbars.scss +6 -1
  93. package/src/styles/shared/_input.scss +0 -2
  94. package/src/styles/styles.scss +1 -0
  95. package/src/styles/_root_updated.scss +0 -593
@@ -2,27 +2,105 @@ import type { CSSProperties, ReactNode, Ref } from 'react';
2
2
  import type { CommentAuthor, CommentData } from '../ds-comment-card';
3
3
 
4
4
  export interface DsCommentBubbleProps {
5
+ /**
6
+ * Ref forwarded to the bubble root element
7
+ */
5
8
  ref?: Ref<HTMLDivElement>;
9
+ /**
10
+ * Existing comment thread rendered inside the bubble. Omit to render an empty
11
+ * bubble for composing a new comment.
12
+ */
6
13
  comment?: CommentData;
14
+ /**
15
+ * The user currently viewing the bubble. Used to decide whether thread messages
16
+ * can be edited or deleted by the viewer.
17
+ */
7
18
  currentUser?: CommentAuthor;
19
+ /**
20
+ * Hide the "action required" checkbox and the associated visual highlight.
21
+ * @default false
22
+ */
8
23
  hideActionRequired?: boolean;
24
+ /**
25
+ * Whether the comment is flagged as requiring action. Drives the action-required
26
+ * highlight and the checkbox state.
27
+ * @default false
28
+ */
9
29
  actionRequired?: boolean;
30
+ /**
31
+ * Called when the "action required" checkbox is toggled. Receives the new checked state.
32
+ */
10
33
  onActionRequiredChange?: (checked: boolean) => void;
34
+ /**
35
+ * Current value of the reply / new-comment textarea (controlled)
36
+ */
11
37
  value?: string;
38
+ /**
39
+ * Called whenever the textarea value changes. Receives the new string value.
40
+ */
12
41
  onValueChange?: (value: string) => void;
42
+ /**
43
+ * Called when the user submits the textarea content (clicks send or presses Enter).
44
+ * Receives the message content and the current action-required flag.
45
+ */
13
46
  onSend?: (content: string, actionRequired: boolean) => void;
47
+ /**
48
+ * Called when the bubble should be dismissed (e.g., clicking outside an empty bubble
49
+ * or pressing the close affordance).
50
+ */
14
51
  onClose?: () => void;
52
+ /**
53
+ * Called when the user resolves the top-level comment from the bubble header menu.
54
+ */
15
55
  onResolve?: () => void;
56
+ /**
57
+ * Called when the user toggles the top-level comment's action-required flag from
58
+ * the bubble header menu.
59
+ */
16
60
  onToggleActionRequired?: () => void;
61
+ /**
62
+ * Called when the user forwards the top-level comment from the bubble header menu.
63
+ */
17
64
  onForward?: () => void;
65
+ /**
66
+ * Called when the user marks the top-level comment as unread from the bubble header menu.
67
+ */
18
68
  onMarkUnread?: () => void;
69
+ /**
70
+ * Called when the user copies a link to the top-level comment.
71
+ */
19
72
  onCopyLink?: () => void;
73
+ /**
74
+ * Called when the user deletes the top-level comment.
75
+ */
20
76
  onDelete?: () => void;
77
+ /**
78
+ * Called when a thread message is edited. Receives the message id and the new content.
79
+ */
21
80
  onEditMessage?: (messageId: string, newContent: string) => void;
81
+ /**
82
+ * Called when a thread message is deleted. Receives the message id.
83
+ */
22
84
  onDeleteMessage?: (messageId: string) => void;
85
+ /**
86
+ * Called when a thread message is marked as unread. Receives the message id.
87
+ */
23
88
  onMessageMarkUnread?: (messageId: string) => void;
89
+ /**
90
+ * Called when a thread message is resolved. Receives the message id.
91
+ */
24
92
  onMessageResolved?: (messageId: string) => void;
93
+ /**
94
+ * Optional reference chip shown in the bubble header. A string is rendered as a
95
+ * `DsTag` with a sell icon; any other `ReactNode` is rendered verbatim.
96
+ */
25
97
  referenceTag?: ReactNode;
98
+ /**
99
+ * Additional CSS class name applied to the bubble root
100
+ */
26
101
  className?: string;
102
+ /**
103
+ * Inline styles applied to the bubble root
104
+ */
27
105
  style?: CSSProperties;
28
106
  }
@@ -1,4 +1,4 @@
1
- @import '../../styles/mixin';
1
+ @use '../../styles/mixin' as mixins;
2
2
 
3
3
  $side-color-width: 4px;
4
4
  $border-width: 1px;
@@ -30,7 +30,7 @@ $transition-duration: 0.2s;
30
30
  }
31
31
  }
32
32
 
33
- @include disabled-overlay;
33
+ @include mixins.disabled-overlay;
34
34
  }
35
35
 
36
36
  .sideColor {
@@ -1,45 +1,159 @@
1
1
  import type { CSSProperties, ReactNode, Ref } from 'react';
2
2
 
3
3
  export interface CommentAuthor {
4
+ /**
5
+ * Stable identifier for the user. Used to compare authors (e.g. to determine
6
+ * whether the current viewer can edit a message).
7
+ */
4
8
  id: string;
9
+ /**
10
+ * Display name shown next to the avatar
11
+ */
5
12
  name: string;
13
+ /**
14
+ * Optional URL to the user's avatar image. When omitted, the avatar falls back
15
+ * to initials derived from `name`.
16
+ */
6
17
  avatarSrc?: string;
7
18
  }
8
19
 
9
20
  export interface CommentMessage {
21
+ /**
22
+ * Stable identifier for the message. Passed to callbacks to identify which
23
+ * message was acted on.
24
+ */
10
25
  id: string;
26
+ /**
27
+ * Author of the message
28
+ */
11
29
  author: CommentAuthor;
30
+ /**
31
+ * Text content of the message
32
+ */
12
33
  content: string;
34
+ /**
35
+ * Timestamp when the message was created
36
+ */
13
37
  createdAt: Date;
38
+ /**
39
+ * Whether this message is the first message in a thread (i.e., the top-level
40
+ * comment body). Used to render it differently from replies.
41
+ * @default false
42
+ */
14
43
  isInitialMessage?: boolean;
44
+ /**
45
+ * Whether this message has been marked resolved
46
+ * @default false
47
+ */
15
48
  isResolved?: boolean;
16
49
  }
17
50
 
18
51
  export interface CommentData {
52
+ /**
53
+ * Stable identifier for the comment thread. Passed to drawer/bubble callbacks
54
+ * to identify which comment was acted on.
55
+ */
19
56
  id: string;
57
+ /**
58
+ * Short, user-facing numeric identifier (e.g., "#42") shown in the card header
59
+ * for quick reference in conversations.
60
+ */
20
61
  numericId: number;
62
+ /**
63
+ * Author of the top-level comment
64
+ */
21
65
  author: CommentAuthor;
66
+ /**
67
+ * Timestamp when the top-level comment was created
68
+ */
22
69
  createdAt: Date;
70
+ /**
71
+ * Whether the entire comment thread is resolved. When true, the card is rendered
72
+ * in its resolved (muted) state.
73
+ */
23
74
  isResolved: boolean;
75
+ /**
76
+ * Ordered list of messages in the thread, from oldest to newest. The first
77
+ * message is typically the top-level comment body.
78
+ */
24
79
  messages: CommentMessage[];
80
+ /**
81
+ * Optional tag labels used for filtering and grouping in the comments drawer.
82
+ */
25
83
  labels?: string[];
84
+ /**
85
+ * Optional reference chip shown in the card header. A string renders as a tag;
86
+ * any other `ReactNode` renders verbatim.
87
+ */
26
88
  referenceTag?: ReactNode;
89
+ /**
90
+ * Whether the comment is flagged as requiring action. Drives the action-required
91
+ * highlight.
92
+ * @default false
93
+ */
27
94
  isActionRequired?: boolean;
28
95
  }
29
96
 
30
97
  export interface DsCommentCardProps {
98
+ /**
99
+ * Ref forwarded to the card root button element
100
+ */
31
101
  ref?: Ref<HTMLButtonElement>;
102
+ /**
103
+ * The comment thread rendered by the card
104
+ */
32
105
  comment: CommentData;
106
+ /**
107
+ * Whether the card is disabled and cannot be clicked
108
+ * @default false
109
+ */
33
110
  disabled?: boolean;
111
+ /**
112
+ * How long message content is rendered:
113
+ * - `hidden` (default): truncate to a preview with ellipsis
114
+ * - `displayed`: show the full message content without truncation
115
+ * @default hidden
116
+ */
34
117
  overflow?: 'hidden' | 'displayed';
118
+ /**
119
+ * Called when the card body is clicked (typically opens the thread in a bubble/drawer).
120
+ */
35
121
  onClick?: () => void;
122
+ /**
123
+ * Called when the user resolves the comment from the card's overflow menu.
124
+ */
36
125
  onResolve?: () => void;
126
+ /**
127
+ * Called when the user toggles the comment's action-required flag from the overflow menu.
128
+ */
37
129
  onToggleActionRequired?: () => void;
130
+ /**
131
+ * Called when the user forwards the comment from the overflow menu.
132
+ */
38
133
  onForward?: () => void;
134
+ /**
135
+ * Called when the user marks the comment as unread from the overflow menu.
136
+ */
39
137
  onMarkUnread?: () => void;
138
+ /**
139
+ * Called when the user copies a link to the comment from the overflow menu.
140
+ */
40
141
  onCopyLink?: () => void;
142
+ /**
143
+ * Called when the user deletes the comment from the overflow menu.
144
+ */
41
145
  onDelete?: () => void;
146
+ /**
147
+ * Formatter for the card's timestamp. Receives the `createdAt` Date and returns
148
+ * the string to display. Lets consumers localize or swap the relative/absolute format.
149
+ */
42
150
  formatTimestamp?: (date: Date) => string;
151
+ /**
152
+ * Additional CSS class name applied to the card root
153
+ */
43
154
  className?: string;
155
+ /**
156
+ * Inline styles applied to the card root
157
+ */
44
158
  style?: CSSProperties;
45
159
  }
@@ -3,11 +3,37 @@ import type { CSSProperties, Ref } from 'react';
3
3
  export type CommentIndicatorType = 'placeholder' | 'default' | 'action-required';
4
4
 
5
5
  export interface DsCommentIndicatorProps {
6
+ /**
7
+ * Visual state of the indicator:
8
+ * - `placeholder`: dashed outline for "click here to add a comment" affordances
9
+ * - `default`: filled pin showing an existing comment
10
+ * - `action-required`: emphasized pin for comments flagged as requiring action
11
+ * @default default
12
+ */
6
13
  type?: CommentIndicatorType;
14
+ /**
15
+ * Optional URL to the author's avatar image shown inside the pin
16
+ */
7
17
  avatarSrc?: string;
18
+ /**
19
+ * Author display name used to derive fallback avatar initials when `avatarSrc`
20
+ * is not provided
21
+ */
8
22
  avatarName?: string;
23
+ /**
24
+ * Called when the indicator is clicked (e.g., to open the comment bubble)
25
+ */
9
26
  onClick?: () => void;
27
+ /**
28
+ * Ref forwarded to the indicator root button element
29
+ */
10
30
  ref?: Ref<HTMLButtonElement>;
31
+ /**
32
+ * Additional CSS class name applied to the indicator root
33
+ */
11
34
  className?: string;
35
+ /**
36
+ * Inline styles applied to the indicator root
37
+ */
12
38
  style?: CSSProperties;
13
39
  }
@@ -1,14 +1,47 @@
1
1
  export interface FilterTag {
2
+ /**
3
+ * Stable identifier for the chip, used when removing it from the filter state
4
+ */
2
5
  id: string;
6
+ /**
7
+ * Human-readable label rendered inside the chip
8
+ */
3
9
  label: string;
10
+ /**
11
+ * Identifier of the filter category this chip belongs to (e.g., `authors`,
12
+ * `labels`, `statuses`). Maps to a key on `CommentsFilterState`.
13
+ */
4
14
  filterId: string;
15
+ /**
16
+ * Underlying filter value this chip represents (e.g., an author id or a status
17
+ * value). Used to remove the value from the corresponding array in
18
+ * `CommentsFilterState`.
19
+ */
5
20
  value: string;
6
21
  }
7
22
 
8
23
  export interface CommentsFilterState {
24
+ /**
25
+ * Author ids currently included in the filter. Empty array means no author
26
+ * filter is applied.
27
+ */
9
28
  authors: string[];
29
+ /**
30
+ * Lower bound of the createdAt range as an ISO date string, inclusive.
31
+ */
10
32
  dateFrom?: string;
33
+ /**
34
+ * Upper bound of the createdAt range as an ISO date string, inclusive.
35
+ */
11
36
  dateTo?: string;
37
+ /**
38
+ * Label strings currently included in the filter. Empty array means no label
39
+ * filter is applied.
40
+ */
12
41
  labels: string[];
42
+ /**
43
+ * Status buckets currently included in the filter. Empty array means all
44
+ * statuses are shown.
45
+ */
13
46
  statuses: ('unresolved' | 'resolved' | 'action-required')[];
14
47
  }
@@ -1,12 +1,48 @@
1
1
  import type { CommentsFilterState } from '../../comments-filters.types';
2
2
 
3
3
  export interface CommentsFilterModalProps {
4
+ /**
5
+ * Whether the filter modal is visible
6
+ */
4
7
  open: boolean;
8
+ /**
9
+ * Called when the modal should open or close (e.g., backdrop click, close button,
10
+ * escape key). Receives the next `open` state.
11
+ */
5
12
  onOpenChange: (open: boolean) => void;
13
+ /**
14
+ * Current filter state rendered by the modal inputs (controlled)
15
+ */
6
16
  filters: CommentsFilterState;
17
+ /**
18
+ * Called whenever the user edits a filter input. Receives the next filter state.
19
+ */
7
20
  onFiltersChange: (filters: CommentsFilterState) => void;
21
+ /**
22
+ * Called when the user confirms the current filter state via the Apply button.
23
+ */
8
24
  onApply: () => void;
25
+ /**
26
+ * Called when the user resets all filters via the "Clear all" affordance.
27
+ */
9
28
  onClearAll: () => void;
10
- availableAuthors: Array<{ id: string; name: string }>;
29
+ /**
30
+ * All authors selectable in the "Authors" filter input. Typically derived from
31
+ * the visible comment list.
32
+ */
33
+ availableAuthors: Array<{
34
+ /**
35
+ * Stable author id, used as the filter value.
36
+ */
37
+ id: string;
38
+ /**
39
+ * Display name shown in the filter option.
40
+ */
41
+ name: string;
42
+ }>;
43
+ /**
44
+ * All labels selectable in the "Labels" filter input. Typically derived from
45
+ * the visible comment list.
46
+ */
11
47
  availableLabels: string[];
12
48
  }
@@ -2,22 +2,86 @@ import type { CSSProperties, ReactNode, Ref } from 'react';
2
2
  import type { CommentData } from '../ds-comment-card';
3
3
 
4
4
  export interface DsCommentsDrawerProps {
5
+ /**
6
+ * Ref forwarded to the drawer root element
7
+ */
5
8
  ref?: Ref<HTMLElement>;
9
+ /**
10
+ * Whether the drawer is visible
11
+ */
6
12
  open: boolean;
13
+ /**
14
+ * Called when the drawer should open or close (e.g., backdrop click, close button,
15
+ * escape key). Receives the next `open` state.
16
+ */
7
17
  onOpenChange: (open: boolean) => void;
18
+ /**
19
+ * List of comment threads to render in the drawer
20
+ */
8
21
  comments: CommentData[];
22
+ /**
23
+ * Whether resolved comments are currently included in the visible list.
24
+ * @default false
25
+ */
9
26
  showResolved?: boolean;
27
+ /**
28
+ * Called when the "show resolved" toggle changes. Receives the new boolean value.
29
+ */
10
30
  onShowResolvedChange?: (show: boolean) => void;
31
+ /**
32
+ * Current value of the search input (controlled)
33
+ */
11
34
  searchQuery?: string;
35
+ /**
36
+ * Called when the search query changes. Receives the new query string.
37
+ */
12
38
  onSearchChange?: (query: string) => void;
39
+ /**
40
+ * Called when a comment card is clicked. Receives the full comment so consumers
41
+ * can open the thread in a bubble or scroll to its anchor.
42
+ */
13
43
  onCommentClick?: (comment: CommentData) => void;
44
+ /**
45
+ * Called when a comment is resolved from its card overflow menu. Receives the
46
+ * comment id.
47
+ */
14
48
  onResolveComment?: (commentId: string) => void;
49
+ /**
50
+ * Called when a comment's action-required flag is toggled from its card overflow
51
+ * menu. Receives the comment id.
52
+ */
15
53
  onToggleActionRequired?: (commentId: string) => void;
54
+ /**
55
+ * Called when a comment is forwarded from its card overflow menu. Receives the
56
+ * comment id.
57
+ */
16
58
  onForward?: (commentId: string) => void;
59
+ /**
60
+ * Called when a comment is marked as unread from its card overflow menu. Receives
61
+ * the comment id.
62
+ */
17
63
  onMarkUnread?: (commentId: string) => void;
64
+ /**
65
+ * Called when a link to the comment is copied from its card overflow menu.
66
+ * Receives the comment id.
67
+ */
18
68
  onCopyLink?: (commentId: string) => void;
69
+ /**
70
+ * Called when a comment is deleted from its card overflow menu. Receives the
71
+ * comment id.
72
+ */
19
73
  onDelete?: (commentId: string) => void;
74
+ /**
75
+ * Custom empty-state content shown when the comments list is empty after
76
+ * applying filters and search. Defaults to a built-in placeholder when omitted.
77
+ */
20
78
  noCommentsMessage?: ReactNode;
79
+ /**
80
+ * Additional CSS class name applied to the drawer root
81
+ */
21
82
  className?: string;
83
+ /**
84
+ * Inline styles applied to the drawer root
85
+ */
22
86
  style?: CSSProperties;
23
87
  }
@@ -63,6 +63,29 @@ type DsDateInputBaseProps = Pick<
63
63
  DatePickerRootProps,
64
64
  'disabled' | 'readOnly' | 'id' | 'open' | 'name' | 'style'
65
65
  > & {
66
+ /**
67
+ * Unique identifier for the input field
68
+ */
69
+ id?: string;
70
+ /**
71
+ * HTML name attribute for the input field, used in form submissions
72
+ */
73
+ name?: string;
74
+ /**
75
+ * Whether the input is disabled and cannot be interacted with
76
+ * @default false
77
+ */
78
+ disabled?: boolean;
79
+ /**
80
+ * Whether the input is read-only. The field is focusable but the value cannot
81
+ * be changed.
82
+ * @default false
83
+ */
84
+ readOnly?: boolean;
85
+ /**
86
+ * Whether the calendar popover is open (controlled). Pair with `onOpenChange`.
87
+ */
88
+ open?: boolean;
66
89
  /**
67
90
  * Callback when the open state changes
68
91
  * @param open - Whether the calendar is open
@@ -31,6 +31,7 @@ const DsDatePicker = ({
31
31
  slotProps,
32
32
  onChange,
33
33
  onOpenChange,
34
+ onBlur,
34
35
  value: _value,
35
36
  defaultValue: _defaultValue,
36
37
  min: _min,
@@ -97,6 +98,8 @@ const DsDatePicker = ({
97
98
  } else {
98
99
  resetInput();
99
100
  }
101
+
102
+ onBlur?.();
100
103
  };
101
104
 
102
105
  const showClearButton = !hideClearButton && !disabled && !readOnly && !!value;
@@ -3,13 +3,28 @@ import type { DsTextInputProps } from '../ds-text-input';
3
3
  import type { DsTimePickerProps } from '../ds-time-picker';
4
4
 
5
5
  export interface DsDatePickerLocale {
6
+ /**
7
+ * aria-label for the button that opens the calendar popover
8
+ */
6
9
  openCalendarLabel?: string;
10
+ /**
11
+ * aria-label for the button that reveals the time picker when `withTime` is set
12
+ */
7
13
  timeTriggerLabel?: string;
14
+ /**
15
+ * aria-label for the clear button
16
+ */
8
17
  clearLabel?: string;
9
18
  }
10
19
 
11
20
  export interface DsDatePickerSlotProps {
21
+ /**
22
+ * Props forwarded to the underlying `DsTextInput` that displays the selected date.
23
+ */
12
24
  input?: DsTextInputProps;
25
+ /**
26
+ * Props forwarded to the nested `DsTimePicker` rendered when `withTime` is set.
27
+ */
13
28
  timePicker?: DsTimePickerProps;
14
29
  }
15
30
 
@@ -40,6 +55,11 @@ export interface DsDatePickerProps extends Pick<
40
55
  */
41
56
  onOpenChange?: (open: boolean) => void;
42
57
 
58
+ /**
59
+ * Callback when the input is blurred
60
+ */
61
+ onBlur?: () => void;
62
+
43
63
  /**
44
64
  * Minimum allowed datetime as Date object
45
65
  */
@@ -7,15 +7,31 @@ export const dateRangePickerOrientations = ['horizontal', 'vertical'] as const;
7
7
  export type DateRangePickerOrientation = (typeof dateRangePickerOrientations)[number];
8
8
 
9
9
  export interface DsDateRangePickerLocale {
10
+ /**
11
+ * Label shown on the "Clear all" button.
12
+ */
10
13
  clearAllLabel?: string;
11
14
  }
12
15
 
13
16
  export type DateRangeFormControlSlotProps = Partial<Omit<DsFormControlProps, 'children'>>;
14
17
 
15
18
  export interface DsDateRangePickerSlotProps {
19
+ /**
20
+ * Props forwarded to the start-date `DsDatePicker`.
21
+ */
16
22
  startDatePicker?: DsDatePickerProps;
23
+ /**
24
+ * Props forwarded to the end-date `DsDatePicker`.
25
+ */
17
26
  endDatePicker?: DsDatePickerProps;
27
+ /**
28
+ * Props forwarded to the `DsFormControl` wrapping the start-date picker
29
+ * (e.g., to set a label or helper text).
30
+ */
18
31
  startDateFormControl?: DateRangeFormControlSlotProps;
32
+ /**
33
+ * Props forwarded to the `DsFormControl` wrapping the end-date picker.
34
+ */
19
35
  endDateFormControl?: DateRangeFormControlSlotProps;
20
36
  }
21
37
 
@@ -71,10 +87,22 @@ export interface DsDateRangePickerProps {
71
87
  */
72
88
  closeOnSelect?: boolean;
73
89
 
90
+ /**
91
+ * Whether both pickers are disabled.
92
+ * @default false
93
+ */
74
94
  disabled?: boolean;
75
95
 
96
+ /**
97
+ * Whether both pickers are read-only. Inputs are focusable but values cannot
98
+ * be changed.
99
+ * @default false
100
+ */
76
101
  readOnly?: boolean;
77
102
 
103
+ /**
104
+ * Additional CSS class name applied to the range picker wrapper.
105
+ */
78
106
  className?: string;
79
107
 
80
108
  /**
@@ -40,7 +40,16 @@ export interface DsDialogProps {
40
40
  /**
41
41
  * Custom fixed position (e.g., { top: number, left: number })
42
42
  */
43
- customPosition?: { top: number; left: number };
43
+ customPosition?: {
44
+ /**
45
+ * Distance in pixels from the top of the viewport.
46
+ */
47
+ top: number;
48
+ /**
49
+ * Distance in pixels from the left of the viewport.
50
+ */
51
+ left: number;
52
+ };
44
53
  /**
45
54
  * If true, show modal overlay and center dialog (default: true)
46
55
  */
@@ -162,6 +162,30 @@ export interface DsDropdownMenuItemProps extends Pick<
162
162
  Menu.ItemProps,
163
163
  'disabled' | 'asChild' | 'className' | 'style' | 'onSelect' | 'onClick' | 'value' | 'children'
164
164
  > {
165
+ /**
166
+ * Underlying value reported to the root's `onSelect` when this item is chosen.
167
+ */
168
+ value: Menu.ItemProps['value'];
169
+ /**
170
+ * Whether this item is disabled and cannot be selected.
171
+ * @default false
172
+ */
173
+ disabled?: Menu.ItemProps['disabled'];
174
+ /**
175
+ * Render the item as its direct child via Radix-style slot forwarding. Useful
176
+ * for wrapping links (`<a>`) as dropdown items.
177
+ * @default false
178
+ */
179
+ asChild?: Menu.ItemProps['asChild'];
180
+ /**
181
+ * Called when the item is selected via click or keyboard activation.
182
+ */
183
+ onSelect?: Menu.ItemProps['onSelect'];
184
+ /**
185
+ * Called when the item is clicked. Fires before `onSelect` and runs even when
186
+ * keyboard-activated via Space/Enter.
187
+ */
188
+ onClick?: Menu.ItemProps['onClick'];
165
189
  /**
166
190
  * Whether the item is selected (applies selected styling)
167
191
  */