@nxgt/material-vue 0.31.0 → 0.33.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 (104) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/README.md +20 -7
  3. package/dist/{Button-CNbJT5qV.js → Button-DEA5W6O3.js} +1 -1
  4. package/dist/{HoverCardTrigger-BTAHE6wK.js → HoverCardTrigger-CjSteFgk.js} +2 -2
  5. package/dist/{camera-rJmgxIEn.js → camera-B063QUeM.js} +4 -4
  6. package/dist/components/components.css +3 -1
  7. package/dist/components/ui/fields/otp-field/input-otp.css +48 -0
  8. package/dist/{components-Dxy9DvEe.js → components-CmIOfRO4.js} +13547 -17345
  9. package/dist/components.js +8 -8
  10. package/dist/composables.js +25 -25
  11. package/dist/dnd.js +1 -1
  12. package/dist/fonts/katex/KaTeX_AMS-Regular.woff2 +0 -0
  13. package/dist/fonts/katex/KaTeX_Caligraphic-Bold.woff2 +0 -0
  14. package/dist/fonts/katex/KaTeX_Caligraphic-Regular.woff2 +0 -0
  15. package/dist/fonts/katex/KaTeX_Fraktur-Bold.woff2 +0 -0
  16. package/dist/fonts/katex/KaTeX_Fraktur-Regular.woff2 +0 -0
  17. package/dist/fonts/katex/KaTeX_Main-Bold.woff2 +0 -0
  18. package/dist/fonts/katex/KaTeX_Main-BoldItalic.woff2 +0 -0
  19. package/dist/fonts/katex/KaTeX_Main-Italic.woff2 +0 -0
  20. package/dist/fonts/katex/KaTeX_Main-Regular.woff2 +0 -0
  21. package/dist/fonts/katex/KaTeX_Math-BoldItalic.woff2 +0 -0
  22. package/dist/fonts/katex/KaTeX_Math-Italic.woff2 +0 -0
  23. package/dist/fonts/katex/KaTeX_SansSerif-Bold.woff2 +0 -0
  24. package/dist/fonts/katex/KaTeX_SansSerif-Italic.woff2 +0 -0
  25. package/dist/fonts/katex/KaTeX_SansSerif-Regular.woff2 +0 -0
  26. package/dist/fonts/katex/KaTeX_Script-Regular.woff2 +0 -0
  27. package/dist/fonts/katex/KaTeX_Size1-Regular.woff2 +0 -0
  28. package/dist/fonts/katex/KaTeX_Size2-Regular.woff2 +0 -0
  29. package/dist/fonts/katex/KaTeX_Size3-Regular.woff2 +0 -0
  30. package/dist/fonts/katex/KaTeX_Size4-Regular.woff2 +0 -0
  31. package/dist/fonts/katex/KaTeX_Typewriter-Regular.woff2 +0 -0
  32. package/dist/{form-scope-BhNw4Mm6.js → form-scope-DuDx5Jyx.js} +1 -1
  33. package/dist/{i18n-provider-BPK68eqM.js → i18n-provider-CiVi05fs.js} +1 -1
  34. package/dist/i18n.js +4 -4
  35. package/dist/{icon-button-DXXjxBgr.js → icon-button-CWcOcNHr.js} +1 -1
  36. package/dist/lib/components/ui/fields/attributes/form-schema.d.ts +11 -2
  37. package/dist/lib/components/ui/fields/contacts/consts.d.ts +1 -1
  38. package/dist/lib/components/ui/fields/opening-hours/consts.d.ts +12 -1
  39. package/dist/lib/components/ui/fields/search-field/index.d.ts +2 -1
  40. package/dist/lib/components/ui/primitives/index.d.ts +1 -0
  41. package/dist/lib/components/ui/primitives/nonce-provider/index.d.ts +2 -0
  42. package/dist/lib/components/ui/primitives/nonce-provider/nonce-provider.vue.d.ts +20 -0
  43. package/dist/lib/components/ui/selection/autocomplete/autocomplete-items.d.ts +5 -0
  44. package/dist/lib/components/ui/selection/autocomplete/autocomplete.vue.d.ts +6 -3
  45. package/dist/lib/components/ui/selection/autocomplete/filter-options.d.ts +9 -2
  46. package/dist/lib/components/ui/selection/autocomplete/index.d.ts +1 -0
  47. package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-list.vue.d.ts +8 -1
  48. package/dist/lib/components/ui/selection/autocomplete/search-types.d.ts +34 -0
  49. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-items.d.ts +20 -3
  50. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-list.d.ts +28 -0
  51. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-search.d.ts +11 -0
  52. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-status.d.ts +32 -0
  53. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-texts.d.ts +1 -3
  54. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete.d.ts +10 -5
  55. package/dist/lib/components/ui/selection/radio-group/radio-group-field.vue.d.ts +2 -0
  56. package/dist/lib/composables/index.d.ts +1 -0
  57. package/dist/lib/composables/use-csp-nonce.d.ts +18 -0
  58. package/dist/lib/i18n/resources/en/en.d.ts +4 -0
  59. package/dist/lib/i18n/resources/en/material.json.d.ts +5 -1
  60. package/dist/lib/i18n/resources/fr/fr.d.ts +4 -0
  61. package/dist/lib/i18n/resources/fr/material.json.d.ts +5 -1
  62. package/dist/lib/i18n/resources/resources.d.ts +8 -0
  63. package/dist/lib/i18n/translator.d.ts +1 -1
  64. package/dist/lib/lib/index.d.ts +1 -0
  65. package/dist/lib/nuxt/auto-imports.d.ts +1 -1
  66. package/dist/lib/nuxt/component-names.d.ts +1 -1
  67. package/dist/lib/vite/index.d.ts +3 -2
  68. package/dist/lib.js +50 -49
  69. package/dist/main.js +17 -17
  70. package/dist/map.js +4 -4
  71. package/dist/material-vue.css +1 -1
  72. package/dist/{pdf-outline-sidebar-6pIxLP_o.js → pdf-outline-sidebar-CzY59j_Y.js} +2 -2
  73. package/dist/{pdf-page-list-ojy2YSTr.js → pdf-page-list-BMxNOnPk.js} +2 -2
  74. package/dist/{pdf-page--zE3j8bc.js → pdf-page-nM_fvTHh.js} +1 -1
  75. package/dist/{pdf-reader-CcSJaFFp.js → pdf-reader-Dpv3oWe1.js} +52 -49
  76. package/dist/{pdf-sidebar-8DC9VdCG.js → pdf-sidebar-DkefUgWg.js} +3 -3
  77. package/dist/{pdf-thumbnail-sidebar-BbPcfCYm.js → pdf-thumbnail-sidebar-I6i1lv5J.js} +3 -3
  78. package/dist/{pdf-toolbar-B_MDicKL.js → pdf-toolbar-Da6UMt1O.js} +4 -4
  79. package/dist/pdf.js +2 -2
  80. package/dist/{sortable-provider-Cb3tm9Cy.js → sortable-provider-Cvpqk8tp.js} +2 -2
  81. package/dist/{stored-language-UnInBB6T.js → stored-language-GDRdeYD8.js} +10 -2
  82. package/dist/{stx-player-CjGKQF6K.js → stx-player-CN7Ic8tP.js} +14 -14
  83. package/dist/{translator-J3_vaV_A.js → translator-BDFEmlcL.js} +1 -1
  84. package/dist/{use-heading-spy-_dk8kGwL.js → use-heading-spy-DimKb49j.js} +54 -46
  85. package/dist/{use-material-translation-Do6ztdtV.js → use-material-translation-CaHS6oZz.js} +3 -3
  86. package/dist/vite.js +2 -2
  87. package/docs/README.md +1 -0
  88. package/docs/components/data-display.md +5 -0
  89. package/docs/components/form-fields.md +23 -0
  90. package/docs/components/primitives.md +41 -0
  91. package/docs/components/selection-and-choice.md +75 -4
  92. package/docs/getting-started.md +5 -1
  93. package/docs/guides/csp.md +420 -0
  94. package/docs/guides/helpers.md +3 -1
  95. package/docs/guides/theming.md +27 -0
  96. package/docs/roadmap.md +21 -0
  97. package/docs/troubleshooting.md +217 -0
  98. package/lib/components/components.css +3 -1
  99. package/lib/components/ui/fields/otp-field/input-otp.css +48 -0
  100. package/lib/nuxt/auto-imports.ts +1 -0
  101. package/lib/nuxt/component-names.ts +1 -0
  102. package/lib/vite/index.ts +6 -2
  103. package/package.json +9 -4
  104. package/dist/lib/components/ui/fields/search-field/debounce.d.ts +0 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,78 @@
