@drivenets/design-system 0.7.3 → 0.9.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 (117) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/index.cjs +5730 -4569
  3. package/dist/index.d.cts +1768 -1065
  4. package/dist/index.d.cts.map +1 -1
  5. package/dist/index.d.ts +1768 -1065
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +5718 -4577
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.min.css +1 -1
  10. package/package.json +14 -14
  11. package/src/components/ds-autocomplete/ds-autocomplete.module.scss +1 -2
  12. package/src/components/ds-autocomplete/ds-autocomplete.tsx +13 -8
  13. package/src/components/ds-autocomplete/ds-autocomplete.types.ts +2 -1
  14. package/src/components/ds-button/versions/ds-button-new/ds-button-new.module.scss +25 -9
  15. package/src/components/ds-button/versions/ds-button-new/ds-button-new.tsx +5 -5
  16. package/src/components/ds-button/versions/ds-button-new/ds-button-new.types.ts +11 -1
  17. package/src/components/ds-button/versions/ds-button-new/index.ts +4 -1
  18. package/src/components/ds-button-v3/ds-button-v3.module.scss +391 -0
  19. package/src/components/ds-button-v3/ds-button-v3.tsx +55 -0
  20. package/src/components/ds-button-v3/ds-button-v3.types.ts +49 -0
  21. package/src/components/ds-button-v3/index.ts +2 -0
  22. package/src/components/ds-comment-bubble/ds-comment-bubble.module.scss +6 -2
  23. package/src/components/ds-comment-bubble/ds-comment-bubble.tsx +22 -15
  24. package/src/components/ds-comment-bubble/ds-comment-bubble.types.ts +1 -0
  25. package/src/components/ds-comments-drawer/components/comments-filter-modal/comments-filter-modal.tsx +1 -1
  26. package/src/components/ds-comments-drawer/ds-comments-drawer.tsx +3 -9
  27. package/src/components/ds-date-input/ds-date-input.tsx +3 -4
  28. package/src/components/ds-date-input/ds-date-input.types.ts +3 -1
  29. package/src/components/ds-date-input/index.ts +10 -0
  30. package/src/components/ds-date-picker/components/calendar-table.module.scss +93 -0
  31. package/src/components/ds-date-picker/components/calendar-view-control/calendar-view-control.module.scss +48 -0
  32. package/src/components/ds-date-picker/components/calendar-view-control/calendar-view-control.tsx +20 -0
  33. package/src/components/ds-date-picker/components/calendar-view-control/index.ts +1 -0
  34. package/src/components/ds-date-picker/components/day-view/day-view.module.scss +12 -0
  35. package/src/components/ds-date-picker/components/day-view/day-view.tsx +45 -0
  36. package/src/components/ds-date-picker/components/day-view/index.ts +1 -0
  37. package/src/components/ds-date-picker/components/month-view/index.ts +1 -0
  38. package/src/components/ds-date-picker/components/month-view/month-view.module.scss +4 -0
  39. package/src/components/ds-date-picker/components/month-view/month-view.tsx +35 -0
  40. package/src/components/ds-date-picker/components/year-view/index.ts +1 -0
  41. package/src/components/ds-date-picker/components/year-view/year-view.module.scss +4 -0
  42. package/src/components/ds-date-picker/components/year-view/year-view.tsx +35 -0
  43. package/src/components/ds-date-picker/ds-date-picker.module.scss +29 -0
  44. package/src/components/ds-date-picker/ds-date-picker.tsx +211 -0
  45. package/src/components/ds-date-picker/ds-date-picker.types.ts +94 -0
  46. package/src/components/ds-date-picker/ds-date-picker.utils.ts +87 -0
  47. package/src/components/ds-date-picker/ds-date-picker.utils.unit.test.ts +226 -0
  48. package/src/components/ds-date-picker/index.ts +2 -0
  49. package/src/components/ds-date-range-picker/ds-date-range-picker.module.scss +20 -0
  50. package/src/components/ds-date-range-picker/ds-date-range-picker.tsx +101 -0
  51. package/src/components/ds-date-range-picker/ds-date-range-picker.types.ts +95 -0
  52. package/src/components/ds-date-range-picker/ds-date-range-picker.utils.ts +19 -0
  53. package/src/components/ds-date-range-picker/ds-date-range-picker.utils.unit.test.ts +48 -0
  54. package/src/components/ds-date-range-picker/index.ts +9 -0
  55. package/src/components/ds-drawer/ds-drawer.tsx +6 -9
  56. package/src/components/ds-drawer/ds-drawer.types.ts +4 -2
  57. package/src/components/ds-file-upload/ds-file-upload-api.types.ts +1 -0
  58. package/src/components/ds-file-upload/hooks/use-file-upload.ts +1 -1
  59. package/src/components/ds-file-upload/index.ts +6 -1
  60. package/src/components/ds-file-upload/utils/file-factory.ts +1 -0
  61. package/src/components/ds-file-upload/utils/file-factory.unit.test.ts +37 -0
  62. package/src/components/ds-form-control/ds-form-control.tsx +7 -3
  63. package/src/components/ds-key-value-pair/ds-key-value-pair.module.scss +72 -0
  64. package/src/components/ds-key-value-pair/ds-key-value-pair.tsx +47 -0
  65. package/src/components/ds-key-value-pair/ds-key-value-pair.types.ts +24 -0
  66. package/src/components/ds-key-value-pair/index.ts +3 -0
  67. package/src/components/ds-loader/ds-loader.tsx +1 -1
  68. package/src/components/ds-panel/ds-panel.module.scss +4 -1
  69. package/src/components/ds-panel/ds-panel.tsx +8 -3
  70. package/src/components/ds-panel/ds-panel.types.ts +8 -1
  71. package/src/components/ds-panel/index.ts +4 -1
  72. package/src/components/ds-select/ds-select.module.scss +4 -1
  73. package/src/components/ds-split-button/ds-split-button.module.scss +99 -0
  74. package/src/components/ds-split-button/ds-split-button.tsx +49 -0
  75. package/src/components/ds-split-button/ds-split-button.types.ts +25 -0
  76. package/src/components/ds-split-button/index.ts +10 -0
  77. package/src/components/ds-stack/ds-stack.module.scss +4 -0
  78. package/src/components/ds-stack/ds-stack.tsx +35 -0
  79. package/src/components/ds-stack/ds-stack.types.ts +19 -0
  80. package/src/components/ds-stack/index.ts +18 -0
  81. package/src/components/ds-status-badge/ds-status-badge.module.scss +1 -1
  82. package/src/components/ds-table/components/ds-table-body-virtualized/ds-table-body-virtualized.tsx +6 -4
  83. package/src/components/ds-table/components/ds-table-bulk-actions/ds-table-bulk-actions.module.scss +5 -8
  84. package/src/components/ds-table/ds-table.module.scss +6 -0
  85. package/src/components/ds-table/ds-table.tsx +3 -0
  86. package/src/components/ds-time-picker/components/time-item/index.ts +1 -0
  87. package/src/components/ds-time-picker/components/time-item/time-item.module.scss +37 -0
  88. package/src/components/ds-time-picker/components/time-item/time-item.tsx +26 -0
  89. package/src/components/ds-time-picker/components/time-item/time-item.types.ts +10 -0
  90. package/src/components/ds-time-picker/components/time-scroller/index.ts +2 -0
  91. package/src/components/ds-time-picker/components/time-scroller/time-scroller.module.scss +25 -0
  92. package/src/components/ds-time-picker/components/time-scroller/time-scroller.tsx +61 -0
  93. package/src/components/ds-time-picker/components/time-scroller/time-scroller.types.ts +17 -0
  94. package/src/components/ds-time-picker/components/time-scroller/time-scroller.utils.ts +44 -0
  95. package/src/components/ds-time-picker/ds-time-picker.module.scss +11 -0
  96. package/src/components/ds-time-picker/ds-time-picker.tsx +178 -0
  97. package/src/components/ds-time-picker/ds-time-picker.types.ts +54 -0
  98. package/src/components/ds-time-picker/ds-time-picker.utils.ts +176 -0
  99. package/src/components/ds-time-picker/ds-time-picker.utils.unit.test.ts +316 -0
  100. package/src/components/ds-time-picker/index.ts +3 -0
  101. package/src/components/ds-tooltip/ds-tooltip.module.scss +1 -7
  102. package/src/components/ds-tooltip/ds-tooltip.tsx +9 -9
  103. package/src/components/ds-tooltip/ds-tooltip.types.ts +7 -1
  104. package/src/index.ts +8 -0
  105. package/src/styles/_breakpoints.module.scss +5 -0
  106. package/src/styles/_responsive.scss +13 -0
  107. package/src/styles/_root_updated.scss +593 -0
  108. package/src/styles/_variables.scss +2 -0
  109. package/src/styles/shared/_button.scss +2 -0
  110. package/src/styles/shared/_dropdown.scss +4 -1
  111. package/src/styles/shared/_input.scss +3 -40
  112. package/src/utils/responsive.browser.test.ts +94 -0
  113. package/src/utils/responsive.ts +79 -0
  114. package/src/utils/responsive.unit.test.ts +54 -0
  115. package/src/utils/type-utils.ts +1 -0
  116. package/src/utils/use-controlled.browser.test.ts +79 -0
  117. package/src/utils/use-controlled.ts +18 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drivenets/design-system",
