@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.
Files changed (76) hide show
  1. package/dist/components/badge.cjs +1 -1
  2. package/dist/components/badge.js +18 -8
  3. package/dist/components/base/base-button.cjs +1 -1
  4. package/dist/components/base/base-button.js +40 -29
  5. package/dist/components/base/base-button.props.cjs +1 -1
  6. package/dist/components/base/base-button.props.d.cts +1 -1
  7. package/dist/components/base/base-button.props.d.ts +1 -1
  8. package/dist/components/base/base-button.props.js +1 -0
  9. package/dist/components/context-menu.cjs +1 -1
  10. package/dist/components/context-menu.d.cts +2 -0
  11. package/dist/components/context-menu.d.ts +2 -0
  12. package/dist/components/context-menu.js +7 -7
  13. package/dist/components/dropdown-menu.cjs +1 -1
  14. package/dist/components/dropdown-menu.d.cts +3 -1
  15. package/dist/components/dropdown-menu.d.ts +3 -1
  16. package/dist/components/dropdown-menu.js +8 -8
  17. package/dist/components/index.d.cts +3 -1
  18. package/dist/components/index.d.ts +3 -1
  19. package/dist/components/kbd.props.cjs +1 -1
  20. package/dist/components/kbd.props.d.cts +6 -0
  21. package/dist/components/kbd.props.d.ts +6 -0
  22. package/dist/components/kbd.props.js +8 -2
  23. package/dist/components/multi-select/core/select.cjs +1 -1
  24. package/dist/components/multi-select/core/select.d.cts +5 -1
  25. package/dist/components/multi-select/core/select.d.ts +5 -1
  26. package/dist/components/multi-select/core/select.js +11 -11
  27. package/dist/components/one-time-password-field/index.d.cts +2 -0
  28. package/dist/components/one-time-password-field/index.d.ts +2 -0
  29. package/dist/components/one-time-password-field/one-time-password-field.cjs +1 -0
  30. package/dist/components/one-time-password-field/one-time-password-field.d.cts +17 -0
  31. package/dist/components/one-time-password-field/one-time-password-field.d.ts +17 -0
  32. package/dist/components/one-time-password-field/one-time-password-field.js +43 -0
  33. package/dist/components/one-time-password-field/one-time-password-field.props.cjs +1 -0
  34. package/dist/components/one-time-password-field/one-time-password-field.props.d.cts +26 -0
  35. package/dist/components/one-time-password-field/one-time-password-field.props.d.ts +26 -0
  36. package/dist/components/one-time-password-field/one-time-password-field.props.js +30 -0
  37. package/dist/components/password-toggle-field/password-toggle-field.cjs +1 -1
  38. package/dist/components/password-toggle-field/password-toggle-field.js +1 -1
  39. package/dist/components/popover.cjs +1 -1
  40. package/dist/components/popover.d.cts +9 -3
  41. package/dist/components/popover.d.ts +9 -3
  42. package/dist/components/popover.js +57 -30
  43. package/dist/components/radio.cjs +1 -1
  44. package/dist/components/radio.js +10 -10
  45. package/dist/components/select.cjs +1 -1
  46. package/dist/components/select.d.cts +1 -1
  47. package/dist/components/select.d.ts +1 -1
  48. package/dist/components/select.js +1 -1
  49. package/dist/components/select.props.cjs +1 -1
  50. package/dist/components/select.props.d.cts +2 -2
  51. package/dist/components/select.props.d.ts +2 -2
  52. package/dist/components/select.props.js +2 -1
  53. package/dist/components/slot.d.cts +6 -2
  54. package/dist/components/slot.d.ts +6 -2
  55. package/dist/components/theme-panel.cjs +2 -2
  56. package/dist/components/theme-panel.d.cts +12 -3
  57. package/dist/components/theme-panel.d.ts +12 -3
  58. package/dist/components/theme-panel.js +252 -219
  59. package/dist/components/theme.d.cts +1 -1
  60. package/dist/components/theme.d.ts +1 -1
  61. package/dist/components/theme.props.cjs +1 -1
  62. package/dist/components/theme.props.d.cts +4 -1
  63. package/dist/components/theme.props.d.ts +4 -1
  64. package/dist/components/theme.props.js +1 -1
  65. package/dist/helpers/inert.cjs +1 -1
  66. package/dist/helpers/inert.d.cts +2 -1
  67. package/dist/helpers/inert.d.ts +2 -1
  68. package/dist/helpers/inert.js +1 -1
  69. package/dist/index.cjs +1 -1
  70. package/dist/index.js +33 -32
  71. package/dist/props/index.cjs +1 -1
  72. package/dist/props/index.d.cts +1 -0
  73. package/dist/props/index.d.ts +1 -0
  74. package/dist/props/index.js +62 -61
  75. package/dist/styles.css +1268 -53
  76. 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 C = y.forwardRef(({ defaultOpen: e = !0, open: t, onOpenChange: n, ...r }, i) => {
23
- let [a, o] = y.useState(e), s = t !== void 0, c = s ? t : a, l = s ? n ?? (() => {}) : o;
24
- return /* @__PURE__ */ b(w, {
25
- ...r,
26
- ref: i,
27
- open: c,
28
- onOpenChange: l
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 && k(!O);
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
- k,
66
- O,
67
- $
68
- ]), y.useEffect(() => {
69
- function e(e) {
70
- let t = e.altKey || e.ctrlKey || e.shiftKey || e.metaKey, n = document.activeElement?.closest($);
71
- e.key?.toUpperCase() === "D" && !t && !n && K(Z === "light" ? "dark" : "light");
72
- }
73
- return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
74
- }, [
75
- K,
76
- Z,
77
- $
78
- ]), y.useEffect(() => {
79
- let e = document.documentElement, t = document.body;
80
- function n() {
81
- let n = e.classList.contains("dark") || e.classList.contains("dark-theme") || t.classList.contains("dark") || t.classList.contains("dark-theme");
82
- Q(M === "inherit" ? n ? "dark" : "light" : M);
83
- }
84
- let r = new MutationObserver(function(e) {
85
- e.forEach(function(e) {
86
- e.attributeName === "class" && n();
87
- });
88
- });
89
- return n(), M === "inherit" && (r.observe(e, { attributes: !0 }), r.observe(t, { attributes: !0 })), () => r.disconnect();
90
- }, [M]), /* @__PURE__ */ b(a, {
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: "4",
100
- mt: "4",
101
- inert: O ? void 0 : _,
102
- ...j,
103
- ref: w,
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: 9999,
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: O ? "ease-out" : "ease-in",
114
- transform: O ? "none" : "translateX(105%)",
115
- boxShadow: O ? "var(--shadow-5)" : "var(--shadow-2)",
116
- ...C.style
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: "5",
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(s, {
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
- /* @__PURE__ */ b(u, {
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("label", {
166
- className: "rt-ThemePanelSwatch",
167
- style: { backgroundColor: `var(--${e}-9)` },
168
- children: /* @__PURE__ */ b(v, {
169
- content: `${E(e)}${P === "gray" && J !== "gray" ? ` (${E(J)})` : ""}`,
170
- children: /* @__PURE__ */ b("input", {
171
- className: "rt-ThemePanelSwatchInput",
172
- type: "radio",
173
- name: "accentColor",
174
- value: e,
175
- checked: P === e,
176
- onChange: (e) => F(e.target.value)
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(c, {
182
- asChild: !0,
183
- align: "center",
184
- justify: "between",
185
- children: /* @__PURE__ */ b(n, {
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(--${q}-9)` : e === "gray" ? "var(--gray-9)" : `var(--${e}-9)`,
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: `${E(e)}${e === "auto" ? ` (${E(q)})` : ""}`,
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: I === e,
218
- onChange: (e) => L(e.target.value)
241
+ checked: F === e,
242
+ onChange: (e) => I(e.target.value)
219
243
  })
220
244
  })
221
245
  })
222
246
  }, e))
223
- }),
224
- /* @__PURE__ */ b(n, {
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: Z === e,
246
- onChange: (e) => K(e.target.value)
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: E(e)
299
+ children: M(e)
282
300
  })]
283
301
  })]
284
302
  }, e))
285
- }),
286
- /* @__PURE__ */ b(n, {
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: B === e,
312
- onChange: (e) => V(e.target.value)
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: "32px",
319
- height: "32px",
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: E(e)
355
+ children: M(e)
338
356
  })
339
357
  })
340
358
  })]
341
359
  }, e))
342
- }),
343
- /* @__PURE__ */ b(n, {
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
- /* @__PURE__ */ b(u, {
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: H === e,
365
- onChange: (e) => U(e.target.value)
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: E(e)
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(n, {
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
- style: { maxWidth: 220 },
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: "2",
423
- children: "Whether Card and Table panels are translucent, showing some of\xA0the background behind them."
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
- /* @__PURE__ */ b(u, {
428
- columns: "2",
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: R === e,
441
- onChange: (e) => z(e.target.value)
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: E(e)
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
- w.displayName = "ThemePanelImpl";
565
- function T() {
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 E(e) {
606
+ function M(e) {
574
607
  return e.charAt(0).toUpperCase() + e.slice(1);
575
608
  }
576
- function D(e) {
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 { C as ThemePanel };
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;