@vector-im/compound-web 8.3.1 → 8.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Button/Button.module.css.cjs +4 -4
- package/dist/components/Button/Button.module.css.js +4 -4
- package/dist/components/Button/IconButton/IconButton.module.css.cjs +3 -3
- package/dist/components/Button/IconButton/IconButton.module.css.js +3 -3
- package/dist/components/InlineSpinner/InlineSpinner.cjs +3 -2
- package/dist/components/InlineSpinner/InlineSpinner.cjs.map +1 -1
- package/dist/components/InlineSpinner/InlineSpinner.d.ts.map +1 -1
- package/dist/components/InlineSpinner/InlineSpinner.js +3 -2
- package/dist/components/InlineSpinner/InlineSpinner.js.map +1 -1
- package/dist/components/Menu/CheckboxMenuItem.cjs +3 -1
- package/dist/components/Menu/CheckboxMenuItem.cjs.map +1 -1
- package/dist/components/Menu/CheckboxMenuItem.d.ts.map +1 -1
- package/dist/components/Menu/CheckboxMenuItem.js +3 -1
- package/dist/components/Menu/CheckboxMenuItem.js.map +1 -1
- package/dist/components/Menu/MenuItem.module.css.cjs +8 -8
- package/dist/components/Menu/MenuItem.module.css.js +8 -8
- package/dist/components/Menu/ToggleMenuItem.cjs +3 -1
- package/dist/components/Menu/ToggleMenuItem.cjs.map +1 -1
- package/dist/components/Menu/ToggleMenuItem.d.ts.map +1 -1
- package/dist/components/Menu/ToggleMenuItem.js +3 -1
- package/dist/components/Menu/ToggleMenuItem.js.map +1 -1
- package/dist/components/ReleaseAnnouncement/ReleaseAnnouncement.cjs.map +1 -1
- package/dist/components/ReleaseAnnouncement/ReleaseAnnouncement.d.ts.map +1 -1
- package/dist/components/ReleaseAnnouncement/ReleaseAnnouncement.js.map +1 -1
- package/dist/style.css +84 -81
- package/package.json +5 -5
- package/src/components/Button/Button.module.css +3 -0
- package/src/components/Button/IconButton/IconButton.module.css +1 -1
- package/src/components/InlineSpinner/InlineSpinner.tsx +3 -2
- package/src/components/Menu/CheckboxMenuItem.tsx +4 -2
- package/src/components/Menu/MenuItem.module.css +1 -1
- package/src/components/Menu/ToggleMenuItem.tsx +3 -1
- package/src/components/ReleaseAnnouncement/ReleaseAnnouncement.tsx +4 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const button = "
|
|
4
|
-
const destructive = "
|
|
3
|
+
const button = "_button_13vu4_8";
|
|
4
|
+
const destructive = "_destructive_13vu4_110";
|
|
5
5
|
const styles = {
|
|
6
6
|
button,
|
|
7
|
-
"icon-only": "_icon-
|
|
8
|
-
"has-icon": "_has-
|
|
7
|
+
"icon-only": "_icon-only_13vu4_53",
|
|
8
|
+
"has-icon": "_has-icon_13vu4_60",
|
|
9
9
|
destructive
|
|
10
10
|
};
|
|
11
11
|
exports.button = button;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const button = "
|
|
2
|
-
const destructive = "
|
|
1
|
+
const button = "_button_13vu4_8";
|
|
2
|
+
const destructive = "_destructive_13vu4_110";
|
|
3
3
|
const styles = {
|
|
4
4
|
button,
|
|
5
|
-
"icon-only": "_icon-
|
|
6
|
-
"has-icon": "_has-
|
|
5
|
+
"icon-only": "_icon-only_13vu4_53",
|
|
6
|
+
"has-icon": "_has-icon_13vu4_60",
|
|
7
7
|
destructive
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const destructive = "
|
|
3
|
+
const destructive = "_destructive_1215g_95";
|
|
4
4
|
const styles = {
|
|
5
|
-
"icon-button": "_icon-
|
|
6
|
-
"no-background": "_no-
|
|
5
|
+
"icon-button": "_icon-button_1215g_8",
|
|
6
|
+
"no-background": "_no-background_1215g_42",
|
|
7
7
|
destructive
|
|
8
8
|
};
|
|
9
9
|
exports.default = styles;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const destructive = "
|
|
1
|
+
const destructive = "_destructive_1215g_95";
|
|
2
2
|
const styles = {
|
|
3
|
-
"icon-button": "_icon-
|
|
4
|
-
"no-background": "_no-
|
|
3
|
+
"icon-button": "_icon-button_1215g_8",
|
|
4
|
+
"no-background": "_no-background_1215g_42",
|
|
5
5
|
destructive
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
|
+
const classNames = require("classnames");
|
|
5
6
|
const InlineSpinner_module = require("./InlineSpinner.module.css.cjs");
|
|
6
7
|
const SpinnerIcon = require("@vector-im/compound-design-tokens/assets/web/icons/spinner");
|
|
7
8
|
const InlineSpinner = React.forwardRef(
|
|
8
|
-
function InlineSpinner2({ size = 20, ...props }, ref) {
|
|
9
|
+
function InlineSpinner2({ size = 20, className, ...props }, ref) {
|
|
9
10
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
11
|
SpinnerIcon,
|
|
11
12
|
{
|
|
12
13
|
ref,
|
|
13
|
-
className: InlineSpinner_module.default.icon,
|
|
14
|
+
className: classNames(InlineSpinner_module.default.icon, className),
|
|
14
15
|
style: { width: size, height: size },
|
|
15
16
|
...props
|
|
16
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineSpinner.cjs","sources":["../../../src/components/InlineSpinner/InlineSpinner.tsx"],"sourcesContent":["/*\nCopyright 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { type SVGAttributes, forwardRef } from \"react\";\nimport styles from \"./InlineSpinner.module.css\";\nimport SpinnerIcon from \"@vector-im/compound-design-tokens/assets/web/icons/spinner\";\n\ntype InlineSpinnerProps = {\n size?: number;\n} & SVGAttributes<SVGElement>;\n\nexport const InlineSpinner = forwardRef<SVGSVGElement, InlineSpinnerProps>(\n function InlineSpinner({ size = 20, ...props }, ref) {\n return (\n <SpinnerIcon\n ref={ref}\n className={styles.icon}\n style={{ width: size, height: size }}\n {...props}\n />\n );\n },\n);\n"],"names":["forwardRef","InlineSpinner","jsx","styles"],"mappings":"
|
|
1
|
+
{"version":3,"file":"InlineSpinner.cjs","sources":["../../../src/components/InlineSpinner/InlineSpinner.tsx"],"sourcesContent":["/*\nCopyright 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { type SVGAttributes, forwardRef } from \"react\";\nimport classNames from \"classnames\";\nimport styles from \"./InlineSpinner.module.css\";\nimport SpinnerIcon from \"@vector-im/compound-design-tokens/assets/web/icons/spinner\";\n\ntype InlineSpinnerProps = {\n size?: number;\n} & SVGAttributes<SVGElement>;\n\nexport const InlineSpinner = forwardRef<SVGSVGElement, InlineSpinnerProps>(\n function InlineSpinner({ size = 20, className, ...props }, ref) {\n return (\n <SpinnerIcon\n ref={ref}\n className={classNames(styles.icon, className)}\n style={{ width: size, height: size }}\n {...props}\n />\n );\n },\n);\n"],"names":["forwardRef","InlineSpinner","jsx","styles"],"mappings":";;;;;;;AAgBO,MAAM,gBAAgBA,MAAAA;AAAAA,EAC3B,SAASC,eAAc,EAAE,OAAO,IAAI,WAAW,GAAG,MAAA,GAAS,KAAK;AAC9D,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW,WAAWC,6BAAO,MAAM,SAAS;AAAA,QAC5C,OAAO,EAAE,OAAO,MAAM,QAAQ,KAAA;AAAA,QAC7B,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineSpinner.d.ts","sourceRoot":"","sources":["../../../src/components/InlineSpinner/InlineSpinner.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAyC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"InlineSpinner.d.ts","sourceRoot":"","sources":["../../../src/components/InlineSpinner/InlineSpinner.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAS9D,eAAO,MAAM,aAAa;WAHjB,MAAM;yEAcd,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
+
import classNames from "classnames";
|
|
3
4
|
import styles from "./InlineSpinner.module.css.js";
|
|
4
5
|
import SpinnerIcon from "@vector-im/compound-design-tokens/assets/web/icons/spinner";
|
|
5
6
|
const InlineSpinner = forwardRef(
|
|
6
|
-
function InlineSpinner2({ size = 20, ...props }, ref) {
|
|
7
|
+
function InlineSpinner2({ size = 20, className, ...props }, ref) {
|
|
7
8
|
return /* @__PURE__ */ jsx(
|
|
8
9
|
SpinnerIcon,
|
|
9
10
|
{
|
|
10
11
|
ref,
|
|
11
|
-
className: styles.icon,
|
|
12
|
+
className: classNames(styles.icon, className),
|
|
12
13
|
style: { width: size, height: size },
|
|
13
14
|
...props
|
|
14
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineSpinner.js","sources":["../../../src/components/InlineSpinner/InlineSpinner.tsx"],"sourcesContent":["/*\nCopyright 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { type SVGAttributes, forwardRef } from \"react\";\nimport styles from \"./InlineSpinner.module.css\";\nimport SpinnerIcon from \"@vector-im/compound-design-tokens/assets/web/icons/spinner\";\n\ntype InlineSpinnerProps = {\n size?: number;\n} & SVGAttributes<SVGElement>;\n\nexport const InlineSpinner = forwardRef<SVGSVGElement, InlineSpinnerProps>(\n function InlineSpinner({ size = 20, ...props }, ref) {\n return (\n <SpinnerIcon\n ref={ref}\n className={styles.icon}\n style={{ width: size, height: size }}\n {...props}\n />\n );\n },\n);\n"],"names":["InlineSpinner"],"mappings":"
|
|
1
|
+
{"version":3,"file":"InlineSpinner.js","sources":["../../../src/components/InlineSpinner/InlineSpinner.tsx"],"sourcesContent":["/*\nCopyright 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { type SVGAttributes, forwardRef } from \"react\";\nimport classNames from \"classnames\";\nimport styles from \"./InlineSpinner.module.css\";\nimport SpinnerIcon from \"@vector-im/compound-design-tokens/assets/web/icons/spinner\";\n\ntype InlineSpinnerProps = {\n size?: number;\n} & SVGAttributes<SVGElement>;\n\nexport const InlineSpinner = forwardRef<SVGSVGElement, InlineSpinnerProps>(\n function InlineSpinner({ size = 20, className, ...props }, ref) {\n return (\n <SpinnerIcon\n ref={ref}\n className={classNames(styles.icon, className)}\n style={{ width: size, height: size }}\n {...props}\n />\n );\n },\n);\n"],"names":["InlineSpinner"],"mappings":";;;;;AAgBO,MAAM,gBAAgB;AAAA,EAC3B,SAASA,eAAc,EAAE,OAAO,IAAI,WAAW,GAAG,MAAA,GAAS,KAAK;AAC9D,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW,WAAW,OAAO,MAAM,SAAS;AAAA,QAC5C,OAAO,EAAE,OAAO,MAAM,QAAQ,KAAA;AAAA,QAC7B,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;"}
|
|
@@ -12,11 +12,12 @@ const CheckboxMenuItem = React.forwardRef(
|
|
|
12
12
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13
13
|
MenuItem.MenuItem,
|
|
14
14
|
{
|
|
15
|
-
as: "
|
|
15
|
+
as: "button",
|
|
16
16
|
role: "menuitemcheckbox",
|
|
17
17
|
"aria-checked": checked,
|
|
18
18
|
className,
|
|
19
19
|
label,
|
|
20
|
+
hideChevron: true,
|
|
20
21
|
onSelect,
|
|
21
22
|
disabled,
|
|
22
23
|
Icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -25,6 +26,7 @@ const CheckboxMenuItem = React.forwardRef(
|
|
|
25
26
|
id: toggleId,
|
|
26
27
|
ref,
|
|
27
28
|
"aria-hidden": true,
|
|
29
|
+
tabIndex: -1,
|
|
28
30
|
checked,
|
|
29
31
|
disabled,
|
|
30
32
|
onChange
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxMenuItem.cjs","sources":["../../../src/components/Menu/CheckboxMenuItem.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, {\n type ComponentProps,\n forwardRef,\n useCallback,\n useId,\n} from \"react\";\nimport { MenuItem } from \"./MenuItem\";\nimport { CheckboxInput } from \"../Form\";\n\ntype Props = Pick<\n ComponentProps<typeof MenuItem>,\n \"className\" | \"label\" | \"onSelect\" | \"disabled\"\n> & {\n /**\n * Whether the checkbox is checked.\n */\n checked: boolean;\n};\n\n/**\n * A menu item with a checkbox control.\n * Must be used within a compound Menu or other `menu` or `menubar` aria role subtree.\n */\nexport const CheckboxMenuItem = forwardRef<HTMLInputElement, Props>(\n function CheckboxMenuItem(\n { className, label, onSelect, checked, disabled },\n ref,\n ) {\n const toggleId = useId();\n // The checkbox is controlled and we intend to ignore its events. We do need\n // to at least set onChange though to make React happy.\n const onChange = useCallback(() => {}, []);\n\n // <label> elements are not allowed to have a role like menuitemcheckbox, so\n // we must instead use a
|
|
1
|
+
{"version":3,"file":"CheckboxMenuItem.cjs","sources":["../../../src/components/Menu/CheckboxMenuItem.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, {\n type ComponentProps,\n forwardRef,\n useCallback,\n useId,\n} from \"react\";\nimport { MenuItem } from \"./MenuItem\";\nimport { CheckboxInput } from \"../Form\";\n\ntype Props = Pick<\n ComponentProps<typeof MenuItem>,\n \"className\" | \"label\" | \"onSelect\" | \"disabled\"\n> & {\n /**\n * Whether the checkbox is checked.\n */\n checked: boolean;\n};\n\n/**\n * A menu item with a checkbox control.\n * Must be used within a compound Menu or other `menu` or `menubar` aria role subtree.\n */\nexport const CheckboxMenuItem = forwardRef<HTMLInputElement, Props>(\n function CheckboxMenuItem(\n { className, label, onSelect, checked, disabled },\n ref,\n ) {\n const toggleId = useId();\n // The checkbox is controlled and we intend to ignore its events. We do need\n // to at least set onChange though to make React happy.\n const onChange = useCallback(() => {}, []);\n\n // <label> elements are not allowed to have a role like menuitemcheckbox, so\n // we must instead use a <button> for the menu item and use aria-checked\n // etc. to communicate its state.\n return (\n <MenuItem\n as=\"button\"\n role=\"menuitemcheckbox\"\n aria-checked={checked}\n className={className}\n label={label}\n hideChevron\n onSelect={onSelect}\n disabled={disabled}\n Icon={\n <CheckboxInput\n id={toggleId}\n ref={ref}\n // This is purely cosmetic; really the whole MenuItem is the toggle.\n aria-hidden\n tabIndex={-1}\n checked={checked}\n disabled={disabled}\n onChange={onChange}\n />\n }\n />\n );\n },\n);\n"],"names":["forwardRef","CheckboxMenuItem","useId","useCallback","jsx","MenuItem","CheckboxInput"],"mappings":";;;;;;AA8BO,MAAM,mBAAmBA,MAAAA;AAAAA,EAC9B,SAASC,kBACP,EAAE,WAAW,OAAO,UAAU,SAAS,SAAA,GACvC,KACA;AACA,UAAM,WAAWC,MAAAA,MAAA;AAGjB,UAAM,WAAWC,MAAAA,YAAY,MAAM;AAAA,IAAC,GAAG,CAAA,CAAE;AAKzC,WACEC,2BAAAA;AAAAA,MAACC,SAAAA;AAAAA,MAAA;AAAA,QACC,IAAG;AAAA,QACH,MAAK;AAAA,QACL,gBAAc;AAAA,QACd;AAAA,QACA;AAAA,QACA,aAAW;AAAA,QACX;AAAA,QACA;AAAA,QACA,MACED,2BAAAA;AAAAA,UAACE,SAAAA;AAAAA,UAAA;AAAA,YACC,IAAI;AAAA,YACJ;AAAA,YAEA,eAAW;AAAA,YACX,UAAU;AAAA,YACV;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAIR;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxMenuItem.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/CheckboxMenuItem.tsx"],"names":[],"mappings":"AAOA,OAAO,KAKN,MAAM,OAAO,CAAC;AAcf;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;IAV3B;;OAEG;aACM,OAAO;
|
|
1
|
+
{"version":3,"file":"CheckboxMenuItem.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/CheckboxMenuItem.tsx"],"names":[],"mappings":"AAOA,OAAO,KAKN,MAAM,OAAO,CAAC;AAcf;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;IAV3B;;OAEG;aACM,OAAO;0CA6CjB,CAAC"}
|
|
@@ -10,11 +10,12 @@ const CheckboxMenuItem = forwardRef(
|
|
|
10
10
|
return /* @__PURE__ */ jsx(
|
|
11
11
|
MenuItem,
|
|
12
12
|
{
|
|
13
|
-
as: "
|
|
13
|
+
as: "button",
|
|
14
14
|
role: "menuitemcheckbox",
|
|
15
15
|
"aria-checked": checked,
|
|
16
16
|
className,
|
|
17
17
|
label,
|
|
18
|
+
hideChevron: true,
|
|
18
19
|
onSelect,
|
|
19
20
|
disabled,
|
|
20
21
|
Icon: /* @__PURE__ */ jsx(
|
|
@@ -23,6 +24,7 @@ const CheckboxMenuItem = forwardRef(
|
|
|
23
24
|
id: toggleId,
|
|
24
25
|
ref,
|
|
25
26
|
"aria-hidden": true,
|
|
27
|
+
tabIndex: -1,
|
|
26
28
|
checked,
|
|
27
29
|
disabled,
|
|
28
30
|
onChange
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxMenuItem.js","sources":["../../../src/components/Menu/CheckboxMenuItem.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, {\n type ComponentProps,\n forwardRef,\n useCallback,\n useId,\n} from \"react\";\nimport { MenuItem } from \"./MenuItem\";\nimport { CheckboxInput } from \"../Form\";\n\ntype Props = Pick<\n ComponentProps<typeof MenuItem>,\n \"className\" | \"label\" | \"onSelect\" | \"disabled\"\n> & {\n /**\n * Whether the checkbox is checked.\n */\n checked: boolean;\n};\n\n/**\n * A menu item with a checkbox control.\n * Must be used within a compound Menu or other `menu` or `menubar` aria role subtree.\n */\nexport const CheckboxMenuItem = forwardRef<HTMLInputElement, Props>(\n function CheckboxMenuItem(\n { className, label, onSelect, checked, disabled },\n ref,\n ) {\n const toggleId = useId();\n // The checkbox is controlled and we intend to ignore its events. We do need\n // to at least set onChange though to make React happy.\n const onChange = useCallback(() => {}, []);\n\n // <label> elements are not allowed to have a role like menuitemcheckbox, so\n // we must instead use a
|
|
1
|
+
{"version":3,"file":"CheckboxMenuItem.js","sources":["../../../src/components/Menu/CheckboxMenuItem.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, {\n type ComponentProps,\n forwardRef,\n useCallback,\n useId,\n} from \"react\";\nimport { MenuItem } from \"./MenuItem\";\nimport { CheckboxInput } from \"../Form\";\n\ntype Props = Pick<\n ComponentProps<typeof MenuItem>,\n \"className\" | \"label\" | \"onSelect\" | \"disabled\"\n> & {\n /**\n * Whether the checkbox is checked.\n */\n checked: boolean;\n};\n\n/**\n * A menu item with a checkbox control.\n * Must be used within a compound Menu or other `menu` or `menubar` aria role subtree.\n */\nexport const CheckboxMenuItem = forwardRef<HTMLInputElement, Props>(\n function CheckboxMenuItem(\n { className, label, onSelect, checked, disabled },\n ref,\n ) {\n const toggleId = useId();\n // The checkbox is controlled and we intend to ignore its events. We do need\n // to at least set onChange though to make React happy.\n const onChange = useCallback(() => {}, []);\n\n // <label> elements are not allowed to have a role like menuitemcheckbox, so\n // we must instead use a <button> for the menu item and use aria-checked\n // etc. to communicate its state.\n return (\n <MenuItem\n as=\"button\"\n role=\"menuitemcheckbox\"\n aria-checked={checked}\n className={className}\n label={label}\n hideChevron\n onSelect={onSelect}\n disabled={disabled}\n Icon={\n <CheckboxInput\n id={toggleId}\n ref={ref}\n // This is purely cosmetic; really the whole MenuItem is the toggle.\n aria-hidden\n tabIndex={-1}\n checked={checked}\n disabled={disabled}\n onChange={onChange}\n />\n }\n />\n );\n },\n);\n"],"names":["CheckboxMenuItem"],"mappings":";;;;AA8BO,MAAM,mBAAmB;AAAA,EAC9B,SAASA,kBACP,EAAE,WAAW,OAAO,UAAU,SAAS,SAAA,GACvC,KACA;AACA,UAAM,WAAW,MAAA;AAGjB,UAAM,WAAW,YAAY,MAAM;AAAA,IAAC,GAAG,CAAA,CAAE;AAKzC,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAG;AAAA,QACH,MAAK;AAAA,QACL,gBAAc;AAAA,QACd;AAAA,QACA;AAAA,QACA,aAAW;AAAA,QACX;AAAA,QACA;AAAA,QACA,MACE;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAI;AAAA,YACJ;AAAA,YAEA,eAAW;AAAA,YACX,UAAU;AAAA,YACV;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAIR;AACF;"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const item = "
|
|
4
|
-
const interactive = "
|
|
5
|
-
const label = "
|
|
6
|
-
const icon = "
|
|
7
|
-
const disabled = "
|
|
3
|
+
const item = "_item_lqfwq_8";
|
|
4
|
+
const interactive = "_interactive_lqfwq_26";
|
|
5
|
+
const label = "_label_lqfwq_34";
|
|
6
|
+
const icon = "_icon_lqfwq_50";
|
|
7
|
+
const disabled = "_disabled_lqfwq_118";
|
|
8
8
|
const styles = {
|
|
9
9
|
item,
|
|
10
10
|
interactive,
|
|
11
|
-
"no-label": "_no-
|
|
11
|
+
"no-label": "_no-label_lqfwq_30",
|
|
12
12
|
label,
|
|
13
|
-
"no-icon": "_no-
|
|
13
|
+
"no-icon": "_no-icon_lqfwq_41",
|
|
14
14
|
icon,
|
|
15
|
-
"nav-hint": "_nav-
|
|
15
|
+
"nav-hint": "_nav-hint_lqfwq_59",
|
|
16
16
|
disabled
|
|
17
17
|
};
|
|
18
18
|
exports.default = styles;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
const item = "
|
|
2
|
-
const interactive = "
|
|
3
|
-
const label = "
|
|
4
|
-
const icon = "
|
|
5
|
-
const disabled = "
|
|
1
|
+
const item = "_item_lqfwq_8";
|
|
2
|
+
const interactive = "_interactive_lqfwq_26";
|
|
3
|
+
const label = "_label_lqfwq_34";
|
|
4
|
+
const icon = "_icon_lqfwq_50";
|
|
5
|
+
const disabled = "_disabled_lqfwq_118";
|
|
6
6
|
const styles = {
|
|
7
7
|
item,
|
|
8
8
|
interactive,
|
|
9
|
-
"no-label": "_no-
|
|
9
|
+
"no-label": "_no-label_lqfwq_30",
|
|
10
10
|
label,
|
|
11
|
-
"no-icon": "_no-
|
|
11
|
+
"no-icon": "_no-icon_lqfwq_41",
|
|
12
12
|
icon,
|
|
13
|
-
"nav-hint": "_nav-
|
|
13
|
+
"nav-hint": "_nav-hint_lqfwq_59",
|
|
14
14
|
disabled
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
@@ -12,12 +12,13 @@ const ToggleMenuItem = React.forwardRef(
|
|
|
12
12
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13
13
|
MenuItem.MenuItem,
|
|
14
14
|
{
|
|
15
|
-
as: "
|
|
15
|
+
as: "button",
|
|
16
16
|
role: "menuitemcheckbox",
|
|
17
17
|
"aria-checked": checked,
|
|
18
18
|
className,
|
|
19
19
|
Icon,
|
|
20
20
|
label,
|
|
21
|
+
hideChevron: true,
|
|
21
22
|
onSelect,
|
|
22
23
|
disabled,
|
|
23
24
|
onClick,
|
|
@@ -27,6 +28,7 @@ const ToggleMenuItem = React.forwardRef(
|
|
|
27
28
|
id: toggleId,
|
|
28
29
|
ref,
|
|
29
30
|
"aria-hidden": true,
|
|
31
|
+
tabIndex: -1,
|
|
30
32
|
checked,
|
|
31
33
|
disabled,
|
|
32
34
|
onChange
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleMenuItem.cjs","sources":["../../../src/components/Menu/ToggleMenuItem.tsx"],"sourcesContent":["/*\nCopyright 2023, 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, {\n type ComponentProps,\n forwardRef,\n useCallback,\n useId,\n} from \"react\";\nimport { MenuItem } from \"./MenuItem\";\nimport { ToggleInput } from \"../Form/Controls/Toggle\";\n\ntype Props = Pick<\n ComponentProps<typeof MenuItem>,\n \"className\" | \"Icon\" | \"label\" | \"onSelect\" | \"disabled\" | \"onClick\"\n> & {\n /**\n * Whether the toggle is checked.\n */\n checked: boolean;\n};\n\n/**\n * A menu item with a toggle control.\n * Must be used within a compound Menu or other `menu` or `menubar` aria role subtree.\n */\nexport const ToggleMenuItem = forwardRef<HTMLInputElement, Props>(\n function ToggleMenuItem(\n { className, Icon, label, onSelect, checked, disabled, onClick },\n ref,\n ) {\n const toggleId = useId();\n // The toggle is controlled and we intend to ignore its events. We do need\n // to at least set onChange though to make React happy.\n const onChange = useCallback(() => {}, []);\n\n // <label> elements are not allowed to have a role like menuitemcheckbox, so\n // we must instead use a plain <div> for the menu item and use aria-checked\n // etc. to communicate its state.\n return (\n <MenuItem\n as=\"
|
|
1
|
+
{"version":3,"file":"ToggleMenuItem.cjs","sources":["../../../src/components/Menu/ToggleMenuItem.tsx"],"sourcesContent":["/*\nCopyright 2023, 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, {\n type ComponentProps,\n forwardRef,\n useCallback,\n useId,\n} from \"react\";\nimport { MenuItem } from \"./MenuItem\";\nimport { ToggleInput } from \"../Form/Controls/Toggle\";\n\ntype Props = Pick<\n ComponentProps<typeof MenuItem>,\n \"className\" | \"Icon\" | \"label\" | \"onSelect\" | \"disabled\" | \"onClick\"\n> & {\n /**\n * Whether the toggle is checked.\n */\n checked: boolean;\n};\n\n/**\n * A menu item with a toggle control.\n * Must be used within a compound Menu or other `menu` or `menubar` aria role subtree.\n */\nexport const ToggleMenuItem = forwardRef<HTMLInputElement, Props>(\n function ToggleMenuItem(\n { className, Icon, label, onSelect, checked, disabled, onClick },\n ref,\n ) {\n const toggleId = useId();\n // The toggle is controlled and we intend to ignore its events. We do need\n // to at least set onChange though to make React happy.\n const onChange = useCallback(() => {}, []);\n\n // <label> elements are not allowed to have a role like menuitemcheckbox, so\n // we must instead use a plain <div> for the menu item and use aria-checked\n // etc. to communicate its state.\n return (\n <MenuItem\n as=\"button\"\n role=\"menuitemcheckbox\"\n aria-checked={checked}\n className={className}\n Icon={Icon}\n label={label}\n hideChevron\n onSelect={onSelect}\n disabled={disabled}\n onClick={onClick}\n >\n <ToggleInput\n id={toggleId}\n ref={ref}\n // This is purely cosmetic; really the whole MenuItem is the toggle.\n aria-hidden\n tabIndex={-1}\n checked={checked}\n disabled={disabled}\n onChange={onChange}\n />\n </MenuItem>\n );\n },\n);\n"],"names":["forwardRef","ToggleMenuItem","useId","useCallback","jsx","MenuItem","ToggleInput"],"mappings":";;;;;;AA8BO,MAAM,iBAAiBA,MAAAA;AAAAA,EAC5B,SAASC,gBACP,EAAE,WAAW,MAAM,OAAO,UAAU,SAAS,UAAU,QAAA,GACvD,KACA;AACA,UAAM,WAAWC,MAAAA,MAAA;AAGjB,UAAM,WAAWC,MAAAA,YAAY,MAAM;AAAA,IAAC,GAAG,CAAA,CAAE;AAKzC,WACEC,2BAAAA;AAAAA,MAACC,SAAAA;AAAAA,MAAA;AAAA,QACC,IAAG;AAAA,QACH,MAAK;AAAA,QACL,gBAAc;AAAA,QACd;AAAA,QACA;AAAA,QACA;AAAA,QACA,aAAW;AAAA,QACX;AAAA,QACA;AAAA,QACA;AAAA,QAEA,UAAAD,2BAAAA;AAAAA,UAACE,OAAAA;AAAAA,UAAA;AAAA,YACC,IAAI;AAAA,YACJ;AAAA,YAEA,eAAW;AAAA,YACX,UAAU;AAAA,YACV;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleMenuItem.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/ToggleMenuItem.tsx"],"names":[],"mappings":"AAOA,OAAO,KAKN,MAAM,OAAO,CAAC;AAcf;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;IAVzB;;OAEG;aACM,OAAO;
|
|
1
|
+
{"version":3,"file":"ToggleMenuItem.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/ToggleMenuItem.tsx"],"names":[],"mappings":"AAOA,OAAO,KAKN,MAAM,OAAO,CAAC;AAcf;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;IAVzB;;OAEG;aACM,OAAO;0CA8CjB,CAAC"}
|
|
@@ -10,12 +10,13 @@ const ToggleMenuItem = forwardRef(
|
|
|
10
10
|
return /* @__PURE__ */ jsx(
|
|
11
11
|
MenuItem,
|
|
12
12
|
{
|
|
13
|
-
as: "
|
|
13
|
+
as: "button",
|
|
14
14
|
role: "menuitemcheckbox",
|
|
15
15
|
"aria-checked": checked,
|
|
16
16
|
className,
|
|
17
17
|
Icon,
|
|
18
18
|
label,
|
|
19
|
+
hideChevron: true,
|
|
19
20
|
onSelect,
|
|
20
21
|
disabled,
|
|
21
22
|
onClick,
|
|
@@ -25,6 +26,7 @@ const ToggleMenuItem = forwardRef(
|
|
|
25
26
|
id: toggleId,
|
|
26
27
|
ref,
|
|
27
28
|
"aria-hidden": true,
|
|
29
|
+
tabIndex: -1,
|
|
28
30
|
checked,
|
|
29
31
|
disabled,
|
|
30
32
|
onChange
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleMenuItem.js","sources":["../../../src/components/Menu/ToggleMenuItem.tsx"],"sourcesContent":["/*\nCopyright 2023, 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, {\n type ComponentProps,\n forwardRef,\n useCallback,\n useId,\n} from \"react\";\nimport { MenuItem } from \"./MenuItem\";\nimport { ToggleInput } from \"../Form/Controls/Toggle\";\n\ntype Props = Pick<\n ComponentProps<typeof MenuItem>,\n \"className\" | \"Icon\" | \"label\" | \"onSelect\" | \"disabled\" | \"onClick\"\n> & {\n /**\n * Whether the toggle is checked.\n */\n checked: boolean;\n};\n\n/**\n * A menu item with a toggle control.\n * Must be used within a compound Menu or other `menu` or `menubar` aria role subtree.\n */\nexport const ToggleMenuItem = forwardRef<HTMLInputElement, Props>(\n function ToggleMenuItem(\n { className, Icon, label, onSelect, checked, disabled, onClick },\n ref,\n ) {\n const toggleId = useId();\n // The toggle is controlled and we intend to ignore its events. We do need\n // to at least set onChange though to make React happy.\n const onChange = useCallback(() => {}, []);\n\n // <label> elements are not allowed to have a role like menuitemcheckbox, so\n // we must instead use a plain <div> for the menu item and use aria-checked\n // etc. to communicate its state.\n return (\n <MenuItem\n as=\"
|
|
1
|
+
{"version":3,"file":"ToggleMenuItem.js","sources":["../../../src/components/Menu/ToggleMenuItem.tsx"],"sourcesContent":["/*\nCopyright 2023, 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, {\n type ComponentProps,\n forwardRef,\n useCallback,\n useId,\n} from \"react\";\nimport { MenuItem } from \"./MenuItem\";\nimport { ToggleInput } from \"../Form/Controls/Toggle\";\n\ntype Props = Pick<\n ComponentProps<typeof MenuItem>,\n \"className\" | \"Icon\" | \"label\" | \"onSelect\" | \"disabled\" | \"onClick\"\n> & {\n /**\n * Whether the toggle is checked.\n */\n checked: boolean;\n};\n\n/**\n * A menu item with a toggle control.\n * Must be used within a compound Menu or other `menu` or `menubar` aria role subtree.\n */\nexport const ToggleMenuItem = forwardRef<HTMLInputElement, Props>(\n function ToggleMenuItem(\n { className, Icon, label, onSelect, checked, disabled, onClick },\n ref,\n ) {\n const toggleId = useId();\n // The toggle is controlled and we intend to ignore its events. We do need\n // to at least set onChange though to make React happy.\n const onChange = useCallback(() => {}, []);\n\n // <label> elements are not allowed to have a role like menuitemcheckbox, so\n // we must instead use a plain <div> for the menu item and use aria-checked\n // etc. to communicate its state.\n return (\n <MenuItem\n as=\"button\"\n role=\"menuitemcheckbox\"\n aria-checked={checked}\n className={className}\n Icon={Icon}\n label={label}\n hideChevron\n onSelect={onSelect}\n disabled={disabled}\n onClick={onClick}\n >\n <ToggleInput\n id={toggleId}\n ref={ref}\n // This is purely cosmetic; really the whole MenuItem is the toggle.\n aria-hidden\n tabIndex={-1}\n checked={checked}\n disabled={disabled}\n onChange={onChange}\n />\n </MenuItem>\n );\n },\n);\n"],"names":["ToggleMenuItem"],"mappings":";;;;AA8BO,MAAM,iBAAiB;AAAA,EAC5B,SAASA,gBACP,EAAE,WAAW,MAAM,OAAO,UAAU,SAAS,UAAU,QAAA,GACvD,KACA;AACA,UAAM,WAAW,MAAA;AAGjB,UAAM,WAAW,YAAY,MAAM;AAAA,IAAC,GAAG,CAAA,CAAE;AAKzC,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAG;AAAA,QACH,MAAK;AAAA,QACL,gBAAc;AAAA,QACd;AAAA,QACA;AAAA,QACA;AAAA,QACA,aAAW;AAAA,QACX;AAAA,QACA;AAAA,QACA;AAAA,QAEA,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAI;AAAA,YACJ;AAAA,YAEA,eAAW;AAAA,YACX,UAAU;AAAA,YACV;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAGN;AACF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReleaseAnnouncement.cjs","sources":["../../../src/components/ReleaseAnnouncement/ReleaseAnnouncement.tsx"],"sourcesContent":["/*\nCopyright 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, {\n cloneElement,\n isValidElement,\n type JSX,\n type PropsWithChildren,\n type Ref,\n} from \"react\";\nimport {\n FloatingPortal,\n FloatingFocusManager,\n type Placement,\n useMergeRefs,\n FloatingArrow,\n} from \"@floating-ui/react\";\nimport { Text } from \"../Typography/Text\";\nimport { Button } from \"../Button\";\nimport styles from \"./ReleaseAnnouncement.module.css\";\nimport {\n useReleaseAnnouncementContext,\n ReleaseAnnouncementContext,\n} from \"./ReleaseAnnouncementContext\";\nimport { useReleaseAnnouncement } from \"./useReleaseAnnouncement\";\n\ntype UseReleaseAnnouncementParam = Parameters<typeof useReleaseAnnouncement>[0];\n\ninterface ReleaseAnnouncementProps
|
|
1
|
+
{"version":3,"file":"ReleaseAnnouncement.cjs","sources":["../../../src/components/ReleaseAnnouncement/ReleaseAnnouncement.tsx"],"sourcesContent":["/*\nCopyright 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, {\n cloneElement,\n isValidElement,\n type JSX,\n type PropsWithChildren,\n type Ref,\n} from \"react\";\nimport {\n FloatingPortal,\n FloatingFocusManager,\n type Placement,\n useMergeRefs,\n FloatingArrow,\n} from \"@floating-ui/react\";\nimport { Text } from \"../Typography/Text\";\nimport { Button } from \"../Button\";\nimport styles from \"./ReleaseAnnouncement.module.css\";\nimport {\n useReleaseAnnouncementContext,\n ReleaseAnnouncementContext,\n} from \"./ReleaseAnnouncementContext\";\nimport { useReleaseAnnouncement } from \"./useReleaseAnnouncement\";\n\ntype UseReleaseAnnouncementParam = Parameters<typeof useReleaseAnnouncement>[0];\n\ninterface ReleaseAnnouncementProps extends Omit<\n UseReleaseAnnouncementParam,\n \"placement\" | \"displayArrow\"\n> {\n /**\n * The placement of the component\n * @default \"right\"\n */\n placement?: Placement;\n /**\n * Whether to display an arrow.\n * @default true\n */\n displayArrow?: boolean;\n}\n\n/**\n * The ReleaseAnnouncement component purpose is to inform the user of a new available feature.\n * This component is a floating component that will appear next to an anchor.\n * @param children - Act as an anchor, the component will be displayed alongside of it.\n * @param placement - The placement of the component\n */\nexport function ReleaseAnnouncement({\n /**\n * The children anchor should be a single valid React element.\n */\n children,\n placement = \"right\",\n displayArrow = true,\n ...props\n}: PropsWithChildren<ReleaseAnnouncementProps>): JSX.Element {\n const context = useReleaseAnnouncement({ placement, displayArrow, ...props });\n\n return (\n <ReleaseAnnouncementContext.Provider value={context}>\n <ReleaseAnnouncementAnchor>{children}</ReleaseAnnouncementAnchor>\n <ReleaseAnnouncementContainer>\n <ReleaseAnnouncementContent />\n </ReleaseAnnouncementContainer>\n </ReleaseAnnouncementContext.Provider>\n );\n}\n\n/**\n * The anchor for the ReleaseAnnouncement components.\n * The Release Announcement will appear next to this element.\n * @param children - should be a single valid React element\n * @constructor\n */\nfunction ReleaseAnnouncementAnchor({\n children,\n}: Readonly<PropsWithChildren>): JSX.Element {\n const context = useReleaseAnnouncementContext();\n\n // The children can have a ref and we don't want to discard it\n // Doing a dirty cast to get the optional ref\n const childrenRef = (children as unknown as { ref?: Ref<HTMLElement> })?.ref;\n const ref = useMergeRefs([context.refs.setReference, childrenRef]);\n\n if (!isValidElement(children)) {\n throw new Error(\n \"ReleaseAnnouncement anchor must be a single valid React element\",\n );\n }\n\n const referenceProps = context.getReferenceProps({\n ref,\n // If the ReleaseAnnouncement is open, we need manually aria-describedby.\n // The RA has the dialog role and it's not adding automatically the aria-describedby.\n ...(context.open && {\n \"aria-describedby\": context.getFloatingProps().id as string,\n }),\n });\n\n // getReferenceProps includes aria-expanded (being true when the popup is shown)\n // but axe only allows this on certain elements and we use release anncounements on\n // all sorts of elements. Semantically, I don't think it makes sense because the point\n // of aria-expanded is a hint to the user that there is something that can be expanded.\n // The user can't cause a release announcement to be shown, it just appears when it thinks\n // it's time, so I think adding it here is misleading.\n delete referenceProps[\"aria-expanded\"];\n\n return cloneElement(children, referenceProps);\n}\n\n/**\n * The container for the ReleaseAnnouncement components.\n * Manage focus and positioning of the children.\n * @param children\n */\nfunction ReleaseAnnouncementContainer({\n children,\n}: PropsWithChildren): JSX.Element | null {\n const {\n context: floatingContext,\n arrowRef,\n displayArrow,\n ...rest\n } = useReleaseAnnouncementContext();\n\n if (!floatingContext.open) return null;\n\n return (\n <FloatingPortal>\n <FloatingFocusManager context={floatingContext} modal={false}>\n <div\n ref={rest.refs.setFloating}\n style={rest.floatingStyles}\n aria-labelledby={rest.labelId}\n aria-describedby={rest.descriptionId}\n {...rest.getFloatingProps()}\n className={styles.content}\n >\n {displayArrow && (\n <FloatingArrow\n ref={arrowRef}\n context={floatingContext}\n // design absolute value\n width={20}\n height={12}\n className={styles.arrow}\n />\n )}\n {children}\n </div>\n </FloatingFocusManager>\n </FloatingPortal>\n );\n}\n\n/**\n * The content of the ReleaseAnnouncement component.\n * ---------------------------------------------------------------\n * - The header in a bold text ------------- -\n * - A description in a regular text | Close button | -\n * - Description can be on multiple lines ------------- -\n * ---------------------------------------------------------------\n */\nfunction ReleaseAnnouncementContent(): JSX.Element {\n const { labelId, descriptionId, header, description, closeLabel, onClick } =\n useReleaseAnnouncementContext();\n\n return (\n <>\n <Text\n as=\"h3\"\n id={labelId}\n className={styles.header}\n size=\"lg\"\n weight=\"semibold\"\n >\n {header}\n </Text>\n <Text\n as=\"span\"\n id={descriptionId}\n className={styles.description}\n size=\"sm\"\n weight=\"regular\"\n >\n {description}\n </Text>\n <Button\n size=\"sm\"\n kind=\"secondary\"\n className={styles.button}\n onClick={onClick}\n >\n {closeLabel}\n </Button>\n </>\n );\n}\n"],"names":["useReleaseAnnouncement","jsxs","ReleaseAnnouncementContext","jsx","useReleaseAnnouncementContext","useMergeRefs","isValidElement","cloneElement","FloatingPortal","FloatingFocusManager","styles","FloatingArrow","Fragment","Text","Button"],"mappings":";;;;;;;;;;AAsDO,SAAS,oBAAoB;AAAA;AAAA;AAAA;AAAA,EAIlC;AAAA,EACA,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,GAAG;AACL,GAA6D;AAC3D,QAAM,UAAUA,uBAAAA,uBAAuB,EAAE,WAAW,cAAc,GAAG,OAAO;AAE5E,SACEC,2BAAAA,KAACC,2BAAAA,2BAA2B,UAA3B,EAAoC,OAAO,SAC1C,UAAA;AAAA,IAAAC,+BAAC,6BAA2B,UAAS;AAAA,IACrCA,2BAAAA,IAAC,8BAAA,EACC,UAAAA,2BAAAA,IAAC,4BAAA,CAAA,CAA2B,EAAA,CAC9B;AAAA,EAAA,GACF;AAEJ;AAQA,SAAS,0BAA0B;AAAA,EACjC;AACF,GAA6C;AAC3C,QAAM,UAAUC,2BAAAA,8BAAA;AAIhB,QAAM,cAAe,UAAoD;AACzE,QAAM,MAAMC,MAAAA,aAAa,CAAC,QAAQ,KAAK,cAAc,WAAW,CAAC;AAEjE,MAAI,CAACC,MAAAA,eAAe,QAAQ,GAAG;AAC7B,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AAEA,QAAM,iBAAiB,QAAQ,kBAAkB;AAAA,IAC/C;AAAA;AAAA;AAAA,IAGA,GAAI,QAAQ,QAAQ;AAAA,MAClB,oBAAoB,QAAQ,mBAAmB;AAAA,IAAA;AAAA,EACjD,CACD;AAQD,SAAO,eAAe,eAAe;AAErC,SAAOC,MAAAA,aAAa,UAAU,cAAc;AAC9C;AAOA,SAAS,6BAA6B;AAAA,EACpC;AACF,GAA0C;AACxC,QAAM;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACDH,yDAAA;AAEJ,MAAI,CAAC,gBAAgB,KAAM,QAAO;AAElC,wCACGI,MAAAA,gBAAA,EACC,UAAAL,2BAAAA,IAACM,MAAAA,wBAAqB,SAAS,iBAAiB,OAAO,OACrD,UAAAR,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK,KAAK,KAAK;AAAA,MACf,OAAO,KAAK;AAAA,MACZ,mBAAiB,KAAK;AAAA,MACtB,oBAAkB,KAAK;AAAA,MACtB,GAAG,KAAK,iBAAA;AAAA,MACT,WAAWS,2BAAAA,QAAO;AAAA,MAEjB,UAAA;AAAA,QAAA,gBACCP,2BAAAA;AAAAA,UAACQ,MAAAA;AAAAA,UAAA;AAAA,YACC,KAAK;AAAA,YACL,SAAS;AAAA,YAET,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,WAAWD,2BAAAA,QAAO;AAAA,UAAA;AAAA,QAAA;AAAA,QAGrB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEL,EAAA,CACF;AAEJ;AAUA,SAAS,6BAA0C;AACjD,QAAM,EAAE,SAAS,eAAe,QAAQ,aAAa,YAAY,QAAA,IAC/DN,yDAAA;AAEF,SACEH,2BAAAA,KAAAW,qBAAA,EACE,UAAA;AAAA,IAAAT,2BAAAA;AAAAA,MAACU,KAAAA;AAAAA,MAAA;AAAA,QACC,IAAG;AAAA,QACH,IAAI;AAAA,QACJ,WAAWH,2BAAAA,QAAO;AAAA,QAClB,MAAK;AAAA,QACL,QAAO;AAAA,QAEN,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAEHP,2BAAAA;AAAAA,MAACU,KAAAA;AAAAA,MAAA;AAAA,QACC,IAAG;AAAA,QACH,IAAI;AAAA,QACJ,WAAWH,2BAAAA,QAAO;AAAA,QAClB,MAAK;AAAA,QACL,QAAO;AAAA,QAEN,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAEHP,2BAAAA;AAAAA,MAACW,OAAAA;AAAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,MAAK;AAAA,QACL,WAAWJ,2BAAAA,QAAO;AAAA,QAClB;AAAA,QAEC,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GACF;AAEJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReleaseAnnouncement.d.ts","sourceRoot":"","sources":["../../../src/components/ReleaseAnnouncement/ReleaseAnnouncement.tsx"],"names":[],"mappings":"AAOA,OAAc,EAGZ,KAAK,GAAG,EACR,KAAK,iBAAiB,EAEvB,MAAM,OAAO,CAAC;AACf,OAAO,EAGL,KAAK,SAAS,EAGf,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,KAAK,2BAA2B,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEhF,UAAU,
|
|
1
|
+
{"version":3,"file":"ReleaseAnnouncement.d.ts","sourceRoot":"","sources":["../../../src/components/ReleaseAnnouncement/ReleaseAnnouncement.tsx"],"names":[],"mappings":"AAOA,OAAc,EAGZ,KAAK,GAAG,EACR,KAAK,iBAAiB,EAEvB,MAAM,OAAO,CAAC;AACf,OAAO,EAGL,KAAK,SAAS,EAGf,MAAM,oBAAoB,CAAC;AAQ5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,KAAK,2BAA2B,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEhF,UAAU,wBAAyB,SAAQ,IAAI,CAC7C,2BAA2B,EAC3B,WAAW,GAAG,cAAc,CAC7B;IACC;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC;AAClC;;GAEG;AACH,QAAQ,EACR,SAAmB,EACnB,YAAmB,EACnB,GAAG,KAAK,EACT,EAAE,iBAAiB,CAAC,wBAAwB,CAAC,GAAG,GAAG,CAAC,OAAO,CAW3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReleaseAnnouncement.js","sources":["../../../src/components/ReleaseAnnouncement/ReleaseAnnouncement.tsx"],"sourcesContent":["/*\nCopyright 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, {\n cloneElement,\n isValidElement,\n type JSX,\n type PropsWithChildren,\n type Ref,\n} from \"react\";\nimport {\n FloatingPortal,\n FloatingFocusManager,\n type Placement,\n useMergeRefs,\n FloatingArrow,\n} from \"@floating-ui/react\";\nimport { Text } from \"../Typography/Text\";\nimport { Button } from \"../Button\";\nimport styles from \"./ReleaseAnnouncement.module.css\";\nimport {\n useReleaseAnnouncementContext,\n ReleaseAnnouncementContext,\n} from \"./ReleaseAnnouncementContext\";\nimport { useReleaseAnnouncement } from \"./useReleaseAnnouncement\";\n\ntype UseReleaseAnnouncementParam = Parameters<typeof useReleaseAnnouncement>[0];\n\ninterface ReleaseAnnouncementProps
|
|
1
|
+
{"version":3,"file":"ReleaseAnnouncement.js","sources":["../../../src/components/ReleaseAnnouncement/ReleaseAnnouncement.tsx"],"sourcesContent":["/*\nCopyright 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, {\n cloneElement,\n isValidElement,\n type JSX,\n type PropsWithChildren,\n type Ref,\n} from \"react\";\nimport {\n FloatingPortal,\n FloatingFocusManager,\n type Placement,\n useMergeRefs,\n FloatingArrow,\n} from \"@floating-ui/react\";\nimport { Text } from \"../Typography/Text\";\nimport { Button } from \"../Button\";\nimport styles from \"./ReleaseAnnouncement.module.css\";\nimport {\n useReleaseAnnouncementContext,\n ReleaseAnnouncementContext,\n} from \"./ReleaseAnnouncementContext\";\nimport { useReleaseAnnouncement } from \"./useReleaseAnnouncement\";\n\ntype UseReleaseAnnouncementParam = Parameters<typeof useReleaseAnnouncement>[0];\n\ninterface ReleaseAnnouncementProps extends Omit<\n UseReleaseAnnouncementParam,\n \"placement\" | \"displayArrow\"\n> {\n /**\n * The placement of the component\n * @default \"right\"\n */\n placement?: Placement;\n /**\n * Whether to display an arrow.\n * @default true\n */\n displayArrow?: boolean;\n}\n\n/**\n * The ReleaseAnnouncement component purpose is to inform the user of a new available feature.\n * This component is a floating component that will appear next to an anchor.\n * @param children - Act as an anchor, the component will be displayed alongside of it.\n * @param placement - The placement of the component\n */\nexport function ReleaseAnnouncement({\n /**\n * The children anchor should be a single valid React element.\n */\n children,\n placement = \"right\",\n displayArrow = true,\n ...props\n}: PropsWithChildren<ReleaseAnnouncementProps>): JSX.Element {\n const context = useReleaseAnnouncement({ placement, displayArrow, ...props });\n\n return (\n <ReleaseAnnouncementContext.Provider value={context}>\n <ReleaseAnnouncementAnchor>{children}</ReleaseAnnouncementAnchor>\n <ReleaseAnnouncementContainer>\n <ReleaseAnnouncementContent />\n </ReleaseAnnouncementContainer>\n </ReleaseAnnouncementContext.Provider>\n );\n}\n\n/**\n * The anchor for the ReleaseAnnouncement components.\n * The Release Announcement will appear next to this element.\n * @param children - should be a single valid React element\n * @constructor\n */\nfunction ReleaseAnnouncementAnchor({\n children,\n}: Readonly<PropsWithChildren>): JSX.Element {\n const context = useReleaseAnnouncementContext();\n\n // The children can have a ref and we don't want to discard it\n // Doing a dirty cast to get the optional ref\n const childrenRef = (children as unknown as { ref?: Ref<HTMLElement> })?.ref;\n const ref = useMergeRefs([context.refs.setReference, childrenRef]);\n\n if (!isValidElement(children)) {\n throw new Error(\n \"ReleaseAnnouncement anchor must be a single valid React element\",\n );\n }\n\n const referenceProps = context.getReferenceProps({\n ref,\n // If the ReleaseAnnouncement is open, we need manually aria-describedby.\n // The RA has the dialog role and it's not adding automatically the aria-describedby.\n ...(context.open && {\n \"aria-describedby\": context.getFloatingProps().id as string,\n }),\n });\n\n // getReferenceProps includes aria-expanded (being true when the popup is shown)\n // but axe only allows this on certain elements and we use release anncounements on\n // all sorts of elements. Semantically, I don't think it makes sense because the point\n // of aria-expanded is a hint to the user that there is something that can be expanded.\n // The user can't cause a release announcement to be shown, it just appears when it thinks\n // it's time, so I think adding it here is misleading.\n delete referenceProps[\"aria-expanded\"];\n\n return cloneElement(children, referenceProps);\n}\n\n/**\n * The container for the ReleaseAnnouncement components.\n * Manage focus and positioning of the children.\n * @param children\n */\nfunction ReleaseAnnouncementContainer({\n children,\n}: PropsWithChildren): JSX.Element | null {\n const {\n context: floatingContext,\n arrowRef,\n displayArrow,\n ...rest\n } = useReleaseAnnouncementContext();\n\n if (!floatingContext.open) return null;\n\n return (\n <FloatingPortal>\n <FloatingFocusManager context={floatingContext} modal={false}>\n <div\n ref={rest.refs.setFloating}\n style={rest.floatingStyles}\n aria-labelledby={rest.labelId}\n aria-describedby={rest.descriptionId}\n {...rest.getFloatingProps()}\n className={styles.content}\n >\n {displayArrow && (\n <FloatingArrow\n ref={arrowRef}\n context={floatingContext}\n // design absolute value\n width={20}\n height={12}\n className={styles.arrow}\n />\n )}\n {children}\n </div>\n </FloatingFocusManager>\n </FloatingPortal>\n );\n}\n\n/**\n * The content of the ReleaseAnnouncement component.\n * ---------------------------------------------------------------\n * - The header in a bold text ------------- -\n * - A description in a regular text | Close button | -\n * - Description can be on multiple lines ------------- -\n * ---------------------------------------------------------------\n */\nfunction ReleaseAnnouncementContent(): JSX.Element {\n const { labelId, descriptionId, header, description, closeLabel, onClick } =\n useReleaseAnnouncementContext();\n\n return (\n <>\n <Text\n as=\"h3\"\n id={labelId}\n className={styles.header}\n size=\"lg\"\n weight=\"semibold\"\n >\n {header}\n </Text>\n <Text\n as=\"span\"\n id={descriptionId}\n className={styles.description}\n size=\"sm\"\n weight=\"regular\"\n >\n {description}\n </Text>\n <Button\n size=\"sm\"\n kind=\"secondary\"\n className={styles.button}\n onClick={onClick}\n >\n {closeLabel}\n </Button>\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AAsDO,SAAS,oBAAoB;AAAA;AAAA;AAAA;AAAA,EAIlC;AAAA,EACA,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,GAAG;AACL,GAA6D;AAC3D,QAAM,UAAU,uBAAuB,EAAE,WAAW,cAAc,GAAG,OAAO;AAE5E,SACE,qBAAC,2BAA2B,UAA3B,EAAoC,OAAO,SAC1C,UAAA;AAAA,IAAA,oBAAC,6BAA2B,UAAS;AAAA,IACrC,oBAAC,8BAAA,EACC,UAAA,oBAAC,4BAAA,CAAA,CAA2B,EAAA,CAC9B;AAAA,EAAA,GACF;AAEJ;AAQA,SAAS,0BAA0B;AAAA,EACjC;AACF,GAA6C;AAC3C,QAAM,UAAU,8BAAA;AAIhB,QAAM,cAAe,UAAoD;AACzE,QAAM,MAAM,aAAa,CAAC,QAAQ,KAAK,cAAc,WAAW,CAAC;AAEjE,MAAI,CAAC,eAAe,QAAQ,GAAG;AAC7B,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AAEA,QAAM,iBAAiB,QAAQ,kBAAkB;AAAA,IAC/C;AAAA;AAAA;AAAA,IAGA,GAAI,QAAQ,QAAQ;AAAA,MAClB,oBAAoB,QAAQ,mBAAmB;AAAA,IAAA;AAAA,EACjD,CACD;AAQD,SAAO,eAAe,eAAe;AAErC,SAAO,aAAa,UAAU,cAAc;AAC9C;AAOA,SAAS,6BAA6B;AAAA,EACpC;AACF,GAA0C;AACxC,QAAM;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,8BAAA;AAEJ,MAAI,CAAC,gBAAgB,KAAM,QAAO;AAElC,6BACG,gBAAA,EACC,UAAA,oBAAC,wBAAqB,SAAS,iBAAiB,OAAO,OACrD,UAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAK,KAAK,KAAK;AAAA,MACf,OAAO,KAAK;AAAA,MACZ,mBAAiB,KAAK;AAAA,MACtB,oBAAkB,KAAK;AAAA,MACtB,GAAG,KAAK,iBAAA;AAAA,MACT,WAAW,OAAO;AAAA,MAEjB,UAAA;AAAA,QAAA,gBACC;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,KAAK;AAAA,YACL,SAAS;AAAA,YAET,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,WAAW,OAAO;AAAA,UAAA;AAAA,QAAA;AAAA,QAGrB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEL,EAAA,CACF;AAEJ;AAUA,SAAS,6BAA0C;AACjD,QAAM,EAAE,SAAS,eAAe,QAAQ,aAAa,YAAY,QAAA,IAC/D,8BAAA;AAEF,SACE,qBAAA,UAAA,EACE,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAG;AAAA,QACH,IAAI;AAAA,QACJ,WAAW,OAAO;AAAA,QAClB,MAAK;AAAA,QACL,QAAO;AAAA,QAEN,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAEH;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAG;AAAA,QACH,IAAI;AAAA,QACJ,WAAW,OAAO;AAAA,QAClB,MAAK;AAAA,QACL,QAAO;AAAA,QAEN,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,IAEH;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,MAAK;AAAA,QACL,WAAW,OAAO;AAAA,QAClB;AAAA,QAEC,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GACF;AAEJ;"}
|
package/dist/style.css
CHANGED
|
@@ -247,7 +247,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
|
247
247
|
Please see LICENSE files in the repository root for full details.
|
|
248
248
|
*/
|
|
249
249
|
|
|
250
|
-
._icon-
|
|
250
|
+
._icon-button_1215g_8 {
|
|
251
251
|
--cpd-icon-button-indicator-border-size: calc(
|
|
252
252
|
var(--cpd-icon-button-size) * 0.0625
|
|
253
253
|
);
|
|
@@ -267,13 +267,13 @@ Please see LICENSE files in the repository root for full details.
|
|
|
267
267
|
line-height: 0px;
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
._icon-
|
|
270
|
+
._icon-button_1215g_8[data-kind="primary"] {
|
|
271
271
|
* {
|
|
272
|
-
color: var(--cpd-color-icon-
|
|
272
|
+
color: var(--cpd-color-icon-secondary);
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
._icon-
|
|
276
|
+
._icon-button_1215g_8[data-kind="secondary"] {
|
|
277
277
|
background: var(--cpd-color-bg-subtle-secondary);
|
|
278
278
|
|
|
279
279
|
* {
|
|
@@ -281,11 +281,11 @@ Please see LICENSE files in the repository root for full details.
|
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
-
._no-
|
|
284
|
+
._no-background_1215g_42[data-kind="secondary"] {
|
|
285
285
|
background: transparent;
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
-
._icon-
|
|
288
|
+
._icon-button_1215g_8[aria-disabled="true"] {
|
|
289
289
|
cursor: not-allowed;
|
|
290
290
|
|
|
291
291
|
* {
|
|
@@ -298,7 +298,7 @@ Please see LICENSE files in the repository root for full details.
|
|
|
298
298
|
*/
|
|
299
299
|
|
|
300
300
|
@media (hover) {
|
|
301
|
-
._icon-
|
|
301
|
+
._icon-button_1215g_8:not([aria-disabled="true"]):hover {
|
|
302
302
|
background: var(--cpd-color-bg-subtle-primary);
|
|
303
303
|
|
|
304
304
|
* {
|
|
@@ -307,7 +307,7 @@ Please see LICENSE files in the repository root for full details.
|
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
-
._icon-
|
|
310
|
+
._icon-button_1215g_8:not([aria-disabled="true"]):active {
|
|
311
311
|
background: var(--cpd-color-bg-subtle-primary);
|
|
312
312
|
|
|
313
313
|
* {
|
|
@@ -316,7 +316,7 @@ Please see LICENSE files in the repository root for full details.
|
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
@media (hover) {
|
|
319
|
-
._icon-
|
|
319
|
+
._icon-button_1215g_8:not([aria-disabled="true"])[data-indicator]:is(:hover)::before {
|
|
320
320
|
/* Same colour as the background */
|
|
321
321
|
border: var(--cpd-icon-button-indicator-border-size) solid
|
|
322
322
|
var(--cpd-color-bg-subtle-primary);
|
|
@@ -325,7 +325,7 @@ Please see LICENSE files in the repository root for full details.
|
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
-
._icon-
|
|
328
|
+
._icon-button_1215g_8:not([aria-disabled="true"])[data-indicator]:is(:active)::before {
|
|
329
329
|
/* Same colour as the background */
|
|
330
330
|
border: var(--cpd-icon-button-indicator-border-size) solid
|
|
331
331
|
var(--cpd-color-bg-subtle-primary);
|
|
@@ -334,13 +334,13 @@ Please see LICENSE files in the repository root for full details.
|
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
@media (hover) {
|
|
337
|
-
._icon-
|
|
337
|
+
._icon-button_1215g_8:not([aria-disabled="true"])._destructive_1215g_95:hover {
|
|
338
338
|
background: var(--cpd-color-bg-critical-subtle-hovered);
|
|
339
339
|
outline: 1px solid var(--cpd-color-border-critical-subtle);
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
|
|
343
|
-
._icon-
|
|
343
|
+
._icon-button_1215g_8:not([aria-disabled="true"])._destructive_1215g_95 {
|
|
344
344
|
* {
|
|
345
345
|
color: var(--cpd-color-icon-critical-primary);
|
|
346
346
|
}
|
|
@@ -899,12 +899,12 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
|
899
899
|
Please see LICENSE files in the repository root for full details.
|
|
900
900
|
*/
|
|
901
901
|
|
|
902
|
-
.
|
|
902
|
+
._item_lqfwq_8 {
|
|
903
903
|
display: grid;
|
|
904
904
|
grid-template: "icon label ." auto "empty1 label empty2" auto / auto auto minmax(
|
|
905
905
|
/* Reserve space for the chevron so that the layout doesn't shift on
|
|
906
906
|
hover */
|
|
907
|
-
|
|
907
|
+
var(--cpd-space-2x),
|
|
908
908
|
1fr
|
|
909
909
|
);
|
|
910
910
|
place-items: center end;
|
|
@@ -917,105 +917,105 @@ Please see LICENSE files in the repository root for full details.
|
|
|
917
917
|
background: var(--cpd-color-bg-action-secondary-rest);
|
|
918
918
|
}
|
|
919
919
|
|
|
920
|
-
.
|
|
920
|
+
._item_lqfwq_8._interactive_lqfwq_26 {
|
|
921
921
|
cursor: pointer;
|
|
922
922
|
}
|
|
923
923
|
|
|
924
|
-
.
|
|
924
|
+
._item_lqfwq_8._no-label_lqfwq_30 {
|
|
925
925
|
grid-template: "icon ." auto / auto 1fr;
|
|
926
926
|
}
|
|
927
927
|
|
|
928
|
-
.
|
|
928
|
+
._label_lqfwq_34 {
|
|
929
929
|
grid-area: label;
|
|
930
930
|
margin-inline-end: var(--cpd-space-4x);
|
|
931
931
|
text-align: start;
|
|
932
932
|
word-break: break-word; /* stylelint-disable-line declaration-property-value-keyword-no-deprecated */
|
|
933
933
|
}
|
|
934
934
|
|
|
935
|
-
.
|
|
935
|
+
._item_lqfwq_8._no-icon_lqfwq_41 {
|
|
936
936
|
grid-template: "label ." auto / auto 1fr;
|
|
937
937
|
|
|
938
|
-
.
|
|
938
|
+
._label_lqfwq_34 {
|
|
939
939
|
/* Without icon, the height changes when hovered */
|
|
940
940
|
min-block-size: 24px;
|
|
941
941
|
}
|
|
942
942
|
}
|
|
943
943
|
|
|
944
|
-
.
|
|
944
|
+
._icon_lqfwq_50 {
|
|
945
945
|
grid-area: icon;
|
|
946
946
|
margin-inline-end: var(--cpd-space-3x);
|
|
947
947
|
}
|
|
948
948
|
|
|
949
|
-
.
|
|
949
|
+
._item_lqfwq_8._no-label_lqfwq_30 ._icon_lqfwq_50 {
|
|
950
950
|
margin-inline-end: var(--cpd-space-4x);
|
|
951
951
|
}
|
|
952
952
|
|
|
953
|
-
._nav-
|
|
953
|
+
._nav-hint_lqfwq_59 {
|
|
954
954
|
/* Hidden until the item is hovered over */
|
|
955
955
|
display: none;
|
|
956
956
|
flex-shrink: 0;
|
|
957
957
|
}
|
|
958
958
|
|
|
959
|
-
button.
|
|
959
|
+
button._item_lqfwq_8 {
|
|
960
960
|
appearance: none;
|
|
961
961
|
border: none;
|
|
962
962
|
}
|
|
963
963
|
|
|
964
|
-
.
|
|
964
|
+
._item_lqfwq_8[data-kind="primary"] > ._label_lqfwq_34 {
|
|
965
965
|
color: var(--cpd-color-text-primary);
|
|
966
966
|
}
|
|
967
967
|
|
|
968
|
-
.
|
|
968
|
+
._item_lqfwq_8[data-kind="primary"] > ._icon_lqfwq_50 {
|
|
969
969
|
color: var(--cpd-color-icon-primary);
|
|
970
970
|
}
|
|
971
971
|
|
|
972
|
-
.
|
|
972
|
+
._item_lqfwq_8[data-kind="primary"] > ._nav-hint_lqfwq_59 {
|
|
973
973
|
color: var(--cpd-color-icon-tertiary);
|
|
974
974
|
}
|
|
975
975
|
|
|
976
|
-
.
|
|
976
|
+
._item_lqfwq_8[data-kind="critical"] > ._label_lqfwq_34 {
|
|
977
977
|
color: var(--cpd-color-text-critical-primary);
|
|
978
978
|
}
|
|
979
979
|
|
|
980
|
-
.
|
|
981
|
-
.
|
|
980
|
+
._item_lqfwq_8[data-kind="critical"] > ._icon_lqfwq_50,
|
|
981
|
+
._item_lqfwq_8[data-kind="critical"] > ._nav-hint_lqfwq_59 {
|
|
982
982
|
color: var(--cpd-color-icon-critical-primary);
|
|
983
983
|
}
|
|
984
984
|
|
|
985
985
|
@media (hover) {
|
|
986
|
-
.
|
|
986
|
+
._item_lqfwq_8._interactive_lqfwq_26[data-kind="primary"]:hover {
|
|
987
987
|
background: var(--cpd-color-bg-action-secondary-hovered);
|
|
988
988
|
}
|
|
989
989
|
|
|
990
|
-
.
|
|
990
|
+
._item_lqfwq_8._interactive_lqfwq_26[data-kind="critical"]:hover {
|
|
991
991
|
background: var(--cpd-color-bg-critical-subtle);
|
|
992
992
|
}
|
|
993
993
|
|
|
994
994
|
/* Replace the children with the navigation hint on hover */
|
|
995
|
-
.
|
|
995
|
+
._item_lqfwq_8._interactive_lqfwq_26:hover > ._nav-hint_lqfwq_59 {
|
|
996
996
|
display: initial;
|
|
997
997
|
}
|
|
998
998
|
|
|
999
|
-
.
|
|
999
|
+
._item_lqfwq_8._interactive_lqfwq_26:hover > ._nav-hint_lqfwq_59 ~ * {
|
|
1000
1000
|
display: none;
|
|
1001
1001
|
}
|
|
1002
1002
|
}
|
|
1003
1003
|
|
|
1004
|
-
.
|
|
1004
|
+
._item_lqfwq_8._interactive_lqfwq_26[data-kind="primary"]:active {
|
|
1005
1005
|
background: var(--cpd-color-bg-action-secondary-pressed);
|
|
1006
1006
|
}
|
|
1007
1007
|
|
|
1008
|
-
.
|
|
1008
|
+
._item_lqfwq_8._interactive_lqfwq_26[data-kind="critical"]:active {
|
|
1009
1009
|
background: var(--cpd-color-bg-critical-subtle-hovered);
|
|
1010
1010
|
}
|
|
1011
1011
|
|
|
1012
|
-
.
|
|
1012
|
+
._item_lqfwq_8[data-kind]._disabled_lqfwq_118 {
|
|
1013
1013
|
pointer-events: none;
|
|
1014
1014
|
}
|
|
1015
1015
|
|
|
1016
|
-
.
|
|
1017
|
-
.
|
|
1018
|
-
.
|
|
1016
|
+
._item_lqfwq_8[data-kind]._disabled_lqfwq_118 > ._label_lqfwq_34,
|
|
1017
|
+
._item_lqfwq_8[data-kind]._disabled_lqfwq_118 > ._icon_lqfwq_50,
|
|
1018
|
+
._item_lqfwq_8[data-kind]._disabled_lqfwq_118 > ._nav-hint_lqfwq_59 {
|
|
1019
1019
|
color: var(--cpd-color-text-disabled);
|
|
1020
1020
|
}
|
|
1021
1021
|
/*
|
|
@@ -1780,7 +1780,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
|
1780
1780
|
Please see LICENSE files in the repository root for full details.
|
|
1781
1781
|
*/
|
|
1782
1782
|
|
|
1783
|
-
.
|
|
1783
|
+
._button_13vu4_8 {
|
|
1784
1784
|
border-radius: var(--cpd-radius-pill-effect);
|
|
1785
1785
|
cursor: pointer;
|
|
1786
1786
|
appearance: none;
|
|
@@ -1794,22 +1794,25 @@ Please see LICENSE files in the repository root for full details.
|
|
|
1794
1794
|
transition-property: color, background-color, border-color;
|
|
1795
1795
|
}
|
|
1796
1796
|
|
|
1797
|
-
a.
|
|
1797
|
+
a._button_13vu4_8 {
|
|
1798
1798
|
/* Make the width match that of a real button */
|
|
1799
1799
|
inline-size: max-content;
|
|
1800
|
+
|
|
1801
|
+
/* Buttons should not be underlined */
|
|
1802
|
+
text-decoration: none;
|
|
1800
1803
|
}
|
|
1801
1804
|
|
|
1802
|
-
.
|
|
1805
|
+
._button_13vu4_8 > svg {
|
|
1803
1806
|
transition: color 0.1s;
|
|
1804
1807
|
}
|
|
1805
1808
|
|
|
1806
|
-
.
|
|
1809
|
+
._button_13vu4_8[aria-disabled="true"] {
|
|
1807
1810
|
cursor: not-allowed;
|
|
1808
1811
|
pointer-events: all !important;
|
|
1809
1812
|
color: var(--cpd-color-text-disabled) !important;
|
|
1810
1813
|
}
|
|
1811
1814
|
|
|
1812
|
-
.
|
|
1815
|
+
._button_13vu4_8[aria-disabled="true"] > svg {
|
|
1813
1816
|
color: var(--cpd-color-icon-disabled) !important;
|
|
1814
1817
|
}
|
|
1815
1818
|
|
|
@@ -1817,35 +1820,35 @@ a._button_187yx_8 {
|
|
|
1817
1820
|
* SIZES
|
|
1818
1821
|
*/
|
|
1819
1822
|
|
|
1820
|
-
.
|
|
1823
|
+
._button_13vu4_8[data-size="lg"] {
|
|
1821
1824
|
padding-block: var(--cpd-space-2x);
|
|
1822
1825
|
padding-inline: var(--cpd-space-8x);
|
|
1823
1826
|
min-block-size: var(--cpd-space-12x);
|
|
1824
1827
|
|
|
1825
|
-
&._icon-
|
|
1828
|
+
&._icon-only_13vu4_53 {
|
|
1826
1829
|
padding-inline: var(--cpd-space-2x);
|
|
1827
1830
|
block-size: var(--cpd-space-12x);
|
|
1828
1831
|
inline-size: var(--cpd-space-12x);
|
|
1829
1832
|
}
|
|
1830
1833
|
}
|
|
1831
1834
|
|
|
1832
|
-
.
|
|
1835
|
+
._button_13vu4_8[data-size="lg"]._has-icon_13vu4_60:not(._icon-only_13vu4_53) {
|
|
1833
1836
|
padding-inline-start: var(--cpd-space-7x);
|
|
1834
1837
|
}
|
|
1835
1838
|
|
|
1836
|
-
.
|
|
1839
|
+
._button_13vu4_8[data-size="sm"] {
|
|
1837
1840
|
padding-block: var(--cpd-space-1x);
|
|
1838
1841
|
padding-inline: var(--cpd-space-5x);
|
|
1839
1842
|
min-block-size: var(--cpd-space-9x);
|
|
1840
1843
|
|
|
1841
|
-
&._icon-
|
|
1844
|
+
&._icon-only_13vu4_53 {
|
|
1842
1845
|
padding-inline: var(--cpd-space-1x);
|
|
1843
1846
|
block-size: var(--cpd-space-9x);
|
|
1844
1847
|
inline-size: var(--cpd-space-9x);
|
|
1845
1848
|
}
|
|
1846
1849
|
}
|
|
1847
1850
|
|
|
1848
|
-
.
|
|
1851
|
+
._button_13vu4_8[data-size="sm"]._has-icon_13vu4_60:not(._icon-only_13vu4_53) {
|
|
1849
1852
|
padding-inline-start: var(--cpd-space-4x);
|
|
1850
1853
|
}
|
|
1851
1854
|
|
|
@@ -1853,100 +1856,100 @@ a._button_187yx_8 {
|
|
|
1853
1856
|
* KINDS
|
|
1854
1857
|
*/
|
|
1855
1858
|
|
|
1856
|
-
.
|
|
1859
|
+
._button_13vu4_8[data-kind="primary"] {
|
|
1857
1860
|
color: var(--cpd-color-text-on-solid-primary);
|
|
1858
1861
|
background: var(--cpd-color-bg-action-primary-rest);
|
|
1859
1862
|
border-width: 0;
|
|
1860
1863
|
}
|
|
1861
1864
|
|
|
1862
|
-
.
|
|
1865
|
+
._button_13vu4_8[data-kind="primary"] > svg {
|
|
1863
1866
|
color: var(--cpd-color-icon-on-solid-primary);
|
|
1864
1867
|
}
|
|
1865
1868
|
|
|
1866
1869
|
@media (hover) {
|
|
1867
|
-
.
|
|
1870
|
+
._button_13vu4_8[data-kind="primary"]:hover {
|
|
1868
1871
|
background: var(--cpd-color-bg-action-primary-hovered);
|
|
1869
1872
|
}
|
|
1870
1873
|
}
|
|
1871
1874
|
|
|
1872
|
-
.
|
|
1873
|
-
.
|
|
1875
|
+
._button_13vu4_8[data-kind="primary"]:active,
|
|
1876
|
+
._button_13vu4_8[data-kind="primary"][aria-expanded="true"] {
|
|
1874
1877
|
background: var(--cpd-color-bg-action-primary-pressed);
|
|
1875
1878
|
}
|
|
1876
1879
|
|
|
1877
|
-
.
|
|
1880
|
+
._button_13vu4_8[data-kind="primary"][aria-disabled="true"] {
|
|
1878
1881
|
/* !important to override destructive background */
|
|
1879
1882
|
background: var(--cpd-color-bg-subtle-primary) !important;
|
|
1880
1883
|
}
|
|
1881
1884
|
|
|
1882
|
-
.
|
|
1885
|
+
._button_13vu4_8[data-kind="primary"]._destructive_13vu4_110 {
|
|
1883
1886
|
background: var(--cpd-color-bg-critical-primary);
|
|
1884
1887
|
}
|
|
1885
1888
|
|
|
1886
1889
|
@media (hover) {
|
|
1887
|
-
.
|
|
1890
|
+
._button_13vu4_8[data-kind="primary"]._destructive_13vu4_110:hover {
|
|
1888
1891
|
background: var(--cpd-color-bg-critical-hovered);
|
|
1889
1892
|
}
|
|
1890
1893
|
}
|
|
1891
1894
|
|
|
1892
|
-
.
|
|
1893
|
-
.
|
|
1895
|
+
._button_13vu4_8[data-kind="primary"]._destructive_13vu4_110:active,
|
|
1896
|
+
._button_13vu4_8[data-kind="primary"]._destructive_13vu4_110[aria-expanded="true"] {
|
|
1894
1897
|
/* TODO: We're waiting for this value to be formalized as a semantic token */
|
|
1895
1898
|
background: var(--cpd-color-red-1100);
|
|
1896
1899
|
}
|
|
1897
1900
|
|
|
1898
|
-
.
|
|
1901
|
+
._button_13vu4_8[data-kind="secondary"] {
|
|
1899
1902
|
border: 1px solid var(--cpd-color-border-interactive-secondary);
|
|
1900
1903
|
color: var(--cpd-color-text-primary);
|
|
1901
1904
|
background: var(--cpd-color-bg-canvas-default);
|
|
1902
1905
|
}
|
|
1903
1906
|
|
|
1904
|
-
.
|
|
1907
|
+
._button_13vu4_8[data-kind="secondary"] > svg {
|
|
1905
1908
|
color: var(--cpd-color-icon-primary);
|
|
1906
1909
|
}
|
|
1907
1910
|
|
|
1908
1911
|
@media (hover) {
|
|
1909
|
-
.
|
|
1912
|
+
._button_13vu4_8[data-kind="secondary"]:hover {
|
|
1910
1913
|
border-color: var(--cpd-color-border-interactive-hovered);
|
|
1911
1914
|
background: var(--cpd-color-bg-subtle-secondary);
|
|
1912
1915
|
}
|
|
1913
1916
|
}
|
|
1914
1917
|
|
|
1915
|
-
.
|
|
1916
|
-
.
|
|
1918
|
+
._button_13vu4_8[data-kind="secondary"]:active,
|
|
1919
|
+
._button_13vu4_8[data-kind="secondary"][aria-expanded="true"] {
|
|
1917
1920
|
border-color: var(--cpd-color-border-interactive-hovered);
|
|
1918
1921
|
background: var(--cpd-color-bg-subtle-primary);
|
|
1919
1922
|
}
|
|
1920
1923
|
|
|
1921
|
-
.
|
|
1924
|
+
._button_13vu4_8[data-kind="secondary"][aria-disabled="true"] {
|
|
1922
1925
|
/* !important to override destructive values */
|
|
1923
1926
|
border-color: var(--cpd-color-border-interactive-secondary) !important;
|
|
1924
1927
|
background: var(--cpd-color-bg-subtle-secondary) !important;
|
|
1925
1928
|
}
|
|
1926
1929
|
|
|
1927
|
-
.
|
|
1930
|
+
._button_13vu4_8[data-kind="secondary"]._destructive_13vu4_110 {
|
|
1928
1931
|
border-color: var(--cpd-color-border-critical-subtle);
|
|
1929
1932
|
color: var(--cpd-color-text-critical-primary);
|
|
1930
1933
|
}
|
|
1931
1934
|
|
|
1932
|
-
.
|
|
1935
|
+
._button_13vu4_8[data-kind="secondary"]._destructive_13vu4_110 > svg {
|
|
1933
1936
|
color: var(--cpd-color-icon-critical-primary);
|
|
1934
1937
|
}
|
|
1935
1938
|
|
|
1936
1939
|
@media (hover) {
|
|
1937
|
-
.
|
|
1940
|
+
._button_13vu4_8[data-kind="secondary"]._destructive_13vu4_110:hover {
|
|
1938
1941
|
border-color: var(--cpd-color-border-critical-hovered);
|
|
1939
1942
|
background: var(--cpd-color-bg-critical-subtle);
|
|
1940
1943
|
}
|
|
1941
1944
|
}
|
|
1942
1945
|
|
|
1943
|
-
.
|
|
1944
|
-
.
|
|
1946
|
+
._button_13vu4_8[data-kind="secondary"]._destructive_13vu4_110:active,
|
|
1947
|
+
._button_13vu4_8[data-kind="secondary"]._destructive_13vu4_110[aria-expanded="true"] {
|
|
1945
1948
|
border-color: var(--cpd-color-border-critical-hovered);
|
|
1946
1949
|
background: var(--cpd-color-bg-critical-subtle-hovered);
|
|
1947
1950
|
}
|
|
1948
1951
|
|
|
1949
|
-
.
|
|
1952
|
+
._button_13vu4_8[data-kind="tertiary"] {
|
|
1950
1953
|
border: none;
|
|
1951
1954
|
color: var(--cpd-color-text-primary);
|
|
1952
1955
|
text-decoration: underline;
|
|
@@ -1954,40 +1957,40 @@ a._button_187yx_8 {
|
|
|
1954
1957
|
}
|
|
1955
1958
|
|
|
1956
1959
|
@media (hover) {
|
|
1957
|
-
.
|
|
1960
|
+
._button_13vu4_8[data-kind="tertiary"]:hover {
|
|
1958
1961
|
background: var(--cpd-color-bg-subtle-secondary);
|
|
1959
1962
|
}
|
|
1960
1963
|
}
|
|
1961
1964
|
|
|
1962
|
-
.
|
|
1963
|
-
.
|
|
1965
|
+
._button_13vu4_8[data-kind="tertiary"]:active,
|
|
1966
|
+
._button_13vu4_8[data-kind="tertiary"][aria-expanded="true"] {
|
|
1964
1967
|
background: var(--cpd-color-bg-subtle-primary);
|
|
1965
1968
|
}
|
|
1966
1969
|
|
|
1967
|
-
.
|
|
1970
|
+
._button_13vu4_8[data-kind="tertiary"][aria-disabled="true"] {
|
|
1968
1971
|
color: var(--cpd-color-text-disabled);
|
|
1969
1972
|
|
|
1970
1973
|
/* !important to override destructive background */
|
|
1971
1974
|
background: transparent !important;
|
|
1972
1975
|
}
|
|
1973
1976
|
|
|
1974
|
-
.
|
|
1977
|
+
._button_13vu4_8[data-kind="tertiary"]._destructive_13vu4_110 {
|
|
1975
1978
|
color: var(--cpd-color-text-critical-primary);
|
|
1976
1979
|
}
|
|
1977
1980
|
|
|
1978
1981
|
@media (hover) {
|
|
1979
|
-
.
|
|
1982
|
+
._button_13vu4_8[data-kind="tertiary"]._destructive_13vu4_110:hover {
|
|
1980
1983
|
background: var(--cpd-color-bg-critical-subtle);
|
|
1981
1984
|
}
|
|
1982
1985
|
}
|
|
1983
1986
|
|
|
1984
|
-
.
|
|
1985
|
-
.
|
|
1987
|
+
._button_13vu4_8[data-kind="tertiary"]._destructive_13vu4_110:active,
|
|
1988
|
+
._button_13vu4_8[data-kind="tertiary"]._destructive_13vu4_110[aria-expanded="true"] {
|
|
1986
1989
|
background: var(--cpd-color-bg-critical-subtle-hovered);
|
|
1987
1990
|
}
|
|
1988
1991
|
|
|
1989
1992
|
@media (forced-colors: active) {
|
|
1990
|
-
.
|
|
1993
|
+
._button_13vu4_8[data-kind="primary"] {
|
|
1991
1994
|
outline: 1px solid transparent;
|
|
1992
1995
|
}
|
|
1993
1996
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vector-im/compound-web",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.5",
|
|
4
4
|
"description": "Compound components for the Web",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"repository": {
|
|
38
38
|
"type": "git",
|
|
39
|
-
"url": "git+https://github.com/
|
|
39
|
+
"url": "git+https://github.com/element-hq/compound-web.git"
|
|
40
40
|
},
|
|
41
41
|
"keywords": [
|
|
42
42
|
"compound",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@fontsource/inter": "^5.0.8",
|
|
57
57
|
"@playwright/test": "^1.41.1",
|
|
58
58
|
"@storybook/addon-a11y": "^10.0.0",
|
|
59
|
-
"@storybook/addon-designs": "11.
|
|
59
|
+
"@storybook/addon-designs": "11.1.1",
|
|
60
60
|
"@storybook/addon-docs": "^10.0.0",
|
|
61
61
|
"@storybook/addon-links": "^10.0.0",
|
|
62
62
|
"@storybook/addon-themes": "^10.0.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@testing-library/jest-dom": "^6.1.3",
|
|
66
66
|
"@testing-library/react": "^16.0.0",
|
|
67
67
|
"@testing-library/user-event": "^14.5.1",
|
|
68
|
-
"@tsconfig/
|
|
68
|
+
"@tsconfig/node22": "^22.0.0",
|
|
69
69
|
"@tsconfig/vite-react": "^7.0.0",
|
|
70
70
|
"@types/eslint": "^9.0.0",
|
|
71
71
|
"@types/node": "^24.0.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"eslint-plugin-react": "^7.33.2",
|
|
84
84
|
"eslint-plugin-storybook": "^10.0.0",
|
|
85
85
|
"jsdom": "^27.0.0",
|
|
86
|
-
"prettier": "3.
|
|
86
|
+
"prettier": "3.7.4",
|
|
87
87
|
"react": "^19.1.0",
|
|
88
88
|
"react-dom": "^19.1.0",
|
|
89
89
|
"resize-observer-polyfill": "^1.5.1",
|
|
@@ -22,6 +22,9 @@ Please see LICENSE files in the repository root for full details.
|
|
|
22
22
|
a.button {
|
|
23
23
|
/* Make the width match that of a real button */
|
|
24
24
|
inline-size: max-content;
|
|
25
|
+
|
|
26
|
+
/* Buttons should not be underlined */
|
|
27
|
+
text-decoration: none;
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
.button > svg {
|
|
@@ -6,6 +6,7 @@ Please see LICENSE files in the repository root for full details.
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React, { type SVGAttributes, forwardRef } from "react";
|
|
9
|
+
import classNames from "classnames";
|
|
9
10
|
import styles from "./InlineSpinner.module.css";
|
|
10
11
|
import SpinnerIcon from "@vector-im/compound-design-tokens/assets/web/icons/spinner";
|
|
11
12
|
|
|
@@ -14,11 +15,11 @@ type InlineSpinnerProps = {
|
|
|
14
15
|
} & SVGAttributes<SVGElement>;
|
|
15
16
|
|
|
16
17
|
export const InlineSpinner = forwardRef<SVGSVGElement, InlineSpinnerProps>(
|
|
17
|
-
function InlineSpinner({ size = 20, ...props }, ref) {
|
|
18
|
+
function InlineSpinner({ size = 20, className, ...props }, ref) {
|
|
18
19
|
return (
|
|
19
20
|
<SpinnerIcon
|
|
20
21
|
ref={ref}
|
|
21
|
-
className={styles.icon}
|
|
22
|
+
className={classNames(styles.icon, className)}
|
|
22
23
|
style={{ width: size, height: size }}
|
|
23
24
|
{...props}
|
|
24
25
|
/>
|
|
@@ -39,15 +39,16 @@ export const CheckboxMenuItem = forwardRef<HTMLInputElement, Props>(
|
|
|
39
39
|
const onChange = useCallback(() => {}, []);
|
|
40
40
|
|
|
41
41
|
// <label> elements are not allowed to have a role like menuitemcheckbox, so
|
|
42
|
-
// we must instead use a
|
|
42
|
+
// we must instead use a <button> for the menu item and use aria-checked
|
|
43
43
|
// etc. to communicate its state.
|
|
44
44
|
return (
|
|
45
45
|
<MenuItem
|
|
46
|
-
as="
|
|
46
|
+
as="button"
|
|
47
47
|
role="menuitemcheckbox"
|
|
48
48
|
aria-checked={checked}
|
|
49
49
|
className={className}
|
|
50
50
|
label={label}
|
|
51
|
+
hideChevron
|
|
51
52
|
onSelect={onSelect}
|
|
52
53
|
disabled={disabled}
|
|
53
54
|
Icon={
|
|
@@ -56,6 +57,7 @@ export const CheckboxMenuItem = forwardRef<HTMLInputElement, Props>(
|
|
|
56
57
|
ref={ref}
|
|
57
58
|
// This is purely cosmetic; really the whole MenuItem is the toggle.
|
|
58
59
|
aria-hidden
|
|
60
|
+
tabIndex={-1}
|
|
59
61
|
checked={checked}
|
|
60
62
|
disabled={disabled}
|
|
61
63
|
onChange={onChange}
|
|
@@ -10,7 +10,7 @@ Please see LICENSE files in the repository root for full details.
|
|
|
10
10
|
grid-template: "icon label ." auto "empty1 label empty2" auto / auto auto minmax(
|
|
11
11
|
/* Reserve space for the chevron so that the layout doesn't shift on
|
|
12
12
|
hover */
|
|
13
|
-
|
|
13
|
+
var(--cpd-space-2x),
|
|
14
14
|
1fr
|
|
15
15
|
);
|
|
16
16
|
place-items: center end;
|
|
@@ -43,12 +43,13 @@ export const ToggleMenuItem = forwardRef<HTMLInputElement, Props>(
|
|
|
43
43
|
// etc. to communicate its state.
|
|
44
44
|
return (
|
|
45
45
|
<MenuItem
|
|
46
|
-
as="
|
|
46
|
+
as="button"
|
|
47
47
|
role="menuitemcheckbox"
|
|
48
48
|
aria-checked={checked}
|
|
49
49
|
className={className}
|
|
50
50
|
Icon={Icon}
|
|
51
51
|
label={label}
|
|
52
|
+
hideChevron
|
|
52
53
|
onSelect={onSelect}
|
|
53
54
|
disabled={disabled}
|
|
54
55
|
onClick={onClick}
|
|
@@ -58,6 +59,7 @@ export const ToggleMenuItem = forwardRef<HTMLInputElement, Props>(
|
|
|
58
59
|
ref={ref}
|
|
59
60
|
// This is purely cosmetic; really the whole MenuItem is the toggle.
|
|
60
61
|
aria-hidden
|
|
62
|
+
tabIndex={-1}
|
|
61
63
|
checked={checked}
|
|
62
64
|
disabled={disabled}
|
|
63
65
|
onChange={onChange}
|
|
@@ -30,8 +30,10 @@ import { useReleaseAnnouncement } from "./useReleaseAnnouncement";
|
|
|
30
30
|
|
|
31
31
|
type UseReleaseAnnouncementParam = Parameters<typeof useReleaseAnnouncement>[0];
|
|
32
32
|
|
|
33
|
-
interface ReleaseAnnouncementProps
|
|
34
|
-
|
|
33
|
+
interface ReleaseAnnouncementProps extends Omit<
|
|
34
|
+
UseReleaseAnnouncementParam,
|
|
35
|
+
"placement" | "displayArrow"
|
|
36
|
+
> {
|
|
35
37
|
/**
|
|
36
38
|
* The placement of the component
|
|
37
39
|
* @default "right"
|