@nxgt/material 3.7.5 → 3.8.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 +50 -0
- package/README.md +39 -6
- package/bin/nxgt-theme.js +6 -0
- package/dist/{async-slice-o_fpqeGX.js → async-slice-DDjaJY_F.js} +2 -2
- package/dist/background--Bf_EbFR.js +159 -0
- package/dist/backgrounds/backgrounds.css +2 -0
- package/dist/backgrounds/css-react/moon.css +97 -0
- package/dist/backgrounds.js +3 -139
- package/dist/browser-only-DQ94lWF8.js +18 -0
- package/dist/bubble-input-B7BVd9fX.js +237 -0
- package/dist/{button--cF4gY14.js → button-DbfdITBB.js} +51 -57
- package/dist/charts.js +3 -3
- package/dist/{chip-D1B1dL77.js → chip-DpySRqCy.js} +2 -2
- package/dist/{client-only.utils-lQ7GqP8w.js → client-only.utils-3nHNzCki.js} +1 -1
- package/dist/{code-editor-0CdGwKDg.js → code-editor-BiA14xua.js} +7 -7
- package/dist/code-editor.js +6 -6
- package/dist/{code-language-items-CGARRbVm.js → code-language-items-C_dJ6GVs.js} +2 -2
- package/dist/components/theme-tokens.css +34 -35
- package/dist/components/tones/app-tones.css +2 -1
- package/dist/components/tones/containers.css +4 -1
- package/dist/components/tones/index.css +2 -0
- package/dist/components/tones/surface.css +1 -0
- package/dist/components/tones/tokens.css +8 -3
- package/dist/components/tones/zone-paint.css +15 -0
- package/dist/components/ui/feedback/toast/toast-tokens.css +1 -0
- package/dist/components/ui/layout/app-shell/activity-backdrop.css +26 -0
- package/dist/components/ui/layout/sidebar/sidebar-tokens.css +5 -2
- package/dist/components/ui/media/media-player/nxgt-media-player.css +7 -32
- package/dist/components/ui/primitives/field-box/field-box-tokens.css +5 -2
- package/dist/{components-CDrQCOsU.js → components-B9EIfMdd.js} +18622 -18531
- package/dist/components.js +24 -22
- package/dist/{dialog-DdJ1C4BR.js → dialog-CkIYpJXk.js} +55 -53
- package/dist/dist-B7RjY7SL.js +158 -0
- package/dist/dist-C4wtXCjf.js +593 -0
- package/dist/dist-DVRQkaTK.js +111 -0
- package/dist/dist-lmHmz_bu.js +419 -0
- package/dist/dnd.js +1 -1
- package/dist/dropdown-menu-BC5Tbhb9.js +908 -0
- package/dist/editor.js +527 -527
- package/dist/empty-state-s2CSjKXJ.js +126 -0
- package/dist/{escape-owner-B8k7DvFa.js → escape-owner-CripBce_.js} +2 -1
- package/dist/{field-blur-DFUazxsL.js → field-blur-DPLsMufs.js} +1 -1
- package/dist/{field-blur-context-Dw9ZAgBr.js → field-blur-context-1ZwJgsHE.js} +2 -2
- package/dist/has-text-content-Ds2dkHX_.js +10 -0
- package/dist/hooks.js +35 -33
- package/dist/{hover-card-D5iHS9q1.js → hover-card-Cox-tPDz.js} +41 -39
- package/dist/{i18n-provider-C6SBK_nO.js → i18n-provider-C6HhBw34.js} +1 -1
- package/dist/i18n.js +6 -6
- package/dist/{icon-badge-Bb5-73XP.js → icon-badge-q3Ve8gra.js} +3 -3
- package/dist/{icon-button-5A6Mrj6w.js → icon-button-DJcWpIhu.js} +2 -1
- package/dist/{in-dialog-AiwTD3DK.js → in-dialog-Vwkyp-M5.js} +6 -5
- package/dist/lib/backgrounds/background/available.d.ts +3 -3
- package/dist/lib/backgrounds/background/background.d.ts +7 -3
- package/dist/lib/backgrounds/background/types.d.ts +7 -1
- package/dist/lib/backgrounds/index.d.ts +1 -1
- package/dist/lib/components/ui/layout/app-shell/activity-chrome.d.ts +17 -0
- package/dist/lib/components/ui/layout/app-shell/activity-layout.d.ts +6 -4
- package/dist/lib/components/ui/layout/app-shell/backdrop-layer.d.ts +11 -0
- package/dist/lib/components/ui/layout/app-shell/keep-shapes-inside.d.ts +17 -0
- package/dist/lib/components/ui/layout/app-shell/theme-backdrop.d.ts +6 -0
- package/dist/lib/components/ui/layout/app-shell/use-activity-backdrop.d.ts +18 -0
- package/dist/lib/components/ui/layout/app-shell/use-keep-shapes-inside.d.ts +9 -0
- package/dist/lib/hooks/resolve-theme.d.ts +46 -1
- package/dist/lib/hooks/theme-store.d.ts +35 -4
- package/dist/lib/hooks/use-theme.d.ts +20 -4
- package/dist/lib/i18n/resources/en/en.d.ts +4 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +4 -0
- package/dist/lib/i18n/resources/fr/fr.d.ts +4 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +4 -0
- package/dist/lib/i18n/resources/resources.d.ts +8 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib/theme-picker/index.d.ts +7 -0
- package/dist/lib/theme-picker/partials/mini-background.d.ts +10 -0
- package/dist/lib/theme-picker/partials/mode-control.d.ts +5 -0
- package/dist/lib/theme-picker/partials/theme-tile.d.ts +12 -0
- package/dist/lib/theme-picker/theme-label.d.ts +7 -0
- package/dist/lib/theme-picker/theme-picker.d.ts +25 -0
- package/dist/lib/themes/index.d.ts +14 -0
- package/dist/lib/themes/nxgt-theme-provider.d.ts +29 -0
- package/dist/lib/themes/nxgt-theme.d.ts +22 -0
- package/dist/lib/themes/theme-context.d.ts +28 -0
- package/dist/lib/themes/theme-value.d.ts +5 -0
- package/dist/lib/vite/index.d.ts +1 -1
- package/dist/lib.js +3 -3
- package/dist/main.js +43 -39
- package/dist/map.js +8 -8
- package/dist/material.css +1 -1
- package/dist/nxgt-theme-CgSb9Obl.js +37 -0
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +2 -2
- package/dist/{public-SsiazLEv.js → public-Ce30uvp0.js} +591 -587
- package/dist/read-storage-C2J90bNm.js +10 -0
- package/dist/{rich-code-block-CwNwQs5z.js → rich-code-block-C2Fp_FDU.js} +5 -5
- package/dist/{sortable-provider-BvD98s8Y.js → sortable-provider-pVaEZzty.js} +3 -3
- package/dist/{spinner-CtGCPza-.js → spinner-CsHcmcpF.js} +2 -2
- package/dist/{stored-language-Bb7yX5uE.js → stored-language-BeIKw3-K.js} +15 -15
- package/dist/styles.css +8 -1
- package/dist/theme-context-BagPvRcz.js +16 -0
- package/dist/theme-picker.js +118 -0
- package/dist/theme-store-CSl51uNH.js +91 -0
- package/dist/theme-toggle-C8os82b4.js +48 -0
- package/dist/themes.js +42 -0
- package/dist/toggle-group-j8zaxEg1.js +69 -0
- package/dist/{toolbar-items-DsDDD5AY.js → toolbar-items-CqHvlTU8.js} +443 -589
- package/dist/tooltip-rhbqNmr3.js +1064 -0
- package/dist/{translate-material-Bsjc4Tow.js → translate-material-CGZljjp1.js} +2 -2
- package/dist/{translator-or2y0JJB.js → translator-DCYO4Ij3.js} +3 -3
- package/dist/{use-background-activity-B8jLHNop.js → use-background-activity-KxQgelFF.js} +1 -1
- package/dist/{use-chat-composer-DZ01a16D.js → use-chat-composer-CDrgWGMM.js} +4684 -4886
- package/dist/{use-heading-spy-ByOQNnFZ.js → use-heading-spy-DXo6IOX9.js} +52 -121
- package/dist/{use-material-translation-hLQzOjF0.js → use-material-translation-DkxcLbLM.js} +2 -2
- package/dist/use-slice-reducer-BGkeGtML.js +42 -0
- package/dist/use-theme-Cd-aiDJo.js +31 -0
- package/docs/README.md +2 -1
- package/docs/components/foundations.md +39 -0
- package/docs/components/navigation-and-layout.md +3 -3
- package/docs/getting-started.md +1 -1
- package/docs/guides/app-shell.md +41 -6
- package/docs/guides/backgrounds.md +43 -7
- package/docs/guides/i18n.md +1 -1
- package/docs/guides/themes.md +103 -0
- package/docs/guides/theming.md +288 -84
- package/docs/guides/vite-plugin.md +26 -0
- package/docs/previews/backgrounds-background-from-theme.webp +0 -0
- package/docs/previews/backgrounds-geometry-more.webp +0 -0
- package/docs/previews/backgrounds-geometry.webp +0 -0
- package/docs/previews/backgrounds-illustrated-scenes.webp +0 -0
- package/docs/previews/backgrounds-light-more.webp +0 -0
- package/docs/previews/backgrounds-light.webp +0 -0
- package/docs/previews/backgrounds-material-more.webp +0 -0
- package/docs/previews/backgrounds-matrix.webp +0 -0
- package/docs/previews/backgrounds-moon.webp +0 -0
- package/docs/previews/backgrounds-motif-shapes.webp +0 -0
- package/docs/previews/backgrounds-motifs.webp +0 -0
- package/docs/previews/foundations-themes-themepicker.webp +0 -0
- package/docs/roadmap.md +25 -0
- package/docs/troubleshooting.md +35 -7
- package/lib/backgrounds/backgrounds.css +2 -0
- package/lib/backgrounds/css-react/moon.css +97 -0
- package/lib/components/theme-tokens.css +34 -35
- package/lib/components/tones/app-tones.css +2 -1
- package/lib/components/tones/containers.css +4 -1
- package/lib/components/tones/index.css +2 -0
- package/lib/components/tones/surface.css +1 -0
- package/lib/components/tones/tokens.css +8 -3
- package/lib/components/tones/zone-paint.css +15 -0
- package/lib/components/ui/feedback/toast/toast-tokens.css +1 -0
- package/lib/components/ui/layout/app-shell/activity-backdrop.css +26 -0
- package/lib/components/ui/layout/sidebar/sidebar-tokens.css +5 -2
- package/lib/components/ui/media/media-player/nxgt-media-player.css +7 -32
- package/lib/components/ui/primitives/field-box/field-box-tokens.css +5 -2
- package/lib/styles.css +8 -1
- package/lib/theme-picker/theme-picker-list.css +29 -0
- package/lib/theme-picker/theme-picker.css +192 -0
- package/lib/theme-picker/theme-tile-background.css +77 -0
- package/lib/theme-picker/theme-tile-textures-night.css +63 -0
- package/lib/theme-picker/theme-tile-textures.css +153 -0
- package/lib/themes/ambre.css +134 -0
- package/lib/themes/ardoise.css +133 -0
- package/lib/themes/bleumono.css +136 -0
- package/lib/themes/bluemoon.css +136 -0
- package/lib/themes/corail.css +136 -0
- package/lib/themes/foret.css +133 -0
- package/lib/themes/lavande.css +133 -0
- package/lib/themes/menthe.css +136 -0
- package/lib/themes/ocean.css +136 -0
- package/lib/themes/pink.css +134 -0
- package/lib/themes/prune.css +133 -0
- package/lib/themes/sable.css +133 -0
- package/lib/themes/slate.css +133 -0
- package/lib/themes/teal.css +137 -0
- package/package.json +30 -2
- package/dist/dropdown-menu-DWtgUVW7.js +0 -1490
- package/dist/empty-state-CRWLQ1sM.js +0 -191
- package/dist/tooltip-tmFoTU_d.js +0 -1582
- package/dist/use-slice-reducer-0r5dXnJe.js +0 -58
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { t as e } from "./utils-Bcd2Z3ea.js";
|
|
2
|
+
import { t } from "./use-material-translation-DkxcLbLM.js";
|
|
3
|
+
import { i as n } from "./escape-owner-CripBce_.js";
|
|
4
|
+
import { AlertCircle as r, Construction as i, FileQuestion as a, PackageOpen as o, Search as s, ShieldAlert as c, WifiOff as l } from "lucide-react";
|
|
5
|
+
import { createElement as u } from "react";
|
|
6
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
7
|
+
import { STATE_ACCENT as p, STATE_ICON as m, STATE_ILLUSTRATIONS as h, stateCopy as g } from "@nxgt/material-core/states";
|
|
8
|
+
//#region lib/components/ui/feedback/state-frame/state-icon.tsx
|
|
9
|
+
var _ = {
|
|
10
|
+
"package-open": o,
|
|
11
|
+
search: s,
|
|
12
|
+
"file-question": a,
|
|
13
|
+
"shield-alert": c,
|
|
14
|
+
"alert-circle": r,
|
|
15
|
+
"wifi-off": l,
|
|
16
|
+
construction: i
|
|
17
|
+
};
|
|
18
|
+
function v({ kind: e }) {
|
|
19
|
+
let t = _[m[e]];
|
|
20
|
+
return /* @__PURE__ */ d(t, { "aria-hidden": "true" });
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region lib/components/ui/feedback/state-frame/state-tones.ts
|
|
24
|
+
var y = "[stroke-linecap:round] [stroke-linejoin:round]", b = {
|
|
25
|
+
primary: "fill-primary",
|
|
26
|
+
error: "fill-error",
|
|
27
|
+
warning: "fill-warning",
|
|
28
|
+
info: "fill-info",
|
|
29
|
+
neutral: "fill-muted-foreground"
|
|
30
|
+
}, x = {
|
|
31
|
+
primary: "fill-primary/15",
|
|
32
|
+
error: "fill-error/15",
|
|
33
|
+
warning: "fill-warning/15",
|
|
34
|
+
info: "fill-info/15",
|
|
35
|
+
neutral: "fill-muted-foreground/15"
|
|
36
|
+
}, S = {
|
|
37
|
+
primary: "bg-primary/10 text-primary-text",
|
|
38
|
+
error: "bg-error/10 text-error",
|
|
39
|
+
warning: "bg-warning/10 text-warning",
|
|
40
|
+
info: "bg-info/10 text-info",
|
|
41
|
+
neutral: "border border-border bg-background text-foreground"
|
|
42
|
+
};
|
|
43
|
+
function C(e, t) {
|
|
44
|
+
switch (e) {
|
|
45
|
+
case "surface": return "fill-muted stroke-none";
|
|
46
|
+
case "outline": return `fill-none stroke-muted-foreground/60 stroke-2 ${y}`;
|
|
47
|
+
case "accent": return `${b[t]} stroke-none`;
|
|
48
|
+
case "accent-soft": return `${x[t]} stroke-none`;
|
|
49
|
+
case "muted": return "fill-muted-foreground/15 stroke-none";
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region lib/components/ui/feedback/state-frame/state-illustration.tsx
|
|
54
|
+
function w({ kind: t, className: n, ...r }) {
|
|
55
|
+
let { viewBox: i, shapes: a } = h[t], o = p[t];
|
|
56
|
+
return /* @__PURE__ */ d("svg", {
|
|
57
|
+
"data-slot": "state-illustration",
|
|
58
|
+
viewBox: i,
|
|
59
|
+
"aria-hidden": "true",
|
|
60
|
+
focusable: "false",
|
|
61
|
+
className: e("h-auto w-40 shrink-0", n),
|
|
62
|
+
...r,
|
|
63
|
+
children: a.map((e, t) => u(e.el, {
|
|
64
|
+
key: t,
|
|
65
|
+
className: C(e.tone, o),
|
|
66
|
+
...e.attrs
|
|
67
|
+
}))
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region lib/components/ui/feedback/state-frame/state-frame.tsx
|
|
72
|
+
function T({ kind: t, size: r = "default", illustration: i, icon: a, title: o, headingLevel: s, description: c, actions: l, className: u, children: m, ...h }) {
|
|
73
|
+
let g = r === "inline", _ = r === "compact" || g, y = e("flex shrink-0 items-center justify-center rounded", S[p[t]], g ? "size-8 rounded-full [&_svg]:size-4" : _ ? "size-10 [&_svg]:size-5" : "size-16 [&_svg]:size-7"), b = null;
|
|
74
|
+
return b = i === !1 ? null : i ?? (a == null ? _ ? /* @__PURE__ */ d("div", {
|
|
75
|
+
className: y,
|
|
76
|
+
children: /* @__PURE__ */ d(v, { kind: t })
|
|
77
|
+
}) : /* @__PURE__ */ d(w, { kind: t }) : /* @__PURE__ */ d("div", {
|
|
78
|
+
className: y,
|
|
79
|
+
children: a
|
|
80
|
+
})), /* @__PURE__ */ f("div", {
|
|
81
|
+
"data-kind": t,
|
|
82
|
+
"data-size": r,
|
|
83
|
+
className: e("flex text-foreground", g ? "flex-row items-center gap-3 px-3 py-2.5 text-start" : "flex-col items-center justify-center text-center", !g && (_ ? "gap-3 px-4 py-6" : "min-h-[22rem] gap-5 p-8"), u),
|
|
84
|
+
...h,
|
|
85
|
+
children: [
|
|
86
|
+
b,
|
|
87
|
+
(o != null || c != null) && /* @__PURE__ */ f("div", {
|
|
88
|
+
className: e("flex flex-col", g ? "min-w-0 flex-1 gap-0.5" : "max-w-sm gap-2"),
|
|
89
|
+
children: [o != null && /* @__PURE__ */ d(n, {
|
|
90
|
+
as: s ? `h${s}` : void 0,
|
|
91
|
+
variant: g ? "normal" : _ ? "title-medium" : "headline-small",
|
|
92
|
+
className: e("tracking-tight text-balance", g && "font-medium"),
|
|
93
|
+
children: o
|
|
94
|
+
}), c != null && /* @__PURE__ */ d(n, {
|
|
95
|
+
variant: g ? "body-small" : "body-medium",
|
|
96
|
+
className: "text-pretty",
|
|
97
|
+
children: c
|
|
98
|
+
})]
|
|
99
|
+
}),
|
|
100
|
+
m,
|
|
101
|
+
l != null && /* @__PURE__ */ d("div", {
|
|
102
|
+
className: e("flex flex-wrap items-center gap-2", g ? "shrink-0" : "mt-1 justify-center"),
|
|
103
|
+
children: l
|
|
104
|
+
})
|
|
105
|
+
]
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region lib/components/ui/feedback/empty-state/empty-state.tsx
|
|
110
|
+
function E({ kind: e = "empty", size: n = "default", illustration: r, icon: i, title: a, description: o, action: s, ...c }) {
|
|
111
|
+
let l = g(e, "empty-state"), { t: u } = t(), f = o ?? (a == null ? u(l.descriptionKey, l.description) : void 0);
|
|
112
|
+
return /* @__PURE__ */ d(T, {
|
|
113
|
+
"data-slot": "empty-state",
|
|
114
|
+
"data-variant": e,
|
|
115
|
+
kind: e,
|
|
116
|
+
size: n,
|
|
117
|
+
illustration: r,
|
|
118
|
+
icon: i,
|
|
119
|
+
title: a ?? u(l.titleKey, l.title),
|
|
120
|
+
description: f,
|
|
121
|
+
actions: s,
|
|
122
|
+
...c
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
export { T as n, E as t };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./utils-Bcd2Z3ea.js";
|
|
2
|
-
import {
|
|
2
|
+
import { t } from "./dist-DVRQkaTK.js";
|
|
3
|
+
import { o as n } from "./tooltip-rhbqNmr3.js";
|
|
3
4
|
import { jsx as r } from "react/jsx-runtime";
|
|
4
5
|
//#region lib/components/ui/primitives/typography/typography.tsx
|
|
5
6
|
var i = n("", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./field-blur-context-
|
|
1
|
+
import { t as e } from "./field-blur-context-1ZwJgsHE.js";
|
|
2
2
|
import { t } from "./useEvent-2fKq-6w8.js";
|
|
3
3
|
import n, { useCallback as r, useEffect as i, useRef as a } from "react";
|
|
4
4
|
import { jsx as o } from "react/jsx-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./utils-Bcd2Z3ea.js";
|
|
2
|
-
import {
|
|
3
|
-
import { i as n } from "./escape-owner-
|
|
2
|
+
import { l as t } from "./dist-lmHmz_bu.js";
|
|
3
|
+
import { i as n } from "./escape-owner-CripBce_.js";
|
|
4
4
|
import * as r from "react";
|
|
5
5
|
import { createContext as i, use as a, useMemo as o } from "react";
|
|
6
6
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { isValidElement as e } from "react";
|
|
2
|
+
//#region lib/components/ui/actions/button/has-text-content.ts
|
|
3
|
+
function t(r) {
|
|
4
|
+
return r == null || typeof r == "boolean" ? !1 : typeof r == "string" || typeof r == "number" || typeof r == "bigint" ? String(r).trim() !== "" : Array.isArray(r) ? r.some(t) : e(r) ? !n(r.props["aria-hidden"]) && t(r.props.children) : !1;
|
|
5
|
+
}
|
|
6
|
+
function n(e) {
|
|
7
|
+
return !!e && e !== "false";
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { t };
|
package/dist/hooks.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { r as e } from "./i18n-provider-
|
|
2
|
-
import { a as t, i as n,
|
|
1
|
+
import { r as e } from "./i18n-provider-C6HhBw34.js";
|
|
2
|
+
import { a as t, i as n, o as r, r as i, s as a } from "./theme-store-CSl51uNH.js";
|
|
3
|
+
import { n as o, t as s } from "./use-theme-Cd-aiDJo.js";
|
|
3
4
|
import { t as c } from "./number.utils-BG_eEt5g.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import { n as l, r as u, t as d } from "./use-heading-spy-DXo6IOX9.js";
|
|
6
|
+
import { r as f } from "./use-csp-nonce-ZKs9k-ov.js";
|
|
7
|
+
import { t as p } from "./use-mobile-BDro060N.js";
|
|
8
|
+
import { t as m } from "./use-scroll-away-PQRFZkT2.js";
|
|
9
|
+
import { useCallback as h, useEffect as g, useMemo as _, useState as v } from "react";
|
|
10
|
+
import { useNavigate as y, useSearchParams as b } from "react-router";
|
|
11
|
+
import { createFormatters as x } from "@nxgt/material-core/print-format";
|
|
12
|
+
import { busySettler as S, busySettler as C, createSubmitGuard as w, createSubmitGuard as T } from "@nxgt/material-core/submit-guard";
|
|
11
13
|
//#region lib/hooks/use-allowed-transitions.ts
|
|
12
|
-
function
|
|
14
|
+
function E(e, t, n) {
|
|
13
15
|
return (t[e] || []).map((e) => {
|
|
14
16
|
let t = n[e];
|
|
15
17
|
return t ? {
|
|
@@ -20,18 +22,18 @@ function C(e, t, n) {
|
|
|
20
22
|
}
|
|
21
23
|
//#endregion
|
|
22
24
|
//#region lib/hooks/use-formatters.ts
|
|
23
|
-
function
|
|
25
|
+
function D(t = {}) {
|
|
24
26
|
let n = e(), r = t.locale ?? n?.language ?? "en", { timeZone: i } = t;
|
|
25
|
-
return
|
|
27
|
+
return _(() => x({
|
|
26
28
|
locale: r,
|
|
27
29
|
timeZone: i
|
|
28
30
|
}), [r, i]);
|
|
29
31
|
}
|
|
30
32
|
//#endregion
|
|
31
33
|
//#region lib/hooks/use-navigation.ts
|
|
32
|
-
function
|
|
33
|
-
let n =
|
|
34
|
-
return
|
|
34
|
+
function O(e, t) {
|
|
35
|
+
let n = y();
|
|
36
|
+
return h(() => {
|
|
35
37
|
n(e, t);
|
|
36
38
|
}, [
|
|
37
39
|
n,
|
|
@@ -39,21 +41,21 @@ function T(e, t) {
|
|
|
39
41
|
t
|
|
40
42
|
]);
|
|
41
43
|
}
|
|
42
|
-
function
|
|
43
|
-
let t =
|
|
44
|
-
return
|
|
44
|
+
function k(e) {
|
|
45
|
+
let t = y();
|
|
46
|
+
return _(() => e.map(({ to: e, options: n }) => () => {
|
|
45
47
|
t(e, n);
|
|
46
48
|
}), [t, e]);
|
|
47
49
|
}
|
|
48
50
|
//#endregion
|
|
49
51
|
//#region lib/hooks/use-number-formatter.ts
|
|
50
|
-
function
|
|
51
|
-
let t = e(), n =
|
|
52
|
+
function A() {
|
|
53
|
+
let t = e(), n = h((e, n) => c(e, {
|
|
52
54
|
...n,
|
|
53
55
|
language: t?.language
|
|
54
56
|
}), [t?.language]);
|
|
55
57
|
return {
|
|
56
|
-
formatCurrency:
|
|
58
|
+
formatCurrency: h((e, t) => n(e, {
|
|
57
59
|
...t,
|
|
58
60
|
currency: t?.currency,
|
|
59
61
|
style: t?.currency ? "currency" : void 0
|
|
@@ -63,7 +65,7 @@ function D() {
|
|
|
63
65
|
}
|
|
64
66
|
//#endregion
|
|
65
67
|
//#region lib/hooks/use-options.ts
|
|
66
|
-
function
|
|
68
|
+
function j(e, { filter: t, value: n, label: r, expanded: i }) {
|
|
67
69
|
return e.filter((e) => e && (t?.(e) ?? !0)).map((e) => {
|
|
68
70
|
let t = typeof n == "function" ? n(e) : e[n]?.toString() ?? "", a = "";
|
|
69
71
|
return a = typeof r == "function" ? r(e) : Array.isArray(r) ? r.map((t) => e[t]).filter(Boolean).join(" ") : e[r]?.toString() ?? "", {
|
|
@@ -73,9 +75,9 @@ function O(e, { filter: t, value: n, label: r, expanded: i }) {
|
|
|
73
75
|
};
|
|
74
76
|
});
|
|
75
77
|
}
|
|
76
|
-
function
|
|
78
|
+
function M(e, t) {
|
|
77
79
|
let { filter: n, value: r, label: i, expanded: a } = t;
|
|
78
|
-
return
|
|
80
|
+
return _(() => j(e, {
|
|
79
81
|
filter: n,
|
|
80
82
|
value: r,
|
|
81
83
|
label: i,
|
|
@@ -88,25 +90,25 @@ function k(e, t) {
|
|
|
88
90
|
a
|
|
89
91
|
]);
|
|
90
92
|
}
|
|
91
|
-
function
|
|
93
|
+
function N(e) {
|
|
92
94
|
return e?.edges?.map((e) => e.node) ?? [];
|
|
93
95
|
}
|
|
94
96
|
//#endregion
|
|
95
97
|
//#region lib/hooks/use-search-param.ts
|
|
96
|
-
function
|
|
97
|
-
let [t, n] =
|
|
98
|
-
return
|
|
98
|
+
function P(e) {
|
|
99
|
+
let [t, n] = b();
|
|
100
|
+
return _(() => t.get(e), [t, e]);
|
|
99
101
|
}
|
|
100
102
|
//#endregion
|
|
101
103
|
//#region lib/hooks/use-submit-once.ts
|
|
102
|
-
function
|
|
103
|
-
let [t] =
|
|
104
|
-
return
|
|
104
|
+
function F(e) {
|
|
105
|
+
let [t] = v(T), [n] = v(() => C(t)), r = e !== void 0;
|
|
106
|
+
return g(() => {
|
|
105
107
|
e !== void 0 && n(e);
|
|
106
|
-
}, [e, n]),
|
|
108
|
+
}, [e, n]), h((e, n) => t.once(e, {
|
|
107
109
|
settleSync: !r,
|
|
108
110
|
...n
|
|
109
111
|
}), [t, r]);
|
|
110
112
|
}
|
|
111
113
|
//#endregion
|
|
112
|
-
export { i as applyResolvedTheme,
|
|
114
|
+
export { i as DEFAULT_THEME, n as applyResolvedTheme, t as applyThemeName, j as buildOptions, S as busySettler, w as createSubmitGuard, N as extractNode, r as resolveTheme, a as resolveThemeName, E as useAllowedTransitions, f as useCspNonce, l as useFocusOnMount, D as useFormatters, d as useHeadingSpy, o as useIsClient, p as useIsMobile, u as useLocalizedDate, O as useNavigationHandler, k as useNavigationHandlers, A as useNumberFormatter, M as useOptions, m as useScrollAway, P as useSearchParam, F as useSubmitOnce, s as useTheme };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { t as e } from "./utils-Bcd2Z3ea.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { o as t } from "./dist-DVRQkaTK.js";
|
|
3
|
+
import { a as n, c as r, i, l as a, s as o } from "./dist-lmHmz_bu.js";
|
|
4
|
+
import { b as s, c, d as l, f as u, u as d, x as f } from "./tooltip-rhbqNmr3.js";
|
|
5
|
+
import { t as p } from "./in-dialog-Vwkyp-M5.js";
|
|
4
6
|
import * as m from "react";
|
|
5
7
|
import { Activity as h } from "react";
|
|
6
8
|
import { jsx as g } from "react/jsx-runtime";
|
|
@@ -8,8 +10,8 @@ import { jsx as g } from "react/jsx-runtime";
|
|
|
8
10
|
var _ = Object.defineProperty, v = (e, t) => _(e, "name", {
|
|
9
11
|
value: t,
|
|
10
12
|
configurable: !0
|
|
11
|
-
}), y, b = "HoverCard", [x, S] =
|
|
12
|
-
let { __scopeHoverCard: t, children: r, open: i, defaultOpen: a, onOpenChange: o, openDelay: s = 700, closeDelay:
|
|
13
|
+
}), y, b = "HoverCard", [x, S] = r(b, [u]), C = u(), [w, T] = x(b), E = /* @__PURE__ */ v((e) => {
|
|
14
|
+
let { __scopeHoverCard: t, children: r, open: i, defaultOpen: a, onOpenChange: o, openDelay: s = 700, closeDelay: c = 300 } = e, u = C(t), d = m.useRef(0), f = m.useRef(0), p = m.useRef(!1), h = m.useRef(!1), [_, v] = n({
|
|
13
15
|
prop: i,
|
|
14
16
|
defaultProp: a ?? !1,
|
|
15
17
|
onChange: o,
|
|
@@ -17,8 +19,8 @@ var _ = Object.defineProperty, v = (e, t) => _(e, "name", {
|
|
|
17
19
|
}), y = m.useCallback(() => {
|
|
18
20
|
clearTimeout(f.current), d.current = window.setTimeout(() => v(!0), s);
|
|
19
21
|
}, [s, v]), x = m.useCallback(() => {
|
|
20
|
-
clearTimeout(d.current), !p.current && !h.current && (f.current = window.setTimeout(() => v(!1),
|
|
21
|
-
}, [
|
|
22
|
+
clearTimeout(d.current), !p.current && !h.current && (f.current = window.setTimeout(() => v(!1), c));
|
|
23
|
+
}, [c, v]), S = m.useCallback(() => v(!1), [v]);
|
|
22
24
|
return m.useEffect(() => () => {
|
|
23
25
|
clearTimeout(d.current), clearTimeout(f.current);
|
|
24
26
|
}, []), /* @__PURE__ */ g(w, {
|
|
@@ -30,55 +32,55 @@ var _ = Object.defineProperty, v = (e, t) => _(e, "name", {
|
|
|
30
32
|
onDismiss: S,
|
|
31
33
|
hasSelectionRef: p,
|
|
32
34
|
isPointerDownOnContentRef: h,
|
|
33
|
-
children: /* @__PURE__ */ g(
|
|
35
|
+
children: /* @__PURE__ */ g(l, {
|
|
34
36
|
...u,
|
|
35
37
|
children: r
|
|
36
38
|
})
|
|
37
39
|
});
|
|
38
40
|
}, "HoverCard"), D = "HoverCardTrigger", O = /* @__PURE__ */ m.forwardRef(/* @__PURE__ */ v(function(e, t) {
|
|
39
|
-
let { __scopeHoverCard: n, ...r } = e,
|
|
40
|
-
return /* @__PURE__ */ g(
|
|
41
|
+
let { __scopeHoverCard: n, ...r } = e, i = T(D, n);
|
|
42
|
+
return /* @__PURE__ */ g(c, {
|
|
41
43
|
asChild: !0,
|
|
42
44
|
...C(n),
|
|
43
|
-
children: /* @__PURE__ */ g(
|
|
44
|
-
"data-state":
|
|
45
|
+
children: /* @__PURE__ */ g(a.a, {
|
|
46
|
+
"data-state": i.open ? "open" : "closed",
|
|
45
47
|
...r,
|
|
46
48
|
ref: t,
|
|
47
|
-
onPointerEnter:
|
|
48
|
-
onPointerLeave:
|
|
49
|
-
onFocus:
|
|
50
|
-
onBlur:
|
|
51
|
-
onTouchStart:
|
|
49
|
+
onPointerEnter: o(e.onPointerEnter, I(i.onOpen)),
|
|
50
|
+
onPointerLeave: o(e.onPointerLeave, I(i.onClose)),
|
|
51
|
+
onFocus: o(e.onFocus, i.onOpen),
|
|
52
|
+
onBlur: o(e.onBlur, i.onClose),
|
|
53
|
+
onTouchStart: o(e.onTouchStart, (e) => e.preventDefault())
|
|
52
54
|
})
|
|
53
55
|
});
|
|
54
56
|
}, "HoverCardTrigger")), k = "HoverCardPortal", [A, j] = x(k, { forceMount: void 0 }), M = /* @__PURE__ */ v((e) => {
|
|
55
|
-
let { __scopeHoverCard: t, forceMount: n, children:
|
|
57
|
+
let { __scopeHoverCard: t, forceMount: n, children: r, container: a } = e, o = T(k, t);
|
|
56
58
|
return /* @__PURE__ */ g(A, {
|
|
57
59
|
scope: t,
|
|
58
60
|
forceMount: n,
|
|
59
|
-
children: /* @__PURE__ */ g(
|
|
61
|
+
children: /* @__PURE__ */ g(i, {
|
|
60
62
|
present: n || o.open,
|
|
61
|
-
children: /* @__PURE__ */ g(
|
|
63
|
+
children: /* @__PURE__ */ g(s, {
|
|
62
64
|
asChild: !0,
|
|
63
65
|
container: a,
|
|
64
|
-
children:
|
|
66
|
+
children: r
|
|
65
67
|
})
|
|
66
68
|
})
|
|
67
69
|
});
|
|
68
70
|
}, "HoverCardPortal"), N = "HoverCardContent", P = /* @__PURE__ */ m.forwardRef(/* @__PURE__ */ v(function(e, t) {
|
|
69
|
-
let n = j(N, e.__scopeHoverCard), { forceMount:
|
|
70
|
-
return /* @__PURE__ */ g(
|
|
71
|
-
present:
|
|
71
|
+
let n = j(N, e.__scopeHoverCard), { forceMount: r = n.forceMount, ...a } = e, s = T(N, e.__scopeHoverCard);
|
|
72
|
+
return /* @__PURE__ */ g(i, {
|
|
73
|
+
present: r || s.open,
|
|
72
74
|
children: /* @__PURE__ */ g(F, {
|
|
73
|
-
"data-state":
|
|
75
|
+
"data-state": s.open ? "open" : "closed",
|
|
74
76
|
...a,
|
|
75
|
-
onPointerEnter:
|
|
76
|
-
onPointerLeave:
|
|
77
|
+
onPointerEnter: o(e.onPointerEnter, I(s.onOpen)),
|
|
78
|
+
onPointerLeave: o(e.onPointerLeave, I(s.onClose)),
|
|
77
79
|
ref: t
|
|
78
80
|
})
|
|
79
81
|
});
|
|
80
|
-
}, "HoverCardContent")), F = /* @__PURE__ */ m.forwardRef(/* @__PURE__ */ v(function(e,
|
|
81
|
-
let { __scopeHoverCard:
|
|
82
|
+
}, "HoverCardContent")), F = /* @__PURE__ */ m.forwardRef(/* @__PURE__ */ v(function(e, n) {
|
|
83
|
+
let { __scopeHoverCard: r, onEscapeKeyDown: i, onPointerDownOutside: a, onFocusOutside: s, onInteractOutside: c, ...l } = e, u = T(N, r), p = C(r), h = m.useRef(null), _ = t(n, h), [b, x] = m.useState(!1);
|
|
82
84
|
return m.useEffect(() => {
|
|
83
85
|
if (b) {
|
|
84
86
|
let e = document.body;
|
|
@@ -89,31 +91,31 @@ var _ = Object.defineProperty, v = (e, t) => _(e, "name", {
|
|
|
89
91
|
}, [b]), m.useEffect(() => {
|
|
90
92
|
if (h.current) {
|
|
91
93
|
let e = /* @__PURE__ */ v(() => {
|
|
92
|
-
x(!1),
|
|
93
|
-
document.getSelection()?.toString() !== "" && (
|
|
94
|
+
x(!1), u.isPointerDownOnContentRef.current = !1, setTimeout(() => {
|
|
95
|
+
document.getSelection()?.toString() !== "" && (u.hasSelectionRef.current = !0);
|
|
94
96
|
});
|
|
95
97
|
}, "handlePointerUp");
|
|
96
98
|
return document.addEventListener("pointerup", e), () => {
|
|
97
|
-
document.removeEventListener("pointerup", e),
|
|
99
|
+
document.removeEventListener("pointerup", e), u.hasSelectionRef.current = !1, u.isPointerDownOnContentRef.current = !1;
|
|
98
100
|
};
|
|
99
101
|
}
|
|
100
|
-
}, [
|
|
102
|
+
}, [u.isPointerDownOnContentRef, u.hasSelectionRef]), m.useEffect(() => {
|
|
101
103
|
h.current && L(h.current).forEach((e) => e.setAttribute("tabindex", "-1"));
|
|
102
|
-
}), /* @__PURE__ */ g(
|
|
104
|
+
}), /* @__PURE__ */ g(f, {
|
|
103
105
|
asChild: !0,
|
|
104
106
|
disableOutsidePointerEvents: !1,
|
|
105
107
|
onInteractOutside: c,
|
|
106
|
-
onEscapeKeyDown:
|
|
107
|
-
onPointerDownOutside:
|
|
108
|
-
onFocusOutside:
|
|
108
|
+
onEscapeKeyDown: i,
|
|
109
|
+
onPointerDownOutside: a,
|
|
110
|
+
onFocusOutside: o(s, (e) => {
|
|
109
111
|
e.preventDefault();
|
|
110
112
|
}),
|
|
111
|
-
onDismiss:
|
|
113
|
+
onDismiss: u.onDismiss,
|
|
112
114
|
children: /* @__PURE__ */ g(d, {
|
|
113
115
|
...p,
|
|
114
116
|
...l,
|
|
115
|
-
onPointerDown:
|
|
116
|
-
e.currentTarget.contains(e.target) && x(!0),
|
|
117
|
+
onPointerDown: o(l.onPointerDown, (e) => {
|
|
118
|
+
e.currentTarget.contains(e.target) && x(!0), u.hasSelectionRef.current = !1, u.isPointerDownOnContentRef.current = !0;
|
|
117
119
|
}),
|
|
118
120
|
ref: _,
|
|
119
121
|
style: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as e, r as t, t as n } from "./stored-language-BeIKw3-K.js";
|
|
2
2
|
import { createContext as r, useCallback as i, useContext as a, useMemo as o, useState as s } from "react";
|
|
3
3
|
import { jsx as c } from "react/jsx-runtime";
|
|
4
4
|
//#region lib/i18n/i18n-provider.tsx
|
package/dist/i18n.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as e, i as t,
|
|
2
|
-
import { n as i, r as a, t as o } from "./i18n-provider-
|
|
3
|
-
import { i as s, n as c, o as l, r as u, t as d } from "./translator-
|
|
1
|
+
import { a as e, i as t, n, r } from "./stored-language-BeIKw3-K.js";
|
|
2
|
+
import { n as i, r as a, t as o } from "./i18n-provider-C6HhBw34.js";
|
|
3
|
+
import { i as s, n as c, o as l, r as u, t as d } from "./translator-DCYO4Ij3.js";
|
|
4
4
|
import { t as f } from "./is-production-GLw59WU8.js";
|
|
5
5
|
import { o as p, t as m } from "./merge-BCZE6HGq.js";
|
|
6
|
-
import { t as h } from "./translate-material-
|
|
7
|
-
import { t as g } from "./use-material-translation-
|
|
6
|
+
import { t as h } from "./translate-material-CGZljjp1.js";
|
|
7
|
+
import { t as g } from "./use-material-translation-DkxcLbLM.js";
|
|
8
8
|
import { useCallback as _ } from "react";
|
|
9
9
|
//#region lib/i18n/merge-resources.ts
|
|
10
10
|
function v(e, t, n = "") {
|
|
@@ -44,4 +44,4 @@ function x(e) {
|
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
//#endregion
|
|
47
|
-
export {
|
|
47
|
+
export { n as FALLBACK_LANGUAGE, s as FormatMessageError, o as I18nProvider, r as LANGUAGE_KEY, t as SUPPORTED_LANGUAGES, d as createTranslator, x as createTypedTranslation, l as formatMessage, c as getLanguage, b as mergeResources, e as resources, u as translate, h as translateMaterial, i as useI18nContext, g as useMaterialTranslation, a as useOptionalI18nContext };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./utils-Bcd2Z3ea.js";
|
|
2
|
-
import { f as t } from "./dialog-
|
|
3
|
-
import { a as n, i as r, n as i } from "./field-blur-context-
|
|
4
|
-
import { t as a } from "./icon-button-
|
|
2
|
+
import { f as t } from "./dialog-CkIYpJXk.js";
|
|
3
|
+
import { a as n, i as r, n as i } from "./field-blur-context-1ZwJgsHE.js";
|
|
4
|
+
import { t as a } from "./icon-button-DJcWpIhu.js";
|
|
5
5
|
import { isValidElement as o, useId as s } from "react";
|
|
6
6
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
7
|
import { describedBy as u } from "@nxgt/material-core/described-by";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./utils-Bcd2Z3ea.js";
|
|
2
2
|
import { n as t } from "./use-shape-morph-BKA_R5P5.js";
|
|
3
|
-
import {
|
|
3
|
+
import { n, t as r } from "./dist-DVRQkaTK.js";
|
|
4
|
+
import { o as i, t as a } from "./tooltip-rhbqNmr3.js";
|
|
4
5
|
import { i as o, n as s, r as c, t as l } from "./button-tones-BgZJ1tkD.js";
|
|
5
6
|
import { shapeOutline as u, toSvgPath as d } from "@nxgt/material-core/shapes";
|
|
6
7
|
import { useRef as f } from "react";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { n as e } from "./rolldown-runtime-BFFgcFxR.js";
|
|
2
|
-
import {
|
|
2
|
+
import { o as t } from "./dist-DVRQkaTK.js";
|
|
3
|
+
import { l as n, n as r } from "./dist-lmHmz_bu.js";
|
|
3
4
|
import * as i from "react";
|
|
4
5
|
import { createContext as a, useContext as o, useEffect as s, useLayoutEffect as c, useRef as l, useState as u } from "react";
|
|
5
6
|
import { jsx as d } from "react/jsx-runtime";
|
|
@@ -13,7 +14,7 @@ var m = Object.defineProperty, h = (e, t) => m(e, "name", {
|
|
|
13
14
|
bubbles: !1,
|
|
14
15
|
cancelable: !0
|
|
15
16
|
}, y = /* @__PURE__ */ i.forwardRef(/* @__PURE__ */ h(function(e, a) {
|
|
16
|
-
let { loop: o = !1, trapped: s = !1, onMountAutoFocus: c, onUnmountAutoFocus: l, ...u } = e, [f, p] = i.useState(null), m = r(c), y = r(l), C = i.useRef(null), w =
|
|
17
|
+
let { loop: o = !1, trapped: s = !1, onMountAutoFocus: c, onUnmountAutoFocus: l, ...u } = e, [f, p] = i.useState(null), m = r(c), y = r(l), C = i.useRef(null), w = t(a, p), T = i.useRef({
|
|
17
18
|
paused: !1,
|
|
18
19
|
pause() {
|
|
19
20
|
this.paused = !0;
|
|
@@ -81,7 +82,7 @@ var m = Object.defineProperty, h = (e, t) => m(e, "name", {
|
|
|
81
82
|
s,
|
|
82
83
|
T.paused
|
|
83
84
|
]);
|
|
84
|
-
return /* @__PURE__ */ d(
|
|
85
|
+
return /* @__PURE__ */ d(n.div, {
|
|
85
86
|
tabIndex: -1,
|
|
86
87
|
...u,
|
|
87
88
|
ref: w,
|
|
@@ -734,7 +735,7 @@ var Ze = function(e) {
|
|
|
734
735
|
return null;
|
|
735
736
|
};
|
|
736
737
|
}, tt = a(void 0);
|
|
737
|
-
function nt(e,
|
|
738
|
+
function nt(e, n) {
|
|
738
739
|
let [r, i] = u(null), [a, o] = rt(r), d = l(null);
|
|
739
740
|
return s(() => {
|
|
740
741
|
if (!e || !a || !r || r.getAttribute("data-state") === "closed") return;
|
|
@@ -748,7 +749,7 @@ function nt(e, t) {
|
|
|
748
749
|
r
|
|
749
750
|
]), c(() => {
|
|
750
751
|
!a || r?.getAttribute("data-state") !== "closed" || (d.current?.(), o(!1));
|
|
751
|
-
}),
|
|
752
|
+
}), t(i, n);
|
|
752
753
|
}
|
|
753
754
|
function rt(e) {
|
|
754
755
|
let [t, n] = u(!0);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The presets this library draws: the ids `BackgroundProps.preset` accepts.
|
|
3
|
-
* Core's `BACKGROUND_PRESETS` is the table of all
|
|
3
|
+
* Core's `BACKGROUND_PRESETS` is the table of all 45 presets, and its
|
|
4
4
|
* `SHIPPED_BACKGROUND_PRESETS` the common floor (`gradient`, `grain`) every
|
|
5
|
-
* library draws; this list is `@nxgt/material`'s own and holds all
|
|
5
|
+
* library draws; this list is `@nxgt/material`'s own and holds all 45.
|
|
6
6
|
* Any other id draws the gradient, with a warning outside production.
|
|
7
7
|
*/
|
|
8
|
-
export declare const AVAILABLE_BACKGROUND_PRESETS: readonly ["gradient", "grain", "mesh", "aurora", "spotlight", "bokeh", "rays", "halo", "plasma", "glass", "ripples", "blobs", "paper", "linen", "concrete", "marble", "isometric", "blueprint", "dots", "stripes", "low-poly", "topography", "waves", "hexagons", "circuit", "graph-paper", "checker", "diagonal-checker", "chevrons", "shapes", "confetti-grid", "constellation", "halftone", "truchet", "floating", "scatter-icons", "school", "night-sky", "bubbles", "leaves", "science", "music", "travel", "sport"];
|
|
8
|
+
export declare const AVAILABLE_BACKGROUND_PRESETS: readonly ["gradient", "grain", "mesh", "aurora", "spotlight", "bokeh", "rays", "halo", "plasma", "glass", "ripples", "blobs", "paper", "linen", "concrete", "marble", "isometric", "blueprint", "dots", "stripes", "low-poly", "topography", "waves", "hexagons", "circuit", "graph-paper", "checker", "diagonal-checker", "chevrons", "shapes", "confetti-grid", "constellation", "halftone", "truchet", "floating", "scatter-icons", "school", "night-sky", "bubbles", "leaves", "science", "music", "travel", "sport", "moon"];
|
|
9
9
|
export type AvailableBackgroundPreset = (typeof AVAILABLE_BACKGROUND_PRESETS)[number];
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { BackgroundProps } from './types.js';
|
|
2
2
|
export type { BackgroundProps } from './types.js';
|
|
3
3
|
/**
|
|
4
|
-
* A backdrop that centres its children, with a choice of
|
|
4
|
+
* A backdrop that centres its children, with a choice of 45 presets: the
|
|
5
5
|
* superset of the `Background` of `/components` (which has `tone`, `intensity`,
|
|
6
6
|
* `preset` and `animated`). The extra props here are `grain`, `seed`, `fill` and
|
|
7
7
|
* `motif` (`shapes` (any of `MOTIF_SHAPES_ALL`), `density`, `size`, `rotate` (default `false`),
|
|
8
|
-
* `shapeFill`, `opacitySpread`). Its look is plain CSS keyed on
|
|
8
|
+
* `shapeFill`, `opacitySpread`) and `moon` (`position`, `phase`, `halo`: the `moon` preset only). Its look is plain CSS keyed on
|
|
9
9
|
* `data-background` and `data-*` (`@nxgt/material/backgrounds.css` for the
|
|
10
10
|
* grain), its SVG comes from core as data, and it emits no `style` attribute.
|
|
11
11
|
* Nothing is random or measured, and the SVG ids come from `useId`, so the
|
|
12
12
|
* server and the client render the same markup.
|
|
13
13
|
*
|
|
14
|
+
* A prop you leave out (`preset`, `tone`, `intensity`, `seed`, `motif`, `grain`,
|
|
15
|
+
* `animated`, `moon`) is taken from the nearest theme (`NxgtThemeProvider`, `NxgtTheme`),
|
|
16
|
+
* then from the defaults above; a prop you pass always wins.
|
|
17
|
+
*
|
|
14
18
|
* `data-background` is set after your props, so a wrapper's own `data-slot`
|
|
15
19
|
* does not unhook the CSS. `preset="grain"` is the gradient plus the grain:
|
|
16
20
|
* `data-preset` says so, `data-background` stays `gradient`.
|
|
17
21
|
*/
|
|
18
|
-
export declare function Background({ children, ref, preset:
|
|
22
|
+
export declare function Background({ children, ref, preset: presetProp, tone: toneProp, intensity: intensityProp, animated: animatedProp, grain: grainProp, seed: seedProp, motif: motifProp, moon: moonProp, fill, ...props }: BackgroundProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BackgroundIntensity, BackgroundTone, MotifOptions } from '@nxgt/material-core/backgrounds';
|
|
1
|
+
import { BackgroundIntensity, BackgroundTone, MoonOptions, MotifOptions } from '@nxgt/material-core/backgrounds';
|
|
2
2
|
import { ComponentProps } from 'react';
|
|
3
3
|
import { AvailableBackgroundPreset } from './available.js';
|
|
4
4
|
export interface BackgroundProps extends ComponentProps<'div'> {
|
|
@@ -25,6 +25,12 @@ export interface BackgroundProps extends ComponentProps<'div'> {
|
|
|
25
25
|
* `halftone`, `truchet`, `floating` and `scatter-icons`, each the options
|
|
26
26
|
* it uses. A new object with the same values is the same scene. */
|
|
27
27
|
motif?: MotifOptions;
|
|
28
|
+
/** What the `moon` preset draws beside `motif`'s `size` and `density`:
|
|
29
|
+
* `position` (the moon's centre as fractions of the container, default
|
|
30
|
+
* `{ x: 0.8, y: 0.2 }`), `phase` (the crescent's thickness, 0.3 fat to 0.8
|
|
31
|
+
* thin, default `0.78`) and `halo` (its radius in moons, default `2.6`).
|
|
32
|
+
* A new object with the same values is the same scene. */
|
|
33
|
+
moon?: MoonOptions;
|
|
28
34
|
/** `'viewport'` is the viewport's size (as in `/components`);
|
|
29
35
|
* `'container'` fills its parent, which needs a definite height. A
|
|
30
36
|
* `className` overrides either. */
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
* name (same props, plus every preset's), with the types and the engine's
|
|
10
10
|
* tables re-exported from `@nxgt/material-core/backgrounds` by name.
|
|
11
11
|
*/
|
|
12
|
-
export { BACKGROUND_INTENSITIES, BACKGROUND_PRESETS, BACKGROUND_TONES, type BackgroundIntensity, type BackgroundPreset, type BackgroundTone, MOTIF_SHAPES, MOTIF_SHAPES_ALL, type MotifDensity, type MotifOptions, type MotifShape, type MotifSize, type OpacitySpread, type PresetInfo, SHIPPED_BACKGROUND_PRESETS, type ShapeFill, type ShippedBackgroundPreset, } from '@nxgt/material-core/backgrounds';
|
|
12
|
+
export { BACKGROUND_INTENSITIES, BACKGROUND_PRESETS, BACKGROUND_TONES, type BackgroundIntensity, type BackgroundPreset, type BackgroundTone, MOTIF_SHAPES, MOTIF_SHAPES_ALL, type MoonOptions, type MotifDensity, type MotifOptions, type MotifShape, type MotifSize, type OpacitySpread, type PresetInfo, SHIPPED_BACKGROUND_PRESETS, type ShapeFill, type ShippedBackgroundPreset, } from '@nxgt/material-core/backgrounds';
|
|
13
13
|
export { Background, type BackgroundProps } from './background/index.js';
|
|
14
14
|
export { AVAILABLE_BACKGROUND_PRESETS, type AvailableBackgroundPreset, } from './background/available.js';
|