@softistx/material 3.249.0 → 3.250.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.
- package/CHANGELOG.md +10 -0
- package/README.md +2 -2
- package/dist/capture-toolbar.css +1 -1
- package/dist/{components-BbAylWQW.js → components-DUvKQIBi.js} +3 -1
- package/dist/components.js +1 -1
- package/dist/embed-chunks/{dist-C-lAK_LC.js → dist-BVPJSDov.js} +1 -1
- package/dist/embed-chunks/{emoji-picker-BWDQFdQu.js → emoji-picker-CrIXB9pF.js} +22 -22
- package/dist/embed-chunks/{mention-list-CdUr0h3X.js → mention-list-9hwOYNND.js} +1 -1
- package/dist/embed-chunks/{nxgt-theme-provider-DdDsiEPj.js → nxgt-theme-provider-Cjl7Eb8v.js} +703 -592
- package/dist/embed-chunks/switch-control-BrwJRN_V.js +207 -0
- package/dist/embed-chunks/{tabs-root-MF9lEHbq.js → tabs-root-BvPc1aaV.js} +5 -5
- package/dist/embed-chunks/{useLatest-RGIW0nya.js → useLatest-CbcU5ozz.js} +322 -322
- package/dist/embed.css +2 -2
- package/dist/embed.js +1266 -740
- package/dist/image-editor.css +1 -1
- package/dist/image-editor.js +902 -1017
- package/dist/lib/components/ui/layout/account-frame/account-frame.d.ts +2 -2
- package/dist/lib/embed/index.d.ts +4 -1
- package/dist/main.js +1 -1
- package/docs/components/navigation-and-layout.md +2 -2
- package/docs/guides/embed.md +44 -0
- package/package.json +1 -1
- package/dist/embed-chunks/bubble-input-yXAeW84_.js +0 -29
- package/dist/embed-chunks/switch-control-B95ZWvna.js +0 -181
|
@@ -2,8 +2,8 @@ import { ComponentProps, ReactNode } from 'react';
|
|
|
2
2
|
import { ShellBack } from '../app-shell/activity-layout-navigation.types.js';
|
|
3
3
|
import { AppBreadcrumbRoot } from '../app-shell/app-breadcrumb.js';
|
|
4
4
|
import { AuthCardNoticeTone } from '../auth-card/internal.js';
|
|
5
|
-
/** The frame's width: 24rem, 32rem or
|
|
6
|
-
export type AccountFrameWidth = 'sm' | 'md' | 'lg';
|
|
5
|
+
/** The frame's width: 24rem, 32rem, 48rem, 64rem or 80rem. */
|
|
6
|
+
export type AccountFrameWidth = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
7
7
|
export type AccountFrameProps = Omit<ComponentProps<'main'>, 'title'> & {
|
|
8
8
|
/** The page's `h1`. */
|
|
9
9
|
title: ReactNode;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* fields (alone or wired to React Hook Form with `TextFormField`,
|
|
5
5
|
* `EmailFormField` and `TextareaFormField`;
|
|
6
6
|
* the config-driven `Field` and `FormField` carry every field type, the editors
|
|
7
|
-
* included, so they stay in the main entry), a Checkbox (label and description, alone or wired with `CheckboxFormField`), an Alert, the
|
|
7
|
+
* included, so they stay in the main entry), a `ConfirmDialog` (the destructive confirm, openable from inside a `Dialog`), a Checkbox (label and description, alone or wired with `CheckboxFormField`), a `SwitchField` (the plain variant with its help text, alone or wired with `SwitchFormField`), an Alert, the
|
|
8
8
|
* `AttachmentList` (the files of a `/files/drop` zone), the chat parts
|
|
9
9
|
* (`ChatThread`, `ChatMessageList`, `ChatMessage` with its plain-text `text` mode,
|
|
10
10
|
* `ChatMessageSeparator`, `ChatComposer`; the emoji picker and the mention list load lazily), the
|
|
@@ -25,12 +25,15 @@ export { Button, type ButtonProps, } from '../components/ui/actions/button/butto
|
|
|
25
25
|
export { ListRow, type ListRowProps, } from '../components/ui/collections/list-row/list-row.js';
|
|
26
26
|
export { BadgeBase as Badge, type BadgeProps, type BadgeTone, } from '../components/ui/display/badge/badge-base.js';
|
|
27
27
|
export { Alert, type AlertProps } from '../components/ui/feedback/alert/alert.js';
|
|
28
|
+
export { ConfirmDialog, type ConfirmDialogProps, type ConfirmTone, } from '../components/ui/feedback/confirm-dialog/confirm-dialog.js';
|
|
28
29
|
export { EmptyState, type EmptyStateKind, type EmptyStateProps, } from '../components/ui/feedback/empty-state/empty-state.js';
|
|
29
30
|
export { Skeleton } from '../components/ui/feedback/skeleton/skeleton.js';
|
|
30
31
|
export { SkeletonText } from '../components/ui/feedback/skeleton/skeleton-text.js';
|
|
31
32
|
export { Spinner, type SpinnerProps, } from '../components/ui/feedback/spinner/spinner.js';
|
|
32
33
|
export { EmailField, type EmailFieldProps, } from '../components/ui/fields/email-field/email-field.js';
|
|
33
34
|
export { EmailFormField } from '../components/ui/fields/email-field/email-form-field.js';
|
|
35
|
+
export { SwitchField, type SwitchFieldProps, } from '../components/ui/fields/switch/switch.js';
|
|
36
|
+
export { SwitchFormField } from '../components/ui/fields/switch/switch-form-field.js';
|
|
34
37
|
export { TextField, type TextFieldProps, } from '../components/ui/fields/text-field/text-field.js';
|
|
35
38
|
export { TextFormField } from '../components/ui/fields/text-field/text-form-field.js';
|
|
36
39
|
export { TextareaField, type TextareaProps, } from '../components/ui/fields/textarea-field/textarea-field.js';
|
package/dist/main.js
CHANGED
|
@@ -10,7 +10,7 @@ import { t as ce } from "./checkbox-D-nZpo1x.js";
|
|
|
10
10
|
import { a as le, c as ue, d as de, f as fe, i as pe, l as me, n as he, o as ge, r as _e, s as ve, t as ye, u as be } from "./dropdown-menu-D-PRbHaP.js";
|
|
11
11
|
import { C as xe, S as Se, _ as Ce, a as we, b as Te, c as Ee, d as De, f as Oe, g as ke, h as Ae, i as je, l as Me, m as Ne, n as Pe, o as Fe, p as Ie, r as Le, s as Re, t as ze, u as Be, v as Ve, w as He, x as Ue, y as We } from "./breadcrumb-DYa6pVsq.js";
|
|
12
12
|
import { t as Ge } from "./label-DyK0TmBd.js";
|
|
13
|
-
import { $ as Ke, $a as qe, $c as Je, $d as Ye, $f as Xe, $h as Ze, $i as Qe, $l as $e, $m as et, $n as tt, $o as nt, $p as rt, $r as it, $s as at, $t as ot, $u as st, A as ct, Aa as lt, Ac as ut, Ad as dt, Af as ft, Ah as pt, Ai as mt, Al as ht, Am as gt, An as _t, Ao as vt, Ap as yt, Ar as bt, As as xt, At as St, Au as Ct, B as wt, Ba as Tt, Bc as Et, Bd as Dt, Bf as Ot, Bh as kt, Bi as At, Bl as jt, Bm as Mt, Bn as Nt, Bo as Pt, Bp as Ft, Br as It, Bs as Lt, Bt as Rt, Bu as zt, C as Bt, Ca as Vt, Cc as Ht, Cd as Ut, Cf as Wt, Ch as Gt, Ci as Kt, Cl as qt, Cm as Jt, Cn as Yt, Co as Xt, Cp as Zt, Cr as Qt, Cs as $t, Ct as en, Cu as tn, D as nn, Da as rn, Dc as an, Dd as on, Df as sn, Dh as cn, Di as ln, Dl as un, Dm as dn, Dn as fn, Do as pn, Dp as mn, Dr as hn, Ds as gn, Dt as _n, Du as vn, E as yn, Ea as bn, Ec as xn, Ed as Sn, Ef as Cn, Eh as wn, Ei as Tn, El as En, Em as Dn, En as On, Eo as kn, Ep as An, Er as jn, Es as Mn, Et as Nn, Eu as Pn, F as Fn, Fa as In, Fc as Ln, Fd as Rn, Ff as zn, Fh as Bn, Fi as Vn, Fl as Hn, Fm as Un, Fn as Wn, Fo as Gn, Fp as Kn, Fr as qn, Fs as Jn, Ft as Yn, Fu as Xn, G as Zn, Ga as Qn, Gc as $n, Gd as er, Gf as tr, Gh as nr, Gi as rr, Gl as ir, Gm as ar, Gn as or, Go as sr, Gp as cr, Gr as lr, Gs as ur, Gt as dr, Gu as fr, H as pr, Ha as mr, Hc as hr, Hd as gr, Hf as _r, Hh as vr, Hi as yr, Hl as br, Hm as xr, Hn as Sr, Ho as Cr, Hp as wr, Hr as Tr, Hs as Er, Ht as Dr, Hu as Or, I as kr, Ia as Ar, Ic as jr, Id as Mr, If as Nr, Ih as Pr, Ii as Fr, Il as Ir, Im as Lr, In as Rr, Io as zr, Ip as Br, Ir as Vr, Is as Hr, It as Ur, Iu as Wr, J as Gr, Ja as Kr, Jc as qr, Jd as Jr, Jf as Yr, Jh as Xr, Ji as Zr, Jl as Qr, Jm as $r, Jn as ei, Jo as ti, Jp as ni, Jr as ri, Js as ii, Jt as ai, Ju as oi, K as si, Ka as ci, Kc as li, Kd as ui, Kf as di, Kh as fi, Ki as pi, Kl as mi, Km as hi, Kn as gi, Ko as _i, Kp as vi, Kr as yi, Ks as bi, Kt as xi, Ku as Si, L as Ci, La as wi, Lc as Ti, Ld as Ei, Lf as Di, Lh as Oi, Li as ki, Ll as Ai, Lm as ji, Ln as Mi, Lo as Ni, Lp as Pi, Lr as Fi, Ls as Ii, Lt as Li, Lu as Ri, M as zi, Ma as Bi, Mc as Vi, Md as Hi, Mf as Ui, Mh as Wi, Mi as Gi, Ml as Ki, Mm as qi, Mn as Ji, Mo as Yi, Mp as Xi, Mr as Zi, Ms as Qi, Mt as $i, Mu as ea, N as ta, Na as na, Nc as ra, Nd as ia, Nf as aa, Nh as oa, Ni as sa, Nl as ca, Nm as la, Nn as ua, No as da, Np as fa, Nr as pa, Ns as ma, Nt as ha, Nu as ga, O as _a, Oa as va, Oc as ya, Od as ba, Of as xa, Oh as Sa, Oi as Ca, Ol as wa, Om as Ta, On as Ea, Oo as Da, Op as Oa, Or as ka, Os as Aa, Ot as ja, Ou as Ma, P as Na, Pa, Pc as Fa, Pd as Ia, Pf as La, Ph as Ra, Pi as za, Pl as Ba, Pm as Va, Pn as Ha, Po as Ua, Pp as Wa, Pr as Ga, Ps as Ka, Pt as qa, Pu as Ja, Q as Ya, Qa as Xa, Qc as Za, Qd as Qa, Qf as $a, Qh as eo, Qi as to, Ql as no, Qm as ro, Qn as io, Qo as ao, Qp as oo, Qr as so, Qs as co, Qt as lo, Qu as uo, R as fo, Ra as po, Rc as mo, Rd as ho, Rf as go, Rh as _o, Ri as vo, Rl as yo, Rm as bo, Rn as xo, Ro as So, Rp as Co, Rr as wo, Rs as To, Rt as Eo, Ru as Do, S as Oo, Sa as ko, Sc as Ao, Sd as jo, Sf as Mo, Sh as No, Si as Po, Sl as Fo, Sm as Io, Sn as Lo, So as Ro, Sp as zo, Sr as Bo, Ss as Vo, St as Ho, Su as Uo, T as Wo, Ta as Go, Tc as Ko, Td as qo, Tf as Jo, Th as Yo, Ti as Xo, Tl as Zo, Tm as Qo, Tn as $o, To as es, Tp as ts, Tr as ns, Ts as rs, Tt as is, Tu as as, U as os, Ua as ss, Uc as cs, Ud as ls, Uf as us, Uh as ds, Ui as fs, Ul as ps, Um as ms, Un as hs, Uo as gs, Up as _s, Ur as vs, Us as ys, Ut as bs, Uu as xs, V as Ss, Va as Cs, Vc as ws, Vd as Ts, Vf as Es, Vh as Ds, Vi as Os, Vl as ks, Vm as As, Vn as js, Vo as Ms, Vp as Ns, Vr as Ps, Vs as Fs, Vt as Is, Vu as Ls, W as Rs, Wa as zs, Wc as Bs, Wd as Vs, Wf as Hs, Wh as Us, Wi as Ws, Wl as Gs, Wm as Ks, Wn as qs, Wo as Js, Wp as Ys, Wr as Xs, Ws as Zs, Wt as Qs, Wu as $s, X as ec, Xa as tc, Xc as nc, Xd as rc, Xf as ic, Xh as ac, Xi as oc, Xl as sc, Xm as cc, Xn as lc, Xo as uc, Xp as dc, Xr as fc, Xs as pc, Xt as mc, Xu as hc, Y as gc, Ya as _c, Yc as vc, Yd as yc, Yf as bc, Yh as xc, Yi as Sc, Yl as Cc, Ym as wc, Yn as Tc, Yo as Ec, Yp as Dc, Yr as Oc, Ys as kc, Yt as Ac, Yu as jc, Z as Mc, Za as Nc, Zc as Pc, Zd as Fc, Zf as Ic, Zh as Lc, Zi as Rc, Zl as zc, Zm as Bc, Zn as Vc, Zo as Hc, Zp as Uc, Zr as Wc, Zs as Gc, Zt as Kc, Zu as qc, _ as Jc, _a as Yc, _c as Xc, _d as Zc, _f as Qc, _h as $c, _i as el, _l as tl, _m as nl, _n as rl, _o as il, _p as al, _r as ol, _s as sl, _t as cl, _u as ll, a as ul, aa as dl, ac as fl, ad as pl, af as ml, ah as hl, ai as gl, al as _l, am as vl, an as yl, ao as bl, ap as xl, ar as Sl, as as Cl, at as wl, au as Tl, b as El, ba as Dl, bc as Ol, bd as kl, bf as Al, bh as jl, bi as Ml, bl as Nl, bm as Pl, bn as Fl, bo as Il, bp as Ll, br as Rl, bs as zl, bt as Bl, bu as Vl, c as Hl, ca as Ul, cc as Wl, cd as Gl, cf as Kl, ch as ql, ci as Jl, cl as Yl, cm as Xl, cn as Zl, co as Ql, cp as $l, cr as eu, cs as tu, ct as nu, cu as ru, d as iu, da as au, dc as ou, dd as su, df as cu, dh as lu, di as uu, dl as du, dm as fu, dn as pu, do as mu, dp as hu, dr as gu, ds as _u, dt as vu, du as yu, ea as bu, ec as xu, ed as Su, ef as Cu, eg as wu, eh as Tu, ei as Eu, el as Du, em as Ou, en as ku, eo as Au, ep as ju, er as Mu, es as Nu, et as Pu, eu as Fu, f as Iu, fa as Lu, fc as Ru, fd as zu, ff as Bu, fh as Vu, fi as Hu, fl as Uu, fm as Wu, fn as Gu, fo as Ku, fp as qu, fr as Ju, fs as Yu, ft as Xu, fu as Zu, g as Qu, ga as $u, gc as ed, gd as td, gf as nd, gh as rd, gi as id, gl as ad, gm as od, gn as sd, go as cd, gp as ld, gr as ud, gs as dd, gt as fd, gu as pd, h as md, ha as hd, hc as gd, hd as _d, hf as vd, hh as yd, hi as bd, hl as xd, hm as Sd, hn as Cd, ho as wd, hp as Td, hr as Ed, hs as Dd, ht as Od, hu as kd, i as Ad, ia as jd, ic as Md, id as Nd, if as Pd, ig as Fd, ih as Id, ii as Ld, il as Rd, im as zd, in as Bd, io as Vd, ip as Hd, ir as Ud, is as Wd, it as Gd, iu as Kd, j as qd, ja as Jd, jc as Yd, jd as Xd, jf as Zd, jh as Qd, ji as $d, jl as ef, jm as tf, jn as nf, jo as rf, jp as af, jr as of, js as sf, jt as cf, ju as lf, k as uf, ka as df, kc as ff, kd as pf, kf as mf, kh as hf, ki as gf, kl as _f, km as vf, kn as yf, ko as bf, kp as xf, kr as Sf, ks as Cf, kt as wf, ku as Tf, l as Ef, la as Df, lc as Of, ld as kf, lf as Af, lh as jf, li as Mf, ll as Nf, lm as Pf, ln as Ff, lo as If, lp as Lf, lr as Rf, ls as zf, lt as Bf, lu as Vf, m as Hf, ma as Uf, mc as Wf, md as Gf, mf as Kf, mh as qf, mi as Jf, ml as Yf, mm as Xf, mn as Zf, mo as Qf, mp as $f, mr as ep, ms as tp, mt as np, mu as rp, n as ip, na as ap, nc as op, nd as sp, nf as cp, ng as lp, nh as up, ni as dp, nl as fp, nm as pp, nn as Z, no as mp, np as hp, nr as gp, ns as _p, nt as vp, nu as yp, o as bp, oa as xp, oc as Sp, od as Cp, of as wp, oh as Tp, oi as Ep, ol as Dp, om as Op, on as kp, oo as Ap, op as jp, or as Mp, os as Np, ot as Pp, ou as Fp, p as Ip, pa as Lp, pc as Rp, pd as zp, pf as Bp, ph as Vp, pi as Hp, pl as Up, pm as Wp, pn as Gp, po as Kp, pp as qp, pr as Jp, ps as Yp, pt as Xp, pu as Zp, q as Qp, qa as $p, qc as em, qd as tm, qf as nm, qh as rm, qi as im, ql as am, qm as om, qn as sm, qo as cm, qp as lm, qr as um, qs as dm, qt as fm, qu as pm, r as mm, ra as hm, rc as gm, rd as _m, rf as vm, rg as ym, rh as bm, ri as xm, rl as Sm, rm as Cm, rn as wm, ro as Tm, rp as Em, rr as Dm, rs as Om, rt as km, ru as Am, s as jm, sa as Mm, sc as Nm, sd as Pm, sf as Fm, sh as Im, si as Lm, sl as Rm, sm as zm, sn as Bm, so as Vm, sp as Hm, sr as Um, ss as Wm, st as Gm, su as Km, t as qm, ta as Jm, tc as Ym, td as Xm, tf as Zm, tg as Qm, th as $m, ti as eh, tl as th, tm as nh, tn as rh, to as ih, tp as ah, tr as oh, ts as sh, tt as ch, tu as lh, u as uh, ua as dh, uc as fh, ud as ph, uf as mh, uh as hh, ui as gh, ul as _h, um as vh, un as yh, uo as bh, up as xh, ur as Sh, us as Ch, ut as wh, uu as Th, v as Eh, va as Dh, vc as Oh, vd as kh, vf as Ah, vh as jh, vi as Mh, vl as Nh, vm as Ph, vn as Fh, vo as Ih, vp as Lh, vr as Rh, vs as zh, vt as Bh, vu as Vh, w as Hh, wa as Uh, wc as Wh, wd as Gh, wf as Kh, wh as qh, wi as Jh, wl as Yh, wm as Xh, wn as Zh, wo as Qh, wp as $h, wr as eg, ws as tg, wt as ng, wu as rg, x as ig, xa as ag, xc as og, xd as sg, xf as cg, xh as lg, xi as ug, xl as dg, xm as fg, xn as pg, xo as mg, xp as hg, xr as gg, xs as _g, xt as vg, xu as yg, y as bg, ya as xg, yc as Sg, yd as Cg, yf as wg, yh as Tg, yi as Eg, yl as Dg, ym as Og, yn as kg, yo as Ag, yp as jg, yr as Mg, ys as Ng, yt as Pg, yu as Fg, z as Ig, za as Lg, zc as Rg, zd as zg, zf as Bg, zh as Vg, zi as Hg, zl as Ug, zm as Wg, zn as Gg, zo as Kg, zp as qg, zr as Jg, zs as Yg, zt as Xg, zu as Zg } from "./components-
|
|
13
|
+
import { $ as Ke, $a as qe, $c as Je, $d as Ye, $f as Xe, $h as Ze, $i as Qe, $l as $e, $m as et, $n as tt, $o as nt, $p as rt, $r as it, $s as at, $t as ot, $u as st, A as ct, Aa as lt, Ac as ut, Ad as dt, Af as ft, Ah as pt, Ai as mt, Al as ht, Am as gt, An as _t, Ao as vt, Ap as yt, Ar as bt, As as xt, At as St, Au as Ct, B as wt, Ba as Tt, Bc as Et, Bd as Dt, Bf as Ot, Bh as kt, Bi as At, Bl as jt, Bm as Mt, Bn as Nt, Bo as Pt, Bp as Ft, Br as It, Bs as Lt, Bt as Rt, Bu as zt, C as Bt, Ca as Vt, Cc as Ht, Cd as Ut, Cf as Wt, Ch as Gt, Ci as Kt, Cl as qt, Cm as Jt, Cn as Yt, Co as Xt, Cp as Zt, Cr as Qt, Cs as $t, Ct as en, Cu as tn, D as nn, Da as rn, Dc as an, Dd as on, Df as sn, Dh as cn, Di as ln, Dl as un, Dm as dn, Dn as fn, Do as pn, Dp as mn, Dr as hn, Ds as gn, Dt as _n, Du as vn, E as yn, Ea as bn, Ec as xn, Ed as Sn, Ef as Cn, Eh as wn, Ei as Tn, El as En, Em as Dn, En as On, Eo as kn, Ep as An, Er as jn, Es as Mn, Et as Nn, Eu as Pn, F as Fn, Fa as In, Fc as Ln, Fd as Rn, Ff as zn, Fh as Bn, Fi as Vn, Fl as Hn, Fm as Un, Fn as Wn, Fo as Gn, Fp as Kn, Fr as qn, Fs as Jn, Ft as Yn, Fu as Xn, G as Zn, Ga as Qn, Gc as $n, Gd as er, Gf as tr, Gh as nr, Gi as rr, Gl as ir, Gm as ar, Gn as or, Go as sr, Gp as cr, Gr as lr, Gs as ur, Gt as dr, Gu as fr, H as pr, Ha as mr, Hc as hr, Hd as gr, Hf as _r, Hh as vr, Hi as yr, Hl as br, Hm as xr, Hn as Sr, Ho as Cr, Hp as wr, Hr as Tr, Hs as Er, Ht as Dr, Hu as Or, I as kr, Ia as Ar, Ic as jr, Id as Mr, If as Nr, Ih as Pr, Ii as Fr, Il as Ir, Im as Lr, In as Rr, Io as zr, Ip as Br, Ir as Vr, Is as Hr, It as Ur, Iu as Wr, J as Gr, Ja as Kr, Jc as qr, Jd as Jr, Jf as Yr, Jh as Xr, Ji as Zr, Jl as Qr, Jm as $r, Jn as ei, Jo as ti, Jp as ni, Jr as ri, Js as ii, Jt as ai, Ju as oi, K as si, Ka as ci, Kc as li, Kd as ui, Kf as di, Kh as fi, Ki as pi, Kl as mi, Km as hi, Kn as gi, Ko as _i, Kp as vi, Kr as yi, Ks as bi, Kt as xi, Ku as Si, L as Ci, La as wi, Lc as Ti, Ld as Ei, Lf as Di, Lh as Oi, Li as ki, Ll as Ai, Lm as ji, Ln as Mi, Lo as Ni, Lp as Pi, Lr as Fi, Ls as Ii, Lt as Li, Lu as Ri, M as zi, Ma as Bi, Mc as Vi, Md as Hi, Mf as Ui, Mh as Wi, Mi as Gi, Ml as Ki, Mm as qi, Mn as Ji, Mo as Yi, Mp as Xi, Mr as Zi, Ms as Qi, Mt as $i, Mu as ea, N as ta, Na as na, Nc as ra, Nd as ia, Nf as aa, Nh as oa, Ni as sa, Nl as ca, Nm as la, Nn as ua, No as da, Np as fa, Nr as pa, Ns as ma, Nt as ha, Nu as ga, O as _a, Oa as va, Oc as ya, Od as ba, Of as xa, Oh as Sa, Oi as Ca, Ol as wa, Om as Ta, On as Ea, Oo as Da, Op as Oa, Or as ka, Os as Aa, Ot as ja, Ou as Ma, P as Na, Pa, Pc as Fa, Pd as Ia, Pf as La, Ph as Ra, Pi as za, Pl as Ba, Pm as Va, Pn as Ha, Po as Ua, Pp as Wa, Pr as Ga, Ps as Ka, Pt as qa, Pu as Ja, Q as Ya, Qa as Xa, Qc as Za, Qd as Qa, Qf as $a, Qh as eo, Qi as to, Ql as no, Qm as ro, Qn as io, Qo as ao, Qp as oo, Qr as so, Qs as co, Qt as lo, Qu as uo, R as fo, Ra as po, Rc as mo, Rd as ho, Rf as go, Rh as _o, Ri as vo, Rl as yo, Rm as bo, Rn as xo, Ro as So, Rp as Co, Rr as wo, Rs as To, Rt as Eo, Ru as Do, S as Oo, Sa as ko, Sc as Ao, Sd as jo, Sf as Mo, Sh as No, Si as Po, Sl as Fo, Sm as Io, Sn as Lo, So as Ro, Sp as zo, Sr as Bo, Ss as Vo, St as Ho, Su as Uo, T as Wo, Ta as Go, Tc as Ko, Td as qo, Tf as Jo, Th as Yo, Ti as Xo, Tl as Zo, Tm as Qo, Tn as $o, To as es, Tp as ts, Tr as ns, Ts as rs, Tt as is, Tu as as, U as os, Ua as ss, Uc as cs, Ud as ls, Uf as us, Uh as ds, Ui as fs, Ul as ps, Um as ms, Un as hs, Uo as gs, Up as _s, Ur as vs, Us as ys, Ut as bs, Uu as xs, V as Ss, Va as Cs, Vc as ws, Vd as Ts, Vf as Es, Vh as Ds, Vi as Os, Vl as ks, Vm as As, Vn as js, Vo as Ms, Vp as Ns, Vr as Ps, Vs as Fs, Vt as Is, Vu as Ls, W as Rs, Wa as zs, Wc as Bs, Wd as Vs, Wf as Hs, Wh as Us, Wi as Ws, Wl as Gs, Wm as Ks, Wn as qs, Wo as Js, Wp as Ys, Wr as Xs, Ws as Zs, Wt as Qs, Wu as $s, X as ec, Xa as tc, Xc as nc, Xd as rc, Xf as ic, Xh as ac, Xi as oc, Xl as sc, Xm as cc, Xn as lc, Xo as uc, Xp as dc, Xr as fc, Xs as pc, Xt as mc, Xu as hc, Y as gc, Ya as _c, Yc as vc, Yd as yc, Yf as bc, Yh as xc, Yi as Sc, Yl as Cc, Ym as wc, Yn as Tc, Yo as Ec, Yp as Dc, Yr as Oc, Ys as kc, Yt as Ac, Yu as jc, Z as Mc, Za as Nc, Zc as Pc, Zd as Fc, Zf as Ic, Zh as Lc, Zi as Rc, Zl as zc, Zm as Bc, Zn as Vc, Zo as Hc, Zp as Uc, Zr as Wc, Zs as Gc, Zt as Kc, Zu as qc, _ as Jc, _a as Yc, _c as Xc, _d as Zc, _f as Qc, _h as $c, _i as el, _l as tl, _m as nl, _n as rl, _o as il, _p as al, _r as ol, _s as sl, _t as cl, _u as ll, a as ul, aa as dl, ac as fl, ad as pl, af as ml, ah as hl, ai as gl, al as _l, am as vl, an as yl, ao as bl, ap as xl, ar as Sl, as as Cl, at as wl, au as Tl, b as El, ba as Dl, bc as Ol, bd as kl, bf as Al, bh as jl, bi as Ml, bl as Nl, bm as Pl, bn as Fl, bo as Il, bp as Ll, br as Rl, bs as zl, bt as Bl, bu as Vl, c as Hl, ca as Ul, cc as Wl, cd as Gl, cf as Kl, ch as ql, ci as Jl, cl as Yl, cm as Xl, cn as Zl, co as Ql, cp as $l, cr as eu, cs as tu, ct as nu, cu as ru, d as iu, da as au, dc as ou, dd as su, df as cu, dh as lu, di as uu, dl as du, dm as fu, dn as pu, do as mu, dp as hu, dr as gu, ds as _u, dt as vu, du as yu, ea as bu, ec as xu, ed as Su, ef as Cu, eg as wu, eh as Tu, ei as Eu, el as Du, em as Ou, en as ku, eo as Au, ep as ju, er as Mu, es as Nu, et as Pu, eu as Fu, f as Iu, fa as Lu, fc as Ru, fd as zu, ff as Bu, fh as Vu, fi as Hu, fl as Uu, fm as Wu, fn as Gu, fo as Ku, fp as qu, fr as Ju, fs as Yu, ft as Xu, fu as Zu, g as Qu, ga as $u, gc as ed, gd as td, gf as nd, gh as rd, gi as id, gl as ad, gm as od, gn as sd, go as cd, gp as ld, gr as ud, gs as dd, gt as fd, gu as pd, h as md, ha as hd, hc as gd, hd as _d, hf as vd, hh as yd, hi as bd, hl as xd, hm as Sd, hn as Cd, ho as wd, hp as Td, hr as Ed, hs as Dd, ht as Od, hu as kd, i as Ad, ia as jd, ic as Md, id as Nd, if as Pd, ig as Fd, ih as Id, ii as Ld, il as Rd, im as zd, in as Bd, io as Vd, ip as Hd, ir as Ud, is as Wd, it as Gd, iu as Kd, j as qd, ja as Jd, jc as Yd, jd as Xd, jf as Zd, jh as Qd, ji as $d, jl as ef, jm as tf, jn as nf, jo as rf, jp as af, jr as of, js as sf, jt as cf, ju as lf, k as uf, ka as df, kc as ff, kd as pf, kf as mf, kh as hf, ki as gf, kl as _f, km as vf, kn as yf, ko as bf, kp as xf, kr as Sf, ks as Cf, kt as wf, ku as Tf, l as Ef, la as Df, lc as Of, ld as kf, lf as Af, lh as jf, li as Mf, ll as Nf, lm as Pf, ln as Ff, lo as If, lp as Lf, lr as Rf, ls as zf, lt as Bf, lu as Vf, m as Hf, ma as Uf, mc as Wf, md as Gf, mf as Kf, mh as qf, mi as Jf, ml as Yf, mm as Xf, mn as Zf, mo as Qf, mp as $f, mr as ep, ms as tp, mt as np, mu as rp, n as ip, na as ap, nc as op, nd as sp, nf as cp, ng as lp, nh as up, ni as dp, nl as fp, nm as pp, nn as Z, no as mp, np as hp, nr as gp, ns as _p, nt as vp, nu as yp, o as bp, oa as xp, oc as Sp, od as Cp, of as wp, oh as Tp, oi as Ep, ol as Dp, om as Op, on as kp, oo as Ap, op as jp, or as Mp, os as Np, ot as Pp, ou as Fp, p as Ip, pa as Lp, pc as Rp, pd as zp, pf as Bp, ph as Vp, pi as Hp, pl as Up, pm as Wp, pn as Gp, po as Kp, pp as qp, pr as Jp, ps as Yp, pt as Xp, pu as Zp, q as Qp, qa as $p, qc as em, qd as tm, qf as nm, qh as rm, qi as im, ql as am, qm as om, qn as sm, qo as cm, qp as lm, qr as um, qs as dm, qt as fm, qu as pm, r as mm, ra as hm, rc as gm, rd as _m, rf as vm, rg as ym, rh as bm, ri as xm, rl as Sm, rm as Cm, rn as wm, ro as Tm, rp as Em, rr as Dm, rs as Om, rt as km, ru as Am, s as jm, sa as Mm, sc as Nm, sd as Pm, sf as Fm, sh as Im, si as Lm, sl as Rm, sm as zm, sn as Bm, so as Vm, sp as Hm, sr as Um, ss as Wm, st as Gm, su as Km, t as qm, ta as Jm, tc as Ym, td as Xm, tf as Zm, tg as Qm, th as $m, ti as eh, tl as th, tm as nh, tn as rh, to as ih, tp as ah, tr as oh, ts as sh, tt as ch, tu as lh, u as uh, ua as dh, uc as fh, ud as ph, uf as mh, uh as hh, ui as gh, ul as _h, um as vh, un as yh, uo as bh, up as xh, ur as Sh, us as Ch, ut as wh, uu as Th, v as Eh, va as Dh, vc as Oh, vd as kh, vf as Ah, vh as jh, vi as Mh, vl as Nh, vm as Ph, vn as Fh, vo as Ih, vp as Lh, vr as Rh, vs as zh, vt as Bh, vu as Vh, w as Hh, wa as Uh, wc as Wh, wd as Gh, wf as Kh, wh as qh, wi as Jh, wl as Yh, wm as Xh, wn as Zh, wo as Qh, wp as $h, wr as eg, ws as tg, wt as ng, wu as rg, x as ig, xa as ag, xc as og, xd as sg, xf as cg, xh as lg, xi as ug, xl as dg, xm as fg, xn as pg, xo as mg, xp as hg, xr as gg, xs as _g, xt as vg, xu as yg, y as bg, ya as xg, yc as Sg, yd as Cg, yf as wg, yh as Tg, yi as Eg, yl as Dg, ym as Og, yn as kg, yo as Ag, yp as jg, yr as Mg, ys as Ng, yt as Pg, yu as Fg, z as Ig, za as Lg, zc as Rg, zd as zg, zf as Bg, zh as Vg, zi as Hg, zl as Ug, zm as Wg, zn as Gg, zo as Kg, zp as qg, zr as Jg, zs as Yg, zt as Xg, zu as Zg } from "./components-DUvKQIBi.js";
|
|
14
14
|
import { i as Qg, n as $g, r as e_, t as t_ } from "./popover-osl5duoA.js";
|
|
15
15
|
import { n as n_, t as r_ } from "./scroll-area-BxKiT4Dn.js";
|
|
16
16
|
import { a as i_, c as a_, i as o_, l as s_, n as c_, o as l_, r as u_, s as d_, t as f_, u as p_ } from "./select-BGhRlBh4.js";
|
|
@@ -481,7 +481,7 @@ The tint follows the theme's primary. Pass `backdrop={false}` on the card: the v
|
|
|
481
481
|
|
|
482
482
|

|
|
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
|
|
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. |
|
package/docs/guides/embed.md
CHANGED
|
@@ -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/package.json
CHANGED
|
@@ -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 };
|