@nxgt/material 3.17.0 → 3.18.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 (66) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +1 -1
  3. package/dist/{async-slice-BA7wI9qp.js → async-slice-gqif7FX9.js} +2 -2
  4. package/dist/{button-DOYHfcMJ.js → button-Ck1Bif-Q.js} +1 -1
  5. package/dist/charts.js +3 -3
  6. package/dist/{chip-C8MB2xzb.js → chip-B9pZFWbi.js} +1 -1
  7. package/dist/{code-editor-BqeS_XMJ.js → code-editor-M4DcaX-P.js} +4 -4
  8. package/dist/code-editor.js +4 -4
  9. package/dist/{code-language-items-DOr9J9yu.js → code-language-items-Bnm_WDVg.js} +2 -2
  10. package/dist/{components-D5-uZqnU.js → components-nq1rUKCK.js} +19141 -18576
  11. package/dist/components.js +15 -15
  12. package/dist/{dialog-CFIn1NPR.js → dialog-jYcWDh9G.js} +1 -1
  13. package/dist/dnd.js +1 -1
  14. package/dist/{dropdown-menu-CL6mNhgT.js → dropdown-menu-BEZhNnhr.js} +1 -1
  15. package/dist/editor.js +7 -7
  16. package/dist/{empty-state-BNljKZLV.js → empty-state-BBUsR0_X.js} +1 -1
  17. package/dist/hooks.js +2 -2
  18. package/dist/{i18n-provider-WReTVxE3.js → i18n-provider-3TsMIGn1.js} +1 -1
  19. package/dist/i18n.js +5 -5
  20. package/dist/{icon-badge-lfAUxNe8.js → icon-badge-92uhu2o6.js} +1 -1
  21. package/dist/lib/components/ui/selection/switcher/partials/switcher-footer.d.ts +13 -0
  22. package/dist/lib/components/ui/selection/switcher/partials/switcher-groups.d.ts +9 -0
  23. package/dist/lib/components/ui/selection/switcher/partials/switcher-list.d.ts +8 -0
  24. package/dist/lib/components/ui/selection/switcher/partials/switcher-menu.d.ts +13 -0
  25. package/dist/lib/components/ui/selection/switcher/partials/switcher-popover.d.ts +12 -0
  26. package/dist/lib/components/ui/selection/switcher/partials/switcher-row.d.ts +22 -0
  27. package/dist/lib/components/ui/selection/switcher/partials/switcher-search.d.ts +14 -0
  28. package/dist/lib/components/ui/selection/switcher/partials/switcher-sheet.d.ts +12 -0
  29. package/dist/lib/components/ui/selection/switcher/partials/switcher-tile.d.ts +7 -0
  30. package/dist/lib/components/ui/selection/switcher/partials/switcher-tooltip.d.ts +9 -0
  31. package/dist/lib/components/ui/selection/switcher/partials/switcher-trigger.d.ts +17 -0
  32. package/dist/lib/components/ui/selection/switcher/switcher.d.ts +10 -15
  33. package/dist/lib/components/ui/selection/switcher/switcher.utils.d.ts +13 -0
  34. package/dist/lib/components/ui/selection/switcher/types.d.ts +73 -0
  35. package/dist/lib/components/ui/selection/switcher/use-clipped.d.ts +3 -0
  36. package/dist/lib/components/ui/selection/switcher/use-switcher-list.d.ts +21 -0
  37. package/dist/lib/i18n/resources/en/en.d.ts +10 -0
  38. package/dist/lib/i18n/resources/en/material.json.d.ts +10 -0
  39. package/dist/lib/i18n/resources/fr/fr.d.ts +10 -0
  40. package/dist/lib/i18n/resources/fr/material.json.d.ts +10 -0
  41. package/dist/lib/i18n/resources/resources.d.ts +20 -0
  42. package/dist/lib/i18n/translator.d.ts +1 -1
  43. package/dist/lib.js +1 -1
  44. package/dist/main.js +21 -21
  45. package/dist/map.js +4 -4
  46. package/dist/material.css +1 -1
  47. package/dist/pdf-reader.js +1 -1
  48. package/dist/print.js +2 -2
  49. package/dist/{public-B4lpmahC.js → public-BLw13izR.js} +6 -6
  50. package/dist/{rich-code-block-CvqJmvuT.js → rich-code-block-DPe5USBG.js} +4 -4
  51. package/dist/{sortable-provider-DE692phf.js → sortable-provider-CtAb1Q02.js} +1 -1
  52. package/dist/{spinner-CGgOgUCe.js → spinner-CcmXeIHf.js} +1 -1
  53. package/dist/{stored-language-DiCe2ZcR.js → stored-language-CsDEJDR7.js} +22 -2
  54. package/dist/theme-picker.js +2 -2
  55. package/dist/{theme-toggle-O6z6PokP.js → theme-toggle-CWovcIQY.js} +1 -1
  56. package/dist/{toolbar-items-DCZxamGy.js → toolbar-items-CrATPuOX.js} +2 -2
  57. package/dist/{translate-material-DZ_i8xJx.js → translate-material-X1daoGxE.js} +2 -2
  58. package/dist/{translator-Ch1dEqFf.js → translator-BUVKAo4l.js} +1 -1
  59. package/dist/{use-chat-composer-ByWwRuYg.js → use-chat-composer-UZVFm8Tw.js} +12 -12
  60. package/dist/{use-heading-spy-S6PT8wPG.js → use-heading-spy-ByraZUf9.js} +1 -1
  61. package/dist/{use-material-translation-C4ysFJtw.js → use-material-translation-tD9XqIBm.js} +2 -2
  62. package/docs/components/overlays-and-menus.md +1 -1
  63. package/docs/components/selection-and-choice.md +76 -6
  64. package/docs/previews/selection-choice-switcher.webp +0 -0
  65. package/docs/troubleshooting.md +18 -1
  66. package/package.json +2 -2
