@nxgt/material 3.2.0 → 3.4.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 +29 -0
- package/README.md +3 -3
- package/dist/backgrounds/backgrounds.css +30 -1
- package/dist/backgrounds/css/gradient.css +18 -5
- package/dist/backgrounds/css-react/blobs.css +65 -0
- package/dist/backgrounds/css-react/bubbles.css +41 -0
- package/dist/backgrounds/css-react/checker.css +47 -0
- package/dist/backgrounds/css-react/chevrons.css +46 -0
- package/dist/backgrounds/css-react/circuit.css +111 -0
- package/dist/backgrounds/css-react/concrete.css +41 -0
- package/dist/backgrounds/css-react/diagonal-checker.css +48 -0
- package/dist/backgrounds/css-react/glass.css +99 -0
- package/dist/backgrounds/css-react/graph-paper.css +74 -0
- package/dist/backgrounds/css-react/halo.css +66 -0
- package/dist/backgrounds/css-react/hexagons.css +79 -0
- package/dist/backgrounds/css-react/illustrated.css +164 -0
- package/dist/backgrounds/css-react/leaves.css +41 -0
- package/dist/backgrounds/css-react/linen.css +44 -0
- package/dist/backgrounds/css-react/marble.css +55 -0
- package/dist/backgrounds/css-react/music.css +2 -0
- package/dist/backgrounds/css-react/night-sky.css +41 -0
- package/dist/backgrounds/css-react/paper.css +49 -0
- package/dist/backgrounds/css-react/plasma.css +53 -0
- package/dist/backgrounds/css-react/rays.css +67 -0
- package/dist/backgrounds/css-react/ripples.css +68 -0
- package/dist/backgrounds/css-react/school.css +2 -0
- package/dist/backgrounds/css-react/science.css +2 -0
- package/dist/backgrounds/css-react/sport.css +2 -0
- package/dist/backgrounds/css-react/travel.css +2 -0
- package/dist/backgrounds.js +57 -33
- package/dist/lib/backgrounds/background/available.d.ts +3 -3
- package/dist/lib/backgrounds/background/background.d.ts +2 -2
- package/dist/lib/backgrounds/index.d.ts +1 -1
- package/dist/material.css +1 -1
- package/docs/components/navigation-and-layout.md +1 -1
- package/docs/getting-started.md +1 -1
- package/docs/guides/backgrounds.md +114 -15
- package/docs/previews/backgrounds-geometry-more.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-material-more.webp +0 -0
- package/docs/previews/backgrounds-matrix.webp +0 -0
- package/docs/previews/backgrounds-motif-shapes.webp +0 -0
- package/docs/roadmap.md +16 -4
- package/docs/troubleshooting.md +24 -2
- package/lib/backgrounds/backgrounds.css +30 -1
- package/lib/backgrounds/css/gradient.css +18 -5
- package/lib/backgrounds/css-react/blobs.css +65 -0
- package/lib/backgrounds/css-react/bubbles.css +41 -0
- package/lib/backgrounds/css-react/checker.css +47 -0
- package/lib/backgrounds/css-react/chevrons.css +46 -0
- package/lib/backgrounds/css-react/circuit.css +111 -0
- package/lib/backgrounds/css-react/concrete.css +41 -0
- package/lib/backgrounds/css-react/diagonal-checker.css +48 -0
- package/lib/backgrounds/css-react/glass.css +99 -0
- package/lib/backgrounds/css-react/graph-paper.css +74 -0
- package/lib/backgrounds/css-react/halo.css +66 -0
- package/lib/backgrounds/css-react/hexagons.css +79 -0
- package/lib/backgrounds/css-react/illustrated.css +164 -0
- package/lib/backgrounds/css-react/leaves.css +41 -0
- package/lib/backgrounds/css-react/linen.css +44 -0
- package/lib/backgrounds/css-react/marble.css +55 -0
- package/lib/backgrounds/css-react/music.css +2 -0
- package/lib/backgrounds/css-react/night-sky.css +41 -0
- package/lib/backgrounds/css-react/paper.css +49 -0
- package/lib/backgrounds/css-react/plasma.css +53 -0
- package/lib/backgrounds/css-react/rays.css +67 -0
- package/lib/backgrounds/css-react/ripples.css +68 -0
- package/lib/backgrounds/css-react/school.css +2 -0
- package/lib/backgrounds/css-react/science.css +2 -0
- package/lib/backgrounds/css-react/sport.css +2 -0
- package/lib/backgrounds/css-react/travel.css +2 -0
- package/package.json +103 -2
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* The `paper` preset: a sheet of paper. A seeded fibre grain (an SVG of
|
|
2
|
+
* `feTurbulence` specks on a seamless 400 px tile: black in light, white in
|
|
3
|
+
* dark, like the grain overlay) over a warm tint that the tone cools or warms
|
|
4
|
+
* (`wash`: cream in light, the tone's colour mixed in). Intensity never goes above the default (`vivid` draws as the default). Static: `animated`
|
|
5
|
+
* does nothing. React only: nothing in the shared `css/` folder. */
|
|
6
|
+
@import "../css/scene.css";
|
|
7
|
+
|
|
8
|
+
@layer components {
|
|
9
|
+
/* `vivid` is capped at the default strength: a texture under body text
|
|
10
|
+
* never gets stronger (the tint and the specks read these two). */
|
|
11
|
+
[data-background="paper"][data-intensity="vivid"][data-intensity] {
|
|
12
|
+
--nxgt-bg-a1: 8%;
|
|
13
|
+
--nxgt-bg-op: 0.72;
|
|
14
|
+
}
|
|
15
|
+
[data-background="paper"] > [data-layer="wash"] {
|
|
16
|
+
position: absolute;
|
|
17
|
+
inset: 0;
|
|
18
|
+
background-image: linear-gradient(
|
|
19
|
+
180deg,
|
|
20
|
+
color-mix(
|
|
21
|
+
in oklab,
|
|
22
|
+
var(--nxgt-bg-c1) calc(var(--nxgt-bg-a1) * 1.6),
|
|
23
|
+
color-mix(
|
|
24
|
+
in oklab,
|
|
25
|
+
rgb(250 233 196) calc(70% * (1 - var(--nxgt-bg-grain-invert))),
|
|
26
|
+
transparent
|
|
27
|
+
)
|
|
28
|
+
),
|
|
29
|
+
color-mix(
|
|
30
|
+
in oklab,
|
|
31
|
+
var(--nxgt-bg-c2) var(--nxgt-bg-a1),
|
|
32
|
+
color-mix(
|
|
33
|
+
in oklab,
|
|
34
|
+
rgb(250 233 196) calc(42% * (1 - var(--nxgt-bg-grain-invert))),
|
|
35
|
+
transparent
|
|
36
|
+
)
|
|
37
|
+
)
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
[data-background="paper"] > [data-scene] > svg {
|
|
41
|
+
filter: invert(var(--nxgt-bg-grain-invert));
|
|
42
|
+
}
|
|
43
|
+
[data-background="paper"] > [data-scene] .tx1 {
|
|
44
|
+
opacity: calc(var(--nxgt-bg-op) * 0.12);
|
|
45
|
+
}
|
|
46
|
+
[data-background="paper"] > [data-scene] .tx2 {
|
|
47
|
+
opacity: calc(var(--nxgt-bg-op) * 0.09);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/* The `plasma` preset: a soft colour field. A seeded SVG of soft discs in
|
|
2
|
+
* radial gradients in the tone's three colours, three strengths each (`pm-l1..3`),
|
|
3
|
+
* over a tint (`wash`). Blended with the page: it adds light in dark. Motion
|
|
4
|
+
* (opt-in, `animated`): the field drifts. React only: nothing in the shared
|
|
5
|
+
* `css/` folder. */
|
|
6
|
+
@import "../css/scene.css";
|
|
7
|
+
|
|
8
|
+
@layer components {
|
|
9
|
+
[data-background="plasma"] {
|
|
10
|
+
isolation: isolate;
|
|
11
|
+
}
|
|
12
|
+
[data-background="plasma"] > [data-layer="wash"] {
|
|
13
|
+
position: absolute;
|
|
14
|
+
inset: 0;
|
|
15
|
+
background-image: linear-gradient(
|
|
16
|
+
160deg,
|
|
17
|
+
color-mix(in oklab, var(--nxgt-bg-c1) var(--nxgt-bg-a1), transparent),
|
|
18
|
+
color-mix(in oklab, var(--nxgt-bg-c3) var(--nxgt-bg-a1), transparent)
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
[data-background="plasma"] > [data-scene] > svg {
|
|
22
|
+
mix-blend-mode: var(--nxgt-bg-glow-blend);
|
|
23
|
+
}
|
|
24
|
+
[data-background="plasma"] > [data-scene] .pm-l1 {
|
|
25
|
+
fill-opacity: calc(var(--nxgt-bg-op) * 0.16);
|
|
26
|
+
}
|
|
27
|
+
[data-background="plasma"] > [data-scene] .pm-l2 {
|
|
28
|
+
fill-opacity: calc(var(--nxgt-bg-op) * 0.26);
|
|
29
|
+
}
|
|
30
|
+
[data-background="plasma"] > [data-scene] .pm-l3 {
|
|
31
|
+
fill-opacity: calc(var(--nxgt-bg-op) * 0.38);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
36
|
+
@keyframes nxgt-bg-plasma-drift {
|
|
37
|
+
from {
|
|
38
|
+
transform: translate(-3%, -2%) scale(1);
|
|
39
|
+
}
|
|
40
|
+
to {
|
|
41
|
+
transform: translate(3%, 2%) scale(1.06);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@layer components {
|
|
46
|
+
[data-background="plasma"][data-animated] > [data-scene] .pm-field {
|
|
47
|
+
animation: nxgt-bg-plasma-drift 28s ease-in-out infinite alternate
|
|
48
|
+
var(--nxgt-bg-play, running);
|
|
49
|
+
transform-box: view-box;
|
|
50
|
+
transform-origin: 50% 50%;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/* The `rays` preset: a sunburst. A conic gradient of alternating rays from
|
|
2
|
+
* the top centre of the frame (`rays`, a layer twice the frame's size and
|
|
3
|
+
* centred on that point, faded with distance) over a tint (`wash`). CSS only.
|
|
4
|
+
* Blended with the page: it adds light in dark. Motion (opt-in, `animated`):
|
|
5
|
+
* the burst turns slowly. React only: nothing in the shared `css/` folder. */
|
|
6
|
+
@layer components {
|
|
7
|
+
[data-background="rays"] {
|
|
8
|
+
overflow: clip;
|
|
9
|
+
isolation: isolate;
|
|
10
|
+
}
|
|
11
|
+
[data-background="rays"] > [data-layer="wash"] {
|
|
12
|
+
position: absolute;
|
|
13
|
+
inset: 0;
|
|
14
|
+
background-image: radial-gradient(
|
|
15
|
+
ellipse 70% 60% at 50% 0%,
|
|
16
|
+
color-mix(in oklab, var(--nxgt-bg-c2) var(--nxgt-bg-a2), transparent),
|
|
17
|
+
transparent 75%
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
[data-background="rays"] > [data-layer="rays"] {
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: -100%;
|
|
23
|
+
right: -50%;
|
|
24
|
+
bottom: 0;
|
|
25
|
+
left: -50%;
|
|
26
|
+
opacity: var(--nxgt-bg-op);
|
|
27
|
+
mix-blend-mode: var(--nxgt-bg-glow-blend);
|
|
28
|
+
background-image: repeating-conic-gradient(
|
|
29
|
+
from 0deg at 50% 50%,
|
|
30
|
+
color-mix(in oklab, var(--nxgt-bg-c1) 34%, transparent) 0deg 6deg,
|
|
31
|
+
transparent 6deg 9deg,
|
|
32
|
+
color-mix(in oklab, var(--nxgt-bg-c2) 24%, transparent) 9deg 12deg,
|
|
33
|
+
transparent 12deg 18deg,
|
|
34
|
+
color-mix(in oklab, var(--nxgt-bg-c3) 28%, transparent) 18deg 21deg,
|
|
35
|
+
transparent 21deg 30deg
|
|
36
|
+
);
|
|
37
|
+
-webkit-mask-image: radial-gradient(
|
|
38
|
+
closest-side,
|
|
39
|
+
rgb(0 0 0 / 0.5) 0,
|
|
40
|
+
black 14%,
|
|
41
|
+
rgb(0 0 0 / 0.35) 55%,
|
|
42
|
+
transparent
|
|
43
|
+
);
|
|
44
|
+
mask-image: radial-gradient(
|
|
45
|
+
closest-side,
|
|
46
|
+
rgb(0 0 0 / 0.5) 0,
|
|
47
|
+
black 14%,
|
|
48
|
+
rgb(0 0 0 / 0.35) 55%,
|
|
49
|
+
transparent
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
55
|
+
@keyframes nxgt-bg-rays-turn {
|
|
56
|
+
to {
|
|
57
|
+
transform: rotate(30deg);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@layer components {
|
|
62
|
+
[data-background="rays"][data-animated] > [data-layer="rays"] {
|
|
63
|
+
animation: nxgt-bg-rays-turn 90s linear infinite
|
|
64
|
+
var(--nxgt-bg-play, running);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/* The `ripples` preset: rings spreading from three seeded centres, one tone
|
|
2
|
+
* colour each (`rp-c1..3`), fading outward, over a tint (`wash`). Blended
|
|
3
|
+
* with the page: it adds light in dark. Motion (opt-in, `animated`): each set
|
|
4
|
+
* of rings breathes at its own pace (`rp-d1..3`). React only: nothing in the
|
|
5
|
+
* shared `css/` folder. */
|
|
6
|
+
@import "../css/scene.css";
|
|
7
|
+
|
|
8
|
+
@layer components {
|
|
9
|
+
[data-background="ripples"] {
|
|
10
|
+
isolation: isolate;
|
|
11
|
+
}
|
|
12
|
+
[data-background="ripples"] > [data-layer="wash"] {
|
|
13
|
+
position: absolute;
|
|
14
|
+
inset: 0;
|
|
15
|
+
background-image: radial-gradient(
|
|
16
|
+
ellipse 90% 80% at 50% 50%,
|
|
17
|
+
color-mix(in oklab, var(--nxgt-bg-c1) var(--nxgt-bg-a1), transparent),
|
|
18
|
+
transparent 80%
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
[data-background="ripples"] > [data-scene] > svg {
|
|
22
|
+
mix-blend-mode: var(--nxgt-bg-glow-blend);
|
|
23
|
+
}
|
|
24
|
+
[data-background="ripples"] > [data-scene] circle {
|
|
25
|
+
fill: none;
|
|
26
|
+
stroke-width: 2;
|
|
27
|
+
opacity: var(--nxgt-bg-op);
|
|
28
|
+
}
|
|
29
|
+
[data-background="ripples"] > [data-scene] .rp-c1 {
|
|
30
|
+
stroke: var(--nxgt-bg-c1);
|
|
31
|
+
}
|
|
32
|
+
[data-background="ripples"] > [data-scene] .rp-c2 {
|
|
33
|
+
stroke: var(--nxgt-bg-c2);
|
|
34
|
+
}
|
|
35
|
+
[data-background="ripples"] > [data-scene] .rp-c3 {
|
|
36
|
+
stroke: var(--nxgt-bg-c3);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
41
|
+
@keyframes nxgt-bg-ripples-breathe {
|
|
42
|
+
from {
|
|
43
|
+
transform: scale(0.94);
|
|
44
|
+
}
|
|
45
|
+
to {
|
|
46
|
+
transform: scale(1.06);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@layer components {
|
|
51
|
+
[data-background="ripples"][data-animated] > [data-scene] [class^="rp-c"] {
|
|
52
|
+
animation: nxgt-bg-ripples-breathe 14s ease-in-out infinite alternate
|
|
53
|
+
var(--nxgt-bg-play, running);
|
|
54
|
+
transform-box: fill-box;
|
|
55
|
+
transform-origin: 50% 50%;
|
|
56
|
+
}
|
|
57
|
+
[data-background="ripples"][data-animated] > [data-scene] .rp-d1 {
|
|
58
|
+
animation-direction: alternate;
|
|
59
|
+
}
|
|
60
|
+
[data-background="ripples"][data-animated] > [data-scene] .rp-d2 {
|
|
61
|
+
animation-duration: 19s;
|
|
62
|
+
animation-direction: alternate-reverse;
|
|
63
|
+
}
|
|
64
|
+
[data-background="ripples"][data-animated] > [data-scene] .rp-d3 {
|
|
65
|
+
animation-duration: 24s;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
package/dist/backgrounds.js
CHANGED
|
@@ -3,52 +3,76 @@ import { t } from "./compose-refs-DZ0iIVF-.js";
|
|
|
3
3
|
import { t as n } from "./use-background-activity-B8jLHNop.js";
|
|
4
4
|
import { createElement as r, memo as i, useId as a, useMemo as o, useRef as s } from "react";
|
|
5
5
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
|
-
import { BACKGROUND_INTENSITIES as d, BACKGROUND_PRESETS as f, BACKGROUND_TONES as p, MOTIF_SHAPES as m,
|
|
6
|
+
import { BACKGROUND_INTENSITIES as d, BACKGROUND_PRESETS as f, BACKGROUND_TONES as p, MOTIF_SHAPES as m, MOTIF_SHAPES_ALL as h, SCENE_LAYER as g, SHIPPED_BACKGROUND_PRESETS as _, buildBackgroundScene as v, presetLayers as y, resolveBackgroundPreset as b, svgIdPrefix as x } from "@nxgt/material-core/backgrounds";
|
|
7
7
|
//#region lib/backgrounds/background/available.ts
|
|
8
|
-
var
|
|
8
|
+
var S = [
|
|
9
9
|
"gradient",
|
|
10
10
|
"grain",
|
|
11
11
|
"mesh",
|
|
12
12
|
"aurora",
|
|
13
13
|
"spotlight",
|
|
14
|
-
"bokeh"
|
|
15
|
-
|
|
14
|
+
"bokeh",
|
|
15
|
+
"rays",
|
|
16
|
+
"halo",
|
|
17
|
+
"plasma",
|
|
18
|
+
"glass",
|
|
19
|
+
"ripples",
|
|
20
|
+
"blobs",
|
|
21
|
+
"paper",
|
|
22
|
+
"linen",
|
|
23
|
+
"concrete",
|
|
24
|
+
"marble"
|
|
25
|
+
], C = [
|
|
16
26
|
"isometric",
|
|
17
27
|
"blueprint",
|
|
18
28
|
"dots",
|
|
19
29
|
"stripes",
|
|
20
30
|
"low-poly",
|
|
21
31
|
"topography",
|
|
22
|
-
"waves"
|
|
23
|
-
|
|
32
|
+
"waves",
|
|
33
|
+
"hexagons",
|
|
34
|
+
"circuit",
|
|
35
|
+
"graph-paper",
|
|
36
|
+
"checker",
|
|
37
|
+
"diagonal-checker",
|
|
38
|
+
"chevrons"
|
|
39
|
+
], w = [
|
|
24
40
|
"shapes",
|
|
25
41
|
"confetti-grid",
|
|
26
42
|
"constellation",
|
|
27
43
|
"halftone",
|
|
28
44
|
"truchet",
|
|
29
45
|
"floating",
|
|
30
|
-
"scatter-icons"
|
|
31
|
-
|
|
32
|
-
|
|
46
|
+
"scatter-icons",
|
|
47
|
+
"school",
|
|
48
|
+
"night-sky",
|
|
49
|
+
"bubbles",
|
|
50
|
+
"leaves",
|
|
51
|
+
"science",
|
|
52
|
+
"music",
|
|
53
|
+
"travel",
|
|
54
|
+
"sport"
|
|
55
|
+
], T = [
|
|
33
56
|
...S,
|
|
34
|
-
...C
|
|
35
|
-
|
|
36
|
-
|
|
57
|
+
...C,
|
|
58
|
+
...w
|
|
59
|
+
], E = /^(aria|data)-/, D = (e) => e === "class" ? "className" : E.test(e) ? e : e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), O = i(function e({ node: t }) {
|
|
60
|
+
let n = Object.fromEntries(Object.entries(t.attrs).map(([e, t]) => [D(e), t]));
|
|
37
61
|
return r(t.tag, n, ...(t.children ?? []).map((t, n) => /* @__PURE__ */ l(e, { node: t }, n)));
|
|
38
|
-
}),
|
|
39
|
-
return /* @__PURE__ */ u(c, { children: [
|
|
62
|
+
}), k = i(function({ preset: e, scene: t, grain: n }) {
|
|
63
|
+
return /* @__PURE__ */ u(c, { children: [y(e).map((e) => e === g ? t && /* @__PURE__ */ l("div", {
|
|
40
64
|
"data-scene": "",
|
|
41
65
|
"aria-hidden": "true",
|
|
42
|
-
children: /* @__PURE__ */ l(
|
|
66
|
+
children: /* @__PURE__ */ l(O, { node: t })
|
|
43
67
|
}, e) : /* @__PURE__ */ l("div", {
|
|
44
68
|
"data-layer": e,
|
|
45
69
|
"aria-hidden": "true"
|
|
46
70
|
}, e)), n && /* @__PURE__ */ l("div", {
|
|
47
71
|
"data-overlay": "grain",
|
|
48
72
|
"aria-hidden": "true",
|
|
49
|
-
children: /* @__PURE__ */ l(
|
|
73
|
+
children: /* @__PURE__ */ l(O, { node: n })
|
|
50
74
|
})] });
|
|
51
|
-
}),
|
|
75
|
+
}), A = (e) => console.warn(e), j = Object.keys({
|
|
52
76
|
shapes: 1,
|
|
53
77
|
density: 1,
|
|
54
78
|
size: 1,
|
|
@@ -56,37 +80,37 @@ var x = [
|
|
|
56
80
|
shapeFill: 1,
|
|
57
81
|
opacitySpread: 1
|
|
58
82
|
}).filter((e) => e !== "shapes");
|
|
59
|
-
function
|
|
60
|
-
return
|
|
83
|
+
function M(e) {
|
|
84
|
+
return j.map((t) => e?.[t]);
|
|
61
85
|
}
|
|
62
|
-
function
|
|
86
|
+
function N(e, t, n, r, i) {
|
|
63
87
|
if (e === "grain") return null;
|
|
64
88
|
let a = JSON.parse(i);
|
|
65
|
-
return
|
|
89
|
+
return v(e, {
|
|
66
90
|
idPrefix: t,
|
|
67
91
|
seed: n,
|
|
68
92
|
motif: {
|
|
69
|
-
...Object.fromEntries(
|
|
93
|
+
...Object.fromEntries(j.map((e, t) => [e, a[t] ?? void 0])),
|
|
70
94
|
shapes: r === void 0 ? void 0 : r.split(",").filter(Boolean)
|
|
71
95
|
}
|
|
72
96
|
});
|
|
73
97
|
}
|
|
74
|
-
function
|
|
75
|
-
return
|
|
98
|
+
function P(e, t) {
|
|
99
|
+
return v("grain", {
|
|
76
100
|
idPrefix: `${e}-grain`,
|
|
77
101
|
seed: t
|
|
78
102
|
});
|
|
79
103
|
}
|
|
80
|
-
function
|
|
81
|
-
let
|
|
104
|
+
function F({ children: r, ref: i, preset: c = "gradient", tone: d = "primary", intensity: f = "default", animated: p = !1, grain: m = !1, seed: h = 0, motif: g, fill: _ = "viewport", ...v }) {
|
|
105
|
+
let y = s(null), S = o(() => t(y, i), [i]), C = n(y, p), w = x(a()), E = b(c, T, e() ? void 0 : A), D = m || E === "grain", O = g?.shapes ? [...new Set(g.shapes)].sort().join(",") : void 0, j = JSON.stringify(M(g)), F = o(() => N(E, w, h, O, j), [
|
|
82
106
|
E,
|
|
83
|
-
|
|
107
|
+
w,
|
|
84
108
|
h,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
]), I = o(() => D ?
|
|
109
|
+
O,
|
|
110
|
+
j
|
|
111
|
+
]), I = o(() => D ? P(w, h) : null, [
|
|
88
112
|
D,
|
|
89
|
-
|
|
113
|
+
w,
|
|
90
114
|
h
|
|
91
115
|
]);
|
|
92
116
|
return /* @__PURE__ */ u("div", {
|
|
@@ -101,7 +125,7 @@ function P({ children: r, ref: i, preset: c = "gradient", tone: d = "primary", i
|
|
|
101
125
|
"data-animated": p ? "" : void 0,
|
|
102
126
|
"data-grain": D ? "" : void 0,
|
|
103
127
|
"data-paused": p && C ? "" : void 0,
|
|
104
|
-
children: [/* @__PURE__ */ l(
|
|
128
|
+
children: [/* @__PURE__ */ l(k, {
|
|
105
129
|
preset: E,
|
|
106
130
|
scene: F,
|
|
107
131
|
grain: I
|
|
@@ -112,4 +136,4 @@ function P({ children: r, ref: i, preset: c = "gradient", tone: d = "primary", i
|
|
|
112
136
|
});
|
|
113
137
|
}
|
|
114
138
|
//#endregion
|
|
115
|
-
export {
|
|
139
|
+
export { T as AVAILABLE_BACKGROUND_PRESETS, d as BACKGROUND_INTENSITIES, f as BACKGROUND_PRESETS, p as BACKGROUND_TONES, F as Background, m as MOTIF_SHAPES, h as MOTIF_SHAPES_ALL, _ as SHIPPED_BACKGROUND_PRESETS };
|
|
@@ -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 44 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 44.
|
|
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", "isometric", "blueprint", "dots", "stripes", "low-poly", "topography", "waves", "shapes", "confetti-grid", "constellation", "halftone", "truchet", "floating", "scatter-icons"];
|
|
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"];
|
|
9
9
|
export type AvailableBackgroundPreset = (typeof AVAILABLE_BACKGROUND_PRESETS)[number];
|
|
@@ -1,10 +1,10 @@
|
|
|
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 44 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
|
-
* `motif` (`shapes
|
|
7
|
+
* `motif` (`shapes` (any of `MOTIF_SHAPES_ALL`), `density`, `size`, `rotate` (default `false`),
|
|
8
8
|
* `shapeFill`, `opacitySpread`). 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.
|
|
@@ -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, 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 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';
|