@gnome-ui/react 1.47.0 → 1.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +2 -0
  2. package/dist/components/AvatarGroup/AvatarGroup.cjs +2 -0
  3. package/dist/components/AvatarGroup/AvatarGroup.cjs.map +1 -0
  4. package/dist/components/AvatarGroup/AvatarGroup.d.ts +16 -0
  5. package/dist/components/AvatarGroup/AvatarGroup.js +36 -0
  6. package/dist/components/AvatarGroup/AvatarGroup.js.map +1 -0
  7. package/dist/components/AvatarGroup/AvatarGroup.module.css.cjs +2 -0
  8. package/dist/components/AvatarGroup/AvatarGroup.module.css.cjs.map +1 -0
  9. package/dist/components/AvatarGroup/AvatarGroup.module.css.js +13 -0
  10. package/dist/components/AvatarGroup/AvatarGroup.module.css.js.map +1 -0
  11. package/dist/components/AvatarGroup/index.d.ts +2 -0
  12. package/dist/components/AvatarGroup.cjs +1 -0
  13. package/dist/components/AvatarGroup.d.ts +2 -0
  14. package/dist/components/AvatarGroup.js +2 -0
  15. package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
  16. package/dist/components/BottomSheet/BottomSheet.cjs.map +1 -1
  17. package/dist/components/BottomSheet/BottomSheet.d.ts +3 -3
  18. package/dist/components/BottomSheet/BottomSheet.js +72 -31
  19. package/dist/components/BottomSheet/BottomSheet.js.map +1 -1
  20. package/dist/components/BottomSheet/BottomSheet.module.css.cjs +1 -1
  21. package/dist/components/BottomSheet/BottomSheet.module.css.cjs.map +1 -1
  22. package/dist/components/BottomSheet/BottomSheet.module.css.js +13 -8
  23. package/dist/components/BottomSheet/BottomSheet.module.css.js.map +1 -1
  24. package/dist/components/EntryRow/EntryRow.module.css.cjs +1 -1
  25. package/dist/components/EntryRow/EntryRow.module.css.cjs.map +1 -1
  26. package/dist/components/EntryRow/EntryRow.module.css.js +10 -10
  27. package/dist/components/EntryRow/EntryRow.module.css.js.map +1 -1
  28. package/dist/components/Icon/Icon.cjs +1 -1
  29. package/dist/components/Icon/Icon.cjs.map +1 -1
  30. package/dist/components/Icon/Icon.d.ts +8 -1
  31. package/dist/components/Icon/Icon.js +22 -20
  32. package/dist/components/Icon/Icon.js.map +1 -1
  33. package/dist/components/Icon/Icon.module.css.cjs +2 -0
  34. package/dist/components/Icon/Icon.module.css.cjs.map +1 -0
  35. package/dist/components/Icon/Icon.module.css.js +14 -0
  36. package/dist/components/Icon/Icon.module.css.js.map +1 -0
  37. package/dist/components/Icon/index.d.ts +1 -1
  38. package/dist/components/InlineViewSwitcher/InlineViewSwitcher.cjs +1 -1
  39. package/dist/components/InlineViewSwitcher/InlineViewSwitcher.cjs.map +1 -1
  40. package/dist/components/InlineViewSwitcher/InlineViewSwitcher.d.ts +11 -1
  41. package/dist/components/InlineViewSwitcher/InlineViewSwitcher.js +136 -24
  42. package/dist/components/InlineViewSwitcher/InlineViewSwitcher.js.map +1 -1
  43. package/dist/components/InlineViewSwitcher/InlineViewSwitcher.module.css.cjs +1 -1
  44. package/dist/components/InlineViewSwitcher/InlineViewSwitcher.module.css.cjs.map +1 -1
  45. package/dist/components/InlineViewSwitcher/InlineViewSwitcher.module.css.js +22 -10
  46. package/dist/components/InlineViewSwitcher/InlineViewSwitcher.module.css.js.map +1 -1
  47. package/dist/components/InlineViewSwitcher/InlineViewSwitcherItem.cjs +1 -1
  48. package/dist/components/InlineViewSwitcher/InlineViewSwitcherItem.cjs.map +1 -1
  49. package/dist/components/InlineViewSwitcher/InlineViewSwitcherItem.d.ts +4 -1
  50. package/dist/components/InlineViewSwitcher/InlineViewSwitcherItem.js +7 -6
  51. package/dist/components/InlineViewSwitcher/InlineViewSwitcherItem.js.map +1 -1
  52. package/dist/components/InlineViewSwitcher/index.d.ts +1 -1
  53. package/dist/components/Modal/Modal.cjs +2 -0
  54. package/dist/components/Modal/Modal.cjs.map +1 -0
  55. package/dist/components/Modal/Modal.d.ts +40 -0
  56. package/dist/components/Modal/Modal.js +93 -0
  57. package/dist/components/Modal/Modal.js.map +1 -0
  58. package/dist/components/Modal/Modal.module.css.cjs +2 -0
  59. package/dist/components/Modal/Modal.module.css.cjs.map +1 -0
  60. package/dist/components/Modal/Modal.module.css.js +23 -0
  61. package/dist/components/Modal/Modal.module.css.js.map +1 -0
  62. package/dist/components/Modal/index.d.ts +2 -0
  63. package/dist/components/Modal.cjs +1 -0
  64. package/dist/components/Modal.d.ts +2 -0
  65. package/dist/components/Modal.js +2 -0
  66. package/dist/index.cjs +1 -1
  67. package/dist/index.d.ts +5 -1
  68. package/dist/index.js +95 -93
  69. package/dist/style.css +1 -1
  70. package/package.json +11 -1
@@ -1,2 +1,2 @@
1
- let e=require("react/jsx-runtime");var t={sm:12,md:16,lg:20};function n(e){return`paths`in e&&Array.isArray(e.paths)}var r=({icon:r,size:i=`md`,label:a,width:o,height:s,...c})=>{let l=t[i],u=n(r)?r.viewBox:r.viewBox??`0 0 24 24`,d=n(r)?r.paths.map((t,n)=>(0,e.jsx)(`path`,{d:t.d,fillRule:t.fillRule,clipRule:t.clipRule,transform:t.transform},n)):[(0,e.jsx)(`path`,{d:r.path},0)];return(0,e.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:u,width:o??l,height:s??l,fill:`currentColor`,"aria-label":a,"aria-hidden":a?void 0:!0,role:a?`img`:void 0,focusable:`false`,...c,children:d})};exports.Icon=r;
1
+ const e=require("./Icon.module.css.cjs");let t=require("react/jsx-runtime");var n={sm:12,md:16,lg:20};function r(e){return`paths`in e&&Array.isArray(e.paths)}var i=({icon:i,size:a=`md`,label:o,width:s,height:c,color:l,className:u,...d})=>{let f=n[a],p=r(i)?i.viewBox:i.viewBox??`0 0 24 24`,m=r(i)?i.paths.map((e,n)=>(0,t.jsx)(`path`,{d:e.d,fillRule:e.fillRule,clipRule:e.clipRule,transform:e.transform},n)):[(0,t.jsx)(`path`,{d:i.path},0)],h=[l&&l!=="default"?e.default[`color-${l}`]:void 0,u].filter(Boolean).join(` `)||void 0;return(0,t.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:p,width:s??f,height:c??f,fill:`currentColor`,"aria-label":o,"aria-hidden":o?void 0:!0,role:o?`img`:void 0,focusable:`false`,className:h,...d,children:m})};exports.Icon=i;
2
2
  //# sourceMappingURL=Icon.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.cjs","names":[],"sources":["../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import type { AnyIconDefinition, IconDefinition } from '@gnome-ui/icons';\nimport type { SVGAttributes } from 'react';\n\nexport type IconSize = 'sm' | 'md' | 'lg';\n\nexport interface IconProps extends SVGAttributes<SVGSVGElement> {\n /** Icon from `@gnome-ui/icons`, a `simple-icons` icon, or a raw `{ path }` object. */\n icon: AnyIconDefinition;\n /**\n * Rendered size.\n * - `sm` — 12 px\n * - `md` — 16 px (default)\n * - `lg` — 20 px\n *\n * Override with `width`/`height` for non-standard sizes.\n */\n size?: IconSize;\n /** Accessible label. Omit for decorative icons — they are hidden from screen readers. */\n label?: string;\n}\n\nconst SIZE_MAP: Record<IconSize, number> = { sm: 12, md: 16, lg: 20 };\n\nfunction isIconDefinition(icon: AnyIconDefinition): icon is IconDefinition {\n // When an object has both `path` and `paths`, `paths` wins.\n return 'paths' in icon && Array.isArray((icon as IconDefinition).paths);\n}\n\n/**\n * Renders an icon as an inline SVG.\n *\n * Accepts icons from `@gnome-ui/icons`, any `simple-icons` icon, or a plain\n * `{ path }` object. Uses `currentColor` so the icon inherits the text color\n * of its parent. Pass `label` only when the icon conveys meaning on its own.\n *\n * @example\n * import { Search } from \"@gnome-ui/icons\";\n * <Icon icon={Search} label=\"Search\" />\n *\n * @example\n * import { siGithub } from \"simple-icons\";\n * <Icon icon={siGithub} label=\"GitHub\" />\n */\nexport const Icon = ({ icon, size = 'md', label, width, height, ...props }: IconProps) => {\n const px = SIZE_MAP[size];\n\n const resolvedViewBox = isIconDefinition(icon) ? icon.viewBox : (icon.viewBox ?? '0 0 24 24');\n\n const paths = isIconDefinition(icon)\n ? icon.paths.map((p, i) => (\n <path key={i} d={p.d} fillRule={p.fillRule} clipRule={p.clipRule} transform={p.transform} />\n ))\n : [<path key={0} d={icon.path} />];\n\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox={resolvedViewBox}\n width={width ?? px}\n height={height ?? px}\n fill=\"currentColor\"\n aria-label={label}\n aria-hidden={label ? undefined : true}\n role={label ? 'img' : undefined}\n focusable=\"false\"\n {...props}\n >\n {paths}\n </svg>\n );\n};\n"],"mappings":"mCAqBA,IAAM,EAAqC,CAAE,GAAI,GAAI,GAAI,GAAI,GAAI,EAAG,EAEpE,SAAS,EAAiB,EAAiD,CAEzE,MAAO,UAAW,GAAQ,MAAM,QAAS,EAAwB,KAAK,CACxE,CAiBA,IAAa,GAAQ,CAAE,OAAM,OAAO,KAAM,QAAO,QAAO,SAAQ,GAAG,KAAuB,CACxF,IAAM,EAAK,EAAS,GAEd,EAAkB,EAAiB,CAAI,EAAI,EAAK,QAAW,EAAK,SAAW,YAE3E,EAAQ,EAAiB,CAAI,EAC/B,EAAK,MAAM,KAAK,EAAG,KACjB,EAAA,EAAA,KAAC,OAAD,CAAc,EAAG,EAAE,EAAG,SAAU,EAAE,SAAU,SAAU,EAAE,SAAU,UAAW,EAAE,SAAY,EAAhF,CAAgF,CAC5F,EACD,EAAC,EAAA,EAAA,KAAC,OAAD,CAAc,EAAG,EAAK,IAAO,EAAlB,CAAkB,CAAC,EAEnC,OACE,EAAA,EAAA,KAAC,MAAD,CACE,MAAM,6BACN,QAAS,EACT,MAAO,GAAS,EAChB,OAAQ,GAAU,EAClB,KAAK,eACL,aAAY,EACZ,cAAa,EAAQ,IAAA,GAAY,GACjC,KAAM,EAAQ,MAAQ,IAAA,GACtB,UAAU,QACV,GAAI,WAEH,CACE,CAAA,CAET"}