3
- "version": "0.7.3",
3
+ "version": "0.9.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.cts",
@@ -51,10 +51,11 @@
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.21",
55
- "@zag-js/react": "^1.35.3",
56
- "@zag-js/steps": "^1.35.3",
57
- "classnames": "^2.5.1"
54
+ "@tanstack/react-virtual": "^3.13.23",
55
+ "@zag-js/react": "^1.37.0",
56
+ "@zag-js/steps": "^1.37.0",
57
+ "classnames": "^2.5.1",
58
+ "csstype": "^3.2.3"
58
59
  },
59
60
  "peerDependencies": {
60
61
  "@internationalized/date": "^3.0.0",
@@ -67,14 +68,14 @@
67
68
  "@eslint/compat": "^2.0.3",
68
69
  "@faker-js/faker": "^10.3.0",
69
70
  "@hookform/resolvers": "^5.2.2",
70
- "@rollup/plugin-babel": "^7.0.0",
71
+ "@rolldown/plugin-babel": "^0.2.2",
71
72
  "@storybook/addon-a11y": "^10.2.19",
72
73
  "@storybook/addon-docs": "^10.2.19",
73
74
  "@storybook/addon-vitest": "^10.2.19",
74
- "@storybook/builder-vite": "^10.2.19",
75
75
  "@storybook/react-vite": "^10.2.19",
76
76
  "@tanstack/react-query": "^5.90.21",
77
77
  "@tanstack/react-router": "^1.166.2",
78
+ "@tsdown/css": "^0.21.6",
78
79
  "@types/eslint-plugin-jsx-a11y": "^6.10.1",
79
80
  "@types/react": "^19.2.14",
80
81
  "@types/react-dom": "^19.2.3",
@@ -89,29 +90,28 @@
89
90
  "eslint-plugin-storybook": "^10.2.19",
90
91
  "mockdate": "^3.0.5",
91
92
  "playwright": "^1.58.2",
92
- "postcss": "^8.5.8",
93
- "postcss-modules": "^6.0.1",
94
93
  "publint": "^0.3.18",
95
94
  "react": "^19.2.4",
96
95
  "react-dom": "^19.2.4",
97
96
  "react-hook-form": "^7.71.2",
98
- "rollup-plugin-sass": "^1.15.3",
99
97
  "sass-embedded": "^1.97.3",
100
98
  "storybook": "^10.2.19",
101
- "tsdown": "^0.21.0",
99
+ "tsdown": "^0.21.6",
102
100
  "typed-scss-modules": "^8.1.1",
103
101
  "typescript": "^5.9.3",
104
102
  "typescript-plugin-css-modules": "^5.2.0",
105
- "vite": "^8.0.0",
103
+ "vite": "8.0.5",
106
104
  "vitest": "^4.1.0",
107
105
  "vitest-browser-react": "^2.1.0",
108
106
  "zod": "^4.3.6",
109
107
  "@drivenets/eslint-plugin-internal": "0.0.0",
110
- "@drivenets/vite-plugin-design-system": "0.0.6"
108
+ "@drivenets/vite-plugin-design-system": "0.0.7"
111
109
  },
