reshaped 2.2.0 → 2.3.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 (160) hide show
  1. package/CHANGELOG.md +19 -12
  2. package/LICENSE-SOURCE.md +40 -0
  3. package/LICENSE.md +21 -37
  4. package/bin/clean.sh +1 -0
  5. package/bin/cli.js +1 -11
  6. package/bin/release-source.sh +7 -0
  7. package/bundle.css +1 -1
  8. package/bundle.js +10 -10
  9. package/cli/theming/definitions/base.d.ts +1 -1
  10. package/cli/theming/definitions/figma.d.ts +1 -1
  11. package/cli/theming/definitions/reshaped.d.ts +1 -1
  12. package/cli/theming/definitions/slate.d.ts +1 -1
  13. package/cli/theming/index.d.ts +4 -4
  14. package/cli/theming/index.js +7 -107
  15. package/components/Actionable/Actionable.js +14 -3
  16. package/components/Actionable/Actionable.module.css +1 -1
  17. package/components/Autocomplete/tests/Autocomplete.stories.js +27 -1
  18. package/components/Button/Button.js +2 -0
  19. package/components/Button/Button.module.css +1 -1
  20. package/components/Button/Button.types.d.ts +6 -0
  21. package/components/Button/ButtonGroup.d.ts +4 -0
  22. package/components/Button/ButtonGroup.js +9 -0
  23. package/components/Button/tests/Button.stories.d.ts +1 -0
  24. package/components/Button/tests/Button.stories.js +63 -0
  25. package/components/Checkbox/Checkbox.module.css +1 -1
  26. package/components/DropdownMenu/DropdownMenu.js +1 -1
  27. package/components/DropdownMenu/tests/DropdownMenu.stories.js +1 -0
  28. package/components/Overlay/Overlay.js +4 -4
  29. package/components/Radio/Radio.module.css +1 -1
  30. package/components/Select/Select.js +1 -1
  31. package/components/Slider/Slider.module.css +1 -1
  32. package/components/Switch/Switch.module.css +1 -1
  33. package/components/Tabs/Tabs.d.ts +1 -8
  34. package/components/Tabs/Tabs.module.css +1 -1
  35. package/components/Tabs/Tabs.types.d.ts +6 -7
  36. package/components/Tabs/TabsContext.d.ts +4 -0
  37. package/components/Tabs/TabsControlled.js +24 -1
  38. package/components/Tabs/TabsItem.d.ts +1 -8
  39. package/components/Tabs/TabsItem.js +22 -4
  40. package/components/Tabs/TabsList.js +30 -32
  41. package/components/Tabs/tests/Tabs.stories.d.ts +1 -0
  42. package/components/Tabs/tests/Tabs.stories.js +17 -0
  43. package/components/Toast/ToastContainer.js +1 -0
  44. package/components/Toast/ToastProvider.js +4 -0
  45. package/components/Toast/tests/Toast.stories.js +1 -0
  46. package/components/_private/Flyout/Flyout.types.d.ts +2 -0
  47. package/components/_private/Flyout/FlyoutContent.js +7 -3
  48. package/components/_private/Flyout/FlyoutControlled.js +8 -1
  49. package/components/_private/Flyout/tests/Flyout.stories.d.ts +1 -0
  50. package/components/_private/Flyout/tests/Flyout.stories.js +25 -0
  51. package/components/_private/Portal/Portal.d.ts +8 -4
  52. package/components/_private/Portal/Portal.js +23 -11
  53. package/components/_private/Portal/Portal.types.d.ts +7 -2
  54. package/components/_private/Portal/index.d.ts +1 -1
  55. package/components/_private/Portal/index.js +1 -1
  56. package/components/_private/Portal/tests/Portal.stories.js +11 -12
  57. package/config/next.d.ts +4 -5
  58. package/config/next.js +21 -7
  59. package/config/tailwind.d.ts +1 -1
  60. package/config/tailwind.js +3 -3
  61. package/hooks/_private/useFlyout.js +16 -13
  62. package/package.json +39 -31
  63. package/themes/_generator/tests/themes.stories.d.ts +6 -0
  64. package/themes/_generator/tests/themes.stories.js +32 -0
  65. package/{cli/theming → themes/_generator}/tokens/color/color.transforms.d.ts +1 -1
  66. package/{cli/theming → themes/_generator}/tokens/duration/duration.transforms.d.ts +1 -1
  67. package/{cli/theming → themes/_generator}/tokens/easing/easing.transforms.d.ts +1 -1
  68. package/{cli/theming → themes/_generator}/tokens/font/font.transforms.d.ts +1 -1
  69. package/{cli/theming → themes/_generator}/tokens/fontFamily/fontFamily.transforms.d.ts +1 -1
  70. package/{cli/theming → themes/_generator}/tokens/fontWeight/fontWeight.transforms.d.ts +1 -1
  71. package/{cli/theming → themes/_generator}/tokens/shadow/shadow.transforms.d.ts +1 -1
  72. package/{cli/theming → themes/_generator}/tokens/shadow/shadow.transforms.js +1 -1
  73. package/{cli/theming → themes/_generator}/tokens/unit/unit.transforms.d.ts +1 -1
  74. package/{cli/theming → themes/_generator}/tokens/viewport/viewport.transforms.d.ts +1 -1
  75. package/themes/_generator/transform.d.ts +7 -0
  76. package/themes/_generator/transform.js +57 -0
  77. package/{cli/theming → themes/_generator}/types.d.ts +3 -1
  78. package/{cli/theming → themes/_generator}/utilities/css.js +3 -1
  79. package/themes/_generator/utilities/generateBackgroundColors.d.ts +4 -0
  80. package/themes/_generator/utilities/generateBackgroundColors.js +54 -0
  81. package/themes/_generator/utilities/generateUnits.d.ts +4 -0
  82. package/themes/_generator/utilities/generateUnits.js +17 -0
  83. package/{cli/theming → themes/_generator}/utilities/mergeDeep.js +1 -3
  84. package/{cli/theming → themes/_generator}/utilities/resolveTokenReference.js +1 -3
  85. package/themes/index.d.ts +3 -0
  86. package/themes/index.js +5 -0
  87. package/types/config.d.ts +1 -1
  88. package/utilities/a11y.js +12 -3
  89. package/{cli/utilities → utilities}/color.d.ts +1 -1
  90. package/utilities/dom.d.ts +1 -0
  91. package/utilities/dom.js +9 -0
  92. package/cli/theming/definitions/minimal.d.ts +0 -3
  93. package/cli/theming/definitions/minimal.js +0 -80
  94. package/cli/utilities/tests/color.test.d.ts +0 -1
  95. package/cli/utilities/tests/color.test.js +0 -63
  96. package/styles/aspectRatio/index.test.d.ts +0 -1
  97. package/styles/aspectRatio/index.test.js +0 -24
  98. package/styles/bleed/index.test.d.ts +0 -1
  99. package/styles/bleed/index.test.js +0 -24
  100. package/styles/height/index.test.d.ts +0 -1
  101. package/styles/height/index.test.js +0 -27
  102. package/styles/inset/index.test.d.ts +0 -1
  103. package/styles/inset/index.test.js +0 -27
  104. package/styles/maxHeight/index.test.d.ts +0 -1
  105. package/styles/maxHeight/index.test.js +0 -27
  106. package/styles/maxWidth/index.test.d.ts +0 -1
  107. package/styles/maxWidth/index.test.js +0 -27
  108. package/styles/padding/index.test.d.ts +0 -1
  109. package/styles/padding/index.test.js +0 -24
  110. package/styles/position/index.test.d.ts +0 -1
  111. package/styles/position/index.test.js +0 -21
  112. package/styles/radius/index.test.d.ts +0 -1
  113. package/styles/radius/index.test.js +0 -24
  114. package/styles/width/index.test.d.ts +0 -1
  115. package/styles/width/index.test.js +0 -27
  116. package/themes/minimal/theme.css +0 -1
  117. package/utilities/testPresets.d.ts +0 -25
  118. package/utilities/testPresets.js +0 -76
  119. package/utilities/tests/Chain.test.d.ts +0 -1
  120. package/utilities/tests/Chain.test.js +0 -45
  121. /package/bin/{copy-release.sh → release-copy.sh} +0 -0
  122. /package/{cli/theming → themes/_generator}/tokens/color/color.transforms.js +0 -0
  123. /package/{cli/theming → themes/_generator}/tokens/color/color.types.d.ts +0 -0
  124. /package/{cli/theming → themes/_generator}/tokens/color/color.types.js +0 -0
  125. /package/{cli/theming → themes/_generator}/tokens/duration/duration.transforms.js +0 -0
  126. /package/{cli/theming → themes/_generator}/tokens/duration/duration.types.d.ts +0 -0
  127. /package/{cli/theming → themes/_generator}/tokens/duration/duration.types.js +0 -0
  128. /package/{cli/theming → themes/_generator}/tokens/easing/easing.transforms.js +0 -0
  129. /package/{cli/theming → themes/_generator}/tokens/easing/easing.types.d.ts +0 -0
  130. /package/{cli/theming → themes/_generator}/tokens/easing/easing.types.js +0 -0
  131. /package/{cli/theming → themes/_generator}/tokens/font/font.transforms.js +0 -0
  132. /package/{cli/theming → themes/_generator}/tokens/font/font.types.d.ts +0 -0
  133. /package/{cli/theming → themes/_generator}/tokens/font/font.types.js +0 -0
  134. /package/{cli/theming → themes/_generator}/tokens/fontFamily/fontFamily.transforms.js +0 -0
  135. /package/{cli/theming → themes/_generator}/tokens/fontFamily/fontFamily.types.d.ts +0 -0
  136. /package/{cli/theming → themes/_generator}/tokens/fontFamily/fontFamily.types.js +0 -0
  137. /package/{cli/theming → themes/_generator}/tokens/fontWeight/fontWeight.transforms.js +0 -0
  138. /package/{cli/theming → themes/_generator}/tokens/fontWeight/fontWeight.types.d.ts +0 -0
  139. /package/{cli/theming → themes/_generator}/tokens/fontWeight/fontWeight.types.js +0 -0
  140. /package/{cli/theming → themes/_generator}/tokens/shadow/shadow.types.d.ts +0 -0
  141. /package/{cli/theming → themes/_generator}/tokens/shadow/shadow.types.js +0 -0
  142. /package/{cli/theming → themes/_generator}/tokens/transforms.d.ts +0 -0
  143. /package/{cli/theming → themes/_generator}/tokens/transforms.js +0 -0
  144. /package/{cli/theming → themes/_generator}/tokens/types.d.ts +0 -0
  145. /package/{cli/theming → themes/_generator}/tokens/types.js +0 -0
  146. /package/{cli/theming → themes/_generator}/tokens/unit/unit.transforms.js +0 -0
  147. /package/{cli/theming → themes/_generator}/tokens/unit/unit.types.d.ts +0 -0
  148. /package/{cli/theming → themes/_generator}/tokens/unit/unit.types.js +0 -0
  149. /package/{cli/theming → themes/_generator}/tokens/viewport/viewport.transforms.js +0 -0
  150. /package/{cli/theming → themes/_generator}/tokens/viewport/viewport.types.d.ts +0 -0
  151. /package/{cli/theming → themes/_generator}/tokens/viewport/viewport.types.js +0 -0
  152. /package/{cli/theming → themes/_generator}/types.js +0 -0
  153. /package/{cli/theming → themes/_generator}/utilities/css.d.ts +0 -0
  154. /package/{cli/theming → themes/_generator}/utilities/mergeDeep.d.ts +0 -0
  155. /package/{cli/theming → themes/_generator}/utilities/mergeDefinitions.d.ts +0 -0
  156. /package/{cli/theming → themes/_generator}/utilities/mergeDefinitions.js +0 -0
  157. /package/{cli/theming → themes/_generator}/utilities/resolveTokenReference.d.ts +0 -0
  158. /package/{cli/utilities → utilities}/color.js +0 -0
  159. /package/{cli/utilities → utilities}/string.d.ts +0 -0
  160. /package/{cli/utilities → utilities}/string.js +0 -0
