@endfield-ui/react 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/NOTICE.md +27 -0
- package/README.md +818 -2
- package/dist/index.d.ts +3445 -0
- package/dist/index.js +8706 -0
- package/dist/styles.css +2 -0
- package/package.json +83 -3
- package/src/components/README.md +179 -0
- package/src/components/accordion/Accordion.tsx +168 -0
- package/src/components/accordion/index.ts +8 -0
- package/src/components/alert/Alert.tsx +106 -0
- package/src/components/alert/index.ts +1 -0
- package/src/components/avatar/Avatar.tsx +92 -0
- package/src/components/avatar/AvatarSwitcher.tsx +261 -0
- package/src/components/avatar/index.ts +8 -0
- package/src/components/back-to-top/BackToTop.tsx +124 -0
- package/src/components/back-to-top/index.ts +5 -0
- package/src/components/badge/Badge.tsx +75 -0
- package/src/components/badge/index.ts +1 -0
- package/src/components/bracket-title/BracketTitle.tsx +40 -0
- package/src/components/bracket-title/index.ts +1 -0
- package/src/components/breadcrumb/Breadcrumb.tsx +161 -0
- package/src/components/breadcrumb/index.ts +6 -0
- package/src/components/button/Button.tsx +357 -0
- package/src/components/button/ButtonGroup.tsx +55 -0
- package/src/components/button/index.ts +13 -0
- package/src/components/calendar/Calendar.tsx +443 -0
- package/src/components/calendar/index.ts +7 -0
- package/src/components/carousel/Carousel.tsx +252 -0
- package/src/components/carousel/index.ts +7 -0
- package/src/components/carousel/snap-track.ts +74 -0
- package/src/components/checkbox/Checkbox.tsx +94 -0
- package/src/components/checkbox/choice-style.ts +30 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/chip/FilterChip.tsx +68 -0
- package/src/components/chip/ResourceChip.tsx +63 -0
- package/src/components/chip/capsule-style.ts +22 -0
- package/src/components/chip/index.ts +6 -0
- package/src/components/combobox/Combobox.tsx +450 -0
- package/src/components/combobox/index.ts +10 -0
- package/src/components/completion-banner/CompletionBanner.tsx +72 -0
- package/src/components/completion-banner/index.ts +4 -0
- package/src/components/context-menu/ContextMenu.tsx +70 -0
- package/src/components/context-menu/index.ts +5 -0
- package/src/components/corner-brackets/CornerBrackets.tsx +43 -0
- package/src/components/corner-brackets/index.ts +5 -0
- package/src/components/countdown/Countdown.tsx +145 -0
- package/src/components/countdown/index.ts +6 -0
- package/src/components/dash-indicator/DashIndicator.tsx +44 -0
- package/src/components/dash-indicator/index.ts +1 -0
- package/src/components/data-row/DataRow.tsx +282 -0
- package/src/components/data-row/index.ts +8 -0
- package/src/components/date-picker/DateField.tsx +159 -0
- package/src/components/date-picker/DatePicker.tsx +182 -0
- package/src/components/date-picker/DateRangePicker.tsx +203 -0
- package/src/components/date-picker/index.ts +7 -0
- package/src/components/dialog/Dialog.tsx +203 -0
- package/src/components/dialog/index.ts +7 -0
- package/src/components/dialog/initial-focus.ts +19 -0
- package/src/components/dialog/overlay-style.ts +28 -0
- package/src/components/drawer/Drawer.tsx +213 -0
- package/src/components/drawer/index.ts +6 -0
- package/src/components/dropdown-menu/DropdownMenu.tsx +427 -0
- package/src/components/dropdown-menu/MenuCheck.tsx +44 -0
- package/src/components/dropdown-menu/index.ts +22 -0
- package/src/components/dropdown-menu/menu-style.ts +47 -0
- package/src/components/empty-state/EmptyState.tsx +79 -0
- package/src/components/empty-state/index.ts +1 -0
- package/src/components/field/Field.tsx +203 -0
- package/src/components/field/index.ts +6 -0
- package/src/components/file-upload/FileItem.tsx +201 -0
- package/src/components/file-upload/FileUpload.tsx +425 -0
- package/src/components/file-upload/index.ts +9 -0
- package/src/components/flyout-bar/FlyoutBar.tsx +158 -0
- package/src/components/flyout-bar/index.ts +7 -0
- package/src/components/ghost-text/GhostText.tsx +47 -0
- package/src/components/ghost-text/index.ts +5 -0
- package/src/components/hatch/Hatch.tsx +35 -0
- package/src/components/hatch/index.ts +1 -0
- package/src/components/hazard-stripe/HazardStripe.tsx +35 -0
- package/src/components/hazard-stripe/index.ts +5 -0
- package/src/components/hover-card/HoverCard.tsx +101 -0
- package/src/components/hover-card/index.ts +6 -0
- package/src/components/icon-button/IconButton.tsx +95 -0
- package/src/components/icon-button/index.ts +6 -0
- package/src/components/image-viewer/ImageViewer.tsx +427 -0
- package/src/components/image-viewer/index.ts +7 -0
- package/src/components/input/Input.tsx +109 -0
- package/src/components/input/control-box.ts +71 -0
- package/src/components/input/index.ts +6 -0
- package/src/components/input/value-chip.ts +34 -0
- package/src/components/item-slot/ItemGrid.tsx +207 -0
- package/src/components/item-slot/ItemSlot.tsx +284 -0
- package/src/components/item-slot/index.ts +7 -0
- package/src/components/kbd/Kbd.tsx +33 -0
- package/src/components/kbd/index.ts +1 -0
- package/src/components/link-element/LinkElement.tsx +25 -0
- package/src/components/list/List.tsx +229 -0
- package/src/components/list/band-style.ts +18 -0
- package/src/components/list/index.ts +8 -0
- package/src/components/loader/Loader.tsx +154 -0
- package/src/components/loader/index.ts +1 -0
- package/src/components/marquee/Marquee.tsx +96 -0
- package/src/components/marquee/index.ts +1 -0
- package/src/components/media-card/MediaCard.tsx +139 -0
- package/src/components/media-card/index.ts +5 -0
- package/src/components/nav-action/NavAction.tsx +142 -0
- package/src/components/nav-action/index.ts +5 -0
- package/src/components/nav-menu/NavMenu.tsx +288 -0
- package/src/components/nav-menu/index.ts +6 -0
- package/src/components/navigator/Navigator.tsx +136 -0
- package/src/components/navigator/index.ts +5 -0
- package/src/components/otp-input/OtpInput.tsx +211 -0
- package/src/components/otp-input/index.ts +7 -0
- package/src/components/page-header/PageHeader.tsx +182 -0
- package/src/components/page-header/index.ts +6 -0
- package/src/components/pagination/Pagination.tsx +181 -0
- package/src/components/pagination/index.ts +5 -0
- package/src/components/panel/Panel.tsx +114 -0
- package/src/components/panel/index.ts +13 -0
- package/src/components/play-button/PlayButton.tsx +92 -0
- package/src/components/play-button/index.ts +7 -0
- package/src/components/popover/Popover.tsx +97 -0
- package/src/components/popover/index.ts +8 -0
- package/src/components/popover/panel-style.ts +15 -0
- package/src/components/progress/Progress.tsx +133 -0
- package/src/components/progress/ProgressRing.tsx +123 -0
- package/src/components/progress/index.ts +2 -0
- package/src/components/radio/Radio.tsx +182 -0
- package/src/components/radio/index.ts +7 -0
- package/src/components/rec-indicator/RecIndicator.tsx +47 -0
- package/src/components/rec-indicator/index.ts +1 -0
- package/src/components/registration-strip/RegistrationStrip.tsx +51 -0
- package/src/components/registration-strip/index.ts +5 -0
- package/src/components/schedule/Schedule.tsx +457 -0
- package/src/components/schedule/index.ts +9 -0
- package/src/components/scroll-area/ScrollArea.tsx +137 -0
- package/src/components/scroll-area/index.ts +5 -0
- package/src/components/scroll-hint/ScrollHint.tsx +78 -0
- package/src/components/scroll-hint/index.ts +5 -0
- package/src/components/section-title/SectionTitle.tsx +202 -0
- package/src/components/section-title/index.ts +5 -0
- package/src/components/segmented-control/SegmentedControl.tsx +220 -0
- package/src/components/segmented-control/index.ts +8 -0
- package/src/components/select/Select.tsx +390 -0
- package/src/components/select/index.ts +15 -0
- package/src/components/side-rail/SideRail.tsx +317 -0
- package/src/components/side-rail/SideRailSub.tsx +298 -0
- package/src/components/side-rail/index.ts +14 -0
- package/src/components/skeleton/Skeleton.tsx +70 -0
- package/src/components/skeleton/index.ts +1 -0
- package/src/components/slider/Slider.tsx +219 -0
- package/src/components/slider/index.ts +8 -0
- package/src/components/sparkline/Sparkline.tsx +122 -0
- package/src/components/sparkline/index.ts +6 -0
- package/src/components/spinner/Spinner.tsx +64 -0
- package/src/components/spinner/index.ts +1 -0
- package/src/components/stat/Stat.tsx +79 -0
- package/src/components/stat/index.ts +1 -0
- package/src/components/stepper/Stepper.tsx +316 -0
- package/src/components/stepper/index.ts +1 -0
- package/src/components/steps/Steps.tsx +302 -0
- package/src/components/steps/index.ts +10 -0
- package/src/components/switch/Switch.tsx +120 -0
- package/src/components/switch/index.ts +1 -0
- package/src/components/table/Table.tsx +560 -0
- package/src/components/table/index.ts +20 -0
- package/src/components/tabs/Tabs.tsx +313 -0
- package/src/components/tabs/index.ts +12 -0
- package/src/components/tag/Tag.tsx +66 -0
- package/src/components/tag/TagPair.tsx +34 -0
- package/src/components/tag/index.ts +2 -0
- package/src/components/tag-input/TagInput.tsx +502 -0
- package/src/components/tag-input/index.ts +8 -0
- package/src/components/term/Term.tsx +53 -0
- package/src/components/term/index.ts +1 -0
- package/src/components/textarea/Textarea.tsx +99 -0
- package/src/components/textarea/index.ts +1 -0
- package/src/components/texture/Texture.tsx +45 -0
- package/src/components/texture/index.ts +1 -0
- package/src/components/tick-ring/TickRing.tsx +77 -0
- package/src/components/tick-ring/index.ts +1 -0
- package/src/components/timeline/Timeline.tsx +84 -0
- package/src/components/timeline/index.ts +7 -0
- package/src/components/toast/Toast.tsx +257 -0
- package/src/components/toast/index.ts +10 -0
- package/src/components/toc/Toc.tsx +263 -0
- package/src/components/toc/index.ts +7 -0
- package/src/components/toolbar/Toolbar.tsx +389 -0
- package/src/components/toolbar/index.ts +17 -0
- package/src/components/tooltip/Tooltip.tsx +175 -0
- package/src/components/tooltip/index.ts +8 -0
- package/src/components/top-bar/TopBar.tsx +47 -0
- package/src/components/top-bar/index.ts +1 -0
- package/src/components/viewfinder/Viewfinder.tsx +97 -0
- package/src/components/viewfinder/index.ts +6 -0
- package/src/hooks/README.md +14 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useControllableState.ts +30 -0
- package/src/hooks/useInView.ts +44 -0
- package/src/hooks/useOverflowing.ts +28 -0
- package/src/hooks/usePortalScope.ts +68 -0
- package/src/hooks/useScrollPosition.ts +57 -0
- package/src/hooks/useTheme.ts +102 -0
- package/src/icons/ArrowCorner.tsx +7 -0
- package/src/icons/ArrowLeft.tsx +6 -0
- package/src/icons/ArrowRight.tsx +6 -0
- package/src/icons/CalendarIcon.tsx +10 -0
- package/src/icons/Check.tsx +4 -0
- package/src/icons/ChevronDown.tsx +3 -0
- package/src/icons/ChevronLeft.tsx +6 -0
- package/src/icons/ChevronRight.tsx +6 -0
- package/src/icons/Close.tsx +3 -0
- package/src/icons/Crosshair.tsx +7 -0
- package/src/icons/Lock.tsx +6 -0
- package/src/icons/Menu.tsx +4 -0
- package/src/icons/Minus.tsx +4 -0
- package/src/icons/Plus.tsx +3 -0
- package/src/icons/README.md +31 -0
- package/src/icons/StatusDanger.tsx +7 -0
- package/src/icons/StatusInfo.tsx +7 -0
- package/src/icons/StatusSuccess.tsx +10 -0
- package/src/icons/StatusWarning.tsx +7 -0
- package/src/icons/TriangleRight.tsx +7 -0
- package/src/icons/Upload.tsx +7 -0
- package/src/icons/createIcon.tsx +34 -0
- package/src/icons/index.ts +21 -0
- package/src/index.ts +87 -0
- package/src/lib/README.md +17 -0
- package/src/lib/cn.ts +34 -0
- package/src/lib/date.ts +125 -0
- package/src/lib/decor.ts +6 -0
- package/src/lib/defined.ts +9 -0
- package/src/lib/file.ts +61 -0
- package/src/lib/focus-ring.ts +11 -0
- package/src/lib/merge-refs.ts +11 -0
- package/src/styles/README.md +70 -0
- package/src/styles/index.css +25 -0
- package/src/styles/theme.css +568 -0
- package/src/styles/utilities.css +241 -0
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* endfield-ui 设计令牌(草案)
|
|
3
|
+
*
|
|
4
|
+
* 用法:
|
|
5
|
+
* @import "tailwindcss";
|
|
6
|
+
* @import "./theme.css";
|
|
7
|
+
*
|
|
8
|
+
* 结构:
|
|
9
|
+
* 1. 语义变量 随主题变化;亮色在 :root 与 [data-theme="light"],
|
|
10
|
+
* 暗色在 [data-theme="dark"]。两种都可以加在局部容器上。
|
|
11
|
+
* [data-theme="inverse"] 是"和所在主题相反",给反转块用
|
|
12
|
+
* 2. @theme 不随主题变化的原始令牌
|
|
13
|
+
* 3. @theme inline 把语义变量映射成 Tailwind 颜色工具类
|
|
14
|
+
*
|
|
15
|
+
* 每个值的依据与来源等级(实测 / 观察 / 社区 / 推断)写在
|
|
16
|
+
* docs/design/foundations/ 下的对应文档里;改值时两边一起改。
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/* ------------------------------------------------------------------ */
|
|
20
|
+
/* 1. 语义变量 */
|
|
21
|
+
/* ------------------------------------------------------------------ */
|
|
22
|
+
|
|
23
|
+
:root,
|
|
24
|
+
[data-theme="light"] {
|
|
25
|
+
color-scheme: light;
|
|
26
|
+
|
|
27
|
+
/* 表面 */
|
|
28
|
+
--ef-surface: #ffffff;
|
|
29
|
+
--ef-surface-raised: #fafafa;
|
|
30
|
+
--ef-surface-sunken: #f2f2f2;
|
|
31
|
+
--ef-surface-muted: #e6e6e6;
|
|
32
|
+
--ef-surface-inverse: #191919;
|
|
33
|
+
|
|
34
|
+
/* 文字 */
|
|
35
|
+
--ef-ink: #191919;
|
|
36
|
+
--ef-ink-secondary: #626262;
|
|
37
|
+
--ef-ink-tertiary: #8a8a8a;
|
|
38
|
+
--ef-ink-disabled: #b3b3b3;
|
|
39
|
+
--ef-ink-inverse: #ffffff;
|
|
40
|
+
|
|
41
|
+
/* 线 */
|
|
42
|
+
--ef-line: #d9d9d9;
|
|
43
|
+
--ef-line-strong: #b3b3b3;
|
|
44
|
+
|
|
45
|
+
/* 行动与选中 */
|
|
46
|
+
--ef-action: #fffa00;
|
|
47
|
+
--ef-action-pressed: #eeea00;
|
|
48
|
+
--ef-on-action: #191919;
|
|
49
|
+
--ef-accent-ink: #6b5d00;
|
|
50
|
+
/* 反转块(surface-inverse)上的强调记号:亮色主题下反转块是墨色,直接用行动色 */
|
|
51
|
+
--ef-accent-ink-inverse: var(--ef-action);
|
|
52
|
+
|
|
53
|
+
/* 中性控件 */
|
|
54
|
+
--ef-control: #383838;
|
|
55
|
+
--ef-control-hover: #484848;
|
|
56
|
+
--ef-control-pressed: #282828;
|
|
57
|
+
--ef-on-control: #eeeeee;
|
|
58
|
+
|
|
59
|
+
/* 禁用控件的填充与其上的文字 */
|
|
60
|
+
--ef-disabled: #b3b3b3;
|
|
61
|
+
--ef-on-disabled: #626262;
|
|
62
|
+
|
|
63
|
+
/* 焦点与遮罩 */
|
|
64
|
+
--ef-focus: #191919;
|
|
65
|
+
--ef-scrim: rgb(0 0 0 / 0.5);
|
|
66
|
+
|
|
67
|
+
/* 状态(文字级,在亮色表面上 ≥ 4.5:1) */
|
|
68
|
+
--ef-danger: #de0909;
|
|
69
|
+
--ef-success: #007f43;
|
|
70
|
+
--ef-warning: #b74e00;
|
|
71
|
+
--ef-info: #25759f;
|
|
72
|
+
|
|
73
|
+
/*
|
|
74
|
+
* 相反主题的取值,给 [data-theme="inverse"] 用:和暗色那一块逐项相同
|
|
75
|
+
* (有一条测试核对)。两个主题下取值相同的令牌不用列;
|
|
76
|
+
* 底、字、强调色不在这里,由反转块的父元素现抄,见下面
|
|
77
|
+
*/
|
|
78
|
+
--ef-x-scheme: dark;
|
|
79
|
+
--ef-x-surface-raised: #1f1f1f;
|
|
80
|
+
--ef-x-surface-sunken: #000000;
|
|
81
|
+
--ef-x-surface-muted: #282828;
|
|
82
|
+
--ef-x-ink-secondary: #b3b3b3;
|
|
83
|
+
--ef-x-ink-disabled: #626262;
|
|
84
|
+
--ef-x-line: #383838;
|
|
85
|
+
--ef-x-line-strong: #626262;
|
|
86
|
+
--ef-x-disabled: #282828;
|
|
87
|
+
--ef-x-focus: #fffa00;
|
|
88
|
+
--ef-x-scrim: rgb(0 0 0 / 0.7);
|
|
89
|
+
--ef-x-danger: #f74040;
|
|
90
|
+
--ef-x-success: #00d872;
|
|
91
|
+
--ef-x-warning: #fc6c00;
|
|
92
|
+
--ef-x-info: #2d8fc2;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
[data-theme="dark"] {
|
|
96
|
+
color-scheme: dark;
|
|
97
|
+
|
|
98
|
+
--ef-surface: #141414;
|
|
99
|
+
--ef-surface-raised: #1f1f1f;
|
|
100
|
+
--ef-surface-sunken: #000000;
|
|
101
|
+
--ef-surface-muted: #282828;
|
|
102
|
+
--ef-surface-inverse: #fafafa;
|
|
103
|
+
|
|
104
|
+
--ef-ink: #fafafa;
|
|
105
|
+
--ef-ink-secondary: #b3b3b3;
|
|
106
|
+
--ef-ink-tertiary: #8a8a8a;
|
|
107
|
+
--ef-ink-disabled: #626262;
|
|
108
|
+
--ef-ink-inverse: #191919;
|
|
109
|
+
|
|
110
|
+
--ef-line: #383838;
|
|
111
|
+
--ef-line-strong: #626262;
|
|
112
|
+
|
|
113
|
+
--ef-action: #fffa00;
|
|
114
|
+
--ef-action-pressed: #eeea00;
|
|
115
|
+
--ef-on-action: #191919;
|
|
116
|
+
--ef-accent-ink: #fffa00;
|
|
117
|
+
/* 暗色主题下反转块是近白,记号换成强调色的文字档 */
|
|
118
|
+
--ef-accent-ink-inverse: #6b5d00;
|
|
119
|
+
|
|
120
|
+
--ef-control: #383838;
|
|
121
|
+
--ef-control-hover: #484848;
|
|
122
|
+
--ef-control-pressed: #282828;
|
|
123
|
+
--ef-on-control: #eeeeee;
|
|
124
|
+
|
|
125
|
+
--ef-disabled: #282828;
|
|
126
|
+
--ef-on-disabled: #626262;
|
|
127
|
+
|
|
128
|
+
--ef-focus: #fffa00;
|
|
129
|
+
--ef-scrim: rgb(0 0 0 / 0.7);
|
|
130
|
+
|
|
131
|
+
/* 状态(文字级,在暗色表面上 ≥ 4.5:1) */
|
|
132
|
+
--ef-danger: #f74040;
|
|
133
|
+
--ef-success: #00d872;
|
|
134
|
+
--ef-warning: #fc6c00;
|
|
135
|
+
--ef-info: #2d8fc2;
|
|
136
|
+
|
|
137
|
+
/* 相反主题的取值:和亮色那一块逐项相同 */
|
|
138
|
+
--ef-x-scheme: light;
|
|
139
|
+
--ef-x-surface-raised: #fafafa;
|
|
140
|
+
--ef-x-surface-sunken: #f2f2f2;
|
|
141
|
+
--ef-x-surface-muted: #e6e6e6;
|
|
142
|
+
--ef-x-ink-secondary: #626262;
|
|
143
|
+
--ef-x-ink-disabled: #b3b3b3;
|
|
144
|
+
--ef-x-line: #d9d9d9;
|
|
145
|
+
--ef-x-line-strong: #b3b3b3;
|
|
146
|
+
--ef-x-disabled: #b3b3b3;
|
|
147
|
+
--ef-x-focus: #191919;
|
|
148
|
+
--ef-x-scrim: rgb(0 0 0 / 0.5);
|
|
149
|
+
--ef-x-danger: #de0909;
|
|
150
|
+
--ef-x-success: #007f43;
|
|
151
|
+
--ef-x-warning: #b74e00;
|
|
152
|
+
--ef-x-info: #25759f;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/*
|
|
156
|
+
* 反转块:标题带这类"和页面相反"的区域。把它做成一个局部主题,里面的控件、
|
|
157
|
+
* 焦点环就按这块底色取值,不用逐个改写法。
|
|
158
|
+
*
|
|
159
|
+
* 它的底、字、强调色就是所在处的 surface-inverse / ink-inverse / accent-ink-inverse
|
|
160
|
+
* ——反转块换成这个写法之后颜色不变,局部改过的强调色(主题色接管)也带得进来。
|
|
161
|
+
* 但一个元素读不到自己正在改写的变量在父级是什么值,所以由**父元素**把这三对
|
|
162
|
+
* 对调着抄一份(--ef-x-*),反转块再从继承来的那份里取。
|
|
163
|
+
*
|
|
164
|
+
* 反转块里面不再抄:反转块里再嵌一层反转块不会翻回去,和外面那层相同。
|
|
165
|
+
*/
|
|
166
|
+
:has(> [data-theme="inverse"]):not(
|
|
167
|
+
[data-theme="inverse"],
|
|
168
|
+
[data-theme="inverse"] *
|
|
169
|
+
) {
|
|
170
|
+
--ef-x-surface: var(--ef-surface-inverse);
|
|
171
|
+
--ef-x-surface-inverse: var(--ef-surface);
|
|
172
|
+
--ef-x-ink: var(--ef-ink-inverse);
|
|
173
|
+
--ef-x-ink-inverse: var(--ef-ink);
|
|
174
|
+
--ef-x-accent-ink: var(--ef-accent-ink-inverse);
|
|
175
|
+
--ef-x-accent-ink-inverse: var(--ef-accent-ink);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/*
|
|
179
|
+
* 其余的令牌取相反主题的值:亮、暗两块里各备了一份。走的是继承,
|
|
180
|
+
* 取到的一定是最近那个主题的反面——亮、暗两个容器同时在页面上时(并排预览)也不会取错
|
|
181
|
+
*/
|
|
182
|
+
[data-theme="inverse"] {
|
|
183
|
+
color-scheme: var(--ef-x-scheme);
|
|
184
|
+
|
|
185
|
+
--ef-surface: var(--ef-x-surface);
|
|
186
|
+
--ef-surface-raised: var(--ef-x-surface-raised);
|
|
187
|
+
--ef-surface-sunken: var(--ef-x-surface-sunken);
|
|
188
|
+
--ef-surface-muted: var(--ef-x-surface-muted);
|
|
189
|
+
--ef-surface-inverse: var(--ef-x-surface-inverse);
|
|
190
|
+
|
|
191
|
+
--ef-ink: var(--ef-x-ink);
|
|
192
|
+
--ef-ink-secondary: var(--ef-x-ink-secondary);
|
|
193
|
+
--ef-ink-disabled: var(--ef-x-ink-disabled);
|
|
194
|
+
--ef-ink-inverse: var(--ef-x-ink-inverse);
|
|
195
|
+
|
|
196
|
+
--ef-line: var(--ef-x-line);
|
|
197
|
+
--ef-line-strong: var(--ef-x-line-strong);
|
|
198
|
+
|
|
199
|
+
--ef-accent-ink: var(--ef-x-accent-ink);
|
|
200
|
+
--ef-accent-ink-inverse: var(--ef-x-accent-ink-inverse);
|
|
201
|
+
|
|
202
|
+
--ef-disabled: var(--ef-x-disabled);
|
|
203
|
+
|
|
204
|
+
--ef-focus: var(--ef-x-focus);
|
|
205
|
+
--ef-scrim: var(--ef-x-scrim);
|
|
206
|
+
|
|
207
|
+
--ef-danger: var(--ef-x-danger);
|
|
208
|
+
--ef-success: var(--ef-x-success);
|
|
209
|
+
--ef-warning: var(--ef-x-warning);
|
|
210
|
+
--ef-info: var(--ef-x-info);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* ------------------------------------------------------------------ */
|
|
214
|
+
/* 2. 原始令牌 */
|
|
215
|
+
/* ------------------------------------------------------------------ */
|
|
216
|
+
|
|
217
|
+
@theme {
|
|
218
|
+
/* —— 颜色:清掉 Tailwind 默认色板,只保留本系统的颜色 —— */
|
|
219
|
+
--color-*: initial;
|
|
220
|
+
|
|
221
|
+
--color-white: #ffffff;
|
|
222
|
+
--color-black: #000000;
|
|
223
|
+
|
|
224
|
+
/* 中性阶:全部来自官网实测 */
|
|
225
|
+
--color-neutral-0: #ffffff;
|
|
226
|
+
--color-neutral-50: #fafafa;
|
|
227
|
+
--color-neutral-100: #f2f2f2;
|
|
228
|
+
--color-neutral-200: #e6e6e6;
|
|
229
|
+
--color-neutral-300: #d9d9d9;
|
|
230
|
+
--color-neutral-400: #b3b3b3;
|
|
231
|
+
--color-neutral-500: #8a8a8a;
|
|
232
|
+
--color-neutral-600: #626262;
|
|
233
|
+
--color-neutral-700: #484848;
|
|
234
|
+
--color-neutral-800: #383838;
|
|
235
|
+
--color-neutral-850: #282828;
|
|
236
|
+
--color-neutral-900: #191919;
|
|
237
|
+
--color-neutral-950: #141414;
|
|
238
|
+
|
|
239
|
+
/* 信号黄:官网实测;signal-ink 是亮底上的文字用深档(社区) */
|
|
240
|
+
--color-signal: #fffa00;
|
|
241
|
+
--color-signal-pressed: #eeea00;
|
|
242
|
+
--color-signal-deep: #e6de01;
|
|
243
|
+
--color-signal-ink: #6b5d00;
|
|
244
|
+
|
|
245
|
+
/* 角色色:游戏界面取色(社区),用作填充而非文字 */
|
|
246
|
+
--color-notice: #fc6c00; /* 橙:通知、倒计时、数量 */
|
|
247
|
+
--color-gain: #bce41d; /* 荧光黄绿:增益 */
|
|
248
|
+
--color-data: #2a84b4; /* 蓝:量值图表 */
|
|
249
|
+
--color-region: #06a2a2; /* 青:地区主题 */
|
|
250
|
+
--color-alert: #f62a2a; /* 红:危险 */
|
|
251
|
+
--color-confirm: #00d872; /* 绿:确认 */
|
|
252
|
+
--color-special: #904ef0; /* 紫:特殊 */
|
|
253
|
+
|
|
254
|
+
/* 稀有度色阶:由低到高(社区) */
|
|
255
|
+
--color-rarity-1: #24bafc;
|
|
256
|
+
--color-rarity-2: #904ef6;
|
|
257
|
+
--color-rarity-3: #fcba00;
|
|
258
|
+
--color-rarity-4: #fc6c00;
|
|
259
|
+
|
|
260
|
+
/* 注册色条:印刷三原色的屏幕近似值(推断) */
|
|
261
|
+
--color-reg-magenta: #ec008c;
|
|
262
|
+
--color-reg-cyan: #00aeef;
|
|
263
|
+
--color-reg-yellow: #fff200;
|
|
264
|
+
|
|
265
|
+
/* —— 字体:只列可自由使用的字体,官网的商业字体不在其中 —— */
|
|
266
|
+
--font-*: initial;
|
|
267
|
+
|
|
268
|
+
--font-sans:
|
|
269
|
+
"HarmonyOS Sans SC", "Noto Sans SC", "Source Han Sans SC", "PingFang SC",
|
|
270
|
+
"Microsoft YaHei", system-ui, sans-serif;
|
|
271
|
+
--font-display: "Archivo", "Montserrat", "HarmonyOS Sans SC", sans-serif;
|
|
272
|
+
--font-display--font-variation-settings: "wdth" 125;
|
|
273
|
+
--font-latin: "Outfit", "Urbanist", "HarmonyOS Sans SC", sans-serif;
|
|
274
|
+
--font-tech: "Space Grotesk", "HarmonyOS Sans SC", sans-serif;
|
|
275
|
+
--font-tech--font-feature-settings: "tnum" 1;
|
|
276
|
+
--font-mono:
|
|
277
|
+
"JetBrains Mono", "Cascadia Code", ui-monospace, "SF Mono", Consolas,
|
|
278
|
+
monospace;
|
|
279
|
+
|
|
280
|
+
/* —— 字阶:比例取自官网(正文 = 1),落到 16px 基准 —— */
|
|
281
|
+
--text-*: initial;
|
|
282
|
+
|
|
283
|
+
--text-micro: 0.625rem; /* 10px 技术微标签 */
|
|
284
|
+
--text-micro--line-height: 1;
|
|
285
|
+
--text-xs: 0.75rem; /* 12px 英文小标、页码 */
|
|
286
|
+
--text-xs--line-height: 1.25;
|
|
287
|
+
--text-sm: 0.875rem; /* 14px 标签、导航 */
|
|
288
|
+
--text-sm--line-height: 1.4;
|
|
289
|
+
--text-base: 1rem; /* 16px 正文 */
|
|
290
|
+
--text-base--line-height: 1.6;
|
|
291
|
+
--text-lg: 1.25rem; /* 20px 按钮、页签 */
|
|
292
|
+
--text-lg--line-height: 1.2;
|
|
293
|
+
--text-xl: 1.5rem; /* 24px 英文分节标题 */
|
|
294
|
+
--text-xl--line-height: 1.1;
|
|
295
|
+
--text-2xl: 2rem; /* 32px 中文分节标题 */
|
|
296
|
+
--text-2xl--line-height: 1.1;
|
|
297
|
+
--text-3xl: 2.5rem; /* 40px 色带标题 */
|
|
298
|
+
--text-3xl--line-height: 1;
|
|
299
|
+
--text-4xl: 3.25rem; /* 52px 页面标题、名称 */
|
|
300
|
+
--text-4xl--line-height: 1;
|
|
301
|
+
--text-5xl: 4.5rem; /* 72px 代号 */
|
|
302
|
+
--text-5xl--line-height: 1;
|
|
303
|
+
--text-6xl: 6rem; /* 96px 主视觉大字 */
|
|
304
|
+
--text-6xl--line-height: 1;
|
|
305
|
+
--text-ghost: clamp(5rem, 10.4vw, 12.5rem); /* 镂空巨字 */
|
|
306
|
+
--text-ghost--line-height: 1;
|
|
307
|
+
--text-ghost--letter-spacing: -0.04em;
|
|
308
|
+
|
|
309
|
+
--tracking-ghost: -0.04em;
|
|
310
|
+
--tracking-label: 0.05em;
|
|
311
|
+
|
|
312
|
+
/* —— 圆角:默认直角,另有两档微圆角;胶囊与圆用 rounded-full —— */
|
|
313
|
+
--radius-*: initial;
|
|
314
|
+
|
|
315
|
+
--radius-xs: 2px;
|
|
316
|
+
--radius-sm: 4px;
|
|
317
|
+
--radius-md: 6px;
|
|
318
|
+
|
|
319
|
+
/* —— 阴影:零偏移的环境阴影 —— */
|
|
320
|
+
--shadow-*: initial;
|
|
321
|
+
|
|
322
|
+
--shadow-xs: 0 0 4px rgb(0 0 0 / 0.25);
|
|
323
|
+
--shadow-sm: 0 0 8px rgb(0 0 0 / 0.25);
|
|
324
|
+
--shadow-md: 0 0 12px rgb(0 0 0 / 0.3);
|
|
325
|
+
--shadow-lg: 0 0 24px rgb(0 0 0 / 0.3);
|
|
326
|
+
--shadow-rail: 0 0 12px rgb(0 0 0 / 0.1);
|
|
327
|
+
|
|
328
|
+
/* —— 缓动与时长 —— */
|
|
329
|
+
--ease-standard: ease;
|
|
330
|
+
--ease-emphasis: ease-in-out;
|
|
331
|
+
--ease-exit: ease-out;
|
|
332
|
+
|
|
333
|
+
--duration-instant: 50ms;
|
|
334
|
+
--duration-fast: 200ms;
|
|
335
|
+
--duration-base: 300ms;
|
|
336
|
+
--duration-slow: 400ms;
|
|
337
|
+
--duration-slower: 600ms;
|
|
338
|
+
|
|
339
|
+
/* —— 母题尺寸 —— */
|
|
340
|
+
--cut-sm: 6px;
|
|
341
|
+
--cut-md: 10px;
|
|
342
|
+
--cut-lg: 16px;
|
|
343
|
+
--hatch-size: 6px;
|
|
344
|
+
|
|
345
|
+
/*
|
|
346
|
+
* —— 层叠:从低到高。浮层全在同一层,它们都挂在 <body> 下,谁后打开谁在上,
|
|
347
|
+
* 所以弹窗里的下拉能盖住弹窗。轻提示单独高一层,加载页盖住一切 ——
|
|
348
|
+
*/
|
|
349
|
+
--z-float: 100; /* 悬浮控件:回到顶部、浮在内容上的翻页 */
|
|
350
|
+
--z-nav: 200; /* 常驻导航:侧轨、顶栏 */
|
|
351
|
+
--z-overlay: 300; /* 文字提示、下拉、抽屉、弹窗和它们的遮罩 */
|
|
352
|
+
--z-toast: 400;
|
|
353
|
+
--z-loader: 1000;
|
|
354
|
+
|
|
355
|
+
/* —— 动画 —— */
|
|
356
|
+
--animate-*: initial;
|
|
357
|
+
|
|
358
|
+
--animate-flicker: ef-flicker 600ms linear both;
|
|
359
|
+
--animate-fill: ef-fill 600ms ease-out both;
|
|
360
|
+
--animate-scroll-hint: ef-scroll-hint 1.4s ease-in-out infinite;
|
|
361
|
+
--animate-breathe: ef-breathe 2s ease-in-out infinite;
|
|
362
|
+
--animate-marquee: ef-marquee 20s linear infinite;
|
|
363
|
+
--animate-spin: ef-spin 1s linear infinite;
|
|
364
|
+
--animate-spin-slow: ef-spin 60s linear infinite;
|
|
365
|
+
--animate-blink: ef-blink 1s step-end infinite;
|
|
366
|
+
--animate-slide-in: ef-slide-in 300ms ease-out both;
|
|
367
|
+
--animate-turn-in: ef-turn-in 300ms ease-out both;
|
|
368
|
+
--animate-fade-in: ef-fade-in 300ms ease-out both;
|
|
369
|
+
--animate-indeterminate: ef-indeterminate 1.2s linear infinite alternate;
|
|
370
|
+
--animate-pulse: ef-pulse 2s ease-in-out infinite;
|
|
371
|
+
|
|
372
|
+
/* 三次短促闪烁后点亮(官网实测的关键帧节奏) */
|
|
373
|
+
@keyframes ef-flicker {
|
|
374
|
+
0% {
|
|
375
|
+
opacity: 0;
|
|
376
|
+
}
|
|
377
|
+
10% {
|
|
378
|
+
opacity: 0.5;
|
|
379
|
+
}
|
|
380
|
+
11% {
|
|
381
|
+
opacity: 0;
|
|
382
|
+
}
|
|
383
|
+
20% {
|
|
384
|
+
opacity: 0.5;
|
|
385
|
+
}
|
|
386
|
+
21% {
|
|
387
|
+
opacity: 0;
|
|
388
|
+
}
|
|
389
|
+
40% {
|
|
390
|
+
opacity: 0.5;
|
|
391
|
+
}
|
|
392
|
+
41% {
|
|
393
|
+
opacity: 0;
|
|
394
|
+
}
|
|
395
|
+
100% {
|
|
396
|
+
opacity: 1;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/* 进度条、色块从左侧充填 */
|
|
401
|
+
@keyframes ef-fill {
|
|
402
|
+
from {
|
|
403
|
+
transform: scaleX(0);
|
|
404
|
+
}
|
|
405
|
+
to {
|
|
406
|
+
transform: scaleX(1);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/* 滚动提示:下坠并淡出 */
|
|
411
|
+
@keyframes ef-scroll-hint {
|
|
412
|
+
0% {
|
|
413
|
+
transform: translateY(0);
|
|
414
|
+
opacity: 0;
|
|
415
|
+
}
|
|
416
|
+
60% {
|
|
417
|
+
opacity: 1;
|
|
418
|
+
}
|
|
419
|
+
80% {
|
|
420
|
+
transform: translateY(1.5rem);
|
|
421
|
+
opacity: 0;
|
|
422
|
+
}
|
|
423
|
+
100% {
|
|
424
|
+
transform: translateY(0);
|
|
425
|
+
opacity: 0;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
@keyframes ef-breathe {
|
|
430
|
+
0%,
|
|
431
|
+
100% {
|
|
432
|
+
transform: scale(1);
|
|
433
|
+
}
|
|
434
|
+
50% {
|
|
435
|
+
transform: scale(1.2);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/* 跑马灯:内容需要重复一遍,走完一半后停顿 */
|
|
440
|
+
@keyframes ef-marquee {
|
|
441
|
+
0% {
|
|
442
|
+
transform: translateX(0);
|
|
443
|
+
}
|
|
444
|
+
80%,
|
|
445
|
+
100% {
|
|
446
|
+
transform: translateX(-50%);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
@keyframes ef-spin {
|
|
451
|
+
to {
|
|
452
|
+
transform: rotate(1turn);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
@keyframes ef-blink {
|
|
457
|
+
50% {
|
|
458
|
+
opacity: 0;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/* 分节标题入场三步:滑块从左滑入 → 箭头转正 → 文字淡入 */
|
|
463
|
+
@keyframes ef-slide-in {
|
|
464
|
+
from {
|
|
465
|
+
transform: translateX(-100%);
|
|
466
|
+
}
|
|
467
|
+
to {
|
|
468
|
+
transform: translateX(0);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
@keyframes ef-turn-in {
|
|
473
|
+
from {
|
|
474
|
+
transform: rotate(-45deg);
|
|
475
|
+
}
|
|
476
|
+
to {
|
|
477
|
+
transform: rotate(0);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
@keyframes ef-fade-in {
|
|
482
|
+
from {
|
|
483
|
+
opacity: 0;
|
|
484
|
+
}
|
|
485
|
+
to {
|
|
486
|
+
opacity: 1;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/* 不确定进度:宽 40% 的色块在轨道上匀速往返,所以走自身宽度的 150% */
|
|
491
|
+
@keyframes ef-indeterminate {
|
|
492
|
+
from {
|
|
493
|
+
transform: translateX(0);
|
|
494
|
+
}
|
|
495
|
+
to {
|
|
496
|
+
transform: translateX(150%);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/* 骨架:很轻的明度往返,不是扫光 */
|
|
501
|
+
@keyframes ef-pulse {
|
|
502
|
+
0%,
|
|
503
|
+
100% {
|
|
504
|
+
opacity: 1;
|
|
505
|
+
}
|
|
506
|
+
50% {
|
|
507
|
+
opacity: 0.6;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/* ------------------------------------------------------------------ */
|
|
513
|
+
/* 3. 语义颜色 → Tailwind 工具类 */
|
|
514
|
+
/* ------------------------------------------------------------------ */
|
|
515
|
+
|
|
516
|
+
@theme inline {
|
|
517
|
+
--color-surface: var(--ef-surface);
|
|
518
|
+
--color-surface-raised: var(--ef-surface-raised);
|
|
519
|
+
--color-surface-sunken: var(--ef-surface-sunken);
|
|
520
|
+
--color-surface-muted: var(--ef-surface-muted);
|
|
521
|
+
--color-surface-inverse: var(--ef-surface-inverse);
|
|
522
|
+
|
|
523
|
+
--color-ink: var(--ef-ink);
|
|
524
|
+
--color-ink-secondary: var(--ef-ink-secondary);
|
|
525
|
+
--color-ink-tertiary: var(--ef-ink-tertiary);
|
|
526
|
+
--color-ink-disabled: var(--ef-ink-disabled);
|
|
527
|
+
--color-ink-inverse: var(--ef-ink-inverse);
|
|
528
|
+
|
|
529
|
+
--color-line: var(--ef-line);
|
|
530
|
+
--color-line-strong: var(--ef-line-strong);
|
|
531
|
+
|
|
532
|
+
--color-action: var(--ef-action);
|
|
533
|
+
--color-action-pressed: var(--ef-action-pressed);
|
|
534
|
+
--color-on-action: var(--ef-on-action);
|
|
535
|
+
--color-accent-ink: var(--ef-accent-ink);
|
|
536
|
+
--color-accent-ink-inverse: var(--ef-accent-ink-inverse);
|
|
537
|
+
|
|
538
|
+
--color-control: var(--ef-control);
|
|
539
|
+
--color-control-hover: var(--ef-control-hover);
|
|
540
|
+
--color-control-pressed: var(--ef-control-pressed);
|
|
541
|
+
--color-on-control: var(--ef-on-control);
|
|
542
|
+
|
|
543
|
+
--color-disabled: var(--ef-disabled);
|
|
544
|
+
--color-on-disabled: var(--ef-on-disabled);
|
|
545
|
+
|
|
546
|
+
--color-focus: var(--ef-focus);
|
|
547
|
+
--color-scrim: var(--ef-scrim);
|
|
548
|
+
|
|
549
|
+
--color-danger: var(--ef-danger);
|
|
550
|
+
--color-success: var(--ef-success);
|
|
551
|
+
--color-warning: var(--ef-warning);
|
|
552
|
+
--color-info: var(--ef-info);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/* ------------------------------------------------------------------ */
|
|
556
|
+
/* 减少动态效果 */
|
|
557
|
+
/* ------------------------------------------------------------------ */
|
|
558
|
+
|
|
559
|
+
@media (prefers-reduced-motion: reduce) {
|
|
560
|
+
*,
|
|
561
|
+
*::before,
|
|
562
|
+
*::after {
|
|
563
|
+
animation-duration: 0.01ms !important;
|
|
564
|
+
animation-iteration-count: 1 !important;
|
|
565
|
+
transition-duration: 0.01ms !important;
|
|
566
|
+
scroll-behavior: auto !important;
|
|
567
|
+
}
|
|
568
|
+
}
|