1
+ {"version":3,"file":"Icon.cjs","names":[],"sources":["../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import type { AnyIconDefinition, IconDefinition } from '@gnome-ui/icons';\nimport type { SVGAttributes } from 'react';\n\nimport styles from './Icon.module.css';\n\nexport type IconSize = 'sm' | 'md' | 'lg';\n\n/** Named GNOME palette color for the icon. `\"default\"` (or omitting the prop) inherits `currentColor` from the parent. */\nexport type IconColor =\n | 'default'\n | 'blue'\n | 'green'\n | 'yellow'\n | 'orange'\n | 'red'\n | 'purple'\n | 'brown';\n\nexport interface IconProps extends SVGAttributes<SVGSVGElement> {\n /** Icon from `@gnome-ui/icons`, a `simple-icons` icon, or a raw `{ path }` object. */\n icon: AnyIconDefinition;\n /**\n * Rendered size.\n * - `sm` — 12 px\n * - `md` — 16 px (default)\n * - `lg` — 20 px\n *\n * Override with `width`/`height` for non-standard sizes.\n */\n size?: IconSize;\n /** Accessible label. Omit for decorative icons — they are hidden from screen readers. */\n label?: string;\n /**\n * Named GNOME palette color. Omit (or pass `\"default\"`) to inherit `currentColor`\n * from the parent element — the existing behavior is fully preserved.\n */\n color?: IconColor;\n}\n\nconst SIZE_MAP: Record<IconSize, number> = { sm: 12, md: 16, lg: 20 };\n\nfunction isIconDefinition(icon: AnyIconDefinition): icon is IconDefinition {\n // When an object has both `path` and `paths`, `paths` wins.\n return 'paths' in icon && Array.isArray((icon as IconDefinition).paths);\n}\n\n/**\n * Renders an icon as an inline SVG.\n *\n * Accepts icons from `@gnome-ui/icons`, any `simple-icons` icon, or a plain\n * `{ path }` object. Uses `currentColor` so the icon inherits the text color\n * of its parent. Pass `label` only when the icon conveys meaning on its own.\n *\n * @example\n * import { Search } from \"@gnome-ui/icons\";\n * <Icon icon={Search} label=\"Search\" />\n *\n * @example\n * import { siGithub } from \"simple-icons\";\n * <Icon icon={siGithub} label=\"GitHub\" />\n */\nexport const Icon = ({\n icon,\n size = 'md',\n label,\n width,\n height,\n color,\n className,\n ...props\n}: IconProps) => {\n const px = SIZE_MAP[size];\n\n const resolvedViewBox = isIconDefinition(icon) ? icon.viewBox : (icon.viewBox ?? '0 0 24 24');\n\n const paths = isIconDefinition(icon)\n ? icon.paths.map((p, i) => (\n <path key={i} d={p.d} fillRule={p.fillRule} clipRule={p.clipRule} transform={p.transform} />\n ))\n : [<path key={0} d={icon.path} />];\n\n const colorClass = color && color !== 'default' ? styles[`color-${color}`] : undefined;\n const computedClassName = [colorClass, className].filter(Boolean).join(' ') || undefined;\n\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox={resolvedViewBox}\n width={width ?? px}\n height={height ?? px}\n fill=\"currentColor\"\n aria-label={label}\n aria-hidden={label ? undefined : true}\n role={label ? 'img' : undefined}\n focusable=\"false\"\n className={computedClassName}\n {...props}\n >\n {paths}\n </svg>\n );\n};\n"],"mappings":"4EAuCA,IAAM,EAAqC,CAAE,GAAI,GAAI,GAAI,GAAI,GAAI,EAAG,EAEpE,SAAS,EAAiB,EAAiD,CAEzE,MAAO,UAAW,GAAQ,MAAM,QAAS,EAAwB,KAAK,CACxE,CAiBA,IAAa,GAAQ,CACnB,OACA,OAAO,KACP,QACA,QACA,SACA,QACA,YACA,GAAG,KACY,CACf,IAAM,EAAK,EAAS,GAEd,EAAkB,EAAiB,CAAI,EAAI,EAAK,QAAW,EAAK,SAAW,YAE3E,EAAQ,EAAiB,CAAI,EAC/B,EAAK,MAAM,KAAK,EAAG,KACjB,EAAA,EAAA,KAAC,OAAD,CAAc,EAAG,EAAE,EAAG,SAAU,EAAE,SAAU,SAAU,EAAE,SAAU,UAAW,EAAE,SAAY,EAAhF,CAAgF,CAC5F,EACD,EAAC,EAAA,EAAA,KAAC,OAAD,CAAc,EAAG,EAAK,IAAO,EAAlB,CAAkB,CAAC,EAG7B,EAAoB,CADP,GAAS,IAAU,UAAY,EAAA,QAAO,SAAS,KAAW,IAAA,GACtC,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,GAAK,IAAA,GAE/E,OACE,EAAA,EAAA,KAAC,MAAD,CACE,MAAM,6BACN,QAAS,EACT,MAAO,GAAS,EAChB,OAAQ,GAAU,EAClB,KAAK,eACL,aAAY,EACZ,cAAa,EAAQ,IAAA,GAAY,GACjC,KAAM,EAAQ,MAAQ,IAAA,GACtB,UAAU,QACV,UAAW,EACX,GAAI,WAEH,CACE,CAAA,CAET"}
@@ -1,6 +1,8 @@
1
1
  import { AnyIconDefinition } from '@gnome-ui/icons';
2
2
  import { SVGAttributes } from 'react';
3
3
  export type IconSize = 'sm' | 'md' | 'lg';