@@ -1,3 +1,3 @@
1
- import { BaseThemeDefinition } from "../tokens/types";
1
+ import { BaseThemeDefinition } from "../../../themes/_generator/tokens/types";
2
2
  declare const base: BaseThemeDefinition;
3
3
  export default base;
@@ -1,3 +1,3 @@
1
- import { UserThemeDefinition } from "../tokens/types";
1
+ import { UserThemeDefinition } from "../../../themes/_generator/tokens/types";
2
2
  declare const theme: UserThemeDefinition;
3
3
  export default theme;
@@ -1,3 +1,3 @@
1
- import { UserThemeDefinition } from "../tokens/types";
1
+ import { UserThemeDefinition } from "../../../themes/_generator/tokens/types";
2
2
  declare const theme: UserThemeDefinition;
3
3
  export default theme;
@@ -1,3 +1,3 @@
1
- import { UserThemeDefinition } from "../tokens/types";
1
+ import { UserThemeDefinition } from "../../../themes/_generator/tokens/types";
2
2
  declare const theme: UserThemeDefinition;
3
3
  export default theme;
@@ -1,4 +1,4 @@
1
- import { PartialUserThemeDefinition } from "./tokens/types";
2
- import type * as T from "./types";
3
- export declare const addThemeFragment: (name: string, definition: PartialUserThemeDefinition, options: T.PublicOptions) => void;
4
- export declare const addTheme: (name: string, definition: PartialUserThemeDefinition, options: T.PublicOptions) => void;
1
+ import type { PartialUserThemeDefinition } from "../../themes/_generator/tokens/types";
2
+ import type * as T from "../../themes/_generator/types";
3
+ export declare const addThemeFragment: (name: string, definition: PartialUserThemeDefinition, options: T.CLIOptions) => void;
4
+ export declare const addTheme: (name: string, definition: PartialUserThemeDefinition, options: T.CLIOptions) => void;
@@ -1,27 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
4
  };
@@ -30,99 +7,22 @@ exports.addTheme = exports.addThemeFragment = void 0;
30
7
  const fs_1 = __importDefault(require("fs"));
31
8
  const path_1 = __importDefault(require("path"));
32
9
  const chalk_1 = __importDefault(require("chalk"));
33
- const transforms = __importStar(require("./tokens/transforms"));
34
- const mergeDefinitions_1 = __importDefault(require("./utilities/mergeDefinitions"));
35
- const color_1 = require("../utilities/color");
36
- const string_1 = require("../utilities/string");
37
- const css_1 = require("./utilities/css");
10
+ const mergeDefinitions_1 = __importDefault(require("../../themes/_generator/utilities/mergeDefinitions"));
11
+ const transform_1 = __importDefault(require("../../themes/_generator/transform"));
38
12
  const reshaped_1 = __importDefault(require("./definitions/reshaped"));
39
13
  const base_1 = __importDefault(require("./definitions/base"));
