@enderfall/ui 0.1.8 → 0.1.11

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.
@@ -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,EAAE,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;IAChG,UAAU,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,8CAAsE,WAAW,4CAYvG,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;AAEvC,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"}
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,4CA0CX,CAAC"}
@@ -1,10 +1,14 @@
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("button", { type: "button", className: ["ef-tab", isVertical ? "ef-tab--vertical" : "", tab.id === activeTab ? "is-active" : ""]
6
- .filter(Boolean)
7
- .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: [
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) => {
7
+ const isActive = tab.id === activeTab;
8
+ return (_jsxs(Button, { variant: isActive ? "primary" : "tab", subvariant: isActive ? "glow" : "default", className: ["ef-tab", isVertical ? "ef-tab--vertical" : "", isActive ? "is-active" : ""]
9
+ .filter(Boolean)
10
+ .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 && isActive ? _jsx("span", { className: "ef-tab-active-indicator" }) : null] }, tab.id));
11
+ }) }), (active?.content || renderTabContent) && (_jsx("div", { className: [
8
12
  "ef-tabs-content",
9
13
  showContentBackground ? "ef-tabs-content--background" : "",
10
14
  tabContentClassName,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@enderfall/ui",
3
3
  "private": false,
4
- "version": "0.1.8",
4
+ "version": "0.1.11",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -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?: "primary" | "ghost" | "locked" | "danger" | "delete" | "warning" | "info" | "success";
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
 
@@ -217,13 +217,15 @@ export const Dropdown = (props: DropdownProps) => {
217
217
  }}
218
218
  onMouseLeave={scheduleClose}
219
219
  >
220
- <button
220
+ <Button
221
221
  className="ef-menu-button"
222
222
  type="button"
223
+ variant={props.menuOpen === menu.id ? "primary" : "tab"}
224
+ subvariant={props.menuOpen === menu.id ? "glow" : "default"}
223
225
  data-open={props.menuOpen === menu.id ? "true" : "false"}
224
226
  >
225
227
  {menu.label}
226
- </button>
228
+ </Button>
227
229
  {props.menuOpen === menu.id ? (
228
230
  <div
229
231
  className="ef-menu-popover"
@@ -9,73 +9,15 @@
9
9
  width: fit-content;
10
10
  }
11
11
 
12
- .ef-menu-group {
13
- position: relative;
14
- }
15
-
12
+ .ef-menu-group {
13
+ position: relative;
14
+ }
15
+
16
16
  .ef-menu-button {
17
- color: rgba(238, 241, 246, 0.75);
18
- text-decoration: none;
19
17
  font-size: 1rem;
20
- font-weight: 600;
21
- transition: color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
22
- padding: 8px 18px;
23
- border-radius: 8px;
24
- border: 2px solid transparent;
25
18
  text-transform: uppercase;
26
19
  letter-spacing: 0.08em;
27
- background: rgba(15, 18, 28, 0.7);
28
- box-shadow: none;
29
- cursor: pointer;
30
- }
31
-
32
- :root[data-theme="light"] .ef-menu-button,
33
- :root[data-theme="plain-light"] .ef-menu-button,
34
- :root[data-theme="galaxy"] .ef-menu-button,
35
- :root[data-theme="plain-dark"] .ef-menu-button,
36
- :root[data-theme="system"] .ef-menu-button {
37
- color: rgba(238, 241, 246, 0.75);
38
- text-decoration: none;
39
- font-size: 1rem;
40
- font-weight: 600;
41
- background: rgba(15, 18, 28, 0.7);
42
- border-radius: 8px;
43
- border: 2px solid transparent;
44
20
  padding: 8px 18px;
45
- text-transform: uppercase;
46
- letter-spacing: 0.08em;
47
- box-shadow: none;
48
- }
49
-
50
- .ef-menu-button:hover {
51
- color: #eef1f6;
52
- box-shadow: 0 0 18px rgba(124, 77, 255, 0.35);
53
- transform: translateY(-1px);
54
- }
55
-
56
- :root[data-theme="light"] .ef-menu-button:hover,
57
- :root[data-theme="plain-light"] .ef-menu-button:hover,
58
- :root[data-theme="galaxy"] .ef-menu-button:hover,
59
- :root[data-theme="plain-dark"] .ef-menu-button:hover,
60
- :root[data-theme="system"] .ef-menu-button:hover {
61
- color: #eef1f6;
62
- box-shadow: 0 0 18px rgba(124, 77, 255, 0.35);
63
- transform: translateY(-1px);
64
- }
65
-
66
- .ef-menu-button:focus-visible {
67
- color: #eef1f6;
68
- box-shadow: 0 0 20px rgba(124, 77, 255, 0.45);
69
- transform: translateY(-1px);
70
- }
71
-
72
- .ef-menu-button[data-open="true"],
73
- .ef-menu-group[data-open="true"] > .ef-menu-button {
74
- background:
75
- linear-gradient(var(--ef-surface), var(--ef-surface)) padding-box,
76
- var(--ef-border-gradient) border-box;
77
- color: var(--text-strong);
78
- box-shadow: 0 0 24px rgba(124, 77, 255, 0.6);
79
21
  }
80
22
 
81
23
  .ef-menu-popover {
@@ -28,67 +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
- .ef-tab.is-active {
85
- background:
86
- linear-gradient(#0b0c1a, #0b0c1a) padding-box,
87
- linear-gradient(135deg, #00e5ff, #7c4dff, #ff4dd2, #ffb74d) border-box;
88
- color: #f6f5ff;
89
- box-shadow: 0 0 32px rgba(124, 77, 255, 0.65);
90
- }
91
-
92
34
  .ef-tab--vertical {
93
35
  width: 100%;
94
36
  justify-content: flex-start;
@@ -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;
@@ -34,20 +35,24 @@ export const Tabs = ({
34
35
  return (
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
- {tabs.map((tab) => (
38
- <button
38
+ {tabs.map((tab) => {
39
+ const isActive = tab.id === activeTab;
40
+ return (
41
+ <Button
39
42
  key={tab.id}
40
- type="button"
41
- className={["ef-tab", isVertical ? "ef-tab--vertical" : "", tab.id === activeTab ? "is-active" : ""]
43
+ variant={isActive ? "primary" : "tab"}
44
+ subvariant={isActive ? "glow" : "default"}
45
+ className={["ef-tab", isVertical ? "ef-tab--vertical" : "", isActive ? "is-active" : ""]
42
46
  .filter(Boolean)
43
47
  .join(" ")}
44
48
  onClick={() => onChange(tab.id)}
45
49
  >
46
50
  {tab.icon ? <span className="ef-tab-icon">{tab.icon}</span> : null}
47
51
  <span className="ef-tab-text">{tab.label}</span>
48
- {isVertical && tab.id === activeTab ? <span className="ef-tab-active-indicator" /> : null}
49
- </button>
50
- ))}
52
+ {isVertical && isActive ? <span className="ef-tab-active-indicator" /> : null}
53
+ </Button>
54
+ );
55
+ })}
51
56
  </div>
52
57
 
53
58
  {(active?.content || renderTabContent) && (