@salutejs/plasma-new-hope 0.84.2-canary.1217.9226352649.0 → 0.85.0-canary.1213.9222480539.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. package/cjs/components/Button/Button.css +9 -6
  2. package/cjs/components/Button/Button.js +16 -2
  3. package/cjs/components/Button/Button.js.map +1 -1
  4. package/cjs/components/Button/Button.styles.js +31 -10
  5. package/cjs/components/Button/Button.styles.js.map +1 -1
  6. package/cjs/components/Button/Button.styles_1oz1dew.css +8 -0
  7. package/cjs/components/Button/Button.tokens.js +5 -0
  8. package/cjs/components/Button/Button.tokens.js.map +1 -1
  9. package/cjs/components/Button/variations/_stretching/base.js +1 -1
  10. package/cjs/components/Button/variations/_stretching/base.js.map +1 -1
  11. package/{es/components/Button/variations/_stretching/base_1lx0ute.css → cjs/components/Button/variations/_stretching/base_hy8dc.css} +1 -1
  12. package/cjs/components/ButtonGroup/ButtonGroup.css +2 -2
  13. package/cjs/components/ButtonGroup/ButtonGroup.tokens.js +1 -0
  14. package/cjs/components/ButtonGroup/ButtonGroup.tokens.js.map +1 -1
  15. package/cjs/components/ButtonGroup/variations/_orientation/base.js +1 -1
  16. package/cjs/components/ButtonGroup/variations/_orientation/base.js.map +1 -1
  17. package/{es/components/ButtonGroup/variations/_orientation/base_p85v51.css → cjs/components/ButtonGroup/variations/_orientation/base_y7z7cs.css} +1 -1
  18. package/cjs/components/ButtonGroup/variations/_view/base.js +1 -1
  19. package/cjs/components/ButtonGroup/variations/_view/base.js.map +1 -1
  20. package/cjs/components/ButtonGroup/variations/_view/base_1n9gznw.css +1 -0
  21. package/cjs/components/Checkbox/Checkbox.styles.js.map +1 -1
  22. package/cjs/components/Drawer/Drawer.css +9 -6
  23. package/cjs/components/Drawer/ui/DrawerContent/DrawerContent.css +9 -6
  24. package/cjs/components/Header/ui/HeaderArrow/HeaderArrow.css +9 -6
  25. package/cjs/components/Header/ui/HeaderArrow/HeaderArrow.js +4 -2
  26. package/cjs/components/Header/ui/HeaderArrow/HeaderArrow.js.map +1 -1
  27. package/cjs/components/IconButton/IconButton.css +10 -7
  28. package/cjs/components/IconButton/IconButton.styles.js +1 -1
  29. package/cjs/components/IconButton/{IconButton.styles_1hknr37.css → IconButton.styles_7v8g0e.css} +1 -1
  30. package/cjs/components/Notification/Notification.css +9 -6
  31. package/cjs/components/Notification/NotificationsProvider.css +9 -6
  32. package/cjs/components/Pagination/Pagination.css +11 -8
  33. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +9 -6
  34. package/cjs/components/Panel/ui/PanelHeader/PanelHeader.css +9 -6
  35. package/cjs/components/Radiobox/Radiobox.js.map +1 -1
  36. package/cjs/components/Select/Select.css +9 -6
  37. package/cjs/components/Select/ui/SelectTarget/SelectTarget.css +9 -6
  38. package/cjs/components/Toast/Toast.css +9 -6
  39. package/cjs/components/Toast/ToastController.css +9 -6
  40. package/cjs/index.css +12 -9
  41. package/es/components/Button/Button.css +9 -6
  42. package/es/components/Button/Button.js +17 -3
  43. package/es/components/Button/Button.js.map +1 -1
  44. package/es/components/Button/Button.styles.js +29 -11
  45. package/es/components/Button/Button.styles.js.map +1 -1
  46. package/es/components/Button/Button.styles_1oz1dew.css +8 -0
  47. package/es/components/Button/Button.tokens.js +5 -0
  48. package/es/components/Button/Button.tokens.js.map +1 -1
  49. package/es/components/Button/variations/_stretching/base.js +1 -1
  50. package/es/components/Button/variations/_stretching/base.js.map +1 -1
  51. package/{cjs/components/Button/variations/_stretching/base_1lx0ute.css → es/components/Button/variations/_stretching/base_hy8dc.css} +1 -1
  52. package/es/components/ButtonGroup/ButtonGroup.css +2 -2
  53. package/es/components/ButtonGroup/ButtonGroup.tokens.js +1 -0
  54. package/es/components/ButtonGroup/ButtonGroup.tokens.js.map +1 -1
  55. package/es/components/ButtonGroup/variations/_orientation/base.js +1 -1
  56. package/es/components/ButtonGroup/variations/_orientation/base.js.map +1 -1
  57. package/{cjs/components/ButtonGroup/variations/_orientation/base_p85v51.css → es/components/ButtonGroup/variations/_orientation/base_y7z7cs.css} +1 -1
  58. package/es/components/ButtonGroup/variations/_view/base.js +1 -1
  59. package/es/components/ButtonGroup/variations/_view/base.js.map +1 -1
  60. package/es/components/ButtonGroup/variations/_view/base_1n9gznw.css +1 -0
  61. package/es/components/Checkbox/Checkbox.styles.js.map +1 -1
  62. package/es/components/Drawer/Drawer.css +9 -6
  63. package/es/components/Drawer/ui/DrawerContent/DrawerContent.css +9 -6
  64. package/es/components/Header/ui/HeaderArrow/HeaderArrow.css +9 -6
  65. package/es/components/Header/ui/HeaderArrow/HeaderArrow.js +4 -2
  66. package/es/components/Header/ui/HeaderArrow/HeaderArrow.js.map +1 -1
  67. package/es/components/IconButton/IconButton.css +10 -7
  68. package/es/components/IconButton/IconButton.styles.js +1 -1
  69. package/es/components/IconButton/{IconButton.styles_1hknr37.css → IconButton.styles_7v8g0e.css} +1 -1
  70. package/es/components/Notification/Notification.css +9 -6
  71. package/es/components/Notification/NotificationsProvider.css +9 -6
  72. package/es/components/Pagination/Pagination.css +11 -8
  73. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +9 -6
  74. package/es/components/Panel/ui/PanelHeader/PanelHeader.css +9 -6
  75. package/es/components/Radiobox/Radiobox.js.map +1 -1
  76. package/es/components/Select/Select.css +9 -6
  77. package/es/components/Select/ui/SelectTarget/SelectTarget.css +9 -6
  78. package/es/components/Toast/Toast.css +9 -6
  79. package/es/components/Toast/ToastController.css +9 -6
  80. package/es/index.css +12 -9
  81. package/package.json +2 -2
  82. package/styled-components/cjs/components/Button/Button.js +16 -2
  83. package/styled-components/cjs/components/Button/Button.styles.js +20 -12
  84. package/styled-components/cjs/components/Button/Button.template-doc.mdx +42 -0
  85. package/styled-components/cjs/components/Button/Button.tokens.js +5 -0
  86. package/styled-components/cjs/components/Button/variations/_stretching/base.js +1 -1
  87. package/styled-components/cjs/components/ButtonGroup/ButtonGroup.tokens.js +1 -0
  88. package/styled-components/cjs/components/ButtonGroup/variations/_orientation/base.js +2 -1
  89. package/styled-components/cjs/components/ButtonGroup/variations/_view/base.js +1 -1
  90. package/styled-components/cjs/components/Header/ui/HeaderArrow/HeaderArrow.js +4 -2
  91. package/styled-components/cjs/examples/plasma_b2c/components/Button/Button.config.js +19 -19
  92. package/styled-components/cjs/examples/plasma_b2c/components/Button/Button.stories.tsx +67 -21
  93. package/styled-components/cjs/examples/plasma_b2c/components/ButtonGroup/ButtonGroup.config.js +10 -10
  94. package/styled-components/cjs/examples/plasma_b2c/components/ButtonGroup/ButtonGroup.stories.tsx +1 -1
  95. package/styled-components/cjs/examples/plasma_web/components/Button/Button.config.js +19 -19
  96. package/styled-components/cjs/examples/plasma_web/components/Button/Button.stories.tsx +90 -28
  97. package/styled-components/cjs/examples/plasma_web/components/ButtonGroup/ButtonGroup.config.js +10 -10
  98. package/styled-components/cjs/examples/plasma_web/components/ButtonGroup/ButtonGroup.stories.tsx +1 -1
  99. package/styled-components/cjs/examples/sds_engineer/components/Button/Button.config.js +19 -19
  100. package/styled-components/cjs/examples/sds_engineer/components/Button/Button.stories.tsx +90 -28
  101. package/styled-components/cjs/examples/sds_engineer/components/ButtonGroup/ButtonGroup.config.js +10 -10
  102. package/styled-components/cjs/examples/sds_engineer/components/ButtonGroup/ButtonGroup.stories.tsx +1 -1
  103. package/styled-components/es/components/Button/Button.js +17 -3
  104. package/styled-components/es/components/Button/Button.styles.js +19 -11
  105. package/styled-components/es/components/Button/Button.template-doc.mdx +42 -0
  106. package/styled-components/es/components/Button/Button.tokens.js +5 -0
  107. package/styled-components/es/components/Button/variations/_stretching/base.js +1 -1
  108. package/styled-components/es/components/ButtonGroup/ButtonGroup.tokens.js +1 -0
  109. package/styled-components/es/components/ButtonGroup/variations/_orientation/base.js +3 -2
  110. package/styled-components/es/components/ButtonGroup/variations/_view/base.js +1 -1
  111. package/styled-components/es/components/Header/ui/HeaderArrow/HeaderArrow.js +4 -2
  112. package/styled-components/es/examples/plasma_b2c/components/Button/Button.config.js +19 -19
  113. package/styled-components/es/examples/plasma_b2c/components/Button/Button.stories.tsx +67 -21
  114. package/styled-components/es/examples/plasma_b2c/components/ButtonGroup/ButtonGroup.config.js +10 -10
  115. package/styled-components/es/examples/plasma_b2c/components/ButtonGroup/ButtonGroup.stories.tsx +1 -1
  116. package/styled-components/es/examples/plasma_web/components/Button/Button.config.js +19 -19
  117. package/styled-components/es/examples/plasma_web/components/Button/Button.stories.tsx +90 -28
  118. package/styled-components/es/examples/plasma_web/components/ButtonGroup/ButtonGroup.config.js +10 -10
  119. package/styled-components/es/examples/plasma_web/components/ButtonGroup/ButtonGroup.stories.tsx +1 -1
  120. package/styled-components/es/examples/sds_engineer/components/Button/Button.config.js +19 -19
  121. package/styled-components/es/examples/sds_engineer/components/Button/Button.stories.tsx +90 -28
  122. package/styled-components/es/examples/sds_engineer/components/ButtonGroup/ButtonGroup.config.js +10 -10
  123. package/styled-components/es/examples/sds_engineer/components/ButtonGroup/ButtonGroup.stories.tsx +1 -1
  124. package/types/components/Button/Button.d.ts.map +1 -1
  125. package/types/components/Button/Button.styles.d.ts +5 -1
  126. package/types/components/Button/Button.styles.d.ts.map +1 -1
  127. package/types/components/Button/Button.tokens.d.ts +5 -0
  128. package/types/components/Button/Button.tokens.d.ts.map +1 -1
  129. package/types/components/Button/Button.types.d.ts +16 -4
  130. package/types/components/Button/Button.types.d.ts.map +1 -1
  131. package/types/components/ButtonGroup/ButtonGroup.tokens.d.ts +1 -0
  132. package/types/components/ButtonGroup/ButtonGroup.tokens.d.ts.map +1 -1
  133. package/types/components/ButtonGroup/variations/_orientation/base.d.ts.map +1 -1
  134. package/types/components/ButtonGroup/variations/_view/base.d.ts.map +1 -1
  135. package/types/components/Header/ui/HeaderArrow/HeaderArrow.d.ts.map +1 -1
  136. package/types/components/Notification/Notification.styles.d.ts +43 -1
  137. package/types/components/Notification/Notification.styles.d.ts.map +1 -1
  138. package/types/components/Pagination/Pagination.styles.d.ts +86 -2
  139. package/types/components/Pagination/Pagination.styles.d.ts.map +1 -1
  140. package/types/components/Panel/ui/PanelHeader/PanelHeader.styles.d.ts +43 -1
  141. package/types/components/Panel/ui/PanelHeader/PanelHeader.styles.d.ts.map +1 -1
  142. package/types/components/Radiobox/Radiobox.d.ts +3 -3
  143. package/types/components/Radiobox/Radiobox.d.ts.map +1 -1
  144. package/types/components/Select/ui/SelectTarget/SelectTarget.styles.d.ts +43 -1
  145. package/types/components/Select/ui/SelectTarget/SelectTarget.styles.d.ts.map +1 -1
  146. package/types/components/Toast/Toast.styles.d.ts +43 -1
  147. package/types/components/Toast/Toast.styles.d.ts.map +1 -1
  148. package/types/components/Toast/utils.d.ts +43 -1
  149. package/types/components/Toast/utils.d.ts.map +1 -1
  150. package/types/examples/plasma_b2c/components/Button/Button.config.d.ts.map +1 -1
  151. package/types/examples/plasma_b2c/components/Button/Button.d.ts +43 -1
  152. package/types/examples/plasma_b2c/components/Button/Button.d.ts.map +1 -1
  153. package/types/examples/plasma_b2c/components/ButtonGroup/ButtonGroup.config.d.ts.map +1 -1
  154. package/types/examples/plasma_b2c/components/IconButton/IconButton.d.ts +43 -1
  155. package/types/examples/plasma_b2c/components/IconButton/IconButton.d.ts.map +1 -1
  156. package/types/examples/plasma_b2c/components/Radiobox/Radiobox.d.ts +1 -1
  157. package/types/examples/plasma_b2c/components/Radiobox/Radiobox.d.ts.map +1 -1
  158. package/types/examples/plasma_web/components/Button/Button.config.d.ts.map +1 -1
  159. package/types/examples/plasma_web/components/Button/Button.d.ts +43 -1
  160. package/types/examples/plasma_web/components/Button/Button.d.ts.map +1 -1
  161. package/types/examples/plasma_web/components/ButtonGroup/ButtonGroup.config.d.ts.map +1 -1
  162. package/types/examples/plasma_web/components/IconButton/IconButton.d.ts +43 -1
  163. package/types/examples/plasma_web/components/IconButton/IconButton.d.ts.map +1 -1
  164. package/types/examples/plasma_web/components/Radiobox/Radiobox.d.ts +1 -1
  165. package/types/examples/plasma_web/components/Radiobox/Radiobox.d.ts.map +1 -1
  166. package/types/examples/sds_engineer/components/Button/Button.config.d.ts.map +1 -1
  167. package/types/examples/sds_engineer/components/Button/Button.d.ts +43 -1
  168. package/types/examples/sds_engineer/components/Button/Button.d.ts.map +1 -1
  169. package/types/examples/sds_engineer/components/ButtonGroup/ButtonGroup.config.d.ts.map +1 -1
  170. package/types/examples/sds_engineer/components/Radiobox/Radiobox.d.ts +1 -1
  171. package/types/examples/sds_engineer/components/Radiobox/Radiobox.d.ts.map +1 -1
  172. package/cjs/components/Button/Button.styles_uqvh6u.css +0 -5
  173. package/cjs/components/ButtonGroup/variations/_view/base_6k3uip.css +0 -1
  174. package/es/components/Button/Button.styles_uqvh6u.css +0 -5
  175. package/es/components/ButtonGroup/variations/_view/base_6k3uip.css +0 -1
