@enderfall/ui 0.2.22 → 0.2.24
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/Button.d.ts.map +1 -1
- package/dist/components/Button.js +1 -1
- package/dist/components/Dropdown.js +1 -1
- package/package.json +1 -1
- package/src/components/Button.css +27 -11
- package/src/components/Button.tsx +1 -1
- package/src/components/Dropdown.tsx +49 -49
- package/src/components/UserMenu.css +0 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAElD,KAAK,WAAW,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IAC3D,OAAO,CAAC,EACJ,SAAS,GACT,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,MAAM,GACN,SAAS,GACT,KAAK,CAAC;IACV,UAAU,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,YAAY,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAElD,KAAK,WAAW,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IAC3D,OAAO,CAAC,EACJ,SAAS,GACT,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,MAAM,GACN,SAAS,GACT,KAAK,CAAC;IACV,UAAU,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,YAAY,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,8CAAyE,WAAW,4CAa1G,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export const Button = ({ variant = "primary", subvariant = "
|
|
2
|
+
export const Button = ({ variant = "primary", subvariant = "hover-glow", className, ...props }) => (_jsx("button", { ...props, className: [
|
|
3
3
|
"ef-button",
|
|
4
4
|
variant,
|
|
5
5
|
subvariant === "glow" ? "ef-button--glow" : "",
|
|
@@ -87,7 +87,7 @@ export const Dropdown = (props) => {
|
|
|
87
87
|
}, disabled: item.disabled, title: item.title, children: item.label }, key));
|
|
88
88
|
}
|
|
89
89
|
const isLogoutAction = /\b(log\s*out|sign\s*out)\b/i.test(item.label);
|
|
90
|
-
return (_jsx(Button, { variant: item.buttonVariant ?? (isLogoutAction ? "danger" : "primary"), subvariant: item.buttonSubvariant ?? "
|
|
90
|
+
return (_jsx(Button, { variant: item.buttonVariant ?? (isLogoutAction ? "danger" : "primary"), subvariant: item.buttonSubvariant ?? "hover-glow", className: ["dropdown-item", item.className].filter(Boolean).join(" "), type: "button", onClick: () => {
|
|
91
91
|
item.onClick();
|
|
92
92
|
setOpen(false);
|
|
93
93
|
}, disabled: item.disabled, title: item.title, children: item.label }, key));
|
package/package.json
CHANGED
|
@@ -56,22 +56,38 @@
|
|
|
56
56
|
var(--ef-button-border-soft) border-box;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
.ef-button.primary {
|
|
60
|
-
background:
|
|
61
|
-
linear-gradient(var(--ef-button-surface), var(--ef-button-surface)) padding-box,
|
|
62
|
-
var(--ef-button-border) border-box;
|
|
63
|
-
color: var(--ef-button-text);
|
|
64
|
-
}
|
|
59
|
+
.ef-button.primary {
|
|
60
|
+
background:
|
|
61
|
+
linear-gradient(var(--ef-button-surface), var(--ef-button-surface)) padding-box,
|
|
62
|
+
var(--ef-button-border) border-box;
|
|
63
|
+
color: var(--ef-button-text);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ef-button.primary.ef-button--hover-glow:not(:disabled):hover,
|
|
67
|
+
.ef-button.primary.ef-button--hover-glow:focus-visible,
|
|
68
|
+
.ef-button.primary.ef-button--glow:not(:disabled):hover,
|
|
69
|
+
.ef-button.primary.ef-button--glow:focus-visible {
|
|
70
|
+
transform: none;
|
|
71
|
+
}
|
|
65
72
|
|
|
66
73
|
.ef-button.ghost {
|
|
67
74
|
--ef-button-current-glow-shadow: var(--ef-button-glow-shadow, 0 0 24px rgba(124, 77, 255, 0.45));
|
|
68
75
|
--ef-button-current-hover-shadow: var(--ef-button-hover-shadow, 0 0 18px rgba(124, 77, 255, 0.35));
|
|
69
76
|
--ef-button-current-focus-shadow: var(--ef-button-focus-shadow, 0 0 18px rgba(124, 77, 255, 0.35));
|
|
70
|
-
background:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
background: var(--ef-tab-button-surface, var(--ef-nav-surface));
|
|
78
|
+
box-shadow: var(--ef-tab-button-shadow, var(--ef-nav-shadow));
|
|
79
|
+
color: var(--ef-tab-button-text, var(--ef-nav-text));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ef-button.ghost:not(:disabled):hover {
|
|
83
|
+
background: var(--ef-tab-button-surface-hover, var(--ef-tab-button-surface, var(--ef-nav-surface)));
|
|
84
|
+
box-shadow: var(--ef-tab-button-shadow-hover, var(--ef-nav-shadow-hover));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.ef-button.ghost:focus-visible {
|
|
88
|
+
background: var(--ef-tab-button-surface-hover, var(--ef-tab-button-surface, var(--ef-nav-surface)));
|
|
89
|
+
box-shadow: var(--ef-tab-button-shadow-focus, var(--ef-nav-shadow-focus));
|
|
90
|
+
}
|
|
75
91
|
|
|
76
92
|
.ef-button.locked {
|
|
77
93
|
background: var(--ef-button-locked-bg);
|
|
@@ -14,7 +14,7 @@ type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
14
14
|
subvariant?: "default" | "glow" | "hover-glow";
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
export const Button = ({ variant = "primary", subvariant = "
|
|
17
|
+
export const Button = ({ variant = "primary", subvariant = "hover-glow", className, ...props }: ButtonProps) => (
|
|
18
18
|
<button
|
|
19
19
|
{...props}
|
|
20
20
|
className={[
|
|
@@ -7,26 +7,26 @@ export type HeaderMenuItem = {
|
|
|
7
7
|
content: ReactNode;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
export type DropdownUserItem = {
|
|
11
|
-
id?: string;
|
|
12
|
-
label: string;
|
|
13
|
-
onClick: () => void;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
className?: string;
|
|
16
|
-
title?: string;
|
|
17
|
-
variant?: "default" | "theme-preview";
|
|
18
|
-
buttonVariant?:
|
|
19
|
-
| "primary"
|
|
20
|
-
| "ghost"
|
|
21
|
-
| "locked"
|
|
22
|
-
| "danger"
|
|
23
|
-
| "delete"
|
|
24
|
-
| "warning"
|
|
25
|
-
| "info"
|
|
26
|
-
| "success"
|
|
27
|
-
| "tab";
|
|
28
|
-
buttonSubvariant?: "default" | "glow" | "hover-glow";
|
|
29
|
-
};
|
|
10
|
+
export type DropdownUserItem = {
|
|
11
|
+
id?: string;
|
|
12
|
+
label: string;
|
|
13
|
+
onClick: () => void;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
variant?: "default" | "theme-preview";
|
|
18
|
+
buttonVariant?:
|
|
19
|
+
| "primary"
|
|
20
|
+
| "ghost"
|
|
21
|
+
| "locked"
|
|
22
|
+
| "danger"
|
|
23
|
+
| "delete"
|
|
24
|
+
| "warning"
|
|
25
|
+
| "info"
|
|
26
|
+
| "success"
|
|
27
|
+
| "tab";
|
|
28
|
+
buttonSubvariant?: "default" | "glow" | "hover-glow";
|
|
29
|
+
};
|
|
30
30
|
|
|
31
31
|
export type DropdownUserListItem = {
|
|
32
32
|
id?: string;
|
|
@@ -300,48 +300,48 @@ export const Dropdown = (props: DropdownProps) => {
|
|
|
300
300
|
: null;
|
|
301
301
|
|
|
302
302
|
const renderUserListItems = () => {
|
|
303
|
-
if (props.variant !== "user-list") {
|
|
304
|
-
return props.items.map((item, index) => {
|
|
305
|
-
const key = item.id ?? `${item.label}-${index}`;
|
|
306
|
-
if (item.variant === "theme-preview") {
|
|
307
|
-
return (
|
|
303
|
+
if (props.variant !== "user-list") {
|
|
304
|
+
return props.items.map((item, index) => {
|
|
305
|
+
const key = item.id ?? `${item.label}-${index}`;
|
|
306
|
+
if (item.variant === "theme-preview") {
|
|
307
|
+
return (
|
|
308
308
|
<Button
|
|
309
309
|
key={key}
|
|
310
310
|
type="button"
|
|
311
|
-
variant="primary"
|
|
312
|
-
subvariant={item.buttonSubvariant ?? "default"}
|
|
313
|
-
className={["theme-preview", item.className].filter(Boolean).join(" ")}
|
|
314
|
-
onClick={() => {
|
|
315
|
-
item.onClick();
|
|
316
|
-
setOpen(false);
|
|
317
|
-
}}
|
|
311
|
+
variant="primary"
|
|
312
|
+
subvariant={item.buttonSubvariant ?? "default"}
|
|
313
|
+
className={["theme-preview", item.className].filter(Boolean).join(" ")}
|
|
314
|
+
onClick={() => {
|
|
315
|
+
item.onClick();
|
|
316
|
+
setOpen(false);
|
|
317
|
+
}}
|
|
318
318
|
disabled={item.disabled}
|
|
319
319
|
title={item.title}
|
|
320
|
-
>
|
|
321
|
-
{item.label}
|
|
322
|
-
</Button>
|
|
323
|
-
);
|
|
324
|
-
}
|
|
325
|
-
const isLogoutAction = /\b(log\s*out|sign\s*out)\b/i.test(item.label);
|
|
326
|
-
return (
|
|
320
|
+
>
|
|
321
|
+
{item.label}
|
|
322
|
+
</Button>
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
const isLogoutAction = /\b(log\s*out|sign\s*out)\b/i.test(item.label);
|
|
326
|
+
return (
|
|
327
327
|
<Button
|
|
328
328
|
key={key}
|
|
329
329
|
variant={item.buttonVariant ?? (isLogoutAction ? "danger" : "primary")}
|
|
330
|
-
subvariant={item.buttonSubvariant ?? "
|
|
330
|
+
subvariant={item.buttonSubvariant ?? "hover-glow"}
|
|
331
331
|
className={["dropdown-item", item.className].filter(Boolean).join(" ")}
|
|
332
332
|
type="button"
|
|
333
333
|
onClick={() => {
|
|
334
334
|
item.onClick();
|
|
335
335
|
setOpen(false);
|
|
336
|
-
}}
|
|
337
|
-
disabled={item.disabled}
|
|
338
|
-
title={item.title}
|
|
339
|
-
>
|
|
340
|
-
{item.label}
|
|
341
|
-
</Button>
|
|
342
|
-
);
|
|
343
|
-
});
|
|
344
|
-
}
|
|
336
|
+
}}
|
|
337
|
+
disabled={item.disabled}
|
|
338
|
+
title={item.title}
|
|
339
|
+
>
|
|
340
|
+
{item.label}
|
|
341
|
+
</Button>
|
|
342
|
+
);
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
345
|
|
|
346
346
|
if (!props.items.length) {
|
|
347
347
|
return (
|
|
@@ -116,26 +116,9 @@
|
|
|
116
116
|
cursor: pointer;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
.dropdown-item:not(.ef-button) {
|
|
120
|
-
border: 2px solid transparent;
|
|
121
|
-
padding: 10px 16px;
|
|
122
|
-
border-radius: var(--ef-control-radius, 12px);
|
|
123
|
-
background:
|
|
124
|
-
linear-gradient(var(--ef-surface), var(--ef-surface)) padding-box,
|
|
125
|
-
var(--ef-border-gradient) border-box;
|
|
126
|
-
color: var(--text-strong);
|
|
127
|
-
font-weight: 600;
|
|
128
|
-
transition: box-shadow 0.2s ease, transform 0.2s ease;
|
|
129
|
-
box-shadow: var(--ef-button-glow-shadow, 0 0 24px rgba(124, 77, 255, 0.45));
|
|
130
|
-
}
|
|
131
|
-
|
|
132
119
|
.dropdown-item:hover {
|
|
133
120
|
transform: translateY(-1px);
|
|
134
121
|
}
|
|
135
|
-
|
|
136
|
-
.dropdown-item:not(.ef-button):hover {
|
|
137
|
-
box-shadow: var(--ef-button-hover-glow-shadow, 0 0 18px rgba(124, 77, 255, 0.35));
|
|
138
|
-
}
|
|
139
122
|
|
|
140
123
|
.dropdown-item.theme-preview {
|
|
141
124
|
border: 2px solid transparent;
|