@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
@@ -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
  }
@@ -14,9 +14,9 @@ $transition-duration: 0.2s;
14
14
  width: $indicator-size;
15
15
  height: $indicator-size;
16
16
  padding: 0;
17
- border: $border-width solid var(--color-border);
18
- border-radius: var(--spacing-standard) var(--spacing-standard) var(--spacing-standard) 0;
19
- background: var(--color-background);
17
+ border: $border-width solid var(--border);
18
+ border-radius: var(--standard) var(--standard) var(--standard) 0;
19
+ background: var(--background);
20
20
  box-shadow: 0 5px 15px 0 rgba(0, 0, 0, 0.15);
21
21
  cursor: pointer;
22
22
  transition:
@@ -29,8 +29,8 @@ $transition-duration: 0.2s;
29
29
  }
30
30
 
31
31
  &:not(.actionRequired):hover {
32
- background: var(--color-background-secondary);
33
- border-color: var(--color-border-action-secondary-hover);
32
+ background: var(--background-secondary);
33
+ border-color: var(--border-action-secondary-hover);
34
34
  }
35
35
  }
36
36
 
@@ -44,16 +44,16 @@ $transition-duration: 0.2s;
44
44
  font-size: $plus-icon-font-size;
45
45
  font-weight: var(--font-weight-semi-bold);
46
46
  line-height: 0;
47
- color: var(--color-font-main);
47
+ color: var(--font-main);
48
48
  }
49
49
  }
50
50
 
51
51
  .actionRequired {
52
- background: var(--color-background-warning-strong);
52
+ background: var(--background-warning-strong);
53
53
 
54
54
  &:hover {
55
- background: var(--color-background-danger-strong-hover);
56
- border-color: var(--color-border-action-secondary-hover);
55
+ background: var(--background-error-hover);
56
+ border-color: var(--border-action-secondary-hover);
57
57
  }
58
58
  }
59
59
 
@@ -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
  }
@@ -6,13 +6,13 @@
6
6
  display: flex;
7
7
  justify-content: space-between;
8
8
  align-items: center;
9
- gap: var(--spacing-sm);
9
+ gap: var(--sm);
10
10
  }
11
11
 
12
12
  .headerLeft {
13
13
  display: flex;
14
14
  align-items: center;
15
- gap: var(--spacing-sm);
15
+ gap: var(--sm);
16
16
  }
17
17
 
18
18
  .body {
@@ -30,17 +30,17 @@
30
30
  .tabList {
31
31
  flex-shrink: 0;
32
32
  width: 200px;
33
- border-right: 1px solid var(--color-border-secondary);
33
+ border-right: 1px solid var(--border-secondary);
34
34
  display: flex;
35
35
  flex-direction: column;
36
- gap: var(--spacing-3xs);
37
- padding: var(--spacing-sm);
36
+ gap: var(--3xs);
37
+ padding: var(--sm);
38
38
  }
39
39
 
40
40
  .tabContent {
41
41
  flex: 1;
42
42
  overflow-y: auto;
43
- padding: var(--spacing-standard);
43
+ padding: var(--standard);
44
44
 
45
45
  &[hidden] {
46
46
  display: none;
@@ -54,7 +54,7 @@
54
54
  .badge {
55
55
  display: flex;
56
56
  align-items: center;
57
- gap: var(--spacing-3xs);
57
+ gap: var(--3xs);
58
58
  margin-left: auto;
59
59
  }
60
60
 
@@ -68,13 +68,13 @@
68
68
  .filterSection {
69
69
  display: flex;
70
70
  flex-direction: column;
71
- gap: var(--spacing-sm);
71
+ gap: var(--sm);
72
72
  }
73
73
 
74
74
  .dateField {
75
75
  display: flex;
76
76
  flex-direction: column;
77
- gap: var(--spacing-xs);
77
+ gap: var(--xs);
78
78
  }
79
79
 
80
80
  .dateLabel {
@@ -82,7 +82,7 @@
82
82
  }
83
83
 
84
84
  .emptyMessage {
85
- color: var(--color-font-secondary);
85
+ color: var(--font-secondary);
86
86
  }
87
87
 
88
88
  .footer {
@@ -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
  }
@@ -6,13 +6,13 @@ $scrollbar-border-radius-pill: 9999px;
6
6
  .headerActions {
7
7
  display: flex;
8
8
  align-items: center;
9
- gap: var(--spacing-xs);
9
+ gap: var(--xs);
10
10
  }
11
11
 
12
12
  .divider {
13
13
  width: $divider-width;
14
14
  height: $divider-height;
15
- background: var(--color-border-secondary);
15
+ background: var(--border-secondary);
16
16
  }
17
17
 
18
18
  .searchInput {
@@ -22,8 +22,8 @@ $scrollbar-border-radius-pill: 9999px;
22
22
  .body {
23
23
  display: flex;
24
24
  flex-direction: column;
25
- gap: var(--spacing-standard);
26
- padding: var(--spacing-standard);
25
+ gap: var(--standard);
26
+ padding: var(--standard);
27
27
  overflow-y: auto;
28
28
 
29
29
  &::-webkit-scrollbar {
@@ -35,7 +35,7 @@ $scrollbar-border-radius-pill: 9999px;
35
35
  }
36
36
 
37
37
  &::-webkit-scrollbar-thumb {
38
- background: var(--color-background-tertiary);
38
+ background: var(--background-tertiary);
39
39
  border-radius: $scrollbar-border-radius-pill;
40
40
  }
41
41
  }
@@ -45,16 +45,16 @@ $scrollbar-border-radius-pill: 9999px;
45
45
  flex-direction: column;
46
46
  align-items: center;
47
47
  justify-content: center;
48
- padding: var(--spacing-xl);
48
+ padding: var(--xl);
49
49
  text-align: center;
50
- color: var(--color-font-secondary);
51
- font-size: var(--font-size-sm);
52
- line-height: var(--line-height-sm);
53
- gap: var(--spacing-sm);
50
+ color: var(--font-secondary);
51
+ font-size: var(--body-font-size-sm);
52
+ line-height: var(--body-line-height-small);
53
+ gap: var(--sm);
54
54
  }
55
55
 
56
56
  .emptyIcon {
57
- color: var(--color-icon-secondary);
57
+ color: var(--icon-action-secondary);
58
58
  }
59
59
 
60
60
  .filterTagsToolbar {
@@ -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
  }