@@ -1,55 +1,117 @@
1
- import { ComponentProps } from 'react';
1
+ import * as React from 'react';
2
+ import type { ComponentProps } from 'react';
2
3
  import type { StoryObj, Meta } from '@storybook/react';
4
+ import { disableProps } from '@salutejs/plasma-sb-utils';
3
5
 
4
- import { buttonConfig } from '../../../../components/Button';
5
- import { mergeConfig } from '../../../../engines';
6
- import { WithTheme, argTypesFromConfig } from '../../../_helpers';
6
+ import { IconMic } from '../../../../components/_Icon';
7
+ import { WithTheme } from '../../../_helpers';
7
8
 
8
- import { config } from './Button.config';
9
9
  import { Button } from './Button';
10
10
 
11
+ const views = ['default', 'accent', 'positive', 'warning', 'negative', 'dark', 'light'];
12
+ const sizes = ['l', 'm', 's', 'xs', 'xxs'];
13
+ const stretchingValues = ['auto', 'filled', 'fixed'];
14
+ const pinValues = [
15
+ '',
16
+ 'square-square',
17
+ 'square-clear',
18
+ 'clear-square',
19
+ 'clear-clear',
20
+ 'clear-circle',
21
+ 'circle-clear',
22
+ 'circle-circle',
23
+ ];
24
+ const contentPlacinValues = ['default', 'relaxed'];
25
+
11
26
  const meta: Meta<typeof Button> = {
12
27
  title: 'plasma_web/Button',
13
28
  decorators: [WithTheme],
14
29
  component: Button,
30
+ args: {
31
+ view: 'default',
32
+ size: 'm',
33
+ contentPlacing: 'default',
34
+ stretching: 'auto',
35
+ text: 'Hello',
36
+ value: 'Value',
37
+ disabled: false,
38
+ focused: true,
39
+ square: false,
40
+ isLoading: false,
41
+ },
15
42
  argTypes: {
16
- ...argTypesFromConfig(mergeConfig(buttonConfig, config)),
17
- pin: {
18
- options: [
19
- 'square-square',
20
- 'square-clear',
21
- 'clear-square',
22
- 'clear-clear',
23
- 'clear-circle',
24
- 'circle-clear',
25
- 'circle-circle',
26
- '',
27
- ],
43
+ view: {
44
+ options: views,
45
+ control: {
46
+ type: 'select',
47
+ },
48
+ },
49
+ size: {
50
+ options: sizes,
51
+ control: {
52
+ type: 'select',
53
+ },
54
+ },
55
+ contentPlacing: {
56
+ options: contentPlacinValues,
28
57
  control: {
29
58
  type: 'select',
30
59
  },
31
- table: { defaultValue: { summary: 'bottom' } },
32
60
  },
33
61
  stretching: {
34
- options: ['auto', 'filled', 'fixed'],
62
+ options: stretchingValues,
63
+ control: {
64
+ type: 'select',
65
+ },
66
+ },
67
+ pin: {
68
+ options: pinValues,
35
69
  control: {
36
70
  type: 'select',
37
71
  },
72
+ table: { defaultValue: { summary: 'bottom' } },
38
73
  },
39
74
  },
40
75
  };
41
76
 
42
77
  export default meta;
43
78
 
44
- export const Default: StoryObj<ComponentProps<typeof Button>> = {
79
+ type StoryPropsDefault = ComponentProps<typeof Button> & {
80
+ enableContentLeft: boolean;
81
+ enableContentRight: boolean;
82
+ };
83
+
84
+ const StoryDefault = ({ enableContentLeft, enableContentRight, size, ...rest }: StoryPropsDefault) => {
85
+ const iconSize = size === 'xs' ? 'xs' : 's';
86
+
87
+ return (
88
+ <Button
89
+ contentLeft={enableContentLeft ? <IconMic size={iconSize} color="inherit" /> : undefined}
90
+ contentRight={enableContentRight ? <IconMic size={iconSize} color="inherit" /> : undefined}
91
+ size={size}
92
+ {...rest}
93
+ />
94
+ );
95
+ };
96
+
97
+ export const Default: StoryObj<StoryPropsDefault> = {
45
98
  args: {
46
- children: 'Hello',
47
- view: 'default',
48
- size: 'm',
49
- disabled: false,
50
- focused: true,
51
- square: false,
52
- stretching: 'auto',
53
- isLoading: false,
99
+ enableContentLeft: false,
100
+ enableContentRight: false,
101
+ },
102
+ render: (args) => <StoryDefault {...args} />,
103
+ };
104
+
105
+ export const AccessibilityWithChildren: StoryObj<ComponentProps<typeof Button>> = {
106
+ argTypes: { ...disableProps(['text']) },
107
+ render: (props: ComponentProps<typeof Button>) => {
108
+ const args = { ...props, text: undefined };
109
+
110
+ return (
111
+ <Button {...args}>
112
+ <IconMic color="inherit" />
113
+ <span>Включить микрофон</span>
114
+ </Button>
115
+ );
54
116
  },
55
117
  };
@@ -7,16 +7,16 @@ export var config = {
7
7
  },
8
8
  variations: {
9
9
  view: {
10
- "default": /*#__PURE__*/css(["", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-hover);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
11
- accent: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent-hover);", ":var(--on-dark-text-primary);", ":var(--surface-accent-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
12
- secondary: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-primary);", ":var(--surface-transparent-secondary-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
13
- clear: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--surface-clear);", ":var(--text-primary-hover);", ":var(--surface-clear);", ":var(--text-primary-active);", ":var(--surface-clear);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
14
- positive: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--surface-positive-hover);", ":var(--on-dark-text-primary);", ":var(--surface-positive-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
15
- warning: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":var(--surface-warning-hover);", ":var(--on-dark-text-primary);", ":var(--surface-warning-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
16
- negative: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--surface-negative-hover);", ":var(--on-dark-text-primary);", ":var(--surface-negative-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
17
- dark: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-light-surface-transparent-deep);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-transparent-deep-hover);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-transparent-deep-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
18
- black: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-light-surface-solid-default);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-solid-default-hover);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-solid-default-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
19
- white: /*#__PURE__*/css(["", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default);", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default-hover);", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive)
10
+ "default": /*#__PURE__*/css(["", ":var(--inverse-text-primary);", ":var(--inverse-text-secondary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-hover);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
11
+ accent: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent-hover);", ":var(--on-dark-text-primary);", ":var(--surface-accent-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
12
+ secondary: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-primary);", ":var(--surface-transparent-secondary-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
13
+ clear: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--surface-clear);", ":var(--text-primary-hover);", ":var(--surface-clear);", ":var(--text-primary-active);", ":var(--surface-clear);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
14
+ positive: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--surface-positive-hover);", ":var(--on-dark-text-primary);", ":var(--surface-positive-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
15
+ warning: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":var(--surface-warning-hover);", ":var(--on-dark-text-primary);", ":var(--surface-warning-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
16
+ negative: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--surface-negative-hover);", ":var(--on-dark-text-primary);", ":var(--surface-negative-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
17
+ dark: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":var(--on-light-surface-transparent-deep);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-transparent-deep-hover);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-transparent-deep-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
18
+ black: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":var(--on-light-surface-solid-default);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-solid-default-hover);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-solid-default-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
19
+ white: /*#__PURE__*/css(["", ":var(--on-light-text-primary);", ":var(--on-light-text-secondary);", ":var(--on-dark-surface-solid-default);", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default-hover);", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive)
20
20
  },
21
21
  size: {
22
22
  l: /*#__PURE__*/css(["", ":0.875rem;", ":0.375rem;", ":0.875rem;", ":3.5rem;", ":1.5rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-bold-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);"], buttonGroupTokens.buttonDefaultRadius, buttonGroupTokens.buttonSegmentedRadius, buttonGroupTokens.buttonSideRadius, buttonGroupTokens.buttonHeight, buttonGroupTokens.buttonPadding, buttonGroupTokens.buttonFontFamily, buttonGroupTokens.buttonFontSize, buttonGroupTokens.buttonFontStyle, buttonGroupTokens.buttonFontWeight, buttonGroupTokens.buttonLetterSpacing, buttonGroupTokens.buttonLineHeight),
@@ -11,7 +11,7 @@ import { ButtonGroup } from './ButtonGroup';
11
11
  type StoryProps = ComponentProps<typeof ButtonGroup> & { itemsCount?: number };
12
12
  type Story = StoryObj<StoryProps>;
13
13
 
14
- const views = ['accent', 'default', 'secondary', 'success', 'warning', 'critical', 'clear'];
14
+ const views = ['accent', 'default', 'secondary', 'positive', 'warning', 'negative', 'clear'];
15
15
  const sizes = ['l', 'm', 's', 'xs', 'xxs'];
16
16
  const orientationValues = ['horizontal', 'vertical'];
17
17
  const gapValues = ['none', 'dense', 'wide'];
@@ -8,27 +8,27 @@ export var config = {
8
8
  },
9
9
  variations: {
10
10
  view: {
11
- "default": /*#__PURE__*/css(["", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-hover);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-active);"], buttonTokens.buttonColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive),
12
- accent: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent-hover);", ":var(--on-dark-text-primary);", ":var(--surface-accent-active);"], buttonTokens.buttonColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive),
13
- secondary: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-primary);", ":var(--surface-transparent-secondary-active);"], buttonTokens.buttonColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive),
14
- clear: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--surface-clear);", ":var(--text-primary-hover);", ":var(--surface-clear);", ":var(--text-primary-active);", ":var(--surface-clear);"], buttonTokens.buttonColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive),
15
- positive: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--surface-positive-hover);", ":var(--on-dark-text-primary);", ":var(--surface-positive-active);"], buttonTokens.buttonColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive),
16
- warning: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":var(--surface-warning-hover);", ":var(--on-dark-text-primary);", ":var(--surface-warning-active);"], buttonTokens.buttonColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive),
17
- negative: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--surface-negative-hover);", ":var(--on-dark-text-primary);", ":var(--surface-negative-active);"], buttonTokens.buttonColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive),
18
- dark: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-light-surface-transparent-deep);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-transparent-deep-hover);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-transparent-deep-active);"], buttonTokens.buttonColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive),
19
- black: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-light-surface-solid-default);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-solid-default-hover);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-solid-default-active);"], buttonTokens.buttonColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive),
20
- white: /*#__PURE__*/css(["", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default);", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default-hover);", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default-active);"], buttonTokens.buttonColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive)
11
+ "default": /*#__PURE__*/css(["", ":var(--inverse-text-primary);", ":var(--inverse-text-secondary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-hover);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-active);"], buttonTokens.buttonColor, buttonTokens.buttonValueColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive),
12
+ accent: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent-hover);", ":var(--on-dark-text-primary);", ":var(--surface-accent-active);"], buttonTokens.buttonColor, buttonTokens.buttonValueColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive),
13
+ secondary: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-primary);", ":var(--surface-transparent-secondary-active);"], buttonTokens.buttonColor, buttonTokens.buttonValueColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive),
14
+ clear: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--surface-clear);", ":var(--text-primary-hover);", ":var(--surface-clear);", ":var(--text-primary-active);", ":var(--surface-clear);"], buttonTokens.buttonColor, buttonTokens.buttonValueColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive),
15
+ positive: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--surface-positive-hover);", ":var(--on-dark-text-primary);", ":var(--surface-positive-active);"], buttonTokens.buttonColor, buttonTokens.buttonValueColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive),
16
+ warning: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":var(--surface-warning-hover);", ":var(--on-dark-text-primary);", ":var(--surface-warning-active);"], buttonTokens.buttonColor, buttonTokens.buttonValueColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive),
17
+ negative: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--surface-negative-hover);", ":var(--on-dark-text-primary);", ":var(--surface-negative-active);"], buttonTokens.buttonColor, buttonTokens.buttonValueColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive),
18
+ dark: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":var(--on-light-surface-transparent-deep);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-transparent-deep-hover);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-transparent-deep-active);"], buttonTokens.buttonColor, buttonTokens.buttonValueColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive),
19
+ black: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":var(--on-light-surface-solid-default);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-solid-default-hover);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-solid-default-active);"], buttonTokens.buttonColor, buttonTokens.buttonValueColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive),
20
+ white: /*#__PURE__*/css(["", ":var(--on-light-text-primary);", ":var(--on-light-text-secondary);", ":var(--on-dark-surface-solid-default);", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default-hover);", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default-active);"], buttonTokens.buttonColor, buttonTokens.buttonValueColor, buttonTokens.buttonBackgroundColor, buttonTokens.buttonColorHover, buttonTokens.buttonBackgroundColorHover, buttonTokens.buttonColorActive, buttonTokens.buttonBackgroundColorActive)
21
21
  },