112
110
  "scripts": {
113
111
  "install:playwright": "pnpm exec playwright install chromium --with-deps",
114
- "lint": "pnpm generate-scss-dts && eslint --max-warnings=0 .; EXIT_CODE=$?; rm -rf .scss-dts; exit $EXIT_CODE",
112
+ "lint": "pnpm generate-scss-dts && eslint --max-warnings=0 ${ESLINT_ARGS-} .; EXIT_CODE=$?; rm -rf .scss-dts; exit $EXIT_CODE",
113
+ "//": "ESLINT_ARGS is used to pass arguments to eslint. We're using it so we don't need to duplicate the lint script.",
114
+ "lint:fix": "ESLINT_ARGS=--fix pnpm lint",
115
115
  "typecheck": "pnpm generate-scss-dts && tsc; EXIT_CODE=$?; rm -rf .scss-dts; exit $EXIT_CODE",
116
116
  "generate-scss-dts": "typed-scss-modules ./src -o ./.scss-dts --nameFormat all --exportType default > /dev/null 2>&1",
117
117
  "storybook": "storybook dev -p 6006",
@@ -49,7 +49,7 @@ $autocomplete-opacity-visible: 1;
49
49
  outline: none;
50
50
 
51
51
  &::placeholder {
52
- color: var(--color-font-placeholder);
52
+ color: var(--color-font-disabled);
53
53
  }
54
54
  }
