@softistx/material 3.249.0 → 3.250.1

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.
@@ -481,7 +481,7 @@ The tint follows the theme's primary. Pass `backdrop={false}` on the card: the v
481
481
 
482
482
  ![AccountFrame](https://github.com/softistx/nxgt-material/blob/develop/packages/material/docs/previews/navigation-layout-accountframe.webp)
483
483
 
484
- The frame of a signed-in page that is not the app's shell (a workspace chooser, an account page, a consent screen). A sibling of `AuthCard` on the same base: one `main`, the title as the page's `h1`, a brand row, a notice (status or alert), a footer, an optional backdrop and safe-area padding. It adds the signed-in `account` (the last item at the far right of the brand row, after `toolbar`, as in `AppShell`), `width` (`'sm'` 24rem, `'md'` 32rem by default, `'lg'` 48rem), `surface` (`'card'` by default, or `'plain'` with no border, fill, shadow or inner padding), a tinted page `ground` and a raised card by default (`ground="none"`, `elevation="flat"` opt out), and a `hero` band inside the card. `AuthCard` keeps its own `max-w-sm` card.
484
+ The frame of a signed-in page that is not the app's shell (a workspace chooser, an account page, a consent screen). A sibling of `AuthCard` on the same base: one `main`, the title as the page's `h1`, a brand row, a notice (status or alert), a footer, an optional backdrop and safe-area padding. It adds the signed-in `account` (the last item at the far right of the brand row, after `toolbar`, as in `AppShell`), `width` (`'sm'` 24rem, `'md'` 32rem by default, `'lg'` 48rem, `'xl'` 64rem and `'2xl'` 80rem for a two-column page), `surface` (`'card'` by default, or `'plain'` with no border, fill, shadow or inner padding), a tinted page `ground` and a raised card by default (`ground="none"`, `elevation="flat"` opt out), and a `hero` band inside the card. `AuthCard` keeps its own `max-w-sm` card.
485
485
 
486
486
  ```tsx
487
487
  import { AccountFrame, Button, LanguageSwitcher } from '@softistx/material/components';
@@ -527,7 +527,7 @@ An account page that keeps the workspace's trail: the routes declare `handle.bre
527
527
  | `breadcrumb` | `boolean` | `false` | Shows the breadcrumb trail (`AppBreadcrumb`, built from the matched routes' `handle.breadcrumb`) in a row between the brand row and the card, as `ActivityLayout` draws it, hidden on a phone. Needs a data router (#4944). |
528
528
  | `breadcrumbRoot` | `AppBreadcrumbRoot` | none | The trail's first crumb, as `ActivityLayout`'s `breadcrumbRoot`: a text link, or (`icon: true`) the home icon with its own target and name. |
529
529
  | `back` | `true \| 'breadcrumb' \| { to, label? }` | none | A way back at the start of the trail row, as `handle.back`: `true` goes back in the history; `{ to, label }` is a link named "Back to <label>"; `'breadcrumb'` links to the trail's parent crumb below 768px only, where the trail is hidden. A `SettingsLayout` with `hideFrameBack` hides it on a phone while a section page is open. |
530
- | `width` | `'sm' \| 'md' \| 'lg'` | `'md'` | The width of the row, the panel and the footer: 24, 32 or 48rem. |
530
+ | `width` | `'sm' \| 'md' \| 'lg' \| 'xl' \| '2xl'` | `'md'` | The width of the row, the panel and the footer: 24, 32, 48, 64 or 80rem. |
531
531
  | `surface` | `'card' \| 'plain'` | `'card'` | `'plain'` drops the panel's border, fill, shadow and inner horizontal padding, so the title, description and content share the left edge of the brand row and the banner (#4707). |
532
532
  | `notice`, `noticeTone` | `ReactNode`, `'info' \| 'success' \| 'warning' \| 'error'` | none, `'info'` | A notice above the content; `'error'` makes it an alert, the others a status. |
533
533
  | `focusTitle` | `boolean` | `false` | Moves the focus to the title once shown. |
@@ -67,6 +67,8 @@ createRoot(shadow).render(
67
67
  | `EmailField`, `EmailFieldProps` | an e-mail field with a mail icon drawn inline (no sprite sheet) and a send button |
68
68
  | `Checkbox`, `CheckboxProps` | an opt-in box with a `label` and a `helperText` description (also the form's error), `readOnly`, indeterminate |
69
69
  | `CheckboxFormField` | the checkbox wired to React Hook Form (`control`, `name`) |
70
+ | `SwitchField`, `SwitchFieldProps` | a labelled switch; `variant="plain"` keeps the label beside it with no border, and `helperText` shows under it (also the form's error) |
71
+ | `SwitchFormField` | the switch wired to React Hook Form (`control`, `name`) |
70
72
  | `TextFormField`, `EmailFormField`, `TextareaFormField` | the fields wired to React Hook Form (`control`, `name`) |
71
73
  | `Alert` | a notice |
72
74
  | `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent` | underline (default) or pill tabs; arrow keys move between them. A trigger's `icon` is a node, not a sprite name |
@@ -78,6 +80,7 @@ createRoot(shadow).render(
78
80
  | `Spinner` | a busy indicator |
79
81
  | `ChatThread`, `ChatMessageList`, `ChatMessage`, `ChatMessageSeparator`, `ChatComposer` | a chat: the frame, the scrolling list, a message, a day or "unread" separator and the composer with attachments ([A chat in an embed](#a-chat-in-an-embed)) |
80
82
  | `AttachmentList`, `AttachmentItem` | the files of a message: type icon, name, size, canvas thumbnail, progress, refusal text, Remove ([Files in an embed](#files-in-an-embed)) |
83
+ | `ConfirmDialog` | the destructive confirm ("Delete my data"): Cancel on the left, the short main action on the right, one row; each button `flex-1` in a phone-width container; opens from inside an open `Dialog` ([A confirm in an embed](#a-confirm-in-an-embed)) |
81
84
  | `NonceProvider` | the host page's CSP nonce, for the `<style>` of `ChatMessageList`'s scroll area ([Strict CSP](#strict-csp-and-the-chat-scroll-area)) |
82
85
  | `I18nProvider` | the language of the labels (`initialLanguage`), for `AttachmentList` ([Files in an embed](#files-in-an-embed)) |
83
86
  | `NxgtThemeProvider` | the theme and dark mode; it renders no element |
@@ -416,3 +419,44 @@ import { NonceProvider, ChatThread } from '@softistx/material/embed';
416
419
  ```
417
420
 
418
421
  Mounting the provider also sets the shared `Symbol.for('nxgt.cspNonce')` key on the host page's `globalThis` (the nonce for code that runs outside React).
422
+
423
+ ## A confirm in an embed
424
+
425
+ `ConfirmDialog` is exported from `@softistx/material/embed` and its classes are in
426
+ `embed.css`. It can open from inside an already-open `Dialog`: it portals into the
427
+ `PortalContainerProvider`'s shadow root like the `Dialog`. Its modal scroll lock adds
428
+ a `<style>` to the page; in the embed build that style takes its nonce from the
429
+ `NonceProvider` around the widget, so keep one there under a strict `style-src`.
430
+
431
+ ```tsx
432
+ import {
433
+ ConfirmDialog,
434
+ Dialog,
435
+ DialogContent,
436
+ DialogTitle,
437
+ NonceProvider,
438
+ PortalContainerProvider,
439
+ } from '@softistx/material/embed';
440
+
441
+ <NonceProvider nonce={hostNonce}>
442
+ <PortalContainerProvider container={shadow}>
443
+ <Dialog open>
444
+ <DialogContent>
445
+ <DialogTitle>Your data</DialogTitle>
446
+ <ConfirmDialog
447
+ open={askDelete}
448
+ onOpenChange={setAskDelete}
449
+ title="Delete my data"
450
+ description="This cannot be undone."
451
+ confirmLabel="Delete"
452
+ tone="danger"
453
+ onConfirm={deleteMyData}
454
+ />
455
+ </DialogContent>
456
+ </Dialog>
457
+ </PortalContainerProvider>
458
+ </NonceProvider>;
459
+ ```
460
+
461
+ Its props are those of the main entry's `ConfirmDialog` (`confirmPhrase`, `reason`,
462
+ `refusal`, …).
package/docs/roadmap.md CHANGED
@@ -208,6 +208,7 @@ version they shipped in, and planned entries may name the major they target.
208
208
 
209
209
  - **Indoor floor plans and terrain** — `FloorPlan`, a plan per floor from an image or SVG with a floor selector, markers, popups and clickable rooms, rendered on the server and without the map engine; then hillshade and optional 3D terrain from a keyless elevation source or your own ([#4576](https://github.com/softistx/nxgt-material/issues/4576)).
210
210
  - **Gallery view for folders** — `FileManager` gets a "Gallery" view mode that shows a folder's images and documents as large thumbnails.
211
+ - **Image editor remaster** — `ImageEditor` and `ImageMarkupEditor` get a remastered shared shell with a modern bottom tool bar (the new default look, same props), ellipse and straight line shapes with an outline or a tinted fill ([#5321](https://github.com/softistx/nxgt-material/issues/5321)), zoom and pan ([#5323](https://github.com/softistx/nxgt-material/issues/5323)), a before/after compare ([#5324](https://github.com/softistx/nxgt-material/issues/5324)) and a richer colour palette ([#5325](https://github.com/softistx/nxgt-material/issues/5325)); it builds on the side panel in wide containers ([#5319](https://github.com/softistx/nxgt-material/issues/5319)). Tracking [#5326](https://github.com/softistx/nxgt-material/issues/5326).
211
212
  - **Editing inside viewers** — viewers stay read-only and gain an Edit action that opens the matching editor: the image editor for a picture, annotation for a PDF.
212
213
  - **`ButtonGroup` standard look by default, and the old `Typography` names
213
214
  removed (4.0)** — `ButtonGroup`'s Material 3 Expressive look (`look="standard"`)
@@ -167,6 +167,13 @@
167
167
  background: var(--nxgt-backdrop-fill-nav);
168
168
  backdrop-filter: blur(var(--nxgt-backdrop-blur));
169
169
  }
170
+ /* The trailing edge is closed by the bar itself: it reaches the
171
+ * page edge through a negative end margin its end padding gives back, so the row
172
+ * keeps its place and no 0.5rem strip of page ground shows past the fill. */
173
+ [data-slot="app-header"].nxgt-bar-sidebar {
174
+ margin-inline-end: calc(-1 * max(0.5rem, env(safe-area-inset-right)));
175
+ padding-inline-end: max(0.5rem, env(safe-area-inset-right));
176
+ }
170
177
  /* ...and no seam: the bar fills the 0.5rem of frame padding at its start (a
171
178
  * pseudo-element, so the bar's own height, which the sticky offsets measure,
172
179
  * stays as it was; against a rail it closes the gap to its fill, without one
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softistx/material",
3
- "version": "3.249.0",
3
+ "version": "3.250.1",
4
4
  "license": "MIT",
5
5
  "bugs": {
6
6
  "email": "stevegires@gmail.com"
@@ -1,29 +0,0 @@
1
- import { Suspense as e, use as t } from "react";
2
- import { browser as n } from "react-dom";
3
- import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
4
- //#region lib/lib/browser-only.tsx
5
- function o({ reason: e, children: r }) {
6
- return t(n(e)), r;
7
- }
8
- function s({ reason: t, fallback: n = null, children: r }) {
9
- return /* @__PURE__ */ i(e, {
10
- fallback: n,
11
- children: /* @__PURE__ */ i(o, {
12
- reason: t,
13
- children: r
14
- })
15
- });
16
- }
17
- //#endregion
18
- //#region lib/components/ui/primitives/bubble-input/bubble-input.tsx
19
- function c({ children: e }) {
20
- return /* @__PURE__ */ i(s, {
21
- reason: "Radix's hidden form input carries an inline style",
22
- children: e
23
- });
24
- }
25
- function l(e, t) {
26
- return { internal_do_not_use_render: ({ isFormControl: n }) => /* @__PURE__ */ a(r, { children: [e, n ? /* @__PURE__ */ i(c, { children: t }) : null] }) };
27
- }
28
- //#endregion
29
- export { s as n, l as t };
@@ -1,181 +0,0 @@
1
- import { b as e, c as t, f as n, m as r, p as i, u as a } from "./use-shape-morph-D1MOoQ4T.js";
2
- import { n as o } from "./is-production-Cx8oURag.js";
3
- import { t as s } from "./bubble-input-yXAeW84_.js";
4
- import * as c from "react";
5
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
6
- //#region ../../node_modules/@radix-ui/react-switch/dist/index.mjs
7
- var d = Object.defineProperty, f = (e, t) => d(e, "name", {
8
- value: t,
9
- configurable: !0
10
- }), p = "Switch", [m, h] = i(p), [g, _] = m(p);
11
- function v(e) {
12
- let { __scopeSwitch: t, checked: n, children: r, defaultChecked: i, disabled: o, form: s, name: u, onCheckedChange: d, required: f, value: m = "on", internal_do_not_use_render: h } = e, [_, v] = a({
13
- prop: n,
14
- defaultProp: i ?? !1,
15
- onChange: d,
16
- caller: p
17
- }), [y, b] = c.useState(null), [x, S] = c.useState(null), C = c.useRef(!1), [w, E] = c.useReducer((e) => e + 1, 0), D = {
18
- checked: _,
19
- setChecked: v,
20
- disabled: o,
21
- control: y,
22
- setControl: b,
23
- name: u,
24
- form: s,
25
- value: m,
26
- hasConsumerStoppedPropagationRef: C,
27
- userInteractionCount: w,
28
- onUserInteraction: E,
29
- required: f,
30
- defaultChecked: i,
31
- isFormControl: !y || !!s || !!y.closest("form"),
32
- bubbleInput: x,
33
- setBubbleInput: S
34
- };
35
- return /* @__PURE__ */ l(g, {
36
- scope: t,
37
- ...D,
38
- children: T(h) ? h(D) : r
39
- });
40
- }
41
- f(v, "SwitchProvider");
42
- var y = "SwitchTrigger", b = /* @__PURE__ */ c.forwardRef(/* @__PURE__ */ f(function({ __scopeSwitch: t, onClick: i, ...a }, o) {
43
- let { control: s, form: u, value: d, disabled: p, checked: m, required: h, setControl: g, setChecked: v, hasConsumerStoppedPropagationRef: b, onUserInteraction: x, isFormControl: S, bubbleInput: C } = _(y, t), w = e(o, g), T = c.useRef(m);
44
- return c.useEffect(() => {
45
- let e = u ? s?.ownerDocument.getElementById(u) : s?.form;
46
- if (e instanceof HTMLFormElement) {
47
- let t = /* @__PURE__ */ f(() => v(T.current), "reset");
48
- return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
49
- }
50
- }, [
51
- s,
52
- u,
53
- v
54
- ]), /* @__PURE__ */ l(r.button, {
55
- type: "button",
56
- role: "switch",
57
- "aria-checked": m,
58
- "aria-required": h,
59
- "data-state": E(m),
60
- "data-disabled": p ? "" : void 0,
61
- disabled: p,
62
- value: d,
63
- ...a,
64
- ref: w,
65
- onClick: n(i, (e) => {
66
- x(), v((e) => !e), C && S && (b.current = e.isPropagationStopped(), b.current || e.stopPropagation());
67
- })
68
- });
69
- }, "SwitchTrigger")), x = "SwitchThumb", S = /* @__PURE__ */ c.forwardRef(/* @__PURE__ */ f(function(e, t) {
70
- let { __scopeSwitch: n, ...i } = e, a = _(x, n);
71
- return /* @__PURE__ */ l(r.span, {
72
- "data-state": E(a.checked),
73
- "data-disabled": a.disabled ? "" : void 0,
74
- ...i,
75
- ref: t
76
- });
77
- }, "SwitchThumb")), C = "SwitchBubbleInput", w = /* @__PURE__ */ c.forwardRef(/* @__PURE__ */ f(function({ __scopeSwitch: i, onClick: a, ...o }, s) {
78
- let { control: u, hasConsumerStoppedPropagationRef: d, userInteractionCount: f, checked: p, defaultChecked: m, required: h, disabled: g, name: v, value: y, form: b, bubbleInput: x, setBubbleInput: S } = _(C, i), w = e(s, S), T = t(u), E = c.useRef(!1), D = c.useRef(p), O = c.useRef(f);
79
- c.useEffect(() => {
80
- let e = x;
81
- if (!e) return;
82
- let t = window.HTMLInputElement.prototype, n = Object.getOwnPropertyDescriptor(t, "checked").set, r = f !== O.current;
83
- O.current = f;
84
- let i = D.current !== p;
85
- D.current = p;
86
- let a = !(r && d.current);
87
- if (i && n) {
88
- E.current = !r;
89
- let t = new Event("click", { bubbles: a });
90
- n.call(e, p), e.dispatchEvent(t), E.current = !1;
91
- }
92
- }, [
93
- x,
94
- p,
95
- d,
96
- f
97
- ]);
98
- let k = c.useRef(p);
99
- return /* @__PURE__ */ l(r.input, {
100
- type: "checkbox",
101
- "aria-hidden": !0,
102
- defaultChecked: m ?? k.current,
103
- required: h,
104
- disabled: g,
105
- name: v,
106
- value: y,
107
- form: b,
108
- ...o,
109
- tabIndex: -1,
110
- ref: w,
111
- onClick: n(a, (e) => {
112
- E.current && e.stopPropagation();
113
- }),
114
- style: {
115
- ...o.style,
116
- ...T,
117
- position: "absolute",
118
- pointerEvents: "none",
119
- opacity: 0,
120
- margin: 0,
121
- transform: "translateX(-100%)"
122
- }
123
- });
124
- }, "SwitchBubbleInput"));
125
- function T(e) {
126
- return typeof e == "function";
127
- }
128
- f(T, "isFunction");
129
- function E(e) {
130
- return e ? "checked" : "unchecked";
131
- }
132
- f(E, "getState");
133
- //#endregion
134
- //#region lib/components/ui/fields/switch/partials/switch-control.tsx
135
- function D({ className: e, checked: t, defaultChecked: n, required: r, onCheckedChange: i, name: a, form: c, disabled: d, value: f, thumbIcons: p = !1, readOnly: m, ...h }) {
136
- let g = /* @__PURE__ */ l(b, {
137
- "data-slot": "switch",
138
- "data-thumb-icons": p,
139
- "aria-readonly": m || void 0,
140
- "data-readonly": m || void 0,
141
- className: o("nxgt-switch peer nxgt-touch-target inline-flex h-8 w-[3.25rem] shrink-0 items-center rounded-full shadow-xs outline-none focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-error/20 dark:aria-invalid:ring-error/40 forced-colors:focus-visible:outline-solid forced-colors:focus-visible:outline-2 forced-colors:focus-visible:outline-offset-2 forced-colors:focus-visible:outline-[Highlight] disabled:cursor-not-allowed disabled:opacity-50 data-readonly:cursor-default", e),
142
- "data-pw": a ?? "switch",
143
- ...h,
144
- children: /* @__PURE__ */ u(S, {
145
- "data-slot": "switch-thumb",
146
- "data-nxgt-state-layer": "",
147
- className: "nxgt-switch-thumb pointer-events-none",
148
- "data-pw": a ? `${a}-thumb` : "switch-thumb",
149
- children: [p ? /* @__PURE__ */ l("svg", {
150
- className: "nxgt-switch-icon nxgt-switch-x",
151
- viewBox: "0 0 24 24",
152
- "aria-hidden": "true",
153
- focusable: "false",
154
- children: /* @__PURE__ */ l("path", { d: "M7 7l10 10M17 7L7 17" })
155
- }) : null, /* @__PURE__ */ l("svg", {
156
- className: "nxgt-switch-icon",
157
- viewBox: "0 0 24 24",
158
- "aria-hidden": "true",
159
- focusable: "false",
160
- children: /* @__PURE__ */ l("path", {
161
- className: "nxgt-switch-check",
162
- d: "M5.5 12.5l4.2 4.2L18.5 7.5",
163
- pathLength: 1
164
- })
165
- })]
166
- })
167
- });
168
- return /* @__PURE__ */ l(v, {
169
- checked: m ? t ?? n ?? !1 : t,
170
- defaultChecked: m ? void 0 : n,
171
- required: r,
172
- onCheckedChange: m ? void 0 : i,
173
- name: a,
174
- form: c,
175
- disabled: d,
176
- value: f,
177
- ...s(g, /* @__PURE__ */ l(w, {}))
178
- });
179
- }
180
- //#endregion
181
- export { D as t };