@ug666/ui-react 0.1.0 → 0.3.0-beta.1
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/aliases.d.ts +59 -0
- package/dist/aliases.d.ts.map +1 -0
- package/dist/blocks/feature-grid.d.ts +40 -0
- package/dist/blocks/feature-grid.d.ts.map +1 -0
- package/dist/blocks/index.cjs +467 -0
- package/dist/blocks/index.cjs.map +1 -0
- package/dist/blocks/index.d.ts +8 -0
- package/dist/blocks/index.d.ts.map +1 -0
- package/dist/blocks/index.js +194 -0
- package/dist/blocks/index.js.map +1 -0
- package/dist/blocks/landing-hero.d.ts +55 -0
- package/dist/blocks/landing-hero.d.ts.map +1 -0
- package/dist/chunk-AKWJMDCW.js +467 -0
- package/dist/chunk-AKWJMDCW.js.map +1 -0
- package/dist/chunk-F23X4N6B.js +11 -0
- package/dist/chunk-F23X4N6B.js.map +1 -0
- package/dist/chunk-HGO3GZ56.js +1777 -0
- package/dist/chunk-HGO3GZ56.js.map +1 -0
- package/dist/chunk-HXIWD5LQ.js +319 -0
- package/dist/chunk-HXIWD5LQ.js.map +1 -0
- package/dist/chunk-M6J4PLF4.js +521 -0
- package/dist/chunk-M6J4PLF4.js.map +1 -0
- package/dist/chunk-N3Z7R6GG.js +139 -0
- package/dist/chunk-N3Z7R6GG.js.map +1 -0
- package/dist/chunk-UXWCK6M7.js +5757 -0
- package/dist/chunk-UXWCK6M7.js.map +1 -0
- package/dist/components/accordion.d.ts +59 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/alert.d.ts +23 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/avatar-group.d.ts +20 -0
- package/dist/components/avatar-group.d.ts.map +1 -0
- package/dist/components/avatar.d.ts +34 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/badge.d.ts +17 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/breadcrumb.d.ts +33 -0
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/button-group.d.ts +26 -0
- package/dist/components/button-group.d.ts.map +1 -0
- package/dist/components/button.d.ts +43 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/card.d.ts +26 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/checkbox-group-context.d.ts +14 -0
- package/dist/components/checkbox-group-context.d.ts.map +1 -0
- package/dist/components/checkbox-group.d.ts +18 -0
- package/dist/components/checkbox-group.d.ts.map +1 -0
- package/dist/components/checkbox.d.ts +32 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/config-provider.d.ts +29 -0
- package/dist/components/config-provider.d.ts.map +1 -0
- package/dist/components/container.d.ts +27 -0
- package/dist/components/container.d.ts.map +1 -0
- package/dist/components/context/form-context.d.ts +41 -0
- package/dist/components/context/form-context.d.ts.map +1 -0
- package/dist/components/context-menu.d.ts +39 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/descriptions.d.ts +40 -0
- package/dist/components/descriptions.d.ts.map +1 -0
- package/dist/components/dialog.d.ts +55 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/drawer.d.ts +38 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/dropdown.d.ts +42 -0
- package/dist/components/dropdown.d.ts.map +1 -0
- package/dist/components/empty-state.d.ts +24 -0
- package/dist/components/empty-state.d.ts.map +1 -0
- package/dist/components/form.d.ts +127 -0
- package/dist/components/form.d.ts.map +1 -0
- package/dist/components/icon.d.ts +16 -0
- package/dist/components/icon.d.ts.map +1 -0
- package/dist/components/index.cjs +8684 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.d.ts +60 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +391 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/input.d.ts +28 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/label.d.ts +18 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/layout.d.ts +34 -0
- package/dist/components/layout.d.ts.map +1 -0
- package/dist/components/link.d.ts +18 -0
- package/dist/components/link.d.ts.map +1 -0
- package/dist/components/modal.d.ts +46 -0
- package/dist/components/modal.d.ts.map +1 -0
- package/dist/components/navigation-menu.d.ts +39 -0
- package/dist/components/navigation-menu.d.ts.map +1 -0
- package/dist/components/number-input.d.ts +35 -0
- package/dist/components/number-input.d.ts.map +1 -0
- package/dist/components/otp-input.d.ts +35 -0
- package/dist/components/otp-input.d.ts.map +1 -0
- package/dist/components/pagination.d.ts +16 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/popover.d.ts +36 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/progress.d.ts +21 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/radio.d.ts +68 -0
- package/dist/components/radio.d.ts.map +1 -0
- package/dist/components/scrollbar.d.ts +29 -0
- package/dist/components/scrollbar.d.ts.map +1 -0
- package/dist/components/select.d.ts +48 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/separator.d.ts +28 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/sheet.d.ts +24 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sidebar.d.ts +48 -0
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/components/skeleton.d.ts +16 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/slider.d.ts +44 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/space.d.ts +19 -0
- package/dist/components/space.d.ts.map +1 -0
- package/dist/components/spinner.d.ts +18 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/splitter.d.ts +51 -0
- package/dist/components/splitter.d.ts.map +1 -0
- package/dist/components/statistic.d.ts +30 -0
- package/dist/components/statistic.d.ts.map +1 -0
- package/dist/components/steps.d.ts +33 -0
- package/dist/components/steps.d.ts.map +1 -0
- package/dist/components/switch.d.ts +49 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/table.d.ts +32 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/tabs.d.ts +27 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tag.d.ts +27 -0
- package/dist/components/tag.d.ts.map +1 -0
- package/dist/components/text.d.ts +16 -0
- package/dist/components/text.d.ts.map +1 -0
- package/dist/components/textarea.d.ts +26 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/toast.d.ts +26 -0
- package/dist/components/toast.d.ts.map +1 -0
- package/dist/components/tooltip.d.ts +29 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/hooks/index.cjs +229 -27
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +19 -231
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +2 -1
- package/dist/hooks/use-click-outside.d.ts +9 -0
- package/dist/hooks/use-click-outside.d.ts.map +1 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +12 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -0
- package/dist/hooks/use-debounce.d.ts +7 -0
- package/dist/hooks/use-debounce.d.ts.map +1 -0
- package/dist/hooks/use-escape-key.d.ts +10 -0
- package/dist/hooks/use-escape-key.d.ts.map +1 -0
- package/dist/hooks/use-event-listener.d.ts +28 -0
- package/dist/hooks/use-event-listener.d.ts.map +1 -0
- package/dist/hooks/use-form.d.ts +48 -0
- package/dist/hooks/use-form.d.ts.map +1 -0
- package/dist/hooks/use-hotkeys.d.ts +30 -0
- package/dist/hooks/use-hotkeys.d.ts.map +1 -0
- package/dist/hooks/use-interval.d.ts +19 -0
- package/dist/hooks/use-interval.d.ts.map +1 -0
- package/dist/hooks/use-local-storage.d.ts +9 -0
- package/dist/hooks/use-local-storage.d.ts.map +1 -0
- package/dist/hooks/use-media-query.d.ts +8 -0
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-mounted.d.ts +18 -0
- package/dist/hooks/use-mounted.d.ts.map +1 -0
- package/dist/hooks/use-pagination.d.ts +36 -0
- package/dist/hooks/use-pagination.d.ts.map +1 -0
- package/dist/hooks/use-timeout.d.ts +19 -0
- package/dist/hooks/use-timeout.d.ts.map +1 -0
- package/dist/hooks/use-toggle.d.ts +9 -0
- package/dist/hooks/use-toggle.d.ts.map +1 -0
- package/dist/index.cjs +7017 -1610
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +74 -1361
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +281 -3245
- package/dist/index.js.map +1 -1
- package/dist/internal/button-group-context.d.ts +11 -0
- package/dist/internal/button-group-context.d.ts.map +1 -0
- package/dist/internal/cn.d.ts +8 -0
- package/dist/internal/cn.d.ts.map +1 -0
- package/dist/internal/use-overlay-focus.d.ts +8 -0
- package/dist/internal/use-overlay-focus.d.ts.map +1 -0
- package/dist/internal/use-portal-container.d.ts +2 -0
- package/dist/internal/use-portal-container.d.ts.map +1 -0
- package/dist/labs/file-preview.d.ts +44 -0
- package/dist/labs/file-preview.d.ts.map +1 -0
- package/dist/labs/index.cjs +224 -0
- package/dist/labs/index.cjs.map +1 -0
- package/dist/labs/index.d.ts +14 -0
- package/dist/labs/index.d.ts.map +1 -0
- package/dist/labs/index.js +188 -0
- package/dist/labs/index.js.map +1 -0
- package/dist/labs/model-card.d.ts +50 -0
- package/dist/labs/model-card.d.ts.map +1 -0
- package/dist/patterns/admin-shell.d.ts +52 -0
- package/dist/patterns/admin-shell.d.ts.map +1 -0
- package/dist/patterns/confirm-dialog.d.ts +50 -0
- package/dist/patterns/confirm-dialog.d.ts.map +1 -0
- package/dist/patterns/copy-field.d.ts +29 -0
- package/dist/patterns/copy-field.d.ts.map +1 -0
- package/dist/patterns/index.cjs +1206 -0
- package/dist/patterns/index.cjs.map +1 -0
- package/dist/patterns/index.d.ts +5 -0
- package/dist/patterns/index.d.ts.map +1 -0
- package/dist/patterns/index.js +375 -0
- package/dist/patterns/index.js.map +1 -0
- package/dist/patterns/page-header.d.ts +37 -0
- package/dist/patterns/page-header.d.ts.map +1 -0
- package/dist/primitives/index.cjs +2161 -0
- package/dist/primitives/index.cjs.map +1 -0
- package/dist/primitives/index.d.ts +24 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +107 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/styles.css +4365 -0
- package/dist/theme.cjs +161 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.ts +39 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +19 -0
- package/dist/theme.js.map +1 -0
- package/dist/themes/default.css +80 -0
- package/dist/themes/mecha.css +195 -0
- package/dist/themes/minimal.css +160 -0
- package/dist/tokens.css +1241 -9
- package/package.json +54 -14
- package/dist/chunk-MGXIF756.js +0 -313
- package/dist/chunk-MGXIF756.js.map +0 -1
- package/dist/hooks/index.d.cts +0 -232
- package/dist/index.d.cts +0 -1363
package/dist/theme.cjs
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/theme.ts
|
|
21
|
+
var theme_exports = {};
|
|
22
|
+
__export(theme_exports, {
|
|
23
|
+
UGThemeProvider: () => UGThemeProvider,
|
|
24
|
+
UGThemeScope: () => UGThemeScope,
|
|
25
|
+
UGThemeSurface: () => UGThemeSurface,
|
|
26
|
+
defaultUGTheme: () => import_theme.defaultUGTheme,
|
|
27
|
+
getUGThemeDataAttributes: () => import_theme2.getUGThemeDataAttributes,
|
|
28
|
+
theme: () => import_theme2.theme,
|
|
29
|
+
useUGTheme: () => useUGTheme
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(theme_exports);
|
|
32
|
+
var import_react = require("react");
|
|
33
|
+
var import_theme = require("@ug666/ui-core/theme");
|
|
34
|
+
var import_theme2 = require("@ug666/ui-web/theme");
|
|
35
|
+
var UGThemeContext = (0, import_react.createContext)(import_theme.defaultUGTheme);
|
|
36
|
+
function useUGTheme() {
|
|
37
|
+
return (0, import_react.useContext)(UGThemeContext);
|
|
38
|
+
}
|
|
39
|
+
var UGThemeProvider = (0, import_react.forwardRef)(
|
|
40
|
+
({
|
|
41
|
+
preset = import_theme.defaultUGTheme.preset,
|
|
42
|
+
mode = import_theme.defaultUGTheme.mode,
|
|
43
|
+
surface = import_theme.defaultUGTheme.surface,
|
|
44
|
+
density = import_theme.defaultUGTheme.density,
|
|
45
|
+
radius = import_theme.defaultUGTheme.radius,
|
|
46
|
+
shadow = import_theme.defaultUGTheme.shadow,
|
|
47
|
+
font = import_theme.defaultUGTheme.font,
|
|
48
|
+
contrast = import_theme.defaultUGTheme.contrast,
|
|
49
|
+
motion = import_theme.defaultUGTheme.motion,
|
|
50
|
+
background = import_theme.defaultUGTheme.background,
|
|
51
|
+
accent = import_theme.defaultUGTheme.accent,
|
|
52
|
+
children,
|
|
53
|
+
...props
|
|
54
|
+
}, ref) => {
|
|
55
|
+
const value = {
|
|
56
|
+
preset,
|
|
57
|
+
mode,
|
|
58
|
+
surface,
|
|
59
|
+
density,
|
|
60
|
+
radius,
|
|
61
|
+
shadow,
|
|
62
|
+
font,
|
|
63
|
+
contrast,
|
|
64
|
+
motion,
|
|
65
|
+
background,
|
|
66
|
+
accent
|
|
67
|
+
};
|
|
68
|
+
return (0, import_react.createElement)(
|
|
69
|
+
UGThemeContext.Provider,
|
|
70
|
+
{ value },
|
|
71
|
+
(0, import_react.createElement)("div", {
|
|
72
|
+
...props,
|
|
73
|
+
...(0, import_theme2.getUGThemeDataAttributes)(value),
|
|
74
|
+
ref,
|
|
75
|
+
children
|
|
76
|
+
})
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
UGThemeProvider.displayName = "UGThemeProvider";
|
|
81
|
+
var UGThemeScope = (0, import_react.forwardRef)(
|
|
82
|
+
({
|
|
83
|
+
preset,
|
|
84
|
+
mode,
|
|
85
|
+
surface,
|
|
86
|
+
density,
|
|
87
|
+
radius,
|
|
88
|
+
shadow,
|
|
89
|
+
font,
|
|
90
|
+
contrast,
|
|
91
|
+
motion,
|
|
92
|
+
background,
|
|
93
|
+
accent,
|
|
94
|
+
children,
|
|
95
|
+
...props
|
|
96
|
+
}, ref) => {
|
|
97
|
+
const parent = useUGTheme();
|
|
98
|
+
const value = (0, import_theme.createUGThemeValue)(parent, {
|
|
99
|
+
preset,
|
|
100
|
+
mode,
|
|
101
|
+
surface,
|
|
102
|
+
density,
|
|
103
|
+
radius,
|
|
104
|
+
shadow,
|
|
105
|
+
font,
|
|
106
|
+
contrast,
|
|
107
|
+
motion,
|
|
108
|
+
background,
|
|
109
|
+
accent
|
|
110
|
+
});
|
|
111
|
+
return (0, import_react.createElement)(
|
|
112
|
+
UGThemeContext.Provider,
|
|
113
|
+
{ value },
|
|
114
|
+
(0, import_react.createElement)("div", {
|
|
115
|
+
...props,
|
|
116
|
+
...(0, import_theme2.getUGThemeDataAttributes)(value),
|
|
117
|
+
ref,
|
|
118
|
+
children
|
|
119
|
+
})
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
UGThemeScope.displayName = "UGThemeScope";
|
|
124
|
+
var UGThemeSurface = (0, import_react.forwardRef)(
|
|
125
|
+
({ surface = "workspace", density, radius, shadow, font, contrast, motion, background, accent, children, ...props }, ref) => {
|
|
126
|
+
const parent = useUGTheme();
|
|
127
|
+
const value = (0, import_theme.createUGThemeValue)(parent, {
|
|
128
|
+
surface,
|
|
129
|
+
density,
|
|
130
|
+
radius,
|
|
131
|
+
shadow,
|
|
132
|
+
font,
|
|
133
|
+
contrast,
|
|
134
|
+
motion,
|
|
135
|
+
background,
|
|
136
|
+
accent
|
|
137
|
+
});
|
|
138
|
+
return (0, import_react.createElement)(
|
|
139
|
+
UGThemeContext.Provider,
|
|
140
|
+
{ value },
|
|
141
|
+
(0, import_react.createElement)("div", {
|
|
142
|
+
...props,
|
|
143
|
+
...(0, import_theme2.getUGThemeDataAttributes)(value),
|
|
144
|
+
ref,
|
|
145
|
+
children
|
|
146
|
+
})
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
UGThemeSurface.displayName = "UGThemeSurface";
|
|
151
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
152
|
+
0 && (module.exports = {
|
|
153
|
+
UGThemeProvider,
|
|
154
|
+
UGThemeScope,
|
|
155
|
+
UGThemeSurface,
|
|
156
|
+
defaultUGTheme,
|
|
157
|
+
getUGThemeDataAttributes,
|
|
158
|
+
theme,
|
|
159
|
+
useUGTheme
|
|
160
|
+
});
|
|
161
|
+
//# sourceMappingURL=theme.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/theme.ts"],"sourcesContent":["/**\n * @description: 主题运行时与 token 映射 — 管理 UG theme / surface / density scope\n * @author: UG - 一个斗码大陆苦逼的三段码之气的少年,并没有神秘戒指中码老的帮助,但总有一天,我会成为斗码大陆中码帝一样的存在。三十年河东,三十年河西,莫欺少年穷。\n * @date: 2026-04-15\n */\nimport {\n createContext,\n createElement,\n forwardRef,\n useContext,\n type HTMLAttributes,\n} from 'react'\nimport {\n createUGThemeValue,\n defaultUGTheme,\n type UGThemeAccent,\n type UGThemeBackground,\n type UGThemeContextValue,\n type UGThemeContrast,\n type UGThemeDensity,\n type UGThemeFont,\n type UGThemeMode,\n type UGThemeMotion,\n type UGThemePreset,\n type UGThemeRadius,\n type UGThemeShadow,\n type UGThemeSurfaceValue,\n} from '@ug666/ui-core/theme'\nimport { getUGThemeDataAttributes, theme } from '@ug666/ui-web/theme'\n\nexport { defaultUGTheme }\nexport { getUGThemeDataAttributes, theme }\nexport type {\n UGThemeAccent,\n UGThemeBackground,\n UGThemeContextValue,\n UGThemeContrast,\n UGThemeDensity,\n UGThemeFont,\n UGThemeMode,\n UGThemeMotion,\n UGThemePreset,\n UGThemeRadius,\n UGThemeShadow,\n UGThemeSurfaceValue,\n} from '@ug666/ui-core/theme'\nexport type { Theme, UGThemeDataAttributes } from '@ug666/ui-web/theme'\n\nexport interface UGThemeStyleProps {\n readonly shadow?: UGThemeShadow\n readonly font?: UGThemeFont\n readonly contrast?: UGThemeContrast\n readonly motion?: UGThemeMotion\n readonly background?: UGThemeBackground\n readonly accent?: UGThemeAccent\n}\n\nexport interface UGThemeProviderProps extends HTMLAttributes<HTMLDivElement>, UGThemeStyleProps {\n readonly preset?: UGThemePreset\n readonly mode?: UGThemeMode\n readonly surface?: UGThemeSurfaceValue\n readonly density?: UGThemeDensity\n readonly radius?: UGThemeRadius\n}\n\nexport interface UGThemeScopeProps extends UGThemeProviderProps {}\n\nexport interface UGThemeSurfaceProps extends HTMLAttributes<HTMLDivElement>, UGThemeStyleProps {\n readonly surface?: UGThemeSurfaceValue\n readonly density?: UGThemeDensity\n readonly radius?: UGThemeRadius\n}\n\nconst UGThemeContext = createContext<UGThemeContextValue>(defaultUGTheme)\n\nexport function useUGTheme(): UGThemeContextValue {\n return useContext(UGThemeContext)\n}\n\nexport const UGThemeProvider = forwardRef<HTMLDivElement, UGThemeProviderProps>(\n (\n {\n preset = defaultUGTheme.preset,\n mode = defaultUGTheme.mode,\n surface = defaultUGTheme.surface,\n density = defaultUGTheme.density,\n radius = defaultUGTheme.radius,\n shadow = defaultUGTheme.shadow,\n font = defaultUGTheme.font,\n contrast = defaultUGTheme.contrast,\n motion = defaultUGTheme.motion,\n background = defaultUGTheme.background,\n accent = defaultUGTheme.accent,\n children,\n ...props\n },\n ref,\n ) => {\n const value: UGThemeContextValue = {\n preset,\n mode,\n surface,\n density,\n radius,\n shadow,\n font,\n contrast,\n motion,\n background,\n accent,\n }\n\n return createElement(\n UGThemeContext.Provider,\n { value },\n createElement('div', {\n ...props,\n ...getUGThemeDataAttributes(value),\n ref,\n children,\n }),\n )\n },\n)\n\nUGThemeProvider.displayName = 'UGThemeProvider'\n\nexport const UGThemeScope = forwardRef<HTMLDivElement, UGThemeScopeProps>(\n (\n {\n preset,\n mode,\n surface,\n density,\n radius,\n shadow,\n font,\n contrast,\n motion,\n background,\n accent,\n children,\n ...props\n },\n ref,\n ) => {\n const parent = useUGTheme()\n const value = createUGThemeValue(parent, {\n preset,\n mode,\n surface,\n density,\n radius,\n shadow,\n font,\n contrast,\n motion,\n background,\n accent,\n })\n\n return createElement(\n UGThemeContext.Provider,\n { value },\n createElement('div', {\n ...props,\n ...getUGThemeDataAttributes(value),\n ref,\n children,\n }),\n )\n },\n)\n\nUGThemeScope.displayName = 'UGThemeScope'\n\nexport const UGThemeSurface = forwardRef<HTMLDivElement, UGThemeSurfaceProps>(\n ({ surface = 'workspace', density, radius, shadow, font, contrast, motion, background, accent, children, ...props }, ref) => {\n const parent = useUGTheme()\n const value = createUGThemeValue(parent, {\n surface,\n density,\n radius,\n shadow,\n font,\n contrast,\n motion,\n background,\n accent,\n })\n\n return createElement(\n UGThemeContext.Provider,\n { value },\n createElement('div', {\n ...props,\n ...getUGThemeDataAttributes(value),\n ref,\n children,\n }),\n )\n },\n)\n\nUGThemeSurface.displayName = 'UGThemeSurface'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,mBAMO;AACP,mBAeO;AACP,IAAAA,gBAAgD;AA6ChD,IAAM,qBAAiB,4BAAmC,2BAAc;AAEjE,SAAS,aAAkC;AAChD,aAAO,yBAAW,cAAc;AAClC;AAEO,IAAM,sBAAkB;AAAA,EAC7B,CACE;AAAA,IACE,SAAS,4BAAe;AAAA,IACxB,OAAO,4BAAe;AAAA,IACtB,UAAU,4BAAe;AAAA,IACzB,UAAU,4BAAe;AAAA,IACzB,SAAS,4BAAe;AAAA,IACxB,SAAS,4BAAe;AAAA,IACxB,OAAO,4BAAe;AAAA,IACtB,WAAW,4BAAe;AAAA,IAC1B,SAAS,4BAAe;AAAA,IACxB,aAAa,4BAAe;AAAA,IAC5B,SAAS,4BAAe;AAAA,IACxB;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,QAA6B;AAAA,MACjC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAEA,eAAO;AAAA,MACL,eAAe;AAAA,MACf,EAAE,MAAM;AAAA,UACR,4BAAc,OAAO;AAAA,QACnB,GAAG;AAAA,QACH,OAAG,wCAAyB,KAAK;AAAA,QACjC;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAEA,gBAAgB,cAAc;AAEvB,IAAM,mBAAe;AAAA,EAC1B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,SAAS,WAAW;AAC1B,UAAM,YAAQ,iCAAmB,QAAQ;AAAA,MACvC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAED,eAAO;AAAA,MACL,eAAe;AAAA,MACf,EAAE,MAAM;AAAA,UACR,4BAAc,OAAO;AAAA,QACnB,GAAG;AAAA,QACH,OAAG,wCAAyB,KAAK;AAAA,QACjC;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAEA,aAAa,cAAc;AAEpB,IAAM,qBAAiB;AAAA,EAC5B,CAAC,EAAE,UAAU,aAAa,SAAS,QAAQ,QAAQ,MAAM,UAAU,QAAQ,YAAY,QAAQ,UAAU,GAAG,MAAM,GAAG,QAAQ;AAC3H,UAAM,SAAS,WAAW;AAC1B,UAAM,YAAQ,iCAAmB,QAAQ;AAAA,MACvC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAED,eAAO;AAAA,MACL,eAAe;AAAA,MACf,EAAE,MAAM;AAAA,UACR,4BAAc,OAAO;AAAA,QACnB,GAAG;AAAA,QACH,OAAG,wCAAyB,KAAK;AAAA,QACjC;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAEA,eAAe,cAAc;","names":["import_theme"]}
|
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description: 主题运行时与 token 映射 — 管理 UG theme / surface / density scope
|
|
3
|
+
* @author: UG - 一个斗码大陆苦逼的三段码之气的少年,并没有神秘戒指中码老的帮助,但总有一天,我会成为斗码大陆中码帝一样的存在。三十年河东,三十年河西,莫欺少年穷。
|
|
4
|
+
* @date: 2026-04-15
|
|
5
|
+
*/
|
|
6
|
+
import { type HTMLAttributes } from 'react';
|
|
7
|
+
import { defaultUGTheme, type UGThemeAccent, type UGThemeBackground, type UGThemeContextValue, type UGThemeContrast, type UGThemeDensity, type UGThemeFont, type UGThemeMode, type UGThemeMotion, type UGThemePreset, type UGThemeRadius, type UGThemeShadow, type UGThemeSurfaceValue } from '@ug666/ui-core/theme';
|
|
8
|
+
import { getUGThemeDataAttributes, theme } from '@ug666/ui-web/theme';
|
|
9
|
+
export { defaultUGTheme };
|
|
10
|
+
export { getUGThemeDataAttributes, theme };
|
|
11
|
+
export type { UGThemeAccent, UGThemeBackground, UGThemeContextValue, UGThemeContrast, UGThemeDensity, UGThemeFont, UGThemeMode, UGThemeMotion, UGThemePreset, UGThemeRadius, UGThemeShadow, UGThemeSurfaceValue, } from '@ug666/ui-core/theme';
|
|
12
|
+
export type { Theme, UGThemeDataAttributes } from '@ug666/ui-web/theme';
|
|
13
|
+
export interface UGThemeStyleProps {
|
|
14
|
+
readonly shadow?: UGThemeShadow;
|
|
15
|
+
readonly font?: UGThemeFont;
|
|
16
|
+
readonly contrast?: UGThemeContrast;
|
|
17
|
+
readonly motion?: UGThemeMotion;
|
|
18
|
+
readonly background?: UGThemeBackground;
|
|
19
|
+
readonly accent?: UGThemeAccent;
|
|
20
|
+
}
|
|
21
|
+
export interface UGThemeProviderProps extends HTMLAttributes<HTMLDivElement>, UGThemeStyleProps {
|
|
22
|
+
readonly preset?: UGThemePreset;
|
|
23
|
+
readonly mode?: UGThemeMode;
|
|
24
|
+
readonly surface?: UGThemeSurfaceValue;
|
|
25
|
+
readonly density?: UGThemeDensity;
|
|
26
|
+
readonly radius?: UGThemeRadius;
|
|
27
|
+
}
|
|
28
|
+
export interface UGThemeScopeProps extends UGThemeProviderProps {
|
|
29
|
+
}
|
|
30
|
+
export interface UGThemeSurfaceProps extends HTMLAttributes<HTMLDivElement>, UGThemeStyleProps {
|
|
31
|
+
readonly surface?: UGThemeSurfaceValue;
|
|
32
|
+
readonly density?: UGThemeDensity;
|
|
33
|
+
readonly radius?: UGThemeRadius;
|
|
34
|
+
}
|
|
35
|
+
export declare function useUGTheme(): UGThemeContextValue;
|
|
36
|
+
export declare const UGThemeProvider: import("react").ForwardRefExoticComponent<UGThemeProviderProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
37
|
+
export declare const UGThemeScope: import("react").ForwardRefExoticComponent<UGThemeScopeProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
38
|
+
export declare const UGThemeSurface: import("react").ForwardRefExoticComponent<UGThemeSurfaceProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
39
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,OAAO,CAAA;AACd,OAAO,EAEL,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACzB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,wBAAwB,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAErE,OAAO,EAAE,cAAc,EAAE,CAAA;AACzB,OAAO,EAAE,wBAAwB,EAAE,KAAK,EAAE,CAAA;AAC1C,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,mBAAmB,GACpB,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAEvE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAA;IAC/B,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAA;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAA;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAA;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,iBAAiB,CAAA;IACvC,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAA;CAChC;AAED,MAAM,WAAW,oBAAqB,SAAQ,cAAc,CAAC,cAAc,CAAC,EAAE,iBAAiB;IAC7F,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAA;IAC/B,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAA;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAA;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,CAAA;IACjC,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAA;CAChC;AAED,MAAM,WAAW,iBAAkB,SAAQ,oBAAoB;CAAG;AAElE,MAAM,WAAW,mBAAoB,SAAQ,cAAc,CAAC,cAAc,CAAC,EAAE,iBAAiB;IAC5F,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAA;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,CAAA;IACjC,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAA;CAChC;AAID,wBAAgB,UAAU,IAAI,mBAAmB,CAEhD;AAED,eAAO,MAAM,eAAe,iHA4C3B,CAAA;AAID,eAAO,MAAM,YAAY,8GA6CxB,CAAA;AAID,eAAO,MAAM,cAAc,gHA0B1B,CAAA"}
|
package/dist/theme.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
UGThemeProvider,
|
|
3
|
+
UGThemeScope,
|
|
4
|
+
UGThemeSurface,
|
|
5
|
+
defaultUGTheme,
|
|
6
|
+
getUGThemeDataAttributes,
|
|
7
|
+
theme,
|
|
8
|
+
useUGTheme
|
|
9
|
+
} from "./chunk-N3Z7R6GG.js";
|
|
10
|
+
export {
|
|
11
|
+
UGThemeProvider,
|
|
12
|
+
UGThemeScope,
|
|
13
|
+
UGThemeSurface,
|
|
14
|
+
defaultUGTheme,
|
|
15
|
+
getUGThemeDataAttributes,
|
|
16
|
+
theme,
|
|
17
|
+
useUGTheme
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description: UG UI default 主题骨架 — 复用基础 token,仅声明主题 scope 默认值
|
|
3
|
+
* @author: UG - 一个斗码大陆苦逼的三段码之气的少年,并没有神秘戒指中码老的帮助,但总有一天,我会成为斗码大陆中码帝一样的存在。三十年河东,三十年河西,莫欺少年穷。
|
|
4
|
+
* @date: 2026-06-16
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
:root[data-ug-theme='default'],
|
|
8
|
+
:where([data-ug-theme='default']) {
|
|
9
|
+
--font-sans: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", ui-sans-serif, system-ui, sans-serif;
|
|
10
|
+
--font-mono: "Cascadia Mono", "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
|
|
11
|
+
--control-border-width: 1px;
|
|
12
|
+
--ug-button-bg-image: none;
|
|
13
|
+
--ug-button-border-image: none;
|
|
14
|
+
--ug-card-texture-image: none;
|
|
15
|
+
--ug-panel-noise-image: none;
|
|
16
|
+
--ug-focus-ring-image: none;
|
|
17
|
+
--ug-control-surface: hsl(var(--surface-1));
|
|
18
|
+
--ug-control-surface-hover: hsl(var(--surface-2));
|
|
19
|
+
--ug-control-surface-active: hsl(var(--surface-3));
|
|
20
|
+
--ug-control-border: hsl(var(--border-strong));
|
|
21
|
+
--ug-control-border-hover: hsl(var(--primary) / 0.6);
|
|
22
|
+
--ug-panel-border: hsl(var(--border-base));
|
|
23
|
+
--ug-panel-surface: hsl(var(--surface-1));
|
|
24
|
+
--ug-panel-surface-muted: hsl(var(--surface-2));
|
|
25
|
+
--ug-focus-ring-shadow: 0 0 0 3px hsl(var(--ring) / 0.22);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:where(
|
|
29
|
+
.dark [data-ug-theme='default'],
|
|
30
|
+
[data-ug-theme='default'].dark,
|
|
31
|
+
[data-ug-mode='dark'] [data-ug-theme='default'],
|
|
32
|
+
[data-ug-theme='default'][data-ug-mode='dark']
|
|
33
|
+
) {
|
|
34
|
+
--text-primary: 0 0% 100%;
|
|
35
|
+
--overlay-alpha: 0.7;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:where(
|
|
39
|
+
[data-ug-mode='light'] [data-ug-theme='default'],
|
|
40
|
+
[data-ug-theme='default'][data-ug-mode='light'],
|
|
41
|
+
[data-ug-mode='system'] [data-ug-theme='default'],
|
|
42
|
+
[data-ug-theme='default'][data-ug-mode='system']
|
|
43
|
+
) {
|
|
44
|
+
--overlay-alpha: 0.5;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@media (prefers-color-scheme: dark) {
|
|
48
|
+
:where(
|
|
49
|
+
[data-ug-mode='system'] [data-ug-theme='default'],
|
|
50
|
+
[data-ug-theme='default'][data-ug-mode='system']
|
|
51
|
+
) {
|
|
52
|
+
--text-primary: 0 0% 100%;
|
|
53
|
+
--overlay-alpha: 0.7;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:where([data-ug-theme='default'][data-ug-surface='workspace']) {
|
|
58
|
+
--section-gap: 1.75rem;
|
|
59
|
+
--page-max-width: 72rem;
|
|
60
|
+
--docs-wide-max-width: 100rem;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:where([data-ug-theme='default'][data-ug-surface='showcase']) {
|
|
64
|
+
--section-gap: 2.5rem;
|
|
65
|
+
--page-max-width: 76rem;
|
|
66
|
+
--docs-wide-max-width: 104rem;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:where([data-ug-theme='default'][data-ug-surface='auth']) {
|
|
70
|
+
--page-max-width: 28rem;
|
|
71
|
+
--docs-wide-max-width: 52rem;
|
|
72
|
+
--radius-panel: 0.75rem;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:where([data-ug-theme='default'][data-ug-surface='content']) {
|
|
76
|
+
--section-gap: 2.125rem;
|
|
77
|
+
--content-gap: 1.125rem;
|
|
78
|
+
--page-max-width: 64rem;
|
|
79
|
+
--docs-wide-max-width: 88rem;
|
|
80
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description: UG UI mecha 主题骨架 — 保留轻量入口,仅声明机械感 token
|
|
3
|
+
* @author: UG - 一个斗码大陆苦逼的三段码之气的少年,并没有神秘戒指中码老的帮助,但总有一天,我会成为斗码大陆中码帝一样的存在。三十年河东,三十年河西,莫欺少年穷。
|
|
4
|
+
* @date: 2026-06-16
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
:where([data-ug-theme='mecha']) {
|
|
8
|
+
--font-sans: "Bahnschrift", "DIN Alternate", "Microsoft YaHei UI", "PingFang SC", ui-sans-serif, system-ui, sans-serif;
|
|
9
|
+
--font-mono: "Cascadia Mono", "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
|
|
10
|
+
--surface-0: 214 30% 96%;
|
|
11
|
+
--surface-1: 210 22% 99%;
|
|
12
|
+
--surface-2: 212 24% 94%;
|
|
13
|
+
--surface-3: 211 22% 88%;
|
|
14
|
+
--text-primary: 218 36% 10%;
|
|
15
|
+
--text-secondary: 214 18% 34%;
|
|
16
|
+
--text-tertiary: 214 12% 52%;
|
|
17
|
+
--border-strong: 211 24% 58%;
|
|
18
|
+
--border-base: 211 20% 78%;
|
|
19
|
+
--border-subtle: 211 22% 88%;
|
|
20
|
+
--primary: 188 94% 34%;
|
|
21
|
+
--primary-hover: 188 96% 28%;
|
|
22
|
+
--primary-active: 190 96% 22%;
|
|
23
|
+
--primary-soft: 188 94% 34%;
|
|
24
|
+
--primary-soft-fg: 190 96% 22%;
|
|
25
|
+
--ring: 188 94% 34%;
|
|
26
|
+
--radius-control: 0.25rem;
|
|
27
|
+
--radius-panel: 0.375rem;
|
|
28
|
+
--radius-overlay: 0.5rem;
|
|
29
|
+
--shadow-color: 218 44% 10%;
|
|
30
|
+
--shadow-sm: 0 1px 0 hsl(var(--border-strong) / 0.32), 0 8px 18px -16px hsl(var(--shadow-color) / 0.28);
|
|
31
|
+
--shadow-md: 0 1px 0 hsl(var(--border-strong) / 0.28), 0 18px 34px -24px hsl(var(--shadow-color) / 0.38);
|
|
32
|
+
--shadow-lg: 0 1px 0 hsl(var(--border-strong) / 0.24), 0 28px 54px -30px hsl(var(--shadow-color) / 0.46);
|
|
33
|
+
--shadow-xl: 0 1px 0 hsl(var(--border-strong) / 0.22), 0 38px 76px -36px hsl(var(--shadow-color) / 0.52);
|
|
34
|
+
--shadow-2xl: 0 1px 0 hsl(var(--border-strong) / 0.2), 0 48px 96px -42px hsl(var(--shadow-color) / 0.58);
|
|
35
|
+
--shadow-glow: 0 0 0 1px hsl(var(--ring) / 0.2), 0 0 28px hsl(var(--ring) / 0.18);
|
|
36
|
+
--control-border-width: 1px;
|
|
37
|
+
--motion-duration-fast: 100ms;
|
|
38
|
+
--motion-duration-base: 160ms;
|
|
39
|
+
--motion-duration-slow: 220ms;
|
|
40
|
+
--ug-button-bg-image: linear-gradient(180deg, hsl(var(--primary) / 0.14), transparent 72%);
|
|
41
|
+
--ug-button-border-image: none;
|
|
42
|
+
--ug-card-texture-image:
|
|
43
|
+
linear-gradient(135deg, hsl(var(--primary) / 0.08), transparent 38%),
|
|
44
|
+
repeating-linear-gradient(90deg, hsl(var(--border-subtle) / 0.45) 0 1px, transparent 1px 12px);
|
|
45
|
+
--ug-panel-noise-image:
|
|
46
|
+
linear-gradient(135deg, hsl(var(--primary) / 0.06), transparent 42%),
|
|
47
|
+
repeating-linear-gradient(0deg, hsl(var(--border-subtle) / 0.36) 0 1px, transparent 1px 10px);
|
|
48
|
+
--ug-focus-ring-image: none;
|
|
49
|
+
--ug-control-surface: hsl(var(--surface-2));
|
|
50
|
+
--ug-control-surface-hover: hsl(var(--surface-3));
|
|
51
|
+
--ug-control-surface-active: hsl(var(--surface-3));
|
|
52
|
+
--ug-control-border: hsl(var(--border-strong));
|
|
53
|
+
--ug-control-border-hover: hsl(var(--primary) / 0.72);
|
|
54
|
+
--ug-panel-border: hsl(var(--border-strong) / 0.72);
|
|
55
|
+
--ug-panel-surface: hsl(var(--surface-1));
|
|
56
|
+
--ug-panel-surface-muted: hsl(var(--surface-2));
|
|
57
|
+
--ug-focus-ring-shadow: 0 0 0 1px hsl(var(--surface-0)), 0 0 0 4px hsl(var(--ring) / 0.24);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:where(
|
|
61
|
+
.dark [data-ug-theme='mecha'],
|
|
62
|
+
[data-ug-theme='mecha'].dark,
|
|
63
|
+
[data-ug-mode='dark'] [data-ug-theme='mecha'],
|
|
64
|
+
[data-ug-theme='mecha'][data-ug-mode='dark']
|
|
65
|
+
) {
|
|
66
|
+
--surface-0: 218 34% 7%;
|
|
67
|
+
--surface-1: 218 28% 10%;
|
|
68
|
+
--surface-2: 218 24% 15%;
|
|
69
|
+
--surface-3: 218 20% 22%;
|
|
70
|
+
--text-primary: 190 34% 96%;
|
|
71
|
+
--text-secondary: 200 18% 74%;
|
|
72
|
+
--text-tertiary: 205 12% 58%;
|
|
73
|
+
--border-strong: 190 22% 42%;
|
|
74
|
+
--border-base: 204 18% 28%;
|
|
75
|
+
--border-subtle: 212 20% 18%;
|
|
76
|
+
--primary: 184 96% 52%;
|
|
77
|
+
--primary-hover: 184 98% 62%;
|
|
78
|
+
--primary-active: 184 98% 72%;
|
|
79
|
+
--primary-soft: 184 96% 52%;
|
|
80
|
+
--primary-soft-fg: 184 98% 72%;
|
|
81
|
+
--ring: 184 96% 52%;
|
|
82
|
+
--shadow-color: 218 48% 3%;
|
|
83
|
+
--ug-card-texture-image:
|
|
84
|
+
linear-gradient(135deg, hsl(var(--primary) / 0.12), transparent 40%),
|
|
85
|
+
repeating-linear-gradient(90deg, hsl(var(--border-subtle) / 0.42) 0 1px, transparent 1px 12px);
|
|
86
|
+
--ug-panel-noise-image:
|
|
87
|
+
linear-gradient(135deg, hsl(var(--primary) / 0.1), transparent 44%),
|
|
88
|
+
repeating-linear-gradient(0deg, hsl(var(--border-subtle) / 0.36) 0 1px, transparent 1px 10px);
|
|
89
|
+
--ug-control-surface: hsl(var(--surface-2));
|
|
90
|
+
--ug-control-surface-hover: hsl(var(--surface-3));
|
|
91
|
+
--ug-panel-border: hsl(var(--border-strong) / 0.8);
|
|
92
|
+
--ug-panel-surface: hsl(var(--surface-1));
|
|
93
|
+
--ug-panel-surface-muted: hsl(var(--surface-2));
|
|
94
|
+
--ug-focus-ring-shadow: 0 0 0 1px hsl(var(--surface-0)), 0 0 0 4px hsl(var(--ring) / 0.28);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:where(
|
|
98
|
+
[data-ug-mode='light'] [data-ug-theme='mecha'],
|
|
99
|
+
[data-ug-theme='mecha'][data-ug-mode='light'],
|
|
100
|
+
[data-ug-mode='system'] [data-ug-theme='mecha'],
|
|
101
|
+
[data-ug-theme='mecha'][data-ug-mode='system']
|
|
102
|
+
) {
|
|
103
|
+
--surface-0: 214 30% 96%;
|
|
104
|
+
--surface-1: 210 22% 99%;
|
|
105
|
+
--surface-2: 212 24% 94%;
|
|
106
|
+
--surface-3: 211 22% 88%;
|
|
107
|
+
--text-primary: 218 36% 10%;
|
|
108
|
+
--text-secondary: 214 18% 34%;
|
|
109
|
+
--text-tertiary: 214 12% 52%;
|
|
110
|
+
--border-strong: 211 24% 58%;
|
|
111
|
+
--border-base: 211 20% 78%;
|
|
112
|
+
--border-subtle: 211 22% 88%;
|
|
113
|
+
--primary: 188 94% 34%;
|
|
114
|
+
--primary-hover: 188 96% 28%;
|
|
115
|
+
--primary-active: 190 96% 22%;
|
|
116
|
+
--primary-soft: 188 94% 34%;
|
|
117
|
+
--primary-soft-fg: 190 96% 22%;
|
|
118
|
+
--ring: 188 94% 34%;
|
|
119
|
+
--shadow-color: 218 44% 10%;
|
|
120
|
+
--ug-card-texture-image:
|
|
121
|
+
linear-gradient(135deg, hsl(var(--primary) / 0.08), transparent 38%),
|
|
122
|
+
repeating-linear-gradient(90deg, hsl(var(--border-subtle) / 0.45) 0 1px, transparent 1px 12px);
|
|
123
|
+
--ug-panel-noise-image:
|
|
124
|
+
linear-gradient(135deg, hsl(var(--primary) / 0.06), transparent 42%),
|
|
125
|
+
repeating-linear-gradient(0deg, hsl(var(--border-subtle) / 0.36) 0 1px, transparent 1px 10px);
|
|
126
|
+
--ug-control-surface: hsl(var(--surface-2));
|
|
127
|
+
--ug-control-surface-hover: hsl(var(--surface-3));
|
|
128
|
+
--ug-panel-border: hsl(var(--border-strong) / 0.72);
|
|
129
|
+
--ug-panel-surface: hsl(var(--surface-1));
|
|
130
|
+
--ug-panel-surface-muted: hsl(var(--surface-2));
|
|
131
|
+
--ug-focus-ring-shadow: 0 0 0 1px hsl(var(--surface-0)), 0 0 0 4px hsl(var(--ring) / 0.24);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@media (prefers-color-scheme: dark) {
|
|
135
|
+
:where(
|
|
136
|
+
[data-ug-mode='system'] [data-ug-theme='mecha'],
|
|
137
|
+
[data-ug-theme='mecha'][data-ug-mode='system']
|
|
138
|
+
) {
|
|
139
|
+
--surface-0: 218 34% 7%;
|
|
140
|
+
--surface-1: 218 28% 10%;
|
|
141
|
+
--surface-2: 218 24% 15%;
|
|
142
|
+
--surface-3: 218 20% 22%;
|
|
143
|
+
--text-primary: 190 34% 96%;
|
|
144
|
+
--text-secondary: 200 18% 74%;
|
|
145
|
+
--text-tertiary: 205 12% 58%;
|
|
146
|
+
--border-strong: 190 22% 42%;
|
|
147
|
+
--border-base: 204 18% 28%;
|
|
148
|
+
--border-subtle: 212 20% 18%;
|
|
149
|
+
--primary: 184 96% 52%;
|
|
150
|
+
--primary-hover: 184 98% 62%;
|
|
151
|
+
--primary-active: 184 98% 72%;
|
|
152
|
+
--primary-soft: 184 96% 52%;
|
|
153
|
+
--primary-soft-fg: 184 98% 72%;
|
|
154
|
+
--ring: 184 96% 52%;
|
|
155
|
+
--shadow-color: 218 48% 3%;
|
|
156
|
+
--ug-card-texture-image:
|
|
157
|
+
linear-gradient(135deg, hsl(var(--primary) / 0.12), transparent 40%),
|
|
158
|
+
repeating-linear-gradient(90deg, hsl(var(--border-subtle) / 0.42) 0 1px, transparent 1px 12px);
|
|
159
|
+
--ug-panel-noise-image:
|
|
160
|
+
linear-gradient(135deg, hsl(var(--primary) / 0.1), transparent 44%),
|
|
161
|
+
repeating-linear-gradient(0deg, hsl(var(--border-subtle) / 0.36) 0 1px, transparent 1px 10px);
|
|
162
|
+
--ug-control-surface: hsl(var(--surface-2));
|
|
163
|
+
--ug-control-surface-hover: hsl(var(--surface-3));
|
|
164
|
+
--ug-panel-border: hsl(var(--border-strong) / 0.8);
|
|
165
|
+
--ug-panel-surface: hsl(var(--surface-1));
|
|
166
|
+
--ug-panel-surface-muted: hsl(var(--surface-2));
|
|
167
|
+
--ug-focus-ring-shadow: 0 0 0 1px hsl(var(--surface-0)), 0 0 0 4px hsl(var(--ring) / 0.28);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
:where([data-ug-theme='mecha'][data-ug-surface='workspace']) {
|
|
172
|
+
--control-height-md: 2.375rem;
|
|
173
|
+
--section-gap: 1.625rem;
|
|
174
|
+
--page-max-width: 74rem;
|
|
175
|
+
--docs-wide-max-width: 102rem;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
:where([data-ug-theme='mecha'][data-ug-surface='showcase']) {
|
|
179
|
+
--section-gap: 2.75rem;
|
|
180
|
+
--page-max-width: 80rem;
|
|
181
|
+
--docs-wide-max-width: 108rem;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
:where([data-ug-theme='mecha'][data-ug-surface='auth']) {
|
|
185
|
+
--page-max-width: 30rem;
|
|
186
|
+
--docs-wide-max-width: 56rem;
|
|
187
|
+
--radius-panel: 0.5rem;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
:where([data-ug-theme='mecha'][data-ug-surface='content']) {
|
|
191
|
+
--section-gap: 2.25rem;
|
|
192
|
+
--content-gap: 1.0625rem;
|
|
193
|
+
--page-max-width: 66rem;
|
|
194
|
+
--docs-wide-max-width: 90rem;
|
|
195
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description: UG UI minimal 主题骨架 — 低阴影、弱边界、轻量产品气质
|
|
3
|
+
* @author: UG - 一个斗码大陆苦逼的三段码之气的少年,并没有神秘戒指中码老的帮助,但总有一天,我会成为斗码大陆中码帝一样的存在。三十年河东,三十年河西,莫欺少年穷。
|
|
4
|
+
* @date: 2026-06-16
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
:where([data-ug-theme='minimal']) {
|
|
8
|
+
--font-sans: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", ui-sans-serif, system-ui, sans-serif;
|
|
9
|
+
--font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
|
|
10
|
+
--surface-0: 210 20% 99%;
|
|
11
|
+
--surface-1: 0 0% 100%;
|
|
12
|
+
--surface-2: 210 18% 97%;
|
|
13
|
+
--surface-3: 210 16% 94%;
|
|
14
|
+
--border-strong: 210 14% 76%;
|
|
15
|
+
--border-base: 210 16% 88%;
|
|
16
|
+
--border-subtle: 210 18% 94%;
|
|
17
|
+
--primary: 198 74% 34%;
|
|
18
|
+
--primary-hover: 198 78% 28%;
|
|
19
|
+
--primary-active: 198 80% 23%;
|
|
20
|
+
--primary-soft: 198 74% 34%;
|
|
21
|
+
--primary-soft-fg: 198 80% 23%;
|
|
22
|
+
--radius-control: 0.375rem;
|
|
23
|
+
--radius-panel: 0.5rem;
|
|
24
|
+
--radius-overlay: 0.625rem;
|
|
25
|
+
--shadow-color: 210 24% 12%;
|
|
26
|
+
--shadow-sm: none;
|
|
27
|
+
--shadow-md: 0 1px 2px hsl(var(--shadow-color) / 0.07);
|
|
28
|
+
--shadow-lg: 0 8px 24px -20px hsl(var(--shadow-color) / 0.24);
|
|
29
|
+
--shadow-xl: 0 16px 38px -28px hsl(var(--shadow-color) / 0.32);
|
|
30
|
+
--shadow-2xl: 0 24px 48px -32px hsl(var(--shadow-color) / 0.36);
|
|
31
|
+
--shadow-glow: 0 0 0 1px hsl(var(--ring) / 0.14);
|
|
32
|
+
--control-border-width: 1px;
|
|
33
|
+
--ug-button-bg-image: none;
|
|
34
|
+
--ug-button-border-image: none;
|
|
35
|
+
--ug-card-texture-image: none;
|
|
36
|
+
--ug-panel-noise-image: none;
|
|
37
|
+
--ug-focus-ring-image: none;
|
|
38
|
+
--ug-control-surface: hsl(var(--surface-1));
|
|
39
|
+
--ug-control-surface-hover: hsl(var(--surface-2));
|
|
40
|
+
--ug-control-surface-active: hsl(var(--surface-3));
|
|
41
|
+
--ug-control-border: hsl(var(--border-base));
|
|
42
|
+
--ug-control-border-hover: hsl(var(--primary) / 0.48);
|
|
43
|
+
--ug-panel-border: hsl(var(--border-base));
|
|
44
|
+
--ug-panel-surface: hsl(var(--surface-1));
|
|
45
|
+
--ug-panel-surface-muted: hsl(var(--surface-2));
|
|
46
|
+
--ug-focus-ring-shadow: 0 0 0 2px hsl(var(--ring) / 0.18);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:where(
|
|
50
|
+
.dark [data-ug-theme='minimal'],
|
|
51
|
+
[data-ug-theme='minimal'].dark,
|
|
52
|
+
[data-ug-mode='dark'] [data-ug-theme='minimal'],
|
|
53
|
+
[data-ug-theme='minimal'][data-ug-mode='dark']
|
|
54
|
+
) {
|
|
55
|
+
--surface-0: 210 22% 9%;
|
|
56
|
+
--surface-1: 210 18% 12%;
|
|
57
|
+
--surface-2: 210 16% 16%;
|
|
58
|
+
--surface-3: 210 14% 22%;
|
|
59
|
+
--border-strong: 210 13% 36%;
|
|
60
|
+
--border-base: 210 14% 24%;
|
|
61
|
+
--border-subtle: 210 14% 18%;
|
|
62
|
+
--primary: 196 78% 58%;
|
|
63
|
+
--primary-hover: 196 80% 66%;
|
|
64
|
+
--primary-active: 196 82% 74%;
|
|
65
|
+
--primary-soft: 196 78% 58%;
|
|
66
|
+
--primary-soft-fg: 196 82% 74%;
|
|
67
|
+
--shadow-md: 0 1px 2px hsl(var(--shadow-color) / 0.22);
|
|
68
|
+
--shadow-lg: 0 10px 26px -22px hsl(var(--shadow-color) / 0.64);
|
|
69
|
+
--shadow-xl: 0 18px 42px -30px hsl(var(--shadow-color) / 0.72);
|
|
70
|
+
--shadow-2xl: 0 26px 56px -36px hsl(var(--shadow-color) / 0.78);
|
|
71
|
+
--ug-control-surface: hsl(var(--surface-1));
|
|
72
|
+
--ug-control-surface-hover: hsl(var(--surface-2));
|
|
73
|
+
--ug-panel-border: hsl(var(--border-base));
|
|
74
|
+
--ug-panel-surface: hsl(var(--surface-1));
|
|
75
|
+
--ug-panel-surface-muted: hsl(var(--surface-2));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:where(
|
|
79
|
+
[data-ug-mode='light'] [data-ug-theme='minimal'],
|
|
80
|
+
[data-ug-theme='minimal'][data-ug-mode='light'],
|
|
81
|
+
[data-ug-mode='system'] [data-ug-theme='minimal'],
|
|
82
|
+
[data-ug-theme='minimal'][data-ug-mode='system']
|
|
83
|
+
) {
|
|
84
|
+
--surface-0: 210 20% 99%;
|
|
85
|
+
--surface-1: 0 0% 100%;
|
|
86
|
+
--surface-2: 210 18% 97%;
|
|
87
|
+
--surface-3: 210 16% 94%;
|
|
88
|
+
--border-strong: 210 14% 76%;
|
|
89
|
+
--border-base: 210 16% 88%;
|
|
90
|
+
--border-subtle: 210 18% 94%;
|
|
91
|
+
--primary: 198 74% 34%;
|
|
92
|
+
--primary-hover: 198 78% 28%;
|
|
93
|
+
--primary-active: 198 80% 23%;
|
|
94
|
+
--primary-soft: 198 74% 34%;
|
|
95
|
+
--primary-soft-fg: 198 80% 23%;
|
|
96
|
+
--shadow-sm: none;
|
|
97
|
+
--shadow-md: 0 1px 2px hsl(var(--shadow-color) / 0.07);
|
|
98
|
+
--shadow-lg: 0 8px 24px -20px hsl(var(--shadow-color) / 0.24);
|
|
99
|
+
--shadow-xl: 0 16px 38px -28px hsl(var(--shadow-color) / 0.32);
|
|
100
|
+
--shadow-2xl: 0 24px 48px -32px hsl(var(--shadow-color) / 0.36);
|
|
101
|
+
--ug-control-surface: hsl(var(--surface-1));
|
|
102
|
+
--ug-control-surface-hover: hsl(var(--surface-2));
|
|
103
|
+
--ug-panel-border: hsl(var(--border-base));
|
|
104
|
+
--ug-panel-surface: hsl(var(--surface-1));
|
|
105
|
+
--ug-panel-surface-muted: hsl(var(--surface-2));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@media (prefers-color-scheme: dark) {
|
|
109
|
+
:where(
|
|
110
|
+
[data-ug-mode='system'] [data-ug-theme='minimal'],
|
|
111
|
+
[data-ug-theme='minimal'][data-ug-mode='system']
|
|
112
|
+
) {
|
|
113
|
+
--surface-0: 210 22% 9%;
|
|
114
|
+
--surface-1: 210 18% 12%;
|
|
115
|
+
--surface-2: 210 16% 16%;
|
|
116
|
+
--surface-3: 210 14% 22%;
|
|
117
|
+
--border-strong: 210 13% 36%;
|
|
118
|
+
--border-base: 210 14% 24%;
|
|
119
|
+
--border-subtle: 210 14% 18%;
|
|
120
|
+
--primary: 196 78% 58%;
|
|
121
|
+
--primary-hover: 196 80% 66%;
|
|
122
|
+
--primary-active: 196 82% 74%;
|
|
123
|
+
--primary-soft: 196 78% 58%;
|
|
124
|
+
--primary-soft-fg: 196 82% 74%;
|
|
125
|
+
--shadow-md: 0 1px 2px hsl(var(--shadow-color) / 0.22);
|
|
126
|
+
--shadow-lg: 0 10px 26px -22px hsl(var(--shadow-color) / 0.64);
|
|
127
|
+
--shadow-xl: 0 18px 42px -30px hsl(var(--shadow-color) / 0.72);
|
|
128
|
+
--shadow-2xl: 0 26px 56px -36px hsl(var(--shadow-color) / 0.78);
|
|
129
|
+
--ug-control-surface: hsl(var(--surface-1));
|
|
130
|
+
--ug-control-surface-hover: hsl(var(--surface-2));
|
|
131
|
+
--ug-panel-border: hsl(var(--border-base));
|
|
132
|
+
--ug-panel-surface: hsl(var(--surface-1));
|
|
133
|
+
--ug-panel-surface-muted: hsl(var(--surface-2));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
:where([data-ug-theme='minimal'][data-ug-surface='workspace']) {
|
|
138
|
+
--section-gap: 1.5rem;
|
|
139
|
+
--page-max-width: 70rem;
|
|
140
|
+
--docs-wide-max-width: 96rem;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
:where([data-ug-theme='minimal'][data-ug-surface='showcase']) {
|
|
144
|
+
--section-gap: 2.25rem;
|
|
145
|
+
--page-max-width: 74rem;
|
|
146
|
+
--docs-wide-max-width: 100rem;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
:where([data-ug-theme='minimal'][data-ug-surface='auth']) {
|
|
150
|
+
--page-max-width: 27rem;
|
|
151
|
+
--docs-wide-max-width: 50rem;
|
|
152
|
+
--radius-panel: 0.5rem;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
:where([data-ug-theme='minimal'][data-ug-surface='content']) {
|
|
156
|
+
--section-gap: 1.875rem;
|
|
157
|
+
--content-gap: 1rem;
|
|
158
|
+
--page-max-width: 62rem;
|
|
159
|
+
--docs-wide-max-width: 84rem;
|
|
160
|
+
}
|