@drivenets/design-system 0.7.1 → 0.7.2
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 +14 -0
- package/dist/index.cjs +414 -679
- package/dist/index.d.cts +39 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +39 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +410 -670
- package/dist/index.js.map +1 -1
- package/dist/index.min.css +1 -1
- package/package.json +24 -20
- package/src/components/ds-breadcrumb/ds-breadcrumb.tsx +1 -1
- package/src/components/ds-button/versions/ds-button-legacy/ds-button-legacy.tsx +1 -0
- package/src/components/ds-button/versions/ds-button-new/ds-button-new.module.scss +13 -0
- package/src/components/ds-button/versions/ds-button-new/ds-button-new.tsx +1 -1
- package/src/components/ds-button/versions/ds-button-new/ds-button-new.types.ts +1 -1
- package/src/components/ds-checkbox/ds-checkbox.module.scss +36 -5
- package/src/components/ds-checkbox/ds-checkbox.tsx +2 -1
- package/src/components/ds-checkbox/{ds-checkbox.types.tsx → ds-checkbox.types.ts} +7 -0
- package/src/components/ds-chip-group/ds-chip-group.tsx +1 -1
- package/src/components/ds-comment-bubble/components/ds-thread-item/ds-thread-item.module.scss +0 -23
- package/src/components/ds-comment-bubble/components/ds-thread-item/ds-thread-item.tsx +2 -11
- package/src/components/ds-comment-bubble/ds-comment-bubble.module.scss +0 -39
- package/src/components/ds-comment-bubble/ds-comment-bubble.tsx +21 -20
- package/src/components/ds-comment-card/ds-comment-card.tsx +2 -2
- package/src/components/ds-confirmation/ds-confirmation.tsx +1 -1
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.module.scss +1 -1
- package/src/components/ds-dropdown-menu/ds-dropdown-menu.tsx +2 -2
- package/src/components/ds-expandable-text-input/ds-expandable-text-input.tsx +6 -2
- package/src/components/ds-segment-group/ds-segment-group.tsx +1 -1
- package/src/components/ds-select/ds-select.tsx +41 -7
- package/src/components/ds-select/{ds-select.types.tsx → ds-select.types.ts} +12 -0
- package/src/components/ds-select/select-items-chips.tsx +3 -2
- package/src/components/ds-select/utils.test.ts +37 -0
- package/src/components/ds-select/utils.ts +7 -0
- package/src/components/ds-smart-tabs/{ds-smart-tabs.types.tsx → ds-smart-tabs.types.ts} +1 -1
- package/src/components/ds-stepper/components/ds-step-next-button.tsx +7 -3
- package/src/components/ds-stepper/components/ds-step.tsx +1 -1
- package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.tsx +4 -1
- package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.types.ts +4 -0
- package/src/components/ds-table/components/ds-table-row/ds-table-row.tsx +1 -1
- package/src/components/ds-tabs/components/ds-tabs-tab/ds-tabs-tab.tsx +1 -2
- package/src/components/ds-tag-filter/{utils.test.ts → utils.browser.test.ts} +20 -113
- package/src/components/ds-text-input/ds-text-input.tsx +4 -0
- package/src/components/ds-text-input/{ds-text-input.types.tsx → ds-text-input.types.ts} +8 -1
- /package/src/components/ds-alert-banner/{ds-alert-banner.types.tsx → ds-alert-banner.types.ts} +0 -0
- /package/src/components/ds-alert-banner/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-autocomplete/{ds-autocomplete.types.tsx → ds-autocomplete.types.ts} +0 -0
- /package/src/components/ds-breadcrumb/{ds-breadcrumb.types.tsx → ds-breadcrumb.types.ts} +0 -0
- /package/src/components/ds-breadcrumb/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-checkbox/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-chip/{ds-chip.types.tsx → ds-chip.types.ts} +0 -0
- /package/src/components/ds-chip/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-comments-drawer/{comments-filters.test.ts → comments-filters.unit.test.ts} +0 -0
- /package/src/components/ds-confirmation/{ds-confirmation.types.tsx → ds-confirmation.types.ts} +0 -0
- /package/src/components/ds-date-input/{ds-date-input.types.tsx → ds-date-input.types.ts} +0 -0
- /package/src/components/ds-dialog/{ds-dialog.types.tsx → ds-dialog.types.ts} +0 -0
- /package/src/components/ds-dialog/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-drawer/{ds-drawer.types.tsx → ds-drawer.types.ts} +0 -0
- /package/src/components/ds-dropdown-menu/{ds-dropdown-menu.types.tsx → ds-dropdown-menu.types.ts} +0 -0
- /package/src/components/ds-dropdown-menu/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-expandable-text-input/{ds-expandable-text-input.types.tsx → ds-expandable-text-input.types.ts} +0 -0
- /package/src/components/ds-file-upload/components/file-upload/{file-upload.types.tsx → file-upload.types.ts} +0 -0
- /package/src/components/ds-file-upload/components/file-upload-item/{file-upload-item.types.tsx → file-upload-item.types.ts} +0 -0
- /package/src/components/ds-file-upload/{ds-file-upload.types.tsx → ds-file-upload.types.ts} +0 -0
- /package/src/components/ds-form-control/{ds-form-control.types.tsx → ds-form-control.types.ts} +0 -0
- /package/src/components/ds-form-control/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-modal/{ds-modal.types.tsx → ds-modal.types.ts} +0 -0
- /package/src/components/ds-modal/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-number-input/{ds-number-input.types.tsx → ds-number-input.types.ts} +0 -0
- /package/src/components/ds-number-input/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-panel/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-password-input/{ds-password-input.types.tsx → ds-password-input.types.ts} +0 -0
- /package/src/components/ds-password-input/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-popover/{ds-popover.types.tsx → ds-popover.types.ts} +0 -0
- /package/src/components/ds-popover/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-progress-arc/{utils.test.ts → utils.unit.test.ts} +0 -0
- /package/src/components/ds-progress-linear/{utils.test.ts → utils.unit.test.ts} +0 -0
- /package/src/components/ds-radio-group/{ds-radio-group.types.tsx → ds-radio-group.types.ts} +0 -0
- /package/src/components/ds-radio-group/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-segment-group/{ds-segment-group.types.tsx → ds-segment-group.types.ts} +0 -0
- /package/src/components/ds-segment-group/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-select/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-skeleton/{ds-skeleton.tsx → ds-skeleton.ts} +0 -0
- /package/src/components/ds-smart-tabs/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-spinner/{ds-spinner.types.tsx → ds-spinner.types.ts} +0 -0
- /package/src/components/ds-spinner/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-status-badge/{ds-status-badge.types.tsx → ds-status-badge.types.ts} +0 -0
- /package/src/components/ds-status-badge/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-stepper/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-system-status/{ds-system-status.types.tsx → ds-system-status.types.ts} +0 -0
- /package/src/components/ds-system-status/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-table/context/{ds-table-context.tsx → ds-table-context.ts} +0 -0
- /package/src/components/ds-tag/{ds-tag.types.tsx → ds-tag.types.ts} +0 -0
- /package/src/components/ds-tag/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-textarea/{ds-textarea.types.tsx → ds-textarea.types.ts} +0 -0
- /package/src/components/ds-textarea/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-toast/{ds-toast.types.tsx → ds-toast.types.ts} +0 -0
- /package/src/components/ds-toggle/{ds-toggle.types.tsx → ds-toggle.types.ts} +0 -0
- /package/src/components/ds-toggle/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-tooltip/{ds-tooltip.types.tsx → ds-tooltip.types.ts} +0 -0
- /package/src/components/ds-tooltip/{index.tsx → index.ts} +0 -0
- /package/src/components/ds-typography/{ds-typography.types.tsx → ds-typography.types.ts} +0 -0
- /package/src/components/ds-typography/{index.tsx → index.ts} +0 -0
- /package/src/utils/{format-relative-time.test.ts → format-relative-time.unit.test.ts} +0 -0
- /package/src/{components/ds-table/utils → utils}/merge-refs.ts +0 -0
- /package/src/utils/{numbers.test.ts → numbers.unit.test.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drivenets/design-system",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.cts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"directory": "/packages/design-system"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@ark-ui/react": "^5.34.
|
|
39
|
+
"@ark-ui/react": "^5.34.1",
|
|
40
40
|
"@dnd-kit/core": "^6.3.1",
|
|
41
41
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
42
42
|
"@dnd-kit/sortable": "^10.0.0",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
52
52
|
"@radix-ui/react-visually-hidden": "^1.2.4",
|
|
53
53
|
"@tanstack/react-table": "^8.21.3",
|
|
54
|
-
"@tanstack/react-virtual": "^3.13.
|
|
55
|
-
"@zag-js/react": "^1.35.
|
|
56
|
-
"@zag-js/steps": "^1.35.
|
|
54
|
+
"@tanstack/react-virtual": "^3.13.21",
|
|
55
|
+
"@zag-js/react": "^1.35.3",
|
|
56
|
+
"@zag-js/steps": "^1.35.3",
|
|
57
57
|
"classnames": "^2.5.1"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
@@ -64,21 +64,21 @@
|
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
67
|
-
"@eslint/compat": "^2.0.
|
|
67
|
+
"@eslint/compat": "^2.0.3",
|
|
68
68
|
"@faker-js/faker": "^10.3.0",
|
|
69
69
|
"@hookform/resolvers": "^5.2.2",
|
|
70
|
-
"@rollup/plugin-babel": "^
|
|
71
|
-
"@storybook/addon-a11y": "^10.2.
|
|
72
|
-
"@storybook/addon-docs": "^10.2.
|
|
73
|
-
"@storybook/addon-vitest": "^10.2.
|
|
74
|
-
"@storybook/builder-vite": "^10.2.
|
|
75
|
-
"@storybook/react-vite": "^10.2.
|
|
70
|
+
"@rollup/plugin-babel": "^7.0.0",
|
|
71
|
+
"@storybook/addon-a11y": "^10.2.16",
|
|
72
|
+
"@storybook/addon-docs": "^10.2.16",
|
|
73
|
+
"@storybook/addon-vitest": "^10.2.16",
|
|
74
|
+
"@storybook/builder-vite": "^10.2.16",
|
|
75
|
+
"@storybook/react-vite": "^10.2.16",
|
|
76
76
|
"@tanstack/react-query": "^5.90.21",
|
|
77
|
-
"@tanstack/react-router": "^1.
|
|
77
|
+
"@tanstack/react-router": "^1.166.2",
|
|
78
78
|
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
|
|
79
79
|
"@types/react": "^19.2.14",
|
|
80
80
|
"@types/react-dom": "^19.2.3",
|
|
81
|
-
"@
|
|
81
|
+
"@vitejs/plugin-react-swc": "^4.2.3",
|
|
82
82
|
"@vitest/browser-playwright": "^4.0.18",
|
|
83
83
|
"@vitest/coverage-v8": "^4.0.18",
|
|
84
84
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
@@ -86,35 +86,39 @@
|
|
|
86
86
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
87
87
|
"eslint-plugin-react": "^7.37.5",
|
|
88
88
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
89
|
-
"eslint-plugin-storybook": "^10.2.
|
|
90
|
-
"jsdom": "^28.1.0",
|
|
89
|
+
"eslint-plugin-storybook": "^10.2.16",
|
|
91
90
|
"mockdate": "^3.0.5",
|
|
92
91
|
"playwright": "^1.58.2",
|
|
93
|
-
"postcss": "^8.5.
|
|
92
|
+
"postcss": "^8.5.8",
|
|
94
93
|
"postcss-modules": "^6.0.1",
|
|
95
|
-
"publint": "^0.3.
|
|
94
|
+
"publint": "^0.3.18",
|
|
96
95
|
"react": "^19.2.4",
|
|
97
96
|
"react-dom": "^19.2.4",
|
|
98
97
|
"react-hook-form": "^7.71.2",
|
|
99
98
|
"rollup-plugin-sass": "^1.15.3",
|
|
100
99
|
"sass-embedded": "^1.97.3",
|
|
101
|
-
"storybook": "^10.2.
|
|
102
|
-
"tsdown": "^0.
|
|
100
|
+
"storybook": "^10.2.16",
|
|
101
|
+
"tsdown": "^0.21.0",
|
|
103
102
|
"typed-scss-modules": "^8.1.1",
|
|
104
103
|
"typescript": "^5.9.3",
|
|
105
104
|
"typescript-plugin-css-modules": "^5.2.0",
|
|
106
105
|
"vite": "^7.3.1",
|
|
107
106
|
"vitest": "^4.0.18",
|
|
107
|
+
"vitest-browser-react": "^2.0.5",
|
|
108
108
|
"zod": "^4.3.6",
|
|
109
|
+
"@drivenets/eslint-plugin-internal": "0.0.0",
|
|
109
110
|
"@drivenets/vite-plugin-design-system": "0.0.6"
|
|
110
111
|
},
|
|
111
112
|
"scripts": {
|
|
113
|
+
"install:playwright": "pnpm exec playwright install chromium --with-deps",
|
|
112
114
|
"lint": "pnpm generate-scss-dts && eslint --max-warnings=0 .; EXIT_CODE=$?; rm -rf .scss-dts; exit $EXIT_CODE",
|
|
113
115
|
"typecheck": "pnpm generate-scss-dts && tsc; EXIT_CODE=$?; rm -rf .scss-dts; exit $EXIT_CODE",
|
|
114
116
|
"generate-scss-dts": "typed-scss-modules ./src -o ./.scss-dts --nameFormat all --exportType default > /dev/null 2>&1",
|
|
115
117
|
"storybook": "storybook dev -p 6006",
|
|
116
118
|
"test": "vitest --project=\"!requires-build\"",
|
|
117
119
|
"test:coverage": "pnpm test --coverage",
|
|
120
|
+
"test:unit": "vitest --project=unit",
|
|
121
|
+
"test:browser": "vitest --project=browser",
|
|
118
122
|
"test:requires-build": "vitest --project=requires-build",
|
|
119
123
|
"build": "tsdown",
|
|
120
124
|
"build:watch": "pnpm build --watch",
|
|
@@ -6,7 +6,7 @@ import styles from './ds-breadcrumb.module.scss';
|
|
|
6
6
|
import type { DsBreadcrumbProps } from './ds-breadcrumb.types';
|
|
7
7
|
import { DsIcon } from '../ds-icon';
|
|
8
8
|
import { DsDropdownMenu } from '../ds-dropdown-menu';
|
|
9
|
-
import { DsTextInput } from '../ds-text-input
|
|
9
|
+
import { DsTextInput } from '../ds-text-input';
|
|
10
10
|
import { DsTypography } from '../ds-typography';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@use '../../../../styles/typography';
|
|
2
2
|
|
|
3
|
+
$button-size-tiny: 16px;
|
|
3
4
|
$button-size-small: 28px;
|
|
4
5
|
$button-size-default: 32px;
|
|
5
6
|
$button-size-large: 40px;
|
|
@@ -29,6 +30,13 @@ $button-size-large: 40px;
|
|
|
29
30
|
flex-grow: 1;
|
|
30
31
|
}
|
|
31
32
|
|
|
33
|
+
&.tiny .content {
|
|
34
|
+
@include typography.body-xs-md;
|
|
35
|
+
height: $button-size-tiny;
|
|
36
|
+
border-radius: var(--spacing-4xs);
|
|
37
|
+
--icon-width-tiny: 13px;
|
|
38
|
+
}
|
|
39
|
+
|
|
32
40
|
&.small .content {
|
|
33
41
|
@include typography.body-xs-md;
|
|
34
42
|
height: $button-size-small;
|
|
@@ -66,6 +74,11 @@ $button-size-large: 40px;
|
|
|
66
74
|
height: $button-size-small;
|
|
67
75
|
width: $button-size-small;
|
|
68
76
|
}
|
|
77
|
+
|
|
78
|
+
&.tiny .content {
|
|
79
|
+
height: $button-size-tiny;
|
|
80
|
+
width: $button-size-tiny;
|
|
81
|
+
}
|
|
69
82
|
}
|
|
70
83
|
|
|
71
84
|
&.primary-filled {
|
|
@@ -3,7 +3,7 @@ import type React from 'react';
|
|
|
3
3
|
import { Children, isValidElement } from 'react';
|
|
4
4
|
import styles from './ds-button-new.module.scss';
|
|
5
5
|
import type { DsButtonProps } from './ds-button-new.types';
|
|
6
|
-
import DsIcon from '../../../ds-icon
|
|
6
|
+
import { DsIcon } from '../../../ds-icon';
|
|
7
7
|
|
|
8
8
|
const isIconOnly = (children: React.ReactNode) => {
|
|
9
9
|
if (Children.count(children) !== 1) {
|
|
@@ -6,7 +6,7 @@ export type ButtonType = (typeof buttonTypes)[number];
|
|
|
6
6
|
export const buttonVariants = ['filled', 'ghost', 'danger', 'dark'] as const;
|
|
7
7
|
export type ButtonVariant = (typeof buttonVariants)[number];
|
|
8
8
|
|
|
9
|
-
export const buttonSizes = ['large', 'medium', 'small'] as const;
|
|
9
|
+
export const buttonSizes = ['large', 'medium', 'small', 'tiny'] as const;
|
|
10
10
|
export type ButtonSize = (typeof buttonSizes)[number];
|
|
11
11
|
|
|
12
12
|
export interface DsButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
&:has(.checkboxRoot:focus-visible) {
|
|
21
|
+
&:has(.label):has(.checkboxRoot:focus-visible) {
|
|
22
22
|
border-color: var(--color-background-selected);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
&:has([data-state='unchecked']:focus-visible) {
|
|
25
|
+
&:has(.label):has([data-state='unchecked']:focus-visible) {
|
|
26
26
|
border-color: var(--color-background-selected-hover);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -62,7 +62,8 @@
|
|
|
62
62
|
background-color: var(--color-background-selected);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
&:hover
|
|
65
|
+
&:hover,
|
|
66
|
+
&:focus-visible {
|
|
66
67
|
background: var(--color-background-action-secondary-hover);
|
|
67
68
|
}
|
|
68
69
|
}
|
|
@@ -72,7 +73,8 @@
|
|
|
72
73
|
border-color: var(--color-background-deselected);
|
|
73
74
|
}
|
|
74
75
|
|
|
75
|
-
&:hover
|
|
76
|
+
&:hover,
|
|
77
|
+
&:focus-visible {
|
|
76
78
|
background: var(--color-background-action-hover-weak);
|
|
77
79
|
}
|
|
78
80
|
}
|
|
@@ -83,7 +85,8 @@
|
|
|
83
85
|
background-color: var(--color-background-selected);
|
|
84
86
|
}
|
|
85
87
|
|
|
86
|
-
&:hover
|
|
88
|
+
&:hover,
|
|
89
|
+
&:focus-visible {
|
|
87
90
|
background: var(--color-background-action-secondary-hover);
|
|
88
91
|
}
|
|
89
92
|
}
|
|
@@ -128,3 +131,31 @@
|
|
|
128
131
|
cursor: pointer;
|
|
129
132
|
width: 100%;
|
|
130
133
|
}
|
|
134
|
+
|
|
135
|
+
.default {
|
|
136
|
+
border-color: transparent;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.warning {
|
|
140
|
+
&:has([data-state='checked']),
|
|
141
|
+
&:has([data-state='indeterminate']) {
|
|
142
|
+
.label {
|
|
143
|
+
color: var(--color-font-warning);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.checkboxRoot {
|
|
148
|
+
&[data-state='checked'],
|
|
149
|
+
&[data-state='indeterminate'] {
|
|
150
|
+
.checkboxWrapper {
|
|
151
|
+
border-color: var(--color-background-warning-strong);
|
|
152
|
+
background-color: var(--color-background-warning-strong);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&:hover,
|
|
156
|
+
&:focus-visible {
|
|
157
|
+
background: var(--color-background-warning);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -11,6 +11,7 @@ import { DsIcon } from '../ds-icon';
|
|
|
11
11
|
*/
|
|
12
12
|
const DsCheckbox: React.FC<DsCheckboxProps> = ({
|
|
13
13
|
id,
|
|
14
|
+
variant = 'default',
|
|
14
15
|
label,
|
|
15
16
|
labelInfo,
|
|
16
17
|
className,
|
|
@@ -23,7 +24,7 @@ const DsCheckbox: React.FC<DsCheckboxProps> = ({
|
|
|
23
24
|
const checkboxId = id || generatedId;
|
|
24
25
|
|
|
25
26
|
return (
|
|
26
|
-
<div className={classNames(styles.container, className)}>
|
|
27
|
+
<div className={classNames(styles.container, styles[variant], className)}>
|
|
27
28
|
<CheckboxPrimitive.Root
|
|
28
29
|
className={styles.checkboxRoot}
|
|
29
30
|
id={checkboxId}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
import type { Root } from '@radix-ui/react-checkbox';
|
|
3
3
|
|
|
4
|
+
export const checkboxVariants = ['default', 'warning'] as const;
|
|
5
|
+
export type CheckboxVariant = (typeof checkboxVariants)[number];
|
|
6
|
+
|
|
4
7
|
export interface DsCheckboxProps extends ComponentPropsWithoutRef<typeof Root> {
|
|
8
|
+
/**
|
|
9
|
+
* Visual variant of the checkbox
|
|
10
|
+
*/
|
|
11
|
+
variant?: CheckboxVariant;
|
|
5
12
|
/**
|
|
6
13
|
* Label for the checkbox
|
|
7
14
|
*/
|
|
@@ -7,7 +7,7 @@ import styles from './ds-chip-group.module.scss';
|
|
|
7
7
|
import type { DsChipGroupProps } from './ds-chip-group.types';
|
|
8
8
|
import { useChipRowCalculation } from './hooks/use-chip-row-calculation';
|
|
9
9
|
import { DsTypography } from '../ds-typography';
|
|
10
|
-
import DsChip from '../ds-chip
|
|
10
|
+
import { DsChip } from '../ds-chip';
|
|
11
11
|
import { DsCheckbox } from '../ds-checkbox';
|
|
12
12
|
import { DsButton } from '../ds-button';
|
|
13
13
|
import { DsIcon } from '../ds-icon';
|
package/src/components/ds-comment-bubble/components/ds-thread-item/ds-thread-item.module.scss
CHANGED
|
@@ -1,29 +1,10 @@
|
|
|
1
1
|
$avatar-size: 24px;
|
|
2
2
|
$avatar-fallback-font-size: 10px;
|
|
3
3
|
$header-height: 24px;
|
|
4
|
-
$icon-button-size: 16px;
|
|
5
4
|
$dropdown-min-width: 180px;
|
|
6
5
|
$border-radius-circle: 50%;
|
|
7
6
|
$transition-duration: 0.2s;
|
|
8
7
|
|
|
9
|
-
@mixin icon-button-size {
|
|
10
|
-
&#{&} {
|
|
11
|
-
width: $icon-button-size;
|
|
12
|
-
height: $icon-button-size;
|
|
13
|
-
min-width: $icon-button-size;
|
|
14
|
-
min-height: $icon-button-size;
|
|
15
|
-
padding: 0;
|
|
16
|
-
border: none;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.iconButtonContent {
|
|
21
|
-
height: $icon-button-size !important;
|
|
22
|
-
min-height: $icon-button-size !important;
|
|
23
|
-
padding: 0 !important;
|
|
24
|
-
border: none !important;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
8
|
.threadItem {
|
|
28
9
|
display: flex;
|
|
29
10
|
gap: var(--spacing-lg);
|
|
@@ -120,10 +101,6 @@ $transition-duration: 0.2s;
|
|
|
120
101
|
transition: opacity $transition-duration ease;
|
|
121
102
|
}
|
|
122
103
|
|
|
123
|
-
.actionButton {
|
|
124
|
-
@include icon-button-size;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
104
|
.editContainer {
|
|
128
105
|
width: 100%;
|
|
129
106
|
align-self: stretch;
|
|
@@ -97,14 +97,7 @@ export const DsThreadItem = ({
|
|
|
97
97
|
{hasEditActions && (
|
|
98
98
|
<DsDropdownMenu.Root>
|
|
99
99
|
<DsDropdownMenu.Trigger asChild>
|
|
100
|
-
<DsButton
|
|
101
|
-
design="v1.2"
|
|
102
|
-
buttonType="tertiary"
|
|
103
|
-
size="small"
|
|
104
|
-
aria-label="More actions"
|
|
105
|
-
className={styles.actionButton}
|
|
106
|
-
contentClassName={styles.iconButtonContent}
|
|
107
|
-
>
|
|
100
|
+
<DsButton design="v1.2" buttonType="tertiary" size="tiny" aria-label="More actions">
|
|
108
101
|
<DsIcon icon="more_vert" size="tiny" />
|
|
109
102
|
</DsButton>
|
|
110
103
|
</DsDropdownMenu.Trigger>
|
|
@@ -131,11 +124,9 @@ export const DsThreadItem = ({
|
|
|
131
124
|
<DsButton
|
|
132
125
|
design="v1.2"
|
|
133
126
|
buttonType="tertiary"
|
|
134
|
-
size="
|
|
127
|
+
size="tiny"
|
|
135
128
|
onClick={() => onResolved(id)}
|
|
136
129
|
aria-label="Mark message as resolved"
|
|
137
|
-
className={styles.actionButton}
|
|
138
|
-
contentClassName={styles.iconButtonContent}
|
|
139
130
|
>
|
|
140
131
|
<DsIcon icon="check_circle" size="tiny" />
|
|
141
132
|
</DsButton>
|
|
@@ -8,33 +8,13 @@ $input-min-height-initial: 20px;
|
|
|
8
8
|
$input-min-height-typing: 40px;
|
|
9
9
|
$input-min-height-thread: 28px;
|
|
10
10
|
$input-max-height: 480px;
|
|
11
|
-
$icon-button-size: 16px;
|
|
12
11
|
$scrollbar-width-textarea: 4px;
|
|
13
12
|
$scrollbar-border-radius-pill: 100px;
|
|
14
13
|
$dropdown-min-width: 160px;
|
|
15
14
|
$border-width: 1px;
|
|
16
|
-
$checkbox-border-radius: 2px;
|
|
17
15
|
|
|
18
16
|
$transition-duration: 0.2s;
|
|
19
17
|
|
|
20
|
-
@mixin icon-button-size {
|
|
21
|
-
&#{&} {
|
|
22
|
-
width: $icon-button-size;
|
|
23
|
-
height: $icon-button-size;
|
|
24
|
-
min-width: $icon-button-size;
|
|
25
|
-
min-height: $icon-button-size;
|
|
26
|
-
padding: 0;
|
|
27
|
-
border: none;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.iconButtonContent {
|
|
32
|
-
height: $icon-button-size !important;
|
|
33
|
-
min-height: $icon-button-size !important;
|
|
34
|
-
padding: 0 !important;
|
|
35
|
-
border: none !important;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
18
|
.bubble {
|
|
39
19
|
display: flex;
|
|
40
20
|
flex-direction: column;
|
|
@@ -180,11 +160,6 @@ $transition-duration: 0.2s;
|
|
|
180
160
|
}
|
|
181
161
|
}
|
|
182
162
|
|
|
183
|
-
.headerActionButton {
|
|
184
|
-
@include icon-button-size;
|
|
185
|
-
opacity: 1;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
163
|
.inputArea {
|
|
189
164
|
display: flex;
|
|
190
165
|
align-items: center;
|
|
@@ -252,20 +227,6 @@ $transition-duration: 0.2s;
|
|
|
252
227
|
padding: var(--spacing-xs) 0;
|
|
253
228
|
}
|
|
254
229
|
|
|
255
|
-
.actionRequiredCheckbox {
|
|
256
|
-
&.checked {
|
|
257
|
-
[data-state='checked'] {
|
|
258
|
-
background: var(--color-background-warning-strong);
|
|
259
|
-
border-color: var(--color-border-warning);
|
|
260
|
-
border-radius: $checkbox-border-radius;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
label {
|
|
264
|
-
color: var(--color-font-warning);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
230
|
.sendButton {
|
|
270
231
|
flex-shrink: 0;
|
|
271
232
|
}
|
|
@@ -9,7 +9,7 @@ import { DsIcon } from '../ds-icon';
|
|
|
9
9
|
import { DsTag } from '../ds-tag';
|
|
10
10
|
import { DsDropdownMenu } from '../ds-dropdown-menu';
|
|
11
11
|
import { useClickOutside, useAutoResize } from './hooks';
|
|
12
|
-
import { mergeRefs } from '
|
|
12
|
+
import { mergeRefs } from '../../utils/merge-refs';
|
|
13
13
|
|
|
14
14
|
export const DsCommentBubble = ({
|
|
15
15
|
ref,
|
|
@@ -125,14 +125,7 @@ export const DsCommentBubble = ({
|
|
|
125
125
|
<div className={styles.headerActions}>
|
|
126
126
|
<DsDropdownMenu.Root>
|
|
127
127
|
<DsDropdownMenu.Trigger asChild>
|
|
128
|
-
<DsButton
|
|
129
|
-
design="v1.2"
|
|
130
|
-
buttonType="tertiary"
|
|
131
|
-
size="small"
|
|
132
|
-
aria-label="More actions"
|
|
133
|
-
className={styles.headerActionButton}
|
|
134
|
-
contentClassName={styles.iconButtonContent}
|
|
135
|
-
>
|
|
128
|
+
<DsButton design="v1.2" buttonType="tertiary" size="tiny" aria-label="More actions">
|
|
136
129
|
<DsIcon icon="more_vert" size="tiny" />
|
|
137
130
|
</DsButton>
|
|
138
131
|
</DsDropdownMenu.Trigger>
|
|
@@ -159,11 +152,9 @@ export const DsCommentBubble = ({
|
|
|
159
152
|
<DsButton
|
|
160
153
|
design="v1.2"
|
|
161
154
|
buttonType="tertiary"
|
|
162
|
-
size="
|
|
155
|
+
size="tiny"
|
|
163
156
|
onClick={() => onResolve()}
|
|
164
157
|
aria-label="Resolve"
|
|
165
|
-
className={styles.headerActionButton}
|
|
166
|
-
contentClassName={styles.iconButtonContent}
|
|
167
158
|
>
|
|
168
159
|
<DsIcon icon="check_circle" size="tiny" />
|
|
169
160
|
</DsButton>
|
|
@@ -174,10 +165,8 @@ export const DsCommentBubble = ({
|
|
|
174
165
|
<DsButton
|
|
175
166
|
design="v1.2"
|
|
176
167
|
buttonType="tertiary"
|
|
177
|
-
size="
|
|
168
|
+
size="tiny"
|
|
178
169
|
onClick={() => onClose()}
|
|
179
|
-
className={styles.headerActionButton}
|
|
180
|
-
contentClassName={styles.iconButtonContent}
|
|
181
170
|
aria-label="Close"
|
|
182
171
|
>
|
|
183
172
|
<DsIcon icon="close" size="tiny" />
|
|
@@ -214,7 +203,14 @@ export const DsCommentBubble = ({
|
|
|
214
203
|
</div>
|
|
215
204
|
|
|
216
205
|
{(isInitialMode || hasThread) && (
|
|
217
|
-
<DsButton
|
|
206
|
+
<DsButton
|
|
207
|
+
design="v1.2"
|
|
208
|
+
buttonType="tertiary"
|
|
209
|
+
size="tiny"
|
|
210
|
+
disabled={!hasContent}
|
|
211
|
+
onClick={handleSend}
|
|
212
|
+
aria-label="Send"
|
|
213
|
+
>
|
|
218
214
|
<DsIcon icon="send" size="tiny" />
|
|
219
215
|
</DsButton>
|
|
220
216
|
)}
|
|
@@ -223,15 +219,20 @@ export const DsCommentBubble = ({
|
|
|
223
219
|
{showFooter && (
|
|
224
220
|
<div className={styles.footer}>
|
|
225
221
|
<DsCheckbox
|
|
222
|
+
variant="warning"
|
|
226
223
|
label="Action required"
|
|
227
224
|
checked={actionRequired}
|
|
228
225
|
onCheckedChange={(checked) => onActionRequiredChange?.(checked === true)}
|
|
229
|
-
className={classNames(styles.actionRequiredCheckbox, {
|
|
230
|
-
[styles.checked]: actionRequired,
|
|
231
|
-
})}
|
|
232
226
|
/>
|
|
233
227
|
|
|
234
|
-
<DsButton
|
|
228
|
+
<DsButton
|
|
229
|
+
design="v1.2"
|
|
230
|
+
buttonType="tertiary"
|
|
231
|
+
size="tiny"
|
|
232
|
+
disabled={!hasContent}
|
|
233
|
+
onClick={handleSend}
|
|
234
|
+
aria-label="Send"
|
|
235
|
+
>
|
|
235
236
|
<DsIcon icon="send" size="tiny" />
|
|
236
237
|
</DsButton>
|
|
237
238
|
</div>
|
|
@@ -101,7 +101,7 @@ export const DsCommentCard = ({
|
|
|
101
101
|
{showMoreMenu && (
|
|
102
102
|
<DsDropdownMenu.Root>
|
|
103
103
|
<DsDropdownMenu.Trigger asChild>
|
|
104
|
-
<DsButton design="v1.2" buttonType="tertiary" size="
|
|
104
|
+
<DsButton design="v1.2" buttonType="tertiary" size="tiny" aria-label="More actions">
|
|
105
105
|
<DsIcon icon="more_vert" size="tiny" />
|
|
106
106
|
</DsButton>
|
|
107
107
|
</DsDropdownMenu.Trigger>
|
|
@@ -139,7 +139,7 @@ export const DsCommentCard = ({
|
|
|
139
139
|
<DsButton
|
|
140
140
|
design="v1.2"
|
|
141
141
|
buttonType="tertiary"
|
|
142
|
-
size="
|
|
142
|
+
size="tiny"
|
|
143
143
|
onClick={handleResolve}
|
|
144
144
|
aria-label="Resolve comment"
|
|
145
145
|
>
|
|
@@ -6,8 +6,8 @@ import { Portal } from '@ark-ui/react/portal';
|
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import styles from './ds-dropdown-menu.module.scss';
|
|
8
8
|
import { DsIcon } from '../ds-icon';
|
|
9
|
-
import DsTypography from '../ds-typography
|
|
10
|
-
import DsTextInput from '../ds-text-input
|
|
9
|
+
import { DsTypography } from '../ds-typography';
|
|
10
|
+
import { DsTextInput } from '../ds-text-input';
|
|
11
11
|
import type {
|
|
12
12
|
DsDropdownMenuActionsProps,
|
|
13
13
|
DsDropdownMenuContentProps,
|
|
@@ -3,7 +3,7 @@ import { DsTextInput } from '../ds-text-input';
|
|
|
3
3
|
import { DsIcon } from '../ds-icon';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import styles from './ds-expandable-text-input.module.scss';
|
|
6
|
-
import { mergeRefs } from '
|
|
6
|
+
import { mergeRefs } from '../../utils/merge-refs';
|
|
7
7
|
import type { DsExpandableTextInputProps } from './ds-expandable-text-input.types';
|
|
8
8
|
import { DsButton } from '../ds-button';
|
|
9
9
|
|
|
@@ -11,6 +11,7 @@ export function DsExpandableTextInput({
|
|
|
11
11
|
onClear,
|
|
12
12
|
onExpandChange,
|
|
13
13
|
icon,
|
|
14
|
+
size,
|
|
14
15
|
...props
|
|
15
16
|
}: DsExpandableTextInputProps) {
|
|
16
17
|
const hasInitialValue = Boolean(props.value ?? props.defaultValue);
|
|
@@ -29,9 +30,12 @@ export function DsExpandableTextInput({
|
|
|
29
30
|
}
|
|
30
31
|
};
|
|
31
32
|
|
|
33
|
+
const clearButtonSize = size === 'small' ? 'tiny' : 'small';
|
|
34
|
+
|
|
32
35
|
return (
|
|
33
36
|
<DsTextInput
|
|
34
37
|
{...props}
|
|
38
|
+
size={size}
|
|
35
39
|
ref={mergeRefs(ref, props.ref)}
|
|
36
40
|
tabIndex={expanded ? 0 : -1}
|
|
37
41
|
className={classNames(
|
|
@@ -80,7 +84,7 @@ export function DsExpandableTextInput({
|
|
|
80
84
|
endAdornment: (
|
|
81
85
|
<DsButton
|
|
82
86
|
design="v1.2"
|
|
83
|
-
size=
|
|
87
|
+
size={clearButtonSize}
|
|
84
88
|
buttonType="tertiary"
|
|
85
89
|
variant="filled"
|
|
86
90
|
className={styles.clearTrigger}
|
|
@@ -2,7 +2,7 @@ import type React from 'react';
|
|
|
2
2
|
import { SegmentGroup } from '@ark-ui/react/segment-group';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import styles from './ds-segment-group.module.scss';
|
|
5
|
-
import DsTypography from '../ds-typography
|
|
5
|
+
import { DsTypography } from '../ds-typography';
|
|
6
6
|
import {
|
|
7
7
|
type DsSegmentGroupItemProps,
|
|
8
8
|
type DsSegmentGroupItemTextProps,
|