@leonardaustin/ui 0.31.0 → 0.33.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/README.md +2 -0
- package/dist/components/app-shell/Sidebar.js +125 -123
- package/dist/components/app-shell/ThemeMenu.js +44 -42
- package/dist/components/ui/ActionLink.d.ts +9 -3
- package/dist/components/ui/ActionLink.js +19 -7
- package/dist/components/ui/Button.js +28 -39
- package/dist/components/ui/buttonStyles.d.ts +5 -0
- package/dist/components/ui/buttonStyles.js +23 -0
- package/dist/config/theme.js +49 -7
- package/dist/core.css +121 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +117 -116
- package/dist/providers/SettingsContext.d.ts +1 -1
- package/dist/providers/SettingsProvider.js +4 -2
- package/dist/providers/ThemeContext.d.ts +2 -2
- package/dist/providers/accentColors.d.ts +3 -1
- package/dist/providers/accentColors.js +20 -6
- package/dist/providers/themeClasses.js +2 -0
- package/dist/styles.css +255 -1
- package/dist/themes/studio-dark.css +68 -0
- package/dist/themes/studio-light.css +68 -0
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { cn as e } from "../../lib/cn.js";
|
|
2
2
|
import { mergeRefs as t } from "../../lib/mergeRefs.js";
|
|
3
3
|
import { usePortalContainer as n } from "../../hooks/usePortalContainer.js";
|
|
4
|
-
import { accentItems as r, darkThemes as i, fontOptions as a, lightThemes as
|
|
5
|
-
import { useAnchoredPopup as
|
|
6
|
-
import { useDismiss as
|
|
7
|
-
import { useSettings as
|
|
4
|
+
import { accentItems as r, darkThemes as i, fontOptions as a, lightThemes as ee, themeItems as te } from "../../config/theme.js";
|
|
5
|
+
import { useAnchoredPopup as ne } from "../../hooks/useAnchoredPopup.js";
|
|
6
|
+
import { useDismiss as o } from "../../hooks/useDismiss.js";
|
|
7
|
+
import { useSettings as s } from "../../hooks/useSettings.js";
|
|
8
|
+
import { usesThemeAccent as c } from "../../providers/accentColors.js";
|
|
8
9
|
import { useToast as l } from "../ui/Toast.js";
|
|
9
10
|
import { useApplyTheme as u } from "../../hooks/useApplyTheme.js";
|
|
10
11
|
import { Button as d } from "../ui/Button.js";
|
|
@@ -16,8 +17,8 @@ import { Toggle as g } from "../ui/Toggle.js";
|
|
|
16
17
|
import { THEME_MENU_EVENT as _ } from "./themeMenuEvents.js";
|
|
17
18
|
import { useCallback as v, useEffect as y, useMemo as b, useRef as x, useState as S } from "react";
|
|
18
19
|
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
19
|
-
import { Monitor as E, Moon as D, Palette as
|
|
20
|
-
import { createPortal as
|
|
20
|
+
import { Monitor as E, Moon as D, Palette as re, Sun as O } from "lucide-react";
|
|
21
|
+
import { createPortal as ie } from "react-dom";
|
|
21
22
|
//#region src/components/app-shell/ThemeMenu.tsx
|
|
22
23
|
var k = [
|
|
23
24
|
{
|
|
@@ -37,10 +38,10 @@ var k = [
|
|
|
37
38
|
}
|
|
38
39
|
];
|
|
39
40
|
function A({ className: E, respondToOpenEvent: D = !0, onClick: O, ref: A, ...j }) {
|
|
40
|
-
let [M, N] = S(!1), P = n(), [F, I] = S(!1), L = x(null), R = b(() => t(L, A), [A]), z = x(null), B =
|
|
41
|
+
let [M, N] = S(!1), P = n(), [F, I] = S(!1), L = x(null), R = b(() => t(L, A), [A]), z = x(null), B = s(), V = u(), { toast: H } = l(), U = v(() => {
|
|
41
42
|
N(!1), I(!1);
|
|
42
43
|
}, []);
|
|
43
|
-
|
|
44
|
+
o(M, U, [z], [L], { outsideClick: !F }), ne(M, L, z, {
|
|
44
45
|
side: "bottom",
|
|
45
46
|
align: "end",
|
|
46
47
|
gap: 6,
|
|
@@ -60,7 +61,7 @@ function A({ className: E, respondToOpenEvent: D = !0, onClick: O, ref: A, ...j
|
|
|
60
61
|
};
|
|
61
62
|
return document.addEventListener(_, e), () => document.removeEventListener(_, e);
|
|
62
63
|
}, [D]);
|
|
63
|
-
let { colorMode: G, setColorMode: K, preferredDarkTheme: q, preferredLightTheme: J, accentColor: Y, setAccentColor:
|
|
64
|
+
let { colorMode: G, setColorMode: K, preferredDarkTheme: q, preferredLightTheme: J, accentColor: Y, setAccentColor: ae, fontSize: oe, setFontSize: se, uiFont: ce, setUiFont: le, headingFont: ue, setHeadingFont: de, proseFont: fe, setProseFont: pe, codeFont: me, setCodeFont: he, borderRadius: ge, setBorderRadius: _e, borderWidth: ve, setBorderWidth: ye, tracking: be, setTracking: xe, lineHeight: Se, setLineHeight: Ce, density: X, setDensity: we, reducedMotion: Te, setReducedMotion: Ee, saveThemeCustomization: De, resetThemeCustomization: Oe, hasThemeOverrides: ke, isCustomized: Z, resolvedTheme: Q } = B, $ = c(Q);
|
|
64
65
|
return /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("button", {
|
|
65
66
|
type: "button",
|
|
66
67
|
...j,
|
|
@@ -73,8 +74,8 @@ function A({ className: E, respondToOpenEvent: D = !0, onClick: O, ref: A, ...j
|
|
|
73
74
|
"aria-expanded": M,
|
|
74
75
|
title: "Theme",
|
|
75
76
|
className: e("flex h-7 w-7 cursor-pointer items-center justify-center rounded transition-colors duration-[100ms]", M ? "text-accent-fg bg-accent-muted" : "text-text-tertiary hover:text-text-primary hover:bg-bg-hover", E),
|
|
76
|
-
children: /* @__PURE__ */ w(
|
|
77
|
-
}), M &&
|
|
77
|
+
children: /* @__PURE__ */ w(re, { className: "h-4 w-4" })
|
|
78
|
+
}), M && ie(/* @__PURE__ */ w("div", {
|
|
78
79
|
ref: z,
|
|
79
80
|
role: "dialog",
|
|
80
81
|
"aria-label": "Theme settings",
|
|
@@ -119,7 +120,7 @@ function A({ className: E, respondToOpenEvent: D = !0, onClick: O, ref: A, ...j
|
|
|
119
120
|
children: "Light themes"
|
|
120
121
|
}), /* @__PURE__ */ w("div", {
|
|
121
122
|
className: "grid grid-cols-2 gap-2",
|
|
122
|
-
children:
|
|
123
|
+
children: ee.map((e) => /* @__PURE__ */ w(h, {
|
|
123
124
|
label: e.label,
|
|
124
125
|
icon: e.icon,
|
|
125
126
|
preview: e.preview,
|
|
@@ -131,16 +132,17 @@ function A({ className: E, respondToOpenEvent: D = !0, onClick: O, ref: A, ...j
|
|
|
131
132
|
as: "h3",
|
|
132
133
|
border: !1,
|
|
133
134
|
className: "mb-2",
|
|
134
|
-
children: "Accent"
|
|
135
|
+
children: $ ? "Studio uses its own accent" : "Accent"
|
|
135
136
|
}), /* @__PURE__ */ w("div", {
|
|
136
137
|
className: "flex flex-wrap gap-1.5",
|
|
137
138
|
children: r.map((t) => /* @__PURE__ */ w("button", {
|
|
138
139
|
type: "button",
|
|
139
|
-
|
|
140
|
-
|
|
140
|
+
disabled: $,
|
|
141
|
+
onClick: () => ae(t.value),
|
|
142
|
+
className: e("h-6 w-6 cursor-pointer rounded-full transition-transform duration-[100ms] hover:scale-110 disabled:cursor-not-allowed disabled:opacity-40", !$ && Y === t.value && "ring-offset-bg-tertiary scale-110 ring-2 ring-offset-1"),
|
|
141
143
|
style: {
|
|
142
144
|
backgroundColor: t.color,
|
|
143
|
-
|
|
145
|
+
...!$ && Y === t.value ? { "--utility-ring-color": t.color } : {}
|
|
144
146
|
},
|
|
145
147
|
title: t.value.charAt(0).toUpperCase() + t.value.slice(1),
|
|
146
148
|
"aria-label": t.value
|
|
@@ -158,29 +160,29 @@ function A({ className: E, respondToOpenEvent: D = !0, onClick: O, ref: A, ...j
|
|
|
158
160
|
label: "UI / Body",
|
|
159
161
|
size: "sm",
|
|
160
162
|
options: a,
|
|
161
|
-
value:
|
|
162
|
-
onValueChange: (e) =>
|
|
163
|
+
value: ce,
|
|
164
|
+
onValueChange: (e) => le(e)
|
|
163
165
|
}),
|
|
164
166
|
/* @__PURE__ */ w(p, {
|
|
165
167
|
label: "Headings",
|
|
166
168
|
size: "sm",
|
|
167
169
|
options: a,
|
|
168
|
-
value:
|
|
169
|
-
onValueChange: (e) =>
|
|
170
|
+
value: ue,
|
|
171
|
+
onValueChange: (e) => de(e)
|
|
170
172
|
}),
|
|
171
173
|
/* @__PURE__ */ w(p, {
|
|
172
174
|
label: "Prose",
|
|
173
175
|
size: "sm",
|
|
174
176
|
options: a,
|
|
175
|
-
value:
|
|
176
|
-
onValueChange: (e) =>
|
|
177
|
+
value: fe,
|
|
178
|
+
onValueChange: (e) => pe(e)
|
|
177
179
|
}),
|
|
178
180
|
/* @__PURE__ */ w(p, {
|
|
179
181
|
label: "Code",
|
|
180
182
|
size: "sm",
|
|
181
183
|
options: a,
|
|
182
|
-
value:
|
|
183
|
-
onValueChange: (e) =>
|
|
184
|
+
value: me,
|
|
185
|
+
onValueChange: (e) => he(e)
|
|
184
186
|
})
|
|
185
187
|
]
|
|
186
188
|
})] }),
|
|
@@ -191,24 +193,24 @@ function A({ className: E, respondToOpenEvent: D = !0, onClick: O, ref: A, ...j
|
|
|
191
193
|
label: "Font size",
|
|
192
194
|
min: 11,
|
|
193
195
|
max: 18,
|
|
194
|
-
value:
|
|
195
|
-
onValueChange:
|
|
196
|
+
value: oe,
|
|
197
|
+
onValueChange: se,
|
|
196
198
|
showValue: !0
|
|
197
199
|
}),
|
|
198
200
|
/* @__PURE__ */ w(m, {
|
|
199
201
|
label: "Corner radius",
|
|
200
202
|
min: 0,
|
|
201
203
|
max: 16,
|
|
202
|
-
value:
|
|
203
|
-
onValueChange:
|
|
204
|
+
value: ge,
|
|
205
|
+
onValueChange: _e,
|
|
204
206
|
showValue: !0
|
|
205
207
|
}),
|
|
206
208
|
/* @__PURE__ */ w(m, {
|
|
207
209
|
label: "Border width",
|
|
208
210
|
min: 1,
|
|
209
211
|
max: 3,
|
|
210
|
-
value:
|
|
211
|
-
onValueChange:
|
|
212
|
+
value: ve,
|
|
213
|
+
onValueChange: ye,
|
|
212
214
|
showValue: !0
|
|
213
215
|
}),
|
|
214
216
|
/* @__PURE__ */ w(m, {
|
|
@@ -216,8 +218,8 @@ function A({ className: E, respondToOpenEvent: D = !0, onClick: O, ref: A, ...j
|
|
|
216
218
|
min: 0,
|
|
217
219
|
max: .3,
|
|
218
220
|
step: .01,
|
|
219
|
-
value:
|
|
220
|
-
onValueChange:
|
|
221
|
+
value: be,
|
|
222
|
+
onValueChange: xe,
|
|
221
223
|
showValue: !0
|
|
222
224
|
}),
|
|
223
225
|
/* @__PURE__ */ w(m, {
|
|
@@ -225,8 +227,8 @@ function A({ className: E, respondToOpenEvent: D = !0, onClick: O, ref: A, ...j
|
|
|
225
227
|
min: 1.2,
|
|
226
228
|
max: 2,
|
|
227
229
|
step: .05,
|
|
228
|
-
value:
|
|
229
|
-
onValueChange:
|
|
230
|
+
value: Se,
|
|
231
|
+
onValueChange: Ce,
|
|
230
232
|
showValue: !0
|
|
231
233
|
}),
|
|
232
234
|
/* @__PURE__ */ w(m, {
|
|
@@ -234,33 +236,33 @@ function A({ className: E, respondToOpenEvent: D = !0, onClick: O, ref: A, ...j
|
|
|
234
236
|
min: .18,
|
|
235
237
|
max: .32,
|
|
236
238
|
step: .01,
|
|
237
|
-
value:
|
|
238
|
-
onValueChange:
|
|
239
|
+
value: X,
|
|
240
|
+
onValueChange: we,
|
|
239
241
|
showValue: !0
|
|
240
242
|
})
|
|
241
243
|
]
|
|
242
244
|
}),
|
|
243
245
|
/* @__PURE__ */ w(g, {
|
|
244
246
|
label: "Reduced motion",
|
|
245
|
-
checked:
|
|
246
|
-
onCheckedChange:
|
|
247
|
+
checked: Te,
|
|
248
|
+
onCheckedChange: Ee
|
|
247
249
|
}),
|
|
248
250
|
/* @__PURE__ */ T("div", {
|
|
249
251
|
className: "border-border flex items-center gap-2 border-t pt-3",
|
|
250
252
|
children: [/* @__PURE__ */ w(d, {
|
|
251
253
|
variant: "primary",
|
|
252
254
|
size: "sm",
|
|
253
|
-
disabled: !
|
|
255
|
+
disabled: !Z,
|
|
254
256
|
onClick: () => {
|
|
255
|
-
|
|
257
|
+
De(), H("success", `Saved customization for ${te.find((e) => e.value === Q)?.label ?? Q}`);
|
|
256
258
|
},
|
|
257
259
|
children: "Save for theme"
|
|
258
260
|
}), /* @__PURE__ */ w(d, {
|
|
259
261
|
variant: "secondary",
|
|
260
262
|
size: "sm",
|
|
261
|
-
disabled: !
|
|
263
|
+
disabled: !ke && !Z,
|
|
262
264
|
onClick: () => {
|
|
263
|
-
|
|
265
|
+
Oe(), H("info", "Reset to theme defaults");
|
|
264
266
|
},
|
|
265
267
|
children: "Reset"
|
|
266
268
|
})]
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
|
+
import { type ControlSize } from "../../providers/ControlSizeContext";
|
|
2
3
|
type AnchorProps = ComponentPropsWithRef<"a"> & {
|
|
3
4
|
href: string;
|
|
4
5
|
};
|
|
5
6
|
export interface ActionLinkProps extends AnchorProps {
|
|
6
7
|
/** Destination for native navigation, including opening in a new tab. */
|
|
7
8
|
href: string;
|
|
8
|
-
/**
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Inline text link, bordered secondary action or accent primary action.
|
|
11
|
+
* `secondary` and `primary` match Button and follow the control size.
|
|
12
|
+
*/
|
|
13
|
+
appearance?: "inline" | "secondary" | "primary";
|
|
14
|
+
/** Inherit ControlSizeProvider or opt into a minimum 44px hit area. */
|
|
15
|
+
controlSize?: ControlSize;
|
|
10
16
|
/** Render a router anchor, forwarding the supplied attributes, children and ref. */
|
|
11
17
|
renderLink?: (props: AnchorProps) => ReactNode;
|
|
12
18
|
}
|
|
13
|
-
export declare function ActionLink({ appearance, renderLink, className, ...props }: ActionLinkProps): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
|
|
19
|
+
export declare function ActionLink({ appearance, controlSize, renderLink, className, ...props }: ActionLinkProps): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
|
|
14
20
|
export {};
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import { cn as e } from "../../lib/cn.js";
|
|
2
|
-
import {
|
|
2
|
+
import { useControlSize as t } from "../../providers/ControlSizeContext.js";
|
|
3
|
+
import { buttonBaseStyles as n, sizeStyles as r, variantStyles as i } from "./buttonStyles.js";
|
|
4
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
3
5
|
//#region src/components/ui/ActionLink.tsx
|
|
4
|
-
function
|
|
5
|
-
let o = {
|
|
6
|
-
...
|
|
7
|
-
|
|
6
|
+
function o({ appearance: o = "inline", controlSize: s, renderLink: c, className: l, ...u }) {
|
|
7
|
+
let d = t(s), f = o !== "inline", p = {
|
|
8
|
+
...u,
|
|
9
|
+
...f && {
|
|
10
|
+
"data-control-size": d,
|
|
11
|
+
"data-variant": o,
|
|
12
|
+
"data-size": "md"
|
|
13
|
+
},
|
|
14
|
+
className: e(f ? [
|
|
15
|
+
"ui-sized-control",
|
|
16
|
+
n,
|
|
17
|
+
i[o],
|
|
18
|
+
r.md
|
|
19
|
+
] : ["focus-visible:outline-accent focus-visible:outline-2 focus-visible:outline-offset-2", "text-accent-fg underline underline-offset-2"], l)
|
|
8
20
|
};
|
|
9
|
-
return
|
|
21
|
+
return c ? c(p) : /* @__PURE__ */ a("a", { ...p });
|
|
10
22
|
}
|
|
11
23
|
//#endregion
|
|
12
|
-
export {
|
|
24
|
+
export { o as ActionLink };
|
|
@@ -1,41 +1,30 @@
|
|
|
1
1
|
import { cn as e } from "../../lib/cn.js";
|
|
2
2
|
import { useControlSize as t } from "../../providers/ControlSizeContext.js";
|
|
3
|
+
import { buttonBaseStyles as n, sizeStyles as r, variantStyles as i } from "./buttonStyles.js";
|
|
3
4
|
import "react";
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { Loader2 as
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { Loader2 as s } from "lucide-react";
|
|
6
7
|
//#region src/components/ui/Button.tsx
|
|
7
|
-
var
|
|
8
|
-
primary: "bg-accent text-text-on-accent hover:bg-accent-hover active:bg-accent-active",
|
|
9
|
-
secondary: "bg-bg-secondary text-text-primary border border-border hover:bg-bg-hover hover:border-border-strong",
|
|
10
|
-
danger: "bg-danger-muted text-danger-fg border border-transparent hover:bg-danger/20",
|
|
11
|
-
ghost: "text-text-secondary hover:text-text-primary hover:bg-bg-hover",
|
|
12
|
-
icon: "text-text-tertiary hover:text-text-primary hover:bg-bg-hover",
|
|
13
|
-
link: "text-accent-fg hover:underline underline-offset-2"
|
|
14
|
-
}, o = {
|
|
15
|
-
xs: "h-6 px-2 text-2xs gap-1",
|
|
16
|
-
sm: "h-7 px-2.5 text-xs gap-1.5",
|
|
17
|
-
md: "h-8 px-3 text-xs gap-2",
|
|
18
|
-
lg: "h-9 px-4 text-sm gap-2"
|
|
19
|
-
}, s = {
|
|
8
|
+
var c = {
|
|
20
9
|
xs: "h-6 w-6",
|
|
21
10
|
sm: "h-7 w-7",
|
|
22
11
|
md: "h-8 w-8",
|
|
23
12
|
lg: "h-9 w-9"
|
|
24
|
-
},
|
|
13
|
+
}, l = {
|
|
25
14
|
xs: "text-2xs gap-1",
|
|
26
15
|
sm: "text-xs gap-1.5",
|
|
27
16
|
md: "text-xs gap-2",
|
|
28
17
|
lg: "text-sm gap-2"
|
|
29
|
-
},
|
|
18
|
+
}, u = {
|
|
30
19
|
xs: "h-3 w-3",
|
|
31
20
|
sm: "h-3.5 w-3.5",
|
|
32
21
|
md: "h-3.5 w-3.5",
|
|
33
22
|
lg: "h-4 w-4"
|
|
34
|
-
},
|
|
23
|
+
}, d = {
|
|
35
24
|
sm: "hidden sm:inline",
|
|
36
25
|
md: "hidden md:inline",
|
|
37
26
|
lg: "hidden lg:inline"
|
|
38
|
-
},
|
|
27
|
+
}, f = {
|
|
39
28
|
sm: {
|
|
40
29
|
xs: "px-1 sm:px-2",
|
|
41
30
|
sm: "px-1.5 sm:px-2.5",
|
|
@@ -55,29 +44,29 @@ var a = {
|
|
|
55
44
|
lg: "px-2.5 lg:px-4"
|
|
56
45
|
}
|
|
57
46
|
};
|
|
58
|
-
function
|
|
59
|
-
let
|
|
60
|
-
return /* @__PURE__ */
|
|
47
|
+
function p({ variant: p = "secondary", size: m = "md", controlSize: h, loading: g, pressed: _, icon: v, hideLabel: y, className: b, children: x, disabled: S, ref: C, ...w }) {
|
|
48
|
+
let T = t(h), E = p === "icon", D = p === "link", O = _ ?? (w["aria-pressed"] === !0 || w["aria-pressed"] === "true"), k = y === !0 ? "sm" : y === !1 ? void 0 : y;
|
|
49
|
+
return /* @__PURE__ */ o("button", {
|
|
61
50
|
type: "button",
|
|
62
|
-
ref:
|
|
63
|
-
"data-control-size":
|
|
64
|
-
"data-variant":
|
|
65
|
-
"data-size":
|
|
66
|
-
"data-pressed":
|
|
67
|
-
"data-hide-label":
|
|
68
|
-
disabled:
|
|
69
|
-
className: e((!
|
|
70
|
-
...
|
|
71
|
-
"aria-pressed":
|
|
51
|
+
ref: C,
|
|
52
|
+
"data-control-size": T,
|
|
53
|
+
"data-variant": p,
|
|
54
|
+
"data-size": m,
|
|
55
|
+
"data-pressed": _ !== void 0 || w["aria-pressed"] !== void 0 ? String(O) : void 0,
|
|
56
|
+
"data-hide-label": k && !E ? "" : void 0,
|
|
57
|
+
disabled: S || g,
|
|
58
|
+
className: e((!D || T === "comfortable") && "ui-sized-control", n, i[p], O && (p === "secondary" || p === "ghost" || E) && "text-text-primary", E ? c[m] : D ? l[m] : r[m], k && !E && !D && f[k]?.[m], b),
|
|
59
|
+
...w,
|
|
60
|
+
"aria-pressed": _ ?? w["aria-pressed"],
|
|
72
61
|
children: [
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
className:
|
|
77
|
-
children:
|
|
78
|
-
}) :
|
|
62
|
+
g && /* @__PURE__ */ a(s, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
63
|
+
v && !g && /* @__PURE__ */ a(v, { className: u[m] }),
|
|
64
|
+
x && (k ? /* @__PURE__ */ a("span", {
|
|
65
|
+
className: d[k],
|
|
66
|
+
children: x
|
|
67
|
+
}) : x)
|
|
79
68
|
]
|
|
80
69
|
});
|
|
81
70
|
}
|
|
82
71
|
//#endregion
|
|
83
|
-
export {
|
|
72
|
+
export { p as Button };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ButtonSize, ButtonVariant } from "./Button";
|
|
2
|
+
/** Shared Button class tokens, reused by ActionLink so the two cannot drift. */
|
|
3
|
+
export declare const buttonBaseStyles: string;
|
|
4
|
+
export declare const variantStyles: Record<ButtonVariant, string>;
|
|
5
|
+
export declare const sizeStyles: Record<ButtonSize, string>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/components/ui/buttonStyles.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"inline-flex items-center justify-center rounded-md font-medium",
|
|
4
|
+
"font-control",
|
|
5
|
+
"transition-colors duration-[100ms] ease-out",
|
|
6
|
+
"cursor-pointer",
|
|
7
|
+
"disabled:cursor-not-allowed disabled:opacity-40",
|
|
8
|
+
"focus-visible:outline-accent focus-visible:outline-2 focus-visible:outline-offset-2"
|
|
9
|
+
].join(" "), t = {
|
|
10
|
+
primary: "bg-accent text-text-on-accent hover:bg-accent-hover active:bg-accent-active",
|
|
11
|
+
secondary: "bg-bg-secondary text-text-primary border border-border hover:bg-bg-hover hover:border-border-strong",
|
|
12
|
+
danger: "bg-danger-muted text-danger-fg border border-transparent hover:bg-danger/20",
|
|
13
|
+
ghost: "text-text-secondary hover:text-text-primary hover:bg-bg-hover",
|
|
14
|
+
icon: "text-text-tertiary hover:text-text-primary hover:bg-bg-hover",
|
|
15
|
+
link: "text-accent-fg hover:underline underline-offset-2"
|
|
16
|
+
}, n = {
|
|
17
|
+
xs: "h-6 px-2 text-2xs gap-1",
|
|
18
|
+
sm: "h-7 px-2.5 text-xs gap-1.5",
|
|
19
|
+
md: "h-8 px-3 text-xs gap-2",
|
|
20
|
+
lg: "h-9 px-4 text-sm gap-2"
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { e as buttonBaseStyles, n as sizeStyles, t as variantStyles };
|
package/dist/config/theme.js
CHANGED
|
@@ -82,6 +82,24 @@ var s = [
|
|
|
82
82
|
fg: "#272d40"
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
+
{
|
|
86
|
+
value: "studioLight",
|
|
87
|
+
label: "Studio Light",
|
|
88
|
+
icon: n,
|
|
89
|
+
preview: {
|
|
90
|
+
bg: "#f6f8fa",
|
|
91
|
+
fg: "#d0d7de"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
value: "studioDark",
|
|
96
|
+
label: "Studio Dark",
|
|
97
|
+
icon: n,
|
|
98
|
+
preview: {
|
|
99
|
+
bg: "#0d1117",
|
|
100
|
+
fg: "#30363d"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
85
103
|
{
|
|
86
104
|
value: "glassLight",
|
|
87
105
|
label: "Glass Light",
|
|
@@ -96,7 +114,8 @@ var s = [
|
|
|
96
114
|
"lightInverted",
|
|
97
115
|
"cyberBrutalLight",
|
|
98
116
|
"hashiTheme",
|
|
99
|
-
"glassLight"
|
|
117
|
+
"glassLight",
|
|
118
|
+
"studioLight"
|
|
100
119
|
]);
|
|
101
120
|
function l(e) {
|
|
102
121
|
return c.has(e);
|
|
@@ -148,8 +167,21 @@ var u = s.filter((e) => l(e.value)), d = s.filter((e) => !l(e.value)), f = {
|
|
|
148
167
|
density: .25
|
|
149
168
|
}, h = {
|
|
150
169
|
...f,
|
|
151
|
-
|
|
170
|
+
uiFont: "native",
|
|
171
|
+
headingFont: "native",
|
|
172
|
+
proseFont: "native",
|
|
173
|
+
controlFont: "native",
|
|
174
|
+
labelFont: "native",
|
|
175
|
+
navigationFont: "native",
|
|
176
|
+
dataFont: "native",
|
|
177
|
+
codeFont: "system-mono",
|
|
178
|
+
fontSize: 13,
|
|
179
|
+
tracking: 0,
|
|
180
|
+
borderRadius: 8
|
|
152
181
|
}, g = {
|
|
182
|
+
...f,
|
|
183
|
+
borderRadius: 12
|
|
184
|
+
}, _ = {
|
|
153
185
|
dark: f,
|
|
154
186
|
light: f,
|
|
155
187
|
lightInverted: f,
|
|
@@ -158,9 +190,11 @@ var u = s.filter((e) => l(e.value)), d = s.filter((e) => !l(e.value)), f = {
|
|
|
158
190
|
cyberBrutalDark: p,
|
|
159
191
|
cyberBrutalLight: p,
|
|
160
192
|
hashiTheme: m,
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
193
|
+
studioDark: h,
|
|
194
|
+
glassDark: g,
|
|
195
|
+
studioLight: h,
|
|
196
|
+
glassLight: g
|
|
197
|
+
}, v = [
|
|
164
198
|
{
|
|
165
199
|
value: "archivo-expanded",
|
|
166
200
|
label: "Archivo Expanded"
|
|
@@ -177,11 +211,19 @@ var u = s.filter((e) => l(e.value)), d = s.filter((e) => !l(e.value)), f = {
|
|
|
177
211
|
value: "pt-serif",
|
|
178
212
|
label: "PT Serif"
|
|
179
213
|
},
|
|
214
|
+
{
|
|
215
|
+
value: "native",
|
|
216
|
+
label: "Native UI"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
value: "system-mono",
|
|
220
|
+
label: "System Mono"
|
|
221
|
+
},
|
|
180
222
|
{
|
|
181
223
|
value: "system",
|
|
182
224
|
label: "System"
|
|
183
225
|
}
|
|
184
|
-
],
|
|
226
|
+
], y = [
|
|
185
227
|
{
|
|
186
228
|
value: "purple",
|
|
187
229
|
color: "#7a59fc"
|
|
@@ -216,4 +258,4 @@ var u = s.filter((e) => l(e.value)), d = s.filter((e) => !l(e.value)), f = {
|
|
|
216
258
|
}
|
|
217
259
|
];
|
|
218
260
|
//#endregion
|
|
219
|
-
export {
|
|
261
|
+
export { y as accentItems, d as darkThemes, v as fontOptions, l as isLightTheme, u as lightThemes, _ as themeDefaults, s as themeItems };
|