@vector-im/compound-web 8.3.5 → 8.3.6

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 (26) hide show
  1. package/dist/components/Form/Controls/Checkbox/Checkbox.module.css.cjs +3 -3
  2. package/dist/components/Form/Controls/Checkbox/Checkbox.module.css.js +3 -3
  3. package/dist/components/Form/Controls/Radio/Radio.module.css.cjs +3 -3
  4. package/dist/components/Form/Controls/Radio/Radio.module.css.js +3 -3
  5. package/dist/components/Menu/ContextMenu.cjs +1 -2
  6. package/dist/components/Menu/ContextMenu.cjs.map +1 -1
  7. package/dist/components/Menu/ContextMenu.d.ts.map +1 -1
  8. package/dist/components/Menu/ContextMenu.js +1 -2
  9. package/dist/components/Menu/ContextMenu.js.map +1 -1
  10. package/dist/components/Menu/FloatingMenu.cjs.map +1 -1
  11. package/dist/components/Menu/FloatingMenu.d.ts.map +1 -1
  12. package/dist/components/Menu/FloatingMenu.js.map +1 -1
  13. package/dist/components/Menu/FloatingMenu.module.css.cjs +2 -2
  14. package/dist/components/Menu/FloatingMenu.module.css.js +2 -2
  15. package/dist/style.css +59 -72
  16. package/package.json +5 -5
  17. package/src/components/Form/Controls/Checkbox/Checkbox.module.css +4 -0
  18. package/src/components/Form/Controls/Radio/Radio.module.css +4 -0
  19. package/src/components/Menu/ContextMenu.tsx +1 -2
  20. package/src/components/Menu/FloatingMenu.module.css +0 -11
  21. package/src/components/Menu/FloatingMenu.tsx +1 -0
  22. package/dist/components/Menu/ContextMenu.module.css.cjs +0 -9
  23. package/dist/components/Menu/ContextMenu.module.css.cjs.map +0 -1
  24. package/dist/components/Menu/ContextMenu.module.css.js +0 -9
  25. package/dist/components/Menu/ContextMenu.module.css.js.map +0 -1
  26. package/src/components/Menu/ContextMenu.module.css +0 -10
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const container = "_container_1md5v_10";
4
- const input = "_input_1md5v_18";
5
- const ui = "_ui_1md5v_19";
3
+ const container = "_container_153f2_10";
4
+ const input = "_input_153f2_18";
5
+ const ui = "_ui_153f2_19";
6
6
  const styles = {
7
7
  container,
8
8
  input,
@@ -1,6 +1,6 @@
1
- const container = "_container_1md5v_10";
2
- const input = "_input_1md5v_18";
3
- const ui = "_ui_1md5v_19";
1
+ const container = "_container_153f2_10";
2
+ const input = "_input_153f2_18";
3
+ const ui = "_ui_153f2_19";
4
4
  const styles = {
5
5
  container,
6
6
  input,
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const container = "_container_1qhtc_10";
4
- const input = "_input_1qhtc_18";
5
- const ui = "_ui_1qhtc_19";
3
+ const container = "_container_1ug7n_10";
4
+ const input = "_input_1ug7n_18";
5
+ const ui = "_ui_1ug7n_19";
6
6
  const styles = {
7
7
  container,
8
8
  input,
@@ -1,6 +1,6 @@
1
- const container = "_container_1qhtc_10";
2
- const input = "_input_1qhtc_18";
3
- const ui = "_ui_1qhtc_19";
1
+ const container = "_container_1ug7n_10";
2
+ const input = "_input_1ug7n_18";
3
+ const ui = "_ui_1ug7n_19";
4
4
  const styles = {
5
5
  container,
6
6
  input,
@@ -7,7 +7,6 @@ const FloatingMenu = require("./FloatingMenu.cjs");
7
7
  const vaul = require("vaul");
8
8
  const classNames = require("classnames");
9
9
  const DrawerMenu_module = require("./DrawerMenu.module.css.cjs");
10
- const ContextMenu_module = require("./ContextMenu.module.css.cjs");
11
10
  const MenuContext = require("./MenuContext.cjs");
12
11
  const DrawerMenu = require("./DrawerMenu.cjs");
13
12
  const platform = require("../../utils/platform.cjs");
@@ -58,7 +57,7 @@ const ContextMenu = ({
58
57
  ] }) })
59
58
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs(reactContextMenu.Root, { onOpenChange, children: [
60
59
  trigger,
61
- /* @__PURE__ */ jsxRuntime.jsx(reactContextMenu.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(reactContextMenu.Content, { asChild: true, className: classNames(ContextMenu_module.default.content), children: /* @__PURE__ */ jsxRuntime.jsx(FloatingMenu.FloatingMenu, { showTitle, title, children }) }) })
60
+ /* @__PURE__ */ jsxRuntime.jsx(reactContextMenu.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(reactContextMenu.Content, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(FloatingMenu.FloatingMenu, { showTitle, title, children }) }) })
62
61
  ] });
63
62
  };
