geekin-devtoys 0.5.1 → 0.6.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/lib/GBranched/index.js +1 -0
- package/lib/GBranched/index.mjs +5 -0
- package/lib/GBranched/style.css +97 -0
- package/lib/GBranched-BtF7heMk.js +1 -0
- package/lib/{GBranched-gk9VjilV.mjs → GBranched-vnLlYOl9.mjs} +22 -22
- package/lib/GBranched.d.ts +4 -0
- package/lib/GButton/index.js +1 -0
- package/lib/{GButton-DYVUVEmW.mjs → GButton/index.mjs} +11 -10
- package/lib/GButton/style.css +97 -1
- package/lib/GButton.d.ts +4 -0
- package/lib/GCard/index.js +1 -0
- package/lib/{GCard-fy7pLgOm.mjs → GCard/index.mjs} +10 -9
- package/lib/GCard/style.css +97 -0
- package/lib/GCard.d.ts +4 -0
- package/lib/GColorPicker/index.js +1 -0
- package/lib/GColorPicker/index.mjs +572 -0
- package/lib/GColorPicker/style.css +98 -0
- package/lib/GColorPicker.d.ts +4 -0
- package/lib/GCount/index.js +1 -0
- package/lib/{GCount-B8qGAPPw.mjs → GCount/index.mjs} +9 -8
- package/lib/GCount.d.ts +4 -0
- package/lib/GDialog/index.js +1 -0
- package/lib/GDialog/index.mjs +458 -0
- package/lib/GDialog/style.css +97 -1
- package/lib/GDialog.d.ts +4 -0
- package/lib/GDropdown/index.js +1 -0
- package/lib/{GDropdown-DAV-MJNy.mjs → GDropdown/index.mjs} +7 -6
- package/lib/GDropdown/style.css +97 -0
- package/lib/GDropdown.d.ts +4 -0
- package/lib/GFuzzyText/index.js +1 -0
- package/lib/{GFuzzyText-C8YqMyVc.mjs → GFuzzyText/index.mjs} +16 -15
- package/lib/GFuzzyText.d.ts +4 -0
- package/lib/GInput/index.js +1 -0
- package/lib/{GInput-Dmr0imGb.mjs → GInput/index.mjs} +7 -6
- package/lib/GInput/style.css +97 -1
- package/lib/GInput.d.ts +4 -0
- package/lib/GPagination/index.js +1 -0
- package/lib/{GPagination-C3Bv-WAh.mjs → GPagination/index.mjs} +10 -9
- package/lib/GPagination.d.ts +4 -0
- package/lib/GPicker/index.js +1 -0
- package/lib/{GPicker-Dod_ZC1a.mjs → GPicker/index.mjs} +18 -17
- package/lib/GPicker/style.css +97 -1
- package/lib/GPicker.d.ts +4 -0
- package/lib/GPie3D/index.js +1 -0
- package/lib/{GPie3D-f9qP9766.mjs → GPie3D/index.mjs} +13 -12
- package/lib/GPie3D/style.css +97 -0
- package/lib/GPie3D.d.ts +4 -0
- package/lib/GPluginVideo/index.js +1 -0
- package/lib/{GPluginVideo-DRoHqxth.mjs → GPluginVideo/index.mjs} +9 -8
- package/lib/GPluginVideo.d.ts +6 -0
- package/lib/GPopover/index.js +1 -0
- package/lib/GPopover/index.mjs +179 -0
- package/lib/GPopover/style.css +98 -0
- package/lib/GPopover.d.ts +4 -0
- package/lib/GProgress/index.js +1 -0
- package/lib/{GProgress-DE4nojJS.mjs → GProgress/index.mjs} +3 -2
- package/lib/GProgress/style.css +97 -0
- package/lib/GProgress.d.ts +4 -0
- package/lib/GRing/index.js +1 -0
- package/lib/{GRing-wjC39-EB.mjs → GRing/index.mjs} +9 -8
- package/lib/GRing/style.css +97 -0
- package/lib/GRing.d.ts +4 -0
- package/lib/GScreen/index.js +1 -0
- package/lib/{GScreen-2eUu-UYd.mjs → GScreen/index.mjs} +18 -17
- package/lib/GScreen.d.ts +4 -0
- package/lib/GScroller/index.js +1 -0
- package/lib/{GScroller-B3nJgbB6.mjs → GScroller/index.mjs} +8 -7
- package/lib/GScroller/style.css +97 -0
- package/lib/GScroller.d.ts +4 -0
- package/lib/GScrubber/index.js +1 -0
- package/lib/GScrubber/index.mjs +250 -0
- package/lib/GScrubber.d.ts +4 -0
- package/lib/GSegment/index.js +1 -0
- package/lib/GSegment/index.mjs +398 -0
- package/lib/GSegment/style.css +98 -1
- package/lib/GSegment.d.ts +4 -0
- package/lib/GShinyText/index.js +1 -0
- package/lib/{GShinyText-DlOUA5Ks.mjs → GShinyText/index.mjs} +26 -25
- package/lib/GShinyText.d.ts +4 -0
- package/lib/GSlider/index.js +1 -0
- package/lib/GSlider/index.mjs +272 -0
- package/lib/GSlider/style.css +98 -1
- package/lib/GSlider.d.ts +4 -0
- package/lib/GSpin/index.js +1 -0
- package/lib/GSpin/index.mjs +163 -0
- package/lib/GSpin/style.css +98 -0
- package/lib/GSpin.d.ts +4 -0
- package/lib/GSteps/index.js +1 -0
- package/lib/{GSteps-Dn5IYJpx.mjs → GSteps/index.mjs} +21 -20
- package/lib/GSteps/style.css +97 -0
- package/lib/GSteps.d.ts +4 -0
- package/lib/GSwitch/index.js +1 -0
- package/lib/GSwitch/index.mjs +199 -0
- package/lib/GSwitch/style.css +98 -0
- package/lib/GSwitch.d.ts +4 -0
- package/lib/GTable/index.js +1 -0
- package/lib/{GTable-JWC4MouE.mjs → GTable/index.mjs} +16 -15
- package/lib/GTable/style.css +97 -1
- package/lib/GTable.d.ts +4 -0
- package/lib/GTag/index.js +1 -0
- package/lib/{GTag-BBCyhlbu.mjs → GTag/index.mjs} +15 -14
- package/lib/GTag/style.css +97 -1
- package/lib/GTag.d.ts +4 -0
- package/lib/GToast/index.js +1 -0
- package/lib/{GToast-BRd2P7dm.mjs → GToast/index.mjs} +13 -12
- package/lib/GToast/style.css +97 -0
- package/lib/GToast.d.ts +4 -0
- package/lib/GTree/index.js +1 -0
- package/lib/{GTree-BeEm75-u.mjs → GTree/index.mjs} +14 -13
- package/lib/GTree/style.css +97 -0
- package/lib/GTree.d.ts +4 -0
- package/lib/{GVideo-DHoeaGKS.js → GVideo/index.js} +2 -2
- package/lib/{GVideo-CNWjIzXx.mjs → GVideo/index.mjs} +8 -7
- package/lib/GVideo/style.css +97 -0
- package/lib/GVideo.d.ts +6 -0
- package/lib/assets/GScrubber.css +1 -0
- package/lib/components/GBranched/index.d.ts +6 -6
- package/lib/components/GButton/index.d.ts +1 -1
- package/lib/components/GColorPicker/color.d.ts +59 -0
- package/lib/components/GColorPicker/index.d.ts +30 -0
- package/lib/components/GColorPicker/types.d.ts +89 -0
- package/lib/components/GCount/index.d.ts +5 -5
- package/lib/components/GDialog/index.d.ts +3 -3
- package/lib/components/GDropdown/index.d.ts +6 -6
- package/lib/components/GFuzzyText/index.d.ts +3 -3
- package/lib/components/GInput/index.d.ts +4 -4
- package/lib/components/GPagination/index.d.ts +1 -1
- package/lib/components/GPicker/index.d.ts +4 -4
- package/lib/components/GPicker/types.d.ts +6 -0
- package/lib/components/GPie3D/index.d.ts +2 -2
- package/lib/components/GPopover/__tests__/index.test.d.ts +1 -0
- package/lib/components/GPopover/index.d.ts +48 -0
- package/lib/components/GPopover/types.d.ts +72 -0
- package/lib/components/GProgress/index.d.ts +1 -1
- package/lib/components/GRing/index.d.ts +2 -2
- package/lib/components/GScroller/index.d.ts +1 -1
- package/lib/components/GScrubber/__tests__/index.test.d.ts +1 -0
- package/lib/components/GScrubber/index.d.ts +31 -0
- package/lib/components/GScrubber/types.d.ts +101 -0
- package/lib/components/GSegment/index.d.ts +9 -8
- package/lib/components/GSegment/types.d.ts +10 -4
- package/lib/components/GShinyText/index.d.ts +3 -3
- package/lib/components/GSlider/index.d.ts +5 -3
- package/lib/components/GSlider/types.d.ts +27 -4
- package/lib/components/GSpin/__tests__/index.test.d.ts +1 -0
- package/lib/components/GSpin/index.d.ts +30 -0
- package/lib/components/GSpin/types.d.ts +174 -0
- package/lib/components/GSwitch/__tests__/index.test.d.ts +1 -0
- package/lib/components/{GRadio → GSwitch}/index.d.ts +13 -13
- package/lib/components/{GRadio → GSwitch}/types.d.ts +7 -7
- package/lib/components/GTable/index.d.ts +1 -1
- package/lib/index/index.js +1 -1
- package/lib/index/index.mjs +89 -77
- package/lib/index/style.css +109 -6
- package/lib/index.d.ts +12 -4
- package/package.json +37 -9
- package/lib/GBranched-DgHZO9BQ.js +0 -1
- package/lib/GButton-DiVnpCJ_.js +0 -1
- package/lib/GCard-mUE6ozOd.js +0 -1
- package/lib/GCount-PeMCQxKJ.js +0 -1
- package/lib/GDialog-BXKKf7pp.mjs +0 -379
- package/lib/GDialog-DYUmUJIs.js +0 -1
- package/lib/GDropdown-XCTNfuvx.js +0 -1
- package/lib/GFuzzyText-DlvSSgZN.js +0 -1
- package/lib/GInput-BQ3kUKBK.js +0 -1
- package/lib/GPagination-TlNbcdVK.js +0 -1
- package/lib/GPicker-CGIJstWX.js +0 -1
- package/lib/GPie3D-n-Rr8wxJ.js +0 -1
- package/lib/GPluginVideo-CCMOsKR1.js +0 -1
- package/lib/GProgress-BLhyozxX.js +0 -1
- package/lib/GRadio/style.css +0 -1
- package/lib/GRadio-Cfrcw4ij.js +0 -1
- package/lib/GRadio-DJT1sLHB.mjs +0 -197
- package/lib/GRing-C7jmMP3i.js +0 -1
- package/lib/GScreen-XeAOifAH.js +0 -1
- package/lib/GScroller-SxgsNnGm.js +0 -1
- package/lib/GSegment-BOCz6tKA.mjs +0 -363
- package/lib/GSegment-DBya2zxC.js +0 -1
- package/lib/GShinyText-1l_2iEh2.js +0 -1
- package/lib/GSlider-Cr82jLMa.mjs +0 -183
- package/lib/GSlider-Did6qEGG.js +0 -1
- package/lib/GSteps-CLkuWWKC.js +0 -1
- package/lib/GTable-DbKMCmgA.js +0 -1
- package/lib/GTag-Cz1B_ljk.js +0 -1
- package/lib/GToast-Dz_Ukb9h.js +0 -1
- package/lib/GTree-6YPV4gsf.js +0 -1
- package/lib/index/index.d.mts +0 -6
- /package/lib/components/{GRadio → GColorPicker}/__tests__/index.test.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../GBranched-BtF7heMk.js");exports.GBranched=e.GBranched;exports.default=e.GBranched;
|
package/lib/GBranched/style.css
CHANGED
|
@@ -1 +1,98 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/*
|
|
3
|
+
* 组件库公共样式:全局 CSS 变量,供各组件消费
|
|
4
|
+
* 按模块拆分文件管理(颜色 → color.css,尺寸 → size.css),在此聚合引入
|
|
5
|
+
* 此文件额外承载非颜色非尺寸类变量,颜色变量一律放 color.css、尺寸变量一律放 size.css
|
|
6
|
+
*/
|
|
7
|
+
/*
|
|
8
|
+
* 颜色变量模块:所有颜色类 CSS 变量集中于此管理
|
|
9
|
+
* 变量统一携带 --g- 库名称空间前缀,避免污染宿主项目的命名空间
|
|
10
|
+
* 同一颜色全库共用一个变量(如 --g-primary-color),不再按组件拆分
|
|
11
|
+
* 派生色(primary-light 等)用 color-mix() 从基础色实时混出,
|
|
12
|
+
* 业务侧覆盖基础色换肤时派生色自动跟随,无需逐个同步
|
|
13
|
+
* 业务侧可在任意祖先节点(:root / body / 容器)覆盖同名变量实现换肤
|
|
14
|
+
*/
|
|
15
|
+
:root {
|
|
16
|
+
/* ===== 公共语义色(primary / success / warning / danger 全库共用) ===== */
|
|
17
|
+
--g-primary-color: #039be5; /* 主色,覆盖它即可换主题色,派生色自动联动 */
|
|
18
|
+
--g-primary-light-color: color-mix(in srgb, var(--g-primary-color) 10%, var(--g-bg-color)); /* 主色浅底,hover / 选中背景 */
|
|
19
|
+
--g-success-color: #50c189; /* 成功色 */
|
|
20
|
+
--g-warning-color: #f78716; /* 警告色 */
|
|
21
|
+
--g-danger-color: #e1594d; /* 危险色 */
|
|
22
|
+
--g-emphasis-color: #000000; /* 强调色(浅色模式黑,深色模式反白为白) */
|
|
23
|
+
--g-emphasis-text-color: #ffffff; /* 强调色上的文字色 */
|
|
24
|
+
|
|
25
|
+
/* ===== 公共中性色(随深色模式切换) ===== */
|
|
26
|
+
--g-text-color: rgba(0, 0, 0, 0.88); /* 主要文字色 */
|
|
27
|
+
--g-text-secondary-color: rgba(0, 0, 0, 0.45); /* 次要文字色 */
|
|
28
|
+
--g-text-placeholder-color: rgba(0, 0, 0, 0.35); /* 占位文字色 */
|
|
29
|
+
--g-bg-color: #ffffff; /* 组件背景色 */
|
|
30
|
+
--g-overlay-bg-color: #ffffff; /* 浮层(dropdown / 弹层)背景色 */
|
|
31
|
+
--g-overlay-mask-color: rgba(15, 23, 42, 0.32); /* 全屏遮罩底色(GDialog overlay / GSpin fullscreen 遮罩共用) */
|
|
32
|
+
--g-border-color: #dcdfe3; /* 边框色 */
|
|
33
|
+
--g-border-light-color: #e4e7ea; /* 更浅边框色(行分隔线等) */
|
|
34
|
+
--g-border-strong-color: #cdd0d4; /* 更深边框色(容器外框等) */
|
|
35
|
+
--g-fill-color: #f0f2f5; /* 填充色(表头渐变深端) */
|
|
36
|
+
--g-fill-light-color: #f5f7fa; /* 浅填充色(表头渐变浅端 / 底座背景) */
|
|
37
|
+
--g-fill-lighter-color: #fafafa; /* 更浅填充色(斑马纹) */
|
|
38
|
+
|
|
39
|
+
/* ===== 组件特有变量 ===== */
|
|
40
|
+
--g-button-default-color: #e8e8eb; /* default 按钮底色 */
|
|
41
|
+
--g-input-group-bg-color: #e8e8eb; /* input 的 prepend / append 拼接块底色 */
|
|
42
|
+
--g-scrubber-chip-color: #e8e8eb; /* GScrubber 数值刮擦器芯片底色 */
|
|
43
|
+
--g-scrubber-accent-color: var(--g-primary-color); /* GScrubber 主题色(填充 / 描边 / 增量气泡底),联动主色换肤 */
|
|
44
|
+
--g-scrubber-ghost-ink-color: #ffffff; /* GScrubber 增量气泡文字色(主色底上反白) */
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* 深色模式:跟随 vueuse useDark 的 html.dark 约定自动切换
|
|
48
|
+
仅覆盖随模式变化的值;--g-primary-light-color 混入的 --g-bg-color 在此处已是深色底,自动联动无需覆盖 */
|
|
49
|
+
html.dark {
|
|
50
|
+
--g-emphasis-color: #ffffff; /* 深色底上反白为白,避免融进背景 */
|
|
51
|
+
--g-emphasis-text-color: #000000; /* 反白后文字为黑 */
|
|
52
|
+
|
|
53
|
+
--g-text-color: #e5eaf3; /* 主要文字色 */
|
|
54
|
+
--g-text-secondary-color: rgba(255, 255, 255, 0.45);
|
|
55
|
+
--g-text-placeholder-color: rgba(255, 255, 255, 0.35);
|
|
56
|
+
--g-bg-color: #2b2b2f;
|
|
57
|
+
--g-overlay-bg-color: #1d1e1f; /* 浮层比页面底更深一档 */
|
|
58
|
+
--g-overlay-mask-color: rgba(0, 0, 0, 0.55); /* 深色底上遮罩加深 */
|
|
59
|
+
--g-border-color: #4c4d4f;
|
|
60
|
+
--g-border-light-color: #414243;
|
|
61
|
+
--g-border-strong-color: #636466;
|
|
62
|
+
--g-fill-color: #303030;
|
|
63
|
+
--g-fill-light-color: #262727;
|
|
64
|
+
--g-fill-lighter-color: #1d1e1f;
|
|
65
|
+
|
|
66
|
+
--g-button-default-color: #333336; /* 深色底上的 default 按钮底色 */
|
|
67
|
+
--g-input-group-bg-color: #333336; /* 深色拼接块底色 */
|
|
68
|
+
--g-scrubber-chip-color: #333336; /* 深色底上的刮擦器芯片底色 */
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/*
|
|
72
|
+
* 组件尺寸体系:大 / 中(默认)/ 小,全库统一(GButton / GInput / GTag / GSwitch 共用)
|
|
73
|
+
* 高度基准与 GButton 一致:large 40 / middle 32 / small 24,字号 16 / 14 / 12
|
|
74
|
+
* 组件以回退形式消费:var(--g-size-xxx, 组件内默认值),在任意祖先节点覆盖变量即可全库联动
|
|
75
|
+
* 圆角 / 内边距等派生尺寸由各组件按自身规则推导,不放这里
|
|
76
|
+
*/
|
|
77
|
+
:root {
|
|
78
|
+
/* 高度 */
|
|
79
|
+
--g-size-large-height: 40px;
|
|
80
|
+
--g-size-middle-height: 32px;
|
|
81
|
+
--g-size-small-height: 24px;
|
|
82
|
+
/* 字号 */
|
|
83
|
+
--g-size-large-font-size: 16px;
|
|
84
|
+
--g-size-middle-font-size: 14px;
|
|
85
|
+
--g-size-small-font-size: 12px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
:root {
|
|
90
|
+
/* ===== 公共浮层遮罩(GDialog overlay / GSpin fullscreen 遮罩共用) ===== */
|
|
91
|
+
--g-overlay-mask-backdrop: blur(4px) saturate(1.05); /* 遮罩背景毛玻璃效果,与底色变量 --g-overlay-mask-color 配套 */
|
|
92
|
+
|
|
93
|
+
/* ===== GButton ===== */
|
|
94
|
+
--g-button-bg-color: var(--g-button-default-color); /* 按钮背景色 @default 跟随 --g-button-default-color(深色模式自动切换) */
|
|
95
|
+
--g-button-font-size: var(--g-size-middle-font-size, 14px); /* 按钮字号 @default 跟随统一尺寸体系的 middle 档字号 */
|
|
96
|
+
--g-button-radius: 6px; /* 按钮圆角 @default 6px(large 尺寸 8px / small 尺寸 4px 由组件推导) */
|
|
97
|
+
}
|
|
1
98
|
.g-branched[data-v-cd651c8b]{--bm-ink: #18181b;--bm-accent: #18181b;--bm-line: #d4d4d8;--bm-muted: color-mix(in srgb, var(--bm-ink) 55%, transparent);position:relative;display:flex;flex-direction:column;width:fit-content;max-width:min(var(--bm-w),100%);padding-left:14px;color:var(--bm-ink);font-family:inherit;font-size:var(--bm-font);line-height:1.2}.g-branched[data-v-cd651c8b]:before{content:"";position:absolute;top:8px;bottom:0;left:0;width:2px;border-radius:1px;background:linear-gradient(to bottom,var(--bm-line) 0%,var(--bm-line) 55%,transparent 100%)}html.dark .g-branched[data-v-cd651c8b]{--bm-ink: #fafafa;--bm-accent: #fafafa;--bm-line: #52525b}.g-branched__marker[data-v-cd651c8b]{position:absolute;top:-1px;left:0;z-index:1;width:2px;height:16px;border-radius:1px;background:var(--bm-accent);opacity:0;transition:top .22s cubic-bezier(.23,1,.32,1),opacity .15s ease}.g-branched__marker[data-on][data-v-cd651c8b]{opacity:1}.g-branched__section[data-v-cd651c8b]{display:flex;flex-direction:column}.g-branched__head[data-v-cd651c8b]{display:block;margin:0;padding:9px 0;border:0;background:transparent;outline:none;color:var(--bm-muted);font-family:inherit;font-size:calc(var(--bm-font) + 1px);font-weight:500;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:color .2s ease}.g-branched__section[data-open] .g-branched__head[data-v-cd651c8b],.g-branched__head[data-active][data-v-cd651c8b],.g-branched__head[data-v-cd651c8b]:hover{color:var(--bm-ink)}.g-branched__fold[data-v-cd651c8b]{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--bm-fold) cubic-bezier(.23,1,.32,1)}.g-branched__section[data-open] .g-branched__fold[data-v-cd651c8b]{grid-template-rows:1fr}.g-branched__clip[data-v-cd651c8b]{min-height:0;overflow:hidden}.g-branched__body[data-v-cd651c8b]{position:relative;box-sizing:border-box;padding:var(--bm-pad) 0}.g-branched__lines[data-v-cd651c8b]{position:absolute;top:0;left:0;overflow:visible;pointer-events:none;opacity:0;transition:opacity .2s ease}.g-branched__section[data-open] .g-branched__lines[data-v-cd651c8b]{opacity:1;transition:opacity .25s ease .1s}.g-branched__path[data-v-cd651c8b]{fill:none;stroke:var(--bm-line);stroke-width:var(--bm-line-w);stroke-linecap:round;stroke-linejoin:round}.g-branched__path--accent[data-v-cd651c8b]{stroke:var(--bm-accent);transition:stroke-dashoffset var(--bm-draw) cubic-bezier(.23,1,.32,1)}.g-branched__item[data-v-cd651c8b]{box-sizing:border-box;display:flex;align-items:center;gap:8px;width:100%;height:var(--bm-row);margin:0;padding:0;padding-left:var(--bm-indent);border:0;background:transparent;outline:none;color:var(--bm-muted);font-family:inherit;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:color .2s ease}.g-branched__item[data-v-cd651c8b]:hover{color:var(--bm-ink)}.g-branched__item[data-active][data-v-cd651c8b]{color:var(--bm-accent);font-weight:500}.g-branched__icon[data-v-cd651c8b]{display:inline-flex;flex:none}.g-branched__label[data-v-cd651c8b]{white-space:nowrap}.g-branched__head[data-v-cd651c8b]:focus-visible,.g-branched__item[data-v-cd651c8b]:focus-visible{outline:2px solid var(--bm-accent);outline-offset:-2px;border-radius:6px}@media(prefers-reduced-motion:reduce){.g-branched__marker[data-v-cd651c8b]{transition:opacity .15s ease}.g-branched__fold[data-v-cd651c8b],.g-branched__path--accent[data-v-cd651c8b]{transition:none}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),I=["data-open"],R=["aria-expanded","aria-current","data-active","onClick"],T={key:0,class:"g-branched__fold"},F={class:"g-branched__clip"},L=["width","height"],G=["d"],P=["d"],q=["d"],U=["aria-current","data-active","tabindex","onClick"],W={key:0,class:"g-branched__icon","aria-hidden":"true"},K={class:"g-branched__label"},m=6,Q=16,X=e.defineComponent({name:"GBranched",__name:"index",props:{items:{default:void 0},defaultOpen:{default:0},defaultActive:{default:""},color:{default:void 0},accentColor:{default:void 0},lineColor:{default:void 0},width:{default:240},rowHeight:{default:36},indent:{default:40},trunk:{default:14},radius:{default:10},lineWidth:{default:1.5},fontSize:{default:14},drawDuration:{default:400},foldDuration:{default:300},className:{default:""}},emits:["select","toggle"],setup(d,{emit:k}){const v=[{label:"Getting started",children:[{value:"install",label:"Installation"},{value:"quick",label:"Quick start"},{value:"config",label:"Configuration"},{value:"theming",label:"Theming"}]},{label:"Components",children:[{value:"buttons",label:"Buttons"},{value:"typography",label:"Typography"},{value:"overlays",label:"Overlays"},{value:"toasts",label:"Toasts"}]}],f=t=>new Set(Array.isArray(t)?t:t>=0?[t]:[]),a=d,$=k,p=e.computed(()=>a.items??v),u=e.ref(f(a.defaultOpen)),s=e.ref(a.defaultActive||(p.value.find((t,n)=>t.children&&f(a.defaultOpen).has(n))?.children?.[0]?.value??"")),y=e.ref(null),w=e.ref(null),E=[];let _=null;const b=e.computed(()=>p.value.findIndex(t=>t.children?.some(n=>n.value===s.value))),C=e.computed(()=>b.value>=0&&u.value.has(b.value)),S=t=>{const n=w.value,l=E[b.value];if(!n)return;const c=C.value&&l;t||(n.style.transition="none"),c&&(n.style.top=`${l.offsetTop+(l.offsetHeight-Q)/2}px`),n.toggleAttribute("data-on",!!c),t||(n.offsetHeight,n.style.transition="")},x=()=>{_?.disconnect(),S(!0);let t=!0;_=new ResizeObserver(()=>{if(t){t=!1;return}S(!1)}),y.value&&_.observe(y.value)};e.onMounted(x),e.onUnmounted(()=>_?.disconnect()),e.watch(()=>[b.value,C.value,p.value,a.fontSize,a.rowHeight],x,{flush:"post"});const H=(t,n)=>{s.value=t,$("select",t,n)},N=t=>{const n=new Set(u.value),l=!n.has(t);l?n.add(t):n.delete(t),u.value=n,$("toggle",t,l)},r=e.computed(()=>Math.min(a.radius,a.rowHeight/2-2)),B=e.computed(()=>a.indent-8),i=t=>m+t*a.rowHeight+a.rowHeight/2,V=t=>`M ${a.trunk} ${i(t)-r.value} A ${r.value} ${r.value} 0 0 0 ${a.trunk+r.value} ${i(t)} H ${B.value}`,z=t=>`M ${a.trunk} 0 V ${i(t)-r.value} A ${r.value} ${r.value} 0 0 0 ${a.trunk+r.value} ${i(t)} H ${B.value}`,D=t=>i(t)-r.value+Math.PI*r.value/2+(B.value-a.trunk-r.value),M=t=>`M ${a.trunk} 0 V ${i(t-1)-r.value}`,O=e.computed(()=>({"--bm-w":`${a.width}px`,...a.color!==void 0&&{"--bm-ink":a.color},...a.accentColor!==void 0&&{"--bm-accent":a.accentColor},...a.lineColor!==void 0&&{"--bm-line":a.lineColor},"--bm-font":`${a.fontSize}px`,"--bm-row":`${a.rowHeight}px`,"--bm-indent":`${a.indent}px`,"--bm-line-w":a.lineWidth,"--bm-pad":`${m}px`,"--bm-draw":`${a.drawDuration}ms`,"--bm-fold":`${a.foldDuration}ms`}));return(t,n)=>(e.openBlock(),e.createElementBlock("nav",{ref_key:"navRef",ref:y,class:e.normalizeClass(["g-branched",t.className]),style:e.normalizeStyle(O.value)},[e.createElementVNode("span",{ref_key:"markerRef",ref:w,class:"g-branched__marker","aria-hidden":"true"},null,512),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:l.value??l.label,class:"g-branched__section","data-open":l.children&&u.value.has(c)?"":void 0},[e.createElementVNode("button",{ref_for:!0,ref:o=>E[c]=o,type:"button",class:"g-branched__head","aria-expanded":l.children?u.value.has(c):void 0,"aria-current":!l.children&&(l.value??l.label)===s.value?"true":void 0,"data-active":!l.children&&(l.value??l.label)===s.value?"":void 0,onClick:o=>l.children?N(c):H(l.value??l.label,l)},e.toDisplayString(l.label),9,R),l.children?(e.openBlock(),e.createElementBlock("div",T,[e.createElementVNode("div",F,[e.createElementVNode("div",{class:"g-branched__body",style:e.normalizeStyle({height:`${m*2+l.children.length*t.rowHeight}px`})},[(e.openBlock(),e.createElementBlock("svg",{class:"g-branched__lines",width:t.indent,height:m*2+l.children.length*t.rowHeight,"aria-hidden":"true"},[e.createElementVNode("path",{class:"g-branched__path",d:M(l.children.length)},null,8,G),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.children,(o,h)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${o.value}`,class:"g-branched__path",d:V(h)},null,8,P))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.children,(o,h)=>(e.openBlock(),e.createElementBlock("path",{key:`reach-${o.value}`,class:"g-branched__path g-branched__path--accent",d:z(h),style:e.normalizeStyle({strokeDasharray:D(h),strokeDashoffset:o.value===s.value?0:D(h)})},null,12,q))),128))],8,L)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.children,o=>(e.openBlock(),e.createElementBlock("button",{key:o.value,type:"button",class:"g-branched__item","aria-current":o.value===s.value?"true":void 0,"data-active":o.value===s.value?"":void 0,tabindex:u.value.has(c)?0:-1,onClick:h=>H(o.value,o)},[o.icon?(e.openBlock(),e.createElementBlock("span",W,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon)))])):e.createCommentVNode("",!0),e.createElementVNode("span",K,e.toDisplayString(o.label),1)],8,U))),128))],4)])])):e.createCommentVNode("",!0)],8,I))),128))],6))}}),A=(d,k)=>{const v=d.__vccOpts||d;for(const[f,a]of k)v[f]=a;return v},g=A(X,[["__scopeId","data-v-cd651c8b"]]);g.install=d=>{d.component(g.name,g)};exports.GBranched=g;exports._export_sfc=A;
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import { defineComponent as W, computed as f, ref as $, onMounted as q, onUnmounted as K, watch as Q, createElementBlock as s, openBlock as o, normalizeStyle as A, normalizeClass as X, createElementVNode as _, Fragment as w, renderList as k, createCommentVNode as G, toDisplayString as N, createBlock as Y, resolveDynamicComponent as j } from "vue";
|
|
2
|
-
const J =
|
|
3
|
-
const b = d.__vccOpts || d;
|
|
4
|
-
for (const [p, a] of x)
|
|
5
|
-
b[p] = a;
|
|
6
|
-
return b;
|
|
7
|
-
}, Z = ["data-open"], ee = ["aria-expanded", "aria-current", "data-active", "onClick"], ae = {
|
|
2
|
+
const J = ["data-open"], Z = ["aria-expanded", "aria-current", "data-active", "onClick"], ee = {
|
|
8
3
|
key: 0,
|
|
9
4
|
class: "g-branched__fold"
|
|
10
|
-
},
|
|
5
|
+
}, ae = { class: "g-branched__clip" }, te = ["width", "height"], ne = ["d"], le = ["d"], oe = ["d"], re = ["aria-current", "data-active", "tabindex", "onClick"], se = {
|
|
11
6
|
key: 0,
|
|
12
7
|
class: "g-branched__icon",
|
|
13
8
|
"aria-hidden": "true"
|
|
14
|
-
},
|
|
9
|
+
}, ce = { class: "g-branched__label" }, C = 6, ue = 16, de = /* @__PURE__ */ W({
|
|
15
10
|
name: "GBranched",
|
|
16
11
|
__name: "index",
|
|
17
12
|
props: {
|
|
@@ -63,7 +58,7 @@ const J = (d, x) => {
|
|
|
63
58
|
const n = O.value, t = z[y.value];
|
|
64
59
|
if (!n) return;
|
|
65
60
|
const c = B.value && t;
|
|
66
|
-
e || (n.style.transition = "none"), c && (n.style.top = `${t.offsetTop + (t.offsetHeight -
|
|
61
|
+
e || (n.style.transition = "none"), c && (n.style.top = `${t.offsetTop + (t.offsetHeight - ue) / 2}px`), n.toggleAttribute("data-on", !!c), e || (n.offsetHeight, n.style.transition = "");
|
|
67
62
|
}, R = () => {
|
|
68
63
|
m?.disconnect(), I(!0);
|
|
69
64
|
let e = !0;
|
|
@@ -135,9 +130,9 @@ const J = (d, x) => {
|
|
|
135
130
|
"aria-current": !t.children && (t.value ?? t.label) === u.value ? "true" : void 0,
|
|
136
131
|
"data-active": !t.children && (t.value ?? t.label) === u.value ? "" : void 0,
|
|
137
132
|
onClick: (l) => t.children ? V(c) : T(t.value ?? t.label, t)
|
|
138
|
-
}, N(t.label), 9,
|
|
139
|
-
t.children ? (o(), s("div",
|
|
140
|
-
_("div",
|
|
133
|
+
}, N(t.label), 9, Z),
|
|
134
|
+
t.children ? (o(), s("div", ee, [
|
|
135
|
+
_("div", ae, [
|
|
141
136
|
_("div", {
|
|
142
137
|
class: "g-branched__body",
|
|
143
138
|
style: A({ height: `${C * 2 + t.children.length * e.rowHeight}px` })
|
|
@@ -151,12 +146,12 @@ const J = (d, x) => {
|
|
|
151
146
|
_("path", {
|
|
152
147
|
class: "g-branched__path",
|
|
153
148
|
d: L(t.children.length)
|
|
154
|
-
}, null, 8,
|
|
149
|
+
}, null, 8, ne),
|
|
155
150
|
(o(!0), s(w, null, k(t.children, (l, v) => (o(), s("path", {
|
|
156
151
|
key: `line-${l.value}`,
|
|
157
152
|
class: "g-branched__path",
|
|
158
153
|
d: P(v)
|
|
159
|
-
}, null, 8,
|
|
154
|
+
}, null, 8, le))), 128)),
|
|
160
155
|
(o(!0), s(w, null, k(t.children, (l, v) => (o(), s("path", {
|
|
161
156
|
key: `reach-${l.value}`,
|
|
162
157
|
class: "g-branched__path g-branched__path--accent",
|
|
@@ -165,8 +160,8 @@ const J = (d, x) => {
|
|
|
165
160
|
strokeDasharray: E(v),
|
|
166
161
|
strokeDashoffset: l.value === u.value ? 0 : E(v)
|
|
167
162
|
})
|
|
168
|
-
}, null, 12,
|
|
169
|
-
], 8,
|
|
163
|
+
}, null, 12, oe))), 128))
|
|
164
|
+
], 8, te)),
|
|
170
165
|
(o(!0), s(w, null, k(t.children, (l) => (o(), s("button", {
|
|
171
166
|
key: l.value,
|
|
172
167
|
type: "button",
|
|
@@ -176,22 +171,27 @@ const J = (d, x) => {
|
|
|
176
171
|
tabindex: i.value.has(c) ? 0 : -1,
|
|
177
172
|
onClick: (v) => T(l.value, l)
|
|
178
173
|
}, [
|
|
179
|
-
l.icon ? (o(), s("span",
|
|
174
|
+
l.icon ? (o(), s("span", se, [
|
|
180
175
|
(o(), Y(j(l.icon)))
|
|
181
176
|
])) : G("", !0),
|
|
182
|
-
_("span",
|
|
183
|
-
], 8,
|
|
177
|
+
_("span", ce, N(l.label), 1)
|
|
178
|
+
], 8, re))), 128))
|
|
184
179
|
], 4)
|
|
185
180
|
])
|
|
186
181
|
])) : G("", !0)
|
|
187
|
-
], 8,
|
|
182
|
+
], 8, J))), 128))
|
|
188
183
|
], 6));
|
|
189
184
|
}
|
|
190
|
-
}),
|
|
185
|
+
}), ie = (d, x) => {
|
|
186
|
+
const b = d.__vccOpts || d;
|
|
187
|
+
for (const [p, a] of x)
|
|
188
|
+
b[p] = a;
|
|
189
|
+
return b;
|
|
190
|
+
}, D = /* @__PURE__ */ ie(de, [["__scopeId", "data-v-cd651c8b"]]);
|
|
191
191
|
D.install = (d) => {
|
|
192
192
|
d.component(D.name, D);
|
|
193
193
|
};
|
|
194
194
|
export {
|
|
195
195
|
D as G,
|
|
196
|
-
|
|
196
|
+
ie as _
|
|
197
197
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("motion-v"),b=require("../GBranched-BtF7heMk.js"),B=["type","disabled"],h={key:0,class:"g-button__loading"},f={key:1,class:"g-button__icon"},_={key:2,class:"g-button__text"},v=e.defineComponent({name:"GButton",__name:"index",props:{type:{default:"default"},size:{default:"middle"},loading:{type:Boolean},disabled:{type:Boolean},block:{type:Boolean},nativeType:{default:"button"}},emits:["click"],setup(i,{emit:r}){const s=i,u=r,p=t=>{if(!(s.disabled||s.loading)){if(s.type!=="link"&&!g.value){const o=t.currentTarget.getBoundingClientRect(),c=t.clientX!==0||t.clientY!==0,k={id:++m,x:c?t.clientX-o.left:o.width/2,y:c?t.clientY-o.top:o.height/2,size:Math.hypot(o.width,o.height)*2};l.value.push(k)}u("click",t)}},l=e.ref([]);let m=0;const y=t=>{l.value=l.value.filter(a=>a.id!==t)},g=d.useReducedMotion();return(t,a)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["g-button",["g-button--"+t.type,"g-button--"+t.size,{"is-block":t.block,"is-loading":t.loading,"is-disabled":t.disabled}]]),type:t.nativeType,disabled:t.disabled||t.loading,onClick:p},[t.loading?(e.openBlock(),e.createElementBlock("span",h)):e.createCommentVNode("",!0),t.$slots.icon?(e.openBlock(),e.createElementBlock("span",f,[e.renderSlot(t.$slots,"icon",{},void 0,!0)])):e.createCommentVNode("",!0),t.$slots.default?(e.openBlock(),e.createElementBlock("span",_,[e.renderSlot(t.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,o=>(e.openBlock(),e.createBlock(e.unref(d.motion).span,{key:o.id,class:"g-button__wave",initial:{x:"-50%",y:"-50%",scale:0,opacity:.2},animate:{x:"-50%",y:"-50%",scale:1,opacity:0},transition:{duration:.6,ease:"easeOut"},style:e.normalizeStyle({left:o.x+"px",top:o.y+"px",width:o.size+"px",height:o.size+"px"}),onAnimationComplete:c=>y(o.id)},null,8,["style","onAnimationComplete"]))),128))],10,B))}}),n=b._export_sfc(v,[["__scopeId","data-v-39479b50"]]);n.install=i=>{i.component(n.name,n)};exports.GButton=n;exports.default=n;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as k, ref as _, createElementBlock as n, openBlock as o, normalizeClass as B, createCommentVNode as r, renderSlot as u, Fragment as v, renderList as z, createBlock as C, unref as $, normalizeStyle as
|
|
2
|
-
import { useReducedMotion as
|
|
3
|
-
import { _ as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as k, ref as _, createElementBlock as n, openBlock as o, normalizeClass as B, createCommentVNode as r, renderSlot as u, Fragment as v, renderList as z, createBlock as C, unref as $, normalizeStyle as M } from "vue";
|
|
2
|
+
import { useReducedMotion as T, motion as w } from "motion-v";
|
|
3
|
+
import { _ as A } from "../GBranched-vnLlYOl9.mjs";
|
|
4
|
+
const G = ["type", "disabled"], I = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "g-button__loading"
|
|
7
7
|
}, R = {
|
|
@@ -41,7 +41,7 @@ const A = ["type", "disabled"], I = {
|
|
|
41
41
|
let g = 0;
|
|
42
42
|
const b = (e) => {
|
|
43
43
|
i.value = i.value.filter((a) => a.id !== e);
|
|
44
|
-
}, f =
|
|
44
|
+
}, f = T();
|
|
45
45
|
return (e, a) => (o(), n("button", {
|
|
46
46
|
class: B(["g-button", [
|
|
47
47
|
"g-button--" + e.type,
|
|
@@ -63,21 +63,22 @@ const A = ["type", "disabled"], I = {
|
|
|
63
63
|
e.$slots.default ? (o(), n("span", S, [
|
|
64
64
|
u(e.$slots, "default", {}, void 0, !0)
|
|
65
65
|
])) : r("", !0),
|
|
66
|
-
(o(!0), n(v, null, z(i.value, (t) => (o(), C($(
|
|
66
|
+
(o(!0), n(v, null, z(i.value, (t) => (o(), C($(w).span, {
|
|
67
67
|
key: t.id,
|
|
68
68
|
class: "g-button__wave",
|
|
69
69
|
initial: { x: "-50%", y: "-50%", scale: 0, opacity: 0.2 },
|
|
70
70
|
animate: { x: "-50%", y: "-50%", scale: 1, opacity: 0 },
|
|
71
71
|
transition: { duration: 0.6, ease: "easeOut" },
|
|
72
|
-
style:
|
|
72
|
+
style: M({ left: t.x + "px", top: t.y + "px", width: t.size + "px", height: t.size + "px" }),
|
|
73
73
|
onAnimationComplete: (d) => b(t.id)
|
|
74
74
|
}, null, 8, ["style", "onAnimationComplete"]))), 128))
|
|
75
|
-
], 10,
|
|
75
|
+
], 10, G));
|
|
76
76
|
}
|
|
77
|
-
}), c = /* @__PURE__ */
|
|
77
|
+
}), c = /* @__PURE__ */ A(X, [["__scopeId", "data-v-39479b50"]]);
|
|
78
78
|
c.install = (s) => {
|
|
79
79
|
s.component(c.name, c);
|
|
80
80
|
};
|
|
81
81
|
export {
|
|
82
|
-
c as
|
|
82
|
+
c as GButton,
|
|
83
|
+
c as default
|
|
83
84
|
};
|
package/lib/GButton/style.css
CHANGED
|
@@ -1 +1,97 @@
|
|
|
1
|
-
@charset "UTF-8"
|
|
1
|
+
@charset "UTF-8";/*
|
|
2
|
+
* 组件库公共样式:全局 CSS 变量,供各组件消费
|
|
3
|
+
* 按模块拆分文件管理(颜色 → color.css,尺寸 → size.css),在此聚合引入
|
|
4
|
+
* 此文件额外承载非颜色非尺寸类变量,颜色变量一律放 color.css、尺寸变量一律放 size.css
|
|
5
|
+
*/
|
|
6
|
+
/*
|
|
7
|
+
* 颜色变量模块:所有颜色类 CSS 变量集中于此管理
|
|
8
|
+
* 变量统一携带 --g- 库名称空间前缀,避免污染宿主项目的命名空间
|
|
9
|
+
* 同一颜色全库共用一个变量(如 --g-primary-color),不再按组件拆分
|
|
10
|
+
* 派生色(primary-light 等)用 color-mix() 从基础色实时混出,
|
|
11
|
+
* 业务侧覆盖基础色换肤时派生色自动跟随,无需逐个同步
|
|
12
|
+
* 业务侧可在任意祖先节点(:root / body / 容器)覆盖同名变量实现换肤
|
|
13
|
+
*/
|
|
14
|
+
:root {
|
|
15
|
+
/* ===== 公共语义色(primary / success / warning / danger 全库共用) ===== */
|
|
16
|
+
--g-primary-color: #039be5; /* 主色,覆盖它即可换主题色,派生色自动联动 */
|
|
17
|
+
--g-primary-light-color: color-mix(in srgb, var(--g-primary-color) 10%, var(--g-bg-color)); /* 主色浅底,hover / 选中背景 */
|
|
18
|
+
--g-success-color: #50c189; /* 成功色 */
|
|
19
|
+
--g-warning-color: #f78716; /* 警告色 */
|
|
20
|
+
--g-danger-color: #e1594d; /* 危险色 */
|
|
21
|
+
--g-emphasis-color: #000000; /* 强调色(浅色模式黑,深色模式反白为白) */
|
|
22
|
+
--g-emphasis-text-color: #ffffff; /* 强调色上的文字色 */
|
|
23
|
+
|
|
24
|
+
/* ===== 公共中性色(随深色模式切换) ===== */
|
|
25
|
+
--g-text-color: rgba(0, 0, 0, 0.88); /* 主要文字色 */
|
|
26
|
+
--g-text-secondary-color: rgba(0, 0, 0, 0.45); /* 次要文字色 */
|
|
27
|
+
--g-text-placeholder-color: rgba(0, 0, 0, 0.35); /* 占位文字色 */
|
|
28
|
+
--g-bg-color: #ffffff; /* 组件背景色 */
|
|
29
|
+
--g-overlay-bg-color: #ffffff; /* 浮层(dropdown / 弹层)背景色 */
|
|
30
|
+
--g-overlay-mask-color: rgba(15, 23, 42, 0.32); /* 全屏遮罩底色(GDialog overlay / GSpin fullscreen 遮罩共用) */
|
|
31
|
+
--g-border-color: #dcdfe3; /* 边框色 */
|
|
32
|
+
--g-border-light-color: #e4e7ea; /* 更浅边框色(行分隔线等) */
|
|
33
|
+
--g-border-strong-color: #cdd0d4; /* 更深边框色(容器外框等) */
|
|
34
|
+
--g-fill-color: #f0f2f5; /* 填充色(表头渐变深端) */
|
|
35
|
+
--g-fill-light-color: #f5f7fa; /* 浅填充色(表头渐变浅端 / 底座背景) */
|
|
36
|
+
--g-fill-lighter-color: #fafafa; /* 更浅填充色(斑马纹) */
|
|
37
|
+
|
|
38
|
+
/* ===== 组件特有变量 ===== */
|
|
39
|
+
--g-button-default-color: #e8e8eb; /* default 按钮底色 */
|
|
40
|
+
--g-input-group-bg-color: #e8e8eb; /* input 的 prepend / append 拼接块底色 */
|
|
41
|
+
--g-scrubber-chip-color: #e8e8eb; /* GScrubber 数值刮擦器芯片底色 */
|
|
42
|
+
--g-scrubber-accent-color: var(--g-primary-color); /* GScrubber 主题色(填充 / 描边 / 增量气泡底),联动主色换肤 */
|
|
43
|
+
--g-scrubber-ghost-ink-color: #ffffff; /* GScrubber 增量气泡文字色(主色底上反白) */
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* 深色模式:跟随 vueuse useDark 的 html.dark 约定自动切换
|
|
47
|
+
仅覆盖随模式变化的值;--g-primary-light-color 混入的 --g-bg-color 在此处已是深色底,自动联动无需覆盖 */
|
|
48
|
+
html.dark {
|
|
49
|
+
--g-emphasis-color: #ffffff; /* 深色底上反白为白,避免融进背景 */
|
|
50
|
+
--g-emphasis-text-color: #000000; /* 反白后文字为黑 */
|
|
51
|
+
|
|
52
|
+
--g-text-color: #e5eaf3; /* 主要文字色 */
|
|
53
|
+
--g-text-secondary-color: rgba(255, 255, 255, 0.45);
|
|
54
|
+
--g-text-placeholder-color: rgba(255, 255, 255, 0.35);
|
|
55
|
+
--g-bg-color: #2b2b2f;
|
|
56
|
+
--g-overlay-bg-color: #1d1e1f; /* 浮层比页面底更深一档 */
|
|
57
|
+
--g-overlay-mask-color: rgba(0, 0, 0, 0.55); /* 深色底上遮罩加深 */
|
|
58
|
+
--g-border-color: #4c4d4f;
|
|
59
|
+
--g-border-light-color: #414243;
|
|
60
|
+
--g-border-strong-color: #636466;
|
|
61
|
+
--g-fill-color: #303030;
|
|
62
|
+
--g-fill-light-color: #262727;
|
|
63
|
+
--g-fill-lighter-color: #1d1e1f;
|
|
64
|
+
|
|
65
|
+
--g-button-default-color: #333336; /* 深色底上的 default 按钮底色 */
|
|
66
|
+
--g-input-group-bg-color: #333336; /* 深色拼接块底色 */
|
|
67
|
+
--g-scrubber-chip-color: #333336; /* 深色底上的刮擦器芯片底色 */
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/*
|
|
71
|
+
* 组件尺寸体系:大 / 中(默认)/ 小,全库统一(GButton / GInput / GTag / GSwitch 共用)
|
|
72
|
+
* 高度基准与 GButton 一致:large 40 / middle 32 / small 24,字号 16 / 14 / 12
|
|
73
|
+
* 组件以回退形式消费:var(--g-size-xxx, 组件内默认值),在任意祖先节点覆盖变量即可全库联动
|
|
74
|
+
* 圆角 / 内边距等派生尺寸由各组件按自身规则推导,不放这里
|
|
75
|
+
*/
|
|
76
|
+
:root {
|
|
77
|
+
/* 高度 */
|
|
78
|
+
--g-size-large-height: 40px;
|
|
79
|
+
--g-size-middle-height: 32px;
|
|
80
|
+
--g-size-small-height: 24px;
|
|
81
|
+
/* 字号 */
|
|
82
|
+
--g-size-large-font-size: 16px;
|
|
83
|
+
--g-size-middle-font-size: 14px;
|
|
84
|
+
--g-size-small-font-size: 12px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
:root {
|
|
89
|
+
/* ===== 公共浮层遮罩(GDialog overlay / GSpin fullscreen 遮罩共用) ===== */
|
|
90
|
+
--g-overlay-mask-backdrop: blur(4px) saturate(1.05); /* 遮罩背景毛玻璃效果,与底色变量 --g-overlay-mask-color 配套 */
|
|
91
|
+
|
|
92
|
+
/* ===== GButton ===== */
|
|
93
|
+
--g-button-bg-color: var(--g-button-default-color); /* 按钮背景色 @default 跟随 --g-button-default-color(深色模式自动切换) */
|
|
94
|
+
--g-button-font-size: var(--g-size-middle-font-size, 14px); /* 按钮字号 @default 跟随统一尺寸体系的 middle 档字号 */
|
|
95
|
+
--g-button-radius: 6px; /* 按钮圆角 @default 6px(large 尺寸 8px / small 尺寸 4px 由组件推导) */
|
|
96
|
+
}
|
|
97
|
+
.g-button[data-v-39479b50]{--g-button-wave-color: currentcolor;position:relative;display:inline-flex;align-items:center;justify-content:center;gap:6px;height:var(--g-size-middle-height, 32px);padding:0 15px;font-size:var(--g-button-font-size, 14px);line-height:1;white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;overflow:hidden;color:var(--g-text-color, rgba(0, 0, 0, .88));background:var(--g-button-bg-color, var(--g-button-default-color, #e8e8eb));border:none;border-radius:var(--g-button-radius, 6px);outline:none;transition:all .2s cubic-bezier(.645,.045,.355,1)}.g-button[data-v-39479b50]:not(.is-disabled):hover,.g-button[data-v-39479b50]:not(.is-disabled):focus-visible{border-color:var(--g-primary-color, #039be5);color:var(--g-primary-color, #039be5)}.g-button[data-v-39479b50]:not(.is-disabled):active{border-color:color-mix(in srgb,var(--g-primary-color, #039be5) 70%,#000);color:color-mix(in srgb,var(--g-primary-color, #039be5) 70%,#000)}.g-button.is-block[data-v-39479b50]{display:flex;width:100%}.g-button.is-disabled[data-v-39479b50]{cursor:not-allowed;opacity:.5}.g-button--large[data-v-39479b50]{height:var(--g-size-large-height, 40px);padding:0 20px;font-size:var(--g-size-large-font-size, 16px);border-radius:calc(var(--g-button-radius, 6px) + 2px)}.g-button--small[data-v-39479b50]{height:var(--g-size-small-height, 24px);padding:0 7px;font-size:var(--g-size-small-font-size, 12px);border-radius:calc(var(--g-button-radius, 6px) - 2px)}.g-button--primary[data-v-39479b50]{--g-button-wave-color: #fff;color:#fff;background:var(--g-primary-color, #039be5);border-color:var(--g-primary-color, #039be5)}.g-button--primary[data-v-39479b50]:not(.is-disabled):hover,.g-button--primary[data-v-39479b50]:not(.is-disabled):focus-visible{color:#fff;background:color-mix(in srgb,var(--g-primary-color, #039be5) 85%,#fff)}.g-button--primary[data-v-39479b50]:not(.is-disabled):active{color:#fff;background:color-mix(in srgb,var(--g-primary-color, #039be5) 70%,#000)}.g-button--success[data-v-39479b50],.g-button--warning[data-v-39479b50],.g-button--danger[data-v-39479b50]{--g-button-wave-color: #fff;color:#fff}.g-button--success[data-v-39479b50]:not(.is-disabled):hover,.g-button--success[data-v-39479b50]:not(.is-disabled):focus-visible,.g-button--warning[data-v-39479b50]:not(.is-disabled):hover,.g-button--warning[data-v-39479b50]:not(.is-disabled):focus-visible,.g-button--danger[data-v-39479b50]:not(.is-disabled):hover,.g-button--danger[data-v-39479b50]:not(.is-disabled):focus-visible{color:#fff;background:color-mix(in srgb,var(--g-button-type-color) 85%,#fff)}.g-button--success[data-v-39479b50]:not(.is-disabled):active,.g-button--warning[data-v-39479b50]:not(.is-disabled):active,.g-button--danger[data-v-39479b50]:not(.is-disabled):active{color:#fff;background:color-mix(in srgb,var(--g-button-type-color) 70%,#000)}.g-button--success[data-v-39479b50]{--g-button-type-color: var(--g-success-color, #50c189);background:var(--g-button-type-color);border-color:var(--g-button-type-color)}.g-button--warning[data-v-39479b50]{--g-button-type-color: var(--g-warning-color, #f78716);background:var(--g-button-type-color);border-color:var(--g-button-type-color)}.g-button--danger[data-v-39479b50]{--g-button-type-color: var(--g-danger-color, #e1594d);background:var(--g-button-type-color);border-color:var(--g-button-type-color)}.g-button--emphasis[data-v-39479b50]{--g-button-wave-color: var(--g-emphasis-text-color, #fff);color:var(--g-emphasis-text-color, #fff);background:var(--g-emphasis-color, #000)}.g-button--emphasis[data-v-39479b50]:not(.is-disabled):hover,.g-button--emphasis[data-v-39479b50]:not(.is-disabled):focus-visible{color:var(--g-emphasis-text-color, #fff);background:color-mix(in srgb,var(--g-emphasis-color, #000) 85%,var(--g-emphasis-text-color, #fff))}.g-button--emphasis[data-v-39479b50]:not(.is-disabled):active{color:var(--g-emphasis-text-color, #fff);background:color-mix(in srgb,var(--g-emphasis-color, #000) 70%,var(--g-emphasis-text-color, #fff))}.g-button--link[data-v-39479b50]{height:auto;padding:2px 5px;background:transparent;border-color:transparent}.g-button--link[data-v-39479b50]:not(.is-disabled):hover,.g-button--link[data-v-39479b50]:not(.is-disabled):focus-visible{color:color-mix(in srgb,var(--g-primary-color, #039be5) 85%,#fff);background:transparent}.g-button__loading[data-v-39479b50]{width:1em;height:1em;border:2px solid currentcolor;border-top-color:transparent;border-radius:50%;animation:g-button-spin-39479b50 .6s linear infinite}.g-button__icon[data-v-39479b50]{display:inline-flex;align-items:center}.g-button__icon[data-v-39479b50] svg{width:1em;height:1em;display:block}.g-button__wave[data-v-39479b50]{position:absolute;border-radius:50%;background:var(--g-button-wave-color);opacity:.2;pointer-events:none}@keyframes g-button-spin-39479b50{to{transform:rotate(360deg)}}
|
package/lib/GButton.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),U=require("../GBranched-BtF7heMk.js"),W={class:"g-card__content"},H=a.defineComponent({__name:"index",props:{className:{default:""},edgeSensitivity:{default:30},glowColor:{default:"40 80 80"},backgroundColor:{},borderRadius:{default:28},glowRadius:{default:40},glowIntensity:{default:1},coneSpread:{default:25},animated:{type:Boolean,default:!1},colors:{default:()=>["#c084fc","#f472b6","#38bdf8"]},fillOpacity:{default:.5},shadow:{type:Boolean,default:!0},glow:{type:Boolean,default:!0}},setup(v){function B(e){const t=e.match(/([\d.]+)\s*([\d.]+)%?\s*([\d.]+)%?/);return t?{h:parseFloat(t[1]),s:parseFloat(t[2]),l:parseFloat(t[3])}:{h:40,s:80,l:80}}function O(e,t){const{h:n,s:o,l}=B(e),c=`${n}deg ${o}% ${l}%`;return[[0,0,0,1,100,!0],[0,0,1,0,60,!0],[0,0,3,0,50,!0],[0,0,6,0,40,!0],[0,0,15,0,30,!0],[0,0,25,2,20,!0],[0,0,50,2,10,!0],[0,0,1,0,60,!1],[0,0,3,0,50,!1],[0,0,6,0,40,!1],[0,0,15,0,30,!1],[0,0,25,2,20,!1],[0,0,50,2,10,!1]].map(([d,s,$,k,T,q])=>{const D=Math.min(T*t,100);return`${q?"inset ":""}${d}px ${s}px ${$}px ${k}px hsl(${c} / ${D}%)`}).join(", ")}function C(e){return 1-Math.pow(1-e,3)}function w(e){return e*e*e}function b({start:e=0,end:t=100,duration:n=1e3,delay:o=0,ease:l=C,onUpdate:c,onEnd:i}){const d=performance.now()+o;function s(){const $=performance.now()-d,k=Math.min($/n,1);c(e+(t-e)*l(k)),k<1?requestAnimationFrame(s):i&&i()}setTimeout(()=>requestAnimationFrame(s),o)}const P=["80% 55%","69% 34%","8% 6%","41% 38%","86% 85%","82% 18%","51% 4%"],E=[0,1,2,0,1,2,1];function N(e){const t=[];for(let n=0;n<7;n++){const o=e[Math.min(E[n],e.length-1)];t.push(`radial-gradient(at ${P[n]}, ${o} 0px, transparent 50%)`)}return t.push(`linear-gradient(${e[0]} 0 100%)`),t}const r=v,S=a.computed(()=>r.backgroundColor??"transparent"),x=a.useTemplateRef("cardRef"),y=a.ref(!1),f=a.ref(45),p=a.ref(0),h=a.ref(!1),M=e=>{const{width:t,height:n}=e.getBoundingClientRect();return[t/2,n/2]},z=(e,t,n)=>{const[o,l]=M(e),c=t-o,i=n-l;let d=1/0,s=1/0;return c!==0&&(d=o/Math.abs(c)),i!==0&&(s=l/Math.abs(i)),Math.min(Math.max(1/Math.min(d,s),0),1)},V=(e,t,n)=>{const[o,l]=M(e),c=t-o,i=n-l;if(c===0&&i===0)return 0;let s=Math.atan2(i,c)*(180/Math.PI)+90;return s<0&&(s+=360),s},A=e=>{const t=x.value;if(!t)return;const n=t.getBoundingClientRect(),o=e.clientX-n.left,l=e.clientY-n.top;p.value=z(t,o,l),f.value=V(t,o,l)};a.watch(()=>r.animated,()=>{if(!r.animated)return;const e=110,t=465;h.value=!0,f.value=e,b({duration:500,onUpdate:n=>p.value=n/100}),b({ease:w,duration:1500,end:50,onUpdate:n=>{f.value=(t-e)*(n/100)+e}}),b({ease:C,delay:1500,duration:2250,start:50,end:100,onUpdate:n=>{f.value=(t-e)*(n/100)+e}}),b({ease:w,delay:2500,duration:1500,start:100,end:0,onUpdate:n=>p.value=n/100,onEnd:()=>h.value=!1})},{immediate:!0});const _=a.computed(()=>r.edgeSensitivity+20),g=a.computed(()=>y.value||h.value),I=a.computed(()=>g.value?Math.max(0,(p.value*100-_.value)/(100-_.value)):0),F=a.computed(()=>g.value?Math.max(0,(p.value*100-r.edgeSensitivity)/(100-r.edgeSensitivity)):0),R=a.computed(()=>N(r.colors)),j=a.computed(()=>R.value.map(e=>`${e} border-box`)),G=a.computed(()=>R.value.map(e=>`${e} padding-box`)),u=a.computed(()=>`${f.value.toFixed(3)}deg`);return(e,t)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"cardRef",ref:x,onPointermove:A,onPointerenter:t[0]||(t[0]=n=>y.value=!0),onPointerleave:t[1]||(t[1]=n=>y.value=!1),class:a.normalizeClass(["g-card",{"g-card--shadow":r.shadow},r.className]),style:a.normalizeStyle({background:S.value,borderRadius:r.borderRadius+"px"})},[r.glow?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",{class:"g-card__border",style:a.normalizeStyle({background:[`linear-gradient(${S.value} 0 100%) padding-box`,"linear-gradient(rgb(255 255 255 / 0%) 0% 100%) border-box",...j.value].join(", "),opacity:I.value,maskImage:`conic-gradient(from ${u.value} at center, black ${r.coneSpread}%, transparent ${r.coneSpread+15}%, transparent ${100-r.coneSpread-15}%, black ${100-r.coneSpread}%)`,WebkitMaskImage:`conic-gradient(from ${u.value} at center, black ${r.coneSpread}%, transparent ${r.coneSpread+15}%, transparent ${100-r.coneSpread-15}%, black ${100-r.coneSpread}%)`,transition:g.value?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"})},null,4),a.createElementVNode("div",{class:"g-card__fill",style:a.normalizeStyle({background:G.value.join(", "),maskImage:["linear-gradient(to bottom, black, black)","radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)","radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",`conic-gradient(from ${u.value} at center, transparent 5%, black 15%, black 85%, transparent 95%)`].join(", "),WebkitMaskImage:["linear-gradient(to bottom, black, black)","radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)","radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",`conic-gradient(from ${u.value} at center, transparent 5%, black 15%, black 85%, transparent 95%)`].join(", "),opacity:I.value*r.fillOpacity,transition:g.value?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"})},null,4),a.createElementVNode("span",{class:"g-card__glow",style:a.normalizeStyle({inset:`-${r.glowRadius}px`,maskImage:`conic-gradient(from ${u.value} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,WebkitMaskImage:`conic-gradient(from ${u.value} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,opacity:F.value,transition:g.value?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"})},[a.createElementVNode("span",{class:"g-card__glow-inner",style:a.normalizeStyle({inset:`${r.glowRadius}px`,boxShadow:O(r.glowColor,r.glowIntensity)})},null,4)],4)],64)):a.createCommentVNode("",!0),a.createElementVNode("div",W,[a.renderSlot(e.$slots,"default",{},void 0,!0)])],38))}}),m=U._export_sfc(H,[["__scopeId","data-v-7ef47624"]]),L=[{name:"Daylight",colors:["#5464f6ff","#c084fc","#38bdf8"],glowColor:"220 80 60",backgroundColor:"#f8fafc",dark:!1},{name:"Quartz",colors:["#f472b6","#fb7185","#f9a8d4"],glowColor:"340 80 65",backgroundColor:"#f8fafc",dark:!1},{name:"Matcha",colors:["#34d399","#86efac","#fbbf24"],glowColor:"150 60 50",backgroundColor:"#f8fafc",dark:!1},{name:"Ocean",colors:["#0ea5e9","#22d3ee","#6366f1"],glowColor:"200 90 65",backgroundColor:"#f8fafc",dark:!1},{name:"Daylight",colors:["#c084fc","#f472b6","#38bdf8"],glowColor:"280 80 75",backgroundColor:"#1d1e1f",dark:!0},{name:"Quartz",colors:["#f97316","#f43f5e","#facc15"],glowColor:"20 90 65",backgroundColor:"#1d1e1f",dark:!0},{name:"Matcha",colors:["#34d399","#10b981","#a7f3d0"],glowColor:"150 70 65",backgroundColor:"#1d1e1f",dark:!0},{name:"Ocean",colors:["#0ea5e9","#22d3ee","#6366f1"],glowColor:"200 90 65",backgroundColor:"#1d1e1f",dark:!0}];m.install=v=>{v.component(m.name,m)};exports.GCard=m;exports.cardPresets=L;exports.default=m;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as X, computed as i, useTemplateRef as Y, ref as y, watch as J, createElementBlock as A, openBlock as F, normalizeStyle as b, normalizeClass as K, createCommentVNode as Z, createElementVNode as m, Fragment as ee, renderSlot as ae } from "vue";
|
|
2
|
-
import { _ as te } from "
|
|
2
|
+
import { _ as te } from "../GBranched-vnLlYOl9.mjs";
|
|
3
3
|
const ne = { class: "g-card__content" }, re = /* @__PURE__ */ X({
|
|
4
4
|
__name: "index",
|
|
5
5
|
props: {
|
|
@@ -73,11 +73,11 @@ const ne = { class: "g-card__content" }, re = /* @__PURE__ */ X({
|
|
|
73
73
|
"86% 85%",
|
|
74
74
|
"82% 18%",
|
|
75
75
|
"51% 4%"
|
|
76
|
-
],
|
|
77
|
-
function
|
|
76
|
+
], z = [0, 1, 2, 0, 1, 2, 1];
|
|
77
|
+
function D(e) {
|
|
78
78
|
const a = [];
|
|
79
79
|
for (let t = 0; t < 7; t++) {
|
|
80
|
-
const r = e[Math.min(
|
|
80
|
+
const r = e[Math.min(z[t], e.length - 1)];
|
|
81
81
|
a.push(`radial-gradient(at ${j[t]}, ${r} 0px, transparent 50%)`);
|
|
82
82
|
}
|
|
83
83
|
return a.push(`linear-gradient(${e[0]} 0 100%)`), a;
|
|
@@ -85,7 +85,7 @@ const ne = { class: "g-card__content" }, re = /* @__PURE__ */ X({
|
|
|
85
85
|
const n = h, _ = i(() => n.backgroundColor ?? "transparent"), I = Y("cardRef"), $ = y(!1), f = y(45), p = y(0), C = y(!1), R = (e) => {
|
|
86
86
|
const { width: a, height: t } = e.getBoundingClientRect();
|
|
87
87
|
return [a / 2, t / 2];
|
|
88
|
-
},
|
|
88
|
+
}, G = (e, a, t) => {
|
|
89
89
|
const [r, o] = R(e), s = a - r, c = t - o;
|
|
90
90
|
let d = 1 / 0, l = 1 / 0;
|
|
91
91
|
return s !== 0 && (d = r / Math.abs(s)), c !== 0 && (l = o / Math.abs(c)), Math.min(Math.max(1 / Math.min(d, l), 0), 1);
|
|
@@ -98,7 +98,7 @@ const ne = { class: "g-card__content" }, re = /* @__PURE__ */ X({
|
|
|
98
98
|
const a = I.value;
|
|
99
99
|
if (!a) return;
|
|
100
100
|
const t = a.getBoundingClientRect(), r = e.clientX - t.left, o = e.clientY - t.top;
|
|
101
|
-
p.value =
|
|
101
|
+
p.value = G(a, r, o), f.value = T(a, r, o);
|
|
102
102
|
};
|
|
103
103
|
J(
|
|
104
104
|
() => n.animated,
|
|
@@ -143,7 +143,7 @@ const ne = { class: "g-card__content" }, re = /* @__PURE__ */ X({
|
|
|
143
143
|
0,
|
|
144
144
|
(p.value * 100 - n.edgeSensitivity) / (100 - n.edgeSensitivity)
|
|
145
145
|
) : 0
|
|
146
|
-
), P = i(() =>
|
|
146
|
+
), P = i(() => D(n.colors)), W = i(() => P.value.map((e) => `${e} border-box`)), q = i(() => P.value.map((e) => `${e} padding-box`)), u = i(() => `${f.value.toFixed(3)}deg`);
|
|
147
147
|
return (e, a) => (F(), A("div", {
|
|
148
148
|
ref_key: "cardRef",
|
|
149
149
|
ref: I,
|
|
@@ -285,6 +285,7 @@ x.install = (h) => {
|
|
|
285
285
|
h.component(x.name, x);
|
|
286
286
|
};
|
|
287
287
|
export {
|
|
288
|
-
x as
|
|
289
|
-
se as
|
|
288
|
+
x as GCard,
|
|
289
|
+
se as cardPresets,
|
|
290
|
+
x as default
|
|
290
291
|
};
|
package/lib/GCard/style.css
CHANGED
|
@@ -1 +1,98 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/*
|
|
3
|
+
* 组件库公共样式:全局 CSS 变量,供各组件消费
|
|
4
|
+
* 按模块拆分文件管理(颜色 → color.css,尺寸 → size.css),在此聚合引入
|
|
5
|
+
* 此文件额外承载非颜色非尺寸类变量,颜色变量一律放 color.css、尺寸变量一律放 size.css
|
|
6
|
+
*/
|
|
7
|
+
/*
|
|
8
|
+
* 颜色变量模块:所有颜色类 CSS 变量集中于此管理
|
|
9
|
+
* 变量统一携带 --g- 库名称空间前缀,避免污染宿主项目的命名空间
|
|
10
|
+
* 同一颜色全库共用一个变量(如 --g-primary-color),不再按组件拆分
|
|
11
|
+
* 派生色(primary-light 等)用 color-mix() 从基础色实时混出,
|
|
12
|
+
* 业务侧覆盖基础色换肤时派生色自动跟随,无需逐个同步
|
|
13
|
+
* 业务侧可在任意祖先节点(:root / body / 容器)覆盖同名变量实现换肤
|
|
14
|
+
*/
|
|
15
|
+
:root {
|
|
16
|
+
/* ===== 公共语义色(primary / success / warning / danger 全库共用) ===== */
|
|
17
|
+
--g-primary-color: #039be5; /* 主色,覆盖它即可换主题色,派生色自动联动 */
|
|
18
|
+
--g-primary-light-color: color-mix(in srgb, var(--g-primary-color) 10%, var(--g-bg-color)); /* 主色浅底,hover / 选中背景 */
|
|
19
|
+
--g-success-color: #50c189; /* 成功色 */
|
|
20
|
+
--g-warning-color: #f78716; /* 警告色 */
|
|
21
|
+
--g-danger-color: #e1594d; /* 危险色 */
|
|
22
|
+
--g-emphasis-color: #000000; /* 强调色(浅色模式黑,深色模式反白为白) */
|
|
23
|
+
--g-emphasis-text-color: #ffffff; /* 强调色上的文字色 */
|
|
24
|
+
|
|
25
|
+
/* ===== 公共中性色(随深色模式切换) ===== */
|
|
26
|
+
--g-text-color: rgba(0, 0, 0, 0.88); /* 主要文字色 */
|
|
27
|
+
--g-text-secondary-color: rgba(0, 0, 0, 0.45); /* 次要文字色 */
|
|
28
|
+
--g-text-placeholder-color: rgba(0, 0, 0, 0.35); /* 占位文字色 */
|
|
29
|
+
--g-bg-color: #ffffff; /* 组件背景色 */
|
|
30
|
+
--g-overlay-bg-color: #ffffff; /* 浮层(dropdown / 弹层)背景色 */
|
|
31
|
+
--g-overlay-mask-color: rgba(15, 23, 42, 0.32); /* 全屏遮罩底色(GDialog overlay / GSpin fullscreen 遮罩共用) */
|
|
32
|
+
--g-border-color: #dcdfe3; /* 边框色 */
|
|
33
|
+
--g-border-light-color: #e4e7ea; /* 更浅边框色(行分隔线等) */
|
|
34
|
+
--g-border-strong-color: #cdd0d4; /* 更深边框色(容器外框等) */
|
|
35
|
+
--g-fill-color: #f0f2f5; /* 填充色(表头渐变深端) */
|
|
36
|
+
--g-fill-light-color: #f5f7fa; /* 浅填充色(表头渐变浅端 / 底座背景) */
|
|
37
|
+
--g-fill-lighter-color: #fafafa; /* 更浅填充色(斑马纹) */
|
|
38
|
+
|
|
39
|
+
/* ===== 组件特有变量 ===== */
|
|
40
|
+
--g-button-default-color: #e8e8eb; /* default 按钮底色 */
|
|
41
|
+
--g-input-group-bg-color: #e8e8eb; /* input 的 prepend / append 拼接块底色 */
|
|
42
|
+
--g-scrubber-chip-color: #e8e8eb; /* GScrubber 数值刮擦器芯片底色 */
|
|
43
|
+
--g-scrubber-accent-color: var(--g-primary-color); /* GScrubber 主题色(填充 / 描边 / 增量气泡底),联动主色换肤 */
|
|
44
|
+
--g-scrubber-ghost-ink-color: #ffffff; /* GScrubber 增量气泡文字色(主色底上反白) */
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* 深色模式:跟随 vueuse useDark 的 html.dark 约定自动切换
|
|
48
|
+
仅覆盖随模式变化的值;--g-primary-light-color 混入的 --g-bg-color 在此处已是深色底,自动联动无需覆盖 */
|
|
49
|
+
html.dark {
|
|
50
|
+
--g-emphasis-color: #ffffff; /* 深色底上反白为白,避免融进背景 */
|
|
51
|
+
--g-emphasis-text-color: #000000; /* 反白后文字为黑 */
|
|
52
|
+
|
|
53
|
+
--g-text-color: #e5eaf3; /* 主要文字色 */
|
|
54
|
+
--g-text-secondary-color: rgba(255, 255, 255, 0.45);
|
|
55
|
+
--g-text-placeholder-color: rgba(255, 255, 255, 0.35);
|
|
56
|
+
--g-bg-color: #2b2b2f;
|
|
57
|
+
--g-overlay-bg-color: #1d1e1f; /* 浮层比页面底更深一档 */
|
|
58
|
+
--g-overlay-mask-color: rgba(0, 0, 0, 0.55); /* 深色底上遮罩加深 */
|
|
59
|
+
--g-border-color: #4c4d4f;
|
|
60
|
+
--g-border-light-color: #414243;
|
|
61
|
+
--g-border-strong-color: #636466;
|
|
62
|
+
--g-fill-color: #303030;
|
|
63
|
+
--g-fill-light-color: #262727;
|
|
64
|
+
--g-fill-lighter-color: #1d1e1f;
|
|
65
|
+
|
|
66
|
+
--g-button-default-color: #333336; /* 深色底上的 default 按钮底色 */
|
|
67
|
+
--g-input-group-bg-color: #333336; /* 深色拼接块底色 */
|
|
68
|
+
--g-scrubber-chip-color: #333336; /* 深色底上的刮擦器芯片底色 */
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/*
|
|
72
|
+
* 组件尺寸体系:大 / 中(默认)/ 小,全库统一(GButton / GInput / GTag / GSwitch 共用)
|
|
73
|
+
* 高度基准与 GButton 一致:large 40 / middle 32 / small 24,字号 16 / 14 / 12
|
|
74
|
+
* 组件以回退形式消费:var(--g-size-xxx, 组件内默认值),在任意祖先节点覆盖变量即可全库联动
|
|
75
|
+
* 圆角 / 内边距等派生尺寸由各组件按自身规则推导,不放这里
|
|
76
|
+
*/
|
|
77
|
+
:root {
|
|
78
|
+
/* 高度 */
|
|
79
|
+
--g-size-large-height: 40px;
|
|
80
|
+
--g-size-middle-height: 32px;
|
|
81
|
+
--g-size-small-height: 24px;
|
|
82
|
+
/* 字号 */
|
|
83
|
+
--g-size-large-font-size: 16px;
|
|
84
|
+
--g-size-middle-font-size: 14px;
|
|
85
|
+
--g-size-small-font-size: 12px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
:root {
|
|
90
|
+
/* ===== 公共浮层遮罩(GDialog overlay / GSpin fullscreen 遮罩共用) ===== */
|
|
91
|
+
--g-overlay-mask-backdrop: blur(4px) saturate(1.05); /* 遮罩背景毛玻璃效果,与底色变量 --g-overlay-mask-color 配套 */
|
|
92
|
+
|
|
93
|
+
/* ===== GButton ===== */
|
|
94
|
+
--g-button-bg-color: var(--g-button-default-color); /* 按钮背景色 @default 跟随 --g-button-default-color(深色模式自动切换) */
|
|
95
|
+
--g-button-font-size: var(--g-size-middle-font-size, 14px); /* 按钮字号 @default 跟随统一尺寸体系的 middle 档字号 */
|
|
96
|
+
--g-button-radius: 6px; /* 按钮圆角 @default 6px(large 尺寸 8px / small 尺寸 4px 由组件推导) */
|
|
97
|
+
}
|
|
1
98
|
.g-card[data-v-7ef47624]{position:relative;display:grid;isolation:isolate;border:1px solid rgba(255,255,255,.15);transform:translateZ(.01px)}.g-card--shadow[data-v-7ef47624]{box-shadow:#0000000d 0 2px 8px,#0000000d 0 16px 40px}.g-card__border[data-v-7ef47624],.g-card__fill[data-v-7ef47624]{position:absolute;inset:0;z-index:-1;border:1px solid transparent;border-radius:inherit}.g-card__fill[data-v-7ef47624]{mask-composite:subtract,add,add,add,add,add;-webkit-mask-composite:source-out,source-over,source-over,source-over,source-over,source-over;mix-blend-mode:soft-light}.g-card__glow[data-v-7ef47624]{position:absolute;z-index:1;border-radius:inherit;pointer-events:none;mix-blend-mode:plus-lighter}.g-card__glow-inner[data-v-7ef47624]{position:absolute;border-radius:inherit}.g-card__content[data-v-7ef47624]{position:relative;z-index:1;display:flex;flex-direction:column;overflow:auto}
|
package/lib/GCard.d.ts
ADDED