1
1
  # @nxgt/material-vue
2
2
 
3
+ ## 0.33.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#479](https://github.com/softistx/nxgt-material/pull/479) [`6850b50`](https://github.com/softistx/nxgt-material/commit/6850b50d3832b401e32ea25aa356dde9b5684193) Thanks [@SteveGT96](https://github.com/SteveGT96)! - KaTeX's fonts (`Markdown` maths) ship as files: the compiled stylesheet `dist/material-vue.css` no longer inlines its 60 fonts as `data:` URIs, and goes from 1.75 MB to 0.31 MB (about 1 MB to 44 KB gzipped). Its `@font-face` rules point at the 20 `woff2` files in `dist/fonts/katex/`, beside it, through a relative `url()`, so a strict `font-src 'self'` allows them and a browser downloads a font only when a formula draws from it. KaTeX's layout CSS stays in the stylesheet.
8
+
9
+ **Migration:** nothing to import. A bundler that processes the compiled stylesheet (`@import "@nxgt/material-vue"`) emits the fonts as files (Vite inlines the 3.6 KB `KaTeX_Size3` font unless `assetsInlineLimit` is set: see the CSP guide's KaTeX fonts section). An app that serves `dist/material-vue.css` itself must serve `dist/fonts/` beside it, at the same relative path; without it, math renders in the system fonts (`\mathbb`, large delimiters and roots look wrong), the rest of the page is unaffected. The Tailwind route (`styles.css`) is unchanged.
10
+
11
+ - [#474](https://github.com/softistx/nxgt-material/pull/474) [`f4185a4`](https://github.com/softistx/nxgt-material/commit/f4185a49a03100e107092927eedf59893b5bd73a) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `NonceProvider` gives the page's Content Security Policy nonce to every component below it. Render it once at the root, on the server and on the client, with the request's nonce: `<NonceProvider :nonce="nonce">`. A nested `NonceProvider` without a `nonce` inherits the outer one's. The Nuxt module registers it; with nuxt-security, `useNonce()` on the server and `getCspNonce()` on the client.
12
+
13
+ - It renders reka's `ConfigProvider` with `nonce`, so reka's `Select`, `Combobox`, `ScrollArea` and `Splitter` stamp their `<style>`; it carries over the `dir`, `locale`, `scrollBody`, `teleportTo` and `useId` of a `ConfigProvider` above it.
14
+ - `InputOTP` (and `OtpField`) pass it to vue-input-otp when given no `nonce` prop, and `RichTextEditor` sets tiptap's `injectNonce` from it.
15
+ - `useCspNonce()` (`@nxgt/material-vue/composables`, auto-imported by the Nuxt module) is a computed ref of the provider's nonce, else reka's `ConfigProvider` nonce, else `undefined`, for a `<style>` of your own.
16
+ - `getCspNonce()` and `setCspNonce()` are re-exported from `@nxgt/material-core/csp-nonce` by `@nxgt/material-vue/lib` and the main entry. `setCspNonce` does nothing on a server.
17
+
18
+ **Migration:** a `<ConfigProvider :nonce="nonce">` wrapped around the app for reka, as the CSP guide of 0.28.0 showed, still works; search for it and replace it with `<NonceProvider :nonce="nonce">`, which also reaches `InputOTP` and `RichTextEditor`, and drop the `:nonce` passed to each `InputOTP`. `NonceProvider` keeps the nonce for the code outside Vue (`setCspNonce`) once mounted, never in setup, so one request's nonce never reaches another's.
19
+
20
+ - [#478](https://github.com/softistx/nxgt-material/pull/478) [`525ca57`](https://github.com/softistx/nxgt-material/commit/525ca577bb5e186a84a900088ec286bcca6c8b94) Thanks [@SteveGT96](https://github.com/SteveGT96)! - The stylesheet (`styles.css` and `dist/material-vue.css`) now carries `InputOTP`'s rules (`input-otp.css`: the hidden input's selection, caret and autofill), the ones vue-input-otp adds on mount through a `<style>`. On a page under a strict Content Security Policy without the nonce, that `<style>` is still blocked and reported, but `InputOTP` renders right; under a `NonceProvider` it carries the nonce and nothing is reported. `ImageCropper` (vue-advanced-cropper) is measured: it injects no `<style>`, and the Content Security Policy guide now says so.
21
+
22
+ **Migration:** none for an app that imports the stylesheet, as the README asks (`@import "@nxgt/material-vue/styles.css"`, or `dist/material-vue.css`). A route served `'unsafe-inline'` in `style-src-elem` only for `ImageCropper` can drop it and keep the nonce.
23
+
24
+ - [#480](https://github.com/softistx/nxgt-material/pull/480) [`634a58e`](https://github.com/softistx/nxgt-material/commit/634a58e3353ebe340e87b0f21858396aa4354654) Thanks [@SteveGT96](https://github.com/SteveGT96)! - zod is no longer bundled, and the library builds no zod schema while it loads, so a page under a strict Content Security Policy (a `script-src` without `'unsafe-eval'`) can stop zod's `new Function` probe with one `z.config({ jitless: true })`.
25
+
26
+ - `zod` stays a dependency (`^4.4.3`), imported at runtime: the library now uses the zod your app resolves, one copy when your range overlaps.
27
+ - New `openingHoursSchema()` and `attributeFormSchema()`: the zod schemas of one `OpeningHour` and of `AttributeForm`, built on the first call and the same schema after. `AttributeForm` builds its schema in its setup, not at import; `toAttributeFormSchema()` is unchanged.
28
+ - `OpeningHoursSchema` and the attribute form's `schema` are **deprecated** (removed in 1.0). They still work: each is built on its first use and behaves as its factory's schema (`.parse`, `.safeParse`, `.shape`, `.extend`, `instanceof z.ZodObject`), but it is not the same object (`===`), and a `.meta()` or `registry.add()` on it is not seen through the factory's schema.
29
+
30
+ **Migration:**
31
+
32
+ 1. Install zod in the app if it is not there yet (`bun add zod`): a strict package manager (pnpm) does not let the app import a package it does not list. Keep it inside `^4.4.3`.
33
+ 2. Search for `OpeningHoursSchema` and replace it with `openingHoursSchema()`; search for `schema` imported from `@nxgt/material-vue` (or `/components`) and replace it with `attributeFormSchema()`.
34
+ 3. Under a strict CSP, call `z.config({ jitless: true })` in a module the client entry imports first (in Nuxt, a plugin named `00.zod.client.ts`), before the first schema is built; the `EvalError` / `'unsafe-eval'` report from zod then stops. Build your own schemas inside functions when their module may load before that one. `docs/guides/csp.md`, "zod and `'unsafe-eval'`".
35
+
36
+ ### Patch Changes
37
+
38
+ - [#467](https://github.com/softistx/nxgt-material/pull/467) [`f621c1e`](https://github.com/softistx/nxgt-material/commit/f621c1e0c75974cd6d1c22728719d47c1acd9a24) Thanks [@SteveGT96](https://github.com/SteveGT96)! - A Content Security Policy guide (`docs/guides/csp.md`): the directives to send, the components that still inject a `<style>`, the zod and KaTeX settings, a self-hosted font, the per-request nonce; troubleshooting entries for the reports a strict policy sends, and a roadmap line.
39
+
40
+ - [#481](https://github.com/softistx/nxgt-material/pull/481) [`6facbb0`](https://github.com/softistx/nxgt-material/commit/6facbb0d05b67b4235f1451369e5b85d9c59fc54) Thanks [@SteveGT96](https://github.com/SteveGT96)! - The CSP guide shows how to self-host Inter under a strict `font-src` (`@fontsource-variable/inter`, the `--font-sans` token, the fallback stack, `cspAssetsInlineLimit`, now also exported by `@nxgt/material-vue/vite`), the theming guide has a Fonts section, and troubleshooting has an entry for a font refused from Google Fonts. The guide's last section, now "Status", states the CSP work is complete.
41
+
42
+ - [#479](https://github.com/softistx/nxgt-material/pull/479) [`e10c717`](https://github.com/softistx/nxgt-material/commit/e10c717bb6e3b74f444a2551b72314ddcd6c864c) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `@import "@nxgt/material"` (and `@nxgt/material-vue`) in CSS now resolves to the stylesheet under Vite and esbuild: the `style` condition comes before `import` in the `.` export, because those tools always add `import` when they resolve a CSS `@import`.
43
+ - Updated dependencies [[`3a2889d`](https://github.com/softistx/nxgt-material/commit/3a2889d71f1bfc9039ef43db916f3be3bf287ccd), [`634a58e`](https://github.com/softistx/nxgt-material/commit/634a58e3353ebe340e87b0f21858396aa4354654)]:
44
+ - @nxgt/material-core@0.9.0
45
+
46
+ ## 0.32.0
47
+
48
+ ### Minor Changes
49
+
50
+ - [#521](https://github.com/softistx/nxgt-material/pull/521) [`b76cd9a`](https://github.com/softistx/nxgt-material/commit/b76cd9ae3cc4f4d0f1b20cec31c9471819ffcd3c) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `Autocomplete` can search a server (softistx/nxgt-material#514). Fixes [#514](https://github.com/softistx/nxgt-material/issues/514).
51
+
52
+ - **Server search.** `onSearch(query, { signal })` (Vue: the function prop `on-search`, so `@search="fn"` binds it too) is called once typing pauses and its results become the list. Each search aborts the previous one (pass `signal` to `fetch`), and a response that lands after a newer one is dropped, even from an API that ignores the signal. `minQueryLength` (Vue: `min-query-length`, default 1) is how many characters it waits for; below it the list says "Type at least N characters to search." A rejected search is shown and announced ("The search failed. Try again.") and reported to `onSearchError` (Vue: `@search-error`). `options` is now optional: with `onSearch` it is the list before a search and the selected options' labels, and a picked option keeps its chip once a new search no longer returns it.
53
+ - **Controlled mode.** `loading` and `searchError` (Vue: `search-error`), beside `onQueryChange` (Vue: `@query-change`), for an app that fetches `options` itself.
54
+ - **A configurable debounce.** `debounceMs` (Vue: `debounce-ms`), 250 ms by default, sets the pause before `onSearch` and `onQueryChange`.
55
+ - **Accent-insensitive matching.** `filter`: `'accent-insensitive'` (the default without `onSearch`), `'none'` (the default with `onSearch`) or `(option, query) => boolean`. The default compares the label or value with the query lowercased in the provider's language and stripped of accents, so "e" finds "École" and "orle" finds "Orléans". Vue's exported `filterAutocompleteOptions` matches the same way and takes an optional `locale`.
56
+ - **Accessibility.** A polite live region announces "Loading…", then "N results" / "No results" (or the failure) once the search answers or typing pauses, not on every keystroke; the list is `aria-busy` while loading. New strings: `material.autocomplete.loading`, `.results`, `.search-error`, `.min-query` (en, fr). The keyboard works as before.
57
+ - React: clearing a single `Autocomplete`'s input no longer throws (`Cannot read properties of null (reading 'value')`).
58
+ - `@nxgt/material-core` adds `/debounce` (the `debounce` both libraries' `SearchField` kept a copy of, still exported by both, Vue now with its `Debounced` type), `/text-match` (`foldText`, `matchesText`) and `/async-search` (`createAsyncSearch`, `searchAnnouncement`).
59
+
60
+ Apps that built their own search field and result list while waiting for this (marked `Temporary, until material [#514](https://github.com/softistx/nxgt-material/issues/514)`) can replace it with `onSearch` and remove the workaround.
61
+
62
+ **Behaviour changes, no API removed.**
63
+
64
+ - Local matching ignores accents by default, so a query can keep more options than before. To match as before, pass your own `filter`, for example `filter={(option, query) => option.label.toLowerCase().includes(query.toLowerCase())}`; to show `options` exactly as given (filtered on your server), pass `filter="none"`.
65
+ - `onQueryChange` (`@query-change`) now runs 250 ms after typing pauses; it was a fixed 1 s in `@nxgt/material` and 300 ms in `@nxgt/material-vue`. Search for `onQueryChange` / `@query-change`, and add `debounceMs={1000}` (`:debounce-ms="300"`) where the old pause mattered — or move the fetch to `onSearch`.
66
+ - React: the list's empty text is no longer a live region of its own (Base UI's `ComboboxEmpty` had `role="status"`); the field's one status region (`[data-slot="autocomplete-status"]`) says "No results" instead. A test that found the empty text by `role="status"` finds it by its text.
67
+
68
+ - [#518](https://github.com/softistx/nxgt-material/pull/518) [`102f3b8`](https://github.com/softistx/nxgt-material/commit/102f3b822ea8d1e83aaffec8b6739ce4fdb5a599) Thanks [@SteveGT96](https://github.com/SteveGT96)! - A `RadioGroup` option can be disabled on its own (softistx/nxgt-material#513): `options` take `disabled?: boolean`, in `RadioGroup` and `RadioGroupFormField` of `@nxgt/material` and in `RadioGroupField` and `RadioGroupFormField` of `@nxgt/material-vue`. A disabled option is announced as disabled, skipped by the arrow keys (as the Radix and Reka UI primitives do), and drawn with a muted label (4.5:1 in both themes) and a faded radio; the group's own `disabled` still disables every option. `@nxgt/material` also exports the `RadioGroupOption` type, as `@nxgt/material-vue` does. Apps can drop the list of unavailable choices they kept apart (`Temporary, until material [#513](https://github.com/softistx/nxgt-material/issues/513)`). Fixes [#513](https://github.com/softistx/nxgt-material/issues/513).
69
+
70
+ ### Patch Changes
71
+
72
+ - [#519](https://github.com/softistx/nxgt-material/pull/519) [`18f30c1`](https://github.com/softistx/nxgt-material/commit/18f30c1cc6cc41c2b73a43fad2501b7db2bbc016) Thanks [@SteveGT96](https://github.com/SteveGT96)! - package.json names its repository, so issue reports route to it. Each package now has a `repository` field (`git+https://github.com/softistx/nxgt-material.git`, with its `directory` under `packages/`).
73
+ - Updated dependencies [[`b76cd9a`](https://github.com/softistx/nxgt-material/commit/b76cd9ae3cc4f4d0f1b20cec31c9471819ffcd3c), [`18f30c1`](https://github.com/softistx/nxgt-material/commit/18f30c1cc6cc41c2b73a43fad2501b7db2bbc016)]:
74
+ - @nxgt/material-core@0.8.0
75
+
3
76
  ## 0.31.0
4
77
 
5
78
  ### Minor Changes
package/README.md CHANGED
@@ -75,6 +75,12 @@ stores silently split between two instances.
75
75
  | `react`, `@react-pdf/renderer` | `^18.2 \|\| ^19`, `^4.9` | optional: only to render with `@nxgt/material-vue/pdf` |
76
76
  | `nuxt` | `>=3.13` | optional: only for `@nxgt/material-vue/nuxt` |
77
77
 
78
+ **zod** (`^4.4.3`) is a dependency, imported at runtime, not bundled: the
79
+ library uses the zod your app resolves. With a strict package manager (pnpm),
80
+ add it to the app (`bun add zod`) when your own code imports it. Under a
81
+ strict Content Security Policy, call `z.config({ jitless: true })` first:
82
+ [zod and `'unsafe-eval'`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/csp.md#zod-and-unsafe-eval).
83
+
78
84
  The tarball ships `dist/`, `docs/`, the stylesheets (`lib/styles.css`, the
79
85
  component stylesheets it imports, `lib/components/**/*.css`, and
80
86
  `lib/map/map.css`) and the Nuxt module (`lib/nuxt`, with the `lib/vite/index.ts` it imports), and, from the
@@ -93,13 +99,17 @@ Import the stylesheet **explicitly**, in your Tailwind v4 entry, right after
93
99
  @import "@nxgt/material-vue/styles.css";
94
100
  ```
95
101
 
102
+ Toaster and InputOTP take their CSS from this stylesheet: without it they render unstyled.
103
+
96
104
  `styles.css` is the **source** `@theme` layer and already declares the
97
105
  `@source` that makes your build generate the utilities used inside the
98
106
  components. It only applies when imported in the same file as
99
107
  `@import "tailwindcss"`: a second stylesheet (another Nuxt `css[]` entry)
100
108
  starts a second pipeline and the tokens never reach the app. Apps without
101
109
  Tailwind import the compiled `@nxgt/material-vue` style condition instead —
102
- never both. Details in [theming](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/theming.md).
110
+ never both. The compiled file loads KaTeX's fonts (`Markdown` maths) as
111
+ files from `dist/fonts/katex/`, beside it, which `font-src 'self'` allows (Vite inlines the 3.6 KB `KaTeX_Size3` font unless `assetsInlineLimit` is set: see the CSP guide's KaTeX fonts section); no
112
+ extra import is needed. Details in [theming](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/theming.md).
103
113
 
104
114
  The required-field mark after a `Label` is drawn by this stylesheet too, so
105
115
  a page or test rendered without it shows no `*`.
@@ -168,16 +178,16 @@ does not add the stylesheet. Options and the client-only widgets are in
168
178
  | `@nxgt/material-vue/components` | UI components and `*FormField` wrappers ([Components](#components)) |
169
179
  | `@nxgt/material-vue/map` | Leaflet maps, markers, a location field — **its own entry, not in the barrel** ([maps guide](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/maps.md)) |
170
180
  | `@nxgt/material-vue/pdf` | PDF files from plain data: builders, `usePdf`, `PdfDownloadButton`, `pdfResponse` — **its own entry, not in the barrel** ([PDF guide](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/pdf.md)) |
171
- | `@nxgt/material-vue/composables` | `useTheme`, `useIsClient`, `useIsMobile`, `useSearchParam`, … ([helpers](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/helpers.md)) |
181
+ | `@nxgt/material-vue/composables` | `useTheme`, `useIsClient`, `useIsMobile`, `useSearchParam`, `useCspNonce`, … ([helpers](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/helpers.md)) |
172
182
  | `@nxgt/material-vue/dnd` | drag-and-drop primitives ([helpers](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/helpers.md)) |
173
183
  | `@nxgt/material-vue/i18n` | `I18nProvider`, `mergeResources`, `createTranslator`, `translateMaterial`, … ([i18n guide](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/i18n.md)) |
174
- | `@nxgt/material-vue/lib` | `cn`, `clientOnly`, date/number/string utils, Zod error map, `focusFirstInvalid` / `focusField` (focus an invalid field, see [forms](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/forms.md#focusing-the-first-invalid-field)), Pinia store factories ([helpers](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/helpers.md)) |
184
+ | `@nxgt/material-vue/lib` | `cn`, `clientOnly`, date/number/string utils, Zod error map, `focusFirstInvalid` / `focusField` (focus an invalid field, see [forms](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/forms.md#focusing-the-first-invalid-field)), Pinia store factories, `getCspNonce` / `setCspNonce` ([helpers](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/helpers.md)) |
175
185
  | `@nxgt/material-vue/models` | `Status<T>` |
176
186
  | `@nxgt/material-vue/types` | shared function types |
177
187
  | `@nxgt/material-vue/styles.css` | source Tailwind v4 tokens: **this** is what a Tailwind app imports |
178
188
  | `@nxgt/material-vue/map.css` | leaflet's stylesheet, for the apps that use `./map`. Not part of `styles.css` |
179
189
  | `@nxgt/material-vue/nuxt` | Nuxt module |
180
- | `@nxgt/material-vue/vite` | `pdfkitStandardFonts()`, a Vite plugin for a server that inlines `/pdf` with no `node_modules` at runtime ([PDF guide](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/pdf.md#fonts-on-a-fully-inlined-server)) |
190
+ | `@nxgt/material-vue/vite` | `pdfkitStandardFonts()`, a Vite plugin for a server that inlines `/pdf` with no `node_modules` at runtime ([PDF guide](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/pdf.md#fonts-on-a-fully-inlined-server)); `cspAssetsInlineLimit`, a `build.assetsInlineLimit` that never inlines a font ([CSP guide](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/csp.md#katex-fonts)) |
181
191
 
182
192
  ## Usage
183
193
 
@@ -317,6 +327,7 @@ Each area a consumer starts from has its own page under `docs/guides/`.
317
327
  | [PDF documents](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/pdf.md) | PDF files from data with `@nxgt/material-vue/pdf`: builders, `usePdf`, `PdfDownloadButton`, a Nitro route with `pdfResponse`, fonts on an inlined server |
318
328
  | [Maps](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/maps.md) | using `@nxgt/material-vue/map` — optional leaflet peers, `map.css`, what `Map` does when you pass nothing |
319
329
  | [SSR and Nuxt](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/ssr.md) | rendering on a server or with Nuxt: the module, what the barrels guarantee, `clientOnly` for browser-only code |
330
+ | [Content Security Policy](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/csp.md) | serving a strict CSP: the directives, `NonceProvider` and the per-request nonce, the components that still inject a `<style>`, the zod and KaTeX settings, a self-hosted font |
320
331
  | [Helpers](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/helpers.md) | the non-component subpaths: `/lib`, `/composables`, `/i18n`, `/models`, `/types`, `/dnd` |
321
332
 
322
333
  **Upgrading**: 0.3.0 stopped injecting the stylesheet from the Nuxt module,
@@ -365,6 +376,7 @@ React-only for now: `StepperIndicator` ([roadmap](https://cdn.jsdelivr.net/npm/@
365
376
  | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/primitives-toggle.webp" width="120" alt="Toggle"> | [`Toggle`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/primitives.md#toggle), `ToggleGroup`, `ToggleGroupItem` | Pressable on / off button: default or outline, three sizes. | `Toggle` |
366
377
  | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/primitives-togglegroup.webp" width="120" alt="ToggleGroup"> | [`Toggle`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/primitives.md#togglegroup), `ToggleGroup`, `ToggleGroupItem` | Single or multiple toggle group sharing variant and size. | `ToggleGroup`, `ToggleGroupItem`, `ToggleGroupSeparator` |
367
378
  | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/primitives-activity.webp" width="120" alt="Activity"> | [`Activity`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/primitives.md#activity) | Keeps its content mounted and hides it with a boolean `visible`. | `Activity` |
379
+ | — | [`NonceProvider`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/primitives.md#nonceprovider) | Gives the page's CSP nonce to every component below; `useCspNonce()` reads it ([CSP guide](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/guides/csp.md#nonceprovider)). | `NonceProvider` |
368
380
  | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/primitives-scrollarea.webp" width="120" alt="ScrollArea"> | [`ScrollArea`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/primitives.md#scrollarea), `ScrollBar` | Scroll container with a thin custom scrollbar that matches the theme. | `ScrollArea`, `ScrollBar` |
369
381
 
370
382
  ### Buttons & actions
@@ -409,10 +421,10 @@ React-only for now: `StepperIndicator` ([roadmap](https://cdn.jsdelivr.net/npm/@
409
421
  | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/form-fields-ratingfield.webp" width="120" alt="RatingField"> | [`RatingField`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/form-fields.md#ratingfield) · `RatingFormField` | Star rating with hover preview, click-to-clear and a read-only mode. | `RatingField`, `RatingFormField` |
410
422
  | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/form-fields-slider.webp" width="120" alt="Slider"> | [`SliderField`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/form-fields.md#slider) · `SliderFormField`, `Slider` | Labelled single or range slider with a value readout, ticks and leading / trailing content. | `Slider`, `SliderField` (alias), `SliderFormField` |
411
423
  | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/form-fields-switch.webp" width="120" alt="Switch"> | [`SwitchField`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/form-fields.md#switch) · `SwitchFormField`, `Switch` | Toggle switch, optionally in a labelled, bordered row. | `Switch`, `SwitchField` (alias), `SwitchFormField` |
412
- | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/form-fields-attributes.webp" width="120" alt="Attributes"> | [`AttributesField`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/form-fields.md#attributes), `AttributesList`, `AttributeDialog`, `AttributeForm` · `AttributesFormField`, `AttributeValuesForm`, `AttributeValueFormField` · `AttributeValuesFormFieldSet` | Editor for typed custom attributes (string, number, date, select, rich text…). `AttributesField` takes `error` and `helperText`; `AttributesFormField` takes `helperText` and follows `resetForm` / `setFieldValue`. | `AttributesField`, `AttributesList`, `AttributeDialog`, `AttributeForm`, `AttributeValuesForm`, `AttributesFormField`, `AttributeValuesFormFieldSet`, `AttributeValueFormField` |
424
+ | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/form-fields-attributes.webp" width="120" alt="Attributes"> | [`AttributesField`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/form-fields.md#attributes), `AttributesList`, `AttributeDialog`, `AttributeForm` · `AttributesFormField`, `AttributeValuesForm`, `AttributeValueFormField` · `AttributeValuesFormFieldSet` | Editor for typed custom attributes (string, number, date, select, rich text…). `AttributesField` takes `error` and `helperText`; `AttributesFormField` takes `helperText` and follows `resetForm` / `setFieldValue`. | `AttributesField`, `AttributesList`, `AttributeDialog`, `AttributeForm`, `AttributeValuesForm`, `AttributesFormField`, `AttributeValuesFormFieldSet`, `AttributeValueFormField`, `attributeFormSchema()` |
413
425
  | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/form-fields-contacts.webp" width="120" alt="Contacts"> | [`Contacts`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/form-fields.md#contacts), `ContactDialog`, `ContactItem` (deprecated) · `ContactsFormField` | Typed contact list (phone, email, URL…) with an add / edit dialog. | `Contacts`, `ContactItem`, `ContactDialog`, `ContactsFormField` |
414
426
  | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/form-fields-postaladdress.webp" width="120" alt="PostalAddress"> | [`PostalAddress`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/form-fields.md#postaladdress), `PostalAddressDialog` · `PostalAddressFormField` | Address card with an edit dialog. | `PostalAddress`, `PostalAddressDialog`, `PostalAddressFormField` |
415
- | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/form-fields-openinghours.webp" width="120" alt="OpeningHours"> | [`OpeningHours`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/form-fields.md#openinghours), `OpeningHoursDialog`, `OpeningHoursItem` (deprecated) · `OpeningHoursFormField` | Weekly opening hours with an add / edit dialog. | `OpeningHours`, `OpeningHoursDialog`, `OpeningHoursItem`, `OpeningHoursFormField` |
427
+ | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/form-fields-openinghours.webp" width="120" alt="OpeningHours"> | [`OpeningHours`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/form-fields.md#openinghours), `OpeningHoursDialog`, `OpeningHoursItem` (deprecated) · `OpeningHoursFormField` | Weekly opening hours with an add / edit dialog. | `OpeningHours`, `OpeningHoursDialog`, `OpeningHoursItem`, `OpeningHoursFormField`, `openingHoursSchema()` (`OpeningHoursSchema` deprecated) |
416
428
 
417
429
  ### Date & time
418
430
 
@@ -433,7 +445,7 @@ React-only for now: `StepperIndicator` ([roadmap](https://cdn.jsdelivr.net/npm/@
433
445
  | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/selection-choice-selectfield.webp" width="120" alt="SelectField"> | [`SelectField`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/selection-and-choice.md#selectfield) · `SelectFormField` | Labelled select built from `options`, with an `#option` slot. | `SelectField`, `SelectFormField` |
434
446
  | — | [Combobox](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/selection-and-choice.md#combobox) | The raw combobox primitives are not in `@nxgt/material-vue`. Use [`ComboboxField`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/selection-and-choice.md#comboboxfield) for a searchable single select, [`Autocomplete`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/selection-and-choice.md#autocomplete) for several values or free text, or the `Command` parts (Overlays & menus) for a hand-built list. | `Combobox` |
435
447
  | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/selection-choice-comboboxfield.webp" width="120" alt="ComboboxField"> | [`ComboboxField`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/selection-and-choice.md#comboboxfield) · `ComboboxFormField` | Labelled, searchable single select over `{ value, label }` options, in a popover. | `ComboboxField`, `ComboboxFormField` |
436
- | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/selection-choice-autocomplete.webp" width="120" alt="Autocomplete"> | [`Autocomplete`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/selection-and-choice.md#autocomplete) · `AutocompleteFormField` | Single or multiple (chips) autocomplete typed by its options, with free-solo values, a query event and option slots. | `Autocomplete`, `AutocompleteFormField` |
448
+ | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/selection-choice-autocomplete.webp" width="120" alt="Autocomplete"> | [`Autocomplete`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/selection-and-choice.md#autocomplete) · `AutocompleteFormField` | Single or multiple (chips) autocomplete typed by its options, with free-solo values, accent-insensitive matching, a debounced server search and option slots. | `Autocomplete`, `AutocompleteFormField` |
437
449
  | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/selection-choice-checkbox.webp" width="120" alt="Checkbox"> | [`Checkbox`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/selection-and-choice.md#checkbox) · `CheckboxFormField` | Checkbox with label, helper text and an indeterminate state; without a label, the bare Reka UI box. | `Checkbox`, `CheckboxFormField` |
438
450
  | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/selection-choice-checkboxgroup.webp" width="120" alt="CheckboxGroup"> | [`CheckboxGroup`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/selection-and-choice.md#checkboxgroup) · `CheckboxGroupFormField` | Checkbox list built from `options`, valued as `string[]`. | `CheckboxGroup`, `CheckboxGroupFormField` |
439
451
  | <img src="https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/previews/selection-choice-radiogroup.webp" width="120" alt="RadioGroup"> | [`RadioGroupField`](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/components/selection-and-choice.md#radiogroup) · `RadioGroupFormField`, `RadioGroup`, `RadioGroupItem` | Labelled radio group built from `options`, horizontal or vertical. | `RadioGroupField` (alias), `RadioGroup`, `RadioGroupItem`, `RadioGroupFormField` |
@@ -582,6 +594,7 @@ The ones that cost the most time. Every error message, with its fix, is in
582
594
  | Symptom | Fix |
583
595
  | --- | --- |
584
596
  | Components render unstyled, no console error | import `styles.css` right after `@import "tailwindcss"`, in the same file ([getting started](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/getting-started.md#styles)) |
597
+ | Toast or OTP input unstyled | import `@nxgt/material-vue/styles.css` (or `dist/material-vue.css`) |
585
598
  | `<Icon>` is blank | serve `public/assets/icons/sprites/<style>.svg` |
586
599
  | `Cannot find package '@nxgt/material-core'` at server boot | add `@nxgt/material-core` wherever `@nxgt/material-vue` is in `ssr.noExternal` or `--external` ([troubleshooting](https://cdn.jsdelivr.net/npm/@nxgt/material-vue@0/docs/troubleshooting.md#cannot-find-package-nxgtmaterial-core)) |
587
600
  | `getActivePinia()` was called but there was no active Pinia | `app.use(createPinia())` before mount (the Nuxt module does it) |
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./utils-CykWQ0iJ.js";
2
- import { t } from "./use-material-translation-Do6ztdtV.js";
2
+ import { t } from "./use-material-translation-CaHS6oZz.js";
3
3
  import { Comment as n, Fragment as r, Text as i, computed as a, createBlock as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, guardReactiveProps as f, h as p, inject as ee, isVNode as m, mergeProps as h, normalizeClass as g, normalizeProps as _, onBeforeUnmount as v, openBlock as y, provide as b, ref as x, renderSlot as S, shallowRef as C, unref as w, useAttrs as te, useSlots as ne, watch as T, withCtx as E } from "vue";
4
4
  import { Primitive as D, TooltipArrow as O, TooltipContent as k, TooltipPortal as A, TooltipProvider as re, TooltipRoot as j, TooltipTrigger as M, useForwardPropsEmits as N } from "reka-ui";
5
5
  import { cva as P } from "class-variance-authority";
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./utils-CykWQ0iJ.js";
2
- import { t } from "./use-material-translation-Do6ztdtV.js";
3
- import { t as n } from "./Button-CNbJT5qV.js";
2
+ import { t } from "./use-material-translation-CaHS6oZz.js";
3
+ import { t as n } from "./Button-DEA5W6O3.js";
4
4
  import { t as r } from "./use-inert-others-CtGqZKR8.js";
5
5
  import { t as i } from "./field-name-attribute-Bl7LSVK0.js";
6
6
  import { computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, getCurrentInstance as p, guardReactiveProps as m, isRef as h, mergeProps as g, normalizeClass as _, normalizeProps as v, onMounted as ee, onUpdated as y, openBlock as b, renderSlot as x, toDisplayString as S, unref as C, useAttrs as w, useId as T, useTemplateRef as E, vModelText as D, withCtx as O, withDirectives as k } from "vue";
@@ -1,8 +1,8 @@
1
1
  import { t as e } from "./utils-CykWQ0iJ.js";
2
- import { gr as t, mr as n, pr as r } from "./components-Dxy9DvEe.js";
3
- import { t as i } from "./use-material-translation-Do6ztdtV.js";
4
- import { t as a } from "./Button-CNbJT5qV.js";
5
- import { t as o } from "./icon-button-DXXjxBgr.js";
2
+ import { _r as t, hr as n, mr as r } from "./components-CmIOfRO4.js";
3
+ import { t as i } from "./use-material-translation-CaHS6oZz.js";
4
+ import { t as a } from "./Button-DEA5W6O3.js";
5
+ import { t as o } from "./icon-button-CWcOcNHr.js";
6
6
  import { createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, normalizeClass as m, openBlock as h, ref as g, renderSlot as _, shallowRef as v, toDisplayString as y, unref as b, withCtx as x } from "vue";
7
7
  import { Pause as S, Play as C } from "@lucide/vue";
8
8
  //#region lib/components/ui/media/camera/camera-content.vue?vue&type=script&setup=true&lang.ts
@@ -6,7 +6,8 @@
6
6
  * The code theme (CodeBlock); PdfReader's text layer, highlights and pdf.js's
7
7
  * annotation layer; KaTeX (Markdown), highlight.js (RichTextEditor code
8
8
  * blocks), vue-sonner (Toaster), vue-advanced-cropper (ImageCropper); and the
9
- * components styled by a stylesheet of their own. */
9
+ * components styled by a stylesheet of their own, input-otp.css among them:
10
+ * the rules vue-input-otp also injects, here for a strict CSP. */
10
11
  @import "./ui/display/code/code-moonlight.css";
11
12
  @import "./ui/media/pdf-viewer/pdf-viewer.css";
12
13
  @import "./ui/media/pdf-viewer/pdf-annotation-layer.css";
@@ -15,6 +16,7 @@
15
16
  @import "vue-sonner/style.css";
16
17
  @import "vue-advanced-cropper/dist/style.css";
17
18
  @import "./ui/feedback/spinner/spinner.css";
19
+ @import "./ui/fields/otp-field/input-otp.css";
18
20
  @import "./ui/media/image-cropper/partials/image-cropper-canvas.css";
19
21
  @import "./ui/actions/button-group/button-group.css";
20
22
  @import "./ui/primitives/label/label.css";
@@ -0,0 +1,48 @@
1
+ /* The rules input-otp (React, 1.4.2) and vue-input-otp (0.4.0) add on mount,
2
+ * through `insertRule` into a `<style id="input-otp-style">`: the hidden
3
+ * input's caret, selection and autofill stay invisible behind the slots.
4
+ * Here so a strict CSP blocks nothing. @nxgt/material strips input-otp's
5
+ * injection at build (build/strip-style-injection.ts); vue-input-otp is
6
+ * external, still injects, and takes the nonce (NonceProvider). The same file
7
+ * in both libraries (scripts/shared-paths.ts). */
8
+ /* biome-ignore-all lint/complexity/noImportantStyles: input-otp's own rules */
9
+ [data-input-otp]::selection {
10
+ background: transparent !important;
11
+ color: transparent !important;
12
+ }
13
+
14
+ /* Two rules: a browser that does not know one pseudo-class drops the list. */
15
+ [data-input-otp]:autofill {
16
+ background: transparent !important;
17
+ color: transparent !important;
18
+ border-color: transparent !important;
19
+ opacity: 0 !important;
20
+ box-shadow: none !important;
21
+ -webkit-box-shadow: none !important;
22
+ -webkit-text-fill-color: transparent !important;
23
+ }
24
+
25
+ [data-input-otp]:-webkit-autofill {
26
+ background: transparent !important;
27
+ color: transparent !important;
28
+ border-color: transparent !important;
29
+ opacity: 0 !important;
30
+ box-shadow: none !important;
31
+ -webkit-box-shadow: none !important;
32
+ -webkit-text-fill-color: transparent !important;
33
+ }
34
+
35
+ @supports (-webkit-touch-callout: none) {
36
+ [data-input-otp] {
37
+ letter-spacing: -0.6em !important;
38
+ font-weight: 100 !important;
39
+ font-stretch: ultra-condensed;
40
+ font-optical-sizing: none !important;
41
+ left: -1px !important;
42
+ right: 1px !important;
43
+ }
44
+ }
45
+
46
+ [data-input-otp] + * {
47
+ pointer-events: all !important;
48
+ }