64
63
  exports.ContextMenu = ContextMenu;
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenu.cjs","sources":["../../../src/components/Menu/ContextMenu.tsx"],"sourcesContent":["/*\nCopyright 2023 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 FC,\n type ReactNode,\n useCallback,\n useMemo,\n useState,\n} from \"react\";\nimport {\n Root,\n Trigger,\n Portal,\n Content,\n ContextMenuItem,\n} from \"@radix-ui/react-context-menu\";\nimport { FloatingMenu } from \"./FloatingMenu\";\nimport { Drawer } from \"vaul\";\nimport classnames from \"classnames\";\nimport drawerStyles from \"./DrawerMenu.module.css\";\nimport contextStyles from \"./ContextMenu.module.css\";\nimport {\n MenuContext,\n type MenuData,\n type MenuItemWrapperProps,\n} from \"./MenuContext\";\nimport { DrawerMenu } from \"./DrawerMenu\";\nimport { getPlatform } from \"../../utils/platform\";\n\ninterface Props {\n /**\n * The menu title.\n */\n title: string;\n /**\n * Wether the title is displayed.\n * @default true\n */\n showTitle?: boolean;\n /**\n * Event handler called when the open state of the menu changes.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * The trigger that can be right-clicked or long-pressed to open the menu.\n * This must be a component that accepts a ref and spreads props.\n * https://www.radix-ui.com/primitives/docs/guides/composition\n */\n trigger: ReactNode;\n /**\n * Whether the functionality of this menu is available through some other\n * keyboard-accessible means. Preferably this should be true, because context\n * menus are potentially difficult to discover, but if false the trigger will\n * become focusable so that it can be opened via keyboard navigation.\n */\n hasAccessibleAlternative: boolean;\n /**\n * The menu contents.\n */\n children: ReactNode;\n}\n\nconst ContextMenuItemWrapper: FC<MenuItemWrapperProps> = ({\n onSelect,\n children,\n}) => (\n <ContextMenuItem onSelect={onSelect ?? undefined} asChild>\n {children}\n </ContextMenuItem>\n);\n\n/**\n * A menu opened by right-clicking or long-pressing another UI element.\n */\nexport const ContextMenu: FC<Props> = ({\n title,\n showTitle = true,\n onOpenChange: onOpenChangeProp,\n trigger: triggerProp,\n hasAccessibleAlternative,\n children: childrenProp,\n}) => {\n const [open, setOpen] = useState(false);\n const onOpenChange = useCallback(\n (value: boolean) => {\n setOpen(value);\n onOpenChangeProp?.(value);\n },\n [setOpen, onOpenChangeProp],\n );\n\n // Normally, the menu takes the form of a floating box. But on Android and\n // iOS, the menu should morph into a drawer\n const platform = getPlatform();\n const drawer = platform === \"android\" || platform === \"ios\";\n const context: MenuData = useMemo(\n () => ({\n MenuItemWrapper: drawer ? null : ContextMenuItemWrapper,\n onOpenChange,\n }),\n [onOpenChange],\n );\n const children = (\n <MenuContext.Provider value={context}>{childrenProp}</MenuContext.Provider>\n );\n\n const trigger = (\n <Trigger\n aria-haspopup=\"menu\"\n tabIndex={hasAccessibleAlternative ? undefined : 0}\n asChild\n >\n {triggerProp}\n </Trigger>\n );\n\n // This is a small hack: Vaul drawers only support buttons as triggers, so\n // we end up mounting an empty Radix context menu tree alongside the\n // drawer tree, purely so we can use its Trigger component (which supports\n // touch for free). The resulting behavior and DOM tree looks exactly the\n // same as if Vaul provided a long-press trigger of its own, so I think\n // this is fine.\n return drawer ? (\n <>\n <Root onOpenChange={onOpenChange}>{trigger}</Root>\n <Drawer.Root open={open} onOpenChange={onOpenChange}>\n <Drawer.Portal>\n <Drawer.Overlay className={classnames(drawerStyles.bg)} />\n <Drawer.Content asChild>\n <DrawerMenu title={title}>{children}</DrawerMenu>\n </Drawer.Content>\n </Drawer.Portal>\n </Drawer.Root>\n </>\n ) : (\n <Root onOpenChange={onOpenChange}>\n {trigger}\n <Portal>\n <Content asChild className={classnames(contextStyles.content)}>\n <FloatingMenu showTitle={showTitle} title={title}>\n {children}\n </FloatingMenu>\n </Content>\n </Portal>\n </Root>\n );\n};\n"],"names":["ContextMenuItem","useState","useCallback","platform","getPlatform","useMemo","jsx","MenuContext","Trigger","jsxs","Fragment","Root","Drawer","classnames","drawerStyles","DrawerMenu","Portal","Content","contextStyles","FloatingMenu"],"mappings":";;;;;;;;;;;;;AAmEA,MAAM,yBAAmD,CAAC;AAAA,EACxD;AAAA,EACA;AACF,qCACGA,kCAAA,EAAgB,UAAU,YAAY,QAAW,SAAO,MACtD,UACH;AAMK,MAAM,cAAyB,CAAC;AAAA,EACrC;AAAA,EACA,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,SAAS;AAAA,EACT;AAAA,EACA,UAAU;AACZ,MAAM;AACJ,QAAM,CAAC,MAAM,OAAO,IAAIC,MAAAA,SAAS,KAAK;AACtC,QAAM,eAAeC,MAAAA;AAAAA,IACnB,CAAC,UAAmB;AAClB,cAAQ,KAAK;AACb,yBAAmB,KAAK;AAAA,IAC1B;AAAA,IACA,CAAC,SAAS,gBAAgB;AAAA,EAAA;AAK5B,QAAMC,aAAWC,SAAAA,YAAA;AACjB,QAAM,SAASD,eAAa,aAAaA,eAAa;AACtD,QAAM,UAAoBE,MAAAA;AAAAA,IACxB,OAAO;AAAA,MACL,iBAAiB,SAAS,OAAO;AAAA,MACjC;AAAA,IAAA;AAAA,IAEF,CAAC,YAAY;AAAA,EAAA;AAEf,QAAM,WACJC,+BAACC,YAAAA,YAAY,UAAZ,EAAqB,OAAO,SAAU,UAAA,cAAa;AAGtD,QAAM,UACJD,2BAAAA;AAAAA,IAACE,iBAAAA;AAAAA,IAAA;AAAA,MACC,iBAAc;AAAA,MACd,UAAU,2BAA2B,SAAY;AAAA,MACjD,SAAO;AAAA,MAEN,UAAA;AAAA,IAAA;AAAA,EAAA;AAUL,SAAO,SACLC,2BAAAA,KAAAC,WAAAA,UAAA,EACE,UAAA;AAAA,IAAAJ,2BAAAA,IAACK,iBAAAA,MAAA,EAAK,cAA6B,UAAA,QAAA,CAAQ;AAAA,IAC3CL,2BAAAA,IAACM,KAAAA,OAAO,MAAP,EAAY,MAAY,cACvB,UAAAH,gCAACG,KAAAA,OAAO,QAAP,EACC,UAAA;AAAA,MAAAN,+BAACM,KAAAA,OAAO,SAAP,EAAe,WAAWC,WAAWC,kBAAAA,QAAa,EAAE,GAAG;AAAA,MACxDR,2BAAAA,IAACM,KAAAA,OAAO,SAAP,EAAe,SAAO,MACrB,UAAAN,2BAAAA,IAACS,WAAAA,YAAA,EAAW,OAAe,SAAA,CAAS,EAAA,CACtC;AAAA,IAAA,EAAA,CACF,EAAA,CACF;AAAA,EAAA,EAAA,CACF,IAEAN,2BAAAA,KAACE,iBAAAA,MAAA,EAAK,cACH,UAAA;AAAA,IAAA;AAAA,mCACAK,iBAAAA,QAAA,EACC,UAAAV,2BAAAA,IAACW,iBAAAA,SAAA,EAAQ,SAAO,MAAC,WAAWJ,WAAWK,mBAAAA,QAAc,OAAO,GAC1D,UAAAZ,2BAAAA,IAACa,aAAAA,cAAA,EAAa,WAAsB,OACjC,UACH,GACF,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;;"}
1
+ {"version":3,"file":"ContextMenu.cjs","sources":["../../../src/components/Menu/ContextMenu.tsx"],"sourcesContent":["/*\nCopyright 2023 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 FC,\n type ReactNode,\n useCallback,\n useMemo,\n useState,\n} from \"react\";\nimport {\n Root,\n Trigger,\n Portal,\n Content,\n ContextMenuItem,\n} from \"@radix-ui/react-context-menu\";\nimport { FloatingMenu } from \"./FloatingMenu\";\nimport { Drawer } from \"vaul\";\nimport classnames from \"classnames\";\nimport drawerStyles from \"./DrawerMenu.module.css\";\nimport {\n MenuContext,\n type MenuData,\n type MenuItemWrapperProps,\n} from \"./MenuContext\";\nimport { DrawerMenu } from \"./DrawerMenu\";\nimport { getPlatform } from \"../../utils/platform\";\n\ninterface Props {\n /**\n * The menu title.\n */\n title: string;\n /**\n * Wether the title is displayed.\n * @default true\n */\n showTitle?: boolean;\n /**\n * Event handler called when the open state of the menu changes.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * The trigger that can be right-clicked or long-pressed to open the menu.\n * This must be a component that accepts a ref and spreads props.\n * https://www.radix-ui.com/primitives/docs/guides/composition\n */\n trigger: ReactNode;\n /**\n * Whether the functionality of this menu is available through some other\n * keyboard-accessible means. Preferably this should be true, because context\n * menus are potentially difficult to discover, but if false the trigger will\n * become focusable so that it can be opened via keyboard navigation.\n */\n hasAccessibleAlternative: boolean;\n /**\n * The menu contents.\n */\n children: ReactNode;\n}\n\nconst ContextMenuItemWrapper: FC<MenuItemWrapperProps> = ({\n onSelect,\n children,\n}) => (\n <ContextMenuItem onSelect={onSelect ?? undefined} asChild>\n {children}\n </ContextMenuItem>\n);\n\n/**\n * A menu opened by right-clicking or long-pressing another UI element.\n */\nexport const ContextMenu: FC<Props> = ({\n title,\n showTitle = true,\n onOpenChange: onOpenChangeProp,\n trigger: triggerProp,\n hasAccessibleAlternative,\n children: childrenProp,\n}) => {\n const [open, setOpen] = useState(false);\n const onOpenChange = useCallback(\n (value: boolean) => {\n setOpen(value);\n onOpenChangeProp?.(value);\n },\n [setOpen, onOpenChangeProp],\n );\n\n // Normally, the menu takes the form of a floating box. But on Android and\n // iOS, the menu should morph into a drawer\n const platform = getPlatform();\n const drawer = platform === \"android\" || platform === \"ios\";\n const context: MenuData = useMemo(\n () => ({\n MenuItemWrapper: drawer ? null : ContextMenuItemWrapper,\n onOpenChange,\n }),\n [onOpenChange],\n );\n const children = (\n <MenuContext.Provider value={context}>{childrenProp}</MenuContext.Provider>\n );\n\n const trigger = (\n <Trigger\n aria-haspopup=\"menu\"\n tabIndex={hasAccessibleAlternative ? undefined : 0}\n asChild\n >\n {triggerProp}\n </Trigger>\n );\n\n // This is a small hack: Vaul drawers only support buttons as triggers, so\n // we end up mounting an empty Radix context menu tree alongside the\n // drawer tree, purely so we can use its Trigger component (which supports\n // touch for free). The resulting behavior and DOM tree looks exactly the\n // same as if Vaul provided a long-press trigger of its own, so I think\n // this is fine.\n return drawer ? (\n <>\n <Root onOpenChange={onOpenChange}>{trigger}</Root>\n <Drawer.Root open={open} onOpenChange={onOpenChange}>\n <Drawer.Portal>\n <Drawer.Overlay className={classnames(drawerStyles.bg)} />\n <Drawer.Content asChild>\n <DrawerMenu title={title}>{children}</DrawerMenu>\n </Drawer.Content>\n </Drawer.Portal>\n </Drawer.Root>\n </>\n ) : (\n <Root onOpenChange={onOpenChange}>\n {trigger}\n <Portal>\n <Content asChild>\n <FloatingMenu showTitle={showTitle} title={title}>\n {children}\n </FloatingMenu>\n </Content>\n </Portal>\n </Root>\n );\n};\n"],"names":["ContextMenuItem","useState","useCallback","platform","getPlatform","useMemo","jsx","MenuContext","Trigger","jsxs","Fragment","Root","Drawer","classnames","drawerStyles","DrawerMenu","Portal","Content","FloatingMenu"],"mappings":";;;;;;;;;;;;AAkEA,MAAM,yBAAmD,CAAC;AAAA,EACxD;AAAA,EACA;AACF,qCACGA,kCAAA,EAAgB,UAAU,YAAY,QAAW,SAAO,MACtD,UACH;AAMK,MAAM,cAAyB,CAAC;AAAA,EACrC;AAAA,EACA,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,SAAS;AAAA,EACT;AAAA,EACA,UAAU;AACZ,MAAM;AACJ,QAAM,CAAC,MAAM,OAAO,IAAIC,MAAAA,SAAS,KAAK;AACtC,QAAM,eAAeC,MAAAA;AAAAA,IACnB,CAAC,UAAmB;AAClB,cAAQ,KAAK;AACb,yBAAmB,KAAK;AAAA,IAC1B;AAAA,IACA,CAAC,SAAS,gBAAgB;AAAA,EAAA;AAK5B,QAAMC,aAAWC,SAAAA,YAAA;AACjB,QAAM,SAASD,eAAa,aAAaA,eAAa;AACtD,QAAM,UAAoBE,MAAAA;AAAAA,IACxB,OAAO;AAAA,MACL,iBAAiB,SAAS,OAAO;AAAA,MACjC;AAAA,IAAA;AAAA,IAEF,CAAC,YAAY;AAAA,EAAA;AAEf,QAAM,WACJC,+BAACC,YAAAA,YAAY,UAAZ,EAAqB,OAAO,SAAU,UAAA,cAAa;AAGtD,QAAM,UACJD,2BAAAA;AAAAA,IAACE,iBAAAA;AAAAA,IAAA;AAAA,MACC,iBAAc;AAAA,MACd,UAAU,2BAA2B,SAAY;AAAA,MACjD,SAAO;AAAA,MAEN,UAAA;AAAA,IAAA;AAAA,EAAA;AAUL,SAAO,SACLC,2BAAAA,KAAAC,WAAAA,UAAA,EACE,UAAA;AAAA,IAAAJ,2BAAAA,IAACK,iBAAAA,MAAA,EAAK,cAA6B,UAAA,QAAA,CAAQ;AAAA,IAC3CL,2BAAAA,IAACM,KAAAA,OAAO,MAAP,EAAY,MAAY,cACvB,UAAAH,gCAACG,KAAAA,OAAO,QAAP,EACC,UAAA;AAAA,MAAAN,+BAACM,KAAAA,OAAO,SAAP,EAAe,WAAWC,WAAWC,kBAAAA,QAAa,EAAE,GAAG;AAAA,MACxDR,2BAAAA,IAACM,KAAAA,OAAO,SAAP,EAAe,SAAO,MACrB,UAAAN,2BAAAA,IAACS,WAAAA,YAAA,EAAW,OAAe,SAAA,CAAS,EAAA,CACtC;AAAA,IAAA,EAAA,CACF,EAAA,CACF;AAAA,EAAA,EAAA,CACF,IAEAN,2BAAAA,KAACE,iBAAAA,MAAA,EAAK,cACH,UAAA;AAAA,IAAA;AAAA,IACDL,2BAAAA,IAACU,iBAAAA,QAAA,EACC,UAAAV,2BAAAA,IAACW,iBAAAA,SAAA,EAAQ,SAAO,MACd,UAAAX,2BAAAA,IAACY,aAAAA,cAAA,EAAa,WAAsB,OACjC,SAAA,CACH,EAAA,CACF,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/ContextMenu.tsx"],"names":[],"mappings":"AAOA,OAAc,EACZ,KAAK,EAAE,EACP,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAqBf,UAAU,KAAK;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC;;;;OAIG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;;;;OAKG;IACH,wBAAwB,EAAE,OAAO,CAAC;IAClC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAWD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,KAAK,CAwEjC,CAAC"}
1
+ {"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/ContextMenu.tsx"],"names":[],"mappings":"AAOA,OAAc,EACZ,KAAK,EAAE,EACP,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAoBf,UAAU,KAAK;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC;;;;OAIG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;;;;OAKG;IACH,wBAAwB,EAAE,OAAO,CAAC;IAClC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAWD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,KAAK,CAwEjC,CAAC"}
@@ -5,7 +5,6 @@ import { FloatingMenu } from "./FloatingMenu.js";
5
5
  import { Drawer } from "vaul";