4
+ /** Named GNOME palette color for the icon. `"default"` (or omitting the prop) inherits `currentColor` from the parent. */
5
+ export type IconColor = 'default' | 'blue' | 'green' | 'yellow' | 'orange' | 'red' | 'purple' | 'brown';
4
6
  export interface IconProps extends SVGAttributes<SVGSVGElement> {
5
7
  /** Icon from `@gnome-ui/icons`, a `simple-icons` icon, or a raw `{ path }` object. */
6
8
  icon: AnyIconDefinition;
@@ -15,6 +17,11 @@ export interface IconProps extends SVGAttributes<SVGSVGElement> {
15
17
  size?: IconSize;
16
18
  /** Accessible label. Omit for decorative icons — they are hidden from screen readers. */
17
19
  label?: string;
20
+ /**
21
+ * Named GNOME palette color. Omit (or pass `"default"`) to inherit `currentColor`
22
+ * from the parent element — the existing behavior is fully preserved.
23
+ */
24
+ color?: IconColor;
18
25
  }
19
26
  /**
20
27
  * Renders an icon as an inline SVG.
@@ -31,4 +38,4 @@ export interface IconProps extends SVGAttributes<SVGSVGElement> {
31
38
  * import { siGithub } from "simple-icons";
32
39
  * <Icon icon={siGithub} label="GitHub" />
33
40
  */
34
- export declare const Icon: ({ icon, size, label, width, height, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
41
+ export declare const Icon: ({ icon, size, label, width, height, color, className, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,35 +1,37 @@
1
- import { jsx as e } from "react/jsx-runtime";
1
+ import e from "./Icon.module.css.js";
2
+ import { jsx as t } from "react/jsx-runtime";
2
3
  //#region src/components/Icon/Icon.tsx
3
- var t = {
4
+ var n = {
4
5
  sm: 12,
5
6
  md: 16,
6
7
  lg: 20
7
8
  };
8
- function n(e) {
9
+ function r(e) {
9
10
  return "paths" in e && Array.isArray(e.paths);
10
11
  }
11
- var r = ({ icon: r, size: i = "md", label: a, width: o, height: s, ...c }) => {
12
- let l = t[i], u = n(r) ? r.viewBox : r.viewBox ?? "0 0 24 24", d = n(r) ? r.paths.map((t, n) => /* @__PURE__ */ e("path", {
13
- d: t.d,
14
- fillRule: t.fillRule,
15
- clipRule: t.clipRule,
16
- transform: t.transform
17
- }, n)) : [/* @__PURE__ */ e("path", { d: r.path }, 0)];
18
- return /* @__PURE__ */ e("svg", {
12
+ var i = ({ icon: i, size: a = "md", label: o, width: s, height: c, color: l, className: u, ...d }) => {
13
+ let f = n[a], p = r(i) ? i.viewBox : i.viewBox ?? "0 0 24 24", m = r(i) ? i.paths.map((e, n) => /* @__PURE__ */ t("path", {
14
+ d: e.d,
15
+ fillRule: e.fillRule,
16
+ clipRule: e.clipRule,
17
+ transform: e.transform
18
+ }, n)) : [/* @__PURE__ */ t("path", { d: i.path }, 0)], h = [l && l !== "default" ? e[`color-${l}`] : void 0, u].filter(Boolean).join(" ") || void 0;
19
+ return /* @__PURE__ */ t("svg", {
19
20
  xmlns: "http://www.w3.org/2000/svg",
20
- viewBox: u,
21
- width: o ?? l,
22
- height: s ?? l,
21
+ viewBox: p,
22
+ width: s ?? f,
23
+ height: c ?? f,
23
24
  fill: "currentColor",
24
- "aria-label": a,
25
- "aria-hidden": a ? void 0 : !0,
26
- role: a ? "img" : void 0,
25
+ "aria-label": o,
26
+ "aria-hidden": o ? void 0 : !0,
27
+ role: o ? "img" : void 0,
27
28
  focusable: "false",
28
- ...c,
29
- children: d
29
+ className: h,
30
+ ...d,
31
+ children: m
30
32
  });
31
33
  };
32
34
  //#endregion
33
- export { r as Icon };
35
+ export { i as Icon };
34
36
 
35
37
  //# sourceMappingURL=Icon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.js","names":[],"sources":["../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import type { AnyIconDefinition, IconDefinition } from '@gnome-ui/icons';\nimport type { SVGAttributes } from 'react';\n\nexport type IconSize = 'sm' | 'md' | 'lg';\n\nexport interface IconProps extends SVGAttributes<SVGSVGElement> {\n /** Icon from `@gnome-ui/icons`, a `simple-icons` icon, or a raw `{ path }` object. */\n icon: AnyIconDefinition;\n /**\n * Rendered size.\n * - `sm` — 12 px\n * - `md` — 16 px (default)\n * - `lg` — 20 px\n *\n * Override with `width`/`height` for non-standard sizes.\n */\n size?: IconSize;\n /** Accessible label. Omit for decorative icons — they are hidden from screen readers. */\n label?: string;\n}\n\nconst SIZE_MAP: Record<IconSize, number> = { sm: 12, md: 16, lg: 20 };\n\nfunction isIconDefinition(icon: AnyIconDefinition): icon is IconDefinition {\n // When an object has both `path` and `paths`, `paths` wins.\n return 'paths' in icon && Array.isArray((icon as IconDefinition).paths);\n}\n\n/**\n * Renders an icon as an inline SVG.\n *\n * Accepts icons from `@gnome-ui/icons`, any `simple-icons` icon, or a plain\n * `{ path }` object. Uses `currentColor` so the icon inherits the text color\n * of its parent. Pass `label` only when the icon conveys meaning on its own.\n *\n * @example\n * import { Search } from \"@gnome-ui/icons\";\n * <Icon icon={Search} label=\"Search\" />\n *\n * @example\n * import { siGithub } from \"simple-icons\";\n * <Icon icon={siGithub} label=\"GitHub\" />\n */\nexport const Icon = ({ icon, size = 'md', label, width, height, ...props }: IconProps) => {\n const px = SIZE_MAP[size];\n\n const resolvedViewBox = isIconDefinition(icon) ? icon.viewBox : (icon.viewBox ?? '0 0 24 24');\n\n const paths = isIconDefinition(icon)\n ? icon.paths.map((p, i) => (\n <path key={i} d={p.d} fillRule={p.fillRule} clipRule={p.clipRule} transform={p.transform} />\n ))\n : [<path key={0} d={icon.path} />];\n\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox={resolvedViewBox}\n width={width ?? px}\n height={height ?? px}\n fill=\"currentColor\"\n aria-label={label}\n aria-hidden={label ? undefined : true}\n role={label ? 'img' : undefined}\n focusable=\"false\"\n {...props}\n >\n {paths}\n </svg>\n );\n};\n"],"mappings":";;AAqBA,IAAM,IAAqC;CAAE,IAAI;CAAI,IAAI;CAAI,IAAI;AAAG;AAEpE,SAAS,EAAiB,GAAiD;CAEzE,OAAO,WAAW,KAAQ,MAAM,QAAS,EAAwB,KAAK;AACxE;AAiBA,IAAa,KAAQ,EAAE,SAAM,UAAO,MAAM,UAAO,UAAO,WAAQ,GAAG,QAAuB;CACxF,IAAM,IAAK,EAAS,IAEd,IAAkB,EAAiB,CAAI,IAAI,EAAK,UAAW,EAAK,WAAW,aAE3E,IAAQ,EAAiB,CAAI,IAC/B,EAAK,MAAM,KAAK,GAAG,MACjB,kBAAC,QAAD;EAAc,GAAG,EAAE;EAAG,UAAU,EAAE;EAAU,UAAU,EAAE;EAAU,WAAW,EAAE;CAAY,GAAhF,CAAgF,CAC5F,IACD,CAAC,kBAAC,QAAD,EAAc,GAAG,EAAK,KAAO,GAAlB,CAAkB,CAAC;CAEnC,OACE,kBAAC,OAAD;EACE,OAAM;EACN,SAAS;EACT,OAAO,KAAS;EAChB,QAAQ,KAAU;EAClB,MAAK;EACL,cAAY;EACZ,eAAa,IAAQ,KAAA,IAAY;EACjC,MAAM,IAAQ,QAAQ,KAAA;EACtB,WAAU;EACV,GAAI;YAEH;CACE,CAAA;AAET"}
1
+ {"version":3,"file":"Icon.js","names":[],"sources":["../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import type { AnyIconDefinition, IconDefinition } from '@gnome-ui/icons';\nimport type { SVGAttributes } from 'react';\n\nimport styles from './Icon.module.css';\n\nexport type IconSize = 'sm' | 'md' | 'lg';\n\n/** Named GNOME palette color for the icon. `\"default\"` (or omitting the prop) inherits `currentColor` from the parent. */\nexport type IconColor =\n | 'default'\n | 'blue'\n | 'green'\n | 'yellow'\n | 'orange'\n | 'red'\n | 'purple'\n | 'brown';\n\nexport interface IconProps extends SVGAttributes<SVGSVGElement> {\n /** Icon from `@gnome-ui/icons`, a `simple-icons` icon, or a raw `{ path }` object. */\n icon: AnyIconDefinition;\n /**\n * Rendered size.\n * - `sm` — 12 px\n * - `md` — 16 px (default)\n * - `lg` — 20 px\n *\n * Override with `width`/`height` for non-standard sizes.\n */\n size?: IconSize;\n /** Accessible label. Omit for decorative icons — they are hidden from screen readers. */\n label?: string;\n /**\n * Named GNOME palette color. Omit (or pass `\"default\"`) to inherit `currentColor`\n * from the parent element — the existing behavior is fully preserved.\n */\n color?: IconColor;\n}\n\nconst SIZE_MAP: Record<IconSize, number> = { sm: 12, md: 16, lg: 20 };\n\nfunction isIconDefinition(icon: AnyIconDefinition): icon is IconDefinition {\n // When an object has both `path` and `paths`, `paths` wins.\n return 'paths' in icon && Array.isArray((icon as IconDefinition).paths);\n}\n\n/**\n * Renders an icon as an inline SVG.\n *\n * Accepts icons from `@gnome-ui/icons`, any `simple-icons` icon, or a plain\n * `{ path }` object. Uses `currentColor` so the icon inherits the text color\n * of its parent. Pass `label` only when the icon conveys meaning on its own.\n *\n * @example\n * import { Search } from \"@gnome-ui/icons\";\n * <Icon icon={Search} label=\"Search\" />\n *\n * @example\n * import { siGithub } from \"simple-icons\";\n * <Icon icon={siGithub} label=\"GitHub\" />\n */\nexport const Icon = ({\n icon,\n size = 'md',\n label,\n width,\n height,\n color,\n className,\n ...props\n}: IconProps) => {\n const px = SIZE_MAP[size];\n\n const resolvedViewBox = isIconDefinition(icon) ? icon.viewBox : (icon.viewBox ?? '0 0 24 24');\n\n const paths = isIconDefinition(icon)\n ? icon.paths.map((p, i) => (\n <path key={i} d={p.d} fillRule={p.fillRule} clipRule={p.clipRule} transform={p.transform} />\n ))\n : [<path key={0} d={icon.path} />];\n\n const colorClass = color && color !== 'default' ? styles[`color-${color}`] : undefined;\n const computedClassName = [colorClass, className].filter(Boolean).join(' ') || undefined;\n\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox={resolvedViewBox}\n width={width ?? px}\n height={height ?? px}\n fill=\"currentColor\"\n aria-label={label}\n aria-hidden={label ? undefined : true}\n role={label ? 'img' : undefined}\n focusable=\"false\"\n className={computedClassName}\n {...props}\n >\n {paths}\n </svg>\n );\n};\n"],"mappings":";;;AAuCA,IAAM,IAAqC;CAAE,IAAI;CAAI,IAAI;CAAI,IAAI;AAAG;AAEpE,SAAS,EAAiB,GAAiD;CAEzE,OAAO,WAAW,KAAQ,MAAM,QAAS,EAAwB,KAAK;AACxE;AAiBA,IAAa,KAAQ,EACnB,SACA,UAAO,MACP,UACA,UACA,WACA,UACA,cACA,GAAG,QACY;CACf,IAAM,IAAK,EAAS,IAEd,IAAkB,EAAiB,CAAI,IAAI,EAAK,UAAW,EAAK,WAAW,aAE3E,IAAQ,EAAiB,CAAI,IAC/B,EAAK,MAAM,KAAK,GAAG,MACjB,kBAAC,QAAD;EAAc,GAAG,EAAE;EAAG,UAAU,EAAE;EAAU,UAAU,EAAE;EAAU,WAAW,EAAE;CAAY,GAAhF,CAAgF,CAC5F,IACD,CAAC,kBAAC,QAAD,EAAc,GAAG,EAAK,KAAO,GAAlB,CAAkB,CAAC,GAG7B,IAAoB,CADP,KAAS,MAAU,YAAY,EAAO,SAAS,OAAW,KAAA,GACtC,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,KAAK,KAAA;CAE/E,OACE,kBAAC,OAAD;EACE,OAAM;EACN,SAAS;EACT,OAAO,KAAS;EAChB,QAAQ,KAAU;EAClB,MAAK;EACL,cAAY;EACZ,eAAa,IAAQ,KAAA,IAAY;EACjC,MAAM,IAAQ,QAAQ,KAAA;EACtB,WAAU;EACV,WAAW;EACX,GAAI;YAEH;CACE,CAAA;AAET"}
@@ -0,0 +1,2 @@
1
+ var e={"color-blue":`_color-blue_wmix2_7`,"color-green":`_color-green_wmix2_11`,"color-yellow":`_color-yellow_wmix2_15`,"color-orange":`_color-orange_wmix2_19`,"color-red":`_color-red_wmix2_23`,"color-purple":`_color-purple_wmix2_27`,"color-brown":`_color-brown_wmix2_31`};exports.default=e;
2
+ //# sourceMappingURL=Icon.module.css.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icon.module.css.cjs","names":[],"sources":["../../../src/components/Icon/Icon.module.css"],"sourcesContent":["/* ─── Palette color overrides ───────────────────────────────────────────────── */\n/* Applied via the `color` prop. Each class sets the CSS `color` property so */\n/* the SVG's fill=\"currentColor\" resolves to the palette token. */\n\n/* stylelint-disable selector-class-pattern */\n\n.color-blue {\n color: var(--gnome-blue-3, #3584e4);\n}\n\n.color-green {\n color: var(--gnome-green-4, #2ec27e);\n}\n\n.color-yellow {\n color: var(--gnome-yellow-4, #f5c211);\n}\n\n.color-orange {\n color: var(--gnome-orange-3, #ff7800);\n}\n\n.color-red {\n color: var(--gnome-red-3, #e01b24);\n}\n\n.color-purple {\n color: var(--gnome-purple-3, #9141ac);\n}\n\n.color-brown {\n color: var(--gnome-brown-3, #986a44);\n}\n\n/* stylelint-enable selector-class-pattern */\n"],"mappings":""}
@@ -0,0 +1,14 @@
1
+ //#region src/components/Icon/Icon.module.css
2
+ var e = {
3
+ "color-blue": "_color-blue_wmix2_7",
4
+ "color-green": "_color-green_wmix2_11",
5
+ "color-yellow": "_color-yellow_wmix2_15",
6
+ "color-orange": "_color-orange_wmix2_19",
7
+ "color-red": "_color-red_wmix2_23",
8
+ "color-purple": "_color-purple_wmix2_27",
9
+ "color-brown": "_color-brown_wmix2_31"
10
+ };
11
+ //#endregion
12
+ export { e as default };
13
+
14
+ //# sourceMappingURL=Icon.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icon.module.css.js","names":[],"sources":["../../../src/components/Icon/Icon.module.css"],"sourcesContent":["/* ─── Palette color overrides ───────────────────────────────────────────────── */\n/* Applied via the `color` prop. Each class sets the CSS `color` property so */\n/* the SVG's fill=\"currentColor\" resolves to the palette token. */\n\n/* stylelint-disable selector-class-pattern */\n\n.color-blue {\n color: var(--gnome-blue-3, #3584e4);\n}\n\n.color-green {\n color: var(--gnome-green-4, #2ec27e);\n}\n\n.color-yellow {\n color: var(--gnome-yellow-4, #f5c211);\n}\n\n.color-orange {\n color: var(--gnome-orange-3, #ff7800);\n}\n\n.color-red {\n color: var(--gnome-red-3, #e01b24);\n}\n\n.color-purple {\n color: var(--gnome-purple-3, #9141ac);\n}\n\n.color-brown {\n color: var(--gnome-brown-3, #986a44);\n}\n\n/* stylelint-enable selector-class-pattern */\n"],"mappings":""}
@@ -1,2 +1,2 @@
1
- export type { IconProps, IconSize } from './Icon';
1
+ export type { IconColor, IconProps, IconSize } from './Icon';
2
2
  export { Icon } from './Icon';
@@ -1,2 +1,2 @@
1
- const e=require("./InlineViewSwitcher.module.css.cjs");let t=require("react"),n=require("react/jsx-runtime");var r=(0,t.createContext)(null);function i(){let e=(0,t.useContext)(r);if(!e)throw Error(`InlineViewSwitcherItem must be used inside InlineViewSwitcher`);return e}var a=({value:i,onValueChange:a,variant:o=`default`,"aria-label":s=`View switcher`,children:c,className:l,...u})=>{let d=(0,t.useRef)(null);function f(e){let t=Array.from(d.current?.querySelectorAll(`[role=radio]:not(:disabled)`)??[]),n=document.activeElement,r=n instanceof HTMLButtonElement?t.indexOf(n):-1;if(r===-1)return;let i=r;if(e.key===`ArrowRight`||e.key===`ArrowDown`)i=(r+1)%t.length;else if(e.key===`ArrowLeft`||e.key===`ArrowUp`)i=(r-1+t.length)%t.length;else if(e.key===`Home`)i=0;else if(e.key===`End`)i=t.length-1;else return;e.preventDefault(),t[i].focus(),t[i].click()}return(0,n.jsx)(r.Provider,{value:{value:i,onValueChange:a},children:(0,n.jsx)(`div`,{ref:d,role:`radiogroup`,"aria-label":s,onKeyDown:f,className:[e.default.switcher,e.default[o],l].filter(Boolean).join(` `),...u,children:c})})};exports.InlineViewSwitcher=a,exports.useInlineViewSwitcher=i;
1
+ const e=require("../BottomSheet/BottomSheet.cjs"),t=require("../Icon/Icon.cjs"),n=require("./InlineViewSwitcher.module.css.cjs");let r=require("react"),i=require("react/jsx-runtime");var a=(0,r.createContext)(null);function o(){let e=(0,r.useContext)(a);if(!e)throw Error(`InlineViewSwitcherItem must be used inside InlineViewSwitcher`);return e}var s=({value:o,onValueChange:s,variant:c=`default`,overflow:l=`wrap`,"aria-label":u=`View switcher`,children:d,className:f,...p})=>{let m=(0,r.useRef)(null),h=(0,r.useRef)(0),[g,_]=(0,r.useState)(!1),[v,y]=(0,r.useState)(!1),[b,x]=(0,r.useState)({width:0,transform:`translateX(0)`});(0,r.useEffect)(()=>{if(l!==`compact`&&l!==`menu`){_(!1);return}let e=m.current;if(!e)return;let t=new ResizeObserver(()=>{_(t=>{if(!t){let t=e.scrollWidth;return t>e.clientWidth?(h.current=t,!0):!1}return h.current>e.clientWidth+30})});return t.observe(e),()=>t.disconnect()},[l]);let S=r.Children.toArray(d).filter(r.isValidElement).filter(e=>e.type.displayName===`InlineViewSwitcherItem`).map(e=>e.props),C=S.find(e=>e.name===o)??S[0],w=l===`compact`&&g,T=l===`menu`&&g;(0,r.useLayoutEffect)(()=>{if(T)return;let e=m.current;if(!e)return;let t=e.querySelector(`[aria-checked="true"]`);t&&x({width:t.offsetWidth,transform:`translateX(${t.offsetLeft}px)`})},[o,T,w]);function E(e){let t=Array.from(m.current?.querySelectorAll(`[role=radio]:not(:disabled)`)??[]),n=document.activeElement,r=n instanceof HTMLButtonElement?t.indexOf(n):-1;if(r===-1)return;let i=r;if(e.key===`ArrowRight`||e.key===`ArrowDown`)i=(r+1)%t.length;else if(e.key===`ArrowLeft`||e.key===`ArrowUp`)i=(r-1+t.length)%t.length;else if(e.key===`Home`)i=0;else if(e.key===`End`)i=t.length-1;else return;e.preventDefault(),t[i].focus(),t[i].click()}return(0,i.jsx)(a.Provider,{value:{value:o,onValueChange:s,compact:w},children:(0,i.jsxs)(`div`,{ref:m,role:T?void 0:`radiogroup`,"aria-label":u,onKeyDown:E,className:[n.default.switcher,n.default[c],l===`scroll`?n.default.overflowScroll:null,l===`compact`||l===`menu`?n.default.overflowDetect:null,w?n.default.compact:null,f].filter(Boolean).join(` `),...p,children:[!T&&(0,i.jsx)(`span`,{className:n.default.indicator,style:b,"aria-hidden":!0}),T?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(`button`,{type:`button`,className:[n.default.item,n.default.active,n.default.menuTrigger].filter(Boolean).join(` `),onClick:()=>y(!0),"aria-haspopup":`dialog`,"aria-label":`${u}: ${C?.label??C?.name}`,children:[C?.icon&&(0,i.jsx)(`span`,{className:n.default.itemIcon,children:(0,i.jsx)(t.Icon,{icon:C.icon,size:`md`,"aria-hidden":!0})}),C?.label&&(0,i.jsx)(`span`,{className:n.default.itemLabel,children:C.label}),(0,i.jsx)(`span`,{className:n.default.menuChevron,"aria-hidden":`true`,children:`▾`})]}),(0,i.jsx)(e.BottomSheet,{open:v,title:u,onClose:()=>y(!1),children:(0,i.jsx)(`div`,{className:n.default.menuList,role:`radiogroup`,"aria-label":u,children:S.map(e=>(0,i.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":e.name===o,className:[n.default.menuListItem,e.name===o?n.default.menuListItemActive:null].filter(Boolean).join(` `),onClick:()=>{s(e.name),y(!1)},children:[e.icon&&(0,i.jsx)(`span`,{className:n.default.menuListItemIcon,children:(0,i.jsx)(t.Icon,{icon:e.icon,size:`md`,"aria-hidden":!0})}),(0,i.jsx)(`span`,{className:n.default.menuListItemLabel,children:e.label??e.name}),e.name===o&&(0,i.jsx)(`span`,{className:n.default.menuListItemCheck,"aria-hidden":`true`,children:`✓`})]},e.name))})})]}):d]})})};exports.InlineViewSwitcher=s,exports.useInlineViewSwitcher=o;
2
2
  //# sourceMappingURL=InlineViewSwitcher.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"InlineViewSwitcher.cjs","names":[],"sources":["../../../src/components/InlineViewSwitcher/InlineViewSwitcher.tsx"],"sourcesContent":["import {\n createContext,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n useContext,\n useRef,\n} from 'react';\n\nimport styles from './InlineViewSwitcher.module.css';\n\nexport type InlineViewSwitcherVariant = 'default' | 'flat' | 'round' | 'pill';\n\n// ─── Internal context ──────────────────────────────────────────────────────────\n\ninterface InlineViewSwitcherContextValue {\n value: string;\n onValueChange: (value: string) => void;\n}\n\nconst InlineViewSwitcherContext = createContext<InlineViewSwitcherContextValue | null>(null);\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport function useInlineViewSwitcher() {\n const ctx = useContext(InlineViewSwitcherContext);\n\n if (!ctx) {\n throw new Error('InlineViewSwitcherItem must be used inside InlineViewSwitcher');\n }\n\n return ctx;\n}\n\n// ─── InlineViewSwitcher ────────────────────────────────────────────────────────\n\nexport interface InlineViewSwitcherProps extends HTMLAttributes<HTMLDivElement> {\n /** Currently active view name. */\n value: string;\n /** Called with the new value when a view is selected. */\n onValueChange: (value: string) => void;\n /**\n * Visual style of the switcher.\n * - `default` — card background with border and shadow (same as `ToggleGroup`).\n * - `flat` — no background or border; active indicator only.\n * - `round` — pill-shaped container and items.\n * - `pill` — segmented-control style; active item appears lifted, no accent color.\n */\n variant?: InlineViewSwitcherVariant;\n /** Accessible label for the group. */\n 'aria-label'?: string;\n children?: ReactNode;\n}\n\n/**\n * Compact inline view switcher for placing inside content areas, cards, or\n * toolbars — wherever `ViewSwitcher` (header-bar sized) would be too heavy.\n *\n * Built on `ToggleGroup` internals with `flat` and `round` style variants.\n * Mirrors `AdwInlineViewSwitcher` (libadwaita 1.7 / GNOME 48).\n *\n * Compose with `InlineViewSwitcherItem`. Keyboard: ← / → cycle, Home / End jump.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.InlineViewSwitcher.html\n */\nexport const InlineViewSwitcher = ({\n value,\n onValueChange,\n variant = 'default',\n 'aria-label': ariaLabel = 'View switcher',\n children,\n className,\n ...props\n}: InlineViewSwitcherProps) => {\n const groupRef = useRef<HTMLDivElement>(null);\n\n function handleKeyDown(e: KeyboardEvent<HTMLDivElement>) {\n const items = Array.from(\n groupRef.current?.querySelectorAll<HTMLButtonElement>('[role=radio]:not(:disabled)') ?? [],\n );\n const activeElement = document.activeElement;\n const idx = activeElement instanceof HTMLButtonElement ? items.indexOf(activeElement) : -1;\n\n if (idx === -1) {\n return;\n }\n\n let next = idx;\n if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {\n next = (idx + 1) % items.length;\n } else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {\n next = (idx - 1 + items.length) % items.length;\n } else if (e.key === 'Home') {\n next = 0;\n } else if (e.key === 'End') {\n next = items.length - 1;\n } else {\n return;\n }\n\n e.preventDefault();\n items[next].focus();\n items[next].click();\n }\n\n return (\n <InlineViewSwitcherContext.Provider value={{ value, onValueChange }}>\n <div\n ref={groupRef}\n role=\"radiogroup\"\n aria-label={ariaLabel}\n onKeyDown={handleKeyDown}\n className={[styles.switcher, styles[variant], className].filter(Boolean).join(' ')}\n {...props}\n >\n {children}\n </div>\n </InlineViewSwitcherContext.Provider>\n );\n};\n"],"mappings":"6GAoBA,IAAM,GAAA,EAAA,EAAA,eAAiF,IAAI,EAG3F,SAAgB,GAAwB,CACtC,IAAM,GAAA,EAAA,EAAA,YAAiB,CAAyB,EAEhD,GAAI,CAAC,EACH,MAAU,MAAM,+DAA+D,EAGjF,OAAO,CACT,CAiCA,IAAa,GAAsB,CACjC,QACA,gBACA,UAAU,UACV,aAAc,EAAY,gBAC1B,WACA,YACA,GAAG,KAC0B,CAC7B,IAAM,GAAA,EAAA,EAAA,QAAkC,IAAI,EAE5C,SAAS,EAAc,EAAkC,CACvD,IAAM,EAAQ,MAAM,KAClB,EAAS,SAAS,iBAAoC,6BAA6B,GAAK,CAAC,CAC3F,EACM,EAAgB,SAAS,cACzB,EAAM,aAAyB,kBAAoB,EAAM,QAAQ,CAAa,EAAI,GAExF,GAAI,IAAQ,GACV,OAGF,IAAI,EAAO,EACX,GAAI,EAAE,MAAQ,cAAgB,EAAE,MAAQ,YACtC,GAAQ,EAAM,GAAK,EAAM,YACpB,GAAI,EAAE,MAAQ,aAAe,EAAE,MAAQ,UAC5C,GAAQ,EAAM,EAAI,EAAM,QAAU,EAAM,YACnC,GAAI,EAAE,MAAQ,OACnB,EAAO,OACF,GAAI,EAAE,MAAQ,MACnB,EAAO,EAAM,OAAS,OAEtB,OAGF,EAAE,eAAe,EACjB,EAAM,GAAM,MAAM,EAClB,EAAM,GAAM,MAAM,CACpB,CAEA,OACE,EAAA,EAAA,KAAC,EAA0B,SAA3B,CAAoC,MAAO,CAAE,QAAO,eAAc,YAChE,EAAA,EAAA,KAAC,MAAD,CACE,IAAK,EACL,KAAK,aACL,aAAY,EACZ,UAAW,EACX,UAAW,CAAC,EAAA,QAAO,SAAU,EAAA,QAAO,GAAU,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EACjF,GAAI,EAEH,UACE,CAAA,CAC6B,CAAA,CAExC"}
1
+ {"version":3,"file":"InlineViewSwitcher.cjs","names":[],"sources":["../../../src/components/InlineViewSwitcher/InlineViewSwitcher.tsx"],"sourcesContent":["import {\n Children,\n type CSSProperties,\n createContext,\n type HTMLAttributes,\n isValidElement,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\n\nimport { BottomSheet } from '../BottomSheet';\nimport { Icon } from '../Icon';\n\nimport styles from './InlineViewSwitcher.module.css';\nimport type { InlineViewSwitcherItemProps } from './InlineViewSwitcherItem';\n\nexport type InlineViewSwitcherVariant = 'default' | 'flat' | 'round' | 'pill';\n\nexport type InlineViewSwitcherOverflow = 'wrap' | 'scroll' | 'compact' | 'menu';\n\n// ─── Internal context ──────────────────────────────────────────────────────────\n\ninterface InlineViewSwitcherContextValue {\n value: string;\n onValueChange: (value: string) => void;\n compact: boolean;\n}\n\nconst InlineViewSwitcherContext = createContext<InlineViewSwitcherContextValue | null>(null);\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport function useInlineViewSwitcher() {\n const ctx = useContext(InlineViewSwitcherContext);\n\n if (!ctx) {\n throw new Error('InlineViewSwitcherItem must be used inside InlineViewSwitcher');\n }\n\n return ctx;\n}\n\n// ─── InlineViewSwitcher ────────────────────────────────────────────────────────\n\nexport interface InlineViewSwitcherProps extends HTMLAttributes<HTMLDivElement> {\n /** Currently active view name. */\n value: string;\n /** Called with the new value when a view is selected. */\n onValueChange: (value: string) => void;\n /**\n * Visual style of the switcher.\n * - `default` — card background with border and shadow (same as `ToggleGroup`).\n * - `flat` — no background or border; active indicator only.\n * - `round` — pill-shaped container and items.\n * - `pill` — segmented-control style; active item appears lifted, no accent color.\n */\n variant?: InlineViewSwitcherVariant;\n /**\n * Overflow strategy when the container is too narrow for all items.\n * - `wrap` — default; items overflow with no special handling.\n * - `scroll` — horizontal scroll with hidden scrollbar.\n * - `compact` — collapses item labels to icons-only when overflowing (requires icons on all items).\n * - `menu` — shows the active item and a chevron trigger; all items open in a BottomSheet.\n */\n overflow?: InlineViewSwitcherOverflow;\n /** Accessible label for the group. */\n 'aria-label'?: string;\n children?: ReactNode;\n}\n\n/**\n * Compact inline view switcher for placing inside content areas, cards, or\n * toolbars — wherever `ViewSwitcher` (header-bar sized) would be too heavy.\n *\n * Built on `ToggleGroup` internals with `flat` and `round` style variants.\n * Mirrors `AdwInlineViewSwitcher` (libadwaita 1.7 / GNOME 48).\n *\n * Compose with `InlineViewSwitcherItem`. Keyboard: ← / → cycle, Home / End jump.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.InlineViewSwitcher.html\n */\nexport const InlineViewSwitcher = ({\n value,\n onValueChange,\n variant = 'default',\n overflow = 'wrap',\n 'aria-label': ariaLabel = 'View switcher',\n children,\n className,\n ...props\n}: InlineViewSwitcherProps) => {\n const groupRef = useRef<HTMLDivElement>(null);\n const naturalWidthRef = useRef<number>(0);\n const [isOverflowing, setIsOverflowing] = useState(false);\n const [sheetOpen, setSheetOpen] = useState(false);\n const [indicatorStyle, setIndicatorStyle] = useState<CSSProperties>({\n width: 0,\n transform: 'translateX(0)',\n });\n\n useEffect(() => {\n if (overflow !== 'compact' && overflow !== 'menu') {\n setIsOverflowing(false);\n return;\n }\n const el = groupRef.current;\n if (!el) {\n return;\n }\n\n const check = () => {\n setIsOverflowing((prev) => {\n if (!prev) {\n const scrollW = el.scrollWidth;\n if (scrollW > el.clientWidth) {\n naturalWidthRef.current = scrollW;\n return true;\n }\n return false;\n }\n // 30px hysteresis: stay collapsed until container is comfortably wider\n return naturalWidthRef.current > el.clientWidth + 30;\n });\n };\n\n const ro = new ResizeObserver(check);\n ro.observe(el);\n return () => ro.disconnect();\n }, [overflow]);\n\n const allItems = Children.toArray(children)\n .filter(isValidElement)\n .filter(\n (child) => (child.type as { displayName?: string }).displayName === 'InlineViewSwitcherItem',\n )\n .map((child) => (child as ReactElement<InlineViewSwitcherItemProps>).props);\n\n const activeItem = allItems.find((i) => i.name === value) ?? allItems[0];\n const compact = overflow === 'compact' && isOverflowing;\n const inMenuMode = overflow === 'menu' && isOverflowing;\n\n // Track active item position for the sliding indicator\n useLayoutEffect(() => {\n if (inMenuMode) {\n return;\n }\n const group = groupRef.current;\n if (!group) {\n return;\n }\n const activeEl = group.querySelector<HTMLElement>('[aria-checked=\"true\"]');\n if (!activeEl) {\n return;\n }\n\n setIndicatorStyle({\n width: activeEl.offsetWidth,\n transform: `translateX(${activeEl.offsetLeft}px)`,\n });\n }, [value, inMenuMode, compact]);\n\n function handleKeyDown(e: KeyboardEvent<HTMLDivElement>) {\n const items = Array.from(\n groupRef.current?.querySelectorAll<HTMLButtonElement>('[role=radio]:not(:disabled)') ?? [],\n );\n const activeElement = document.activeElement;\n const idx = activeElement instanceof HTMLButtonElement ? items.indexOf(activeElement) : -1;\n\n if (idx === -1) {\n return;\n }\n\n let next = idx;\n if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {\n next = (idx + 1) % items.length;\n } else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {\n next = (idx - 1 + items.length) % items.length;\n } else if (e.key === 'Home') {\n next = 0;\n } else if (e.key === 'End') {\n next = items.length - 1;\n } else {\n return;\n }\n\n e.preventDefault();\n items[next].focus();\n items[next].click();\n }\n\n return (\n <InlineViewSwitcherContext.Provider value={{ value, onValueChange, compact }}>\n <div\n ref={groupRef}\n role={inMenuMode ? undefined : 'radiogroup'}\n aria-label={ariaLabel}\n onKeyDown={handleKeyDown}\n className={[\n styles.switcher,\n styles[variant],\n overflow === 'scroll' ? styles.overflowScroll : null,\n overflow === 'compact' || overflow === 'menu' ? styles.overflowDetect : null,\n compact ? styles.compact : null,\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n {...props}\n >\n {!inMenuMode && <span className={styles.indicator} style={indicatorStyle} aria-hidden />}\n {inMenuMode ? (\n <>\n <button\n type=\"button\"\n className={[styles.item, styles.active, styles.menuTrigger].filter(Boolean).join(' ')}\n onClick={() => setSheetOpen(true)}\n aria-haspopup=\"dialog\"\n aria-label={`${ariaLabel}: ${activeItem?.label ?? activeItem?.name}`}\n >\n {activeItem?.icon && (\n <span className={styles.itemIcon}>\n <Icon icon={activeItem.icon} size=\"md\" aria-hidden />\n </span>\n )}\n {activeItem?.label && <span className={styles.itemLabel}>{activeItem.label}</span>}\n <span className={styles.menuChevron} aria-hidden=\"true\">\n ▾\n </span>\n </button>\n <BottomSheet open={sheetOpen} title={ariaLabel} onClose={() => setSheetOpen(false)}>\n <div className={styles.menuList} role=\"radiogroup\" aria-label={ariaLabel}>\n {allItems.map((item) => (\n <button\n key={item.name}\n type=\"button\"\n role=\"radio\"\n aria-checked={item.name === value}\n className={[\n styles.menuListItem,\n item.name === value ? styles.menuListItemActive : null,\n ]\n .filter(Boolean)\n .join(' ')}\n onClick={() => {\n onValueChange(item.name);\n setSheetOpen(false);\n }}\n >\n {item.icon && (\n <span className={styles.menuListItemIcon}>\n <Icon icon={item.icon} size=\"md\" aria-hidden />\n </span>\n )}\n <span className={styles.menuListItemLabel}>{item.label ?? item.name}</span>\n {item.name === value && (\n <span className={styles.menuListItemCheck} aria-hidden=\"true\">\n ✓\n </span>\n )}\n </button>\n ))}\n </div>\n </BottomSheet>\n </>\n ) : (\n children\n )}\n </div>\n </InlineViewSwitcherContext.Provider>\n );\n};\n"],"mappings":"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"}
@@ -1,8 +1,10 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
2
  export type InlineViewSwitcherVariant = 'default' | 'flat' | 'round' | 'pill';
3
+ export type InlineViewSwitcherOverflow = 'wrap' | 'scroll' | 'compact' | 'menu';
3
4
  interface InlineViewSwitcherContextValue {
4
5
  value: string;
5
6
  onValueChange: (value: string) => void;
7
+ compact: boolean;
6
8
  }
7
9
  export declare function useInlineViewSwitcher(): InlineViewSwitcherContextValue;
8
10
  export interface InlineViewSwitcherProps extends HTMLAttributes<HTMLDivElement> {
@@ -18,6 +20,14 @@ export interface InlineViewSwitcherProps extends HTMLAttributes<HTMLDivElement>
18
20
  * - `pill` — segmented-control style; active item appears lifted, no accent color.
19
21
  */
20
22
  variant?: InlineViewSwitcherVariant;
23
+ /**
24
+ * Overflow strategy when the container is too narrow for all items.
25
+ * - `wrap` — default; items overflow with no special handling.
26
+ * - `scroll` — horizontal scroll with hidden scrollbar.
27
+ * - `compact` — collapses item labels to icons-only when overflowing (requires icons on all items).
28
+ * - `menu` — shows the active item and a chevron trigger; all items open in a BottomSheet.
29
+ */
30
+ overflow?: InlineViewSwitcherOverflow;
21
31
  /** Accessible label for the group. */
22
32
  'aria-label'?: string;
23
33
  children?: ReactNode;
@@ -33,5 +43,5 @@ export interface InlineViewSwitcherProps extends HTMLAttributes<HTMLDivElement>
33
43
  *
34
44
  * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.InlineViewSwitcher.html
35
45
  */
36
- export declare const InlineViewSwitcher: ({ value, onValueChange, variant, "aria-label": ariaLabel, children, className, ...props }: InlineViewSwitcherProps) => import("react/jsx-runtime").JSX.Element;
46
+ export declare const InlineViewSwitcher: ({ value, onValueChange, variant, overflow, "aria-label": ariaLabel, children, className, ...props }: InlineViewSwitcherProps) => import("react/jsx-runtime").JSX.Element;
37
47
  export {};
@@ -1,17 +1,55 @@
1
- import e from "./InlineViewSwitcher.module.css.js";
2
- import { createContext as t, useContext as n, useRef as r } from "react";
3
- import { jsx as i } from "react/jsx-runtime";
1
+ import { BottomSheet as e } from "../BottomSheet/BottomSheet.js";
2
+ import { Icon as t } from "../Icon/Icon.js";
3
+ import n from "./InlineViewSwitcher.module.css.js";
4
+ import { Children as r, createContext as i, isValidElement as a, useContext as o, useEffect as s, useLayoutEffect as c, useRef as l, useState as u } from "react";
5
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
4
6
  //#region src/components/InlineViewSwitcher/InlineViewSwitcher.tsx
5
- var a = t(null);
6
- function o() {
7
- let e = n(a);
7
+ var m = i(null);
8
+ function h() {
9
+ let e = o(m);
8
10
  if (!e) throw Error("InlineViewSwitcherItem must be used inside InlineViewSwitcher");
9
11
  return e;
10
12
  }
11
- var s = ({ value: t, onValueChange: n, variant: o = "default", "aria-label": s = "View switcher", children: c, className: l, ...u }) => {
12
- let d = r(null);
13
- function f(e) {
14
- let t = Array.from(d.current?.querySelectorAll("[role=radio]:not(:disabled)") ?? []), n = document.activeElement, r = n instanceof HTMLButtonElement ? t.indexOf(n) : -1;
13
+ var g = ({ value: i, onValueChange: o, variant: h = "default", overflow: g = "wrap", "aria-label": _ = "View switcher", children: v, className: y, ...b }) => {
14
+ let x = l(null), S = l(0), [C, w] = u(!1), [T, E] = u(!1), [D, O] = u({
15
+ width: 0,
16
+ transform: "translateX(0)"
17
+ });
18
+ s(() => {
19
+ if (g !== "compact" && g !== "menu") {
20
+ w(!1);
21
+ return;
22
+ }
23
+ let e = x.current;
24
+ if (!e) return;
25
+ let t = new ResizeObserver(() => {
26
+ w((t) => {
27
+ if (!t) {
28
+ let t = e.scrollWidth;
29
+ return t > e.clientWidth ? (S.current = t, !0) : !1;
30
+ }
31
+ return S.current > e.clientWidth + 30;
32
+ });
33
+ });
34
+ return t.observe(e), () => t.disconnect();
35
+ }, [g]);
36
+ let k = r.toArray(v).filter(a).filter((e) => e.type.displayName === "InlineViewSwitcherItem").map((e) => e.props), A = k.find((e) => e.name === i) ?? k[0], j = g === "compact" && C, M = g === "menu" && C;
37
+ c(() => {
38
+ if (M) return;
39
+ let e = x.current;
40
+ if (!e) return;
41
+ let t = e.querySelector("[aria-checked=\"true\"]");
42
+ t && O({
43
+ width: t.offsetWidth,
44
+ transform: `translateX(${t.offsetLeft}px)`
45
+ });
46
+ }, [
47
+ i,
48
+ M,
49
+ j
50
+ ]);
51
+ function N(e) {
52
+ let t = Array.from(x.current?.querySelectorAll("[role=radio]:not(:disabled)") ?? []), n = document.activeElement, r = n instanceof HTMLButtonElement ? t.indexOf(n) : -1;
15
53
  if (r === -1) return;
16
54
  let i = r;
17
55
  if (e.key === "ArrowRight" || e.key === "ArrowDown") i = (r + 1) % t.length;
@@ -21,27 +59,101 @@ var s = ({ value: t, onValueChange: n, variant: o = "default", "aria-label": s =
21
59
  else return;
22
60
  e.preventDefault(), t[i].focus(), t[i].click();
23
61
  }
24
- return /* @__PURE__ */ i(a.Provider, {
62
+ return /* @__PURE__ */ f(m.Provider, {
25
63
  value: {
26
- value: t,
27
- onValueChange: n
64
+ value: i,
65
+ onValueChange: o,
66
+ compact: j
28
67
  },
29
- children: /* @__PURE__ */ i("div", {
30
- ref: d,
31
- role: "radiogroup",
32
- "aria-label": s,
33
- onKeyDown: f,
68
+ children: /* @__PURE__ */ p("div", {
69
+ ref: x,
70
+ role: M ? void 0 : "radiogroup",
71
+ "aria-label": _,
72
+ onKeyDown: N,
34
73
  className: [
35
- e.switcher,
36
- e[o],
37
- l
74
+ n.switcher,
75
+ n[h],
76
+ g === "scroll" ? n.overflowScroll : null,
77
+ g === "compact" || g === "menu" ? n.overflowDetect : null,
78
+ j ? n.compact : null,
79
+ y
38
80
  ].filter(Boolean).join(" "),
39
- ...u,
40
- children: c
81
+ ...b,
82
+ children: [!M && /* @__PURE__ */ f("span", {
83
+ className: n.indicator,
84
+ style: D,
85
+ "aria-hidden": !0
86
+ }), M ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ p("button", {
87
+ type: "button",
88
+ className: [
89
+ n.item,
90
+ n.active,
91
+ n.menuTrigger
92
+ ].filter(Boolean).join(" "),
93
+ onClick: () => E(!0),
94
+ "aria-haspopup": "dialog",
95
+ "aria-label": `${_}: ${A?.label ?? A?.name}`,
96
+ children: [
97
+ A?.icon && /* @__PURE__ */ f("span", {
98
+ className: n.itemIcon,
99
+ children: /* @__PURE__ */ f(t, {
100
+ icon: A.icon,
101
+ size: "md",
102
+ "aria-hidden": !0
103
+ })
104
+ }),
105
+ A?.label && /* @__PURE__ */ f("span", {
106
+ className: n.itemLabel,
107
+ children: A.label
108
+ }),
109
+ /* @__PURE__ */ f("span", {
110
+ className: n.menuChevron,
111
+ "aria-hidden": "true",
112
+ children: "▾"
113
+ })
114
+ ]
115
+ }), /* @__PURE__ */ f(e, {
116
+ open: T,
117
+ title: _,
118
+ onClose: () => E(!1),
119
+ children: /* @__PURE__ */ f("div", {
120
+ className: n.menuList,
121
+ role: "radiogroup",
122
+ "aria-label": _,
123
+ children: k.map((e) => /* @__PURE__ */ p("button", {
124
+ type: "button",
125
+ role: "radio",
126
+ "aria-checked": e.name === i,
127
+ className: [n.menuListItem, e.name === i ? n.menuListItemActive : null].filter(Boolean).join(" "),
128
+ onClick: () => {
129
+ o(e.name), E(!1);
130
+ },
131
+ children: [
132
+ e.icon && /* @__PURE__ */ f("span", {
133
+ className: n.menuListItemIcon,
134
+ children: /* @__PURE__ */ f(t, {
135
+ icon: e.icon,
136
+ size: "md",
137
+ "aria-hidden": !0
138
+ })
139
+ }),
140
+ /* @__PURE__ */ f("span", {
141
+ className: n.menuListItemLabel,
142
+ children: e.label ?? e.name
143
+ }),
144
+ e.name === i && /* @__PURE__ */ f("span", {
145
+ className: n.menuListItemCheck,
146
+ "aria-hidden": "true",
147
+ children: "✓"
148
+ })
149
+ ]
150
+ }, e.name))
151
+ })
152
+ })] }) : v]
41
153
  })
42
154
  });
43
155
  };
44
156
  //#endregion
45
- export { s as InlineViewSwitcher, o as useInlineViewSwitcher };
157
+ export { g as InlineViewSwitcher, h as useInlineViewSwitcher };
46
158
 
47
159
  //# sourceMappingURL=InlineViewSwitcher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"InlineViewSwitcher.js","names":[],"sources":["../../../src/components/InlineViewSwitcher/InlineViewSwitcher.tsx"],"sourcesContent":["import {\n createContext,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n useContext,\n useRef,\n} from 'react';\n\nimport styles from './InlineViewSwitcher.module.css';\n\nexport type InlineViewSwitcherVariant = 'default' | 'flat' | 'round' | 'pill';\n\n// ─── Internal context ──────────────────────────────────────────────────────────\n\ninterface InlineViewSwitcherContextValue {\n value: string;\n onValueChange: (value: string) => void;\n}\n\nconst InlineViewSwitcherContext = createContext<InlineViewSwitcherContextValue | null>(null);\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport function useInlineViewSwitcher() {\n const ctx = useContext(InlineViewSwitcherContext);\n\n if (!ctx) {\n throw new Error('InlineViewSwitcherItem must be used inside InlineViewSwitcher');\n }\n\n return ctx;\n}\n\n// ─── InlineViewSwitcher ────────────────────────────────────────────────────────\n\nexport interface InlineViewSwitcherProps extends HTMLAttributes<HTMLDivElement> {\n /** Currently active view name. */\n value: string;\n /** Called with the new value when a view is selected. */\n onValueChange: (value: string) => void;\n /**\n * Visual style of the switcher.\n * - `default` — card background with border and shadow (same as `ToggleGroup`).\n * - `flat` — no background or border; active indicator only.\n * - `round` — pill-shaped container and items.\n * - `pill` — segmented-control style; active item appears lifted, no accent color.\n */\n variant?: InlineViewSwitcherVariant;\n /** Accessible label for the group. */\n 'aria-label'?: string;\n children?: ReactNode;\n}\n\n/**\n * Compact inline view switcher for placing inside content areas, cards, or\n * toolbars — wherever `ViewSwitcher` (header-bar sized) would be too heavy.\n *\n * Built on `ToggleGroup` internals with `flat` and `round` style variants.\n * Mirrors `AdwInlineViewSwitcher` (libadwaita 1.7 / GNOME 48).\n *\n * Compose with `InlineViewSwitcherItem`. Keyboard: ← / → cycle, Home / End jump.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.InlineViewSwitcher.html\n */\nexport const InlineViewSwitcher = ({\n value,\n onValueChange,\n variant = 'default',\n 'aria-label': ariaLabel = 'View switcher',\n children,\n className,\n ...props\n}: InlineViewSwitcherProps) => {\n const groupRef = useRef<HTMLDivElement>(null);\n\n function handleKeyDown(e: KeyboardEvent<HTMLDivElement>) {\n const items = Array.from(\n groupRef.current?.querySelectorAll<HTMLButtonElement>('[role=radio]:not(:disabled)') ?? [],\n );\n const activeElement = document.activeElement;\n const idx = activeElement instanceof HTMLButtonElement ? items.indexOf(activeElement) : -1;\n\n if (idx === -1) {\n return;\n }\n\n let next = idx;\n if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {\n next = (idx + 1) % items.length;\n } else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {\n next = (idx - 1 + items.length) % items.length;\n } else if (e.key === 'Home') {\n next = 0;\n } else if (e.key === 'End') {\n next = items.length - 1;\n } else {\n return;\n }\n\n e.preventDefault();\n items[next].focus();\n items[next].click();\n }\n\n return (\n <InlineViewSwitcherContext.Provider value={{ value, onValueChange }}>\n <div\n ref={groupRef}\n role=\"radiogroup\"\n aria-label={ariaLabel}\n onKeyDown={handleKeyDown}\n className={[styles.switcher, styles[variant], className].filter(Boolean).join(' ')}\n {...props}\n >\n {children}\n </div>\n </InlineViewSwitcherContext.Provider>\n );\n};\n"],"mappings":";;;;AAoBA,IAAM,IAA4B,EAAqD,IAAI;AAG3F,SAAgB,IAAwB;CACtC,IAAM,IAAM,EAAW,CAAyB;CAEhD,IAAI,CAAC,GACH,MAAU,MAAM,+DAA+D;CAGjF,OAAO;AACT;AAiCA,IAAa,KAAsB,EACjC,UACA,kBACA,aAAU,WACV,cAAc,IAAY,iBAC1B,aACA,cACA,GAAG,QAC0B;CAC7B,IAAM,IAAW,EAAuB,IAAI;CAE5C,SAAS,EAAc,GAAkC;EACvD,IAAM,IAAQ,MAAM,KAClB,EAAS,SAAS,iBAAoC,6BAA6B,KAAK,CAAC,CAC3F,GACM,IAAgB,SAAS,eACzB,IAAM,aAAyB,oBAAoB,EAAM,QAAQ,CAAa,IAAI;EAExF,IAAI,MAAQ,IACV;EAGF,IAAI,IAAO;EACX,IAAI,EAAE,QAAQ,gBAAgB,EAAE,QAAQ,aACtC,KAAQ,IAAM,KAAK,EAAM;OACpB,IAAI,EAAE,QAAQ,eAAe,EAAE,QAAQ,WAC5C,KAAQ,IAAM,IAAI,EAAM,UAAU,EAAM;OACnC,IAAI,EAAE,QAAQ,QACnB,IAAO;OACF,IAAI,EAAE,QAAQ,OACnB,IAAO,EAAM,SAAS;OAEtB;EAKF,AAFA,EAAE,eAAe,GACjB,EAAM,GAAM,MAAM,GAClB,EAAM,GAAM,MAAM;CACpB;CAEA,OACE,kBAAC,EAA0B,UAA3B;EAAoC,OAAO;GAAE;GAAO;EAAc;YAChE,kBAAC,OAAD;GACE,KAAK;GACL,MAAK;GACL,cAAY;GACZ,WAAW;GACX,WAAW;IAAC,EAAO;IAAU,EAAO;IAAU;GAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;GACjF,GAAI;GAEH;EACE,CAAA;CAC6B,CAAA;AAExC"}
1
+ {"version":3,"file":"InlineViewSwitcher.js","names":[],"sources":["../../../src/components/InlineViewSwitcher/InlineViewSwitcher.tsx"],"sourcesContent":["import {\n Children,\n type CSSProperties,\n createContext,\n type HTMLAttributes,\n isValidElement,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\n\nimport { BottomSheet } from '../BottomSheet';\nimport { Icon } from '../Icon';\n\nimport styles from './InlineViewSwitcher.module.css';\nimport type { InlineViewSwitcherItemProps } from './InlineViewSwitcherItem';\n\nexport type InlineViewSwitcherVariant = 'default' | 'flat' | 'round' | 'pill';\n\nexport type InlineViewSwitcherOverflow = 'wrap' | 'scroll' | 'compact' | 'menu';\n\n// ─── Internal context ──────────────────────────────────────────────────────────\n\ninterface InlineViewSwitcherContextValue {\n value: string;\n onValueChange: (value: string) => void;\n compact: boolean;\n}\n\nconst InlineViewSwitcherContext = createContext<InlineViewSwitcherContextValue | null>(null);\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport function useInlineViewSwitcher() {\n const ctx = useContext(InlineViewSwitcherContext);\n\n if (!ctx) {\n throw new Error('InlineViewSwitcherItem must be used inside InlineViewSwitcher');\n }\n\n return ctx;\n}\n\n// ─── InlineViewSwitcher ────────────────────────────────────────────────────────\n\nexport interface InlineViewSwitcherProps extends HTMLAttributes<HTMLDivElement> {\n /** Currently active view name. */\n value: string;\n /** Called with the new value when a view is selected. */\n onValueChange: (value: string) => void;\n /**\n * Visual style of the switcher.\n * - `default` — card background with border and shadow (same as `ToggleGroup`).\n * - `flat` — no background or border; active indicator only.\n * - `round` — pill-shaped container and items.\n * - `pill` — segmented-control style; active item appears lifted, no accent color.\n */\n variant?: InlineViewSwitcherVariant;\n /**\n * Overflow strategy when the container is too narrow for all items.\n * - `wrap` — default; items overflow with no special handling.\n * - `scroll` — horizontal scroll with hidden scrollbar.\n * - `compact` — collapses item labels to icons-only when overflowing (requires icons on all items).\n * - `menu` — shows the active item and a chevron trigger; all items open in a BottomSheet.\n */\n overflow?: InlineViewSwitcherOverflow;\n /** Accessible label for the group. */\n 'aria-label'?: string;\n children?: ReactNode;\n}\n\n/**\n * Compact inline view switcher for placing inside content areas, cards, or\n * toolbars — wherever `ViewSwitcher` (header-bar sized) would be too heavy.\n *\n * Built on `ToggleGroup` internals with `flat` and `round` style variants.\n * Mirrors `AdwInlineViewSwitcher` (libadwaita 1.7 / GNOME 48).\n *\n * Compose with `InlineViewSwitcherItem`. Keyboard: ← / → cycle, Home / End jump.\n *\n * @see https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.InlineViewSwitcher.html\n */\nexport const InlineViewSwitcher = ({\n value,\n onValueChange,\n variant = 'default',\n overflow = 'wrap',\n 'aria-label': ariaLabel = 'View switcher',\n children,\n className,\n ...props\n}: InlineViewSwitcherProps) => {\n const groupRef = useRef<HTMLDivElement>(null);\n const naturalWidthRef = useRef<number>(0);\n const [isOverflowing, setIsOverflowing] = useState(false);\n const [sheetOpen, setSheetOpen] = useState(false);\n const [indicatorStyle, setIndicatorStyle] = useState<CSSProperties>({\n width: 0,\n transform: 'translateX(0)',\n });\n\n useEffect(() => {\n if (overflow !== 'compact' && overflow !== 'menu') {\n setIsOverflowing(false);\n return;\n }\n const el = groupRef.current;\n if (!el) {\n return;\n }\n\n const check = () => {\n setIsOverflowing((prev) => {\n if (!prev) {\n const scrollW = el.scrollWidth;\n if (scrollW > el.clientWidth) {\n naturalWidthRef.current = scrollW;\n return true;\n }\n return false;\n }\n // 30px hysteresis: stay collapsed until container is comfortably wider\n return naturalWidthRef.current > el.clientWidth + 30;\n });\n };\n\n const ro = new ResizeObserver(check);\n ro.observe(el);\n return () => ro.disconnect();\n }, [overflow]);\n\n const allItems = Children.toArray(children)\n .filter(isValidElement)\n .filter(\n (child) => (child.type as { displayName?: string }).displayName === 'InlineViewSwitcherItem',\n )\n .map((child) => (child as ReactElement<InlineViewSwitcherItemProps>).props);\n\n const activeItem = allItems.find((i) => i.name === value) ?? allItems[0];\n const compact = overflow === 'compact' && isOverflowing;\n const inMenuMode = overflow === 'menu' && isOverflowing;\n\n // Track active item position for the sliding indicator\n useLayoutEffect(() => {\n if (inMenuMode) {\n return;\n }\n const group = groupRef.current;\n if (!group) {\n return;\n }\n const activeEl = group.querySelector<HTMLElement>('[aria-checked=\"true\"]');\n if (!activeEl) {\n return;\n }\n\n setIndicatorStyle({\n width: activeEl.offsetWidth,\n transform: `translateX(${activeEl.offsetLeft}px)`,\n });\n }, [value, inMenuMode, compact]);\n\n function handleKeyDown(e: KeyboardEvent<HTMLDivElement>) {\n const items = Array.from(\n groupRef.current?.querySelectorAll<HTMLButtonElement>('[role=radio]:not(:disabled)') ?? [],\n );\n const activeElement = document.activeElement;\n const idx = activeElement instanceof HTMLButtonElement ? items.indexOf(activeElement) : -1;\n\n if (idx === -1) {\n return;\n }\n\n let next = idx;\n if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {\n next = (idx + 1) % items.length;\n } else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {\n next = (idx - 1 + items.length) % items.length;\n } else if (e.key === 'Home') {\n next = 0;\n } else if (e.key === 'End') {\n next = items.length - 1;\n } else {\n return;\n }\n\n e.preventDefault();\n items[next].focus();\n items[next].click();\n }\n\n return (\n <InlineViewSwitcherContext.Provider value={{ value, onValueChange, compact }}>\n <div\n ref={groupRef}\n role={inMenuMode ? undefined : 'radiogroup'}\n aria-label={ariaLabel}\n onKeyDown={handleKeyDown}\n className={[\n styles.switcher,\n styles[variant],\n overflow === 'scroll' ? styles.overflowScroll : null,\n overflow === 'compact' || overflow === 'menu' ? styles.overflowDetect : null,\n compact ? styles.compact : null,\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n {...props}\n >\n {!inMenuMode && <span className={styles.indicator} style={indicatorStyle} aria-hidden />}\n {inMenuMode ? (\n <>\n <button\n type=\"button\"\n className={[styles.item, styles.active, styles.menuTrigger].filter(Boolean).join(' ')}\n onClick={() => setSheetOpen(true)}\n aria-haspopup=\"dialog\"\n aria-label={`${ariaLabel}: ${activeItem?.label ?? activeItem?.name}`}\n >\n {activeItem?.icon && (\n <span className={styles.itemIcon}>\n <Icon icon={activeItem.icon} size=\"md\" aria-hidden />\n </span>\n )}\n {activeItem?.label && <span className={styles.itemLabel}>{activeItem.label}</span>}\n <span className={styles.menuChevron} aria-hidden=\"true\">\n ▾\n </span>\n </button>\n <BottomSheet open={sheetOpen} title={ariaLabel} onClose={() => setSheetOpen(false)}>\n <div className={styles.menuList} role=\"radiogroup\" aria-label={ariaLabel}>\n {allItems.map((item) => (\n <button\n key={item.name}\n type=\"button\"\n role=\"radio\"\n aria-checked={item.name === value}\n className={[\n styles.menuListItem,\n item.name === value ? styles.menuListItemActive : null,\n ]\n .filter(Boolean)\n .join(' ')}\n onClick={() => {\n onValueChange(item.name);\n setSheetOpen(false);\n }}\n >\n {item.icon && (\n <span className={styles.menuListItemIcon}>\n <Icon icon={item.icon} size=\"md\" aria-hidden />\n </span>\n )}\n <span className={styles.menuListItemLabel}>{item.label ?? item.name}</span>\n {item.name === value && (\n <span className={styles.menuListItemCheck} aria-hidden=\"true\">\n ✓\n </span>\n )}\n </button>\n ))}\n </div>\n </BottomSheet>\n </>\n ) : (\n children\n )}\n </div>\n </InlineViewSwitcherContext.Provider>\n );\n};\n"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- var e={switcher:`_switcher_2455r_3`,item:`_item_2455r_10`,iconOnly:`_iconOnly_2455r_38`,itemIcon:`_itemIcon_2455r_43`,itemLabel:`_itemLabel_2455r_49`,default:`_default_2455r_55`,active:`_active_2455r_68`,flat:`_flat_2455r_123`,round:`_round_2455r_171`,pill:`_pill_2455r_237`};exports.default=e;
1
+ var e={switcher:`_switcher_l6v4v_3`,indicator:`_indicator_l6v4v_11`,item:`_item_l6v4v_26`,iconOnly:`_iconOnly_l6v4v_57`,itemIcon:`_itemIcon_l6v4v_62`,itemLabel:`_itemLabel_l6v4v_68`,default:`_default_l6v4v_74`,active:`_active_l6v4v_87`,flat:`_flat_l6v4v_148`,round:`_round_l6v4v_202`,pill:`_pill_l6v4v_271`,overflowDetect:`_overflowDetect_l6v4v_342`,overflowScroll:`_overflowScroll_l6v4v_350`,compact:`_compact_l6v4v_370`,menuTrigger:`_menuTrigger_l6v4v_376`,menuChevron:`_menuChevron_l6v4v_380`,menuList:`_menuList_l6v4v_388`,menuListItem:`_menuListItem_l6v4v_395`,menuListItemActive:`_menuListItemActive_l6v4v_434`,menuListItemIcon:`_menuListItemIcon_l6v4v_439`,menuListItemLabel:`_menuListItemLabel_l6v4v_445`,menuListItemCheck:`_menuListItemCheck_l6v4v_449`};exports.default=e;
2
2
  //# sourceMappingURL=InlineViewSwitcher.module.css.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"InlineViewSwitcher.module.css.cjs","names":[],"sources":["../../../src/components/InlineViewSwitcher/InlineViewSwitcher.module.css"],"sourcesContent":["/* ─── Switcher container ────────────────────────────────────────────────────── */\n\n.switcher {\n display: inline-flex;\n align-items: stretch;\n}\n\n/* ─── Item base ─────────────────────────────────────────────────────────────── */\n\n.item {\n appearance: none;\n -webkit-appearance: none;\n border: none;\n background: transparent;\n font: inherit;\n cursor: pointer;\n outline: none;\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--gnome-space-1, 6px);\n\n padding: 4px var(--gnome-space-2, 12px);\n min-height: 28px;\n\n font-family: var(--gnome-font-family);\n font-size: var(--gnome-font-size-body, 1rem);\n font-weight: var(--gnome-font-weight-normal, 400);\n color: var(--gnome-window-fg-color, rgba(0, 0, 0, 0.8));\n white-space: nowrap;\n\n transition:\n background-color var(--gnome-duration-fast) var(--gnome-easing-default),\n box-shadow var(--gnome-duration-fast) var(--gnome-easing-default);\n}\n\n.iconOnly {\n padding: 4px;\n min-width: 28px;\n}\n\n.itemIcon {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n}\n\n.itemLabel {\n line-height: 1;\n}\n\n/* ─── Variant: default ──────────────────────────────────────────────────────── */\n\n.default {\n background-color: var(--gnome-card-bg-color, #ffffff);\n border: 1px solid var(--gnome-light-3, #deddda);\n border-radius: var(--gnome-radius-md);\n box-shadow: var(--gnome-shadow-sm);\n padding: 2px;\n gap: 2px;\n}\n\n.default .item {\n border-radius: calc(var(--gnome-radius-md) - 2px);\n}\n\n.default .item:hover:not(:disabled):not(.active) {\n background-color: rgba(0, 0, 0, 0.06);\n}\n\n.default .item:active:not(:disabled):not(.active) {\n background-color: rgba(0, 0, 0, 0.12);\n}\n\n.default .item:focus-visible {\n box-shadow:\n 0 0 0 var(--gnome-focus-ring-offset, 2px) var(--gnome-card-bg-color, #ffffff),\n 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 2px))\n var(--gnome-focus-ring-color, #3584e4);\n}\n\n.default .active {\n background-color: color-mix(in srgb, var(--gnome-accent-bg-color, #3584e4) 15%, transparent);\n color: var(--gnome-accent-color, #3584e4);\n font-weight: var(--gnome-font-weight-semibold, 600);\n box-shadow: inset 0 0 0 1px\n color-mix(in srgb, var(--gnome-accent-bg-color, #3584e4) 40%, transparent);\n}\n\n@media (prefers-color-scheme: dark) {\n .default {\n background-color: var(--gnome-card-bg-color, #383838);\n border-color: rgba(255, 255, 255, 0.12);\n box-shadow: none;\n }\n\n .default .item:hover:not(:disabled):not(.active) {\n background-color: rgba(255, 255, 255, 0.08);\n }\n\n .default .item:active:not(:disabled):not(.active) {\n background-color: rgba(255, 255, 255, 0.14);\n }\n\n .default .item:focus-visible {\n box-shadow:\n 0 0 0 var(--gnome-focus-ring-offset, 2px) var(--gnome-card-bg-color, #383838),\n 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 2px))\n var(--gnome-focus-ring-color, #78aeed);\n }\n\n .default .active {\n background-color: color-mix(in srgb, var(--gnome-accent-bg-color, #3584e4) 25%, transparent);\n color: var(--gnome-accent-color, #78aeed);\n box-shadow: inset 0 0 0 1px\n color-mix(in srgb, var(--gnome-accent-bg-color, #3584e4) 50%, transparent);\n }\n}\n\n/* ─── Variant: flat ─────────────────────────────────────────────────────────── */\n\n.flat {\n background: transparent;\n border: none;\n box-shadow: none;\n border-radius: var(--gnome-radius-md);\n padding: 2px;\n gap: 2px;\n}\n\n.flat .item {\n border-radius: calc(var(--gnome-radius-md) - 2px);\n color: var(--gnome-window-fg-color, rgba(0, 0, 0, 0.6));\n}\n\n.flat .item:hover:not(:disabled):not(.active) {\n background-color: var(--gnome-hover-overlay);\n}\n\n.flat .item:active:not(:disabled):not(.active) {\n background-color: var(--gnome-active-overlay);\n}\n\n.flat .item:focus-visible {\n box-shadow:\n 0 0 0 var(--gnome-focus-ring-offset, 2px) var(--gnome-window-bg-color, #fafafa),\n 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 2px))\n var(--gnome-focus-ring-color, #3584e4);\n}\n\n.flat .active {\n background-color: color-mix(in srgb, var(--gnome-accent-bg-color, #3584e4) 15%, transparent);\n color: var(--gnome-accent-color, #3584e4);\n font-weight: var(--gnome-font-weight-semibold, 600);\n}\n\n@media (prefers-color-scheme: dark) {\n .flat .item {\n color: var(--gnome-window-fg-color, rgba(255, 255, 255, 0.6));\n }\n\n .flat .active {\n background-color: color-mix(in srgb, var(--gnome-accent-bg-color, #3584e4) 25%, transparent);\n color: var(--gnome-accent-color, #78aeed);\n }\n}\n\n/* ─── Variant: round ────────────────────────────────────────────────────────── */\n\n.round {\n background-color: var(--gnome-card-bg-color, #ffffff);\n border: 1px solid var(--gnome-light-3, #deddda);\n border-radius: var(--gnome-radius-pill, 9999px);\n box-shadow: var(--gnome-shadow-sm);\n padding: 2px;\n gap: 2px;\n}\n\n.round .item {\n border-radius: var(--gnome-radius-pill, 9999px);\n padding: 4px var(--gnome-space-2, 12px);\n}\n\n.round .iconOnly {\n padding: 4px;\n min-width: 28px;\n}\n\n.round .item:hover:not(:disabled):not(.active) {\n background-color: rgba(0, 0, 0, 0.06);\n}\n\n.round .item:active:not(:disabled):not(.active) {\n background-color: rgba(0, 0, 0, 0.12);\n}\n\n.round .item:focus-visible {\n box-shadow:\n 0 0 0 var(--gnome-focus-ring-offset, 2px) var(--gnome-card-bg-color, #ffffff),\n 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 2px))\n var(--gnome-focus-ring-color, #3584e4);\n}\n\n.round .active {\n background-color: var(--gnome-accent-bg-color, #3584e4);\n color: var(--gnome-accent-fg-color, #ffffff);\n font-weight: var(--gnome-font-weight-semibold, 600);\n box-shadow: none;\n}\n\n@media (prefers-color-scheme: dark) {\n .round {\n background-color: var(--gnome-card-bg-color, #383838);\n border-color: rgba(255, 255, 255, 0.12);\n box-shadow: none;\n }\n\n .round .item:hover:not(:disabled):not(.active) {\n background-color: rgba(255, 255, 255, 0.08);\n }\n\n .round .item:active:not(:disabled):not(.active) {\n background-color: rgba(255, 255, 255, 0.14);\n }\n\n .round .item:focus-visible {\n box-shadow:\n 0 0 0 var(--gnome-focus-ring-offset, 2px) var(--gnome-card-bg-color, #383838),\n 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 2px))\n var(--gnome-focus-ring-color, #78aeed);\n }\n}\n\n/* ─── Variant: pill ─────────────────────────────────────────────────────────── */\n\n.pill {\n background-color: var(--gnome-hover-overlay, rgba(0, 0, 0, 0.06));\n border: none;\n border-radius: var(--gnome-radius-pill, 9999px);\n box-shadow: none;\n padding: 3px;\n gap: 2px;\n}\n\n.pill .item {\n border-radius: var(--gnome-radius-pill, 9999px);\n padding: 5px var(--gnome-space-2, 16px);\n color: var(--gnome-window-fg-color);\n}\n\n.pill .item:hover:not(:disabled):not(.active) {\n background-color: rgba(0, 0, 0, 0.04);\n}\n\n.pill .item:active:not(:disabled):not(.active) {\n background-color: rgba(0, 0, 0, 0.08);\n}\n\n.pill .item:focus-visible {\n box-shadow:\n 0 0 0 var(--gnome-focus-ring-offset, 2px) transparent,\n 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 2px))\n var(--gnome-focus-ring-color, #3584e4);\n}\n\n.pill .active {\n background-color: var(--gnome-card-bg-color, #ffffff);\n box-shadow: var(--gnome-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.12));\n font-weight: var(--gnome-font-weight-semibold, 600);\n color: var(--gnome-window-fg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n .pill {\n background-color: var(--gnome-hover-overlay, rgba(255, 255, 255, 0.08));\n }\n\n .pill .item:hover:not(:disabled):not(.active) {\n background-color: rgba(255, 255, 255, 0.05);\n }\n\n .pill .item:active:not(:disabled):not(.active) {\n background-color: rgba(255, 255, 255, 0.1);\n }\n\n .pill .active {\n background-color: var(--gnome-card-bg-color, #383838);\n box-shadow: none;\n }\n}\n\n/* ─── Disabled ──────────────────────────────────────────────────────────────── */\n\n.item:disabled {\n opacity: var(--gnome-opacity-disabled, 0.5);\n cursor: not-allowed;\n}\n\n/* ─── Reduced motion ────────────────────────────────────────────────────────── */\n\n@media (prefers-reduced-motion: reduce) {\n .item {\n transition: none;\n }\n}\n"],"mappings":""}
1
+ {"version":3,"file":"InlineViewSwitcher.module.css.cjs","names":[],"sources":["../../../src/components/InlineViewSwitcher/InlineViewSwitcher.module.css"],"sourcesContent":["/* ─── Switcher container ────────────────────────────────────────────────────── */\n\n.switcher {\n display: inline-flex;\n align-items: stretch;\n position: relative;\n}\n\n/* ─── Sliding indicator ─────────────────────────────────────────────────────── */\n\n.indicator {\n position: absolute;\n top: 2px;\n bottom: 2px;\n left: 0;\n border-radius: calc(var(--gnome-radius-md) - 2px);\n pointer-events: none;\n z-index: 0;\n transition:\n transform 160ms cubic-bezier(0.34, 1.2, 0.64, 1),\n width 160ms var(--gnome-easing-default, ease);\n}\n\n/* ─── Item base ─────────────────────────────────────────────────────────────── */\n\n.item {\n appearance: none;\n -webkit-appearance: none;\n border: none;\n background: transparent;\n font: inherit;\n cursor: pointer;\n outline: none;\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--gnome-space-1, 6px);\n\n padding: 4px var(--gnome-space-2, 12px);\n min-height: 28px;\n\n font-family: var(--gnome-font-family);\n font-size: var(--gnome-font-size-body, 1rem);\n font-weight: var(--gnome-font-weight-normal, 400);\n color: var(--gnome-window-fg-color, rgba(0, 0, 0, 0.8));\n white-space: nowrap;\n\n transition:\n background-color var(--gnome-duration-fast) var(--gnome-easing-default),\n box-shadow var(--gnome-duration-fast) var(--gnome-easing-default);\n\n position: relative;\n z-index: 1;\n}\n\n.iconOnly {\n padding: 4px;\n min-width: 28px;\n}\n\n.itemIcon {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n}\n\n.itemLabel {\n line-height: 1;\n}\n\n/* ─── Variant: default ──────────────────────────────────────────────────────── */\n\n.default {\n background-color: var(--gnome-card-bg-color, #ffffff);\n border: 1px solid var(--gnome-light-3, #deddda);\n border-radius: var(--gnome-radius-md);\n box-shadow: var(--gnome-shadow-sm);\n padding: 2px;\n gap: 2px;\n}\n\n.default .item {\n border-radius: calc(var(--gnome-radius-md) - 2px);\n}\n\n.default .item:hover:not(:disabled):not(.active) {\n background-color: rgba(0, 0, 0, 0.06);\n}\n\n.default .item:active:not(:disabled):not(.active) {\n background-color: rgba(0, 0, 0, 0.12);\n}\n\n.default .item:focus-visible {\n box-shadow:\n 0 0 0 var(--gnome-focus-ring-offset, 2px) var(--gnome-card-bg-color, #ffffff),\n 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 2px))\n var(--gnome-focus-ring-color, #3584e4);\n}\n\n.default .indicator {\n background-color: color-mix(in srgb, var(--gnome-accent-bg-color, #3584e4) 15%, transparent);\n box-shadow: inset 0 0 0 1px\n color-mix(in srgb, var(--gnome-accent-bg-color, #3584e4) 40%, transparent);\n}\n\n.default .active {\n color: var(--gnome-accent-color, #3584e4);\n font-weight: var(--gnome-font-weight-semibold, 600);\n}\n\n@media (prefers-color-scheme: dark) {\n .default {\n background-color: var(--gnome-card-bg-color, #383838);\n border-color: rgba(255, 255, 255, 0.12);\n box-shadow: none;\n }\n\n .default .item:hover:not(:disabled):not(.active) {\n background-color: rgba(255, 255, 255, 0.08);\n }\n\n .default .item:active:not(:disabled):not(.active) {\n background-color: rgba(255, 255, 255, 0.14);\n }\n\n .default .item:focus-visible {\n box-shadow:\n 0 0 0 var(--gnome-focus-ring-offset, 2px) var(--gnome-card-bg-color, #383838),\n 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 2px))\n var(--gnome-focus-ring-color, #78aeed);\n }\n\n .default .indicator {\n background-color: color-mix(in srgb, var(--gnome-accent-bg-color, #3584e4) 25%, transparent);\n box-shadow: inset 0 0 0 1px\n color-mix(in srgb, var(--gnome-accent-bg-color, #3584e4) 50%, transparent);\n }\n\n .default .active {\n color: var(--gnome-accent-color, #78aeed);\n }\n}\n\n/* ─── Variant: flat ─────────────────────────────────────────────────────────── */\n\n.flat {\n background: transparent;\n border: none;\n box-shadow: none;\n border-radius: var(--gnome-radius-md);\n padding: 2px;\n gap: 2px;\n}\n\n.flat .item {\n border-radius: calc(var(--gnome-radius-md) - 2px);\n color: var(--gnome-window-fg-color, rgba(0, 0, 0, 0.6));\n}\n\n.flat .item:hover:not(:disabled):not(.active) {\n background-color: var(--gnome-hover-overlay);\n}\n\n.flat .item:active:not(:disabled):not(.active) {\n background-color: var(--gnome-active-overlay);\n}\n\n.flat .item:focus-visible {\n box-shadow:\n 0 0 0 var(--gnome-focus-ring-offset, 2px) var(--gnome-window-bg-color, #fafafa),\n 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 2px))\n var(--gnome-focus-ring-color, #3584e4);\n}\n\n.flat .indicator {\n background-color: color-mix(in srgb, var(--gnome-accent-bg-color, #3584e4) 15%, transparent);\n}\n\n.flat .active {\n color: var(--gnome-accent-color, #3584e4);\n font-weight: var(--gnome-font-weight-semibold, 600);\n}\n\n@media (prefers-color-scheme: dark) {\n .flat .item {\n color: var(--gnome-window-fg-color, rgba(255, 255, 255, 0.6));\n }\n\n .flat .indicator {\n background-color: color-mix(in srgb, var(--gnome-accent-bg-color, #3584e4) 25%, transparent);\n }\n\n .flat .active {\n color: var(--gnome-accent-color, #78aeed);\n }\n}\n\n/* ─── Variant: round ────────────────────────────────────────────────────────── */\n\n.round {\n background-color: var(--gnome-card-bg-color, #ffffff);\n border: 1px solid var(--gnome-light-3, #deddda);\n border-radius: var(--gnome-radius-pill, 9999px);\n box-shadow: var(--gnome-shadow-sm);\n padding: 2px;\n gap: 2px;\n}\n\n.round .item {\n border-radius: var(--gnome-radius-pill, 9999px);\n padding: 4px var(--gnome-space-2, 12px);\n}\n\n.round .iconOnly {\n padding: 4px;\n min-width: 28px;\n}\n\n.round .item:hover:not(:disabled):not(.active) {\n background-color: rgba(0, 0, 0, 0.06);\n}\n\n.round .item:active:not(:disabled):not(.active) {\n background-color: rgba(0, 0, 0, 0.12);\n}\n\n.round .item:focus-visible {\n box-shadow:\n 0 0 0 var(--gnome-focus-ring-offset, 2px) var(--gnome-card-bg-color, #ffffff),\n 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 2px))\n var(--gnome-focus-ring-color, #3584e4);\n}\n\n.round .indicator {\n background-color: var(--gnome-accent-bg-color, #3584e4);\n border-radius: var(--gnome-radius-pill, 9999px);\n}\n\n.round .active {\n color: var(--gnome-accent-fg-color, #ffffff);\n font-weight: var(--gnome-font-weight-semibold, 600);\n}\n\n@media (prefers-color-scheme: dark) {\n .round {\n background-color: var(--gnome-card-bg-color, #383838);\n border-color: rgba(255, 255, 255, 0.12);\n box-shadow: none;\n }\n\n .round .item:hover:not(:disabled):not(.active) {\n background-color: rgba(255, 255, 255, 0.08);\n }\n\n .round .item:active:not(:disabled):not(.active) {\n background-color: rgba(255, 255, 255, 0.14);\n }\n\n .round .item:focus-visible {\n box-shadow:\n 0 0 0 var(--gnome-focus-ring-offset, 2px) var(--gnome-card-bg-color, #383838),\n 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 2px))\n var(--gnome-focus-ring-color, #78aeed);\n }\n}\n\n/* ─── Variant: pill ─────────────────────────────────────────────────────────── */\n\n.pill {\n background-color: var(--gnome-hover-overlay, rgba(0, 0, 0, 0.06));\n border: none;\n border-radius: var(--gnome-radius-pill, 9999px);\n box-shadow: none;\n padding: 3px;\n gap: 2px;\n}\n\n.pill .item {\n border-radius: var(--gnome-radius-pill, 9999px);\n padding: 5px var(--gnome-space-2, 16px);\n color: var(--gnome-window-fg-color);\n}\n\n.pill .item:hover:not(:disabled):not(.active) {\n background-color: rgba(0, 0, 0, 0.04);\n}\n\n.pill .item:active:not(:disabled):not(.active) {\n background-color: rgba(0, 0, 0, 0.08);\n}\n\n.pill .item:focus-visible {\n box-shadow:\n 0 0 0 var(--gnome-focus-ring-offset, 2px) transparent,\n 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 2px))\n var(--gnome-focus-ring-color, #3584e4);\n}\n\n.pill .indicator {\n background-color: var(--gnome-card-bg-color, #ffffff);\n box-shadow: var(--gnome-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.12));\n border-radius: var(--gnome-radius-pill, 9999px);\n top: 3px;\n bottom: 3px;\n}\n\n.pill .active {\n font-weight: var(--gnome-font-weight-semibold, 600);\n color: var(--gnome-window-fg-color);\n}\n\n@media (prefers-color-scheme: dark) {\n .pill {\n background-color: var(--gnome-hover-overlay, rgba(255, 255, 255, 0.08));\n }\n\n .pill .item:hover:not(:disabled):not(.active) {\n background-color: rgba(255, 255, 255, 0.05);\n }\n\n .pill .item:active:not(:disabled):not(.active) {\n background-color: rgba(255, 255, 255, 0.1);\n }\n\n .pill .indicator {\n background-color: var(--gnome-card-bg-color, #383838);\n box-shadow: none;\n }\n}\n\n/* ─── Disabled ──────────────────────────────────────────────────────────────── */\n\n.item:disabled {\n opacity: var(--gnome-opacity-disabled, 0.5);\n cursor: not-allowed;\n}\n\n/* ─── Overflow: detect (compact / menu) — must be display:flex so clientWidth is constrained ── */\n\n.overflowDetect {\n display: flex;\n min-width: 0;\n width: 100%;\n}\n\n/* ─── Overflow: scroll ──────────────────────────────────────────────────────── */\n\n.overflowScroll {\n max-width: 100%;\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n -webkit-overflow-scrolling: touch;\n scroll-snap-type: x mandatory;\n}\n\n.overflowScroll::-webkit-scrollbar {\n display: none;\n}\n\n.overflowScroll .item {\n scroll-snap-align: start;\n flex-shrink: 0;\n}\n\n/* ─── Overflow: compact (icon-only) ─────────────────────────────────────────── */\n\n.compact .itemLabel {\n display: none;\n}\n\n/* ─── Overflow: menu trigger ────────────────────────────────────────────────── */\n\n.menuTrigger {\n gap: var(--gnome-space-1, 6px);\n}\n\n.menuChevron {\n font-size: 0.75rem;\n opacity: 0.6;\n margin-left: 2px;\n}\n\n/* ─── Overflow: menu BottomSheet list ───────────────────────────────────────── */\n\n.menuList {\n display: flex;\n flex-direction: column;\n gap: 2px;\n padding: 4px 0;\n}\n\n.menuListItem {\n appearance: none;\n -webkit-appearance: none;\n border: none;\n background: transparent;\n font: inherit;\n cursor: pointer;\n outline: none;\n\n display: flex;\n align-items: center;\n gap: var(--gnome-space-2, 12px);\n padding: var(--gnome-space-2, 12px) var(--gnome-space-3, 16px);\n border-radius: var(--gnome-radius-md);\n\n font-family: var(--gnome-font-family);\n font-size: var(--gnome-font-size-body, 1rem);\n color: var(--gnome-window-fg-color, rgba(0, 0, 0, 0.8));\n text-align: left;\n width: 100%;\n\n transition: background-color var(--gnome-duration-fast) var(--gnome-easing-default);\n}\n\n.menuListItem:hover:not(:disabled) {\n background-color: rgba(0, 0, 0, 0.06);\n}\n\n.menuListItem:active:not(:disabled) {\n background-color: rgba(0, 0, 0, 0.12);\n}\n\n.menuListItem:focus-visible {\n box-shadow:\n 0 0 0 var(--gnome-focus-ring-offset, 2px) var(--gnome-window-bg-color, #fafafa),\n 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 2px))\n var(--gnome-focus-ring-color, #3584e4);\n}\n\n.menuListItemActive {\n color: var(--gnome-accent-color, #3584e4);\n font-weight: var(--gnome-font-weight-semibold, 600);\n}\n\n.menuListItemIcon {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n}\n\n.menuListItemLabel {\n flex: 1;\n}\n\n.menuListItemCheck {\n color: var(--gnome-accent-color, #3584e4);\n font-size: 1rem;\n flex-shrink: 0;\n}\n\n@media (prefers-color-scheme: dark) {\n .menuListItem:hover:not(:disabled) {\n background-color: rgba(255, 255, 255, 0.08);\n }\n\n .menuListItem:active:not(:disabled) {\n background-color: rgba(255, 255, 255, 0.14);\n }\n\n .menuListItem:focus-visible {\n box-shadow:\n 0 0 0 var(--gnome-focus-ring-offset, 2px) var(--gnome-window-bg-color, #1e1e1e),\n 0 0 0 calc(var(--gnome-focus-ring-offset, 2px) + var(--gnome-focus-ring-width, 2px))\n var(--gnome-focus-ring-color, #78aeed);\n }\n\n .menuListItemActive {\n color: var(--gnome-accent-color, #78aeed);\n }\n\n .menuListItemCheck {\n color: var(--gnome-accent-color, #78aeed);\n }\n}\n\n/* ─── Reduced motion ────────────────────────────────────────────────────────── */\n\n@media (prefers-reduced-motion: reduce) {\n .item,\n .indicator,\n .menuListItem {\n transition: none;\n }\n}\n"],"mappings":""}
@@ -1,14 +1,26 @@
1
1
  var e = {
2
- switcher: "_switcher_2455r_3",
3
- item: "_item_2455r_10",
4
- iconOnly: "_iconOnly_2455r_38",
5
- itemIcon: "_itemIcon_2455r_43",
6
- itemLabel: "_itemLabel_2455r_49",
7
- default: "_default_2455r_55",
8
- active: "_active_2455r_68",
9
- flat: "_flat_2455r_123",
10
- round: "_round_2455r_171",
11
- pill: "_pill_2455r_237"
2
+ switcher: "_switcher_l6v4v_3",
3
+ indicator: "_indicator_l6v4v_11",
4
+ item: "_item_l6v4v_26",
5
+ iconOnly: "_iconOnly_l6v4v_57",
6
+ itemIcon: "_itemIcon_l6v4v_62",
7
+ itemLabel: "_itemLabel_l6v4v_68",
8
+ default: "_default_l6v4v_74",
9
+ active: "_active_l6v4v_87",
10
+ flat: "_flat_l6v4v_148",
11
+ round: "_round_l6v4v_202",
12
+ pill: "_pill_l6v4v_271",
13
+ overflowDetect: "_overflowDetect_l6v4v_342",
14
+ overflowScroll: "_overflowScroll_l6v4v_350",
15
+ compact: "_compact_l6v4v_370",
16
+ menuTrigger: "_menuTrigger_l6v4v_376",
17
+ menuChevron: "_menuChevron_l6v4v_380",
18
+ menuList: "_menuList_l6v4v_388",
19
+ menuListItem: "_menuListItem_l6v4v_395",
20
+ menuListItemActive: "_menuListItemActive_l6v4v_434",
21
+ menuListItemIcon: "_menuListItemIcon_l6v4v_439",
22
+ menuListItemLabel: "_menuListItemLabel_l6v4v_445",
23
+ menuListItemCheck: "_menuListItemCheck_l6v4v_449"
12
24
  };
13
25
  //#endregion
14
26
  export { e as default };