@nxgt/material-vue 0.32.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 (68) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +19 -6
  3. package/dist/{camera-DlWK0PLP.js → camera-B063QUeM.js} +1 -1
  4. package/dist/components/components.css +3 -1
  5. package/dist/components/ui/fields/otp-field/input-otp.css +48 -0
  6. package/dist/{components-Dqg7KwA2.js → components-CmIOfRO4.js} +12866 -16805
  7. package/dist/components.js +8 -8
  8. package/dist/composables.js +24 -24
  9. package/dist/fonts/katex/KaTeX_AMS-Regular.woff2 +0 -0
  10. package/dist/fonts/katex/KaTeX_Caligraphic-Bold.woff2 +0 -0
  11. package/dist/fonts/katex/KaTeX_Caligraphic-Regular.woff2 +0 -0
  12. package/dist/fonts/katex/KaTeX_Fraktur-Bold.woff2 +0 -0
  13. package/dist/fonts/katex/KaTeX_Fraktur-Regular.woff2 +0 -0
  14. package/dist/fonts/katex/KaTeX_Main-Bold.woff2 +0 -0
  15. package/dist/fonts/katex/KaTeX_Main-BoldItalic.woff2 +0 -0
  16. package/dist/fonts/katex/KaTeX_Main-Italic.woff2 +0 -0
  17. package/dist/fonts/katex/KaTeX_Main-Regular.woff2 +0 -0
  18. package/dist/fonts/katex/KaTeX_Math-BoldItalic.woff2 +0 -0
  19. package/dist/fonts/katex/KaTeX_Math-Italic.woff2 +0 -0
  20. package/dist/fonts/katex/KaTeX_SansSerif-Bold.woff2 +0 -0
  21. package/dist/fonts/katex/KaTeX_SansSerif-Italic.woff2 +0 -0
  22. package/dist/fonts/katex/KaTeX_SansSerif-Regular.woff2 +0 -0
  23. package/dist/fonts/katex/KaTeX_Script-Regular.woff2 +0 -0
  24. package/dist/fonts/katex/KaTeX_Size1-Regular.woff2 +0 -0
  25. package/dist/fonts/katex/KaTeX_Size2-Regular.woff2 +0 -0
  26. package/dist/fonts/katex/KaTeX_Size3-Regular.woff2 +0 -0
  27. package/dist/fonts/katex/KaTeX_Size4-Regular.woff2 +0 -0
  28. package/dist/fonts/katex/KaTeX_Typewriter-Regular.woff2 +0 -0
  29. package/dist/{form-scope-btEYYnGW.js → form-scope-DuDx5Jyx.js} +1 -1
  30. package/dist/lib/components/ui/fields/attributes/form-schema.d.ts +11 -2
  31. package/dist/lib/components/ui/fields/opening-hours/consts.d.ts +12 -1
  32. package/dist/lib/components/ui/primitives/index.d.ts +1 -0
  33. package/dist/lib/components/ui/primitives/nonce-provider/index.d.ts +2 -0
  34. package/dist/lib/components/ui/primitives/nonce-provider/nonce-provider.vue.d.ts +20 -0
  35. package/dist/lib/composables/index.d.ts +1 -0
  36. package/dist/lib/composables/use-csp-nonce.d.ts +18 -0
  37. package/dist/lib/lib/index.d.ts +1 -0
  38. package/dist/lib/nuxt/auto-imports.d.ts +1 -1
  39. package/dist/lib/nuxt/component-names.d.ts +1 -1
  40. package/dist/lib/vite/index.d.ts +3 -2
  41. package/dist/lib.js +48 -47
  42. package/dist/main.js +17 -17
  43. package/dist/material-vue.css +1 -1
  44. package/dist/{pdf-outline-sidebar-DchMD-_k.js → pdf-outline-sidebar-CzY59j_Y.js} +1 -1
  45. package/dist/{pdf-page-list-Cta0S89W.js → pdf-page-list-BMxNOnPk.js} +2 -2
  46. package/dist/{pdf-page-D-kDQq5h.js → pdf-page-nM_fvTHh.js} +1 -1
  47. package/dist/{pdf-reader-BwWozoIQ.js → pdf-reader-Dpv3oWe1.js} +48 -45
  48. package/dist/{pdf-sidebar-B0Addf1P.js → pdf-sidebar-DkefUgWg.js} +2 -2
  49. package/dist/{pdf-thumbnail-sidebar-Dsptq4fb.js → pdf-thumbnail-sidebar-I6i1lv5J.js} +2 -2
  50. package/dist/{stx-player-Bpnir1KO.js → stx-player-CN7Ic8tP.js} +13 -13
  51. package/dist/{use-heading-spy-Czi_Xv3u.js → use-heading-spy-DimKb49j.js} +53 -45
  52. package/dist/vite.js +2 -2
  53. package/docs/README.md +1 -0
  54. package/docs/components/data-display.md +5 -0
  55. package/docs/components/form-fields.md +23 -0
  56. package/docs/components/primitives.md +41 -0
  57. package/docs/getting-started.md +5 -1
  58. package/docs/guides/csp.md +420 -0
  59. package/docs/guides/helpers.md +2 -0
  60. package/docs/guides/theming.md +27 -0
  61. package/docs/roadmap.md +17 -0
  62. package/docs/troubleshooting.md +139 -0
  63. package/lib/components/components.css +3 -1
  64. package/lib/components/ui/fields/otp-field/input-otp.css +48 -0
  65. package/lib/nuxt/auto-imports.ts +1 -0
  66. package/lib/nuxt/component-names.ts +1 -0
  67. package/lib/vite/index.ts +6 -2
  68. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
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
+
3
46
  ## 0.32.0
4
47
 
5
48
  ### 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
 
@@ -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 { gr as t, mr as n, pr as r } from "./components-Dqg7KwA2.js";
2
+ import { _r as t, hr as n, mr as r } from "./components-CmIOfRO4.js";
3
3
  import { t as i } from "./use-material-translation-CaHS6oZz.js";
4
4
  import { t as a } from "./Button-DEA5W6O3.js";
5
5
  import { t as o } from "./icon-button-CWcOcNHr.js";
@@ -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
+ }