@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.
- package/CHANGELOG.md +33 -0
- package/dist/index.cjs +1182 -716
- package/dist/index.d.cts +1806 -636
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1809 -639
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1189 -726
- package/dist/index.js.map +1 -1
- package/dist/index.min.css +1 -1
- package/package.json +11 -13
- package/src/components/ds-alert-banner/ds-alert-banner.module.scss +25 -25
- package/src/components/ds-autocomplete/ds-autocomplete.module.scss +29 -29
- package/src/components/ds-avatar/_mixins.scss +7 -7
- package/src/components/ds-avatar/ds-avatar.module.scss +2 -2
- package/src/components/ds-avatar-group/ds-avatar-group.module.scss +6 -6
- package/src/components/ds-breadcrumb/ds-breadcrumb.module.scss +14 -14
- package/src/components/ds-breadcrumb/ds-breadcrumb.types.ts +40 -6
- package/src/components/ds-button/ds-button.types.ts +13 -2
- package/src/components/ds-button/versions/ds-button-legacy/ds-button-legacy.module.scss +17 -17
- package/src/components/ds-button/versions/ds-button-new/ds-button-new.module.scss +135 -135
- package/src/components/ds-button-v3/ds-button-v3.module.scss +113 -114
- package/src/components/ds-button-v3/ds-button-v3.types.ts +7 -0
- package/src/components/ds-card/ds-card.module.scss +12 -12
- package/src/components/ds-card/ds-card.types.ts +3 -1
- package/src/components/ds-checkbox/ds-checkbox.module.scss +106 -123
- package/src/components/ds-checkbox/ds-checkbox.tsx +24 -35
- package/src/components/ds-checkbox/ds-checkbox.types.ts +12 -11
- package/src/components/ds-checkbox-group/ds-checkbox-group.module.scss +13 -0
- package/src/components/ds-checkbox-group/ds-checkbox-group.tsx +20 -0
- package/src/components/ds-checkbox-group/ds-checkbox-group.types.ts +8 -0
- package/src/components/ds-checkbox-group/hooks/index.ts +6 -0
- package/src/components/ds-checkbox-group/hooks/use-checkbox-select-all.ts +65 -0
- package/src/components/ds-checkbox-group/index.ts +3 -0
- package/src/components/ds-chip/ds-chip.module.scss +17 -17
- package/src/components/ds-chip-group/ds-chip-group.module.scss +12 -12
- package/src/components/ds-comment-bubble/components/ds-comment-thread/ds-comment-thread.module.scss +3 -3
- package/src/components/ds-comment-bubble/components/ds-comment-thread/ds-comment-thread.types.ts +26 -0
- package/src/components/ds-comment-bubble/components/ds-thread-item/ds-thread-item.module.scss +18 -18
- package/src/components/ds-comment-bubble/components/ds-thread-item/ds-thread-item.types.ts +38 -0
- package/src/components/ds-comment-bubble/ds-comment-bubble.module.scss +43 -43
- package/src/components/ds-comment-bubble/ds-comment-bubble.types.ts +78 -0
- package/src/components/ds-comment-card/ds-comment-card.module.scss +34 -34
- package/src/components/ds-comment-card/ds-comment-card.types.ts +114 -0
- package/src/components/ds-comment-indicator/ds-comment-indicator.module.scss +9 -9
- package/src/components/ds-comment-indicator/ds-comment-indicator.types.ts +26 -0
- package/src/components/ds-comments-drawer/comments-filters.types.ts +33 -0
- package/src/components/ds-comments-drawer/components/comments-filter-modal/comments-filter-modal.module.scss +10 -10
- package/src/components/ds-comments-drawer/components/comments-filter-modal/comments-filter-modal.types.ts +37 -1
- package/src/components/ds-comments-drawer/ds-comments-drawer.module.scss +11 -11
- package/src/components/ds-comments-drawer/ds-comments-drawer.types.ts +64 -0
- package/src/components/ds-date-input/ds-date-input.module.scss +42 -42
- package/src/components/ds-date-input/ds-date-input.types.ts +23 -0
- package/src/components/ds-date-picker/components/calendar-table.module.scss +17 -17
- package/src/components/ds-date-picker/components/calendar-view-control/calendar-view-control.module.scss +8 -8
- package/src/components/ds-date-picker/components/day-view/day-view.module.scss +1 -1
- package/src/components/ds-date-picker/ds-date-picker.module.scss +1 -1
- package/src/components/ds-date-picker/ds-date-picker.tsx +3 -0
- package/src/components/ds-date-picker/ds-date-picker.types.ts +20 -0
- package/src/components/ds-date-range-picker/ds-date-range-picker.module.scss +1 -1
- package/src/components/ds-date-range-picker/ds-date-range-picker.types.ts +28 -0
- package/src/components/ds-dialog/ds-dialog.module.scss +3 -3
- package/src/components/ds-dialog/ds-dialog.types.ts +10 -1
- package/src/components/ds-divider/ds-divider.module.scss +1 -1
- package/src/components/ds-drawer/ds-drawer.module.scss +12 -12
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.module.scss +22 -14
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.tsx +2 -0
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.types.ts +33 -0
- package/src/components/ds-expandable-text-input/ds-expandable-text-input.module.scss +1 -1
- package/src/components/ds-file-upload/components/file-upload/file-upload.module.scss +22 -22
- package/src/components/ds-file-upload/components/file-upload/file-upload.types.ts +1 -0
- package/src/components/ds-file-upload/components/file-upload-item/file-upload-item.module.scss +23 -23
- package/src/components/ds-file-upload/ds-file-upload-api.types.ts +55 -0
- package/src/components/ds-filter-status-icon/ds-filter-status-icon.module.scss +5 -5
- package/src/components/ds-form-control/ds-form-control.module.scss +13 -13
- package/src/components/ds-form-control/ds-form-control.types.ts +3 -0
- package/src/components/ds-grid/ds-grid.tsx +29 -12
- package/src/components/ds-grid/ds-grid.types.ts +16 -13
- package/src/components/ds-grid/index.ts +10 -2
- package/src/components/ds-icon/custom-icons/index.ts +2 -0
- package/src/components/ds-icon/custom-icons/special-leading-icon.tsx +11 -0
- package/src/components/ds-icon/ds-icon.module.scss +8 -0
- package/src/components/ds-icon/ds-icon.tsx +10 -4
- package/src/components/ds-icon/ds-icon.types.ts +30 -0
- package/src/components/ds-key-value-pair/ds-key-value-pair.module.scss +7 -7
- package/src/components/ds-key-value-pair/ds-key-value-pair.types.ts +12 -2
- package/src/components/ds-modal/ds-modal.module.scss +9 -9
- package/src/components/ds-modal/ds-modal.types.ts +16 -0
- package/src/components/ds-panel/ds-panel.module.scss +16 -16
- package/src/components/ds-panel/ds-panel.types.ts +39 -0
- package/src/components/ds-popover/ds-popover.module.scss +2 -2
- package/src/components/ds-progress-arc/ds-progress-arc.module.scss +7 -7
- package/src/components/ds-progress-donut/ds-progress-donut.module.scss +7 -7
- package/src/components/ds-progress-linear/ds-progress-linear.module.scss +15 -15
- package/src/components/ds-radio-group/ds-radio-group.module.scss +58 -56
- package/src/components/ds-radio-group/ds-radio-group.tsx +35 -28
- package/src/components/ds-radio-group/ds-radio-group.types.ts +38 -7
- package/src/components/ds-segment-group/ds-segment-group.module.scss +18 -18
- package/src/components/ds-segment-group/ds-segment-group.types.ts +17 -0
- package/src/components/ds-select/ds-select.module.scss +8 -8
- package/src/components/ds-select/ds-select.types.ts +32 -0
- package/src/components/ds-skeleton/ds-skeleton.module.scss +1 -1
- package/src/components/ds-smart-tabs/ds-smart-tabs.module.scss +12 -12
- package/src/components/ds-smart-tabs/ds-smart-tabs.tsx +9 -9
- package/src/components/ds-spinner/ds-spinner.module.scss +1 -1
- package/src/components/ds-split-button/ds-split-button.module.scss +7 -7
- package/src/components/ds-split-button/ds-split-button.types.ts +28 -0
- package/src/components/ds-stack/ds-stack.types.ts +23 -0
- package/src/components/ds-status-badge/ds-status-badge.module.scss +21 -25
- package/src/components/ds-stepper/ds-stepper.module.scss +55 -55
- package/src/components/ds-stepper/ds-stepper.types.ts +34 -1
- package/src/components/ds-system-status/ds-system-status.module.scss +22 -22
- package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.types.ts +27 -0
- package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.module.scss +9 -9
- package/src/components/ds-table/components/ds-table-cell/ds-table-cell.module.scss +4 -4
- package/src/components/ds-table/components/ds-table-header/ds-table-header.module.scss +5 -10
- package/src/components/ds-table/components/ds-table-header/ds-table-header.tsx +6 -9
- package/src/components/ds-table/components/ds-table-row/ds-table-row.module.scss +13 -22
- package/src/components/ds-table/components/ds-table-row/ds-table-row.tsx +11 -18
- package/src/components/ds-table/components/ds-table-row-expandable-cell/ds-table-row-expandable-cell.module.scss +0 -7
- package/src/components/ds-table/components/ds-table-row-expandable-cell/ds-table-row-expandable-cell.tsx +19 -28
- package/src/components/ds-table/components/ds-table-row-expandable-cell/ds-table-row-expandable-cell.types.ts +7 -1
- package/src/components/ds-table/components/ds-table-row-selectable-cell/ds-table-row-selectable-cell.tsx +3 -8
- package/src/components/ds-table/components/ds-table-row-selectable-cell/ds-table-row-selectable-cell.types.ts +11 -0
- package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.module.scss +15 -11
- package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.tsx +9 -4
- package/src/components/ds-table/components/ds-table-row-virtualized/ds-table-row-virtualized.types.ts +27 -0
- package/src/components/ds-table/ds-table.module.scss +9 -2
- package/src/components/ds-table/ds-table.tsx +26 -4
- package/src/components/ds-table/filters/components/range-filter/range-filter.module.scss +1 -1
- package/src/components/ds-table/filters/types/filter-adapter.types.ts +6 -0
- package/src/components/ds-table/styles/_mixins.scss +1 -1
- package/src/components/ds-table/styles/_variables.scss +5 -6
- package/src/components/ds-table/utils/constants.ts +10 -0
- package/src/components/ds-tabs/components/ds-tabs-content/ds-tabs-content.module.scss +1 -1
- package/src/components/ds-tabs/components/ds-tabs-list/ds-tabs-indicator.module.scss +1 -1
- package/src/components/ds-tabs/components/ds-tabs-list/ds-tabs-list.module.scss +3 -3
- package/src/components/ds-tabs/components/ds-tabs-tab/ds-tabs-tab.module.scss +55 -55
- package/src/components/ds-tabs/ds-tabs.module.scss +1 -1
- package/src/components/ds-tag/ds-tag.module.scss +22 -22
- package/src/components/ds-tag/ds-tag.types.ts +6 -0
- package/src/components/ds-tag-filter/ds-tag-filter.module.scss +10 -10
- package/src/components/ds-tag-filter/ds-tag-filter.types.ts +16 -0
- package/src/components/ds-text-input/ds-text-input.module.scss +1 -1
- package/src/components/ds-text-input/ds-text-input.types.ts +3 -0
- package/src/components/ds-time-picker/components/time-item/time-item.module.scss +8 -8
- package/src/components/ds-time-picker/components/time-item/time-item.types.ts +19 -0
- package/src/components/ds-time-picker/components/time-scroller/time-scroller.module.scss +3 -3
- package/src/components/ds-time-picker/components/time-scroller/time-scroller.types.ts +29 -0
- package/src/components/ds-time-picker/ds-time-picker.module.scss +7 -0
- package/src/components/ds-time-picker/ds-time-picker.tsx +8 -1
- package/src/components/ds-time-picker/ds-time-picker.types.ts +80 -0
- package/src/components/ds-toast/ds-toast.module.scss +11 -11
- package/src/components/ds-toggle/ds-toggle.module.scss +18 -18
- package/src/components/ds-tooltip/ds-tooltip.module.scss +5 -5
- package/src/components/ds-tooltip/ds-tooltip.types.ts +6 -0
- package/src/components/ds-tree/ds-tree.module.scss +27 -27
- package/src/components/ds-tree/ds-tree.types.ts +84 -2
- package/src/components/ds-typography/ds-typography.config.ts +46 -27
- package/src/components/ds-typography/ds-typography.tsx +22 -7
- package/src/components/ds-typography/ds-typography.types.ts +15 -4
- package/src/components/ds-vertical-tabs/ds-vertical-tabs.module.scss +13 -13
- package/src/components/ds-workspace/ds-workspace.module.scss +55 -0
- package/src/components/ds-workspace/ds-workspace.tsx +37 -0
- package/src/components/ds-workspace/ds-workspace.types.ts +17 -0
- package/src/components/ds-workspace/index.ts +8 -0
- package/src/index.ts +2 -0
- package/src/styles/_grid.scss +2 -2
- package/src/styles/_root.scss +0 -18
- package/src/styles/_root_new.scss +449 -0
- package/src/styles/_scrollbars.scss +5 -5
- package/src/styles/_typography.scss +18 -14
- package/src/styles/mixins/_list.scss +8 -8
- package/src/styles/shared/_dropdown.scss +9 -9
- package/src/styles/shared/_input.scss +47 -49
- package/src/styles/styles.scss +1 -0
- package/src/styles/_root_updated.scss +0 -593
package/src/components/ds-comment-bubble/components/ds-comment-thread/ds-comment-thread.types.ts
CHANGED
|
@@ -1,12 +1,38 @@
|
|
|
1
1
|
import type { CommentMessage, CommentAuthor } from '../../../ds-comment-card';
|
|
2
2
|
|
|
3
3
|
export interface DsCommentThreadProps {
|
|
4
|
+
/**
|
|
5
|
+
* Ordered list of messages in the thread, from oldest to newest.
|
|
6
|
+
*/
|
|
4
7
|
messages: CommentMessage[];
|
|
8
|
+
/**
|
|
9
|
+
* Author of the top-level comment. Used to visually distinguish their messages
|
|
10
|
+
* from replies by other participants.
|
|
11
|
+
*/
|
|
5
12
|
commentAuthor: CommentAuthor;
|
|
13
|
+
/**
|
|
14
|
+
* The user currently viewing the thread. Used to decide which messages the viewer
|
|
15
|
+
* can edit or delete.
|
|
16
|
+
*/
|
|
6
17
|
currentUser?: CommentAuthor;
|
|
18
|
+
/**
|
|
19
|
+
* Called when a message is edited. Receives the message id and the new content.
|
|
20
|
+
*/
|
|
7
21
|
onEditMessage?: (messageId: string, newContent: string) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Called when a message is deleted. Receives the message id.
|
|
24
|
+
*/
|
|
8
25
|
onDeleteMessage?: (messageId: string) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Called when a message is marked as unread. Receives the message id.
|
|
28
|
+
*/
|
|
9
29
|
onMarkUnread?: (messageId: string) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Called when a message is resolved. Receives the message id.
|
|
32
|
+
*/
|
|
10
33
|
onResolved?: (messageId: string) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Additional CSS class name applied to the thread root
|
|
36
|
+
*/
|
|
11
37
|
className?: string;
|
|
12
38
|
}
|
package/src/components/ds-comment-bubble/components/ds-thread-item/ds-thread-item.module.scss
CHANGED
|
@@ -7,8 +7,8 @@ $transition-duration: 0.2s;
|
|
|
7
7
|
|
|
8
8
|
.threadItem {
|
|
9
9
|
display: flex;
|
|
10
|
-
gap: var(--
|
|
11
|
-
padding: var(--
|
|
10
|
+
gap: var(--lg);
|
|
11
|
+
padding: var(--sm) var(--standard);
|
|
12
12
|
position: relative;
|
|
13
13
|
|
|
14
14
|
&:hover {
|
|
@@ -48,17 +48,17 @@ $transition-duration: 0.2s;
|
|
|
48
48
|
width: $avatar-size;
|
|
49
49
|
height: $avatar-size;
|
|
50
50
|
border-radius: $border-radius-circle;
|
|
51
|
-
background: var(--
|
|
51
|
+
background: var(--background-tertiary);
|
|
52
52
|
font-size: $avatar-fallback-font-size;
|
|
53
53
|
font-weight: var(--font-weight-semi-bold);
|
|
54
|
-
color: var(--
|
|
54
|
+
color: var(--font-main);
|
|
55
55
|
text-transform: uppercase;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
.content {
|
|
59
59
|
display: flex;
|
|
60
60
|
flex-direction: column;
|
|
61
|
-
gap: var(--
|
|
61
|
+
gap: var(--3xs);
|
|
62
62
|
flex: 1;
|
|
63
63
|
min-width: 0;
|
|
64
64
|
}
|
|
@@ -66,29 +66,29 @@ $transition-duration: 0.2s;
|
|
|
66
66
|
.header {
|
|
67
67
|
display: flex;
|
|
68
68
|
align-items: center;
|
|
69
|
-
gap: var(--
|
|
69
|
+
gap: var(--xs);
|
|
70
70
|
height: $header-height;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
.authorName {
|
|
74
|
-
font-size: var(--font-size-md);
|
|
74
|
+
font-size: var(--body-font-size-md);
|
|
75
75
|
font-weight: var(--font-weight-semi-bold);
|
|
76
|
-
line-height: var(--line-height-md);
|
|
77
|
-
color: var(--
|
|
76
|
+
line-height: var(--body-line-height-md);
|
|
77
|
+
color: var(--font-main);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
.timestamp {
|
|
81
|
-
font-size: var(--font-size-md);
|
|
81
|
+
font-size: var(--body-font-size-md);
|
|
82
82
|
font-weight: var(--font-weight-regular);
|
|
83
|
-
line-height: var(--line-height-md);
|
|
84
|
-
color: var(--
|
|
83
|
+
line-height: var(--body-line-height-md);
|
|
84
|
+
color: var(--font-secondary);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
.message {
|
|
88
|
-
font-size: var(--font-size-sm);
|
|
88
|
+
font-size: var(--body-font-size-sm);
|
|
89
89
|
font-weight: var(--font-weight-regular);
|
|
90
|
-
line-height: var(--line-height-
|
|
91
|
-
color: var(--
|
|
90
|
+
line-height: var(--body-line-height-small);
|
|
91
|
+
color: var(--font-main);
|
|
92
92
|
word-wrap: break-word;
|
|
93
93
|
white-space: pre-wrap;
|
|
94
94
|
}
|
|
@@ -96,7 +96,7 @@ $transition-duration: 0.2s;
|
|
|
96
96
|
.actions {
|
|
97
97
|
display: flex;
|
|
98
98
|
align-items: flex-start;
|
|
99
|
-
gap: var(--
|
|
99
|
+
gap: var(--xs);
|
|
100
100
|
opacity: 0;
|
|
101
101
|
transition: opacity $transition-duration ease;
|
|
102
102
|
}
|
|
@@ -112,9 +112,9 @@ $transition-duration: 0.2s;
|
|
|
112
112
|
|
|
113
113
|
.editActions {
|
|
114
114
|
display: flex;
|
|
115
|
-
gap: var(--
|
|
115
|
+
gap: var(--xs);
|
|
116
116
|
justify-content: flex-end;
|
|
117
|
-
margin-top: var(--
|
|
117
|
+
margin-top: var(--xs);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
.dropdownContent {
|
|
@@ -1,15 +1,53 @@
|
|
|
1
1
|
import type { CommentAuthor } from '../../../ds-comment-card';
|
|
2
2
|
|
|
3
3
|
export interface DsThreadItemProps {
|
|
4
|
+
/**
|
|
5
|
+
* Stable identifier for the message. Passed to callbacks to identify which
|
|
6
|
+
* message the user acted on.
|
|
7
|
+
*/
|
|
4
8
|
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* Author of the message
|
|
11
|
+
*/
|
|
5
12
|
author: CommentAuthor;
|
|
13
|
+
/**
|
|
14
|
+
* Text content of the message
|
|
15
|
+
*/
|
|
6
16
|
content: string;
|
|
17
|
+
/**
|
|
18
|
+
* Timestamp when the message was created
|
|
19
|
+
*/
|
|
7
20
|
createdAt: Date;
|
|
21
|
+
/**
|
|
22
|
+
* Whether this message was posted by the author of the top-level comment.
|
|
23
|
+
* Styled slightly differently from replies by other participants.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
8
26
|
isCommentAuthorMessage?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the current viewer can edit or delete this message. Typically true
|
|
29
|
+
* only when the viewer is the message's author.
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
9
32
|
canModify?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Called when the viewer saves an edit. Receives the message id and the new content.
|
|
35
|
+
*/
|
|
10
36
|
onEdit?: (messageId: string, newContent: string) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Called when the viewer deletes the message. Receives the message id.
|
|
39
|
+
*/
|
|
11
40
|
onDelete?: (messageId: string) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Called when the viewer marks the message as unread. Receives the message id.
|
|
43
|
+
*/
|
|
12
44
|
onMarkUnread?: (messageId: string) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Called when the viewer resolves the message. Receives the message id.
|
|
47
|
+
*/
|
|
13
48
|
onResolved?: (messageId: string) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Additional CSS class name applied to the item root
|
|
51
|
+
*/
|
|
14
52
|
className?: string;
|
|
15
53
|
}
|
|
@@ -19,8 +19,8 @@ $transition-duration: 0.2s;
|
|
|
19
19
|
display: flex;
|
|
20
20
|
flex-direction: column;
|
|
21
21
|
width: $bubble-width-thread;
|
|
22
|
-
background: var(--
|
|
23
|
-
border: $border-width solid var(--
|
|
22
|
+
background: var(--background);
|
|
23
|
+
border: $border-width solid var(--primary-700-default);
|
|
24
24
|
border-radius: $bubble-border-radius-pill;
|
|
25
25
|
box-shadow: 0 6px 13px 0 rgba(4, 69, 204, 0.2);
|
|
26
26
|
overflow: hidden;
|
|
@@ -31,19 +31,19 @@ $transition-duration: 0.2s;
|
|
|
31
31
|
padding $transition-duration ease;
|
|
32
32
|
|
|
33
33
|
&.actionRequired {
|
|
34
|
-
border-color: var(--
|
|
34
|
+
border-color: var(--background-warning-strong);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.initial {
|
|
39
39
|
width: $bubble-width-initial;
|
|
40
40
|
border-width: $border-width;
|
|
41
|
-
padding: var(--
|
|
41
|
+
padding: var(--sm) var(--standard);
|
|
42
42
|
border-radius: $bubble-border-radius-pill;
|
|
43
43
|
|
|
44
44
|
.inputArea {
|
|
45
45
|
padding: 0;
|
|
46
|
-
gap: var(--
|
|
46
|
+
gap: var(--xs);
|
|
47
47
|
align-items: center;
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -57,12 +57,12 @@ $transition-duration: 0.2s;
|
|
|
57
57
|
.textarea {
|
|
58
58
|
padding: 0;
|
|
59
59
|
min-height: $input-min-height-initial;
|
|
60
|
-
line-height: var(--line-height-
|
|
60
|
+
line-height: var(--body-line-height-small);
|
|
61
61
|
overflow: hidden;
|
|
62
62
|
resize: none;
|
|
63
63
|
|
|
64
64
|
&::placeholder {
|
|
65
|
-
color: var(--
|
|
65
|
+
color: var(--font-disabled);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -70,12 +70,12 @@ $transition-duration: 0.2s;
|
|
|
70
70
|
.typing {
|
|
71
71
|
width: $bubble-width-typing;
|
|
72
72
|
border-width: $border-width;
|
|
73
|
-
padding: var(--
|
|
73
|
+
padding: var(--sm) var(--standard) 0;
|
|
74
74
|
border-radius: $bubble-border-radius-pill;
|
|
75
75
|
|
|
76
76
|
.inputArea {
|
|
77
|
-
padding: 0 0 var(--
|
|
78
|
-
border-bottom: $border-width solid var(--
|
|
77
|
+
padding: 0 0 var(--sm);
|
|
78
|
+
border-bottom: $border-width solid var(--border-secondary);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
.inputWrapper {
|
|
@@ -93,14 +93,14 @@ $transition-duration: 0.2s;
|
|
|
93
93
|
flex-direction: column;
|
|
94
94
|
|
|
95
95
|
.inputArea {
|
|
96
|
-
border-top: $border-width solid var(--
|
|
97
|
-
padding: var(--
|
|
96
|
+
border-top: $border-width solid var(--border-secondary);
|
|
97
|
+
padding: var(--xs) var(--standard);
|
|
98
98
|
flex-shrink: 0;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
.inputWrapper {
|
|
102
|
-
background: var(--
|
|
103
|
-
padding: var(--
|
|
102
|
+
background: var(--background);
|
|
103
|
+
padding: var(--xs) var(--sm);
|
|
104
104
|
border-radius: $bubble-border-radius-standard;
|
|
105
105
|
min-height: $input-min-height-thread;
|
|
106
106
|
}
|
|
@@ -110,9 +110,9 @@ $transition-duration: 0.2s;
|
|
|
110
110
|
display: flex;
|
|
111
111
|
align-items: center;
|
|
112
112
|
justify-content: space-between;
|
|
113
|
-
gap: var(--
|
|
114
|
-
padding: var(--
|
|
115
|
-
border-bottom: $border-width solid var(--
|
|
113
|
+
gap: var(--xs);
|
|
114
|
+
padding: var(--xs) var(--standard) var(--xs);
|
|
115
|
+
border-bottom: $border-width solid var(--border);
|
|
116
116
|
flex-shrink: 0;
|
|
117
117
|
}
|
|
118
118
|
|
|
@@ -126,32 +126,32 @@ $transition-duration: 0.2s;
|
|
|
126
126
|
.headerInfo {
|
|
127
127
|
display: flex;
|
|
128
128
|
align-items: center;
|
|
129
|
-
gap: var(--
|
|
129
|
+
gap: var(--xs);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
.commentId {
|
|
133
|
-
font-size: var(--font-size-sm);
|
|
134
|
-
line-height: var(--line-height-
|
|
135
|
-
color: var(--
|
|
133
|
+
font-size: var(--body-font-size-sm);
|
|
134
|
+
line-height: var(--body-line-height-small);
|
|
135
|
+
color: var(--font-secondary);
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
.actionRequiredBadge {
|
|
139
|
-
font-size: var(--font-size-sm);
|
|
140
|
-
line-height: var(--line-height-
|
|
141
|
-
color: var(--
|
|
139
|
+
font-size: var(--body-font-size-sm);
|
|
140
|
+
line-height: var(--body-line-height-small);
|
|
141
|
+
color: var(--font-warning);
|
|
142
142
|
font-weight: var(--font-weight-regular);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
.headerRight {
|
|
146
146
|
display: flex;
|
|
147
147
|
align-items: center;
|
|
148
|
-
gap: var(--
|
|
148
|
+
gap: var(--xs);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
.headerActions {
|
|
152
152
|
display: flex;
|
|
153
153
|
align-items: center;
|
|
154
|
-
gap: var(--
|
|
154
|
+
gap: var(--xs);
|
|
155
155
|
opacity: 0;
|
|
156
156
|
transition: opacity $transition-duration ease;
|
|
157
157
|
|
|
@@ -163,24 +163,24 @@ $transition-duration: 0.2s;
|
|
|
163
163
|
.inputArea {
|
|
164
164
|
display: flex;
|
|
165
165
|
align-items: center;
|
|
166
|
-
gap: var(--
|
|
166
|
+
gap: var(--xs);
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
.inputWrapper {
|
|
170
170
|
display: flex;
|
|
171
171
|
align-items: center;
|
|
172
172
|
flex: 1;
|
|
173
|
-
gap: var(--
|
|
173
|
+
gap: var(--xs);
|
|
174
174
|
min-height: $input-min-height-thread;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
.searchIcon {
|
|
178
|
-
color: var(--
|
|
178
|
+
color: var(--font-main);
|
|
179
179
|
flex-shrink: 0;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
.infoIcon {
|
|
183
|
-
color: var(--
|
|
183
|
+
color: var(--font-main);
|
|
184
184
|
flex-shrink: 0;
|
|
185
185
|
}
|
|
186
186
|
|
|
@@ -191,15 +191,15 @@ $transition-duration: 0.2s;
|
|
|
191
191
|
padding: 0;
|
|
192
192
|
border: none;
|
|
193
193
|
background: transparent;
|
|
194
|
-
font-size: var(--font-size-sm);
|
|
195
|
-
line-height: var(--line-height-
|
|
194
|
+
font-size: var(--body-font-size-sm);
|
|
195
|
+
line-height: var(--body-line-height-small);
|
|
196
196
|
font-family: inherit;
|
|
197
|
-
color: var(--
|
|
197
|
+
color: var(--font-main);
|
|
198
198
|
resize: none;
|
|
199
199
|
overflow-y: auto;
|
|
200
200
|
|
|
201
201
|
&::placeholder {
|
|
202
|
-
color: var(--
|
|
202
|
+
color: var(--font-disabled);
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
&:focus {
|
|
@@ -215,7 +215,7 @@ $transition-duration: 0.2s;
|
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
&::-webkit-scrollbar-thumb {
|
|
218
|
-
background: var(--
|
|
218
|
+
background: var(--background-tertiary);
|
|
219
219
|
border-radius: $scrollbar-border-radius-pill;
|
|
220
220
|
}
|
|
221
221
|
}
|
|
@@ -224,7 +224,7 @@ $transition-duration: 0.2s;
|
|
|
224
224
|
display: flex;
|
|
225
225
|
align-items: center;
|
|
226
226
|
justify-content: space-between;
|
|
227
|
-
padding: var(--
|
|
227
|
+
padding: var(--xs) 0;
|
|
228
228
|
|
|
229
229
|
> :last-child {
|
|
230
230
|
margin-left: auto;
|
|
@@ -246,18 +246,18 @@ $transition-duration: 0.2s;
|
|
|
246
246
|
.dropdownItem {
|
|
247
247
|
display: flex;
|
|
248
248
|
align-items: center;
|
|
249
|
-
gap: var(--
|
|
250
|
-
padding: var(--
|
|
251
|
-
font-size: var(--font-size-sm);
|
|
252
|
-
line-height: var(--line-height-
|
|
253
|
-
color: var(--
|
|
249
|
+
gap: var(--xs);
|
|
250
|
+
padding: var(--xs) var(--sm);
|
|
251
|
+
font-size: var(--body-font-size-sm);
|
|
252
|
+
line-height: var(--body-line-height-small);
|
|
253
|
+
color: var(--font-main);
|
|
254
254
|
cursor: pointer;
|
|
255
255
|
|
|
256
256
|
&:hover {
|
|
257
|
-
background: var(--
|
|
257
|
+
background: var(--background-secondary);
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
&.danger {
|
|
261
|
-
color: var(--
|
|
261
|
+
color: var(--font-error);
|
|
262
262
|
}
|
|
263
263
|
}
|
|
@@ -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
|
}
|
|
@@ -8,9 +8,9 @@ $transition-duration: 0.2s;
|
|
|
8
8
|
.card {
|
|
9
9
|
display: flex;
|
|
10
10
|
width: 100%;
|
|
11
|
-
border: $border-width solid var(--
|
|
12
|
-
border-radius: var(--
|
|
13
|
-
background: var(--
|
|
11
|
+
border: $border-width solid var(--border);
|
|
12
|
+
border-radius: var(--3xs);
|
|
13
|
+
background: var(--background);
|
|
14
14
|
overflow: hidden;
|
|
15
15
|
cursor: pointer;
|
|
16
16
|
text-align: left;
|
|
@@ -20,8 +20,8 @@ $transition-duration: 0.2s;
|
|
|
20
20
|
box-shadow $transition-duration ease;
|
|
21
21
|
|
|
22
22
|
&:hover {
|
|
23
|
-
background: var(--
|
|
24
|
-
border-color: var(--
|
|
23
|
+
background: var(--background-action-hover-weak);
|
|
24
|
+
border-color: var(--border);
|
|
25
25
|
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
|
|
26
26
|
|
|
27
27
|
.actions {
|
|
@@ -36,10 +36,10 @@ $transition-duration: 0.2s;
|
|
|
36
36
|
.sideColor {
|
|
37
37
|
width: $side-color-width;
|
|
38
38
|
flex-shrink: 0;
|
|
39
|
-
background: var(--
|
|
39
|
+
background: var(--background-info-strong);
|
|
40
40
|
|
|
41
41
|
&.actionRequired {
|
|
42
|
-
background: var(--
|
|
42
|
+
background: var(--background-warning-strong);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -53,57 +53,57 @@ $transition-duration: 0.2s;
|
|
|
53
53
|
.header {
|
|
54
54
|
display: flex;
|
|
55
55
|
flex-direction: column;
|
|
56
|
-
gap: var(--
|
|
57
|
-
padding: var(--
|
|
58
|
-
padding-bottom: var(--
|
|
56
|
+
gap: var(--3xs);
|
|
57
|
+
padding: var(--xs) var(--standard);
|
|
58
|
+
padding-bottom: var(--3xs);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
.headerTop {
|
|
62
62
|
display: flex;
|
|
63
63
|
align-items: flex-start;
|
|
64
|
-
gap: var(--
|
|
64
|
+
gap: var(--3xs);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
.headerLeft {
|
|
68
68
|
display: flex;
|
|
69
69
|
flex-direction: column;
|
|
70
70
|
flex: 1;
|
|
71
|
-
gap: var(--
|
|
71
|
+
gap: var(--sm);
|
|
72
72
|
min-width: 0;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
.commentInfo {
|
|
76
76
|
display: flex;
|
|
77
77
|
align-items: center;
|
|
78
|
-
gap: var(--
|
|
78
|
+
gap: var(--xs);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
.commentId {
|
|
82
|
-
font-size: var(--font-size-sm);
|
|
83
|
-
line-height: var(--line-height-
|
|
84
|
-
color: var(--
|
|
82
|
+
font-size: var(--body-font-size-sm);
|
|
83
|
+
line-height: var(--body-line-height-small);
|
|
84
|
+
color: var(--font-secondary);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
.authorInfo {
|
|
88
88
|
display: flex;
|
|
89
89
|
align-items: center;
|
|
90
|
-
gap: var(--
|
|
91
|
-
font-size: var(--font-size-sm);
|
|
92
|
-
line-height: var(--line-height-
|
|
90
|
+
gap: var(--xs);
|
|
91
|
+
font-size: var(--body-font-size-sm);
|
|
92
|
+
line-height: var(--body-line-height-small);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
.authorName {
|
|
96
|
-
color: var(--
|
|
96
|
+
color: var(--font-main);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
.timestamp {
|
|
100
|
-
color: var(--
|
|
100
|
+
color: var(--font-secondary);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
.actions {
|
|
104
104
|
display: flex;
|
|
105
105
|
align-items: center;
|
|
106
|
-
gap: var(--
|
|
106
|
+
gap: var(--3xs);
|
|
107
107
|
opacity: 0;
|
|
108
108
|
visibility: hidden;
|
|
109
109
|
transition:
|
|
@@ -118,12 +118,12 @@ $transition-duration: 0.2s;
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
&:hover {
|
|
121
|
-
background: var(--
|
|
122
|
-
background-color: var(--
|
|
121
|
+
background: var(--background-action-hover-weak) !important;
|
|
122
|
+
background-color: var(--background-action-hover-weak) !important;
|
|
123
123
|
|
|
124
124
|
> * {
|
|
125
|
-
background: var(--
|
|
126
|
-
background-color: var(--
|
|
125
|
+
background: var(--background-action-hover-weak) !important;
|
|
126
|
+
background-color: var(--background-action-hover-weak) !important;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
}
|
|
@@ -132,14 +132,14 @@ $transition-duration: 0.2s;
|
|
|
132
132
|
.body {
|
|
133
133
|
display: flex;
|
|
134
134
|
flex-direction: column;
|
|
135
|
-
gap: var(--
|
|
136
|
-
padding: var(--
|
|
135
|
+
gap: var(--3xs);
|
|
136
|
+
padding: var(--xs) var(--standard);
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
.message {
|
|
140
|
-
font-size: var(--font-size-xs);
|
|
141
|
-
line-height: var(--line-height-xs);
|
|
142
|
-
color: var(--
|
|
140
|
+
font-size: var(--body-font-size-xs);
|
|
141
|
+
line-height: var(--body-line-height-xs);
|
|
142
|
+
color: var(--font-main);
|
|
143
143
|
word-wrap: break-word;
|
|
144
144
|
|
|
145
145
|
&.truncated {
|
|
@@ -152,9 +152,9 @@ $transition-duration: 0.2s;
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
.replyCount {
|
|
155
|
-
font-size: var(--font-size-xs);
|
|
156
|
-
line-height: var(--line-height-xs);
|
|
157
|
-
color: var(--
|
|
155
|
+
font-size: var(--body-font-size-xs);
|
|
156
|
+
line-height: var(--body-line-height-xs);
|
|
157
|
+
color: var(--font-secondary);
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
.dropdownContent {
|