40
- const generateBackgroundColors = (definition, themeOptions) => {
41
- if (!definition.color)
42
- return;
43
- Object.keys(definition.color).forEach((tokenName) => {
44
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
45
- const bgToken = (_a = definition.color) === null || _a === void 0 ? void 0 : _a[tokenName];
46
- const generatedForegroundName = `on${(0, string_1.capitalize)(tokenName)}`;
47
- const generatedRGBName = `rgb${(0, string_1.capitalize)(tokenName)}`;
48
- const needsDynamicForeground = (_b = themeOptions === null || themeOptions === void 0 ? void 0 : themeOptions.generateOnColorsFor) === null || _b === void 0 ? void 0 : _b.includes(tokenName);
49
- const needsRGB = tokenName.startsWith("background") ||
50
- tokenName.endsWith("black") ||
51
- tokenName.endsWith("white");
52
- if (!bgToken)
53
- return;
54
- if (needsDynamicForeground) {
55
- const hex = (0, color_1.getOnColor)({
56
- bgHexColor: bgToken.hex,
57
- mode: "light",
58
- lightHexColor: (_d = (_c = definition === null || definition === void 0 ? void 0 : definition.color) === null || _c === void 0 ? void 0 : _c.white) === null || _d === void 0 ? void 0 : _d.hex,
59
- darkHexColor: (_f = (_e = definition === null || definition === void 0 ? void 0 : definition.color) === null || _e === void 0 ? void 0 : _e.black) === null || _f === void 0 ? void 0 : _f.hex,
60
- });
61
- const hexDark = (0, color_1.getOnColor)({
62
- bgHexColor: bgToken.hexDark || bgToken.hex,
63
- mode: "dark",
64
- lightHexColor: (_h = (_g = definition === null || definition === void 0 ? void 0 : definition.color) === null || _g === void 0 ? void 0 : _g.white) === null || _h === void 0 ? void 0 : _h.hex,
65
- darkHexColor: (_k = (_j = definition === null || definition === void 0 ? void 0 : definition.color) === null || _j === void 0 ? void 0 : _j.black) === null || _k === void 0 ? void 0 : _k.hex,
66
- });
67
- // eslint-disable-next-line no-param-reassign
68
- definition.color[generatedForegroundName] = {
69
- hex,
70
- hexDark: hex !== hexDark ? hexDark : undefined,
71
- };
72
- }
73
- if (needsRGB) {
74
- // eslint-disable-next-line no-param-reassign
75
- definition.color[generatedRGBName] = {
76
- hex: (0, color_1.hexToRgbString)(bgToken.hex),
77
- hexDark: bgToken.hexDark && (0, color_1.hexToRgbString)(bgToken.hexDark),
78
- };
79
- }
80
- });
81
- };
82
- const generateUnits = (definition) => {
83
- var _a, _b;
84
- const baseValue = (_b = (_a = definition.unit) === null || _a === void 0 ? void 0 : _a.base) === null || _b === void 0 ? void 0 : _b.px;
85
- // If base value hasn't changed, we don't need to regenerate tokens
86
- if (!baseValue)
87
- return;
88
- for (let i = 1; i <= 10; i += 1) {
89
- const generatedName = `x${i}`;
90
- // eslint-disable-next-line no-param-reassign
91
- definition.unit[generatedName] = {
92
- px: baseValue * i,
93
- };
94
- }
95
- };
96
14
  const transformDefinition = (name, definition, options) => {
97
- const { outputPath, isPrivate, isFragment } = options;
98
- generateBackgroundColors(definition, options.themeOptions);
99
- generateUnits(definition);
100
- const transformedStorage = {
101
- variable: [],
102
- media: [],
103
- };
104
- Object.entries(definition).forEach(([tokenType, tokenValues]) => {
105
- if (!tokenValues)
106
- return;
107
- const transform = transforms.css[tokenType];
108
- Object.entries(tokenValues).forEach(([tokenName, token]) => {
109
- const transformedTokens = transform(tokenName, token, definition);
110
- transformedTokens.forEach((transformedToken) => {
111
- transformedStorage[transformedToken.type].push(transformedToken);
112
- });
113
- });
114
- });
115
- const variablesCode = (0, css_1.variablesTemplate)(name, transformedStorage.variable);
15
+ const { isFragment, outputPath } = options;
16
+ const code = (0, transform_1.default)(name, definition, options);
116
17
  const themeFolderPath = isFragment
117
18
  ? path_1.default.resolve(outputPath, "fragments", name)
118
19
  : path_1.default.resolve(outputPath, name);
119
20
  const themePath = path_1.default.resolve(themeFolderPath, "theme.css");
120
21
  fs_1.default.mkdirSync(themeFolderPath, { recursive: true });
121
- fs_1.default.writeFileSync(themePath, variablesCode);
122
- if (isPrivate && !isFragment) {
123
- const mediaCode = (0, css_1.mediaTemplate)(transformedStorage.media);
22
+ fs_1.default.writeFileSync(themePath, code.variables);
23
+ if (code.media) {
124
24
  const mediaPath = path_1.default.resolve(outputPath, "media.css");
125
- fs_1.default.writeFileSync(mediaPath, mediaCode);
25
+ fs_1.default.writeFileSync(mediaPath, code.media);
126
26
  }
127
27
  const logOutput = `Compiled ${chalk_1.default.bold(name)} theme${isFragment ? " fragment" : ""}`;
128
28
  // eslint-disable-next-line no-console
@@ -6,6 +6,7 @@ const Actionable = (props, ref) => {
6
6
  const { children, href, onClick, type, disabled, insetFocus, borderRadius, as, fullWidth, className, attributes, } = props;
7
7
  const rootClassNames = classNames(s.root, className, disabled && s["--disabled"], borderRadius && s[`--radius-${borderRadius}`], insetFocus && s["--inset"], fullWidth && s["--full-width"]);
8
8
  const rootAttributes = Object.assign({}, attributes);
9
+ const repeatRef = React.useRef(false);
9
10
  const hasClickHandler = onClick || (attributes === null || attributes === void 0 ? void 0 : attributes.onClick);
10
11
  const hasFocusHandler = (attributes === null || attributes === void 0 ? void 0 : attributes.onFocus) || (attributes === null || attributes === void 0 ? void 0 : attributes.onBlur);
11
12
  const isLink = Boolean(href || (attributes === null || attributes === void 0 ? void 0 : attributes.href));
@@ -34,13 +35,19 @@ const Actionable = (props, ref) => {
34
35
  var _a;
35
36
  if (disabled)
36
37
  return;
38
+ /**
39
+ * - Holding enter keep onClick getting triggered
40
+ * - Storybook environment is triggering onClick twice on each enter press
41
+ */
42
+ if (repeatRef.current)
43
+ return;
37
44
  onClick === null || onClick === void 0 ? void 0 : onClick(event);
38
45
  (_a = attributes === null || attributes === void 0 ? void 0 : attributes.onClick) === null || _a === void 0 ? void 0 : _a.call(attributes, event);
39
46
  };
40
- const handleClick = (event) => handlePress(event);
41
47
  const handleKeyDown = (event) => {
42
48
  const simulatingButton = rootAttributes.role === "button";
43
- if (!simulatingButton || isLink)
49
+ // These cases are handled correctly by the browsers
50
+ if (simulatingButton || isLink)
44
51
  return;
45
52
  const isSpace = event.key === " ";
46
53
  const isEnter = event.key === "Enter";
@@ -48,7 +55,11 @@ const Actionable = (props, ref) => {
48
55
  return;
49
56
  event.preventDefault();
50
57
  handlePress(event);
58
+ repeatRef.current = true;
59
+ };
60
+ const handleKeyUp = () => {
61
+ repeatRef.current = false;
51
62
  };
52
- return (React.createElement(TagName, Object.assign({ ref: ref }, rootAttributes, { className: rootClassNames, onClick: handleClick, onKeyDown: handleKeyDown }), children));
63
+ return (React.createElement(TagName, Object.assign({ ref: ref }, rootAttributes, { className: rootClassNames, onClick: handlePress, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp }), children));
53
64
  };
54
65
  export default React.forwardRef(Actionable);
@@ -1 +1 @@
1
- .root{-webkit-tap-highlight-color:none;background:none;border:0;color:inherit;display:inline-block;font-size:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0;text-align:initial;text-decoration:none;vertical-align:top}.root:focus{outline:none;z-index:var(--rs-z-index-raised)}[role=button].root,button.root{cursor:pointer}.root.--disabled,.root[disabled]{cursor:not-allowed}.root.--disabled:active,.root[disabled]:active{transform:none}.--full-width{width:100%}[data-rs-keyboard] .root:focus{box-shadow:var(--rs-focus-shadow)}[data-rs-keyboard] .root.--inset:focus{box-shadow:var(--rs-focus-inset-shadow)}[data-rs-keyboard] .root.--radius-inherit:focus{box-shadow:none}[data-rs-keyboard] .root.--radius-inherit:focus>*{box-shadow:var(--rs-focus-shadow)}[data-rs-keyboard] .root.--radius-inherit.--inset:focus>*{box-shadow:var(--rs-focus-inset-shadow)}
1
+ .root{-webkit-tap-highlight-color:transparent;background:none;border:0;color:inherit;display:inline-block;font-size:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0;text-align:initial;text-decoration:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:top}.root:focus{outline:none;z-index:var(--rs-z-index-raised)}[role=button].root,button.root{cursor:pointer}.root.--disabled,.root[disabled]{cursor:not-allowed}.root.--disabled:active,.root[disabled]:active{transform:none}.--full-width{width:100%}[data-rs-keyboard] .root:focus{box-shadow:var(--rs-focus-shadow)}[data-rs-keyboard] .root.--inset:focus{box-shadow:var(--rs-focus-inset-shadow)}[data-rs-keyboard] .root.--radius-inherit:focus{box-shadow:none}[data-rs-keyboard] .root.--radius-inherit:focus>*{box-shadow:var(--rs-focus-shadow)}[data-rs-keyboard] .root.--radius-inherit.--inset:focus>*{box-shadow:var(--rs-focus-inset-shadow)}
@@ -1,10 +1,12 @@
1
1
  import React from "react";
2
2
  import { Example } from "../../../utilities/storybook/index.js";
3
3
  import Autocomplete from "../index.js";
4
+ import Loader from "../../Loader/index.js";
5
+ import View from "../../View/index.js";
4
6
  export default { title: "Components/Autocomplete" };
5
7
  const Demo = () => {
6
8
  const [value, setValue] = React.useState("");
7
- return (<Autocomplete name="fruit" value={value} placeholder="Pick your food" onChange={({ value }) => setValue(value)}>
9
+ return (<Autocomplete name="fruit" value={value} placeholder="Pick your food" onChange={(args) => setValue(args.value)}>
8
10
  {["Pizza", "Pie", "Ice-cream"].map((v) => {
9
11
  if (!v.toLowerCase().includes(value.toLowerCase()))
10
12
  return;
@@ -14,8 +16,32 @@ const Demo = () => {
14
16
  })}
15
17
  </Autocomplete>);
16
18
  };
19
+ const DemoAsync = () => {
20
+ const [value, setValue] = React.useState("");
21
+ const [loading, setLoading] = React.useState(false);
22
+ return (<Autocomplete name="fruit" value={value} placeholder="Pick your food" onChange={({ value }) => {
23
+ setLoading(true);
24
+ setTimeout(() => {
25
+ setLoading(false);
26
+ }, 500);
27
+ setValue(value);
28
+ }}>
29
+ {loading ? (<View align="center" justify="center" padding={4}>
30
+ <Loader />
31
+ </View>) : (["Pizza", "Pie", "Ice-cream"].map((v) => {
32
+ if (!v.toLowerCase().includes(value.toLowerCase()))
33
+ return;
34
+ return (<Autocomplete.Item key={v} value={v}>
35
+ {v}
36
+ </Autocomplete.Item>);
37
+ }))}
38
+ </Autocomplete>);
39
+ };
17
40
  export const base = () => (<Example>
18
41
  <Example.Item title="Default">
19
42
  <Demo />
20
43
  </Example.Item>
44
+ <Example.Item title="Async, should keep focus on the first item after reload">
45
+ <DemoAsync />
46
+ </Example.Item>
21
47
  </Example>);
@@ -3,6 +3,7 @@ import { classNames, responsiveClassNames, responsivePropDependency } from "../.
3
3
  import Icon from "../Icon/index.js";
4
4
  import Loader from "../Loader/index.js";
5
5
  import Actionable from "../Actionable/index.js";
6
+ import ButtonGroup from "./ButtonGroup.js";
6
7
  import ButtonAligner from "./ButtonAligner.js";
7
8
  import s from "./Button.module.css";
8
9
  const ButtonBase = (props, ref) => {
@@ -33,5 +34,6 @@ const ButtonBase = (props, ref) => {
33
34
  renderIcon("end")));
34
35
  };
35
36
  const Button = React.forwardRef(ButtonBase);
37
+ Button.Group = ButtonGroup;
36
38
  Button.Aligner = ButtonAligner;
37
39
  export default Button;
@@ -1 +1 @@
1
- .root{--rs-button-border-width:1px;-webkit-tap-highlight-color:transparent;align-items:center;border:var(--rs-button-border-width) solid transparent;box-sizing:border-box;cursor:pointer;display:inline-flex;font-family:var(--rs-font-family-body);font-size:var(--rs-button-font-size);font-weight:var(--rs-font-weight-medium);justify-content:center;line-height:var(--rs-button-line-height);min-height:calc(var(--rs-button-line-height) + var(--rs-button-padding-v) * 2);min-width:calc(var(--rs-button-line-height) - (var(--rs-unit-x1) * 2) + (var(--rs-button-padding-h) * 2));overflow:hidden;padding:calc(var(--rs-button-padding-v) - var(--rs-button-border-width)) calc(var(--rs-button-padding-h) - var(--rs-button-border-width));position:relative;text-align:initial;text-decoration:none;transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:background-color,box-shadow,border-color,color,transform;z-index:0}.root:active{transform:scale(.98)}.loader{align-items:center;display:none;inset:0;justify-content:center;position:absolute}.icon{margin-inline-end:var(--rs-button-icon-gap)}.icon.--icon-position-end{margin-inline-end:0;margin-inline-start:var(--rs-button-icon-gap)}.icon:last-child{margin-inline-end:0}.icon,.text{position:relative;z-index:5}.root.--loading{cursor:default}.root.--loading:active{transform:none}.root.--loading .icon,.root.--loading .text{visibility:hidden}.root.--loading .loader{display:flex}.--elevated{box-shadow:var(--rs-shadow-raised)}.root.--icon-only .icon{margin:0 calc(var(--rs-unit-x1) * -1)}.root.--rounded{border-radius:999px}.--size-small{--rs-button-padding-v:var(--rs-unit-x1);--rs-button-padding-h:var(--rs-unit-x2);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x1);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3)}.--size-medium,.--size-small{border-radius:var(--rs-unit-radius-small)}.--size-medium{--rs-button-padding-v:var(--rs-unit-x2);--rs-button-padding-h:var(--rs-unit-x3);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3)}.--size-large{--rs-button-padding-v:var(--rs-unit-x3);--rs-button-padding-h:var(--rs-unit-x4);--rs-button-padding-h-ghost:var(--rs-unit-x3);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2)}.--size-large,.--size-xlarge{border-radius:var(--rs-unit-radius-medium)}.--size-xlarge{--rs-button-padding-v:var(--rs-unit-x4);--rs-button-padding-h:var(--rs-unit-x5);--rs-button-padding-h-ghost:var(--rs-unit-x4);--rs-button-icon-gap:var(--rs-unit-x3);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2)}.--full-width{text-align:center;width:100%}.root.--variant-faded.--color-critical:before,.root.--variant-faded.--color-inherit:before,.root.--variant-faded.--color-neutral:before,.root.--variant-faded.--color-positive:before,.root.--variant-faded.--color-primary:before,.root.--variant-ghost.--color-inherit:before,.root.--variant-outline.--color-inherit:before,.root.--variant-solid.--color-black:before,.root.--variant-solid.--color-white:before{content:"";inset:0;opacity:0;position:absolute;transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity}.root.--variant-solid.--color-neutral{background-color:var(--rs-color-background-neutral);color:var(--rs-color-foreground-neutral)}.root.--variant-solid.--color-neutral.--highlighted,.root.--variant-solid.--color-neutral:hover:not(.--loading){background-color:var(--rs-color-background-neutral-highlighted)}.root.--variant-solid.--color-primary{background-color:var(--rs-color-background-primary);color:var(--rs-color-on-background-primary)}.root.--variant-solid.--color-primary.--highlighted,.root.--variant-solid.--color-primary:hover:not(.--loading){background-color:var(--rs-color-background-primary-highlighted)}.root.--variant-solid.--color-critical{background-color:var(--rs-color-background-critical);color:var(--rs-color-on-background-critical)}.root.--variant-solid.--color-critical.--highlighted,.root.--variant-solid.--color-critical:hover:not(.--loading){background-color:var(--rs-color-background-critical-highlighted)}.root.--variant-solid.--color-positive{background-color:var(--rs-color-background-positive);color:var(--rs-color-on-background-positive)}.root.--variant-solid.--color-positive.--highlighted,.root.--variant-solid.--color-positive:hover:not(.--loading){background-color:var(--rs-color-background-positive-highlighted)}.root.--variant-solid.--color-white{--rs-button-border-width:0px;background-color:var(--rs-color-white);color:var(--rs-color-black)}.root.--variant-solid.--color-white:before{background-color:var(--rs-color-black)}.root.--variant-solid.--color-white.--highlighted:before,.root.--variant-solid.--color-white:hover:not(.--loading):before{opacity:.04}.root.--variant-solid.--color-black{--rs-button-border-width:0px;background-color:var(--rs-color-black);color:var(--rs-color-white)}.root.--variant-solid.--color-black:before{background-color:var(--rs-color-white)}.root.--variant-solid.--color-black.--highlighted:before,.root.--variant-solid.--color-black:hover:not(.--loading):before{opacity:.2}.root.--variant-faded.--color-neutral{background-color:var(--rs-color-background-elevation-base);border-color:var(--rs-color-border-neutral-faded);color:var(--rs-color-foreground-neutral)}.root.--variant-faded.--color-neutral:before{background-color:var(--rs-color-foreground-neutral)}.root.--variant-faded.--color-neutral.--highlighted:before,.root.--variant-faded.--color-neutral:hover:not(.--loading):before{opacity:.04}.root.--variant-faded.--color-primary{background-color:var(--rs-color-background-primary-faded);color:var(--rs-color-foreground-primary)}.root.--variant-faded.--color-primary:before{background-color:var(--rs-color-foreground-primary)}.root.--variant-faded.--color-primary.--highlighted:before,.root.--variant-faded.--color-primary:hover:not(.--loading):before{opacity:.06}.root.--variant-faded.--color-critical{background-color:var(--rs-color-background-critical-faded);color:var(--rs-color-foreground-critical)}.root.--variant-faded.--color-critical:before{background-color:var(--rs-color-foreground-critical)}.root.--variant-faded.--color-critical.--highlighted:before,.root.--variant-faded.--color-critical:hover:not(.--loading):before{opacity:.06}.root.--variant-faded.--color-positive{background-color:var(--rs-color-background-positive-faded);color:var(--rs-color-foreground-positive)}.root.--variant-faded.--color-positive:before{background-color:var(--rs-color-foreground-positive)}.root.--variant-faded.--color-positive.--highlighted:before,.root.--variant-faded.--color-positive:hover:not(.--loading):before{opacity:.06}.root.--variant-faded.--color-inherit{color:inherit}.root.--variant-faded.--color-inherit:before{background-color:currentcolor;opacity:.16}.root.--variant-faded.--color-inherit.--highlighted:before,.root.--variant-faded.--color-inherit:hover:not(.--loading):before{opacity:.24}.root.--variant-faded.--color-black{background-color:rgba(var(--rs-color-rgb-black),28%);color:var(--rs-color-white)}.root.--variant-faded.--color-black.--highlighted,.root.--variant-faded.--color-black:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-black),36%)}.root.--variant-faded.--color-white{background-color:rgba(var(--rs-color-rgb-white),28%);color:var(--rs-color-black)}.root.--variant-faded.--color-white.--highlighted,.root.--variant-faded.--color-white:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-white),36%)}.root.--variant-outline.--color-neutral{background-color:transparent;border-color:var(--rs-color-border-neutral);color:var(--rs-color-foreground-neutral)}.root.--variant-outline.--color-neutral.--highlighted,.root.--variant-outline.--color-neutral:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-neutral),28%)}.root.--variant-outline.--color-primary{background-color:transparent;border-color:var(--rs-color-border-primary);color:var(--rs-color-foreground-primary)}.root.--variant-outline.--color-primary.--highlighted,.root.--variant-outline.--color-primary:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-primary),10%)}.root.--variant-outline.--color-critical{background-color:transparent;border-color:var(--rs-color-border-critical);color:var(--rs-color-foreground-critical)}.root.--variant-outline.--color-critical.--highlighted,.root.--variant-outline.--color-critical:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-critical),10%)}.root.--variant-outline.--color-positive{background-color:transparent;border-color:var(--rs-color-border-positive);color:var(--rs-color-foreground-positive)}.root.--variant-outline.--color-positive.--highlighted,.root.--variant-outline.--color-positive:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-positive),10%)}.root.--variant-outline.--color-white{background-color:transparent;border-color:var(--rs-color-white);color:var(--rs-color-white)}.root.--variant-outline.--color-white.--highlighted,.root.--variant-outline.--color-white:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-white),12%)}.root.--variant-outline.--color-black{background-color:transparent;border-color:var(--rs-color-black);color:var(--rs-color-black)}.root.--variant-outline.--color-black.--highlighted,.root.--variant-outline.--color-black:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-black),4%)}.root.--variant-outline.--color-inherit{background-color:transparent;border-color:currentcolor;color:inherit}.root.--variant-outline.--color-inherit:before{background-color:currentcolor;content:"";inset:0;opacity:0;position:absolute;transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity}.root.--variant-outline.--color-inherit.--highlighted,.root.--variant-outline.--color-inherit:hover:not(.--loading){background-color:transparent}.root.--variant-outline.--color-inherit.--highlighted:before,.root.--variant-outline.--color-inherit:hover:not(.--loading):before{opacity:.1}.root.--variant-ghost{padding-left:var(--rs-button-padding-h-ghost);padding-right:var(--rs-button-padding-h-ghost)}.root.--variant-ghost.--color-neutral{background:transparent;color:var(--rs-color-foreground-neutral)}.root.--variant-ghost.--color-neutral.--highlighted,.root.--variant-ghost.--color-neutral:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-neutral),40%)}.root.--variant-ghost.--color-primary{background:transparent;color:var(--rs-color-foreground-primary)}.root.--variant-ghost.--color-primary.--highlighted,.root.--variant-ghost.--color-primary:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-primary),12%)}.root.--variant-ghost.--color-critical{background:transparent;color:var(--rs-color-foreground-critical)}.root.--variant-ghost.--color-critical.--highlighted,.root.--variant-ghost.--color-critical:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-critical),12%)}.root.--variant-ghost.--color-positive{background:transparent;color:var(--rs-color-foreground-positive)}.root.--variant-ghost.--color-positive.--highlighted,.root.--variant-ghost.--color-positive:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-positive),12%)}.root.--variant-ghost.--color-white{background:transparent;color:var(--rs-color-white)}.root.--variant-ghost.--color-white.--highlighted,.root.--variant-ghost.--color-white:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-white),8%)}.root.--variant-ghost.--color-black{background:transparent;color:var(--rs-color-black)}.root.--variant-ghost.--color-black.--highlighted,.root.--variant-ghost.--color-black:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-black),8%)}.root.--variant-ghost.--color-inherit{background-color:transparent;color:inherit}.root.--variant-ghost.--color-inherit:before{background-color:currentcolor}.root.--variant-ghost.--color-inherit.--highlighted,.root.--variant-ghost.--color-inherit:hover:not(.--loading){background-color:transparent}.root.--variant-ghost.--color-inherit.--highlighted:before,.root.--variant-ghost.--color-inherit:hover:not(.--loading):before{opacity:.08}.root.--disabled,.root.--disabled:hover:not(.--loading){background-color:var(--rs-color-background-disabled)!important;border-color:var(--rs-color-border-disabled)!important;color:var(--rs-color-foreground-disabled)!important}.root.--disabled:before,.root.--disabled:hover:not(.--loading):before{opacity:0!important}.root.--disabled.--variant-faded,.root.--disabled:hover:not(.--loading).--variant-faded{background-color:var(--rs-color-background-disabled-faded)!important}.root.--disabled.--variant-outline,.root.--disabled:hover:not(.--loading).--variant-outline{background-color:transparent!important}.root.--disabled.--variant-ghost,.root.--disabled:hover:not(.--loading).--variant-ghost{background-color:transparent!important;border-color:transparent!important}.root.--disabled:active,.root.--disabled:hover:not(.--loading):active{transform:none!important}.aligner{line-height:0}.aligner.--aligner-position-all .root{margin:calc(var(--rs-button-padding-v) * -1) calc(var(--rs-button-padding-h) * -1)}.aligner.--aligner-position-start .root{margin-inline-start:calc(var(--rs-button-padding-h) * -1)}.aligner.--aligner-position-end .root{margin-inline-end:calc(var(--rs-button-padding-h) * -1)}.aligner.--aligner-position-top .root{margin-top:calc(var(--rs-button-padding-v) * -1)}.aligner.--aligner-position-bottom .root{margin-bottom:calc(var(--rs-button-padding-v) * -1)}@media (min-width:660px){.--size-small--m{--rs-button-padding-v:var(--rs-unit-x1);--rs-button-padding-h:var(--rs-unit-x2);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x1);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3)}.--size-medium--m,.--size-small--m{border-radius:var(--rs-unit-radius-small)}.--size-medium--m{--rs-button-padding-v:var(--rs-unit-x2);--rs-button-padding-h:var(--rs-unit-x3);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3)}.--size-large--m{--rs-button-padding-v:var(--rs-unit-x3);--rs-button-padding-h:var(--rs-unit-x4);--rs-button-padding-h-ghost:var(--rs-unit-x3);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2)}.--size-large--m,.--size-xlarge--m{border-radius:var(--rs-unit-radius-medium)}.--size-xlarge--m{--rs-button-padding-v:var(--rs-unit-x4);--rs-button-padding-h:var(--rs-unit-x5);--rs-button-padding-h-ghost:var(--rs-unit-x4);--rs-button-icon-gap:var(--rs-unit-x3);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2)}.--full-width-true--m{text-align:center;width:100%}.--full-width-false--m{text-align:initial;width:auto}}@media (min-width:900px){.--size-small--l{--rs-button-padding-v:var(--rs-unit-x1);--rs-button-padding-h:var(--rs-unit-x2);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x1);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3)}.--size-medium--l,.--size-small--l{border-radius:var(--rs-unit-radius-small)}.--size-medium--l{--rs-button-padding-v:var(--rs-unit-x2);--rs-button-padding-h:var(--rs-unit-x3);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3)}.--size-large--l{--rs-button-padding-v:var(--rs-unit-x3);--rs-button-padding-h:var(--rs-unit-x4);--rs-button-padding-h-ghost:var(--rs-unit-x3);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2)}.--size-large--l,.--size-xlarge--l{border-radius:var(--rs-unit-radius-medium)}.--size-xlarge--l{--rs-button-padding-v:var(--rs-unit-x4);--rs-button-padding-h:var(--rs-unit-x5);--rs-button-padding-h-ghost:var(--rs-unit-x4);--rs-button-icon-gap:var(--rs-unit-x3);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2)}.--full-width-true--l{text-align:center;width:100%}.--full-width-false--l{text-align:initial;width:auto}}@media (min-width:1280px){.--size-small--xl{--rs-button-padding-v:var(--rs-unit-x1);--rs-button-padding-h:var(--rs-unit-x2);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x1);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3)}.--size-medium--xl,.--size-small--xl{border-radius:var(--rs-unit-radius-small)}.--size-medium--xl{--rs-button-padding-v:var(--rs-unit-x2);--rs-button-padding-h:var(--rs-unit-x3);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3)}.--size-large--xl{--rs-button-padding-v:var(--rs-unit-x3);--rs-button-padding-h:var(--rs-unit-x4);--rs-button-padding-h-ghost:var(--rs-unit-x3);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2)}.--size-large--xl,.--size-xlarge--xl{border-radius:var(--rs-unit-radius-medium)}.--size-xlarge--xl{--rs-button-padding-v:var(--rs-unit-x4);--rs-button-padding-h:var(--rs-unit-x5);--rs-button-padding-h-ghost:var(--rs-unit-x4);--rs-button-icon-gap:var(--rs-unit-x3);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2)}.--full-width-true--xl{text-align:center;width:100%}.--full-width-false--xl{text-align:initial;width:auto}}
1
+ .root{-webkit-tap-highlight-color:transparent;align-items:center;border:var(--rs-button-border-width) solid transparent;border-radius:var(--rs-button-radius);box-sizing:border-box;cursor:pointer;display:inline-flex;font-family:var(--rs-font-family-body);font-size:var(--rs-button-font-size);font-weight:var(--rs-font-weight-medium);justify-content:center;line-height:var(--rs-button-line-height);min-height:calc(var(--rs-button-line-height) + var(--rs-button-padding-v) * 2);min-width:calc(var(--rs-button-line-height) - (var(--rs-unit-x1) * 2) + (var(--rs-button-padding-h) * 2));overflow:hidden;padding:calc(var(--rs-button-padding-v) - var(--rs-button-border-width)) calc(var(--rs-button-padding-h) - var(--rs-button-border-width));position:relative;text-align:initial;text-decoration:none;transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:background-color,box-shadow,border-color,color,transform;z-index:0}.root:active{transform:scale(.98)}.loader{align-items:center;display:none;inset:0;justify-content:center;position:absolute}.icon{margin-inline-end:var(--rs-button-icon-gap)}.icon.--icon-position-end{margin-inline-end:0;margin-inline-start:var(--rs-button-icon-gap)}.icon:last-child{margin-inline-end:0}.icon,.text{position:relative;z-index:5}.root.--loading{cursor:default}.root.--loading:active{transform:none}.root.--loading .icon,.root.--loading .text{visibility:hidden}.root.--loading .loader{display:flex}.--elevated{box-shadow:var(--rs-shadow-raised)}.root.--icon-only .icon{margin:0 calc(var(--rs-unit-x1) * -1)}.root.--rounded{border-radius:999px}.--size-small{--rs-button-padding-v:var(--rs-unit-x1);--rs-button-padding-h:var(--rs-unit-x2);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x1);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-medium{--rs-button-padding-v:var(--rs-unit-x2);--rs-button-padding-h:var(--rs-unit-x3);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-large{--rs-button-padding-v:var(--rs-unit-x3);--rs-button-padding-h:var(--rs-unit-x4);--rs-button-padding-h-ghost:var(--rs-unit-x3);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--size-xlarge{--rs-button-padding-v:var(--rs-unit-x4);--rs-button-padding-h:var(--rs-unit-x5);--rs-button-padding-h-ghost:var(--rs-unit-x4);--rs-button-icon-gap:var(--rs-unit-x3);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--full-width{text-align:center;width:100%}.root.--variant-faded.--color-critical:before,.root.--variant-faded.--color-inherit:before,.root.--variant-faded.--color-neutral:before,.root.--variant-faded.--color-positive:before,.root.--variant-faded.--color-primary:before,.root.--variant-ghost.--color-inherit:before,.root.--variant-outline.--color-inherit:before,.root.--variant-solid.--color-black:before,.root.--variant-solid.--color-white:before{content:"";inset:0;opacity:0;position:absolute;transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity}.root.--variant-solid{--rs-button-border-width:0px}.root.--variant-solid.--color-neutral{background-color:var(--rs-color-background-neutral);color:var(--rs-color-foreground-neutral)}.root.--variant-solid.--color-neutral.--highlighted,.root.--variant-solid.--color-neutral:hover:not(.--loading){background-color:var(--rs-color-background-neutral-highlighted)}.root.--variant-solid.--color-primary{background-color:var(--rs-color-background-primary);color:var(--rs-color-on-background-primary)}.root.--variant-solid.--color-primary.--highlighted,.root.--variant-solid.--color-primary:hover:not(.--loading){background-color:var(--rs-color-background-primary-highlighted)}.root.--variant-solid.--color-critical{background-color:var(--rs-color-background-critical);color:var(--rs-color-on-background-critical)}.root.--variant-solid.--color-critical.--highlighted,.root.--variant-solid.--color-critical:hover:not(.--loading){background-color:var(--rs-color-background-critical-highlighted)}.root.--variant-solid.--color-positive{background-color:var(--rs-color-background-positive);color:var(--rs-color-on-background-positive)}.root.--variant-solid.--color-positive.--highlighted,.root.--variant-solid.--color-positive:hover:not(.--loading){background-color:var(--rs-color-background-positive-highlighted)}.root.--variant-solid.--color-white{background-color:var(--rs-color-white);color:var(--rs-color-black)}.root.--variant-solid.--color-white:before{background-color:var(--rs-color-black)}.root.--variant-solid.--color-white.--highlighted:before,.root.--variant-solid.--color-white:hover:not(.--loading):before{opacity:.04}.root.--variant-solid.--color-black{background-color:var(--rs-color-black);color:var(--rs-color-white)}.root.--variant-solid.--color-black:before{background-color:var(--rs-color-white)}.root.--variant-solid.--color-black.--highlighted:before,.root.--variant-solid.--color-black:hover:not(.--loading):before{opacity:.2}.root.--variant-faded{--rs-button-border-width:0px}.root.--variant-faded.--color-neutral{--rs-button-border-width:1px;background-color:var(--rs-color-background-elevation-base);border-color:var(--rs-color-border-neutral-faded);color:var(--rs-color-foreground-neutral)}.root.--variant-faded.--color-neutral:before{background-color:var(--rs-color-foreground-neutral)}.root.--variant-faded.--color-neutral.--highlighted:before,.root.--variant-faded.--color-neutral:hover:not(.--loading):before{opacity:.04}.root.--variant-faded.--color-primary{background-color:var(--rs-color-background-primary-faded);color:var(--rs-color-foreground-primary)}.root.--variant-faded.--color-primary:before{background-color:var(--rs-color-foreground-primary)}.root.--variant-faded.--color-primary.--highlighted:before,.root.--variant-faded.--color-primary:hover:not(.--loading):before{opacity:.06}.root.--variant-faded.--color-critical{background-color:var(--rs-color-background-critical-faded);color:var(--rs-color-foreground-critical)}.root.--variant-faded.--color-critical:before{background-color:var(--rs-color-foreground-critical)}.root.--variant-faded.--color-critical.--highlighted:before,.root.--variant-faded.--color-critical:hover:not(.--loading):before{opacity:.06}.root.--variant-faded.--color-positive{background-color:var(--rs-color-background-positive-faded);color:var(--rs-color-foreground-positive)}.root.--variant-faded.--color-positive:before{background-color:var(--rs-color-foreground-positive)}.root.--variant-faded.--color-positive.--highlighted:before,.root.--variant-faded.--color-positive:hover:not(.--loading):before{opacity:.06}.root.--variant-faded.--color-inherit{color:inherit}.root.--variant-faded.--color-inherit:before{background-color:currentcolor;opacity:.16}.root.--variant-faded.--color-inherit.--highlighted:before,.root.--variant-faded.--color-inherit:hover:not(.--loading):before{opacity:.24}.root.--variant-faded.--color-black{background-color:rgba(var(--rs-color-rgb-black),28%);color:var(--rs-color-white)}.root.--variant-faded.--color-black.--highlighted,.root.--variant-faded.--color-black:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-black),36%)}.root.--variant-faded.--color-white{background-color:rgba(var(--rs-color-rgb-white),28%);color:var(--rs-color-black)}.root.--variant-faded.--color-white.--highlighted,.root.--variant-faded.--color-white:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-white),36%)}.root.--variant-outline{--rs-button-border-width:1px}.root.--variant-outline.--color-neutral{background-color:transparent;border-color:var(--rs-color-border-neutral);color:var(--rs-color-foreground-neutral)}.root.--variant-outline.--color-neutral.--highlighted,.root.--variant-outline.--color-neutral:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-neutral),28%)}.root.--variant-outline.--color-primary{background-color:transparent;border-color:var(--rs-color-border-primary);color:var(--rs-color-foreground-primary)}.root.--variant-outline.--color-primary.--highlighted,.root.--variant-outline.--color-primary:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-primary),10%)}.root.--variant-outline.--color-critical{background-color:transparent;border-color:var(--rs-color-border-critical);color:var(--rs-color-foreground-critical)}.root.--variant-outline.--color-critical.--highlighted,.root.--variant-outline.--color-critical:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-critical),10%)}.root.--variant-outline.--color-positive{background-color:transparent;border-color:var(--rs-color-border-positive);color:var(--rs-color-foreground-positive)}.root.--variant-outline.--color-positive.--highlighted,.root.--variant-outline.--color-positive:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-positive),10%)}.root.--variant-outline.--color-white{background-color:transparent;border-color:var(--rs-color-white);color:var(--rs-color-white)}.root.--variant-outline.--color-white.--highlighted,.root.--variant-outline.--color-white:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-white),12%)}.root.--variant-outline.--color-black{background-color:transparent;border-color:var(--rs-color-black);color:var(--rs-color-black)}.root.--variant-outline.--color-black.--highlighted,.root.--variant-outline.--color-black:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-black),4%)}.root.--variant-outline.--color-inherit{background-color:transparent;border-color:currentcolor;color:inherit}.root.--variant-outline.--color-inherit:before{background-color:currentcolor;content:"";inset:0;opacity:0;position:absolute;transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity}.root.--variant-outline.--color-inherit.--highlighted,.root.--variant-outline.--color-inherit:hover:not(.--loading){background-color:transparent}.root.--variant-outline.--color-inherit.--highlighted:before,.root.--variant-outline.--color-inherit:hover:not(.--loading):before{opacity:.1}.root.--variant-ghost{--rs-button-border-width:0px;padding-left:var(--rs-button-padding-h-ghost);padding-right:var(--rs-button-padding-h-ghost)}.root.--variant-ghost.--color-neutral{background:transparent;color:var(--rs-color-foreground-neutral)}.root.--variant-ghost.--color-neutral.--highlighted,.root.--variant-ghost.--color-neutral:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-neutral),40%)}.root.--variant-ghost.--color-primary{background:transparent;color:var(--rs-color-foreground-primary)}.root.--variant-ghost.--color-primary.--highlighted,.root.--variant-ghost.--color-primary:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-primary),12%)}.root.--variant-ghost.--color-critical{background:transparent;color:var(--rs-color-foreground-critical)}.root.--variant-ghost.--color-critical.--highlighted,.root.--variant-ghost.--color-critical:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-critical),12%)}.root.--variant-ghost.--color-positive{background:transparent;color:var(--rs-color-foreground-positive)}.root.--variant-ghost.--color-positive.--highlighted,.root.--variant-ghost.--color-positive:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-background-positive),12%)}.root.--variant-ghost.--color-white{background:transparent;color:var(--rs-color-white)}.root.--variant-ghost.--color-white.--highlighted,.root.--variant-ghost.--color-white:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-white),8%)}.root.--variant-ghost.--color-black{background:transparent;color:var(--rs-color-black)}.root.--variant-ghost.--color-black.--highlighted,.root.--variant-ghost.--color-black:hover:not(.--loading){background-color:rgba(var(--rs-color-rgb-black),8%)}.root.--variant-ghost.--color-inherit{background-color:transparent;color:inherit}.root.--variant-ghost.--color-inherit:before{background-color:currentcolor}.root.--variant-ghost.--color-inherit.--highlighted,.root.--variant-ghost.--color-inherit:hover:not(.--loading){background-color:transparent}.root.--variant-ghost.--color-inherit.--highlighted:before,.root.--variant-ghost.--color-inherit:hover:not(.--loading):before{opacity:.08}.root.--disabled,.root.--disabled:hover:not(.--loading){background-color:var(--rs-color-background-disabled)!important;border-color:var(--rs-color-border-disabled)!important;color:var(--rs-color-foreground-disabled)!important}.root.--disabled:before,.root.--disabled:hover:not(.--loading):before{opacity:0!important}.root.--disabled.--variant-faded,.root.--disabled:hover:not(.--loading).--variant-faded{background-color:var(--rs-color-background-disabled-faded)!important}.root.--disabled.--variant-outline,.root.--disabled:hover:not(.--loading).--variant-outline{background-color:transparent!important}.root.--disabled.--variant-ghost,.root.--disabled:hover:not(.--loading).--variant-ghost{background-color:transparent!important;border-color:transparent!important}.root.--disabled:active,.root.--disabled:hover:not(.--loading):active{transform:none!important}.group .root{border-radius:0}.group .root:first-child{border-end-start-radius:var(--rs-button-radius);border-start-start-radius:var(--rs-button-radius)}.group .root:not(:first-child){border-inline-start:1px solid var(--rs-button-group-separator-color)}.group .root:last-child{border-end-end-radius:var(--rs-button-radius);border-start-end-radius:var(--rs-button-radius)}.group .root.--variant-solid.--color-neutral{--rs-button-group-separator-color:var(--rs-color-border-neutral)}.group .root.--variant-ghost.--color-neutral{--rs-button-group-separator-color:var(--rs-color-border-neutral-faded)}.group .root.--variant-solid.--color-positive{--rs-button-group-separator-color:var(--rs-color-border-positive)}.group .root.--variant-ghost.--color-positive{--rs-button-group-separator-color:var(--rs-color-border-positive-faded)}.group .root.--variant-solid.--color-critical{--rs-button-group-separator-color:var(--rs-color-border-critical)}.group .root.--variant-ghost.--color-critical{--rs-button-group-separator-color:var(--rs-color-border-critical-faded)}.group .root.--variant-solid.--color-primary{--rs-button-group-separator-color:var(--rs-color-border-primary)}.group .root.--variant-ghost.--color-primary{--rs-button-group-separator-color:var(--rs-color-border-primary-faded)}.group .root.--variant-faded.--color-positive{--rs-button-group-separator-color:var(--rs-color-border-positive-faded)}.group .root.--variant-faded.--color-critical{--rs-button-group-separator-color:var(--rs-color-border-critical-faded)}.group .root.--variant-faded.--color-primary{--rs-button-group-separator-color:var(--rs-color-border-primary-faded)}.group .root.--variant-solid.--color-black{--rs-button-group-separator-color:rgba(var(--rs-color-rgb-white),0.28)}.group .root.--variant-faded.--color-black{--rs-button-group-separator-color:rgba(var(--rs-color-rgb-white),0.14)}.group .root.--variant-faded.--color-white,.group .root.--variant-ghost.--color-black,.group .root.--variant-solid.--color-white{--rs-button-group-separator-color:rgba(var(--rs-color-rgb-black),0.2)}.group .root.--variant-ghost.--color-white{--rs-button-group-separator-color:rgba(var(--rs-color-rgb-white),0.28)}.aligner{line-height:0}.aligner.--aligner-position-all .root{margin:calc(var(--rs-button-padding-v) * -1) calc(var(--rs-button-padding-h) * -1)}.aligner.--aligner-position-start .root{margin-inline-start:calc(var(--rs-button-padding-h) * -1)}.aligner.--aligner-position-end .root{margin-inline-end:calc(var(--rs-button-padding-h) * -1)}.aligner.--aligner-position-top .root{margin-top:calc(var(--rs-button-padding-v) * -1)}.aligner.--aligner-position-bottom .root{margin-bottom:calc(var(--rs-button-padding-v) * -1)}@media (min-width:660px){.--size-small--m{--rs-button-padding-v:var(--rs-unit-x1);--rs-button-padding-h:var(--rs-unit-x2);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x1);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-medium--m{--rs-button-padding-v:var(--rs-unit-x2);--rs-button-padding-h:var(--rs-unit-x3);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-large--m{--rs-button-padding-v:var(--rs-unit-x3);--rs-button-padding-h:var(--rs-unit-x4);--rs-button-padding-h-ghost:var(--rs-unit-x3);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--size-xlarge--m{--rs-button-padding-v:var(--rs-unit-x4);--rs-button-padding-h:var(--rs-unit-x5);--rs-button-padding-h-ghost:var(--rs-unit-x4);--rs-button-icon-gap:var(--rs-unit-x3);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--full-width-true--m{text-align:center;width:100%}.--full-width-false--m{text-align:initial;width:auto}}@media (min-width:900px){.--size-small--l{--rs-button-padding-v:var(--rs-unit-x1);--rs-button-padding-h:var(--rs-unit-x2);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x1);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-medium--l{--rs-button-padding-v:var(--rs-unit-x2);--rs-button-padding-h:var(--rs-unit-x3);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-large--l{--rs-button-padding-v:var(--rs-unit-x3);--rs-button-padding-h:var(--rs-unit-x4);--rs-button-padding-h-ghost:var(--rs-unit-x3);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--size-xlarge--l{--rs-button-padding-v:var(--rs-unit-x4);--rs-button-padding-h:var(--rs-unit-x5);--rs-button-padding-h-ghost:var(--rs-unit-x4);--rs-button-icon-gap:var(--rs-unit-x3);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--full-width-true--l{text-align:center;width:100%}.--full-width-false--l{text-align:initial;width:auto}}@media (min-width:1280px){.--size-small--xl{--rs-button-padding-v:var(--rs-unit-x1);--rs-button-padding-h:var(--rs-unit-x2);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x1);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-medium--xl{--rs-button-padding-v:var(--rs-unit-x2);--rs-button-padding-h:var(--rs-unit-x3);--rs-button-padding-h-ghost:var(--rs-unit-x2);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-3);--rs-button-font-size:var(--rs-font-size-body-3);--rs-button-radius:var(--rs-unit-radius-small)}.--size-large--xl{--rs-button-padding-v:var(--rs-unit-x3);--rs-button-padding-h:var(--rs-unit-x4);--rs-button-padding-h-ghost:var(--rs-unit-x3);--rs-button-icon-gap:var(--rs-unit-x2);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--size-xlarge--xl{--rs-button-padding-v:var(--rs-unit-x4);--rs-button-padding-h:var(--rs-unit-x5);--rs-button-padding-h-ghost:var(--rs-unit-x4);--rs-button-icon-gap:var(--rs-unit-x3);--rs-button-line-height:var(--rs-line-height-body-2);--rs-button-font-size:var(--rs-font-size-body-2);--rs-button-radius:var(--rs-unit-radius-medium)}.--full-width-true--xl{text-align:center;width:100%}.--full-width-false--xl{text-align:initial;width:auto}}
@@ -18,6 +18,11 @@ type BaseProps = {
18
18
  className?: G.ClassName;
19
19
  };
20
20
  export type Props = Omit<ActionableProps, keyof BaseProps> & BaseProps;
21
+ export type GroupProps = {
22
+ children: React.ReactNode;
23
+ className?: G.ClassName;
24
+ attributes?: G.Attributes<"div", Props>;
25
+ };
21
26
  type AlignerPosition = "start" | "end" | "top" | "bottom";
22
27
  export type AlignerProps = {
23
28
  children: React.ReactElement;
@@ -27,5 +32,6 @@ export type AlignerProps = {
27
32
  };
28
33
  export type Export = React.ForwardRefExoticComponent<Props> & {
29
34
  Aligner: React.ComponentType<AlignerProps>;
35
+ Group: React.ComponentType<GroupProps>;
30
36
  };
31
37
  export {};
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type * as T from "./Button.types";
3
+ declare const ButtonGroup: (props: T.GroupProps) => React.JSX.Element;
4
+ export default ButtonGroup;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { classNames } from "../../utilities/helpers.js";
3
+ import s from "./Button.module.css";
4
+ const ButtonGroup = (props) => {
5
+ const { children, className, attributes } = props;
6
+ const groupClassNames = classNames(s.group, className);
7
+ return (React.createElement("div", Object.assign({}, attributes, { className: groupClassNames, role: "group" }), children));
8
+ };
9
+ export default ButtonGroup;
@@ -12,4 +12,5 @@ export declare const fullWidth: () => React.JSX.Element;
12
12
  export declare const loading: () => React.JSX.Element;
13
13
  export declare const highlighted: () => React.JSX.Element;
14
14
  export declare const disabled: () => React.JSX.Element;
15
+ export declare const group: () => React.JSX.Element;
15
16
  export declare const aligner: () => React.JSX.Element;
@@ -498,6 +498,69 @@ export const disabled = () => (<Example>
498
498
  </View>
499
499
  </Example.Item>
500
500
  </Example>);
501
+ export const group = () => (<Example>
502
+ <Example.Item title="with icon">
503
+ <Button.Group>
504
+ <Button rounded>Submit</Button>
505
+ <Button rounded icon={IconZap}/>
506
+ </Button.Group>
507
+ </Example.Item>
508
+ <Example.Item title="variant: solid">
509
+ <View gap={2}>
510
+ {["neutral", "primary", "critical", "positive", "black", "white"].map((color) => (<Button.Group>
511
+ <Button color={color}>One</Button>
512
+ <Button color={color}>Two</Button>
513
+ <Button color={color}>Three</Button>
514
+ </Button.Group>))}
515
+ </View>
516
+ </Example.Item>
517
+ <Example.Item title="variant: outline">
518
+ <View gap={2}>
519
+ {["neutral", "primary", "critical", "positive", "black", "white"].map((color) => (<Button.Group>
520
+ <Button color={color} variant="outline">
521
+ One
522
+ </Button>
523
+ <Button color={color} variant="outline">
524
+ Two
525
+ </Button>
526
+ <Button color={color} variant="outline">
527
+ Three
528
+ </Button>
529
+ </Button.Group>))}
530
+ </View>
531
+ </Example.Item>
532
+ <Example.Item title="variant: faded">
533
+ <View gap={2}>
534
+ {["neutral", "primary", "critical", "positive", "black", "white"].map((color) => (<Button.Group>
535
+ <Button color={color} variant="faded">
536
+ One
537
+ </Button>
538
+ <Button color={color} variant="faded">
539
+ Two
540
+ </Button>
541
+ <Button color={color} variant="faded">
542
+ Three
543
+ </Button>
544
+ </Button.Group>))}
545
+ </View>
546
+ </Example.Item>
547
+
548
+ <Example.Item title="variant: ghost">
549
+ <View gap={2}>
550
+ {["neutral", "primary", "critical", "positive", "black", "white"].map((color) => (<Button.Group>
551
+ <Button color={color} variant="ghost">
552
+ One
553
+ </Button>
554
+ <Button color={color} variant="ghost">
555
+ Two
556
+ </Button>
557
+ <Button color={color} variant="ghost">
558
+ Three
559
+ </Button>
560
+ </Button.Group>))}
561
+ </View>
562
+ </Example.Item>
563
+ </Example>);
501
564
  export const aligner = () => (<Example>
502
565
  <Example.Item title="aligner: all">
503
566
  <View padding={4} borderColor="neutral-faded" direction="row" gap={2}>
@@ -1 +1 @@
1
- .root{align-items:center;cursor:pointer;display:inline-flex;gap:var(--rs-unit-x2);-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:top}.root:hover .decorator{background:var(--rs-color-background-neutral-faded)}.field{position:relative}.decorator{background:var(--rs-color-background-elevation-base);border:1px solid var(--rs-color-border-neutral);border-radius:var(--rs-unit-radius-small);height:var(--rs-line-height-body-3);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:background-color,border-color;width:var(--rs-line-height-body-3)}.icon{left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%) scale(0);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity,transform}[data-rs-keyboard] .input:focus+.decorator{box-shadow:var(--rs-focus-shadow)}.input:indeterminate+.decorator,.root.--error .input:indeterminate+.decorator,.root.--error:hover .input:indeterminate+.decorator,.root:hover .input:indeterminate+.decorator{background:var(--rs-color-background-primary);border-color:var(--rs-color-background-primary)}.input:indeterminate+.decorator:before,.root.--error .input:indeterminate+.decorator:before,.root.--error:hover .input:indeterminate+.decorator:before,.root:hover .input:indeterminate+.decorator:before{background:var(--rs-color-on-background-primary);border-radius:999px;content:"";height:2px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:var(--rs-unit-x2)}.input:checked+.decorator,.root.--error .input:checked+.decorator,.root.--error:hover .input:checked+.decorator,.root:hover .input:checked+.decorator{background:var(--rs-color-background-primary);border-color:var(--rs-color-background-primary);color:var(--rs-color-on-background-primary)}.input:checked+.decorator .icon,.root.--error .input:checked+.decorator .icon,.root.--error:hover .input:checked+.decorator .icon,.root:hover .input:checked+.decorator .icon{opacity:1;transform:translate(-50%,-50%) scale(1)}.root.--error .decorator{border-color:var(--rs-color-border-critical)}.root.--disabled{color:var(--rs-color-foreground-disabled);cursor:not-allowed}.root.--disabled .decorator,.root.--disabled .input:checked+.decorator,.root.--disabled:hover .decorator,.root.--disabled:hover .input:checked+.decorator{background:var(--rs-color-background-disabled-faded);border-color:var(--rs-color-border-disabled);color:var(--rs-color-foreground-disabled)}.root.--disabled .input:checked+.decorator,.root.--disabled .input:indeterminate+.decorator,.root.--disabled:hover .input:checked+.decorator,.root.--disabled:hover .input:indeterminate+.decorator{background:var(--rs-color-background-disabled);border-color:transparent}.root.--disabled .input:indeterminate+.decorator:before{background:var(--rs-color-foreground-disabled)}.root.--disabled .input:checked+.decorator:after{background:var(--rs-color-border-disabled)}
1
+ .root{-webkit-tap-highlight-color:transparent;align-items:center;cursor:pointer;display:inline-flex;gap:var(--rs-unit-x2);-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:top}.root:hover .decorator{background:var(--rs-color-background-neutral-faded)}.field{position:relative}.decorator{background:var(--rs-color-background-elevation-base);border:1px solid var(--rs-color-border-neutral);border-radius:var(--rs-unit-radius-small);height:var(--rs-line-height-body-3);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:background-color,border-color;width:var(--rs-line-height-body-3)}.icon{left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%) scale(0);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity,transform}[data-rs-keyboard] .input:focus+.decorator{box-shadow:var(--rs-focus-shadow)}.input:indeterminate+.decorator,.root.--error .input:indeterminate+.decorator,.root.--error:hover .input:indeterminate+.decorator,.root:hover .input:indeterminate+.decorator{background:var(--rs-color-background-primary);border-color:var(--rs-color-background-primary)}.input:indeterminate+.decorator:before,.root.--error .input:indeterminate+.decorator:before,.root.--error:hover .input:indeterminate+.decorator:before,.root:hover .input:indeterminate+.decorator:before{background:var(--rs-color-on-background-primary);border-radius:999px;content:"";height:2px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:var(--rs-unit-x2)}.input:checked+.decorator,.root.--error .input:checked+.decorator,.root.--error:hover .input:checked+.decorator,.root:hover .input:checked+.decorator{background:var(--rs-color-background-primary);border-color:var(--rs-color-background-primary);color:var(--rs-color-on-background-primary)}.input:checked+.decorator .icon,.root.--error .input:checked+.decorator .icon,.root.--error:hover .input:checked+.decorator .icon,.root:hover .input:checked+.decorator .icon{opacity:1;transform:translate(-50%,-50%) scale(1)}.root.--error .decorator{border-color:var(--rs-color-border-critical)}.root.--disabled{color:var(--rs-color-foreground-disabled);cursor:not-allowed}.root.--disabled .decorator,.root.--disabled .input:checked+.decorator,.root.--disabled:hover .decorator,.root.--disabled:hover .input:checked+.decorator{background:var(--rs-color-background-disabled-faded);border-color:var(--rs-color-border-disabled);color:var(--rs-color-foreground-disabled)}.root.--disabled .input:checked+.decorator,.root.--disabled .input:indeterminate+.decorator,.root.--disabled:hover .input:checked+.decorator,.root.--disabled:hover .input:indeterminate+.decorator{background:var(--rs-color-background-disabled);border-color:transparent}.root.--disabled .input:indeterminate+.decorator:before{background:var(--rs-color-foreground-disabled)}.root.--disabled .input:checked+.decorator:after{background:var(--rs-color-border-disabled)}
@@ -57,7 +57,7 @@ const DropdownMenuItem = (props) => {
57
57
  if (onClick)
58
58
  onClick(e);
59
59
  };
60
- return (React.createElement(MenuItem, Object.assign({}, props, { roundedCorners: true, className: s.item, attributes: Object.assign(Object.assign({}, props.attributes), { role: "menuitem" }), onClick: handleClick })));
60
+ return (React.createElement(MenuItem, Object.assign({}, props, { roundedCorners: true, className: s.item, attributes: Object.assign({ role: "menuitem" }, props.attributes), onClick: handleClick })));
61
61
  };
62
62
  const DropdownMenuSubMenu = (props) => {
63
63
  const { children } = props;
@@ -42,6 +42,7 @@ export const position = () => (<Example>
42
42
  </DropdownMenu.Content>
43
43
  </DropdownMenu>
44
44
  </Example.Item>
45
+ <div style={{ height: 2000 }}/>
45
46
  </Example>);
46
47
  export const sections = () => (<Example>
47
48
  <Example.Item title="2 sections">
@@ -14,7 +14,6 @@ const Overlay = (props) => {
14
14
  const { active, children, transparent, onClose, className, attributes } = props;
15
15
  const [mounted, setMounted] = React.useState(false);
16
16
  const contentRef = React.useRef(null);
17
- const rootRef = React.useRef(null);
18
17
  const isMouseDownValidRef = React.useRef(false);
19
18
  const releaseFocusRef = React.useRef(null);
20
19
  const { lockScroll, unlockScroll } = useScrollLock();
@@ -101,10 +100,11 @@ const Overlay = (props) => {
101
100
  }, []);
102
101
  if (!rendered || !mounted)
103
102
  return null;
104
- return (React.createElement(Portal, { scopeRef: rootRef },
105
- React.createElement("div", Object.assign({}, attributes, { ref: rootRef, role: "button", tabIndex: -1, className: rootClassNames, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onTransitionEnd: handleTransitionEnd }),
103
+ return (React.createElement(Portal, null,
104
+ React.createElement(Portal.Scope, null, (ref) => (React.createElement("div", Object.assign({}, attributes, { ref: ref, role: "button", tabIndex: -1, className: rootClassNames, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onTransitionEnd: handleTransitionEnd }),
106
105
  React.createElement("div", { className: s.wrapper },
107
106
  React.createElement("div", { className: s.inner },
108
- React.createElement("div", { className: s.content, ref: contentRef }, typeof children === "function" ? children({ active: visible }) : children))))));
107
+ React.createElement("div", { className: s.content, ref: contentRef }, typeof children === "function" ? children({ active: visible }) : children)),
108
+ "P"))))));
109
109
  };
110
110
  export default Overlay;
@@ -1 +1 @@
1
- .root{align-items:center;cursor:pointer;display:inline-flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:top}.root:hover .input:not(:checked)+.decorator{background:var(--rs-color-background-neutral-faded)}.field{position:relative}.decorator{background:var(--rs-color-background-elevation-base);border:1px solid var(--rs-color-border-neutral);border-radius:50%;height:var(--rs-line-height-body-3);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:background-color,border-color;width:var(--rs-line-height-body-3)}.decorator:after{background:var(--rs-color-on-background-primary);border-radius:50%;content:"";height:var(--rs-unit-x2);left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%) scale(0);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity,transform;width:var(--rs-unit-x2)}[data-rs-keyboard] .input:focus+.decorator{box-shadow:var(--rs-focus-shadow)}.input:checked+.decorator,.root.--error .input:checked+.decorator,.root.--error:hover .input:checked+.decorator{background:var(--rs-color-background-primary);border-color:var(--rs-color-background-primary);border-width:2px}.input:checked+.decorator:after,.root.--error .input:checked+.decorator:after,.root.--error:hover .input:checked+.decorator:after{opacity:1;transform:translate(-50%,-50%) scale(1)}.text{margin-inline-start:var(--rs-unit-x2)}.root.--error .decorator,.root.--error:hover .input+.decorator{border-color:var(--rs-color-border-critical)}.root.--disabled{color:var(--rs-color-foreground-disabled);cursor:not-allowed}.root.--disabled .decorator,.root.--disabled .input:checked+.decorator,.root.--disabled:hover .input+.decorator{background:var(--rs-color-background-disabled-faded);border-color:var(--rs-color-border-disabled)}.root.--disabled .input:checked+.decorator{border-color:transparent}.root.--disabled .input:checked+.decorator:after{background:var(--rs-color-border-disabled)}
1
+ .root{-webkit-tap-highlight-color:transparent;align-items:center;cursor:pointer;display:inline-flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:top}.root:hover .input:not(:checked)+.decorator{background:var(--rs-color-background-neutral-faded)}.field{position:relative}.decorator{background:var(--rs-color-background-elevation-base);border:1px solid var(--rs-color-border-neutral);border-radius:50%;height:var(--rs-line-height-body-3);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:background-color,border-color;width:var(--rs-line-height-body-3)}.decorator:after{background:var(--rs-color-on-background-primary);border-radius:50%;content:"";height:var(--rs-unit-x2);left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%) scale(0);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity,transform;width:var(--rs-unit-x2)}[data-rs-keyboard] .input:focus+.decorator{box-shadow:var(--rs-focus-shadow)}.input:checked+.decorator,.root.--error .input:checked+.decorator,.root.--error:hover .input:checked+.decorator{background:var(--rs-color-background-primary);border-color:var(--rs-color-background-primary);border-width:2px}.input:checked+.decorator:after,.root.--error .input:checked+.decorator:after,.root.--error:hover .input:checked+.decorator:after{opacity:1;transform:translate(-50%,-50%) scale(1)}.text{margin-inline-start:var(--rs-unit-x2)}.root.--error .decorator,.root.--error:hover .input+.decorator{border-color:var(--rs-color-border-critical)}.root.--disabled{color:var(--rs-color-foreground-disabled);cursor:not-allowed}.root.--disabled .decorator,.root.--disabled .input:checked+.decorator,.root.--disabled:hover .input+.decorator{background:var(--rs-color-background-disabled-faded);border-color:var(--rs-color-border-disabled)}.root.--disabled .input:checked+.decorator{border-color:transparent}.root.--disabled .input:checked+.decorator:after{background:var(--rs-color-border-disabled)}
@@ -52,7 +52,7 @@ const Select = (props) => {
52
52
  children || (placeholder ? React.createElement(Text, { color: "neutral-faded" }, placeholder) : null)),
53
53
  React.createElement("input", { type: "hidden", value: value, name: name }))),