@@ -1,3 +1,3 @@
1
- import { t as e } from "./public-B4lpmahC.js";
1
+ import { t as e } from "./public-BLw13izR.js";
2
2
  import { configurePdfReader as t } from "@nxgt/material-core/pdf-reader";
3
3
  export { e as PdfReader, t as configurePdfReader };
package/dist/print.js CHANGED
@@ -1,5 +1,5 @@
1
- import { r as e } from "./i18n-provider-WReTVxE3.js";
2
- import { t } from "./translate-material-DZ_i8xJx.js";
1
+ import { r as e } from "./i18n-provider-3TsMIGn1.js";
2
+ import { t } from "./translate-material-X1daoGxE.js";
3
3
  import { Children as n, createContext as r, isValidElement as i, useCallback as a, useContext as o, useEffect as s, useMemo as c, useState as l } from "react";
4
4
  import { jsx as u, jsxs as d } from "react/jsx-runtime";
5
5
  import { resolvePdfFileName as f } from "@nxgt/material-core/pdf-file-name";
@@ -6,18 +6,18 @@ import { c as i, i as a, l as o, n as s, o as c, s as l } from "./dist-lmHmz_bu.
6
6
  import { a as u, o as d } from "./tooltip-CkttDIab.js";
7
7
  import { i as f } from "./dist-C4wtXCjf.js";
8
8
  import { r as p, t as m } from "./in-dialog-Vwkyp-M5.js";
9
- import { C as h, D as g, E as _, O as v, S as y, T as b, _ as x, f as S, g as ee, k as te, r as ne, t as C, u as re, w } from "./dialog-CFIn1NPR.js";
10
- import { c as T, d as ie, f as E, i as ae, l as oe, n as se, o as D, t as ce, u as O } from "./dropdown-menu-CL6mNhgT.js";
11
- import { S as le, a as k, d as A, g as ue, h as de, i as fe, m as pe, n as j, r as me, t as M, u as he, w as ge } from "./toolbar-items-DCZxamGy.js";
12
- import { t as N } from "./use-material-translation-C4ysFJtw.js";
13
- import { t as _e } from "./button-DOYHfcMJ.js";
9
+ import { C as h, D as g, E as _, O as v, S as y, T as b, _ as x, f as S, g as ee, k as te, r as ne, t as C, u as re, w } from "./dialog-jYcWDh9G.js";
10
+ import { c as T, d as ie, f as E, i as ae, l as oe, n as se, o as D, t as ce, u as O } from "./dropdown-menu-BEZhNnhr.js";
11
+ import { S as le, a as k, d as A, g as ue, h as de, i as fe, m as pe, n as j, r as me, t as M, u as he, w as ge } from "./toolbar-items-CrATPuOX.js";
12
+ import { t as N } from "./use-material-translation-tD9XqIBm.js";
13
+ import { t as _e } from "./button-Ck1Bif-Q.js";
14
14
  import { n as ve, t as ye } from "./icon-button-ifTpXt0A.js";
15
15
  import { t as be } from "./useEvent-2fKq-6w8.js";
16
16
  import { n as xe, t as Se } from "./toggle-group-BMJNcFAC.js";
17
17
  import { o as Ce } from "./escape-owner-C4W_sOAU.js";
18
18
  import { n as we } from "./use-slice-reducer-BGkeGtML.js";
19
19
  import { r as Te } from "./use-csp-nonce-ZKs9k-ov.js";
20
- import { n as Ee, t as De } from "./empty-state-BNljKZLV.js";
20
+ import { n as Ee, t as De } from "./empty-state-BBUsR0_X.js";
21
21
  import { t as Oe } from "./client-only.utils-3nHNzCki.js";
22
22
  import { t as ke } from "./use-scroll-away-PQRFZkT2.js";