6
6
  import classNames from "classnames";
7
7
  import drawerMenu from "./DrawerMenu.module.css.js";
8
- import contextStyles from "./ContextMenu.module.css.js";
9
8
  import { MenuContext } from "./MenuContext.js";
10
9
  import { DrawerMenu } from "./DrawerMenu.js";
11
10
  import { getPlatform } from "../../utils/platform.js";
@@ -56,7 +55,7 @@ const ContextMenu = ({
56
55
  ] }) })
57
56
  ] }) : /* @__PURE__ */ jsxs(Root, { onOpenChange, children: [
58
57
  trigger,
59
- /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content, { asChild: true, className: classNames(contextStyles.content), children: /* @__PURE__ */ jsx(FloatingMenu, { showTitle, title, children }) }) })
58
+ /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content, { asChild: true, children: /* @__PURE__ */ jsx(FloatingMenu, { showTitle, title, children }) }) })
60
59
  ] });
61
60
  };
62
61
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenu.js","sources":["../../../src/components/Menu/ContextMenu.tsx"],"sourcesContent":["/*\nCopyright 2023 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 FC,\n type ReactNode,\n useCallback,\n useMemo,\n useState,\n} from \"react\";\nimport {\n Root,\n Trigger,\n Portal,\n Content,\n ContextMenuItem,\n} from \"@radix-ui/react-context-menu\";\nimport { FloatingMenu } from \"./FloatingMenu\";\nimport { Drawer } from \"vaul\";\nimport classnames from \"classnames\";\nimport drawerStyles from \"./DrawerMenu.module.css\";\nimport contextStyles from \"./ContextMenu.module.css\";\nimport {\n MenuContext,\n type MenuData,\n type MenuItemWrapperProps,\n} from \"./MenuContext\";\nimport { DrawerMenu } from \"./DrawerMenu\";\nimport { getPlatform } from \"../../utils/platform\";\n\ninterface Props {\n /**\n * The menu title.\n */\n title: string;\n /**\n * Wether the title is displayed.\n * @default true\n */\n showTitle?: boolean;\n /**\n * Event handler called when the open state of the menu changes.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * The trigger that can be right-clicked or long-pressed to open the menu.\n * This must be a component that accepts a ref and spreads props.\n * https://www.radix-ui.com/primitives/docs/guides/composition\n */\n trigger: ReactNode;\n /**\n * Whether the functionality of this menu is available through some other\n * keyboard-accessible means. Preferably this should be true, because context\n * menus are potentially difficult to discover, but if false the trigger will\n * become focusable so that it can be opened via keyboard navigation.\n */\n hasAccessibleAlternative: boolean;\n /**\n * The menu contents.\n */\n children: ReactNode;\n}\n\nconst ContextMenuItemWrapper: FC<MenuItemWrapperProps> = ({\n onSelect,\n children,\n}) => (\n <ContextMenuItem onSelect={onSelect ?? undefined} asChild>\n {children}\n </ContextMenuItem>\n);\n\n/**\n * A menu opened by right-clicking or long-pressing another UI element.\n */\nexport const ContextMenu: FC<Props> = ({\n title,\n showTitle = true,\n onOpenChange: onOpenChangeProp,\n trigger: triggerProp,\n hasAccessibleAlternative,\n children: childrenProp,\n}) => {\n const [open, setOpen] = useState(false);\n const onOpenChange = useCallback(\n (value: boolean) => {\n setOpen(value);\n onOpenChangeProp?.(value);\n },\n [setOpen, onOpenChangeProp],\n );\n\n // Normally, the menu takes the form of a floating box. But on Android and\n // iOS, the menu should morph into a drawer\n const platform = getPlatform();\n const drawer = platform === \"android\" || platform === \"ios\";\n const context: MenuData = useMemo(\n () => ({\n MenuItemWrapper: drawer ? null : ContextMenuItemWrapper,\n onOpenChange,\n }),\n [onOpenChange],\n );\n const children = (\n <MenuContext.Provider value={context}>{childrenProp}</MenuContext.Provider>\n );\n\n const trigger = (\n <Trigger\n aria-haspopup=\"menu\"\n tabIndex={hasAccessibleAlternative ? undefined : 0}\n asChild\n >\n {triggerProp}\n </Trigger>\n );\n\n // This is a small hack: Vaul drawers only support buttons as triggers, so\n // we end up mounting an empty Radix context menu tree alongside the\n // drawer tree, purely so we can use its Trigger component (which supports\n // touch for free). The resulting behavior and DOM tree looks exactly the\n // same as if Vaul provided a long-press trigger of its own, so I think\n // this is fine.\n return drawer ? (\n <>\n <Root onOpenChange={onOpenChange}>{trigger}</Root>\n <Drawer.Root open={open} onOpenChange={onOpenChange}>\n <Drawer.Portal>\n <Drawer.Overlay className={classnames(drawerStyles.bg)} />\n <Drawer.Content asChild>\n <DrawerMenu title={title}>{children}</DrawerMenu>\n </Drawer.Content>\n </Drawer.Portal>\n </Drawer.Root>\n </>\n ) : (\n <Root onOpenChange={onOpenChange}>\n {trigger}\n <Portal>\n <Content asChild className={classnames(contextStyles.content)}>\n <FloatingMenu showTitle={showTitle} title={title}>\n {children}\n </FloatingMenu>\n </Content>\n </Portal>\n </Root>\n );\n};\n"],"names":["classnames","drawerStyles"],"mappings":";;;;;;;;;;;AAmEA,MAAM,yBAAmD,CAAC;AAAA,EACxD;AAAA,EACA;AACF,0BACG,iBAAA,EAAgB,UAAU,YAAY,QAAW,SAAO,MACtD,UACH;AAMK,MAAM,cAAyB,CAAC;AAAA,EACrC;AAAA,EACA,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,SAAS;AAAA,EACT;AAAA,EACA,UAAU;AACZ,MAAM;AACJ,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AACtC,QAAM,eAAe;AAAA,IACnB,CAAC,UAAmB;AAClB,cAAQ,KAAK;AACb,yBAAmB,KAAK;AAAA,IAC1B;AAAA,IACA,CAAC,SAAS,gBAAgB;AAAA,EAAA;AAK5B,QAAM,WAAW,YAAA;AACjB,QAAM,SAAS,aAAa,aAAa,aAAa;AACtD,QAAM,UAAoB;AAAA,IACxB,OAAO;AAAA,MACL,iBAAiB,SAAS,OAAO;AAAA,MACjC;AAAA,IAAA;AAAA,IAEF,CAAC,YAAY;AAAA,EAAA;AAEf,QAAM,WACJ,oBAAC,YAAY,UAAZ,EAAqB,OAAO,SAAU,UAAA,cAAa;AAGtD,QAAM,UACJ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,iBAAc;AAAA,MACd,UAAU,2BAA2B,SAAY;AAAA,MACjD,SAAO;AAAA,MAEN,UAAA;AAAA,IAAA;AAAA,EAAA;AAUL,SAAO,SACL,qBAAA,UAAA,EACE,UAAA;AAAA,IAAA,oBAAC,MAAA,EAAK,cAA6B,UAAA,QAAA,CAAQ;AAAA,IAC3C,oBAAC,OAAO,MAAP,EAAY,MAAY,cACvB,UAAA,qBAAC,OAAO,QAAP,EACC,UAAA;AAAA,MAAA,oBAAC,OAAO,SAAP,EAAe,WAAWA,WAAWC,WAAa,EAAE,GAAG;AAAA,MACxD,oBAAC,OAAO,SAAP,EAAe,SAAO,MACrB,UAAA,oBAAC,YAAA,EAAW,OAAe,SAAA,CAAS,EAAA,CACtC;AAAA,IAAA,EAAA,CACF,EAAA,CACF;AAAA,EAAA,EAAA,CACF,IAEA,qBAAC,MAAA,EAAK,cACH,UAAA;AAAA,IAAA;AAAA,wBACA,QAAA,EACC,UAAA,oBAAC,SAAA,EAAQ,SAAO,MAAC,WAAWD,WAAW,cAAc,OAAO,GAC1D,UAAA,oBAAC,cAAA,EAAa,WAAsB,OACjC,UACH,GACF,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"ContextMenu.js","sources":["../../../src/components/Menu/ContextMenu.tsx"],"sourcesContent":["/*\nCopyright 2023 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 FC,\n type ReactNode,\n useCallback,\n useMemo,\n useState,\n} from \"react\";\nimport {\n Root,\n Trigger,\n Portal,\n Content,\n ContextMenuItem,\n} from \"@radix-ui/react-context-menu\";\nimport { FloatingMenu } from \"./FloatingMenu\";\nimport { Drawer } from \"vaul\";\nimport classnames from \"classnames\";\nimport drawerStyles from \"./DrawerMenu.module.css\";\nimport {\n MenuContext,\n type MenuData,\n type MenuItemWrapperProps,\n} from \"./MenuContext\";\nimport { DrawerMenu } from \"./DrawerMenu\";\nimport { getPlatform } from \"../../utils/platform\";\n\ninterface Props {\n /**\n * The menu title.\n */\n title: string;\n /**\n * Wether the title is displayed.\n * @default true\n */\n showTitle?: boolean;\n /**\n * Event handler called when the open state of the menu changes.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * The trigger that can be right-clicked or long-pressed to open the menu.\n * This must be a component that accepts a ref and spreads props.\n * https://www.radix-ui.com/primitives/docs/guides/composition\n */\n trigger: ReactNode;\n /**\n * Whether the functionality of this menu is available through some other\n * keyboard-accessible means. Preferably this should be true, because context\n * menus are potentially difficult to discover, but if false the trigger will\n * become focusable so that it can be opened via keyboard navigation.\n */\n hasAccessibleAlternative: boolean;\n /**\n * The menu contents.\n */\n children: ReactNode;\n}\n\nconst ContextMenuItemWrapper: FC<MenuItemWrapperProps> = ({\n onSelect,\n children,\n}) => (\n <ContextMenuItem onSelect={onSelect ?? undefined} asChild>\n {children}\n </ContextMenuItem>\n);\n\n/**\n * A menu opened by right-clicking or long-pressing another UI element.\n */\nexport const ContextMenu: FC<Props> = ({\n title,\n showTitle = true,\n onOpenChange: onOpenChangeProp,\n trigger: triggerProp,\n hasAccessibleAlternative,\n children: childrenProp,\n}) => {\n const [open, setOpen] = useState(false);\n const onOpenChange = useCallback(\n (value: boolean) => {\n setOpen(value);\n onOpenChangeProp?.(value);\n },\n [setOpen, onOpenChangeProp],\n );\n\n // Normally, the menu takes the form of a floating box. But on Android and\n // iOS, the menu should morph into a drawer\n const platform = getPlatform();\n const drawer = platform === \"android\" || platform === \"ios\";\n const context: MenuData = useMemo(\n () => ({\n MenuItemWrapper: drawer ? null : ContextMenuItemWrapper,\n onOpenChange,\n }),\n [onOpenChange],\n );\n const children = (\n <MenuContext.Provider value={context}>{childrenProp}</MenuContext.Provider>\n );\n\n const trigger = (\n <Trigger\n aria-haspopup=\"menu\"\n tabIndex={hasAccessibleAlternative ? undefined : 0}\n asChild\n >\n {triggerProp}\n </Trigger>\n );\n\n // This is a small hack: Vaul drawers only support buttons as triggers, so\n // we end up mounting an empty Radix context menu tree alongside the\n // drawer tree, purely so we can use its Trigger component (which supports\n // touch for free). The resulting behavior and DOM tree looks exactly the\n // same as if Vaul provided a long-press trigger of its own, so I think\n // this is fine.\n return drawer ? (\n <>\n <Root onOpenChange={onOpenChange}>{trigger}</Root>\n <Drawer.Root open={open} onOpenChange={onOpenChange}>\n <Drawer.Portal>\n <Drawer.Overlay className={classnames(drawerStyles.bg)} />\n <Drawer.Content asChild>\n <DrawerMenu title={title}>{children}</DrawerMenu>\n </Drawer.Content>\n </Drawer.Portal>\n </Drawer.Root>\n </>\n ) : (\n <Root onOpenChange={onOpenChange}>\n {trigger}\n <Portal>\n <Content asChild>\n <FloatingMenu showTitle={showTitle} title={title}>\n {children}\n </FloatingMenu>\n </Content>\n </Portal>\n </Root>\n );\n};\n"],"names":["classnames","drawerStyles"],"mappings":";;;;;;;;;;AAkEA,MAAM,yBAAmD,CAAC;AAAA,EACxD;AAAA,EACA;AACF,0BACG,iBAAA,EAAgB,UAAU,YAAY,QAAW,SAAO,MACtD,UACH;AAMK,MAAM,cAAyB,CAAC;AAAA,EACrC;AAAA,EACA,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,SAAS;AAAA,EACT;AAAA,EACA,UAAU;AACZ,MAAM;AACJ,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AACtC,QAAM,eAAe;AAAA,IACnB,CAAC,UAAmB;AAClB,cAAQ,KAAK;AACb,yBAAmB,KAAK;AAAA,IAC1B;AAAA,IACA,CAAC,SAAS,gBAAgB;AAAA,EAAA;AAK5B,QAAM,WAAW,YAAA;AACjB,QAAM,SAAS,aAAa,aAAa,aAAa;AACtD,QAAM,UAAoB;AAAA,IACxB,OAAO;AAAA,MACL,iBAAiB,SAAS,OAAO;AAAA,MACjC;AAAA,IAAA;AAAA,IAEF,CAAC,YAAY;AAAA,EAAA;AAEf,QAAM,WACJ,oBAAC,YAAY,UAAZ,EAAqB,OAAO,SAAU,UAAA,cAAa;AAGtD,QAAM,UACJ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,iBAAc;AAAA,MACd,UAAU,2BAA2B,SAAY;AAAA,MACjD,SAAO;AAAA,MAEN,UAAA;AAAA,IAAA;AAAA,EAAA;AAUL,SAAO,SACL,qBAAA,UAAA,EACE,UAAA;AAAA,IAAA,oBAAC,MAAA,EAAK,cAA6B,UAAA,QAAA,CAAQ;AAAA,IAC3C,oBAAC,OAAO,MAAP,EAAY,MAAY,cACvB,UAAA,qBAAC,OAAO,QAAP,EACC,UAAA;AAAA,MAAA,oBAAC,OAAO,SAAP,EAAe,WAAWA,WAAWC,WAAa,EAAE,GAAG;AAAA,MACxD,oBAAC,OAAO,SAAP,EAAe,SAAO,MACrB,UAAA,oBAAC,YAAA,EAAW,OAAe,SAAA,CAAS,EAAA,CACtC;AAAA,IAAA,EAAA,CACF,EAAA,CACF;AAAA,EAAA,EAAA,CACF,IAEA,qBAAC,MAAA,EAAK,cACH,UAAA;AAAA,IAAA;AAAA,IACD,oBAAC,QAAA,EACC,UAAA,oBAAC,SAAA,EAAQ,SAAO,MACd,UAAA,oBAAC,cAAA,EAAa,WAAsB,OACjC,SAAA,CACH,EAAA,CACF,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FloatingMenu.cjs","sources":["../../../src/components/Menu/FloatingMenu.tsx"],"sourcesContent":["/*\nCopyright 2023 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 classnames from \"classnames\";\nimport React, {\n type ComponentPropsWithoutRef,\n type ReactNode,\n forwardRef,\n useId,\n} from \"react\";\nimport styles from \"./FloatingMenu.module.css\";\nimport { MenuTitle } from \"./MenuTitle.tsx\";\n\ninterface Props extends ComponentPropsWithoutRef<\"div\"> {\n /**\n * The menu title.\n */\n title: string;\n /**\n * Whether to show the title. If false, the title will be hidden but still used as a label for screen readers.\n */\n showTitle?: boolean;\n /**\n * The CSS class.\n */\n className?: string;\n /**\n * The menu contents.\n */\n children: ReactNode;\n}\n\n/**\n * A menu in a floating box, as commonly seen on desktop.\n */\n// This an internal component not intended for export! Consumers should use it\n// via the Menu or ContextMenu components.\nexport const FloatingMenu = forwardRef<HTMLDivElement, Props>(\n ({ title, showTitle = true, className, children, ...props }, ref) => {\n const titleId = useId();\n return (\n <div\n role=\"menu\"\n ref={ref}\n aria-label={showTitle ? undefined : title}\n aria-labelledby={showTitle ? titleId : undefined}\n className={classnames(className, styles.menu)}\n {...props}\n >\n {showTitle && (\n <MenuTitle className={styles.title} title={title} id={titleId} />\n )}\n {children}\n </div>\n );\n },\n);\n\nFloatingMenu.displayName = \"FloatingMenu\";\n"],"names":["forwardRef","useId","jsxs","classnames","styles","MenuTitle"],"mappings":";;;;;;;AAyCO,MAAM,eAAeA,MAAAA;AAAAA,EAC1B,CAAC,EAAE,OAAO,YAAY,MAAM,WAAW,UAAU,GAAG,MAAA,GAAS,QAAQ;AACnE,UAAM,UAAUC,MAAAA,MAAA;AAChB,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL;AAAA,QACA,cAAY,YAAY,SAAY;AAAA,QACpC,mBAAiB,YAAY,UAAU;AAAA,QACvC,WAAWC,WAAW,WAAWC,oBAAAA,QAAO,IAAI;AAAA,QAC3C,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,4CACEC,UAAAA,WAAA,EAAU,WAAWD,4BAAO,OAAO,OAAc,IAAI,SAAS;AAAA,UAEhE;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,aAAa,cAAc;;"}
1
+ {"version":3,"file":"FloatingMenu.cjs","sources":["../../../src/components/Menu/FloatingMenu.tsx"],"sourcesContent":["/*\nCopyright 2023 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 classnames from \"classnames\";\nimport React, {\n type ComponentPropsWithoutRef,\n type ReactNode,\n forwardRef,\n useId,\n} from \"react\";\nimport styles from \"./FloatingMenu.module.css\";\nimport { MenuTitle } from \"./MenuTitle.tsx\";\n\ninterface Props extends ComponentPropsWithoutRef<\"div\"> {\n /**\n * The menu title.\n */\n title: string;\n /**\n * Whether to show the title. If false, the title will be hidden but still used as a label for screen readers.\n */\n showTitle?: boolean;\n /**\n * The CSS class.\n */\n className?: string;\n /**\n * The menu contents.\n */\n children: ReactNode;\n}\n\n/**\n * A menu in a floating box, as commonly seen on desktop.\n */\n// This an internal component not intended for export! Consumers should use it\n// via the Menu or ContextMenu components.\nexport const FloatingMenu = forwardRef<HTMLDivElement, Props>(\n ({ title, showTitle = true, className, children, ...props }, ref) => {\n const titleId = useId();\n\n return (\n <div\n role=\"menu\"\n ref={ref}\n aria-label={showTitle ? undefined : title}\n aria-labelledby={showTitle ? titleId : undefined}\n className={classnames(className, styles.menu)}\n {...props}\n >\n {showTitle && (\n <MenuTitle className={styles.title} title={title} id={titleId} />\n )}\n {children}\n </div>\n );\n },\n);\n\nFloatingMenu.displayName = \"FloatingMenu\";\n"],"names":["forwardRef","useId","jsxs","classnames","styles","MenuTitle"],"mappings":";;;;;;;AAyCO,MAAM,eAAeA,MAAAA;AAAAA,EAC1B,CAAC,EAAE,OAAO,YAAY,MAAM,WAAW,UAAU,GAAG,MAAA,GAAS,QAAQ;AACnE,UAAM,UAAUC,MAAAA,MAAA;AAEhB,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL;AAAA,QACA,cAAY,YAAY,SAAY;AAAA,QACpC,mBAAiB,YAAY,UAAU;AAAA,QACvC,WAAWC,WAAW,WAAWC,oBAAAA,QAAO,IAAI;AAAA,QAC3C,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,4CACEC,UAAAA,WAAA,EAAU,WAAWD,4BAAO,OAAO,OAAc,IAAI,SAAS;AAAA,UAEhE;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,aAAa,cAAc;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FloatingMenu.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/FloatingMenu.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EACZ,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAIf,UAAU,KAAM,SAAQ,wBAAwB,CAAC,KAAK,CAAC;IACrD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;GAEG;AAGH,eAAO,MAAM,YAAY,8EAmBxB,CAAC"}
1
+ {"version":3,"file":"FloatingMenu.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/FloatingMenu.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EACZ,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAIf,UAAU,KAAM,SAAQ,wBAAwB,CAAC,KAAK,CAAC;IACrD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;GAEG;AAGH,eAAO,MAAM,YAAY,8EAoBxB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"FloatingMenu.js","sources":["../../../src/components/Menu/FloatingMenu.tsx"],"sourcesContent":["/*\nCopyright 2023 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 classnames from \"classnames\";\nimport React, {\n type ComponentPropsWithoutRef,\n type ReactNode,\n forwardRef,\n useId,\n} from \"react\";\nimport styles from \"./FloatingMenu.module.css\";\nimport { MenuTitle } from \"./MenuTitle.tsx\";\n\ninterface Props extends ComponentPropsWithoutRef<\"div\"> {\n /**\n * The menu title.\n */\n title: string;\n /**\n * Whether to show the title. If false, the title will be hidden but still used as a label for screen readers.\n */\n showTitle?: boolean;\n /**\n * The CSS class.\n */\n className?: string;\n /**\n * The menu contents.\n */\n children: ReactNode;\n}\n\n/**\n * A menu in a floating box, as commonly seen on desktop.\n */\n// This an internal component not intended for export! Consumers should use it\n// via the Menu or ContextMenu components.\nexport const FloatingMenu = forwardRef<HTMLDivElement, Props>(\n ({ title, showTitle = true, className, children, ...props }, ref) => {\n const titleId = useId();\n return (\n <div\n role=\"menu\"\n ref={ref}\n aria-label={showTitle ? undefined : title}\n aria-labelledby={showTitle ? titleId : undefined}\n className={classnames(className, styles.menu)}\n {...props}\n >\n {showTitle && (\n <MenuTitle className={styles.title} title={title} id={titleId} />\n )}\n {children}\n </div>\n );\n },\n);\n\nFloatingMenu.displayName = \"FloatingMenu\";\n"],"names":["classnames"],"mappings":";;;;;AAyCO,MAAM,eAAe;AAAA,EAC1B,CAAC,EAAE,OAAO,YAAY,MAAM,WAAW,UAAU,GAAG,MAAA,GAAS,QAAQ;AACnE,UAAM,UAAU,MAAA;AAChB,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL;AAAA,QACA,cAAY,YAAY,SAAY;AAAA,QACpC,mBAAiB,YAAY,UAAU;AAAA,QACvC,WAAWA,WAAW,WAAW,OAAO,IAAI;AAAA,QAC3C,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,iCACE,WAAA,EAAU,WAAW,OAAO,OAAO,OAAc,IAAI,SAAS;AAAA,UAEhE;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,aAAa,cAAc;"}
1
+ {"version":3,"file":"FloatingMenu.js","sources":["../../../src/components/Menu/FloatingMenu.tsx"],"sourcesContent":["/*\nCopyright 2023 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 classnames from \"classnames\";\nimport React, {\n type ComponentPropsWithoutRef,\n type ReactNode,\n forwardRef,\n useId,\n} from \"react\";\nimport styles from \"./FloatingMenu.module.css\";\nimport { MenuTitle } from \"./MenuTitle.tsx\";\n\ninterface Props extends ComponentPropsWithoutRef<\"div\"> {\n /**\n * The menu title.\n */\n title: string;\n /**\n * Whether to show the title. If false, the title will be hidden but still used as a label for screen readers.\n */\n showTitle?: boolean;\n /**\n * The CSS class.\n */\n className?: string;\n /**\n * The menu contents.\n */\n children: ReactNode;\n}\n\n/**\n * A menu in a floating box, as commonly seen on desktop.\n */\n// This an internal component not intended for export! Consumers should use it\n// via the Menu or ContextMenu components.\nexport const FloatingMenu = forwardRef<HTMLDivElement, Props>(\n ({ title, showTitle = true, className, children, ...props }, ref) => {\n const titleId = useId();\n\n return (\n <div\n role=\"menu\"\n ref={ref}\n aria-label={showTitle ? undefined : title}\n aria-labelledby={showTitle ? titleId : undefined}\n className={classnames(className, styles.menu)}\n {...props}\n >\n {showTitle && (\n <MenuTitle className={styles.title} title={title} id={titleId} />\n )}\n {children}\n </div>\n );\n },\n);\n\nFloatingMenu.displayName = \"FloatingMenu\";\n"],"names":["classnames"],"mappings":";;;;;AAyCO,MAAM,eAAe;AAAA,EAC1B,CAAC,EAAE,OAAO,YAAY,MAAM,WAAW,UAAU,GAAG,MAAA,GAAS,QAAQ;AACnE,UAAM,UAAU,MAAA;AAEhB,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL;AAAA,QACA,cAAY,YAAY,SAAY;AAAA,QACpC,mBAAiB,YAAY,UAAU;AAAA,QACvC,WAAWA,WAAW,WAAW,OAAO,IAAI;AAAA,QAC3C,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,iCACE,WAAA,EAAU,WAAW,OAAO,OAAO,OAAc,IAAI,SAAS;AAAA,UAEhE;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,aAAa,cAAc;"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const menu = "_menu_1glhz_8";
4
- const title = "_title_1glhz_74";
3
+ const menu = "_menu_1w1u7_8";
4
+ const title = "_title_1w1u7_63";
5
5
  const styles = {
6
6
  menu,
7
7
  title
@@ -1,5 +1,5 @@
1
- const menu = "_menu_1glhz_8";
2
- const title = "_title_1glhz_74";
1
+ const menu = "_menu_1w1u7_8";
2
+ const title = "_title_1w1u7_63";
3
3
  const styles = {
4
4
  menu,
5
5
  title
package/dist/style.css CHANGED
@@ -647,7 +647,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
647
647
  Please see LICENSE files in the repository root for full details.
648
648
  */
649
649
 
650
- ._menu_1glhz_8 {
650
+ ._menu_1w1u7_8 {
651
651
  border-radius: var(--cpd-space-3x);
652
652
  background: var(--cpd-color-bg-canvas-default);
653
653
 
@@ -669,51 +669,40 @@ Please see LICENSE files in the repository root for full details.
669
669
  --cpd-separator-inset: var(--cpd-space-4x);
670
670
  }
671
671
 
672
- @keyframes _slide-in_1glhz_1 {
672
+ @keyframes _slide-in_1w1u7_1 {
673
673
  from {
674
674
  opacity: 0;
675
675
  transform: translate(0, var(--cpd-space-3x));
676
676
  }
677
677
  }
678
678
 
679
- @keyframes _slide-out_1glhz_1 {
680
- to {
681
- opacity: 0;
682
- transform: translate(0, var(--cpd-space-2x));
683
- }
679
+ ._menu_1w1u7_8[data-state="open"] {
680
+ animation: _slide-in_1w1u7_1 180ms;
684
681
  }
685
682
 
686
- ._menu_1glhz_8[data-state="open"] {
687
- animation: _slide-in_1glhz_1 180ms;
688
- }
689
-
690
- ._menu_1glhz_8[data-state="closed"] {
691
- animation: _slide-out_1glhz_1 110ms;
692
- }
693
-
694
- @keyframes _fade-in_1glhz_1 {
683
+ @keyframes _fade-in_1w1u7_1 {
695
684
  from {
696
685
  opacity: 0;
697
686
  }
698
687
  }
699
688
 
700
- @keyframes _fade-out_1glhz_1 {
689
+ @keyframes _fade-out_1w1u7_1 {
701
690
  to {
702
691
  opacity: 0;
703
692
  }
704
693
  }
705
694
 
706
695
  @media (prefers-reduced-motion) {
707
- ._menu_1glhz_8[data-state="open"] {
708
- animation-name: _fade-in_1glhz_1;
696
+ ._menu_1w1u7_8[data-state="open"] {
697
+ animation-name: _fade-in_1w1u7_1;
709
698
  }
710
699
 
711
- ._menu_1glhz_8[data-state="closed"] {
712
- animation-name: _fade-out_1glhz_1;
700
+ ._menu_1w1u7_8[data-state="closed"] {
701
+ animation-name: _fade-out_1w1u7_1;
713
702
  }
714
703
  }
715
704
 
716
- ._title_1glhz_74 {
705
+ ._title_1w1u7_63 {
717
706
  /** Override MenuTitle margin top **/
718
707
  margin-block-start: 0 !important;
719
708
  }
@@ -809,16 +798,6 @@ Please see LICENSE files in the repository root for full details.
809
798
  background: var(--cpd-color-icon-secondary);
810
799
  border-radius: var(--cpd-radius-pill-effect);
811
800
  }
812
- /*
813
- * Copyright 2025 New Vector Ltd
814
- *
815
- * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
816
- * Please see LICENSE files in the repository root for full details.
817
- */
818
-
819
- ._content_vnv5k_8[data-state="closed"] {
820
- animation: none;
821
- }
822
801
  /*
823
802
  Copyright 2023 New Vector Ltd.
824
803
 
@@ -1027,7 +1006,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
1027
1006
  Please see LICENSE files in the repository root for full details.
1028
1007
  */
1029
1008
 
1030
- ._container_1qhtc_10 {
1009
+ ._container_1ug7n_10 {
1031
1010
  --size: 20px;
1032
1011
 
1033
1012
  display: grid;
@@ -1035,21 +1014,21 @@ Please see LICENSE files in the repository root for full details.
1035
1014
  block-size: var(--size);
1036
1015
  }
1037
1016
 
1038
- ._input_1qhtc_18,
1039
- ._ui_1qhtc_19 {
1017
+ ._input_1ug7n_18,
1018
+ ._ui_1ug7n_19 {
1040
1019
  box-sizing: border-box;
1041
1020
  grid-area: 1/1;
1042
1021
  inline-size: var(--size);
1043
1022
  block-size: var(--size);
1044
1023
  }
1045
1024
 
1046
- ._input_1qhtc_18 {
1025
+ ._input_1ug7n_18 {
1047
1026
  opacity: 0;
1048
1027
  margin: 0;
1049
1028
  cursor: pointer;
1050
1029
  }
1051
1030
 
1052
- ._ui_1qhtc_19 {
1031
+ ._ui_1ug7n_19 {
1053
1032
  pointer-events: none;
1054
1033
  border-radius: 50%;
1055
1034
  border: 1px solid;
@@ -1061,7 +1040,7 @@ Please see LICENSE files in the repository root for full details.
1061
1040
  justify-content: center;
1062
1041
  }
1063
1042
 
1064
- ._ui_1qhtc_19::after {
1043
+ ._ui_1ug7n_19::after {
1065
1044
  content: "";
1066
1045
  inline-size: 6px;
1067
1046
  block-size: 6px;
@@ -1074,78 +1053,82 @@ Please see LICENSE files in the repository root for full details.
1074
1053
  color: transparent;
1075
1054
  }
1076
1055
 
1077
- ._input_1qhtc_18:checked + ._ui_1qhtc_19 {
1056
+ ._input_1ug7n_18:checked + ._ui_1ug7n_19 {
1078
1057
  background-color: var(--cpd-color-bg-accent-rest);
1079
1058
  border-color: var(--cpd-color-bg-accent-rest);
1080
1059
  color: unset;
1081
1060
  }
1082
1061
 
1083
- ._input_1qhtc_18:checked + ._ui_1qhtc_19::after {
1062
+ ._input_1ug7n_18:checked + ._ui_1ug7n_19::after {
1084
1063
  background: var(--cpd-color-icon-on-solid-primary);
1085
1064
  border-color: var(--cpd-color-icon-on-solid-primary);
1086
1065
  color: unset;
1087
1066
  }
1088
1067
 
1089
- ._input_1qhtc_18:focus-visible + ._ui_1qhtc_19 {
1068
+ ._input_1ug7n_18:focus-visible + ._ui_1ug7n_19 {
1090
1069
  outline: 2px solid var(--cpd-color-border-focused);
1091
1070
  outline-offset: 1px;
1092
1071
  }
1093
1072
 
1094
- ._input_1qhtc_18[readonly] {
1073
+ ._input_1ug7n_18[readonly] {
1095
1074
  pointer-events: none;
1096
1075
  }
1097
1076
 
1098
- ._input_1qhtc_18[readonly] + ._ui_1qhtc_19 {
1077
+ ._input_1ug7n_18[readonly] + ._ui_1ug7n_19 {
1099
1078
  border-color: var(--cpd-color-border-interactive-secondary);
1100
1079
  background: var(--cpd-color-bg-subtle-secondary);
1101
1080
  }
1102
1081
 
1103
- ._input_1qhtc_18[disabled] + ._ui_1qhtc_19 {
1082
+ ._input_1ug7n_18[disabled] {
1083
+ cursor: not-allowed;
1084
+ }
1085
+
1086
+ ._input_1ug7n_18[disabled] + ._ui_1ug7n_19 {
1104
1087
  border-color: var(--cpd-color-border-disabled);
1105
1088
  background: var(--cpd-color-bg-canvas-disabled);
1106
1089
  }
1107
1090
 
1108
- ._input_1qhtc_18[disabled]:checked + ._ui_1qhtc_19 {
1091
+ ._input_1ug7n_18[disabled]:checked + ._ui_1ug7n_19 {
1109
1092
  border-color: var(--cpd-color-bg-action-primary-disabled);
1110
1093
  background: var(--cpd-color-bg-action-primary-disabled);
1111
1094
  }
1112
1095
 
1113
- ._input_1qhtc_18[readonly]:checked + ._ui_1qhtc_19::after {
1096
+ ._input_1ug7n_18[readonly]:checked + ._ui_1ug7n_19::after {
1114
1097
  background-color: var(--cpd-color-icon-secondary);
1115
1098
  border-color: var(--cpd-color-icon-secondary);
1116
1099
  color: unset;
1117
1100
  }
1118
1101
 
1119
1102
  @media (hover) {
1120
- ._input_1qhtc_18:not([disabled], [readonly], :checked):hover + ._ui_1qhtc_19 {
1103
+ ._input_1ug7n_18:not([disabled], [readonly], :checked):hover + ._ui_1ug7n_19 {
1121
1104
  border-color: var(--cpd-color-bg-accent-hovered);
1122
1105
 
1123
1106
  /** TODO: have the shadow in the design tokens */
1124
1107
  box-shadow: 0 1.2px 2.4px 0 rgb(0 0 0 / 15%);
1125
1108
  }
1126
1109
 
1127
- ._input_1qhtc_18:not([disabled], [readonly], :checked):hover + ._ui_1qhtc_19::after {
1110
+ ._input_1ug7n_18:not([disabled], [readonly], :checked):hover + ._ui_1ug7n_19::after {
1128
1111
  background: var(--cpd-color-icon-quaternary);
1129
1112
  border-color: var(--cpd-color-icon-quaternary);
1130
1113
  color: unset;
1131
1114
  }
1132
1115
 
1133
- ._input_1qhtc_18:not([disabled], [readonly]):checked:hover + ._ui_1qhtc_19 {
1116
+ ._input_1ug7n_18:not([disabled], [readonly]):checked:hover + ._ui_1ug7n_19 {
1134
1117
  border-color: var(--cpd-color-bg-accent-hovered);
1135
1118
  background: var(--cpd-color-bg-accent-hovered);
1136
1119
  }
1137
1120
 
1138
- ._input_1qhtc_18[data-invalid]:not([disabled], [readonly]):checked:hover + ._ui_1qhtc_19 {
1121
+ ._input_1ug7n_18[data-invalid]:not([disabled], [readonly]):checked:hover + ._ui_1ug7n_19 {
1139
1122
  border-color: var(--cpd-color-bg-critical-hovered);
1140
1123
  background: var(--cpd-color-bg-critical-hovered);
1141
1124
  }
1142
1125
  }
1143
1126
 
1144
- ._input_1qhtc_18[data-invalid]:not([disabled], [readonly], :checked) + ._ui_1qhtc_19 {
1127
+ ._input_1ug7n_18[data-invalid]:not([disabled], [readonly], :checked) + ._ui_1ug7n_19 {
1145
1128
  border-color: var(--cpd-color-border-critical-primary);
1146
1129
  }
1147
1130
 
1148
- ._input_1qhtc_18[data-invalid]:not([disabled], [readonly]):checked + ._ui_1qhtc_19 {
1131
+ ._input_1ug7n_18[data-invalid]:not([disabled], [readonly]):checked + ._ui_1ug7n_19 {
1149
1132
  background-color: var(--cpd-color-bg-critical-primary);
1150
1133
  border-color: var(--cpd-color-bg-critical-primary);
1151
1134
  }
@@ -1618,7 +1601,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
1618
1601
  Please see LICENSE files in the repository root for full details.
1619
1602
  */
1620
1603
 
1621
- ._container_1md5v_10 {
1604
+ ._container_153f2_10 {
1622
1605
  --size: 20px;
1623
1606
 
1624
1607
  display: grid;
@@ -1626,28 +1609,28 @@ Please see LICENSE files in the repository root for full details.
1626
1609
  block-size: var(--size);
1627
1610
  }
1628
1611
 
1629
- ._input_1md5v_18,
1630
- ._ui_1md5v_19 {
1612
+ ._input_153f2_18,
1613
+ ._ui_153f2_19 {
1631
1614
  box-sizing: border-box;
1632
1615
  grid-area: 1/1;
1633
1616
  inline-size: var(--size);
1634
1617
  block-size: var(--size);
1635
1618
  }
1636
1619
 
1637
- ._input_1md5v_18 {
1620
+ ._input_153f2_18 {
1638
1621
  opacity: 0;
1639
1622
  margin: 0;
1640
1623
  cursor: pointer;
1641
1624
  }
1642
1625
 
1643
- ._ui_1md5v_19 {
1626
+ ._ui_153f2_19 {
1644
1627
  pointer-events: none;
1645
1628
  border-radius: 4px; /* TODO: Ought to be a token */
1646
1629
  border: 1px solid;
1647
1630
  border-color: var(--cpd-color-border-interactive-primary);
1648
1631
  }
1649
1632
 
1650
- ._ui_1md5v_19 svg {
1633
+ ._ui_153f2_19 svg {
1651
1634
  inline-size: var(--size);
1652
1635
  block-size: var(--size);
1653
1636
 
@@ -1658,71 +1641,75 @@ Please see LICENSE files in the repository root for full details.
1658
1641
  color: transparent;
1659
1642
  }
1660
1643
 
1661
- ._input_1md5v_18:checked + ._ui_1md5v_19 {
1644
+ ._input_153f2_18:checked + ._ui_153f2_19 {
1662
1645
  background-color: var(--cpd-color-bg-accent-rest);
1663
1646
  border-color: var(--cpd-color-bg-accent-rest);
1664
1647
  }
1665
1648
 
1666
- ._input_1md5v_18:checked + ._ui_1md5v_19 svg {
1649
+ ._input_153f2_18:checked + ._ui_153f2_19 svg {
1667
1650
  color: var(--cpd-color-icon-on-solid-primary);
1668
1651
  }
1669
1652
 
1670
- ._input_1md5v_18:focus-visible + ._ui_1md5v_19 {
1653
+ ._input_153f2_18:focus-visible + ._ui_153f2_19 {
1671
1654
  outline: 2px solid var(--cpd-color-border-focused);
1672
1655
  outline-offset: 1px;
1673
1656
  }
1674
1657
 
1675
- ._input_1md5v_18[disabled] + ._ui_1md5v_19 {
1658
+ ._input_153f2_18[disabled] {
1659
+ cursor: not-allowed;
1660
+ }
1661
+
1662
+ ._input_153f2_18[disabled] + ._ui_153f2_19 {
1676
1663
  border-color: var(--cpd-color-border-disabled);
1677
1664
  background: var(--cpd-color-bg-canvas-disabled);
1678
1665
  }
1679
1666
 
1680
- ._input_1md5v_18[readonly] {
1667
+ ._input_153f2_18[readonly] {
1681
1668
  pointer-events: none;
1682
1669
  }
1683
1670
 
1684
- ._input_1md5v_18[readonly] + ._ui_1md5v_19 {
1671
+ ._input_153f2_18[readonly] + ._ui_153f2_19 {
1685
1672
  border-color: var(--cpd-color-border-interactive-secondary);
1686
1673
  background: var(--cpd-color-bg-subtle-secondary);
1687
1674
  }
1688
1675
 
1689
- ._input_1md5v_18[disabled]:checked + ._ui_1md5v_19 {
1676
+ ._input_153f2_18[disabled]:checked + ._ui_153f2_19 {
1690
1677
  border-color: var(--cpd-color-bg-action-primary-disabled);
1691
1678
  background: var(--cpd-color-bg-action-primary-disabled);
1692
1679
  }
1693
1680
 
1694
- ._input_1md5v_18[readonly]:checked + ._ui_1md5v_19 svg {
1681
+ ._input_153f2_18[readonly]:checked + ._ui_153f2_19 svg {
1695
1682
  color: var(--cpd-color-icon-secondary);
1696
1683
  }
1697
1684
 
1698
1685
  @media (hover) {
1699
- ._input_1md5v_18:not([disabled], [readonly], :checked):hover + ._ui_1md5v_19 {
1686
+ ._input_153f2_18:not([disabled], [readonly], :checked):hover + ._ui_153f2_19 {
1700
1687
  border-color: var(--cpd-color-bg-accent-hovered);
1701
1688
 
1702
1689
  /** TODO: have the shadow in the design tokens */
1703
1690
  box-shadow: 0 1.2px 2.4px 0 rgb(0 0 0 / 15%);
1704
1691
  }
1705
1692
 
1706
- ._input_1md5v_18:not([disabled], [readonly], :checked):hover + ._ui_1md5v_19 svg {
1693
+ ._input_153f2_18:not([disabled], [readonly], :checked):hover + ._ui_153f2_19 svg {
1707
1694
  color: var(--cpd-color-icon-quaternary);
1708
1695
  }
1709
1696
 
1710
- ._input_1md5v_18:not([disabled], [readonly]):checked:hover + ._ui_1md5v_19 {
1697
+ ._input_153f2_18:not([disabled], [readonly]):checked:hover + ._ui_153f2_19 {
1711
1698
  border-color: var(--cpd-color-bg-accent-hovered);
1712
1699
  background: var(--cpd-color-bg-accent-hovered);
1713
1700
  }
1714
1701
 
1715
- ._input_1md5v_18[data-invalid]:not([disabled], [readonly]):checked:hover + ._ui_1md5v_19 {
1702
+ ._input_153f2_18[data-invalid]:not([disabled], [readonly]):checked:hover + ._ui_153f2_19 {
1716
1703
  border-color: var(--cpd-color-bg-critical-hovered);
1717
1704
  background: var(--cpd-color-bg-critical-hovered);
1718
1705
  }
1719
1706
  }
1720
1707
 
1721
- ._input_1md5v_18[data-invalid]:not([disabled], :checked, [readonly]) + ._ui_1md5v_19 {
1708
+ ._input_153f2_18[data-invalid]:not([disabled], :checked, [readonly]) + ._ui_153f2_19 {
1722
1709
  border-color: var(--cpd-color-border-critical-primary);
1723
1710
  }
1724
1711
 
1725
- ._input_1md5v_18[data-invalid]:not([disabled], [readonly]):checked + ._ui_1md5v_19 {
1712
+ ._input_153f2_18[data-invalid]:not([disabled], [readonly]):checked + ._ui_153f2_19 {
1726
1713
  background-color: var(--cpd-color-bg-critical-primary);
1727
1714
  border-color: var(--cpd-color-bg-critical-primary);
1728
1715
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vector-im/compound-web",
3
- "version": "8.3.5",
3
+ "version": "8.3.6",
4
4
  "description": "Compound components for the Web",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -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/node22": "^22.0.0",
68
+ "@tsconfig/node24": "^24.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,15 +83,15 @@
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.7.4",
86
+ "prettier": "3.8.0",
87
87
  "react": "^19.1.0",
88
88
  "react-dom": "^19.1.0",
89
89
  "resize-observer-polyfill": "^1.5.1",
90
90
  "rimraf": "^6.0.0",
91
91
  "serve": "^14.2.1",
92
92
  "storybook": "^10.0.0",
93
- "stylelint": "^16.13.2",
94
- "stylelint-config-standard": "^39.0.0",
93
+ "stylelint": "^17.0.0",
94
+ "stylelint-config-standard": "^40.0.0",
95
95
  "stylelint-plugin-defensive-css": "^1.0.0",
96
96
  "stylelint-use-logical": "^2.1.0",
97
97
  "stylelint-value-no-unknown-custom-properties": "^6.0.0",
@@ -61,6 +61,10 @@ Please see LICENSE files in the repository root for full details.
61
61
  outline-offset: 1px;
62
62
  }
63
63
 
64
+ .input[disabled] {
65
+ cursor: not-allowed;
66
+ }
67
+
64
68
  .input[disabled] + .ui {
65
69
  border-color: var(--cpd-color-border-disabled);
66
70
  background: var(--cpd-color-bg-canvas-disabled);
@@ -80,6 +80,10 @@ Please see LICENSE files in the repository root for full details.
80
80
  background: var(--cpd-color-bg-subtle-secondary);
81
81
  }
82
82
 
83
+ .input[disabled] {
84
+ cursor: not-allowed;
85
+ }
86
+
83
87
  .input[disabled] + .ui {
84
88
  border-color: var(--cpd-color-border-disabled);
85
89
  background: var(--cpd-color-bg-canvas-disabled);
@@ -23,7 +23,6 @@ import { FloatingMenu } from "./FloatingMenu";
23
23
  import { Drawer } from "vaul";
24
24
  import classnames from "classnames";
25
25
  import drawerStyles from "./DrawerMenu.module.css";
26
- import contextStyles from "./ContextMenu.module.css";
27
26
  import {
28
27
  MenuContext,
29
28
  type MenuData,
@@ -141,7 +140,7 @@ export const ContextMenu: FC<Props> = ({
141
140
  <Root onOpenChange={onOpenChange}>
142
141
  {trigger}
143
142
  <Portal>
144
- <Content asChild className={classnames(contextStyles.content)}>
143
+ <Content asChild>
145
144
  <FloatingMenu showTitle={showTitle} title={title}>
146
145
  {children}
147
146
  </FloatingMenu>
@@ -34,21 +34,10 @@ Please see LICENSE files in the repository root for full details.
34
34
  }
35
35
  }
36
36
 
37
- @keyframes slide-out {
38
- to {
39
- opacity: 0;
40
- transform: translate(0, var(--cpd-space-2x));
41
- }
42
- }
43
-
44
37
  .menu[data-state="open"] {
45
38
  animation: slide-in 180ms;
46
39
  }
47
40
 
48
- .menu[data-state="closed"] {
49
- animation: slide-out 110ms;
50
- }
51
-
52
41
  @keyframes fade-in {
53
42
  from {
54
43
  opacity: 0;
@@ -42,6 +42,7 @@ interface Props extends ComponentPropsWithoutRef<"div"> {
42
42
  export const FloatingMenu = forwardRef<HTMLDivElement, Props>(
43
43
  ({ title, showTitle = true, className, children, ...props }, ref) => {
44
44
  const titleId = useId();
45
+
45
46
  return (
46
47
  <div
47
48
  role="menu"
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const content = "_content_vnv5k_8";
4
- const contextStyles = {
5
- content
6
- };
7
- exports.content = content;
8
- exports.default = contextStyles;
9
- //# sourceMappingURL=ContextMenu.module.css.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContextMenu.module.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -1,9 +0,0 @@
1
- const content = "_content_vnv5k_8";
2
- const contextStyles = {
3
- content
4
- };
5
- export {
6
- content,
7
- contextStyles as default
8
- };
9
- //# sourceMappingURL=ContextMenu.module.css.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContextMenu.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,10 +0,0 @@
1
- /*
2
- * Copyright 2025 New Vector Ltd
3
- *
4
- * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
5
- * Please see LICENSE files in the repository root for full details.
6
- */
7
-
8
- .content[data-state="closed"] {
9
- animation: none;
10
- }