apple-liquid-glass-react-ui-kit 0.1.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/dist/index.d.mts +235 -0
- package/dist/index.d.ts +235 -0
- package/dist/index.js +674 -0
- package/dist/index.mjs +615 -0
- package/package.json +21 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
// src/design-system/tokens/colors.ts
|
|
2
|
+
var colors = {
|
|
3
|
+
primary: "#0066A1",
|
|
4
|
+
secondary: "#00B2A9",
|
|
5
|
+
text: {
|
|
6
|
+
primary: "#111827",
|
|
7
|
+
secondary: "#6B7280"
|
|
8
|
+
},
|
|
9
|
+
surface: {
|
|
10
|
+
// Liquid Glass surfaces (light)
|
|
11
|
+
base: "rgba(255,255,255,0.72)",
|
|
12
|
+
strong: "rgba(255,255,255,0.88)",
|
|
13
|
+
// Liquid Glass surfaces (dark)
|
|
14
|
+
dark: "rgba(20,20,25,0.65)"
|
|
15
|
+
},
|
|
16
|
+
border: {
|
|
17
|
+
glass: "rgba(255,255,255,0.35)"
|
|
18
|
+
},
|
|
19
|
+
status: {
|
|
20
|
+
info: "#0EA5E9",
|
|
21
|
+
success: "#22C55E",
|
|
22
|
+
warning: "#F59E0B",
|
|
23
|
+
error: "#EF4444"
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// src/design-system/tokens/spacing.ts
|
|
28
|
+
var spacing = {
|
|
29
|
+
0: "0px",
|
|
30
|
+
1: "4px",
|
|
31
|
+
2: "8px",
|
|
32
|
+
3: "12px",
|
|
33
|
+
4: "16px",
|
|
34
|
+
6: "24px",
|
|
35
|
+
8: "32px",
|
|
36
|
+
12: "48px"
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// src/design-system/tokens/typography.ts
|
|
40
|
+
var typography = {
|
|
41
|
+
fontFamily: "Inter, ui-sans-serif, system-ui, -apple-system, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji'",
|
|
42
|
+
display: { fontSize: "40px", lineHeight: "48px", fontWeight: 700 },
|
|
43
|
+
h1: { fontSize: "32px", lineHeight: "40px", fontWeight: 700 },
|
|
44
|
+
h2: { fontSize: "24px", lineHeight: "32px", fontWeight: 600 },
|
|
45
|
+
body: { fontSize: "16px", lineHeight: "24px", fontWeight: 400 },
|
|
46
|
+
caption: { fontSize: "13px", lineHeight: "18px", fontWeight: 400 }
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// src/design-system/tokens/radius.ts
|
|
50
|
+
var radius = {
|
|
51
|
+
sm: "8px",
|
|
52
|
+
md: "12px",
|
|
53
|
+
lg: "20px",
|
|
54
|
+
xl: "28px",
|
|
55
|
+
full: "999px"
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// src/design-system/tokens/shadows.ts
|
|
59
|
+
var shadows = {
|
|
60
|
+
glass: "0 8px 32px rgba(0,0,0,0.12)",
|
|
61
|
+
floating: "0 16px 48px rgba(0,0,0,0.18)",
|
|
62
|
+
modal: "0 24px 64px rgba(0,0,0,0.22)"
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// src/design-system/components/atoms/Button.tsx
|
|
66
|
+
import * as React from "react";
|
|
67
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
68
|
+
var sizeStyles = {
|
|
69
|
+
sm: { padding: `${spacing[1]} ${spacing[2]}`, fontSize: "14px", lineHeight: "20px" },
|
|
70
|
+
md: { padding: `${spacing[2]} ${spacing[4]}`, fontSize: typography.body.fontSize, lineHeight: typography.body.lineHeight },
|
|
71
|
+
lg: { padding: `${spacing[3]} ${spacing[6]}`, fontSize: "16px", lineHeight: "24px" }
|
|
72
|
+
};
|
|
73
|
+
var Button = React.forwardRef(function Button2({ variant = "primary", size = "md", leftIcon, rightIcon, style, children, disabled, ...rest }, ref) {
|
|
74
|
+
const base = {
|
|
75
|
+
display: "inline-flex",
|
|
76
|
+
alignItems: "center",
|
|
77
|
+
justifyContent: "center",
|
|
78
|
+
gap: spacing[2],
|
|
79
|
+
borderRadius: radius.full,
|
|
80
|
+
border: "1px solid transparent",
|
|
81
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
82
|
+
userSelect: "none",
|
|
83
|
+
fontFamily: typography.fontFamily,
|
|
84
|
+
fontWeight: 600,
|
|
85
|
+
transition: "transform 120ms ease, background 180ms ease, box-shadow 180ms ease, border-color 180ms ease, color 180ms ease",
|
|
86
|
+
transform: "translateZ(0)",
|
|
87
|
+
outline: "none",
|
|
88
|
+
WebkitTapHighlightColor: "transparent",
|
|
89
|
+
...sizeStyles[size]
|
|
90
|
+
};
|
|
91
|
+
const variants = {
|
|
92
|
+
primary: {
|
|
93
|
+
background: colors.primary,
|
|
94
|
+
color: "white",
|
|
95
|
+
boxShadow: shadows.glass
|
|
96
|
+
},
|
|
97
|
+
secondary: {
|
|
98
|
+
background: colors.secondary,
|
|
99
|
+
color: "white",
|
|
100
|
+
boxShadow: shadows.glass
|
|
101
|
+
},
|
|
102
|
+
ghost: {
|
|
103
|
+
background: "transparent",
|
|
104
|
+
color: colors.text.primary,
|
|
105
|
+
borderColor: "rgba(17,24,39,0.12)"
|
|
106
|
+
},
|
|
107
|
+
glass: {
|
|
108
|
+
background: colors.surface.base,
|
|
109
|
+
color: colors.text.primary,
|
|
110
|
+
borderColor: colors.border.glass,
|
|
111
|
+
boxShadow: shadows.glass,
|
|
112
|
+
backdropFilter: "blur(18px)",
|
|
113
|
+
WebkitBackdropFilter: "blur(18px)"
|
|
114
|
+
},
|
|
115
|
+
danger: {
|
|
116
|
+
background: colors.status.error,
|
|
117
|
+
color: "white",
|
|
118
|
+
boxShadow: shadows.glass
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
const merged = {
|
|
122
|
+
...base,
|
|
123
|
+
...variants[variant],
|
|
124
|
+
opacity: disabled ? 0.6 : 1,
|
|
125
|
+
...style
|
|
126
|
+
};
|
|
127
|
+
return /* @__PURE__ */ jsxs(
|
|
128
|
+
"button",
|
|
129
|
+
{
|
|
130
|
+
ref,
|
|
131
|
+
style: merged,
|
|
132
|
+
disabled,
|
|
133
|
+
onMouseDown: (e) => {
|
|
134
|
+
if (disabled) return;
|
|
135
|
+
e.currentTarget.style.transform = "scale(0.98)";
|
|
136
|
+
rest.onMouseDown?.(e);
|
|
137
|
+
},
|
|
138
|
+
onMouseUp: (e) => {
|
|
139
|
+
e.currentTarget.style.transform = "translateZ(0)";
|
|
140
|
+
rest.onMouseUp?.(e);
|
|
141
|
+
},
|
|
142
|
+
onMouseLeave: (e) => {
|
|
143
|
+
e.currentTarget.style.transform = "translateZ(0)";
|
|
144
|
+
rest.onMouseLeave?.(e);
|
|
145
|
+
},
|
|
146
|
+
onFocus: (e) => {
|
|
147
|
+
e.currentTarget.style.boxShadow = `0 0 0 4px rgba(0,102,161,0.18), ${variants[variant].boxShadow ?? ""}`;
|
|
148
|
+
rest.onFocus?.(e);
|
|
149
|
+
},
|
|
150
|
+
onBlur: (e) => {
|
|
151
|
+
e.currentTarget.style.boxShadow = String(variants[variant].boxShadow ?? "none");
|
|
152
|
+
rest.onBlur?.(e);
|
|
153
|
+
},
|
|
154
|
+
...rest,
|
|
155
|
+
children: [
|
|
156
|
+
leftIcon,
|
|
157
|
+
/* @__PURE__ */ jsx("span", { children }),
|
|
158
|
+
rightIcon
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
// src/design-system/components/atoms/Input.tsx
|
|
165
|
+
import * as React2 from "react";
|
|
166
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
167
|
+
var Input = React2.forwardRef(function Input2({ state = "default", style, disabled, ...rest }, ref) {
|
|
168
|
+
const isDisabled = disabled || state === "disabled";
|
|
169
|
+
const isError = state === "error";
|
|
170
|
+
const base = {
|
|
171
|
+
width: "100%",
|
|
172
|
+
padding: `${spacing[2]} ${spacing[3]}`,
|
|
173
|
+
borderRadius: radius.lg,
|
|
174
|
+
border: `1px solid ${isError ? "rgba(239,68,68,0.55)" : "rgba(17,24,39,0.12)"}`,
|
|
175
|
+
background: colors.surface.strong,
|
|
176
|
+
color: colors.text.primary,
|
|
177
|
+
fontFamily: typography.fontFamily,
|
|
178
|
+
fontSize: typography.body.fontSize,
|
|
179
|
+
lineHeight: typography.body.lineHeight,
|
|
180
|
+
outline: "none",
|
|
181
|
+
boxShadow: "none",
|
|
182
|
+
backdropFilter: "blur(18px)",
|
|
183
|
+
WebkitBackdropFilter: "blur(18px)",
|
|
184
|
+
transition: "box-shadow 160ms ease, border-color 160ms ease, background 160ms ease",
|
|
185
|
+
opacity: isDisabled ? 0.6 : 1
|
|
186
|
+
};
|
|
187
|
+
return /* @__PURE__ */ jsx2(
|
|
188
|
+
"input",
|
|
189
|
+
{
|
|
190
|
+
ref,
|
|
191
|
+
disabled: isDisabled,
|
|
192
|
+
style: {
|
|
193
|
+
...base,
|
|
194
|
+
...state === "focused" ? { boxShadow: "0 0 0 4px rgba(0,102,161,0.18)", borderColor: "rgba(0,102,161,0.55)" } : null,
|
|
195
|
+
...style
|
|
196
|
+
},
|
|
197
|
+
...rest
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
// src/design-system/components/atoms/Badge.tsx
|
|
203
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
204
|
+
function Badge({ variant = "info", children, style }) {
|
|
205
|
+
const bg = {
|
|
206
|
+
info: "rgba(14,165,233,0.16)",
|
|
207
|
+
success: "rgba(34,197,94,0.16)",
|
|
208
|
+
warning: "rgba(245,158,11,0.16)",
|
|
209
|
+
error: "rgba(239,68,68,0.16)"
|
|
210
|
+
}[variant];
|
|
211
|
+
const fg = colors.status[variant];
|
|
212
|
+
return /* @__PURE__ */ jsx3(
|
|
213
|
+
"span",
|
|
214
|
+
{
|
|
215
|
+
style: {
|
|
216
|
+
display: "inline-flex",
|
|
217
|
+
alignItems: "center",
|
|
218
|
+
padding: `2px ${spacing[2]}`,
|
|
219
|
+
borderRadius: radius.full,
|
|
220
|
+
background: bg,
|
|
221
|
+
color: fg,
|
|
222
|
+
fontFamily: typography.fontFamily,
|
|
223
|
+
fontSize: typography.caption.fontSize,
|
|
224
|
+
lineHeight: typography.caption.lineHeight,
|
|
225
|
+
border: "1px solid rgba(255,255,255,0.35)",
|
|
226
|
+
backdropFilter: "blur(12px)",
|
|
227
|
+
WebkitBackdropFilter: "blur(12px)",
|
|
228
|
+
...style
|
|
229
|
+
},
|
|
230
|
+
children
|
|
231
|
+
}
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// src/design-system/components/atoms/Avatar.tsx
|
|
236
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
237
|
+
function Avatar({ src, alt = "Avatar", initials, size = 36, style }) {
|
|
238
|
+
const base = {
|
|
239
|
+
width: size,
|
|
240
|
+
height: size,
|
|
241
|
+
borderRadius: radius.full,
|
|
242
|
+
overflow: "hidden",
|
|
243
|
+
display: "inline-flex",
|
|
244
|
+
alignItems: "center",
|
|
245
|
+
justifyContent: "center",
|
|
246
|
+
background: "rgba(17,24,39,0.08)",
|
|
247
|
+
color: "rgba(17,24,39,0.75)",
|
|
248
|
+
fontFamily: typography.fontFamily,
|
|
249
|
+
fontWeight: 600,
|
|
250
|
+
fontSize: Math.max(12, Math.round(size * 0.36)),
|
|
251
|
+
lineHeight: 1,
|
|
252
|
+
...style
|
|
253
|
+
};
|
|
254
|
+
if (src) {
|
|
255
|
+
return /* @__PURE__ */ jsx4("img", { src, alt, style: { ...base, objectFit: "cover" } });
|
|
256
|
+
}
|
|
257
|
+
return /* @__PURE__ */ jsx4("span", { style: base, children: initials ?? "" });
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// src/design-system/components/atoms/IconButton.tsx
|
|
261
|
+
import * as React3 from "react";
|
|
262
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
263
|
+
var IconButton = React3.forwardRef(function IconButton2({ variant = "default", icon, size = 40, style, ...rest }, ref) {
|
|
264
|
+
const variants = {
|
|
265
|
+
default: { background: "rgba(17,24,39,0.06)", border: "1px solid rgba(17,24,39,0.10)" },
|
|
266
|
+
glass: {
|
|
267
|
+
background: colors.surface.base,
|
|
268
|
+
border: `1px solid ${colors.border.glass}`,
|
|
269
|
+
boxShadow: shadows.glass,
|
|
270
|
+
backdropFilter: "blur(18px)",
|
|
271
|
+
WebkitBackdropFilter: "blur(18px)"
|
|
272
|
+
},
|
|
273
|
+
active: { background: "rgba(0,102,161,0.14)", border: "1px solid rgba(0,102,161,0.35)" }
|
|
274
|
+
};
|
|
275
|
+
return /* @__PURE__ */ jsx5(
|
|
276
|
+
"button",
|
|
277
|
+
{
|
|
278
|
+
ref,
|
|
279
|
+
style: {
|
|
280
|
+
width: size,
|
|
281
|
+
height: size,
|
|
282
|
+
borderRadius: radius.full,
|
|
283
|
+
display: "inline-flex",
|
|
284
|
+
alignItems: "center",
|
|
285
|
+
justifyContent: "center",
|
|
286
|
+
cursor: "pointer",
|
|
287
|
+
outline: "none",
|
|
288
|
+
transition: "transform 120ms ease, box-shadow 180ms ease, background 180ms ease",
|
|
289
|
+
...variants[variant],
|
|
290
|
+
...style
|
|
291
|
+
},
|
|
292
|
+
...rest,
|
|
293
|
+
children: icon
|
|
294
|
+
}
|
|
295
|
+
);
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
// src/design-system/components/molecules/GlassCard.tsx
|
|
299
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
300
|
+
function GlassCard({ tone = "light", strength = "base", floating = false, style, ...rest }) {
|
|
301
|
+
const bg = tone === "dark" ? colors.surface.dark : strength === "strong" ? colors.surface.strong : colors.surface.base;
|
|
302
|
+
return /* @__PURE__ */ jsx6(
|
|
303
|
+
"div",
|
|
304
|
+
{
|
|
305
|
+
style: {
|
|
306
|
+
background: bg,
|
|
307
|
+
border: `1px solid ${colors.border.glass}`,
|
|
308
|
+
borderRadius: radius.xl,
|
|
309
|
+
boxShadow: floating ? shadows.floating : shadows.glass,
|
|
310
|
+
backdropFilter: "blur(18px)",
|
|
311
|
+
WebkitBackdropFilter: "blur(18px)",
|
|
312
|
+
padding: spacing[4],
|
|
313
|
+
transform: "translateZ(0)",
|
|
314
|
+
...style
|
|
315
|
+
},
|
|
316
|
+
...rest
|
|
317
|
+
}
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// src/design-system/components/molecules/StatCard.tsx
|
|
322
|
+
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
323
|
+
function StatCard({ label, value, delta, icon, tone = "light", style }) {
|
|
324
|
+
return /* @__PURE__ */ jsxs2(GlassCard, { tone, strength: "strong", style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: spacing[4], ...style }, children: [
|
|
325
|
+
/* @__PURE__ */ jsxs2("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: [
|
|
326
|
+
/* @__PURE__ */ jsx7("div", { style: { fontFamily: typography.fontFamily, fontSize: typography.caption.fontSize, lineHeight: typography.caption.lineHeight, color: colors.text.secondary }, children: label }),
|
|
327
|
+
/* @__PURE__ */ jsx7("div", { style: { fontFamily: typography.fontFamily, fontSize: typography.h1.fontSize, lineHeight: typography.h1.lineHeight, fontWeight: typography.h1.fontWeight, color: colors.text.primary }, children: value }),
|
|
328
|
+
delta ? /* @__PURE__ */ jsx7("div", { style: { fontFamily: typography.fontFamily, fontSize: typography.caption.fontSize, lineHeight: typography.caption.lineHeight, color: colors.text.secondary }, children: delta }) : null
|
|
329
|
+
] }),
|
|
330
|
+
icon ? /* @__PURE__ */ jsx7("div", { "aria-hidden": true, style: { opacity: 0.85 }, children: icon }) : null
|
|
331
|
+
] });
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// src/design-system/components/molecules/SearchBar.tsx
|
|
335
|
+
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
336
|
+
function SearchBar({ value, onChange, placeholder = "Search", onClear, leadingIcon, clearIcon }) {
|
|
337
|
+
return /* @__PURE__ */ jsxs3("div", { style: { display: "flex", alignItems: "center", gap: spacing[2] }, children: [
|
|
338
|
+
leadingIcon ? /* @__PURE__ */ jsx8("span", { "aria-hidden": true, style: { opacity: 0.8 }, children: leadingIcon }) : null,
|
|
339
|
+
/* @__PURE__ */ jsx8(
|
|
340
|
+
Input,
|
|
341
|
+
{
|
|
342
|
+
value,
|
|
343
|
+
onChange: (e) => onChange(e.target.value),
|
|
344
|
+
placeholder,
|
|
345
|
+
state: value ? "focused" : "default"
|
|
346
|
+
}
|
|
347
|
+
),
|
|
348
|
+
onClear ? /* @__PURE__ */ jsx8(
|
|
349
|
+
IconButton,
|
|
350
|
+
{
|
|
351
|
+
"aria-label": "Clear",
|
|
352
|
+
variant: "glass",
|
|
353
|
+
icon: clearIcon ?? /* @__PURE__ */ jsx8("span", { style: { fontWeight: 700 }, children: "\xD7" }),
|
|
354
|
+
onClick: onClear
|
|
355
|
+
}
|
|
356
|
+
) : null
|
|
357
|
+
] });
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// src/design-system/components/molecules/FormField.tsx
|
|
361
|
+
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
362
|
+
function FormField({ label, hint, error, children }) {
|
|
363
|
+
return /* @__PURE__ */ jsxs4("div", { style: { display: "flex", flexDirection: "column", gap: spacing[1] }, children: [
|
|
364
|
+
/* @__PURE__ */ jsx9("label", { style: { fontFamily: typography.fontFamily, fontSize: typography.caption.fontSize, lineHeight: typography.caption.lineHeight, color: colors.text.secondary }, children: label }),
|
|
365
|
+
children,
|
|
366
|
+
error ? /* @__PURE__ */ jsx9("div", { style: { fontFamily: typography.fontFamily, fontSize: typography.caption.fontSize, lineHeight: typography.caption.lineHeight, color: colors.status.error }, children: error }) : hint ? /* @__PURE__ */ jsx9("div", { style: { fontFamily: typography.fontFamily, fontSize: typography.caption.fontSize, lineHeight: typography.caption.lineHeight, color: colors.text.secondary }, children: hint }) : null
|
|
367
|
+
] });
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// src/design-system/components/molecules/Toast.tsx
|
|
371
|
+
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
372
|
+
function Toast({ title, message, variant = "info", onDismiss }) {
|
|
373
|
+
const accent = colors.status[variant];
|
|
374
|
+
return /* @__PURE__ */ jsxs5(
|
|
375
|
+
GlassCard,
|
|
376
|
+
{
|
|
377
|
+
strength: "strong",
|
|
378
|
+
floating: true,
|
|
379
|
+
role: "status",
|
|
380
|
+
"aria-live": "polite",
|
|
381
|
+
style: {
|
|
382
|
+
padding: spacing[3],
|
|
383
|
+
display: "flex",
|
|
384
|
+
gap: spacing[3],
|
|
385
|
+
alignItems: "flex-start",
|
|
386
|
+
borderLeft: `4px solid ${accent}`,
|
|
387
|
+
maxWidth: 420
|
|
388
|
+
},
|
|
389
|
+
children: [
|
|
390
|
+
/* @__PURE__ */ jsxs5("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: 4 }, children: [
|
|
391
|
+
/* @__PURE__ */ jsx10("div", { style: { fontFamily: typography.fontFamily, fontWeight: 700, color: colors.text.primary }, children: title }),
|
|
392
|
+
message ? /* @__PURE__ */ jsx10("div", { style: { fontFamily: typography.fontFamily, color: colors.text.secondary, fontSize: typography.body.fontSize, lineHeight: typography.body.lineHeight }, children: message }) : null
|
|
393
|
+
] }),
|
|
394
|
+
onDismiss ? /* @__PURE__ */ jsx10(
|
|
395
|
+
"button",
|
|
396
|
+
{
|
|
397
|
+
"aria-label": "Dismiss",
|
|
398
|
+
onClick: onDismiss,
|
|
399
|
+
style: {
|
|
400
|
+
background: "transparent",
|
|
401
|
+
border: "none",
|
|
402
|
+
cursor: "pointer",
|
|
403
|
+
fontSize: 18,
|
|
404
|
+
lineHeight: "18px",
|
|
405
|
+
padding: 0,
|
|
406
|
+
color: colors.text.secondary
|
|
407
|
+
},
|
|
408
|
+
children: "\xD7"
|
|
409
|
+
}
|
|
410
|
+
) : null
|
|
411
|
+
]
|
|
412
|
+
}
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
// src/design-system/components/organisms/AppShell.tsx
|
|
417
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
418
|
+
function AppShell({ sidebar, header, children }) {
|
|
419
|
+
return /* @__PURE__ */ jsxs6("div", { style: { display: "grid", gridTemplateColumns: sidebar ? "280px 1fr" : "1fr", minHeight: "100vh", gap: spacing[4], padding: spacing[4] }, children: [
|
|
420
|
+
sidebar ? /* @__PURE__ */ jsx11(GlassCard, { strength: "strong", style: { padding: spacing[4] }, children: sidebar }) : null,
|
|
421
|
+
/* @__PURE__ */ jsxs6("div", { style: { display: "flex", flexDirection: "column", gap: spacing[4] }, children: [
|
|
422
|
+
header ? /* @__PURE__ */ jsx11("div", { children: header }) : null,
|
|
423
|
+
/* @__PURE__ */ jsx11("div", { style: { flex: 1 }, children })
|
|
424
|
+
] })
|
|
425
|
+
] });
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// src/design-system/components/organisms/DashboardGrid.tsx
|
|
429
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
430
|
+
function DashboardGrid({ stats, main, side }) {
|
|
431
|
+
return /* @__PURE__ */ jsxs7("div", { style: { display: "flex", flexDirection: "column", gap: spacing[4] }, children: [
|
|
432
|
+
stats ? /* @__PURE__ */ jsx12("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))", gap: spacing[4] }, children: stats }) : null,
|
|
433
|
+
/* @__PURE__ */ jsxs7("div", { style: { display: "grid", gridTemplateColumns: side ? "1.4fr 0.6fr" : "1fr", gap: spacing[4], alignItems: "start" }, children: [
|
|
434
|
+
main ? /* @__PURE__ */ jsx12("div", { children: main }) : null,
|
|
435
|
+
side ? /* @__PURE__ */ jsx12("div", { children: side }) : null
|
|
436
|
+
] })
|
|
437
|
+
] });
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// src/design-system/components/organisms/Modal.tsx
|
|
441
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
442
|
+
function Modal({ open, title, children, footer, onClose }) {
|
|
443
|
+
if (!open) return null;
|
|
444
|
+
return /* @__PURE__ */ jsx13(
|
|
445
|
+
"div",
|
|
446
|
+
{
|
|
447
|
+
role: "dialog",
|
|
448
|
+
"aria-modal": "true",
|
|
449
|
+
style: {
|
|
450
|
+
position: "fixed",
|
|
451
|
+
inset: 0,
|
|
452
|
+
display: "grid",
|
|
453
|
+
placeItems: "center",
|
|
454
|
+
padding: spacing[4],
|
|
455
|
+
background: "rgba(17,24,39,0.35)",
|
|
456
|
+
backdropFilter: "blur(8px)",
|
|
457
|
+
WebkitBackdropFilter: "blur(8px)",
|
|
458
|
+
zIndex: 50
|
|
459
|
+
},
|
|
460
|
+
onMouseDown: (e) => {
|
|
461
|
+
if (e.target === e.currentTarget) onClose();
|
|
462
|
+
},
|
|
463
|
+
children: /* @__PURE__ */ jsxs8(
|
|
464
|
+
GlassCard,
|
|
465
|
+
{
|
|
466
|
+
strength: "strong",
|
|
467
|
+
floating: true,
|
|
468
|
+
style: {
|
|
469
|
+
width: "min(720px, 100%)",
|
|
470
|
+
borderRadius: radius.xl,
|
|
471
|
+
boxShadow: shadows.modal,
|
|
472
|
+
padding: spacing[4]
|
|
473
|
+
},
|
|
474
|
+
children: [
|
|
475
|
+
title ? /* @__PURE__ */ jsx13("div", { style: { marginBottom: spacing[3] }, children: title }) : null,
|
|
476
|
+
/* @__PURE__ */ jsx13("div", { style: { marginBottom: footer ? spacing[4] : 0 }, children }),
|
|
477
|
+
footer ? /* @__PURE__ */ jsx13("div", { children: footer }) : null
|
|
478
|
+
]
|
|
479
|
+
}
|
|
480
|
+
)
|
|
481
|
+
}
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// src/design-system/components/organisms/DataTable.tsx
|
|
486
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
487
|
+
function DataTable({ columns, rows, rowKey, emptyState }) {
|
|
488
|
+
return /* @__PURE__ */ jsx14(GlassCard, { strength: "strong", style: { padding: spacing[3] }, children: /* @__PURE__ */ jsx14("div", { style: { overflowX: "auto" }, children: /* @__PURE__ */ jsxs9("table", { style: { width: "100%", borderCollapse: "separate", borderSpacing: 0 }, children: [
|
|
489
|
+
/* @__PURE__ */ jsx14("thead", { children: /* @__PURE__ */ jsx14("tr", { children: columns.map((c) => /* @__PURE__ */ jsx14(
|
|
490
|
+
"th",
|
|
491
|
+
{
|
|
492
|
+
style: {
|
|
493
|
+
textAlign: "left",
|
|
494
|
+
fontFamily: typography.fontFamily,
|
|
495
|
+
fontSize: typography.caption.fontSize,
|
|
496
|
+
lineHeight: typography.caption.lineHeight,
|
|
497
|
+
color: colors.text.secondary,
|
|
498
|
+
fontWeight: 700,
|
|
499
|
+
padding: `${spacing[2]} ${spacing[2]}`,
|
|
500
|
+
borderBottom: "1px solid rgba(255,255,255,0.35)",
|
|
501
|
+
width: c.width,
|
|
502
|
+
whiteSpace: "nowrap"
|
|
503
|
+
},
|
|
504
|
+
children: c.header
|
|
505
|
+
},
|
|
506
|
+
c.key
|
|
507
|
+
)) }) }),
|
|
508
|
+
/* @__PURE__ */ jsx14("tbody", { children: rows.length === 0 ? /* @__PURE__ */ jsx14("tr", { children: /* @__PURE__ */ jsx14("td", { colSpan: columns.length, style: { padding: spacing[4] }, children: emptyState ?? /* @__PURE__ */ jsx14("div", { style: { fontFamily: typography.fontFamily, color: colors.text.secondary }, children: "No results" }) }) }) : rows.map((r) => /* @__PURE__ */ jsx14("tr", { children: columns.map((c) => /* @__PURE__ */ jsx14(
|
|
509
|
+
"td",
|
|
510
|
+
{
|
|
511
|
+
style: {
|
|
512
|
+
padding: `${spacing[2]} ${spacing[2]}`,
|
|
513
|
+
borderBottom: "1px solid rgba(255,255,255,0.22)",
|
|
514
|
+
fontFamily: typography.fontFamily,
|
|
515
|
+
color: colors.text.primary
|
|
516
|
+
},
|
|
517
|
+
children: c.render(r)
|
|
518
|
+
},
|
|
519
|
+
c.key
|
|
520
|
+
)) }, rowKey(r))) })
|
|
521
|
+
] }) }) });
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
// src/design-system/components/organisms/FormWizard.tsx
|
|
525
|
+
import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
526
|
+
function FormWizard({ steps, activeStepId, onBack, onNext, onFinish, isLast }) {
|
|
527
|
+
const active = steps.find((s) => s.id === activeStepId) ?? steps[0];
|
|
528
|
+
return /* @__PURE__ */ jsx15(GlassCard, { strength: "strong", style: { padding: spacing[4] }, children: /* @__PURE__ */ jsxs10("div", { style: { display: "flex", flexDirection: "column", gap: spacing[4] }, children: [
|
|
529
|
+
/* @__PURE__ */ jsxs10("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
530
|
+
/* @__PURE__ */ jsx15("div", { style: { fontWeight: 700 }, children: active.title }),
|
|
531
|
+
/* @__PURE__ */ jsxs10("div", { style: { opacity: 0.75 }, children: [
|
|
532
|
+
steps.findIndex((s) => s.id === active.id) + 1,
|
|
533
|
+
"/",
|
|
534
|
+
steps.length
|
|
535
|
+
] })
|
|
536
|
+
] }),
|
|
537
|
+
/* @__PURE__ */ jsx15("div", { children: active.content }),
|
|
538
|
+
/* @__PURE__ */ jsxs10("div", { style: { display: "flex", justifyContent: "space-between", gap: spacing[2] }, children: [
|
|
539
|
+
/* @__PURE__ */ jsx15(Button, { variant: "ghost", onClick: onBack, disabled: !onBack, children: "Back" }),
|
|
540
|
+
isLast ? /* @__PURE__ */ jsx15(Button, { variant: "primary", onClick: onFinish, children: "Finish" }) : /* @__PURE__ */ jsx15(Button, { variant: "primary", onClick: onNext, disabled: !onNext, children: "Next" })
|
|
541
|
+
] })
|
|
542
|
+
] }) });
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
// src/design-system/layouts/PageContainer.tsx
|
|
546
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
547
|
+
function PageContainer({ maxWidth = 1200, style, ...rest }) {
|
|
548
|
+
return /* @__PURE__ */ jsx16(
|
|
549
|
+
"div",
|
|
550
|
+
{
|
|
551
|
+
style: {
|
|
552
|
+
width: "100%",
|
|
553
|
+
maxWidth,
|
|
554
|
+
margin: "0 auto",
|
|
555
|
+
padding: spacing[4],
|
|
556
|
+
...style
|
|
557
|
+
},
|
|
558
|
+
...rest
|
|
559
|
+
}
|
|
560
|
+
);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
// src/design-system/layouts/Section.tsx
|
|
564
|
+
import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
565
|
+
function Section({ title, actions, children, style, ...rest }) {
|
|
566
|
+
return /* @__PURE__ */ jsxs11("section", { style: { display: "flex", flexDirection: "column", gap: spacing[3], ...style }, ...rest, children: [
|
|
567
|
+
title || actions ? /* @__PURE__ */ jsxs11("header", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: spacing[2] }, children: [
|
|
568
|
+
title ? /* @__PURE__ */ jsx17("div", { children: title }) : /* @__PURE__ */ jsx17("span", {}),
|
|
569
|
+
actions ? /* @__PURE__ */ jsx17("div", { children: actions }) : null
|
|
570
|
+
] }) : null,
|
|
571
|
+
children
|
|
572
|
+
] });
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
// src/design-system/layouts/Grid.tsx
|
|
576
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
577
|
+
function Grid({ columns = "repeat(auto-fit, minmax(260px, 1fr))", gap = 4, style, ...rest }) {
|
|
578
|
+
return /* @__PURE__ */ jsx18(
|
|
579
|
+
"div",
|
|
580
|
+
{
|
|
581
|
+
style: {
|
|
582
|
+
display: "grid",
|
|
583
|
+
gridTemplateColumns: columns,
|
|
584
|
+
gap: spacing[gap],
|
|
585
|
+
...style
|
|
586
|
+
},
|
|
587
|
+
...rest
|
|
588
|
+
}
|
|
589
|
+
);
|
|
590
|
+
}
|
|
591
|
+
export {
|
|
592
|
+
AppShell,
|
|
593
|
+
Avatar,
|
|
594
|
+
Badge,
|
|
595
|
+
Button,
|
|
596
|
+
DashboardGrid,
|
|
597
|
+
DataTable,
|
|
598
|
+
FormField,
|
|
599
|
+
FormWizard,
|
|
600
|
+
GlassCard,
|
|
601
|
+
Grid,
|
|
602
|
+
IconButton,
|
|
603
|
+
Input,
|
|
604
|
+
Modal,
|
|
605
|
+
PageContainer,
|
|
606
|
+
SearchBar,
|
|
607
|
+
Section,
|
|
608
|
+
StatCard,
|
|
609
|
+
Toast,
|
|
610
|
+
colors,
|
|
611
|
+
radius,
|
|
612
|
+
shadows,
|
|
613
|
+
spacing,
|
|
614
|
+
typography
|
|
615
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "apple-liquid-glass-react-ui-kit",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"main": "dist/index.cjs.js",
|
|
5
|
+
"module": "dist/index.esm.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"peerDependencies": {
|
|
11
|
+
"react": "^19.2.6"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsup src/design-system/index.ts --format esm,cjs --dts --out-dir dist"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/react": "^19.2.14",
|
|
18
|
+
"tsup": "^8.5.1",
|
|
19
|
+
"typescript": "^6.0.3"
|
|
20
|
+
}
|
|
21
|
+
}
|