22
22
  size: {
23
- l: /*#__PURE__*/css(["", ":3.5rem;", ":12.5rem;", ":1.5rem;", ":0.875rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-bold-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":1.375rem;", ":inherit;"], buttonTokens.buttonHeight, buttonTokens.buttonWidth, buttonTokens.buttonPadding, buttonTokens.buttonRadius, buttonTokens.buttonFontFamily, buttonTokens.buttonFontSize, buttonTokens.buttonFontStyle, buttonTokens.buttonFontWeight, buttonTokens.buttonLetterSpacing, buttonTokens.buttonLineHeight, buttonTokens.buttonSpinnerSize, buttonTokens.buttonSpinnerColor),
24
- lr: /*#__PURE__*/css(["", ":3.5rem;", ":12.5rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-bold-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":1.375rem;", ":inherit;"], buttonTokens.buttonHeight, buttonTokens.buttonWidth, buttonTokens.buttonFontFamily, buttonTokens.buttonFontSize, buttonTokens.buttonFontStyle, buttonTokens.buttonFontWeight, buttonTokens.buttonLetterSpacing, buttonTokens.buttonLineHeight, buttonTokens.buttonSpinnerSize, buttonTokens.buttonSpinnerColor),
25
- m: /*#__PURE__*/css(["", ":3rem;", ":11.25rem;", ":1.25rem;", ":0.75rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-bold-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":1.375rem;", ":inherit;"], buttonTokens.buttonHeight, buttonTokens.buttonWidth, buttonTokens.buttonPadding, buttonTokens.buttonRadius, buttonTokens.buttonFontFamily, buttonTokens.buttonFontSize, buttonTokens.buttonFontStyle, buttonTokens.buttonFontWeight, buttonTokens.buttonLetterSpacing, buttonTokens.buttonLineHeight, buttonTokens.buttonSpinnerSize, buttonTokens.buttonSpinnerColor),
26
- mr: /*#__PURE__*/css(["", ":3rem;", ":11.25rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-bold-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":1.375rem;", ":inherit;"], buttonTokens.buttonHeight, buttonTokens.buttonWidth, buttonTokens.buttonFontFamily, buttonTokens.buttonFontSize, buttonTokens.buttonFontStyle, buttonTokens.buttonFontWeight, buttonTokens.buttonLetterSpacing, buttonTokens.buttonLineHeight, buttonTokens.buttonSpinnerSize, buttonTokens.buttonSpinnerColor),
27
- s: /*#__PURE__*/css(["", ":2.5rem;", ":11.25rem;", ":1rem;", ":0.625rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-bold-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":1.375rem;", ":inherit;"], buttonTokens.buttonHeight, buttonTokens.buttonWidth, buttonTokens.buttonPadding, buttonTokens.buttonRadius, buttonTokens.buttonFontFamily, buttonTokens.buttonFontSize, buttonTokens.buttonFontStyle, buttonTokens.buttonFontWeight, buttonTokens.buttonLetterSpacing, buttonTokens.buttonLineHeight, buttonTokens.buttonSpinnerSize, buttonTokens.buttonSpinnerColor),
28
- sr: /*#__PURE__*/css(["", ":2.5rem;", ":11.25rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-bold-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":1.375rem;", ":inherit;"], buttonTokens.buttonHeight, buttonTokens.buttonWidth, buttonTokens.buttonFontFamily, buttonTokens.buttonFontSize, buttonTokens.buttonFontStyle, buttonTokens.buttonFontWeight, buttonTokens.buttonLetterSpacing, buttonTokens.buttonLineHeight, buttonTokens.buttonSpinnerSize, buttonTokens.buttonSpinnerColor),
29
- xs: /*#__PURE__*/css(["", ":2rem;", ":10rem;", ":0.75rem;", ":0.5rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-bold-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":1rem;", ":inherit;"], buttonTokens.buttonHeight, buttonTokens.buttonWidth, buttonTokens.buttonPadding, buttonTokens.buttonRadius, buttonTokens.buttonFontFamily, buttonTokens.buttonFontSize, buttonTokens.buttonFontStyle, buttonTokens.buttonFontWeight, buttonTokens.buttonLetterSpacing, buttonTokens.buttonLineHeight, buttonTokens.buttonSpinnerSize, buttonTokens.buttonSpinnerColor),
30
- xsr: /*#__PURE__*/css(["", ":2rem;", ":10rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-bold-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":1rem;", ":inherit;"], buttonTokens.buttonHeight, buttonTokens.buttonWidth, buttonTokens.buttonFontFamily, buttonTokens.buttonFontSize, buttonTokens.buttonFontStyle, buttonTokens.buttonFontWeight, buttonTokens.buttonLetterSpacing, buttonTokens.buttonLineHeight, buttonTokens.buttonSpinnerSize, buttonTokens.buttonSpinnerColor),
31
- xxs: /*#__PURE__*/css(["", ":1.5rem;", ":8.75rem;", ":0.625rem;", ":0.375rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-bold-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":0.75rem;", ":inherit;"], buttonTokens.buttonHeight, buttonTokens.buttonWidth, buttonTokens.buttonPadding, buttonTokens.buttonRadius, buttonTokens.buttonFontFamily, buttonTokens.buttonFontSize, buttonTokens.buttonFontStyle, buttonTokens.buttonFontWeight, buttonTokens.buttonLetterSpacing, buttonTokens.buttonLineHeight, buttonTokens.buttonSpinnerSize, buttonTokens.buttonSpinnerColor)
23
+ l: /*#__PURE__*/css(["", ":3.5rem;", ":12.5rem;", ":1.5rem;", ":0.875rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-bold-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":1.375rem;", ":inherit;", ":0 0.5rem 0 -0.125rem;", ":0 -0.125rem 0 0.5rem;", ":0 0 0 0.25rem;"], buttonTokens.buttonHeight, buttonTokens.buttonWidth, buttonTokens.buttonPadding, buttonTokens.buttonRadius, buttonTokens.buttonFontFamily, buttonTokens.buttonFontSize, buttonTokens.buttonFontStyle, buttonTokens.buttonFontWeight, buttonTokens.buttonLetterSpacing, buttonTokens.buttonLineHeight, buttonTokens.buttonSpinnerSize, buttonTokens.buttonSpinnerColor, buttonTokens.buttonLeftContentMargin, buttonTokens.buttonRightContentMargin, buttonTokens.buttonValueMargin),
24
+ lr: /*#__PURE__*/css(["", ":3.5rem;", ":12.5rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-bold-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":1.375rem;", ":inherit;", ":0 0.5rem 0 0;", ":0 0 0 0.5rem;", ":0 0 0 0.25rem;"], buttonTokens.buttonHeight, buttonTokens.buttonWidth, buttonTokens.buttonFontFamily, buttonTokens.buttonFontSize, buttonTokens.buttonFontStyle, buttonTokens.buttonFontWeight, buttonTokens.buttonLetterSpacing, buttonTokens.buttonLineHeight, buttonTokens.buttonSpinnerSize, buttonTokens.buttonSpinnerColor, buttonTokens.buttonLeftContentMargin, buttonTokens.buttonRightContentMargin, buttonTokens.buttonValueMargin),
25
+ m: /*#__PURE__*/css(["", ":3rem;", ":11.25rem;", ":1.25rem;", ":0.75rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-bold-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":1.375rem;", ":inherit;", ":0 0.375rem 0 -0.125rem;", ":0 -0.125rem 0 0.375rem;", ":0 0 0 0.25rem;"], buttonTokens.buttonHeight, buttonTokens.buttonWidth, buttonTokens.buttonPadding, buttonTokens.buttonRadius, buttonTokens.buttonFontFamily, buttonTokens.buttonFontSize, buttonTokens.buttonFontStyle, buttonTokens.buttonFontWeight, buttonTokens.buttonLetterSpacing, buttonTokens.buttonLineHeight, buttonTokens.buttonSpinnerSize, buttonTokens.buttonSpinnerColor, buttonTokens.buttonLeftContentMargin, buttonTokens.buttonRightContentMargin, buttonTokens.buttonValueMargin),
26
+ mr: /*#__PURE__*/css(["", ":3rem;", ":11.25rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-bold-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":1.375rem;", ":inherit;", ":0 0.375rem 0 0;", ":0 0 0 0.375rem;", ":0 0 0 0.25rem;"], buttonTokens.buttonHeight, buttonTokens.buttonWidth, buttonTokens.buttonFontFamily, buttonTokens.buttonFontSize, buttonTokens.buttonFontStyle, buttonTokens.buttonFontWeight, buttonTokens.buttonLetterSpacing, buttonTokens.buttonLineHeight, buttonTokens.buttonSpinnerSize, buttonTokens.buttonSpinnerColor, buttonTokens.buttonLeftContentMargin, buttonTokens.buttonRightContentMargin, buttonTokens.buttonValueMargin),
27
+ s: /*#__PURE__*/css(["", ":2.5rem;", ":11.25rem;", ":1rem;", ":0.625rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-bold-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":1.375rem;", ":inherit;", ":0 0.25rem 0 -0.125rem;", ":0 -0.125rem 0 0.25rem;", ":0 0 0 0.25rem;"], buttonTokens.buttonHeight, buttonTokens.buttonWidth, buttonTokens.buttonPadding, buttonTokens.buttonRadius, buttonTokens.buttonFontFamily, buttonTokens.buttonFontSize, buttonTokens.buttonFontStyle, buttonTokens.buttonFontWeight, buttonTokens.buttonLetterSpacing, buttonTokens.buttonLineHeight, buttonTokens.buttonSpinnerSize, buttonTokens.buttonSpinnerColor, buttonTokens.buttonLeftContentMargin, buttonTokens.buttonRightContentMargin, buttonTokens.buttonValueMargin),
28
+ sr: /*#__PURE__*/css(["", ":2.5rem;", ":11.25rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-bold-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":1.375rem;", ":inherit;", ":0 0.25rem 0 0;", ":0 0 0 0.25rem;", ":0 0 0 0.25rem;"], buttonTokens.buttonHeight, buttonTokens.buttonWidth, buttonTokens.buttonFontFamily, buttonTokens.buttonFontSize, buttonTokens.buttonFontStyle, buttonTokens.buttonFontWeight, buttonTokens.buttonLetterSpacing, buttonTokens.buttonLineHeight, buttonTokens.buttonSpinnerSize, buttonTokens.buttonSpinnerColor, buttonTokens.buttonLeftContentMargin, buttonTokens.buttonRightContentMargin, buttonTokens.buttonValueMargin),
29
+ xs: /*#__PURE__*/css(["", ":2rem;", ":10rem;", ":0.75rem;", ":0.5rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-bold-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":1rem;", ":inherit;", ":0 0.25rem 0 -0.125rem;", ":0 -0.125rem 0 0.25rem;", ":0 0 0 0.25rem;"], buttonTokens.buttonHeight, buttonTokens.buttonWidth, buttonTokens.buttonPadding, buttonTokens.buttonRadius, buttonTokens.buttonFontFamily, buttonTokens.buttonFontSize, buttonTokens.buttonFontStyle, buttonTokens.buttonFontWeight, buttonTokens.buttonLetterSpacing, buttonTokens.buttonLineHeight, buttonTokens.buttonSpinnerSize, buttonTokens.buttonSpinnerColor, buttonTokens.buttonLeftContentMargin, buttonTokens.buttonRightContentMargin, buttonTokens.buttonValueMargin),
30
+ xsr: /*#__PURE__*/css(["", ":2rem;", ":10rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-bold-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":1rem;", ":inherit;", ":0 0.25rem 0 0;", ":0 0 0 0.25rem;", ":0 0 0 0.25rem;"], buttonTokens.buttonHeight, buttonTokens.buttonWidth, buttonTokens.buttonFontFamily, buttonTokens.buttonFontSize, buttonTokens.buttonFontStyle, buttonTokens.buttonFontWeight, buttonTokens.buttonLetterSpacing, buttonTokens.buttonLineHeight, buttonTokens.buttonSpinnerSize, buttonTokens.buttonSpinnerColor, buttonTokens.buttonLeftContentMargin, buttonTokens.buttonRightContentMargin, buttonTokens.buttonValueMargin),
31
+ xxs: /*#__PURE__*/css(["", ":1.5rem;", ":8.75rem;", ":0.625rem;", ":0.375rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-bold-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":0.75rem;", ":inherit;", ":0 0.25rem 0 -0.125rem;", ":0 -0.125rem 0 0.25rem;", ":0 0 0 0.25rem;"], buttonTokens.buttonHeight, buttonTokens.buttonWidth, buttonTokens.buttonPadding, buttonTokens.buttonRadius, buttonTokens.buttonFontFamily, buttonTokens.buttonFontSize, buttonTokens.buttonFontStyle, buttonTokens.buttonFontWeight, buttonTokens.buttonLetterSpacing, buttonTokens.buttonLineHeight, buttonTokens.buttonSpinnerSize, buttonTokens.buttonSpinnerColor, buttonTokens.buttonLeftContentMargin, buttonTokens.buttonRightContentMargin, buttonTokens.buttonValueMargin)
32
32
  },
33
33
  disabled: {
34
34
  "true": /*#__PURE__*/css(["", ":0.4;"], buttonTokens.buttonDisabledOpacity)
@@ -1,55 +1,117 @@
1
- import { ComponentProps } from 'react';
1
+ import * as React from 'react';
2
+ import type { ComponentProps } from 'react';
2
3
  import type { StoryObj, Meta } from '@storybook/react';
4
+ import { disableProps } from '@salutejs/plasma-sb-utils';
3
5
 
4
- import { buttonConfig } from '../../../../components/Button';
5
- import { mergeConfig } from '../../../../engines';
6
- import { WithTheme, argTypesFromConfig } from '../../../_helpers';
6
+ import { IconMic } from '../../../../components/_Icon';
7
+ import { WithTheme } from '../../../_helpers';
7
8
 
8
- import { config } from './Button.config';
9
9
  import { Button } from './Button';
10
10
 
11
+ const views = ['default', 'accent', 'positive', 'warning', 'negative', 'dark', 'light'];
12
+ const sizes = ['l', 'm', 's', 'xs', 'xxs'];
13
+ const stretchingValues = ['auto', 'filled', 'fixed'];
14
+ const pinValues = [
15
+ '',
16
+ 'square-square',
17
+ 'square-clear',
18
+ 'clear-square',
19
+ 'clear-clear',
20
+ 'clear-circle',
21
+ 'circle-clear',
22
+ 'circle-circle',
23
+ ];
24
+ const contentPlacinValues = ['default', 'relaxed'];
25
+
11
26
  const meta: Meta<typeof Button> = {
12
27
  title: 'sds_engineer/Button',
13
28
  decorators: [WithTheme],
14
29
  component: Button,
30
+ args: {
31
+ view: 'default',
32
+ size: 'm',
33
+ contentPlacing: 'default',
34
+ stretching: 'auto',
35
+ text: 'Hello',
36
+ value: 'Value',
37
+ disabled: false,
38
+ focused: true,
39
+ square: false,
40
+ isLoading: false,
41
+ },
15
42
  argTypes: {
16
- ...argTypesFromConfig(mergeConfig(buttonConfig, config)),
17
- pin: {
18
- options: [
19
- 'square-square',
20
- 'square-clear',
21
- 'clear-square',
22
- 'clear-clear',
23
- 'clear-circle',
24
- 'circle-clear',
25
- 'circle-circle',
26
- '',
27
- ],
43
+ view: {
44
+ options: views,
45
+ control: {
46
+ type: 'select',
47
+ },
48
+ },
49
+ size: {
50
+ options: sizes,
51
+ control: {
52
+ type: 'select',
53
+ },
54
+ },
55
+ contentPlacing: {
56
+ options: contentPlacinValues,
28
57
  control: {
29
58
  type: 'select',
30
59
  },
31
- table: { defaultValue: { summary: 'bottom' } },
32
60
  },
33
61
  stretching: {
34
- options: ['auto', 'filled', 'fixed'],
62
+ options: stretchingValues,
63
+ control: {
64
+ type: 'select',
65
+ },
66
+ },
67
+ pin: {
68
+ options: pinValues,
35
69
  control: {
36
70
  type: 'select',
37
71
  },
72
+ table: { defaultValue: { summary: 'bottom' } },
38
73
  },
39
74
  },
40
75
  };
41
76
 
42
77
  export default meta;
43
78
 
44
- export const Default: StoryObj<ComponentProps<typeof Button>> = {
79
+ type StoryPropsDefault = ComponentProps<typeof Button> & {
80
+ enableContentLeft: boolean;
81
+ enableContentRight: boolean;
82
+ };
83
+
84
+ const StoryDefault = ({ enableContentLeft, enableContentRight, size, ...rest }: StoryPropsDefault) => {
85
+ const iconSize = size === 'xs' ? 'xs' : 's';
86
+
87
+ return (
88
+ <Button
89
+ contentLeft={enableContentLeft ? <IconMic size={iconSize} color="inherit" /> : undefined}
90
+ contentRight={enableContentRight ? <IconMic size={iconSize} color="inherit" /> : undefined}
91
+ size={size}
92
+ {...rest}
93
+ />
94
+ );
95
+ };
96
+
97
+ export const Default: StoryObj<StoryPropsDefault> = {
45
98
  args: {
46
- children: 'Hello',
47
- view: 'default',
48
- size: 'm',
49
- disabled: false,
50
- focused: true,
51
- square: false,
52
- stretching: 'auto',
53
- isLoading: false,
99
+ enableContentLeft: false,
100
+ enableContentRight: false,
101
+ },
102
+ render: (args) => <StoryDefault {...args} />,
103
+ };
104
+
105
+ export const AccessibilityWithChildren: StoryObj<ComponentProps<typeof Button>> = {
106
+ argTypes: { ...disableProps(['text']) },
107
+ render: (props: ComponentProps<typeof Button>) => {
108
+ const args = { ...props, text: undefined };
109
+
110
+ return (
111
+ <Button {...args}>
112
+ <IconMic color="inherit" />
113
+ <span>Включить микрофон</span>
114
+ </Button>
115
+ );
54
116
  },
55
117
  };
@@ -7,16 +7,16 @@ export var config = {
7
7
  },
8
8
  variations: {
9
9
  view: {
10
- "default": /*#__PURE__*/css(["", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-hover);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
11
- accent: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent-hover);", ":var(--on-dark-text-primary);", ":var(--surface-accent-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
12
- secondary: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-primary);", ":var(--surface-transparent-secondary-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
13
- clear: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--surface-clear);", ":var(--text-primary-hover);", ":var(--surface-clear);", ":var(--text-primary-active);", ":var(--surface-clear);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
14
- positive: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--surface-positive-hover);", ":var(--on-dark-text-primary);", ":var(--surface-positive-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
15
- warning: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":var(--surface-warning-hover);", ":var(--on-dark-text-primary);", ":var(--surface-warning-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
16
- negative: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--surface-negative-hover);", ":var(--on-dark-text-primary);", ":var(--surface-negative-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
17
- dark: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-light-surface-transparent-deep);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-transparent-deep-hover);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-transparent-deep-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
18
- black: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-light-surface-solid-default);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-solid-default-hover);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-solid-default-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
19
- white: /*#__PURE__*/css(["", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default);", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default-hover);", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive)
10
+ "default": /*#__PURE__*/css(["", ":var(--inverse-text-primary);", ":var(--inverse-text-secondary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-hover);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
11
+ accent: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent-hover);", ":var(--on-dark-text-primary);", ":var(--surface-accent-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
12
+ secondary: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-primary);", ":var(--surface-transparent-secondary-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
13
+ clear: /*#__PURE__*/css(["", ":var(--text-primary);", ":var(--text-secondary);", ":var(--surface-clear);", ":var(--text-primary-hover);", ":var(--surface-clear);", ":var(--text-primary-active);", ":var(--surface-clear);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
14
+ positive: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--surface-positive-hover);", ":var(--on-dark-text-primary);", ":var(--surface-positive-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
15
+ warning: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":var(--surface-warning-hover);", ":var(--on-dark-text-primary);", ":var(--surface-warning-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
16
+ negative: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--surface-negative-hover);", ":var(--on-dark-text-primary);", ":var(--surface-negative-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
17
+ dark: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":var(--on-light-surface-transparent-deep);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-transparent-deep-hover);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-transparent-deep-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
18
+ black: /*#__PURE__*/css(["", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":var(--on-light-surface-solid-default);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-solid-default-hover);", ":var(--on-dark-text-primary);", ":var(--on-light-surface-solid-default-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive),
19
+ white: /*#__PURE__*/css(["", ":var(--on-light-text-primary);", ":var(--on-light-text-secondary);", ":var(--on-dark-surface-solid-default);", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default-hover);", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default-active);"], buttonGroupTokens.buttonColor, buttonGroupTokens.buttonValueColor, buttonGroupTokens.buttonBackgroundColor, buttonGroupTokens.buttonColorHover, buttonGroupTokens.buttonBackgroundColorHover, buttonGroupTokens.buttonColorActive, buttonGroupTokens.buttonBackgroundColorActive)
20
20
  },
21
21
  size: {
22
22
  l: /*#__PURE__*/css(["", ":0.875rem;", ":0.375rem;", ":0.875rem;", ":3.5rem;", ":1.5rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-bold-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);"], buttonGroupTokens.buttonDefaultRadius, buttonGroupTokens.buttonSegmentedRadius, buttonGroupTokens.buttonSideRadius, buttonGroupTokens.buttonHeight, buttonGroupTokens.buttonPadding, buttonGroupTokens.buttonFontFamily, buttonGroupTokens.buttonFontSize, buttonGroupTokens.buttonFontStyle, buttonGroupTokens.buttonFontWeight, buttonGroupTokens.buttonLetterSpacing, buttonGroupTokens.buttonLineHeight),
@@ -11,7 +11,7 @@ import { ButtonGroup } from './ButtonGroup';
11
11
  type StoryProps = ComponentProps<typeof ButtonGroup> & { itemsCount?: number };
12
12
  type Story = StoryObj<StoryProps>;
13
13
 
14
- const views = ['accent', 'default', 'secondary', 'success', 'warning', 'critical', 'clear'];
14
+ const views = ['accent', 'default', 'secondary', 'positive', 'warning', 'negative', 'clear'];
15
15
  const sizes = ['l', 'm', 's', 'xs', 'xxs'];
16
16
  const orientationValues = ['horizontal', 'vertical'];
17
17
  const gapValues = ['none', 'dense', 'wide'];
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAU/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,eAAO,MAAM,UAAU,SAAU,UAAU,iBAAiB,EAAE,WAAW,CAAC,uGA4DpE,CAAC;AAEP,eAAO,MAAM,YAAY;;;mBA9DQ,UAAU,iBAAiB,EAAE,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8FzE,CAAC"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAU/C,OAAO,KAAK,EAAE,WAAW,EAA0B,MAAM,gBAAgB,CAAC;AAa1E,eAAO,MAAM,UAAU,SAAU,UAAU,iBAAiB,EAAE,WAAW,CAAC,uGAyEpE,CAAC;AAEP,eAAO,MAAM,YAAY;;;mBA3EQ,UAAU,iBAAiB,EAAE,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2GzE,CAAC"}
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
- export declare const base: import("@linaria/core").LinariaClassName;
3
2
  export declare const ButtonText: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
3
+ export declare const ButtonValue: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
4
4
  export declare const LoadWrap: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
5
+ contentPlacing: string;
5
6
  isLoading?: boolean | undefined;
6
7
  }>;
7
8
  export declare const Loader: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
@@ -21,5 +22,8 @@ export declare const StyledSpinner: import("@linaria/react").StyledMeta & import
21
22
  size?: undefined;
22
23
  view?: string | undefined;
23
24
  } & import("react").RefAttributes<HTMLDivElement>))>;
25
+ export declare const StyledContentLeft: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
26
+ export declare const StyledContentRight: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
27
+ export declare const base: import("@linaria/core").LinariaClassName;
24
28
  export declare const baseContent: string;
25
29
  //# sourceMappingURL=Button.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.styles.ts"],"names":[],"mappings":";AAaA,eAAO,MAAM,IAAI,0CA0BhB,CAAC;AAKF,eAAO,MAAM,UAAU,uKAUtB,CAAC;AAGF,eAAO,MAAM,QAAQ;;EAOpB,CAAC;AAEF,eAAO,MAAM,MAAM,qKAElB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;oDAGzB,CAAC;AAGF,eAAO,MAAM,WAAW,QA6FvB,CAAC"}
1
+ {"version":3,"file":"Button.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.styles.ts"],"names":[],"mappings":";AAaA,eAAO,MAAM,UAAU,uKAWtB,CAAC;AAEF,eAAO,MAAM,WAAW,uKAQvB,CAAC;AAGF,eAAO,MAAM,QAAQ;oBAAgC,MAAM;;EAO1D,CAAC;AAEF,eAAO,MAAM,MAAM,qKAElB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;oDAGzB,CAAC;AAEF,eAAO,MAAM,iBAAiB,qKAG7B,CAAC;AAEF,eAAO,MAAM,kBAAkB,qKAG9B,CAAC;AAEF,eAAO,MAAM,IAAI,0CA0BhB,CAAC;AAGF,eAAO,MAAM,WAAW,QA6FvB,CAAC"}
@@ -3,11 +3,13 @@ export declare const classes: {
3
3
  autoStretching: string;
4
4
  filledStretching: string;
5
5
  fixedStretching: string;
6
+ contentRelaxed: string;
6
7
  buttonSquare: string;
7
8
  buttonItem: string;
8
9
  };
9
10
  export declare const tokens: {
10
11
  buttonColor: string;
12
+ buttonValueColor: string;
11
13
  buttonBackgroundColor: string;
12
14
  buttonColorHover: string;
13
15
  buttonBackgroundColorHover: string;
@@ -26,6 +28,9 @@ export declare const tokens: {
26
28
  buttonFontWeight: string;
27
29
  buttonLetterSpacing: string;
28
30
  buttonLineHeight: string;
31
+ buttonLeftContentMargin: string;
32
+ buttonRightContentMargin: string;
33
+ buttonValueMargin: string;
29
34
  buttonDisabledOpacity: string;
30
35
  buttonFocusColor: string;
31
36
  buttonSpinnerColor: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Button.tokens.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;;;;CAOnB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;CA4BlB,CAAC"}
1
+ {"version":3,"file":"Button.tokens.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;;;;;CAQnB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiClB,CAAC"}
@@ -3,6 +3,18 @@ import type { Pin } from '../../utils/roundness';
3
3
  import { Blur } from '../../mixins';
4
4
  import type { AsProps } from '../../types';
5
5
  declare type Stretching = 'fixed' | 'filled' | 'auto';
6
+ declare type ContentPlacing = 'default' | 'relaxed';
7
+ declare type ContentPlacingValue = 'center' | 'space-between';
8
+ export declare type ContentPlacementMapper = {
9
+ [K in ContentPlacing]: ContentPlacingValue;
10
+ };
11
+ declare type RightContent = {
12
+ value?: string | number;
13
+ contentRight?: never;
14
+ } | {
15
+ value?: never;
16
+ contentRight?: ReactNode;
17
+ };
6
18
  declare type CustomButtonProps = {
7
19
  /**
8
20
  * Текстовая надпись
@@ -13,9 +25,10 @@ declare type CustomButtonProps = {
13
25
  */
14
26
  contentLeft?: ReactNode;
15
27
  /**
16
- * Слот для контента справа, например `Icon`
28
+ * Положение контента по ширине кнопки.
29
+ * @default 'default'
17
30
  */
18
- contentRight?: ReactNode;
31
+ contentPlacing?: ContentPlacing;
19
32
  /**
20
33
  * У кнопки состояние загрузки
21
34
  */
@@ -86,7 +99,6 @@ declare type CustomButtonProps = {
86
99
  */
87
100
  blur?: Blur;
88
101
  };
89
- export interface ButtonProps<T = HTMLElement> extends ButtonHTMLAttributes<T>, Omit<AnchorHTMLAttributes<T>, 'type'>, AsProps, CustomButtonProps {
90
- }
102
+ export declare type ButtonProps<T = HTMLElement> = {} & Omit<ButtonHTMLAttributes<T>, 'value'> & Omit<AnchorHTMLAttributes<T>, 'type'> & AsProps & CustomButtonProps & RightContent;
91
103
  export {};
92
104
  //# sourceMappingURL=Button.types.d.ts.map