23
23
  import { ArrowLeft as Ae, BookOpenText as je, ChevronDown as Me, ChevronLeft as Ne, ChevronRight as Pe, ChevronUp as Fe, Download as Ie, Eraser as Le, FileText as Re, FileWarning as ze, FileX2 as Be, Highlighter as Ve, KeyRound as He, LayoutGrid as Ue, List as We, Loader2 as Ge, Maximize as Ke, MessageSquareText as qe, Minimize as Je, MoreVertical as Ye, MousePointer2 as Xe, MoveHorizontal as Ze, PanelLeft as Qe, Pen as $e, PencilLine as et, Printer as tt, RotateCw as nt, Search as rt, StickyNote as it, Type as at, Underline as ot, Undo2 as st, Volume2 as ct, X as lt, XIcon as ut, ZoomIn as dt, ZoomOut as ft } from "lucide-react";
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./tooltip-CkttDIab.js";
2
- import { c as t, n, t as r } from "./dropdown-menu-CL6mNhgT.js";
3
- import { t as i } from "./use-material-translation-C4ysFJtw.js";
4
- import { a, i as o, n as s, o as c, t as l } from "./code-language-items-DOr9J9yu.js";
2
+ import { c as t, n, t as r } from "./dropdown-menu-BEZhNnhr.js";
3
+ import { t as i } from "./use-material-translation-tD9XqIBm.js";
4
+ import { a, i as o, n as s, o as c, t as l } from "./code-language-items-Bnm_WDVg.js";
5
5
  import { i as u, n as d, r as f, s as p } from "./dist-C3GR7kJd.js";
6
6
  import { t as m } from "./code-block-spec-CGLKRhwD.js";
7
7
  import { Check as h, ChevronDown as g, Copy as _, Maximize2 as v, WrapText as y } from "lucide-react";