54
54
  React.createElement("div", { className: s.arrow },
55
- React.createElement(Icon, { svg: IconArrow, color: "neutral-faded", size: responsivePropDependency(size, (size) => {
55
+ React.createElement(Icon, { svg: IconArrow, color: disabled ? "disabled" : "neutral-faded", size: responsivePropDependency(size, (size) => {
56
56
  return size === "large" || size === "xlarge" ? 5 : 4;
57
57
  }) }))));
58
58
  };
@@ -1 +1 @@
1
- .root{align-items:center;cursor:pointer;display:flex;height:var(--rs-unit-x4)}.bar,.root{position:relative}.bar{background:var(--rs-color-background-neutral);border-radius:var(--rs-unit-radius-small);height:var(--rs-unit-x1);width:100%}.bar,.input{overflow:hidden}.input{height:1px;opacity:0;pointer-events:none;position:absolute;width:1px}.selection{background:var(--rs-color-background-primary);height:100%;position:absolute}.tooltip{background:var(--rs-color-background-elevation-overlay);border-radius:var(--rs-unit-radius-small);bottom:100%;box-shadow:var(--rs-shadow-overlay);color:var(--rs-color-foreground-neutral);left:50%;opacity:0;padding:calc(var(--rs-unit-x1) / 2) var(--rs-unit-x1);transform:translate(-50%);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity,transform;-webkit-user-select:none;-moz-user-select:none;user-select:none}.thumb,.tooltip{position:absolute}.thumb{height:100%;width:0}.thumb:before{background:var(--rs-color-background-primary);border-radius:999px;box-shadow:0 0 0 2px var(--rs-color-background-elevation-base);box-sizing:border-box;height:var(--rs-unit-x4);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:box-shadow;width:var(--rs-unit-x4)}.thumb:after,.thumb:before{content:"";left:0;position:absolute;top:50%;transform:translate(-50%,-50%)}.thumb:after{cursor:grab;height:var(--rs-unit-x9);width:var(--rs-unit-x9)}.thumb:hover .tooltip{opacity:1;transform:translate(-50%,calc(var(--rs-unit-x1) * -1))}.input:focus+.thumb:after,.thumb--active:after{cursor:grabbing}.input:focus+.thumb:before,.thumb--active:before{box-shadow:0 0 0 1px var(--rs-color-background-elevation-base)}.input:focus+.thumb .tooltip,.thumb--active .tooltip{opacity:1;transform:translate(-50%,calc(var(--rs-unit-x1) * -1)) scale(1.1)!important}.--disabled{cursor:not-allowed}.--disabled .bar{background-color:var(--rs-color-background-disabled)}.--disabled .selection,.--disabled .thumb:before{background-color:var(--rs-color-foreground-disabled)}.--disabled .thumb:after{cursor:not-allowed}.--disabled .thumb:hover .tooltip{opacity:0}
1
+ .root{align-items:center;cursor:pointer;display:flex;height:var(--rs-unit-x4);-webkit-user-select:none;-moz-user-select:none;user-select:none}.bar,.root{position:relative}.bar{background:var(--rs-color-background-neutral);border-radius:var(--rs-unit-radius-small);height:var(--rs-unit-x1);width:100%}.bar,.input{overflow:hidden}.input{height:1px;opacity:0;pointer-events:none;position:absolute;width:1px}.selection{background:var(--rs-color-background-primary);height:100%;position:absolute}.tooltip{background:var(--rs-color-background-elevation-overlay);border-radius:var(--rs-unit-radius-small);bottom:100%;box-shadow:var(--rs-shadow-overlay);color:var(--rs-color-foreground-neutral);left:50%;opacity:0;padding:calc(var(--rs-unit-x1) / 2) var(--rs-unit-x1);transform:translate(-50%);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:opacity,transform;-webkit-user-select:none;-moz-user-select:none;user-select:none}.thumb,.tooltip{position:absolute}.thumb{height:100%;width:0}.thumb:before{background:var(--rs-color-background-primary);border-radius:999px;box-shadow:0 0 0 2px var(--rs-color-background-elevation-base);box-sizing:border-box;height:var(--rs-unit-x4);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:box-shadow;width:var(--rs-unit-x4)}.thumb:after,.thumb:before{content:"";left:0;position:absolute;top:50%;transform:translate(-50%,-50%)}.thumb:after{cursor:grab;height:var(--rs-unit-x9);width:var(--rs-unit-x9)}.thumb:hover .tooltip{opacity:1;transform:translate(-50%,calc(var(--rs-unit-x1) * -1))}.input:focus+.thumb:after,.thumb--active:after{cursor:grabbing}.input:focus+.thumb:before,.thumb--active:before{box-shadow:0 0 0 1px var(--rs-color-background-elevation-base)}.input:focus+.thumb .tooltip,.thumb--active .tooltip{opacity:1;transform:translate(-50%,calc(var(--rs-unit-x1) * -1)) scale(1.1)!important}.--disabled{cursor:not-allowed}.--disabled .bar{background-color:var(--rs-color-background-disabled)}.--disabled .selection,.--disabled .thumb:before{background-color:var(--rs-color-foreground-disabled)}.--disabled .thumb:after{cursor:not-allowed}.--disabled .thumb:hover .tooltip{opacity:0}
@@ -1 +1 @@
1
- .root{align-items:center;display:inline-flex;gap:var(--rs-unit-x2);position:relative;vertical-align:top}.input{border:0;height:1px;left:0;opacity:0;outline:none;position:absolute;top:0;width:1px}.input:checked+.area{background:var(--rs-color-background-primary);border-color:transparent}.input:checked+.area .thumb{transform:translateX(var(--rs-unit-x3))}[dir=rtl] .input:checked+.area .thumb{transform:translateX(calc(var(--rs-unit-x3) * -1))}[data-rs-keyboard] .input:focus+.area{box-shadow:var(--rs-focus-shadow)}.input[disabled]+.area{background:var(--rs-color-background-disabled);cursor:not-allowed}.input[disabled]+.area .thumb{opacity:.8}.input[disabled]:checked+.area{background:var(--rs-color-background-primary);opacity:.4}.input[disabled]:checked+.area .thumb{opacity:1}.area{align-items:center;background:var(--rs-color-background-neutral);border:2px solid transparent;border-radius:calc(var(--rs-unit-x1) * 5 / 2);box-sizing:border-box;cursor:pointer;display:flex;height:calc(var(--rs-unit-x1) * 5);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:background,border;width:calc(var(--rs-unit-x1) * 8)}.thumb{background:var(--rs-color-white);border-radius:50%;box-shadow:var(--rs-shadow-raised);height:var(--rs-unit-x4);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:transform;width:var(--rs-unit-x4)}.root--size-small .area{height:calc(var(--rs-unit-x1) * 4);width:calc(var(--rs-unit-x1) * 6)}.root--size-small .thumb{height:var(--rs-unit-x3);width:var(--rs-unit-x3)}.root--size-small .input:checked+.area .thumb{transform:translateX(var(--rs-unit-x2))}[dir=rtl] .root--size-small .input:checked+.area .thumb{transform:translateX(calc(var(--rs-unit-x2) * -1))}.root--reversed{flex-direction:row-reverse}
1
+ .root{-webkit-tap-highlight-color:transparent;align-items:center;display:inline-flex;gap:var(--rs-unit-x2);position:relative;vertical-align:top}.input{border:0;height:1px;left:0;opacity:0;outline:none;position:absolute;top:0;width:1px}.input:checked+.area{background:var(--rs-color-background-primary);border-color:transparent}.input:checked+.area .thumb{transform:translateX(var(--rs-unit-x3))}[dir=rtl] .input:checked+.area .thumb{transform:translateX(calc(var(--rs-unit-x3) * -1))}[data-rs-keyboard] .input:focus+.area{box-shadow:var(--rs-focus-shadow)}.input[disabled]+.area{background:var(--rs-color-background-disabled);cursor:not-allowed}.input[disabled]+.area .thumb{opacity:.8}.input[disabled]:checked+.area{background:var(--rs-color-background-primary);opacity:.4}.input[disabled]:checked+.area .thumb{opacity:1}.area{align-items:center;background:var(--rs-color-background-neutral);border:2px solid transparent;border-radius:calc(var(--rs-unit-x1) * 5 / 2);box-sizing:border-box;cursor:pointer;display:flex;height:calc(var(--rs-unit-x1) * 5);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:background,border;width:calc(var(--rs-unit-x1) * 8)}.thumb{background:var(--rs-color-white);border-radius:50%;box-shadow:var(--rs-shadow-raised);height:var(--rs-unit-x4);transition:var(--rs-duration-fast) var(--rs-easing-standard);transition-property:transform;width:var(--rs-unit-x4)}.root--size-small .area{height:calc(var(--rs-unit-x1) * 4);width:calc(var(--rs-unit-x1) * 6)}.root--size-small .thumb{height:var(--rs-unit-x3);width:var(--rs-unit-x3)}.root--size-small .input:checked+.area .thumb{transform:translateX(var(--rs-unit-x2))}[dir=rtl] .root--size-small .input:checked+.area .thumb{transform:translateX(calc(var(--rs-unit-x2) * -1))}.root--reversed{flex-direction:row-reverse}