@enderfall/ui 0.1.7 → 0.1.9
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 +1 -1
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs.js +2 -1
- package/package.json +2 -2
- package/src/components/Button.css +55 -0
- package/src/components/Button.tsx +10 -1
- package/src/components/Tabs.css +0 -50
- package/src/components/Tabs.tsx +4 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ButtonHTMLAttributes } from "react";
|
|
2
2
|
type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
3
|
-
variant?: "primary" | "ghost" | "locked" | "danger" | "delete" | "warning" | "info" | "success";
|
|
3
|
+
variant?: "primary" | "ghost" | "locked" | "danger" | "delete" | "warning" | "info" | "success" | "tab";
|
|
4
4
|
subvariant?: "default" | "glow";
|
|
5
5
|
};
|
|
6
6
|
export declare const Button: ({ variant, subvariant, className, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -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,
|
|
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,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,8CAAsE,WAAW,4CAYvG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../src/components/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../src/components/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,SAAS,CAAC;CACjD,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,sHASlB,SAAS,4CAsCX,CAAC"}
|
package/dist/components/Tabs.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "./Button";
|
|
2
3
|
export const Tabs = ({ tabs, activeTab, onChange, orientation = "horizontal", showContentBackground = false, className, tabContentClassName, renderTabContent, }) => {
|
|
3
4
|
const isVertical = orientation === "vertical";
|
|
4
5
|
const active = tabs.find((tab) => tab.id === activeTab);
|
|
5
|
-
return (_jsxs("div", { className: ["ef-tabs", isVertical ? "ef-tabs--vertical" : "", className].filter(Boolean).join(" "), children: [_jsx("div", { className: ["ef-tabs-list", isVertical ? "ef-tabs-list--vertical" : ""].filter(Boolean).join(" "), children: tabs.map((tab) => (_jsxs(
|
|
6
|
+
return (_jsxs("div", { className: ["ef-tabs", isVertical ? "ef-tabs--vertical" : "", className].filter(Boolean).join(" "), children: [_jsx("div", { className: ["ef-tabs-list", isVertical ? "ef-tabs-list--vertical" : ""].filter(Boolean).join(" "), children: tabs.map((tab) => (_jsxs(Button, { variant: "tab", className: ["ef-tab", isVertical ? "ef-tab--vertical" : "", tab.id === activeTab ? "is-active" : ""]
|
|
6
7
|
.filter(Boolean)
|
|
7
8
|
.join(" "), onClick: () => onChange(tab.id), children: [tab.icon ? _jsx("span", { className: "ef-tab-icon", children: tab.icon }) : null, _jsx("span", { className: "ef-tab-text", children: tab.label }), isVertical && tab.id === activeTab ? _jsx("span", { className: "ef-tab-active-indicator" }) : null] }, tab.id))) }), (active?.content || renderTabContent) && (_jsx("div", { className: [
|
|
8
9
|
"ef-tabs-content",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enderfall/ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.9",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -30,4 +30,4 @@
|
|
|
30
30
|
"@types/react": "^18.2.43",
|
|
31
31
|
"typescript": "^5.3.3"
|
|
32
32
|
}
|
|
33
|
-
}
|
|
33
|
+
}
|
|
@@ -75,6 +75,61 @@
|
|
|
75
75
|
color: var(--ef-button-text);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
.ef-button.tab {
|
|
79
|
+
color: rgba(238, 241, 246, 0.75);
|
|
80
|
+
text-decoration: none;
|
|
81
|
+
font-size: 1rem;
|
|
82
|
+
font-weight: 600;
|
|
83
|
+
transition: color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
|
|
84
|
+
padding: 8px 18px;
|
|
85
|
+
border-radius: 8px;
|
|
86
|
+
border: 2px solid transparent;
|
|
87
|
+
text-transform: uppercase;
|
|
88
|
+
letter-spacing: 0.08em;
|
|
89
|
+
background: rgba(15, 18, 28, 0.7);
|
|
90
|
+
box-shadow: none;
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
font-family: inherit;
|
|
93
|
+
display: inline-flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
gap: 8px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:root[data-theme="light"] .ef-button.tab,
|
|
100
|
+
:root[data-theme="plain-light"] .ef-button.tab,
|
|
101
|
+
:root[data-theme="galaxy"] .ef-button.tab,
|
|
102
|
+
:root[data-theme="plain-dark"] .ef-button.tab,
|
|
103
|
+
:root[data-theme="system"] .ef-button.tab {
|
|
104
|
+
color: rgba(238, 241, 246, 0.75);
|
|
105
|
+
text-decoration: none;
|
|
106
|
+
font-size: 1rem;
|
|
107
|
+
font-weight: 600;
|
|
108
|
+
padding: 8px 18px;
|
|
109
|
+
border-radius: 8px;
|
|
110
|
+
border: 2px solid transparent;
|
|
111
|
+
text-transform: uppercase;
|
|
112
|
+
letter-spacing: 0.08em;
|
|
113
|
+
background: rgba(15, 18, 28, 0.7);
|
|
114
|
+
box-shadow: none;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.ef-button.tab:hover {
|
|
118
|
+
color: #eef1f6;
|
|
119
|
+
box-shadow: 0 0 18px rgba(124, 77, 255, 0.35);
|
|
120
|
+
transform: translateY(-1px);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
:root[data-theme="light"] .ef-button.tab:hover,
|
|
124
|
+
:root[data-theme="plain-light"] .ef-button.tab:hover,
|
|
125
|
+
:root[data-theme="galaxy"] .ef-button.tab:hover,
|
|
126
|
+
:root[data-theme="plain-dark"] .ef-button.tab:hover,
|
|
127
|
+
:root[data-theme="system"] .ef-button.tab:hover {
|
|
128
|
+
color: #eef1f6;
|
|
129
|
+
box-shadow: 0 0 18px rgba(124, 77, 255, 0.35);
|
|
130
|
+
transform: translateY(-1px);
|
|
131
|
+
}
|
|
132
|
+
|
|
78
133
|
.theme-preview {
|
|
79
134
|
position: relative;
|
|
80
135
|
--shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import type { ButtonHTMLAttributes } from "react";
|
|
2
2
|
|
|
3
3
|
type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
4
|
-
variant?:
|
|
4
|
+
variant?:
|
|
5
|
+
| "primary"
|
|
6
|
+
| "ghost"
|
|
7
|
+
| "locked"
|
|
8
|
+
| "danger"
|
|
9
|
+
| "delete"
|
|
10
|
+
| "warning"
|
|
11
|
+
| "info"
|
|
12
|
+
| "success"
|
|
13
|
+
| "tab";
|
|
5
14
|
subvariant?: "default" | "glow";
|
|
6
15
|
};
|
|
7
16
|
|
package/src/components/Tabs.css
CHANGED
|
@@ -28,59 +28,9 @@
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.ef-tab {
|
|
31
|
-
color: rgba(238, 241, 246, 0.75);
|
|
32
|
-
text-decoration: none;
|
|
33
|
-
font-size: 1rem;
|
|
34
|
-
font-weight: 600;
|
|
35
|
-
transition: color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
|
|
36
|
-
padding: 8px 18px;
|
|
37
|
-
border-radius: 8px;
|
|
38
|
-
border: 2px solid transparent;
|
|
39
|
-
text-transform: uppercase;
|
|
40
|
-
letter-spacing: 0.08em;
|
|
41
|
-
background: rgba(15, 18, 28, 0.7);
|
|
42
|
-
box-shadow: none;
|
|
43
|
-
cursor: pointer;
|
|
44
|
-
font-family: inherit;
|
|
45
|
-
display: inline-flex;
|
|
46
|
-
align-items: center;
|
|
47
31
|
gap: 8px;
|
|
48
32
|
}
|
|
49
33
|
|
|
50
|
-
:root[data-theme="light"] .ef-tab,
|
|
51
|
-
:root[data-theme="plain-light"] .ef-tab,
|
|
52
|
-
:root[data-theme="galaxy"] .ef-tab,
|
|
53
|
-
:root[data-theme="plain-dark"] .ef-tab,
|
|
54
|
-
:root[data-theme="system"] .ef-tab {
|
|
55
|
-
color: rgba(238, 241, 246, 0.75);
|
|
56
|
-
text-decoration: none;
|
|
57
|
-
font-size: 1rem;
|
|
58
|
-
font-weight: 600;
|
|
59
|
-
padding: 8px 18px;
|
|
60
|
-
border-radius: 8px;
|
|
61
|
-
border: 2px solid transparent;
|
|
62
|
-
text-transform: uppercase;
|
|
63
|
-
letter-spacing: 0.08em;
|
|
64
|
-
background: rgba(15, 18, 28, 0.7);
|
|
65
|
-
box-shadow: none;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.ef-tab:hover {
|
|
69
|
-
color: #eef1f6;
|
|
70
|
-
box-shadow: 0 0 18px rgba(124, 77, 255, 0.35);
|
|
71
|
-
transform: translateY(-1px);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
:root[data-theme="light"] .ef-tab:hover,
|
|
75
|
-
:root[data-theme="plain-light"] .ef-tab:hover,
|
|
76
|
-
:root[data-theme="galaxy"] .ef-tab:hover,
|
|
77
|
-
:root[data-theme="plain-dark"] .ef-tab:hover,
|
|
78
|
-
:root[data-theme="system"] .ef-tab:hover {
|
|
79
|
-
color: #eef1f6;
|
|
80
|
-
box-shadow: 0 0 18px rgba(124, 77, 255, 0.35);
|
|
81
|
-
transform: translateY(-1px);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
34
|
.ef-tab.is-active {
|
|
85
35
|
background:
|
|
86
36
|
linear-gradient(#0b0c1a, #0b0c1a) padding-box,
|
package/src/components/Tabs.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
+
import { Button } from "./Button";
|
|
2
3
|
|
|
3
4
|
export type TabsItem = {
|
|
4
5
|
id: string;
|
|
@@ -35,9 +36,9 @@ export const Tabs = ({
|
|
|
35
36
|
<div className={["ef-tabs", isVertical ? "ef-tabs--vertical" : "", className].filter(Boolean).join(" ")}>
|
|
36
37
|
<div className={["ef-tabs-list", isVertical ? "ef-tabs-list--vertical" : ""].filter(Boolean).join(" ")}>
|
|
37
38
|
{tabs.map((tab) => (
|
|
38
|
-
<
|
|
39
|
+
<Button
|
|
39
40
|
key={tab.id}
|
|
40
|
-
|
|
41
|
+
variant="tab"
|
|
41
42
|
className={["ef-tab", isVertical ? "ef-tab--vertical" : "", tab.id === activeTab ? "is-active" : ""]
|
|
42
43
|
.filter(Boolean)
|
|
43
44
|
.join(" ")}
|
|
@@ -46,7 +47,7 @@ export const Tabs = ({
|
|
|
46
47
|
{tab.icon ? <span className="ef-tab-icon">{tab.icon}</span> : null}
|
|
47
48
|
<span className="ef-tab-text">{tab.label}</span>
|
|
48
49
|
{isVertical && tab.id === activeTab ? <span className="ef-tab-active-indicator" /> : null}
|
|
49
|
-
</
|
|
50
|
+
</Button>
|
|
50
51
|
))}
|
|
51
52
|
</div>
|
|
52
53
|
|