@@ -143,7 +143,7 @@ function M({ node: e, editor: t, updateAttributes: n, editable: r, wrap: a, onWr
143
143
  }
144
144
  //#endregion
145
145
  //#region lib/components/ui/widgets/editor/extensions/code/code-block-open.tsx
146
- var N = x(() => import("./code-editor-BqeS_XMJ.js").then((e) => e.n).then((e) => ({ default: e.CodeEditor })));
146
+ var N = x(() => import("./code-editor-M4DcaX-P.js").then((e) => e.n).then((e) => ({ default: e.CodeEditor })));
147
147
  function P() {
148
148
  let { t: e } = i();
149
149
  return /* @__PURE__ */ T("div", {
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./utils-BLfntITJ.js";
2
2
  import { t } from "./dist-DVRQkaTK.js";
3
- import { t as n } from "./use-material-translation-C4ysFJtw.js";
3
+ import { t as n } from "./use-material-translation-tD9XqIBm.js";
4
4
  import { t as r } from "./icon-button-ifTpXt0A.js";
5
5
  import { t as i } from "./compose-refs-DZ0iIVF-.js";
6
6
  import { GripVertical as a } from "lucide-react";
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./utils-BLfntITJ.js";
2
2
  import { o as t } from "./tooltip-CkttDIab.js";
3
- import { t as n } from "./use-material-translation-C4ysFJtw.js";
3
+ import { t as n } from "./use-material-translation-tD9XqIBm.js";
4
4
  import { jsx as r } from "react/jsx-runtime";
5
5
  //#region lib/components/ui/feedback/spinner/spinner.tsx
6
6
  var i = t("transition-all duration-500", {
@@ -2600,7 +2600,17 @@ var t = {
2600
2600
  "scatter-series": "{series}: {count, plural, one {# point} other {# points}}."
2601
2601
  }
2602
2602
  },
2603
- "list-details": { back: "Back to the list" }
2603
+ "list-details": { back: "Back to the list" },
2604
+ switcher: {
2605
+ search: "Search",
2606
+ "search-placeholder": "Search…",
2607
+ clear: "Clear the search",
2608
+ empty: "No results for “{query}”",
2609
+ results: "{count, plural, =0 {No results} one {# result} other {# results}}",
2610
+ recent: "Recent",
2611
+ manage: "Manage…",
2612
+ choose: "Choose"
2613
+ }
2604
2614
  } },
2605
2615
  fr: { material: {
2606
2616
  "empty-state": {
@@ -5200,7 +5210,17 @@ var t = {
5200
5210
  "scatter-series": "{series} : {count, plural, one {# point} other {# points}}."
5201
5211
  }
5202
5212
  },
5203
- "list-details": { back: "Retour à la liste" }
5213
+ "list-details": { back: "Retour à la liste" },
5214
+ switcher: {
5215
+ search: "Rechercher",
5216
+ "search-placeholder": "Rechercher…",
5217
+ clear: "Effacer la recherche",
5218
+ empty: "Aucun résultat pour « {query} »",
5219
+ results: "{count, plural, =0 {Aucun résultat} one {# résultat} other {# résultats}}",
5220
+ recent: "Récents",
5221
+ manage: "Gérer…",
5222
+ choose: "Choisir"
5223
+ }
5204
5224
  } }
5205
5225
  }, n = "language", r = "en", i = Object.keys(t);
5206
5226
  //#endregion
@@ -1,10 +1,10 @@
1
1
  import { t as e } from "./utils-BLfntITJ.js";
2
2
  import { a as t, i as n, n as r, o as i, r as a, t as o } from "./bubble-input-B7BVd9fX.js";
3
- import { t as s } from "./use-material-translation-C4ysFJtw.js";
3
+ import { t as s } from "./use-material-translation-tD9XqIBm.js";
4
4
  import { n as c, r as l } from "./icon-sprites-FxHyqyhg.js";
5
5
  import { t as u } from "./use-theme-DMcyJ52N.js";
6
6
  import { a as d, r as f } from "./theme-context-Cofk6vgs.js";
7
- import { t as p } from "./theme-toggle-O6z6PokP.js";
7
+ import { t as p } from "./theme-toggle-CWovcIQY.js";
8
8
  import { n as m, t as h } from "./nxgt-theme-ZS945iMP.js";
9
9
  import { Check as g } from "lucide-react";
10
10
  import { useContext as _ } from "react";
@@ -1,4 +1,4 @@
1
- import { t as e } from "./use-material-translation-C4ysFJtw.js";
1
+ import { t as e } from "./use-material-translation-tD9XqIBm.js";
2
2
  import { i as t } from "./theme-store-CSl51uNH.js";
3
3
  import { n, t as r } from "./use-theme-DMcyJ52N.js";
4
4
  import { r as i } from "./theme-context-Cofk6vgs.js";
@@ -4,9 +4,9 @@ import { a as i, c as a, i as o, l as s, r as c, s as l } from "./dist-lmHmz_bu.
4
4
  import { b as u, c as d, d as f, f as p, l as m, t as h, u as g, x as _ } from "./tooltip-CkttDIab.js";
5
5
  import { i as v, n as y, r as b, t as x } from "./dist-C4wtXCjf.js";
6
6
  import { a as S, c as C, l as w, o as T, r as ee, s as te, t as E } from "./in-dialog-Vwkyp-M5.js";
7
- import { A as ne, M as re, N as ie, b as ae, d as oe, f as se, i as ce, j as le, l as ue, n as de, o as fe, r as pe, t as me, u as he, y as ge } from "./dropdown-menu-CL6mNhgT.js";
7
+ import { A as ne, M as re, N as ie, b as ae, d as oe, f as se, i as ce, j as le, l as ue, n as de, o as fe, r as pe, t as me, u as he, y as ge } from "./dropdown-menu-BEZhNnhr.js";
8
8
  import { a as _e, n as ve, r as ye, t as be } from "./dist-B7RjY7SL.js";
9
- import { t as xe } from "./use-material-translation-C4ysFJtw.js";
9
+ import { t as xe } from "./use-material-translation-tD9XqIBm.js";
10
10
  import { t as Se } from "./warn-once-C_e47JM8.js";
11
11
  import { o as Ce } from "./escape-owner-C4W_sOAU.js";
12
12
  import { ChevronLeft as we, ChevronRightIcon as Te, MoreVertical as Ee } from "lucide-react";
@@ -1,5 +1,5 @@
1
- import "./stored-language-DiCe2ZcR.js";
2
- import { a as e, r as t } from "./translator-Ch1dEqFf.js";
1
+ import "./stored-language-CsDEJDR7.js";
2
+ import { a as e, r as t } from "./translator-BUVKAo4l.js";
3
3
  //#region lib/i18n/translate-material.ts
4
4
  function n(n, r, i, a) {
5
5
  if (n) for (let e of /* @__PURE__ */ new Set([n, n.split("-")[0]])) {
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./is-production-GLw59WU8.js";
2
- import { a as t, i as n, r, t as i } from "./stored-language-DiCe2ZcR.js";
2
+ import { a as t, i as n, r, t as i } from "./stored-language-CsDEJDR7.js";
3
3
  import { t as a } from "./get-CTzJAwfc.js";
4
4
  //#region ../../node_modules/@formatjs/fast-memoize/index.js
5
5
  function o(e, t) {
@@ -7,21 +7,21 @@ import { a as o, c as s, i as c, l, n as u, o as d, r as f, s as p, t as m } fro
7
7
  import { _ as h, a as g, g as _, h as v, m as y, o as b, p as x, t as S, v as C, y as w } from "./tooltip-CkttDIab.js";
8
8
  import { a as T, i as E, n as D, r as O, t as k } from "./dist-C4wtXCjf.js";
9
9
  import { i as A, n as ee, t as j } from "./in-dialog-Vwkyp-M5.js";
10
- import { A as M, C as N, D as te, E as ne, O as P, S as re, T as ie, _ as F, b as ae, f as oe, g as se, k as I, l as ce, m as le, n as ue, o as de, r as fe, s as pe, t as me, u as he, v as ge, w as _e, x as ve, y as ye } from "./dialog-CFIn1NPR.js";
10
+ import { A as M, C as N, D as te, E as ne, O as P, S as re, T as ie, _ as F, b as ae, f as oe, g as se, k as I, l as ce, m as le, n as ue, o as de, r as fe, s as pe, t as me, u as he, v as ge, w as _e, x as ve, y as ye } from "./dialog-jYcWDh9G.js";
11
11
  import { A as be, C as xe, D as Se, E as Ce, O as we, S as Te, T as Ee, _ as De, a as Oe, b as ke, d as Ae, f as je, g as Me, h as Ne, i as Pe, k as Fe, l as Ie, m as Le, n as Re, o as ze, p as Be, r as Ve, s as He, t as Ue, u as We, v as Ge, w as Ke, x as qe, y as Je } from "./floating-ui.dom-KkZSW8_E.js";
12
- import { D as Ye, E as Xe, N as Ze, O as Qe, c as $e, d as et, f as tt, i as nt, k as rt, m as it, n as at, o as ot, p as st, t as ct, u as lt } from "./dropdown-menu-CL6mNhgT.js";
12
+ import { D as Ye, E as Xe, N as Ze, O as Qe, c as $e, d as et, f as tt, i as nt, k as rt, m as it, n as at, o as ot, p as st, t as ct, u as lt } from "./dropdown-menu-BEZhNnhr.js";
13
13
  import { a as ut, i as dt, n as ft } from "./field-blur-context-Cft9s7Hg.js";
14
- import { C as pt, S as mt, a as ht, c as gt, d as _t, l as vt, n as yt, o as bt, s as xt, u as St } from "./toolbar-items-DCZxamGy.js";
14
+ import { C as pt, S as mt, a as ht, c as gt, d as _t, l as vt, n as yt, o as bt, s as xt, u as St } from "./toolbar-items-CrATPuOX.js";
15
15
  import { a as Ct, i as wt, n as Tt, o as Et, t as Dt } from "./bubble-input-B7BVd9fX.js";
16
16
  import { i as Ot } from "./dist-B7RjY7SL.js";
17
- import "./stored-language-DiCe2ZcR.js";
18
- import { a as kt } from "./translator-Ch1dEqFf.js";
17
+ import "./stored-language-CsDEJDR7.js";
18
+ import { a as kt } from "./translator-BUVKAo4l.js";
19
19
  import { h as At } from "./get-CTzJAwfc.js";
20
20
  import { t as jt } from "./isEmpty-F_g3jLf8.js";
21
- import { t as L } from "./use-material-translation-C4ysFJtw.js";
22
- import { t as Mt } from "./spinner-CGgOgUCe.js";
21
+ import { t as L } from "./use-material-translation-tD9XqIBm.js";
22
+ import { t as Mt } from "./spinner-CcmXeIHf.js";
23
23
  import { a as Nt } from "./button-tones-BwuVvAmd.js";
24
- import { a as Pt, i as Ft, n as It, r as Lt, t as Rt } from "./button-DOYHfcMJ.js";
24
+ import { a as Pt, i as Ft, n as It, r as Lt, t as Rt } from "./button-Ck1Bif-Q.js";
25
25
  import { t as R } from "./icon-button-ifTpXt0A.js";
26
26
  import { n as zt, r as Bt } from "./icon-sprites-FxHyqyhg.js";
27
27
  import { t as Vt } from "./use-ssr-media-query-C6M5m8sf.js";
@@ -35,10 +35,10 @@ import { a as tn, i as nn, o as rn } from "./escape-owner-C4W_sOAU.js";
35
35
  import { n as an } from "./use-slice-reducer-BGkeGtML.js";
36
36
  import { t as on } from "./browser-only-DQ94lWF8.js";
37
37
  import { t as sn } from "./compose-refs-DZ0iIVF-.js";
38
- import { n as cn, r as ln, t as un } from "./chip-C8MB2xzb.js";
39
- import { n as dn, t as fn } from "./icon-badge-lfAUxNe8.js";
38
+ import { n as cn, r as ln, t as un } from "./chip-B9pZFWbi.js";
39
+ import { n as dn, t as fn } from "./icon-badge-92uhu2o6.js";
40
40
  import { r as pn } from "./use-csp-nonce-ZKs9k-ov.js";
41
- import { t as mn } from "./empty-state-BNljKZLV.js";
41
+ import { t as mn } from "./empty-state-BBUsR0_X.js";
42
42
  import { t as hn } from "./skeleton-DSdtr2qc.js";
43
43
  import { H as gn, V as _n, X as vn, bt as yn, it as bn, lt as xn, n as Sn, t as Cn, xt as wn, yt as Tn } from "./dist-moutbfbd.js";
44
44
  import { t as En } from "./markdown-Dw_uH7j7.js";
@@ -10782,7 +10782,7 @@ var CS = (e = {}) => Dn({
10782
10782
  let [{ default: t }, { lowlight: n }, { richCodeBlock: r }] = await Promise.all([
10783
10783
  import("./dist-CRMFGjng.js"),
10784
10784
  import("./lowlight-OtcjU2Sa.js"),
10785
- import("./rich-code-block-CvqJmvuT.js")
10785
+ import("./rich-code-block-DPe5USBG.js")
10786
10786
  ]);
10787
10787
  return [r(t, {
10788
10788
  lowlight: n,
@@ -1,4 +1,4 @@
1
- import { r as e } from "./i18n-provider-WReTVxE3.js";
1
+ import { r as e } from "./i18n-provider-3TsMIGn1.js";
2
2
  import { _ as t, g as n, h as r, n as i, v as a, y as o } from "./number.utils-BG_eEt5g.js";
3
3
  import { useCallback as s, useEffect as c, useMemo as l, useRef as u } from "react";
4
4
  //#region ../../node_modules/date-fns/locale/fr/_lib/formatDistance.js
@@ -1,5 +1,5 @@
1
- import { r as e } from "./i18n-provider-WReTVxE3.js";
2
- import { t } from "./translate-material-DZ_i8xJx.js";
1
+ import { r as e } from "./i18n-provider-3TsMIGn1.js";
2
+ import { t } from "./translate-material-X1daoGxE.js";
3
3
  import { useCallback as n } from "react";
4
4
  //#region lib/i18n/use-material-translation.ts
5
5
  function r() {
@@ -21,7 +21,7 @@ that prevents the default and focuses nothing) goes to the layer's content.
21
21
  Non-modal layers (`modal={false}`, and `DropdownMenu` and `Popover` by
22
22
  default) leave the page as it is.
23
23
 
24
- **Checked and radio items draw a mark.** The check of a `*CheckboxItem` draws in and out and the dot of a `*RadioItem` springs in; a checked `CommandItem`, a chosen `Select` or `Combobox` option, the `PhoneField` country menu, the `Switcher` and the `FilterPresets` menu draw their check in. The mark is `data-slot="option-mark"`, `aria-hidden`, follows the row's text colour and stops moving under reduced motion. Roles, `aria-checked` and keyboard behaviour are unchanged: read `aria-checked` on the item, not the mark.
24
+ **Checked and radio items draw a mark.** The check of a `*CheckboxItem` draws in and out and the dot of a `*RadioItem` springs in; a checked `CommandItem`, a chosen `Select` or `Combobox` option, the `PhoneField` country menu and the `FilterPresets` menu draw their check in. The mark is `data-slot="option-mark"`, `aria-hidden`, follows the row's text colour and stops moving under reduced motion. Roles, `aria-checked` and keyboard behaviour are unchanged: read `aria-checked` on the item, not the mark.
25
25
 
26
26
  **Chosen and highlighted items look the same everywhere.** In the radio groups of `DropdownMenu`, `ContextMenu` and `Menubar`, and in `Select` and
27
27
  `Autocomplete` lists, the one chosen item has a 12 % primary tint, a 3px rounded bar
@@ -28,7 +28,7 @@ value type each one writes. Everything is imported from
28
28
  | <img src="../previews/selection-choice-transferlist.webp" width="96" alt=""> | [TransferList](#transferlist) | Two-pane picker: search, counts, select-all, drag between panes |
29
29
  | <img src="../previews/selection-choice-sortablelist.webp" width="96" alt=""> | [SortableList](#sortablelist) | Reorderable list: drag or keyboard, announced |
30
30
  | <img src="../previews/selection-choice-treeselectfield.webp" width="96" alt=""> | [TreeSelectField](#treeselectfield) | Pick from a tree, single or multiple |
31
- | <img src="../previews/selection-choice-switcher.webp" width="96" alt=""> | [Switcher](#switcher) | Workspace or account switcher |
31
+ | <img src="../previews/selection-choice-switcher.webp" width="96" alt=""> | [Switcher](#switcher) | Workspace, establishment or class switcher: menu, search, groups, links |
32
32
 
33
33
  ## Select
34
34
 
@@ -1125,7 +1125,7 @@ multiple mode).
1125
1125
 
1126
1126
  ![Switcher](../previews/selection-choice-switcher.webp)
1127
1127
 
1128
- Dropdown for switching the active workspace or account, with an avatar.
1128
+ Switches the workspace, the establishment or the class a page is about. A 44px card trigger (initial or icon tile, title, subtitle, up-down chevron) opens a menu for up to 7 options, and from 8 a panel with a search, groups and a listbox; on a phone it is a bottom sheet. `variant="expressive"` is a pill with a larger panel, "Recent" tiles and soft badges. With `getHref` the options are links.
1129
1129
 
1130
1130
  ```tsx
1131
1131
  import { Switcher, type SwitcherItem } from '@nxgt/material/components';
@@ -1138,17 +1138,87 @@ const workspaces: SwitcherItem[] = [
1138
1138
 
1139
1139
  export function Workspaces() {
1140
1140
  const [value, setValue] = useState('acme');
1141
- return <Switcher label="Workspaces" options={workspaces} value={value} onValueChange={setValue} />;
1141
+ return <Switcher label="Workspace" options={workspaces} value={value} onValueChange={setValue} />;
1142
1142
  }
1143
1143
  ```
1144
1144
 
1145
+ An option with no `icon` draws its `initial` (default: the first letter of its title) in a tile of its `tone`. Establishments take an icon, a tone and a "Manage…" footer:
1146
+
1147
+ ```tsx
1148
+ import { Icon, Switcher } from '@nxgt/material/components';
1149
+
1150
+ <Switcher
1151
+ label="Establishment"
1152
+ value={school}
1153
+ onValueChange={setSchool}
1154
+ options={[
1155
+ { id: 'ljc', title: 'Lycée Joss', subtitle: 'Lycée · Douala', icon: <Icon name="school" />, tone: 'primary' },
1156
+ { id: 'src', title: 'École La Source', subtitle: 'Primaire · Bafoussam', icon: <Icon name="graduation-cap" />, tone: 'success' },
1157
+ ]}
1158
+ footer={{ onSelect: () => navigate('/establishments') }}
1159
+ />;
1160
+ ```
1161
+
1162
+ ### Classes: search, groups and links
1163
+
1164
+ Eight options or more (or `searchable`) open a popover with a search field. It is a combobox over a listbox: typing filters on the title, the subtitle and the group (accents and case ignored), the arrows move the active option, Enter chooses it and gives the focus back to the trigger. Options with a `group` are listed under its header, and put the pupil count in the subtitle **or** in `badge`, not both.
1165
+
1166
+ With `getHref` each option is a link, for a switcher that is a navigation (`/classes/6b`): the panel is a `nav` of links with `aria-current="page"` on the chosen one (no `listbox` role), and the arrows move the real focus. Pass your router's link as `linkComponent`, as for `ListTile` and `AccountMenu`:
1167
+
1168
+ ```tsx
1169
+ import { Link } from 'react-router';
1170
+ import { Switcher, type AppShellLinkComponent } from '@nxgt/material/components';
1171
+
1172
+ // Hoisted, outside the render: not a new component on every render.
1173
+ const RouterLink: AppShellLinkComponent = ({ href, ...props }) => <Link to={href} {...props} />;
1174
+
1175
+ <Switcher
1176
+ label="Class"
1177
+ value={classId}
1178
+ options={classes} // { id: '6b', title: '6e B', subtitle: 'Mathematics · 26 pupils', group: '6e', tone: 'primary' }
1179
+ getHref={(item) => `/classes/${item.id}`}
1180
+ linkComponent={RouterLink}
1181
+ footer={{ label: 'Manage my classes…', href: '/classes' }}
1182
+ />;
1183
+ ```
1184
+
1185
+ ### Expressive
1186
+
1187
+ `variant="expressive"` is a pill that opens a larger panel (always with a search). `recent` lists up to 3 option ids shown as tiles above the groups while nothing is typed; `badge` draws a soft badge after the title. On a phone the sheet is full height with a close button.
1188
+
1189
+ ```tsx
1190
+ <Switcher
1191
+ variant="expressive"
1192
+ label="Class"
1193
+ value={classId}
1194
+ onValueChange={setClassId}
1195
+ options={classes.map((c) => ({ ...c, badge: c.pupils }))}
1196
+ recent={['6b', 't1', '4a']}
1197
+ />
1198
+ ```
1199
+
1200
+ A title that does not fit the trigger is cut with an ellipsis: the span carries the full title in `aria-label` (what `expectNoTextOverflow` of `@nxgt/playwright` reads), hovering or focusing the trigger shows it with the subtitle in a tooltip, and the trigger's accessible name is the label, the full title and the subtitle.
1201
+
1145
1202
  | Prop | Type | Default | Effect |
1146
1203
  | --- | --- | --- | --- |
1147
- | `options` | `SwitcherItem[]` | — | `{ id, title, subtitle?, icon? }`; without `icon` an initial avatar is shown |
1204
+ | `options` | `SwitcherItem[]` | — | see below |
1148
1205
  | `value` | `string` | — | the active `id` |
1149
1206
  | `onValueChange` | `(value: string) => void` | — | |
1150
- | `label` | `ReactNode` | — | heading of the menu |
1207
+ | `label` | `ReactNode` | — | what is switched: names the trigger, the panel and the list |
1208
+ | `variant` | `'default' \| 'expressive'` | `'default'` | tile trigger and menu, or pill and large panel |
1209
+ | `searchable` | `boolean` | from 8 options (always, expressive) | the search field of the panel; `true` also replaces the menu with the panel |
1210
+ | `recent` | `string[]` | — | up to 3 option ids shown as tiles (expressive) |
1211
+ | `getHref` | `(item) => string \| undefined` | — | link mode; falls back to `item.href` |
1212
+ | `linkComponent` | `LinkComponent` | `<a>` | your router's link: takes `href`, spreads every prop, forwards `ref` |
1213
+ | `footer` | `{ label?, onSelect?, href? }` | — | a "Manage…" button (a link with `href`) at the end of the panel; `label` defaults to `material.switcher.manage` |
1214
+ | `emptyLabel` | `ReactNode` | `material.switcher.empty` | shown when the search matches nothing |
1215
+ | `sheet` | `boolean` | on a phone | `true` always opens a sheet, `false` never |
1216
+ | `name`, button props | `ComponentProps<'button'>` | — | spread on the trigger; `name` is its `data-pw` |
1217
+
1218
+ `SwitcherItem`: `{ id, title, subtitle?, icon?, group?, initial?, tone?, badge?, href?, disabled? }`.
1219
+
1220
+ Strings (the search field, "Recent", "Manage…", the empty and result texts) are `material.switcher.*` keys, in English and French.
1151
1221
 
1152
1222
  **Emits:** `string` (the item `id`). No form wrapper — it switches context,
1153
1223
  it is not a form value.
1154
- **Storybook:** `Selection & choice/Switcher` · **Vue:** `Switcher`
1224
+ **Storybook:** `Selection & choice/Switcher` (and `/Behaviour`) · **Vue:** `Switcher` (the earlier look; the modern one is React only for now)
@@ -111,6 +111,7 @@ words in your error.
111
111
 
112
112
  - [A `ListTile` link shows two chevrons](#a-listtile-link-shows-two-chevrons)
113
113
  - [A `ListTile` link reloads the whole page](#a-listtile-link-reloads-the-whole-page)
114
+ - [A `Switcher` in link mode reloads the page](#a-switcher-in-link-mode-reloads-the-page)
114
115
  - [After a link in the phone menu, the focus goes to `<main>`, not to the page's title](#after-a-link-in-the-phone-menu-the-focus-goes-to-main-not-to-the-pages-title)
115
116
  - [The phone menu needs two Escapes to close, or a tooltip shows over it](#the-phone-menu-needs-two-escapes-to-close-or-a-tooltip-shows-over-it)
116
117
  - [The phone menu stays open after a navigation, or an app clicks its button to close it](#the-phone-menu-stays-open-after-a-navigation-or-an-app-clicks-its-button-to-close-it)
@@ -1115,7 +1116,7 @@ expect(screen.getByRole('checkbox', { name: 'Email me receipts' })).toHaveAttrib
1115
1116
 
1116
1117
  ### A test looked for `lucide-check` in a menu item
1117
1118
 
1118
- **When:** a test or a style looks for the `lucide-check` or `lucide-circle` svg in a checked item of `DropdownMenu`, `ContextMenu`, `Menubar`, `Select`, `Combobox`, `Command`, the `PhoneField` country menu, the `Switcher` or the filter presets.
1119
+ **When:** a test or a style looks for the `lucide-check` or `lucide-circle` svg in a checked item of `DropdownMenu`, `ContextMenu`, `Menubar`, `Select`, `Combobox`, `Command`, the `PhoneField` country menu or the filter presets.
1119
1120
  **Why:** those items draw an animated mark, an `aria-hidden` element with `data-slot="option-mark"`. In `Select` and `Combobox` it is present only on the chosen option; the menu items keep it mounted while unchecked.
1120
1121
  **Fix:** read `aria-checked` (or `aria-selected`) on the item:
1121
1122
 
@@ -2057,6 +2058,22 @@ const RouterLink: AppShellLinkComponent = ({ href, ...props }) => (
2057
2058
  <ListTile title="Notifications" href="/settings/notifications" linkComponent={RouterLink} />
2058
2059
  ```
2059
2060
 
2061
+ ### A `Switcher` in link mode reloads the page
2062
+
2063
+ **When:** a `Switcher` with `getHref` is used in a router app and choosing an option loads the document again (the page flashes, client state is lost).
2064
+ **Why:** link mode renders plain `<a href>` links, which need no router and so cannot navigate on the client. Without `getHref` the options are not links and `href` on an item does nothing.
2065
+ **Fix:** pass `linkComponent`, with the contract of the app shell's: it takes `href`, spreads every other prop (`aria-current`, `className`, handlers) and forwards `ref`. React Router's `Link` takes `to`, so wrap it:
2066
+
2067
+ ```tsx
2068
+ import { Link } from 'react-router';
2069
+ import { Switcher, type AppShellLinkComponent } from '@nxgt/material/components';
2070
+
2071
+ // Hoisted, outside the render: not a new component on every render.
2072
+ const RouterLink: AppShellLinkComponent = ({ href, ...props }) => <Link to={href} {...props} />;
2073
+
2074
+ <Switcher label="Class" value={classId} options={classes} getHref={(item) => `/classes/${item.id}`} linkComponent={RouterLink} />
2075
+ ```
2076
+
2060
2077
  ### After a link in the phone menu, the focus goes to `<main>`, not to the page's title
2061
2078
 
2062
2079
  **When:** on a phone, a link followed in the menu sheet of `ActivityLayout` or
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/material",
3
- "version": "3.17.0",
3
+ "version": "3.18.0",
4
4
  "license": "MIT",
5
5
  "bugs": {
6
6
  "email": "stevegires@gmail.com"
@@ -357,7 +357,7 @@
357
357
  "docs:previews": "rm -rf node_modules/.cache/nxgt-preview-free/missing && NXGT_PREVIEW_FREE=1 vitest run --project previews && bun .storybook/preview-free-report.ts"
358
358
  },
359
359
  "dependencies": {
360
- "@nxgt/material-core": "^0.32.0",
360
+ "@nxgt/material-core": "^0.32.1",
361
361
  "@base-ui/react": "^1.6.0",
362
362
  "@dnd-kit/core": "^6.3.1",
363
363
  "@dnd-kit/sortable": "^10.0.0",