55
55
 
@@ -200,7 +200,6 @@ $autocomplete-opacity-visible: 1;
200
200
  .disabled {
201
201
  .control {
202
202
  color: var(--color-background-deselected);
203
- background: var(--color-background-secondary);
204
203
  border-color: var(--color-border-disabled);
205
204
  cursor: not-allowed;
206
205
 
@@ -45,10 +45,7 @@ export const DsAutocomplete = ({
45
45
 
46
46
  const handleValueChange = (details: Combobox.ValueChangeDetails<DsAutocompleteOption>) => {
47
47
  const selectedItem = details.items[0];
48
-
49
- if (selectedItem) {
50
- onValueChange?.(selectedItem.value);
51
- }
48
+ onValueChange?.(selectedItem?.value ?? '');
52
49
  };
53
50
 
54
51
  const handleOpenChange = (details: Combobox.OpenChangeDetails) => {
@@ -83,12 +80,20 @@ export const DsAutocomplete = ({
83
80
  <Combobox.Input className={styles.input} placeholder={placeholder} />
84
81
 
85
82
  <Combobox.Context>
86
- {(context) => (
83
+ {(combobox) => (
87
84
  <div className={styles.iconContainer}>
88
- {context.inputValue && !disabled && (
89
- <Combobox.ClearTrigger className={styles.clearButton} aria-label="Clear">
85
+ {combobox.inputValue && !disabled && (
86
+ <button
87
+ type="button"
88
+ className={styles.clearButton}
89
+ aria-label="Clear"
90
+ onClick={() => {
91
+ combobox.setValue([]);
92
+ combobox.setInputValue('');
93
+ }}
94
+ >
90
95
  <DsIcon icon="close" size="medium" />
91
- </Combobox.ClearTrigger>
96
+ </button>
92
97
  )}
93
98
 
94
99
  {showTrigger && (
@@ -85,7 +85,8 @@ export interface DsAutocompleteProps {
85
85
  startAdornment?: React.ReactNode;
86
86
 
87
87
  /**
88
- * Event handler called when the value changes (when an option is selected)
88
+ * Event handler called when the value changes.
89
+ * Fires with the selected option's value, or an empty string when cleared.
89
90
  */
90
91
  onValueChange?: (value: string) => void;
91
92
  /**
@@ -5,6 +5,27 @@ $button-size-small: 28px;
5
5
  $button-size-default: 32px;
6
6
  $button-size-large: 40px;
7
7
 
8
+ @mixin content-size-tiny {
9
+ @include typography.body-xs-md;
10
+ height: $button-size-tiny;
11
+ border-radius: var(--spacing-4xs);
12
+ --icon-width-tiny: 13px;
13
+ }
14
+
15
+ @mixin content-size-small {
16
+ @include typography.body-xs-md;
17
+ height: $button-size-small;
18
+ }
19
+
20
+ @mixin content-size-medium {
21
+ height: $button-size-default;
22
+ }
23
+
24
+ @mixin content-size-large {
25
+ @include typography.body-md-md;
26
+ height: $button-size-large;
27
+ }
28
+
8
29
  .button {
9
30
  @include typography.body-sm-md;
10
31
  display: flex;
@@ -31,24 +52,19 @@ $button-size-large: 40px;
31
52
  }
32
53
 
33
54
  &.tiny .content {
34
- @include typography.body-xs-md;
35
- height: $button-size-tiny;
36
- border-radius: var(--spacing-4xs);
37
- --icon-width-tiny: 13px;
55
+ @include content-size-tiny;
38
56
  }
39
57
 
40
58
  &.small .content {
41
- @include typography.body-xs-md;
42
- height: $button-size-small;
59
+ @include content-size-small;
43
60
  }
44
61
 
45
62
  &.medium .content {
46
- height: $button-size-default;
63
+ @include content-size-medium;
47
64
  }
48
65
 
49
66
  &.large .content {
50
- @include typography.body-md-md;
51
- height: $button-size-large;
67
+ @include content-size-large;
52
68
  }
53
69
 
54
70
  &.iconButton {
@@ -1,8 +1,9 @@
1
1
  import classNames from 'classnames';
2
2
  import type React from 'react';
3
3
  import { Children, isValidElement } from 'react';
4
+
4
5
  import styles from './ds-button-new.module.scss';
5
- import type { DsButtonProps } from './ds-button-new.types';
6
+ import type { DsButtonBaseProps } from './ds-button-new.types';
6
7
  import { DsIcon } from '../../../ds-icon';
7
8
 
8
9
  const isIconOnly = (children: React.ReactNode) => {
@@ -19,7 +20,7 @@ const isIconOnly = (children: React.ReactNode) => {
19
20
  /**
20
21
  * Design system Button component
21
22
  */
22
- const DsButton: React.FC<DsButtonProps> = ({
23
+ const DsButton: React.FC<DsButtonBaseProps> = ({
23
24
  buttonType,
24
25
  variant = 'filled',
25
26
  size = 'medium',
@@ -36,9 +37,8 @@ const DsButton: React.FC<DsButtonProps> = ({
36
37
  styles[size],
37
38
  className,
38
39
 
39
- // @ts-expect-error: we don't have all variations of classnames defined
40
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
41
- styles[`${type}-${variant}`],
40
+ // Casting because we don't have all variations of classnames defined
41
+ styles[`${type}-${variant}` as keyof typeof styles],
42
42
  );
43
43
 
44
44
  return (
@@ -1,5 +1,7 @@
1
1
  import type React from 'react';
2
2
 
3
+ import type { ResponsiveValue } from '../../../../utils/responsive';
4
+
3
5
  export const buttonTypes = ['primary', 'secondary', 'secondary-light', 'tertiary'] as const;
4
6
  export type ButtonType = (typeof buttonTypes)[number];
5
7
 
@@ -9,7 +11,7 @@ export type ButtonVariant = (typeof buttonVariants)[number];
9
11
  export const buttonSizes = ['large', 'medium', 'small', 'tiny'] as const;
10
12
  export type ButtonSize = (typeof buttonSizes)[number];
11
13
 
12
- export interface DsButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
14
+ export interface DsButtonBaseProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
13
15
  /**
14
16
  * Type of the button
15
17
  * @default 'primary'
@@ -39,3 +41,11 @@ export interface DsButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElem
39
41
  */
40
42
  contentClassName?: string;
41
43
  }
44
+
45
+ export interface DsButtonProps extends Omit<DsButtonBaseProps, 'size'> {
46
+ /**
47
+ * Size of the button. Accepts a static value or a responsive object.
48
+ * @default 'medium'
49
+ */
50
+ size?: ResponsiveValue<ButtonSize>;
51
+ }
@@ -1,2 +1,5 @@
1
- export { default as DsButtonNew } from './ds-button-new';
1
+ import { withResponsiveProps } from '../../../../utils/responsive';
2
+ import DsButtonBase from './ds-button-new';
3
+
4
+ export const DsButtonNew = withResponsiveProps(DsButtonBase, ['size']);
2
5
  export * from './ds-button-new.types';
@@ -0,0 +1,391 @@
1
+ @use '../../styles/root_updated';
2
+ @use '../../styles/shared/button' as button;
3
+
4
+ $height-large: 40px;
5
+ $height-medium: 36px;
6
+ $height-small: 28px;
7
+ $border-radius: 4px;
8
+ $focus-ring-width: 2px;
9
+
10
+ @mixin focus-ring($outer-color) {
11
+ outline: $focus-ring-width solid $outer-color;
12
+ }
13
+
14
+ .root {
15
+ box-sizing: border-box;
16
+ display: inline-flex;
17
+ align-items: center;
18
+ justify-content: center;
19
+ gap: var(--3xs);
20
+ margin: 0;
21
+ border: 1px solid transparent;
22
+ border-radius: $border-radius;
23
+ background: transparent;
24
+ font-family: var(--font-family-base);
25
+ font-weight: var(--font-weight-medium);
26
+ text-align: center;
27
+ cursor: pointer;
28
+ transition:
29
+ background-color button.$transition-duration-default,
30
+ border-color button.$transition-duration-quick,
31
+ color button.$transition-duration-default,
32
+ outline-color button.$transition-duration-quick;
33
+
34
+ &:disabled:not([data-loading]) {
35
+ cursor: not-allowed;
36
+ }
37
+
38
+ &[data-loading] {
39
+ cursor: default;
40
+ pointer-events: none;
41
+ }
42
+
43
+ &:focus {
44
+ outline: none;
45
+ }
46
+
47
+ &:focus-visible {
48
+ outline-style: solid;
49
+ }
50
+
51
+ &[data-size='large'] {
52
+ padding: var(--3xs) var(--sm);
53
+ min-height: $height-large;
54
+ font-size: var(--font-size-md);
55
+ line-height: var(--line-height-md);
56
+ }
57
+
58
+ &[data-size='medium'] {
59
+ padding: var(--3xs) var(--sm);
60
+ min-height: $height-medium;
61
+ font-size: var(--font-size-sm);
62
+ line-height: var(--line-height-sm);
63
+ }
64
+
65
+ &[data-size='small'] {
66
+ padding: var(--3xs) var(--sm);
67
+ min-height: $height-small;
68
+ font-size: var(--font-size-xs);
69
+ line-height: var(--line-height-xs);
70
+ }
71
+
72
+ &[data-size='tiny'] {
73
+ min-height: var(--icon-width-tiny);
74
+ padding: 0 var(--3xs);
75
+ font-size: var(--font-size-xs);
76
+ line-height: var(--line-height-xs);
77
+ }
78
+
79
+ &[data-icon-only][data-size='large'] {
80
+ padding: var(--3xs);
81
+ min-width: $height-large;
82
+ }
83
+
84
+ &[data-icon-only][data-size='medium'] {
85
+ padding: var(--3xs);
86
+ min-width: $height-medium;
87
+ }
88
+
89
+ &[data-icon-only][data-size='small'] {
90
+ padding: var(--3xs);
91
+ min-width: $height-small;
92
+ }
93
+
94
+ &[data-icon-only][data-size='tiny'] {
95
+ padding: 0;
96
+ min-width: var(--icon-width-tiny);
97
+ }
98
+ }
99
+
100
+ .root[data-color='default'][data-variant='primary'] {
101
+ background-color: var(--background-background-primary);
102
+ color: var(--font-font-on-action);
103
+ border-color: transparent;
104
+
105
+ &:hover:not(:disabled):not(:active):not([data-selected='true']) {
106
+ background-color: var(--background-background-primary-hover);
107
+ }
108
+
109
+ &:active:not(:disabled) {
110
+ background-color: var(--background-background-primary-selected);
111
+ }
112
+
113
+ &:focus-visible {
114
+ @include focus-ring(var(--border-border-action-primary));
115
+
116
+ background-color: var(--background-background-primary-hover);
117
+ border-color: var(--border-border-inverse);
118
+ }
119
+
120
+ &[data-selected='true'] {
121
+ background-color: var(--background-background-primary-selected);
122
+ }
123
+
124
+ &:disabled:not([data-loading]) {
125
+ background-color: var(--background-background-disable);
126
+ color: var(--font-font-on-action);
127
+ }
128
+ }
129
+
130
+ .root[data-color='default'][data-variant='secondary'] {
131
+ background-color: var(--background-background-action-secondary);
132
+ color: var(--font-font-main);
133
+ border-color: var(--border-border);
134
+
135
+ &:hover:not(:disabled):not(:active):not([data-selected='true']) {
136
+ background-color: var(--background-background-secondary-hover);
137
+ color: var(--font-font-action-secondary);
138
+ border-color: var(--border-border-secondary-hover);
139
+ }
140
+
141
+ &:active:not(:disabled) {
142
+ background-color: var(--background-background-action-secondary-hover);
143
+ color: var(--font-font-action-secondary);
144
+ border-color: var(--border-border-secondary-hover);
145
+ }
146
+
147
+ &:focus-visible {
148
+ @include focus-ring(var(--border-border-action-primary-hover));
149
+
150
+ background-color: var(--background-background-secondary-hover);
151
+ border-color: var(--border-border-inverse);
152
+ color: var(--font-font-action-secondary);
153
+ }
154
+
155
+ &[data-selected='true'] {
156
+ background-color: var(--background-background-action-secondary-hover);
157
+ color: var(--font-font-action-secondary);
158
+ border-color: var(--border-border-secondary-hover);
159
+ }
160
+
161
+ &:disabled:not([data-loading]) {
162
+ background-color: var(--background-background-action-secondary);
163
+ color: var(--font-font-disabled);
164
+ border-color: var(--border-border-disabled);
165
+ }
166
+ }
167
+
168
+ .root[data-color='default'][data-variant='tertiary'] {
169
+ background-color: transparent;
170
+ color: var(--font-font-main);
171
+ border-color: transparent;
172
+
173
+ &:hover:not(:disabled):not(:active):not([data-selected='true']) {
174
+ background-color: var(--background-background-secondary-hover);
175
+ color: var(--font-font-action-secondary);
176
+ }
177
+
178
+ &:active:not(:disabled) {
179
+ background-color: var(--background-background-action-secondary-hover);
180
+ color: var(--font-font-action-secondary);
181
+ }
182
+
183
+ &:focus-visible {
184
+ @include focus-ring(var(--border-border-action-primary-hover));
185
+
186
+ background-color: var(--background-background-secondary-hover);
187
+ border-color: var(--border-border-inverse);
188
+ color: var(--font-font-action-secondary);
189
+ }
190
+
191
+ &[data-selected='true'] {
192
+ background-color: var(--background-background-action-secondary-hover);
193
+ color: var(--font-font-action-secondary);
194
+ }
195
+
196
+ &:disabled:not([data-loading]) {
197
+ background-color: transparent;
198
+ color: var(--font-font-disabled);
199
+ }
200
+ }
201
+
202
+ .root[data-color='negative'][data-variant='primary'] {
203
+ background-color: var(--background-background-negative);
204
+ color: var(--font-font-on-action);
205
+ border-color: transparent;
206
+
207
+ &:hover:not(:disabled):not(:active):not([data-selected='true']) {
208
+ background-color: var(--background-background-negative-hover);
209
+ }
210
+
211
+ &:active:not(:disabled) {
212
+ background-color: var(--background-background-negative-selected);
213
+ }
214
+
215
+ &:focus-visible {
216
+ @include focus-ring(var(--border-border-negative));
217
+
218
+ background-color: var(--background-background-negative-hover);
219
+ border-color: var(--border-border-inverse);
220
+ }
221
+
222
+ &[data-selected='true'] {
223
+ background-color: var(--background-background-negative-selected);
224
+ }
225
+
226
+ &:disabled:not([data-loading]) {
227
+ background-color: var(--background-background-disable);
228
+ color: var(--font-font-on-action);
229
+ }
230
+ }
231
+
232
+ .root[data-color='negative'][data-variant='secondary'] {
233
+ background-color: var(--background-background-action-secondary);
234
+ color: var(--font-font-negative);
235
+ border-color: var(--border-border-negative);
236
+
237
+ &:hover:not(:disabled):not(:active):not([data-selected='true']) {
238
+ background-color: var(--background-background-negative-secondary-hover);
239
+ border-color: var(--border-border-negative-hover);
240
+ }
241
+
242
+ &:active:not(:disabled) {
243
+ background-color: var(--background-background-negative-secondary-selected);
244
+ border-color: var(--border-border-negative-hover);
245
+ }
246
+
247
+ &:focus-visible {
248
+ @include focus-ring(var(--border-border-negative));
249
+
250
+ background-color: var(--background-background-negative-secondary-hover);
251
+ border-color: var(--border-border-inverse);
252
+ }
253
+
254
+ &[data-selected='true'] {
255
+ background-color: var(--background-background-negative-secondary-selected);
256
+ border-color: var(--border-border-negative-hover);
257
+ }
258
+
259
+ &:disabled:not([data-loading]) {
260
+ background-color: var(--background-background-action-secondary);
261
+ color: var(--font-font-disabled);
262
+ border-color: var(--border-border-disabled);
263
+ }
264
+ }
265
+
266
+ .root[data-color='negative'][data-variant='tertiary'] {
267
+ background-color: transparent;
268
+ color: var(--font-font-negative);
269
+ border-color: transparent;
270
+
271
+ &:hover:not(:disabled):not(:active):not([data-selected='true']) {
272
+ background-color: var(--background-background-negative-secondary-hover);
273
+ }
274
+
275
+ &:active:not(:disabled) {
276
+ background-color: var(--background-background-negative-secondary-selected);
277
+ }
278
+
279
+ &:focus-visible {
280
+ @include focus-ring(var(--border-border-negative));
281
+
282
+ background-color: var(--background-background-negative-secondary-hover);
283
+ border-color: var(--border-border-inverse);
284
+ }
285
+
286
+ &[data-selected='true'] {
287
+ background-color: var(--background-background-negative-secondary-selected);
288
+ }
289
+
290
+ &:disabled:not([data-loading]) {
291
+ background-color: transparent;
292
+ color: var(--font-font-disabled);
293
+ }
294
+ }
295
+
296
+ .root[data-color='light'][data-variant='primary'] {
297
+ background-color: var(--background-background-ondark-primary);
298
+ color: var(--font-font-on-action);
299
+ border-color: transparent;
300
+
301
+ &:hover:not(:disabled):not(:active):not([data-selected='true']) {
302
+ background-color: var(--background-background-ondark-primary-hover);
303
+ }
304
+
305
+ &:active:not(:disabled) {
306
+ background-color: var(--background-background-ondark-primary-selected);
307
+ }
308
+
309
+ &:focus-visible {
310
+ @include focus-ring(var(--outline-outline-inverse));
311
+
312
+ background-color: var(--background-background-ondark-primary-hover);
313
+ border-color: var(--border-border-action-secondary);
314
+ }
315
+
316
+ &[data-selected='true'] {
317
+ background-color: var(--background-background-ondark-primary-selected);
318
+ }
319
+
320
+ &:disabled:not([data-loading]) {
321
+ background-color: var(--background-background-ondark-disabled);
322
+ color: var(--font-font-disabled);
323
+ }
324
+ }
325
+
326
+ .root[data-color='light'][data-variant='secondary'] {
327
+ background-color: transparent;
328
+ color: var(--font-font-on-action);
329
+ border-color: var(--border-border-ondark-secondary);
330
+
331
+ &:hover:not(:disabled):not(:active):not([data-selected='true']) {
332
+ background-color: var(--background-background-ondark-secondary-hover);
333
+ color: var(--font-font-on-action);
334
+ }
335
+
336
+ &:active:not(:disabled) {
337
+ background-color: var(--background-background-ondark-secondary-selected);
338
+ color: var(--font-font-on-action);
339
+ }
340
+
341
+ &:focus-visible {
342
+ @include focus-ring(var(--outline-outline-inverse));
343
+
344
+ background-color: var(--background-background-ondark-secondary-hover);
345
+ border-color: var(--border-border-action-secondary);
346
+ color: var(--font-font-on-action);
347
+ }
348
+
349
+ &[data-selected='true'] {
350
+ background-color: var(--background-background-ondark-secondary-selected);
351
+ }
352
+
353
+ &:disabled:not([data-loading]) {
354
+ background-color: transparent;
355
+ color: var(--font-font-ondark-disabled);
356
+ border-color: var(--background-background-ondark-disabled);
357
+ }
358
+ }
359
+
360
+ .root[data-color='light'][data-variant='tertiary'] {
361
+ background-color: transparent;
362
+ color: var(--font-font-on-action);
363
+ border-color: transparent;
364
+
365
+ &:hover:not(:disabled):not(:active):not([data-selected='true']) {
366
+ background-color: var(--background-background-ondark-secondary-hover);
367
+ color: var(--font-font-on-action);
368
+ }
369
+
370
+ &:active:not(:disabled) {
371
+ background-color: var(--background-background-ondark-secondary-selected);
372
+ color: var(--font-font-on-action);
373
+ }
374
+
375
+ &:focus-visible {
376
+ @include focus-ring(var(--outline-outline-inverse));
377
+
378
+ background-color: var(--background-background-ondark-secondary-hover);
379
+ border-color: var(--border-border-action-secondary);
380
+ color: var(--font-font-on-action);
381
+ }
382
+
383
+ &[data-selected='true'] {
384
+ background-color: var(--background-background-ondark-secondary-selected);
385
+ }
386
+
387
+ &:disabled:not([data-loading]) {
388
+ background-color: transparent;
389
+ color: var(--font-font-ondark-disabled);
390
+ }
391
+ }