@bolid-ui/themes 0.3.0 → 0.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/dist/components/badge.cjs +1 -1
- package/dist/components/badge.js +18 -8
- package/dist/components/base/base-button.cjs +1 -1
- package/dist/components/base/base-button.js +40 -29
- package/dist/components/base/base-button.props.cjs +1 -1
- package/dist/components/base/base-button.props.d.cts +1 -1
- package/dist/components/base/base-button.props.d.ts +1 -1
- package/dist/components/base/base-button.props.js +1 -0
- package/dist/components/context-menu.cjs +1 -1
- package/dist/components/context-menu.d.cts +2 -0
- package/dist/components/context-menu.d.ts +2 -0
- package/dist/components/context-menu.js +7 -7
- package/dist/components/dropdown-menu.cjs +1 -1
- package/dist/components/dropdown-menu.d.cts +3 -1
- package/dist/components/dropdown-menu.d.ts +3 -1
- package/dist/components/dropdown-menu.js +8 -8
- package/dist/components/index.d.cts +3 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/kbd.props.cjs +1 -1
- package/dist/components/kbd.props.d.cts +6 -0
- package/dist/components/kbd.props.d.ts +6 -0
- package/dist/components/kbd.props.js +8 -2
- package/dist/components/multi-select/core/select.cjs +1 -1
- package/dist/components/multi-select/core/select.d.cts +5 -1
- package/dist/components/multi-select/core/select.d.ts +5 -1
- package/dist/components/multi-select/core/select.js +11 -11
- package/dist/components/one-time-password-field/index.d.cts +2 -0
- package/dist/components/one-time-password-field/index.d.ts +2 -0
- package/dist/components/one-time-password-field/one-time-password-field.cjs +1 -0
- package/dist/components/one-time-password-field/one-time-password-field.d.cts +17 -0
- package/dist/components/one-time-password-field/one-time-password-field.d.ts +17 -0
- package/dist/components/one-time-password-field/one-time-password-field.js +43 -0
- package/dist/components/one-time-password-field/one-time-password-field.props.cjs +1 -0
- package/dist/components/one-time-password-field/one-time-password-field.props.d.cts +26 -0
- package/dist/components/one-time-password-field/one-time-password-field.props.d.ts +26 -0
- package/dist/components/one-time-password-field/one-time-password-field.props.js +30 -0
- package/dist/components/password-toggle-field/password-toggle-field.cjs +1 -1
- package/dist/components/password-toggle-field/password-toggle-field.js +1 -1
- package/dist/components/popover.cjs +1 -1
- package/dist/components/popover.d.cts +9 -3
- package/dist/components/popover.d.ts +9 -3
- package/dist/components/popover.js +57 -30
- package/dist/components/radio.cjs +1 -1
- package/dist/components/radio.js +10 -10
- package/dist/components/select.cjs +1 -1
- package/dist/components/select.d.cts +1 -1
- package/dist/components/select.d.ts +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/select.props.cjs +1 -1
- package/dist/components/select.props.d.cts +2 -2
- package/dist/components/select.props.d.ts +2 -2
- package/dist/components/select.props.js +2 -1
- package/dist/components/slot.d.cts +6 -2
- package/dist/components/slot.d.ts +6 -2
- package/dist/components/theme-panel.cjs +2 -2
- package/dist/components/theme-panel.d.cts +12 -3
- package/dist/components/theme-panel.d.ts +12 -3
- package/dist/components/theme-panel.js +252 -219
- package/dist/components/theme.d.cts +1 -1
- package/dist/components/theme.d.ts +1 -1
- package/dist/components/theme.props.cjs +1 -1
- package/dist/components/theme.props.d.cts +4 -1
- package/dist/components/theme.props.d.ts +4 -1
- package/dist/components/theme.props.js +1 -1
- package/dist/helpers/inert.cjs +1 -1
- package/dist/helpers/inert.d.cts +2 -1
- package/dist/helpers/inert.d.ts +2 -1
- package/dist/helpers/inert.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +33 -32
- package/dist/props/index.cjs +1 -1
- package/dist/props/index.d.cts +1 -0
- package/dist/props/index.d.ts +1 -0
- package/dist/props/index.js +62 -61
- package/dist/styles.css +1268 -53
- package/package.json +2 -2
|
@@ -17,77 +17,56 @@ import { inert as _ } from "../helpers/inert.js";
|
|
|
17
17
|
import { Tooltip as v } from "./tooltip.js";
|
|
18
18
|
import * as y from "react";
|
|
19
19
|
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
20
|
-
import { useCallbackRef as S } from "@bolid-ui/primitives/internal";
|
|
20
|
+
import { useCallbackRef as S, useControllableState as C } from "@bolid-ui/primitives/internal";
|
|
21
|
+
import { flushSync as w } from "react-dom";
|
|
21
22
|
//#region src/components/theme-panel.tsx
|
|
22
|
-
var
|
|
23
|
-
let [a, o] =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
C.displayName = "ThemePanel";
|
|
32
|
-
var w = y.forwardRef((C, w) => {
|
|
33
|
-
let { open: O, onOpenChange: k, onAppearanceChange: A, ...j } = C, { appearance: M, onAppearanceChange: N, accentColor: P, onAccentColorChange: F, grayColor: I, onGrayColorChange: L, panelBackground: R, onPanelBackgroundChange: z, radius: B, onRadiusChange: V, scaling: H, onScalingChange: U } = o(), W = A !== void 0, G = S(A), K = y.useCallback((e) => {
|
|
34
|
-
let t = T();
|
|
35
|
-
if (M !== "inherit") {
|
|
36
|
-
N(e);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
W ? G(e) : (Q(e), D(e)), t();
|
|
40
|
-
}, [
|
|
41
|
-
M,
|
|
42
|
-
N,
|
|
43
|
-
W,
|
|
44
|
-
G
|
|
45
|
-
]), q = r(P), J = I === "auto" ? q : I, [Y, X] = y.useState("idle");
|
|
46
|
-
async function ee() {
|
|
47
|
-
let e = {
|
|
48
|
-
appearance: M === i.appearance.default ? void 0 : M,
|
|
49
|
-
accentColor: P === i.accentColor.default ? void 0 : P,
|
|
50
|
-
grayColor: I === i.grayColor.default ? void 0 : I,
|
|
51
|
-
panelBackground: R === i.panelBackground.default ? void 0 : R,
|
|
52
|
-
radius: B === i.radius.default ? void 0 : B,
|
|
53
|
-
scaling: H === i.scaling.default ? void 0 : H
|
|
54
|
-
}, t = Object.keys(e).filter((t) => e[t] !== void 0).map((t) => `${t}="${e[t]}"`).join(" "), n = t ? `<Theme ${t}>` : "<Theme>";
|
|
55
|
-
X("copying"), await navigator.clipboard.writeText(n), X("copied"), setTimeout(() => X("idle"), 2e3);
|
|
56
|
-
}
|
|
57
|
-
let [Z, Q] = y.useState(M === "inherit" ? null : M), $ = "\n [contenteditable],\n [role=\"combobox\"],\n [role=\"listbox\"],\n [role=\"menu\"],\n input:not([type=\"radio\"], [type=\"checkbox\"]),\n select,\n textarea\n ";
|
|
23
|
+
var T = "\n [contenteditable],\n [role=\"combobox\"],\n [role=\"listbox\"],\n [role=\"menu\"],\n input:not([type=\"radio\"], [type=\"checkbox\"]),\n select,\n textarea\n ", E = y.forwardRef(({ defaultOpen: e = !0, open: t, onOpenChange: n, ...r }, i) => {
|
|
24
|
+
let [a, o] = C({
|
|
25
|
+
prop: t,
|
|
26
|
+
defaultProp: e,
|
|
27
|
+
onChange: n,
|
|
28
|
+
caller: "ThemePanel"
|
|
29
|
+
}), s = y.useRef(null), c = y.useRef(null);
|
|
58
30
|
return y.useEffect(() => {
|
|
59
31
|
function e(e) {
|
|
60
|
-
let t = e.altKey || e.ctrlKey || e.shiftKey || e.metaKey, n = document.activeElement?.closest(
|
|
61
|
-
e.key?.toUpperCase() === "T" && !t && !n
|
|
32
|
+
let t = e.altKey || e.ctrlKey || e.shiftKey || e.metaKey, n = document.activeElement?.closest(T);
|
|
33
|
+
if (e.key?.toUpperCase() === "T" && !t && !n) {
|
|
34
|
+
let e = !1;
|
|
35
|
+
w(() => {
|
|
36
|
+
o((t) => (e = !t, e));
|
|
37
|
+
}), e ? (c.current = document.activeElement, s.current?.focus()) : c.current?.focus();
|
|
38
|
+
}
|
|
62
39
|
}
|
|
63
40
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
64
|
-
}, [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
41
|
+
}, [o]), /* @__PURE__ */ b(D, {
|
|
42
|
+
...r,
|
|
43
|
+
ref: i,
|
|
44
|
+
triggerRef: s,
|
|
45
|
+
open: a,
|
|
46
|
+
shortcut: /* @__PURE__ */ b(v, {
|
|
47
|
+
content: "Press T to show/hide the Theme Panel",
|
|
48
|
+
side: "bottom",
|
|
49
|
+
sideOffset: 6,
|
|
50
|
+
children: /* @__PURE__ */ b(g, {
|
|
51
|
+
asChild: !0,
|
|
52
|
+
size: "3",
|
|
53
|
+
tabIndex: 0,
|
|
54
|
+
className: "rt-ThemePanelShortcut",
|
|
55
|
+
children: /* @__PURE__ */ b("button", {
|
|
56
|
+
type: "button",
|
|
57
|
+
onClick: () => o((e) => !e),
|
|
58
|
+
ref: s,
|
|
59
|
+
"aria-label": "Toggle the Theme Panel",
|
|
60
|
+
children: "T"
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
E.displayName = "ThemePanel";
|
|
67
|
+
var D = y.forwardRef((e, t) => {
|
|
68
|
+
let { open: n, onAppearanceChange: r, shortcut: i, triggerRef: l, ...u } = e, f = o();
|
|
69
|
+
return /* @__PURE__ */ b(a, {
|
|
91
70
|
asChild: !0,
|
|
92
71
|
radius: "medium",
|
|
93
72
|
scaling: "100%",
|
|
@@ -96,105 +75,150 @@ var w = y.forwardRef((C, w) => {
|
|
|
96
75
|
position: "fixed",
|
|
97
76
|
top: "0",
|
|
98
77
|
right: "0",
|
|
99
|
-
mr:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
78
|
+
mr: {
|
|
79
|
+
initial: "2",
|
|
80
|
+
sm: "4"
|
|
81
|
+
},
|
|
82
|
+
mt: {
|
|
83
|
+
initial: "2",
|
|
84
|
+
sm: "4"
|
|
85
|
+
},
|
|
86
|
+
width: { initial: "360px" },
|
|
87
|
+
maxHeight: {
|
|
88
|
+
initial: "calc(100svh - var(--space-2) - var(--space-2))",
|
|
89
|
+
sm: "calc(100svh - var(--space-4) - var(--space-4))"
|
|
90
|
+
},
|
|
91
|
+
maxWidth: {
|
|
92
|
+
initial: "calc(100svw - var(--space-2) - var(--space-2))",
|
|
93
|
+
sm: "calc(100svw - var(--space-4) - var(--space-4))"
|
|
94
|
+
},
|
|
95
|
+
inert: n ? void 0 : _,
|
|
96
|
+
...u,
|
|
97
|
+
ref: t,
|
|
104
98
|
style: {
|
|
105
|
-
zIndex:
|
|
99
|
+
zIndex: 999999999,
|
|
106
100
|
overflow: "hidden",
|
|
107
|
-
maxHeight: "calc(100vh - var(--space-4) - var(--space-4))",
|
|
108
101
|
borderRadius: "var(--radius-4)",
|
|
109
102
|
backgroundColor: "var(--color-panel-solid)",
|
|
110
103
|
transformOrigin: "top center",
|
|
111
104
|
transitionProperty: "transform, box-shadow",
|
|
112
105
|
transitionDuration: "200ms",
|
|
113
|
-
transitionTimingFunction:
|
|
114
|
-
transform:
|
|
115
|
-
boxShadow:
|
|
116
|
-
...
|
|
106
|
+
transitionTimingFunction: n ? "ease-out" : "ease-in",
|
|
107
|
+
transform: n ? "none" : "translateX(105%)",
|
|
108
|
+
boxShadow: n ? "var(--shadow-5)" : "var(--shadow-2)",
|
|
109
|
+
...e.style
|
|
117
110
|
},
|
|
118
111
|
children: /* @__PURE__ */ b(d, { children: /* @__PURE__ */ x(s, {
|
|
119
112
|
flexGrow: "1",
|
|
120
|
-
p:
|
|
113
|
+
p: {
|
|
114
|
+
initial: "4",
|
|
115
|
+
xs: "5"
|
|
116
|
+
},
|
|
121
117
|
position: "relative",
|
|
118
|
+
children: [!!i && /* @__PURE__ */ b(s, {
|
|
119
|
+
position: "absolute",
|
|
120
|
+
top: "0",
|
|
121
|
+
right: "0",
|
|
122
|
+
m: "2",
|
|
123
|
+
children: i
|
|
124
|
+
}), /* @__PURE__ */ b(O, {
|
|
125
|
+
onAppearanceChange: r,
|
|
126
|
+
context: f
|
|
127
|
+
})]
|
|
128
|
+
}) })
|
|
129
|
+
})
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
D.displayName = "ThemePanelImpl";
|
|
133
|
+
var O = y.forwardRef((d, g) => {
|
|
134
|
+
let { onAppearanceChange: _, context: C, ...w } = d, T = o(), { appearance: E, onAppearanceChange: D, accentColor: O, onAccentColorChange: P, grayColor: F, onGrayColorChange: I, panelBackground: L, onPanelBackgroundChange: R, radius: z, onRadiusChange: B, scaling: V, onScalingChange: H } = C ?? T, [U, W] = y.useState(E === "inherit" ? null : E), G = _ !== void 0, K = S(_), q = y.useCallback((e) => {
|
|
135
|
+
let t = j();
|
|
136
|
+
if (E !== "inherit") {
|
|
137
|
+
D(e);
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
G ? K(e) : (W(e), N(e)), t();
|
|
141
|
+
}, [
|
|
142
|
+
E,
|
|
143
|
+
D,
|
|
144
|
+
G,
|
|
145
|
+
K
|
|
146
|
+
]), J = r(O), Y = F === "auto" ? J : F, [X, Z] = y.useState("idle");
|
|
147
|
+
async function Q() {
|
|
148
|
+
let e = {
|
|
149
|
+
appearance: E === i.appearance.default ? void 0 : E,
|
|
150
|
+
accentColor: O === i.accentColor.default ? void 0 : O,
|
|
151
|
+
grayColor: F === i.grayColor.default ? void 0 : F,
|
|
152
|
+
panelBackground: L === i.panelBackground.default ? void 0 : L,
|
|
153
|
+
radius: z === i.radius.default ? void 0 : z,
|
|
154
|
+
scaling: V === i.scaling.default ? void 0 : V
|
|
155
|
+
}, t = Object.keys(e).filter((t) => e[t] !== void 0).map((t) => `${t}="${e[t]}"`).join(" "), n = t ? `<Theme ${t}>` : "<Theme>";
|
|
156
|
+
Z("copying"), await navigator.clipboard.writeText(n), Z("copied"), setTimeout(() => Z("idle"), 2e3);
|
|
157
|
+
}
|
|
158
|
+
return y.useEffect(() => {
|
|
159
|
+
let e = document.documentElement, t = document.body;
|
|
160
|
+
function n() {
|
|
161
|
+
let n = e.classList.contains("dark") || e.classList.contains("dark-theme") || t.classList.contains("dark") || t.classList.contains("dark-theme");
|
|
162
|
+
W(E === "inherit" ? n ? "dark" : "light" : E);
|
|
163
|
+
}
|
|
164
|
+
let r = new MutationObserver(function(e) {
|
|
165
|
+
e.forEach(function(e) {
|
|
166
|
+
e.attributeName === "class" && n();
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
return n(), E === "inherit" && (r.observe(e, { attributes: !0 }), r.observe(t, { attributes: !0 })), () => r.disconnect();
|
|
170
|
+
}, [E]), /* @__PURE__ */ x(c, {
|
|
171
|
+
direction: "column",
|
|
172
|
+
gap: "5",
|
|
173
|
+
...w,
|
|
174
|
+
ref: g,
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ b(t, {
|
|
177
|
+
size: {
|
|
178
|
+
initial: "3",
|
|
179
|
+
sm: "5"
|
|
180
|
+
},
|
|
181
|
+
trim: "both",
|
|
182
|
+
as: "h2",
|
|
183
|
+
children: "Theme"
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ x(c, {
|
|
186
|
+
direction: "column",
|
|
187
|
+
gap: "5",
|
|
122
188
|
children: [
|
|
123
|
-
/* @__PURE__ */ b(
|
|
124
|
-
position: "absolute",
|
|
125
|
-
top: "0",
|
|
126
|
-
right: "0",
|
|
127
|
-
m: "2",
|
|
128
|
-
children: /* @__PURE__ */ b(v, {
|
|
129
|
-
content: "Press T to show/hide the Theme Panel",
|
|
130
|
-
side: "bottom",
|
|
131
|
-
sideOffset: 6,
|
|
132
|
-
children: /* @__PURE__ */ b(g, {
|
|
133
|
-
asChild: !0,
|
|
134
|
-
size: "3",
|
|
135
|
-
tabIndex: 0,
|
|
136
|
-
className: "rt-ThemePanelShortcut",
|
|
137
|
-
children: /* @__PURE__ */ b("button", {
|
|
138
|
-
onClick: () => k(!O),
|
|
139
|
-
children: "T"
|
|
140
|
-
})
|
|
141
|
-
})
|
|
142
|
-
})
|
|
143
|
-
}),
|
|
144
|
-
/* @__PURE__ */ b(t, {
|
|
145
|
-
size: "5",
|
|
146
|
-
trim: "both",
|
|
147
|
-
as: "h3",
|
|
148
|
-
mb: "5",
|
|
149
|
-
children: "Theme"
|
|
150
|
-
}),
|
|
151
|
-
/* @__PURE__ */ b(n, {
|
|
189
|
+
/* @__PURE__ */ x(k, { children: [/* @__PURE__ */ b(A, {
|
|
152
190
|
id: "accent-color-title",
|
|
153
|
-
as: "p",
|
|
154
|
-
size: "2",
|
|
155
|
-
weight: "medium",
|
|
156
|
-
mt: "5",
|
|
157
191
|
children: "Accent color"
|
|
158
|
-
}),
|
|
159
|
-
|
|
160
|
-
columns: "10",
|
|
192
|
+
}), /* @__PURE__ */ b(c, {
|
|
193
|
+
wrap: "wrap",
|
|
161
194
|
gap: "2",
|
|
162
|
-
mt: "3",
|
|
163
195
|
role: "group",
|
|
164
196
|
"aria-labelledby": "accent-color-title",
|
|
165
|
-
children: i.accentColor.values.map((e) => /* @__PURE__ */ b(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
children: /* @__PURE__ */ b(
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
197
|
+
children: i.accentColor.values.map((e) => /* @__PURE__ */ b(s, {
|
|
198
|
+
asChild: !0,
|
|
199
|
+
children: /* @__PURE__ */ b("label", {
|
|
200
|
+
className: "rt-ThemePanelSwatch",
|
|
201
|
+
style: { backgroundColor: `var(--${e}-9)` },
|
|
202
|
+
children: /* @__PURE__ */ b(v, {
|
|
203
|
+
content: `${M(e)}${O === "gray" && Y !== "gray" ? ` (${M(Y)})` : ""}`,
|
|
204
|
+
children: /* @__PURE__ */ b("input", {
|
|
205
|
+
className: "rt-ThemePanelSwatchInput",
|
|
206
|
+
type: "radio",
|
|
207
|
+
name: "accentColor",
|
|
208
|
+
value: e,
|
|
209
|
+
checked: O === e,
|
|
210
|
+
onChange: (e) => P(e.target.value)
|
|
211
|
+
})
|
|
177
212
|
})
|
|
178
213
|
})
|
|
179
214
|
}, e))
|
|
180
|
-
}),
|
|
181
|
-
/* @__PURE__ */ b(
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
as: "p",
|
|
187
|
-
id: "gray-color-title",
|
|
188
|
-
size: "2",
|
|
189
|
-
weight: "medium",
|
|
190
|
-
mt: "5",
|
|
191
|
-
children: "Gray color"
|
|
192
|
-
})
|
|
193
|
-
}),
|
|
194
|
-
/* @__PURE__ */ b(u, {
|
|
195
|
-
columns: "10",
|
|
215
|
+
})] }),
|
|
216
|
+
/* @__PURE__ */ x(k, { children: [/* @__PURE__ */ b(A, {
|
|
217
|
+
id: "gray-color-title",
|
|
218
|
+
children: "Gray color"
|
|
219
|
+
}), /* @__PURE__ */ b(c, {
|
|
220
|
+
wrap: "wrap",
|
|
196
221
|
gap: "2",
|
|
197
|
-
mt: "3",
|
|
198
222
|
role: "group",
|
|
199
223
|
"aria-labelledby": "gray-color-title",
|
|
200
224
|
children: i.grayColor.values.map((e) => /* @__PURE__ */ b(c, {
|
|
@@ -204,35 +228,29 @@ var w = y.forwardRef((C, w) => {
|
|
|
204
228
|
children: /* @__PURE__ */ b("label", {
|
|
205
229
|
className: "rt-ThemePanelSwatch",
|
|
206
230
|
style: {
|
|
207
|
-
backgroundColor: e === "auto" ? `var(--${
|
|
231
|
+
backgroundColor: e === "auto" ? `var(--${J}-9)` : e === "gray" ? "var(--gray-9)" : `var(--${e}-9)`,
|
|
208
232
|
filter: e === "gray" ? "saturate(0)" : void 0
|
|
209
233
|
},
|
|
210
234
|
children: /* @__PURE__ */ b(v, {
|
|
211
|
-
content: `${
|
|
235
|
+
content: `${M(e)}${e === "auto" ? ` (${M(J)})` : ""}`,
|
|
212
236
|
children: /* @__PURE__ */ b("input", {
|
|
213
237
|
className: "rt-ThemePanelSwatchInput",
|
|
214
238
|
type: "radio",
|
|
215
239
|
name: "grayColor",
|
|
216
240
|
value: e,
|
|
217
|
-
checked:
|
|
218
|
-
onChange: (e) =>
|
|
241
|
+
checked: F === e,
|
|
242
|
+
onChange: (e) => I(e.target.value)
|
|
219
243
|
})
|
|
220
244
|
})
|
|
221
245
|
})
|
|
222
246
|
}, e))
|
|
223
|
-
}),
|
|
224
|
-
/* @__PURE__ */ b(
|
|
247
|
+
})] }),
|
|
248
|
+
/* @__PURE__ */ x(k, { children: [/* @__PURE__ */ b(A, {
|
|
225
249
|
id: "appearance-title",
|
|
226
|
-
as: "p",
|
|
227
|
-
size: "2",
|
|
228
|
-
weight: "medium",
|
|
229
|
-
mt: "5",
|
|
230
250
|
children: "Appearance"
|
|
231
|
-
}),
|
|
232
|
-
/* @__PURE__ */ b(u, {
|
|
251
|
+
}), /* @__PURE__ */ b(u, {
|
|
233
252
|
columns: "2",
|
|
234
253
|
gap: "2",
|
|
235
|
-
mt: "3",
|
|
236
254
|
role: "group",
|
|
237
255
|
"aria-labelledby": "appearance-title",
|
|
238
256
|
children: ["light", "dark"].map((e) => /* @__PURE__ */ x("label", {
|
|
@@ -242,8 +260,8 @@ var w = y.forwardRef((C, w) => {
|
|
|
242
260
|
type: "radio",
|
|
243
261
|
name: "appearance",
|
|
244
262
|
value: e,
|
|
245
|
-
checked:
|
|
246
|
-
onChange: (e) =>
|
|
263
|
+
checked: U === e,
|
|
264
|
+
onChange: (e) => q(e.target.value)
|
|
247
265
|
}), /* @__PURE__ */ x(c, {
|
|
248
266
|
align: "center",
|
|
249
267
|
justify: "center",
|
|
@@ -278,25 +296,19 @@ var w = y.forwardRef((C, w) => {
|
|
|
278
296
|
}), /* @__PURE__ */ b(n, {
|
|
279
297
|
size: "1",
|
|
280
298
|
weight: "medium",
|
|
281
|
-
children:
|
|
299
|
+
children: M(e)
|
|
282
300
|
})]
|
|
283
301
|
})]
|
|
284
302
|
}, e))
|
|
285
|
-
}),
|
|
286
|
-
/* @__PURE__ */ b(
|
|
303
|
+
})] }),
|
|
304
|
+
/* @__PURE__ */ x(k, { children: [/* @__PURE__ */ b(A, {
|
|
287
305
|
id: "radius-title",
|
|
288
|
-
as: "p",
|
|
289
|
-
size: "2",
|
|
290
|
-
weight: "medium",
|
|
291
|
-
mt: "5",
|
|
292
306
|
children: "Radius"
|
|
293
|
-
}),
|
|
294
|
-
/* @__PURE__ */ b(u, {
|
|
295
|
-
columns: "5",
|
|
307
|
+
}), /* @__PURE__ */ b(c, {
|
|
296
308
|
gap: "2",
|
|
297
|
-
mt: "3",
|
|
298
309
|
role: "group",
|
|
299
310
|
"aria-labelledby": "radius-title",
|
|
311
|
+
wrap: "wrap",
|
|
300
312
|
children: i.radius.values.map((e) => /* @__PURE__ */ x(c, {
|
|
301
313
|
direction: "column",
|
|
302
314
|
align: "center",
|
|
@@ -308,15 +320,21 @@ var w = y.forwardRef((C, w) => {
|
|
|
308
320
|
name: "radius",
|
|
309
321
|
id: `theme-panel-radius-${e}`,
|
|
310
322
|
value: e,
|
|
311
|
-
checked:
|
|
312
|
-
onChange: (e) =>
|
|
323
|
+
checked: z === e,
|
|
324
|
+
onChange: (e) => B(e.target.value)
|
|
313
325
|
}), /* @__PURE__ */ b(a, {
|
|
314
326
|
asChild: !0,
|
|
315
327
|
radius: e,
|
|
316
328
|
children: /* @__PURE__ */ b(s, {
|
|
317
329
|
m: "3",
|
|
318
|
-
width:
|
|
319
|
-
|
|
330
|
+
width: {
|
|
331
|
+
initial: "24px",
|
|
332
|
+
sm: "32px"
|
|
333
|
+
},
|
|
334
|
+
height: {
|
|
335
|
+
initial: "24px",
|
|
336
|
+
sm: "32px"
|
|
337
|
+
},
|
|
320
338
|
style: {
|
|
321
339
|
borderTopLeftRadius: e === "full" ? "80%" : "var(--radius-5)",
|
|
322
340
|
backgroundImage: "linear-gradient(to bottom right, var(--accent-3), var(--accent-4))",
|
|
@@ -334,24 +352,18 @@ var w = y.forwardRef((C, w) => {
|
|
|
334
352
|
color: "gray",
|
|
335
353
|
children: /* @__PURE__ */ b("label", {
|
|
336
354
|
htmlFor: `theme-panel-radius-${e}`,
|
|
337
|
-
children:
|
|
355
|
+
children: M(e)
|
|
338
356
|
})
|
|
339
357
|
})
|
|
340
358
|
})]
|
|
341
359
|
}, e))
|
|
342
|
-
}),
|
|
343
|
-
/* @__PURE__ */ b(
|
|
360
|
+
})] }),
|
|
361
|
+
/* @__PURE__ */ x(k, { children: [/* @__PURE__ */ b(A, {
|
|
344
362
|
id: "scaling-title",
|
|
345
|
-
as: "p",
|
|
346
|
-
size: "2",
|
|
347
|
-
weight: "medium",
|
|
348
|
-
mt: "5",
|
|
349
363
|
children: "Scaling"
|
|
350
|
-
}),
|
|
351
|
-
|
|
352
|
-
columns: `${i.scaling.values.length}`,
|
|
364
|
+
}), /* @__PURE__ */ b(u, {
|
|
365
|
+
columns: "repeat(3, 1fr)",
|
|
353
366
|
gap: "2",
|
|
354
|
-
mt: "3",
|
|
355
367
|
role: "group",
|
|
356
368
|
"aria-labelledby": "scaling-title",
|
|
357
369
|
children: i.scaling.values.map((e) => /* @__PURE__ */ x("label", {
|
|
@@ -361,8 +373,8 @@ var w = y.forwardRef((C, w) => {
|
|
|
361
373
|
type: "radio",
|
|
362
374
|
name: "scaling",
|
|
363
375
|
value: e,
|
|
364
|
-
checked:
|
|
365
|
-
onChange: (e) =>
|
|
376
|
+
checked: V === e,
|
|
377
|
+
onChange: (e) => H(e.target.value)
|
|
366
378
|
}), /* @__PURE__ */ b(c, {
|
|
367
379
|
align: "center",
|
|
368
380
|
justify: "center",
|
|
@@ -376,22 +388,18 @@ var w = y.forwardRef((C, w) => {
|
|
|
376
388
|
children: /* @__PURE__ */ b(n, {
|
|
377
389
|
size: "1",
|
|
378
390
|
weight: "medium",
|
|
379
|
-
children:
|
|
391
|
+
children: M(e)
|
|
380
392
|
})
|
|
381
393
|
})
|
|
382
394
|
})
|
|
383
395
|
})]
|
|
384
396
|
}, e))
|
|
385
|
-
}),
|
|
386
|
-
/* @__PURE__ */ x(c, {
|
|
387
|
-
mt: "5",
|
|
397
|
+
})] }),
|
|
398
|
+
/* @__PURE__ */ x(k, { children: [/* @__PURE__ */ x(c, {
|
|
388
399
|
align: "center",
|
|
389
400
|
gap: "2",
|
|
390
|
-
children: [/* @__PURE__ */ b(
|
|
401
|
+
children: [/* @__PURE__ */ b(A, {
|
|
391
402
|
id: "panel-background-title",
|
|
392
|
-
as: "p",
|
|
393
|
-
size: "2",
|
|
394
|
-
weight: "medium",
|
|
395
403
|
children: "Panel background"
|
|
396
404
|
}), /* @__PURE__ */ x(p, { children: [/* @__PURE__ */ b(m, { children: /* @__PURE__ */ b(h, {
|
|
397
405
|
size: "1",
|
|
@@ -414,20 +422,27 @@ var w = y.forwardRef((C, w) => {
|
|
|
414
422
|
})
|
|
415
423
|
}) }), /* @__PURE__ */ b(f, {
|
|
416
424
|
size: "1",
|
|
417
|
-
|
|
425
|
+
width: "220px",
|
|
426
|
+
maxWidth: "90svw",
|
|
427
|
+
minWidth: "0",
|
|
418
428
|
side: "top",
|
|
419
429
|
align: "center",
|
|
420
430
|
children: /* @__PURE__ */ b(n, {
|
|
421
431
|
as: "p",
|
|
422
|
-
size: "
|
|
423
|
-
children: "Whether Card and Table panels are translucent, showing some of
|
|
432
|
+
size: "1",
|
|
433
|
+
children: "Whether Card and Table panels are translucent, showing some of the background behind them."
|
|
424
434
|
})
|
|
425
435
|
})] })]
|
|
426
|
-
}),
|
|
427
|
-
|
|
428
|
-
|
|
436
|
+
}), /* @__PURE__ */ b(u, {
|
|
437
|
+
columns: {
|
|
438
|
+
initial: "1",
|
|
439
|
+
sm: "2"
|
|
440
|
+
},
|
|
441
|
+
rows: {
|
|
442
|
+
initial: "2",
|
|
443
|
+
sm: "1"
|
|
444
|
+
},
|
|
429
445
|
gap: "2",
|
|
430
|
-
mt: "3",
|
|
431
446
|
role: "group",
|
|
432
447
|
"aria-labelledby": "panel-background-title",
|
|
433
448
|
children: i.panelBackground.values.map((e) => /* @__PURE__ */ x("label", {
|
|
@@ -437,8 +452,8 @@ var w = y.forwardRef((C, w) => {
|
|
|
437
452
|
type: "radio",
|
|
438
453
|
name: "panelBackground",
|
|
439
454
|
value: e,
|
|
440
|
-
checked:
|
|
441
|
-
onChange: (e) =>
|
|
455
|
+
checked: L === e,
|
|
456
|
+
onChange: (e) => R(e.target.value)
|
|
442
457
|
}), /* @__PURE__ */ x(c, {
|
|
443
458
|
align: "center",
|
|
444
459
|
justify: "center",
|
|
@@ -545,24 +560,42 @@ var w = y.forwardRef((C, w) => {
|
|
|
545
560
|
}), /* @__PURE__ */ b(n, {
|
|
546
561
|
size: "1",
|
|
547
562
|
weight: "medium",
|
|
548
|
-
children:
|
|
563
|
+
children: M(e)
|
|
549
564
|
})]
|
|
550
565
|
})]
|
|
551
566
|
}, e))
|
|
552
|
-
})
|
|
553
|
-
/* @__PURE__ */ b(l, {
|
|
554
|
-
mt: "5",
|
|
555
|
-
style: { width: "100%" },
|
|
556
|
-
onClick: ee,
|
|
557
|
-
children: Y === "copied" ? "Copied" : "Copy Theme"
|
|
558
|
-
})
|
|
567
|
+
})] })
|
|
559
568
|
]
|
|
560
|
-
})
|
|
561
|
-
|
|
569
|
+
}),
|
|
570
|
+
/* @__PURE__ */ b(l, {
|
|
571
|
+
style: { width: "100%" },
|
|
572
|
+
onClick: Q,
|
|
573
|
+
children: X === "copied" ? "Copied" : "Copy Theme"
|
|
574
|
+
})
|
|
575
|
+
]
|
|
562
576
|
});
|
|
563
577
|
});
|
|
564
|
-
|
|
565
|
-
function
|
|
578
|
+
O.displayName = "ThemePanelContent";
|
|
579
|
+
function k(e) {
|
|
580
|
+
return /* @__PURE__ */ b(c, {
|
|
581
|
+
direction: "column",
|
|
582
|
+
gap: "3",
|
|
583
|
+
asChild: !0,
|
|
584
|
+
...e,
|
|
585
|
+
children: /* @__PURE__ */ b("section", { children: e.children })
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
function A(e) {
|
|
589
|
+
return /* @__PURE__ */ b(t, {
|
|
590
|
+
as: "h3",
|
|
591
|
+
size: {
|
|
592
|
+
initial: "1",
|
|
593
|
+
sm: "2"
|
|
594
|
+
},
|
|
595
|
+
...e
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
function j() {
|
|
566
599
|
let e = document.createElement("style");
|
|
567
600
|
return e.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")), document.head.appendChild(e), () => {
|
|
568
601
|
window.getComputedStyle(document.body), setTimeout(() => {
|
|
@@ -570,12 +603,12 @@ function T() {
|
|
|
570
603
|
}, 1);
|
|
571
604
|
};
|
|
572
605
|
}
|
|
573
|
-
function
|
|
606
|
+
function M(e) {
|
|
574
607
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
575
608
|
}
|
|
576
|
-
function
|
|
609
|
+
function N(e) {
|
|
577
610
|
let t = document.documentElement, n = t.classList.contains("light-theme"), r = t.classList.contains("dark-theme"), i = t.classList.contains("light"), a = t.classList.contains("dark");
|
|
578
611
|
(n || r) && (t.classList.remove("light-theme", "dark-theme"), t.style.colorScheme = e, t.classList.add(`${e}-theme`)), (i || a) && (t.classList.remove("light", "dark"), t.style.colorScheme = e, t.classList.add(e)), !n && !r && !i && !a && (t.style.colorScheme = e, t.classList.add(e));
|
|
579
612
|
}
|
|
580
613
|
//#endregion
|
|
581
|
-
export {
|
|
614
|
+
export { E as ThemePanel, O as ThemePanelContent };
|
|
@@ -32,4 +32,4 @@ declare const Theme: React.ForwardRefExoticComponent<ThemeProps & React.RefAttri
|
|
|
32
32
|
interface ThemeImplPublicProps extends ComponentPropsWithout<'div', RemovedProps | 'dir'>, ThemeOwnProps {
|
|
33
33
|
}
|
|
34
34
|
export { Theme, ThemeContext, useThemeContext };
|
|
35
|
-
export type { ThemeProps };
|
|
35
|
+
export type { ThemeProps, ThemeContextValue };
|
|
@@ -32,4 +32,4 @@ declare const Theme: React.ForwardRefExoticComponent<ThemeProps & React.RefAttri
|
|
|
32
32
|
interface ThemeImplPublicProps extends ComponentPropsWithout<'div', RemovedProps | 'dir'>, ThemeOwnProps {
|
|
33
33
|
}
|
|
34
34
|
export { Theme, ThemeContext, useThemeContext };
|
|
35
|
-
export type { ThemeProps };
|
|
35
|
+
export type { ThemeProps, ThemeContextValue };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("../props/as-child.prop.cjs"),t=require("../props/color.prop.cjs"),n=require("../props/radius.prop.cjs");var r=[`inherit`,`light`,`dark`],i=[`solid`,`translucent`],a=[`90%`,`95%`,`100%`,`105%`,`110%`,`120%`,`130%`,`140%`,`150%`],o={...e.asChildPropDef,hasBackground:{type:`boolean`,default:!0},appearance:{type:`enum`,values:r,default:`inherit`},accentColor:{type:`enum`,values:t.accentColors,default:`blue`},grayColor:{type:`enum`,values:t.grayColors,default:`auto`},panelBackground:{type:`enum`,values:i,default:`translucent`},radius:{type:`enum`,values:n.radii,default:`large`},scaling:{type:`enum`,values:a,default:`100%`}};exports.themePropDefs=o;
|
|
1
|
+
const e=require("../props/as-child.prop.cjs"),t=require("../props/color.prop.cjs"),n=require("../props/radius.prop.cjs");var r=[`inherit`,`light`,`dark`],i=[`solid`,`translucent`],a=[`90%`,`95%`,`100%`,`105%`,`110%`,`120%`,`130%`,`140%`,`150%`],o={...e.asChildPropDef,hasBackground:{type:`boolean`,default:!0},appearance:{type:`enum`,values:r,default:`inherit`},accentColor:{type:`enum`,values:t.accentColors,default:`blue`},grayColor:{type:`enum`,values:t.grayColors,default:`auto`},panelBackground:{type:`enum`,values:i,default:`translucent`},radius:{type:`enum`,values:n.radii,default:`large`},scaling:{type:`enum`,values:a,default:`100%`}};exports.appearances=r,exports.panelBackgrounds=i,exports.scalings=a,exports.themePropDefs=o;
|