@linhey/rhine-design 0.3.0 → 0.4.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/CHANGELOG.md +33 -0
- package/README.md +53 -14
- package/components/Actions.tsx +2 -0
- package/components/COMMON_COMPONENTS.md +5 -1
- package/components/FormWorkflow.tsx +25 -0
- package/components/MOTION.md +6 -2
- package/components/Navigation.tsx +42 -0
- package/components/Overlays.tsx +9 -3
- package/components/README.md +13 -5
- package/components/SPACING.md +82 -0
- package/components/StatusTimeline.tsx +29 -0
- package/components/TYPOGRAPHY.md +34 -2
- package/components/common.css +12 -3
- package/components/index.ts +7 -1
- package/components/patterns.css +39 -0
- package/components/styles.css +12 -8
- package/components/theme-arknights.css +301 -0
- package/components/theme-neo-brutalism.css +84 -0
- package/components/theme.tsx +58 -0
- package/components/timeline.css +23 -0
- package/components/tokens.css +6 -1
- package/docs/DESIGN_SYSTEM.md +12 -2
- package/docs/DESIGN_SYSTEM_AUDIT.md +4 -4
- package/docs/INTERACTION_PATTERNS.md +129 -0
- package/docs/REFERENCE_RESEARCH.md +36 -0
- package/docs/THEME_NEO_BRUTALISM.md +37 -0
- package/docs/THEMING.md +104 -0
- package/package.json +5 -1
- package/preview/CommonGallery.tsx +8 -8
- package/preview/GalleryShell.tsx +106 -0
- package/preview/LineHeightGallery.tsx +27 -0
- package/preview/MotionGallery.tsx +6 -2
- package/preview/PatternGallery.tsx +52 -0
- package/preview/SpacingGallery.tsx +32 -0
- package/preview/SubscriptionGallery.tsx +84 -0
- package/preview/line-height.css +2 -0
- package/preview/main.tsx +39 -25
- package/preview/patterns.css +7 -0
- package/preview/preview.css +2 -8
- package/preview/shell.css +35 -0
- package/preview/spacing.css +2 -0
- package/preview/subscriptions.css +27 -0
- package/preview/theme-arknights.css +234 -0
- package/preview/theme-neo-brutalism.css +11 -0
- package/skills/rhine-design/SKILL.md +5 -3
- package/skills/rhine-design/references/API_MAP.md +7 -3
- package/skills/rhine-design/references/TASK_MAP.md +4 -1
- package/skills/rhine-design/references/integration.md +4 -2
- package/tests/GalleryShell.test.tsx +98 -0
- package/tests/Patterns.test.tsx +75 -0
- package/tests/StatusTimeline.test.tsx +15 -0
- package/tests/Theme.test.tsx +112 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.rhine-side-nav__group { margin-top:var(--rhine-space-4); }
|
|
2
|
+
.rhine-side-nav__group:first-child { margin-top:0; }
|
|
3
|
+
.rhine-side-nav__group>p { margin:0 var(--rhine-space-3) var(--rhine-space-2); font-size:var(--rhine-text-caption); line-height:var(--rhine-leading-caption); color:var(--rhine-muted); }
|
|
4
|
+
.rhine-side-nav ul,.rhine-breadcrumbs ol,.rhine-steps { margin:0; padding:0; list-style:none; }
|
|
5
|
+
.rhine-side-nav ul { display:grid; gap:var(--rhine-space-1); }
|
|
6
|
+
.rhine-side-nav a { min-height:44px; padding:var(--rhine-space-2) var(--rhine-space-3); display:flex; align-items:center; gap:var(--rhine-space-3); border-inline-start:2px solid transparent; border-radius:var(--rhine-radius-control); text-decoration:none; font-size:var(--rhine-text-body); line-height:var(--rhine-leading-body); color:var(--rhine-ink); transition:background-color var(--rhine-duration-hover) var(--rhine-ease-standard); overflow-wrap:anywhere; }
|
|
7
|
+
.rhine-side-nav__label { min-width:0; }
|
|
8
|
+
.rhine-side-nav .rhine-icon { flex-shrink:0; color:var(--rhine-muted); }
|
|
9
|
+
.rhine-side-nav a:hover { background:var(--rhine-bg); }
|
|
10
|
+
.rhine-side-nav a[aria-current=page] { background:var(--rhine-selected); border-color:var(--rhine-green); color:var(--rhine-green); font-weight:600; }
|
|
11
|
+
.rhine-side-nav a[aria-current=page] .rhine-icon { color:var(--rhine-green); }
|
|
12
|
+
.rhine-breadcrumbs ol { display:flex; flex-wrap:wrap; align-items:center; gap:4px 12px; }
|
|
13
|
+
.rhine-breadcrumbs li { display:flex; align-items:center; gap:12px; min-width:0; overflow-wrap:anywhere; font-size:var(--rhine-text-caption); line-height:var(--rhine-leading-caption); color:var(--rhine-muted); }
|
|
14
|
+
.rhine-breadcrumbs a { display:inline-flex; align-items:center; min-height:44px; color:var(--rhine-green); text-underline-offset:3px; }
|
|
15
|
+
.rhine-breadcrumbs [aria-current=page] { color:var(--rhine-ink); font-weight:600; }
|
|
16
|
+
.rhine-breadcrumbs__separator { color:var(--rhine-control); }
|
|
17
|
+
.rhine-steps { display:grid; gap:0; }
|
|
18
|
+
.rhine-steps li { border-inline-start:2px solid var(--rhine-line); }
|
|
19
|
+
.rhine-steps li>div,.rhine-steps button { display:flex; gap:16px; align-items:flex-start; padding:16px; width:100%; text-align:start; color:var(--rhine-muted); }
|
|
20
|
+
.rhine-steps button { border:0; background:none; font:inherit; cursor:pointer; }
|
|
21
|
+
.rhine-steps button:hover { background:var(--rhine-selected); }
|
|
22
|
+
.rhine-steps strong,.rhine-steps small { display:block; overflow-wrap:anywhere; }
|
|
23
|
+
.rhine-steps small { margin-top:4px; font-size:12px; font-weight:400; }
|
|
24
|
+
.rhine-steps__number { flex:0 0 28px; font:14px/24px var(--rhine-mono); }
|
|
25
|
+
.rhine-steps li[data-state=current],.rhine-steps li[data-state=complete] { border-color:var(--rhine-green); }
|
|
26
|
+
.rhine-steps li[data-state=current]>div { background:var(--rhine-selected); color:var(--rhine-green); animation:rhine-pattern-enter var(--rhine-duration-panel) var(--rhine-ease-standard); }
|
|
27
|
+
.rhine-steps li[data-state=error] { border-color:var(--rhine-error); }
|
|
28
|
+
.rhine-steps li[data-state=error]>div { color:var(--rhine-error); background:var(--rhine-error-bg); }
|
|
29
|
+
.rhine-fieldset { min-width:0; margin:0; padding:20px; border:1px solid var(--rhine-line); border-radius:var(--rhine-radius-card); }
|
|
30
|
+
.rhine-fieldset legend { padding:0 8px; font-weight:600; }
|
|
31
|
+
.rhine-fieldset>p { margin:0 0 20px; color:var(--rhine-muted); font-size:12px; }
|
|
32
|
+
.rhine-fieldset__body { display:grid; gap:16px; }
|
|
33
|
+
.rhine-error-summary { padding:20px; border:1px solid var(--rhine-error); border-inline-start:3px solid var(--rhine-error); background:var(--rhine-error-bg); }
|
|
34
|
+
.rhine-error-summary h3 { margin:0 0 8px; font-size:16px; }
|
|
35
|
+
.rhine-error-summary ul { padding-inline-start:20px; margin:0; }
|
|
36
|
+
.rhine-error-summary a { display:inline-block; padding:10px 0; color:var(--rhine-error); text-underline-offset:3px; overflow-wrap:anywhere; }
|
|
37
|
+
.rhine-dialog.rhine-drawer { inset-block:0; inset-inline-end:0; inset-inline-start:auto; width:min(440px,100%); max-height:100dvh; margin:0; transform:none; border-radius:0; animation:rhine-drawer-enter var(--rhine-duration-overlay) var(--rhine-ease-standard); }
|
|
38
|
+
@keyframes rhine-drawer-enter { from { opacity:0; transform:translateX(3px); } to { opacity:1; transform:translateX(0); } }
|
|
39
|
+
@keyframes rhine-pattern-enter { from { opacity:.65; transform:translateY(3px); } to { opacity:1; transform:translateY(0); } }
|
package/components/styles.css
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
@import './tokens.css';
|
|
2
2
|
@import './typography.css';
|
|
3
3
|
@import './common.css';
|
|
4
|
+
@import './patterns.css';
|
|
5
|
+
@import './timeline.css';
|
|
4
6
|
|
|
5
7
|
.rhine-theme { color:var(--rhine-ink); background:var(--rhine-bg); font:var(--rhine-text-body)/var(--rhine-leading-body) var(--rhine-font); font-synthesis:none; }
|
|
8
|
+
.rhine-theme[data-rhine-theme="rhine"] { color-scheme:light; }
|
|
6
9
|
.rhine-theme *, .rhine-theme *::before, .rhine-theme *::after { box-sizing:border-box; }
|
|
7
10
|
.rhine-theme [hidden] { display:none!important; }
|
|
8
11
|
.rhine-theme :is(button,input,select,textarea,summary,a,[tabindex]):focus-visible { outline:2px solid var(--rhine-green); outline-offset:3px; }
|
|
9
12
|
.rhine-sr-only { position:absolute!important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
|
|
10
|
-
.rhine-button { position:relative; display:inline-flex; align-items:center; justify-content:center; min-height:44px; min-width:44px; padding:10px 16px; border:1px solid var(--rhine-ink); border-radius:var(--rhine-radius-control); font:
|
|
13
|
+
.rhine-button { position:relative; display:inline-flex; align-items:center; justify-content:center; min-height:44px; min-width:44px; padding:10px 16px; border:1px solid var(--rhine-ink); border-radius:var(--rhine-radius-control); font:var(--rhine-weight-label) var(--rhine-text-body)/var(--rhine-leading-body) var(--rhine-font); background:var(--rhine-ink); color:var(--rhine-surface); cursor:pointer; overflow-wrap:anywhere; transition:background-color var(--rhine-duration-hover) var(--rhine-ease-standard),border-color var(--rhine-duration-hover) var(--rhine-ease-standard),transform var(--rhine-duration-press) var(--rhine-ease-standard); }
|
|
11
14
|
.rhine-button:hover:not(:disabled):not([aria-disabled=true]) { background:var(--rhine-green); border-color:var(--rhine-green); }
|
|
12
15
|
.rhine-button:active:not(:disabled):not([aria-disabled=true]) { transform:translateY(1px); }
|
|
13
16
|
.rhine-button--secondary { background:var(--rhine-surface); color:var(--rhine-ink); border-color:var(--rhine-control); }
|
|
@@ -25,18 +28,19 @@
|
|
|
25
28
|
.rhine-tone-warning { --rhine-tone:var(--rhine-warning); --rhine-tone-bg:var(--rhine-warning-bg); }
|
|
26
29
|
.rhine-tone-error { --rhine-tone:var(--rhine-error); --rhine-tone-bg:var(--rhine-error-bg); }
|
|
27
30
|
.rhine-badge { display:inline-block; padding:2px 8px; border-radius:2px; background:var(--rhine-tone-bg); color:var(--rhine-tone); font:500 12px/20px var(--rhine-font); }
|
|
28
|
-
.rhine-surface { padding:
|
|
29
|
-
.rhine-selection { display:block; border:1px solid var(--rhine-control); background:var(--rhine-surface); border-radius:var(--rhine-radius-card); padding:
|
|
31
|
+
.rhine-surface { padding:var(--rhine-space-6); border:1px solid var(--rhine-line); border-radius:var(--rhine-radius-card); background:var(--rhine-surface); min-width:0; }
|
|
32
|
+
.rhine-selection { display:block; border:1px solid var(--rhine-control); background:var(--rhine-surface); border-radius:var(--rhine-radius-card); padding:var(--rhine-space-6); cursor:pointer; min-width:0; transition:background-color var(--rhine-duration-hover) var(--rhine-ease-standard),border-color var(--rhine-duration-hover) var(--rhine-ease-standard),box-shadow var(--rhine-duration-hover) var(--rhine-ease-standard); }
|
|
30
33
|
.rhine-selection:hover:not([data-disabled=true]) { border-color:var(--rhine-green); background:#f4f7ef; }
|
|
31
34
|
.rhine-selection[data-selected=true] { border-color:var(--rhine-green); background:var(--rhine-selected); box-shadow:inset 0 0 0 1px var(--rhine-green); }
|
|
32
35
|
.rhine-selection[data-disabled=true] { cursor:default; color:var(--rhine-muted); background:var(--rhine-bg); }
|
|
33
36
|
.rhine-selection:focus-within { outline:2px solid var(--rhine-green); outline-offset:3px; }
|
|
34
|
-
.rhine-selection__heading { display:flex; align-items:center; justify-content:space-between; gap:
|
|
37
|
+
.rhine-selection__heading { display:flex; align-items:center; justify-content:space-between; gap:var(--rhine-space-4); font-size:var(--rhine-text-heading); line-height:var(--rhine-leading-heading); overflow-wrap:anywhere; }
|
|
38
|
+
.rhine-selection__heading>strong { font-weight:var(--rhine-weight-heading); }
|
|
35
39
|
.rhine-selection input { width:18px; height:18px; accent-color:var(--rhine-green); flex-shrink:0; }
|
|
36
|
-
.rhine-selection__content { display:block; margin-top:
|
|
40
|
+
.rhine-selection__content { display:block; margin-top:var(--rhine-space-2); overflow-wrap:anywhere; }
|
|
37
41
|
.rhine-field { display:flex; flex-direction:column; gap:8px; min-width:0; }
|
|
38
42
|
.rhine-field>label { font-weight:500; }
|
|
39
|
-
.rhine-field input { width:100%; min-width:0; min-height:44px; padding:10px 12px; color:var(--rhine-ink); background:var(--rhine-surface); border:1px solid var(--rhine-control); border-radius:var(--rhine-radius-control); font:
|
|
43
|
+
.rhine-field input { width:100%; min-width:0; min-height:44px; padding:10px 12px; color:var(--rhine-ink); background:var(--rhine-surface); border:1px solid var(--rhine-control); border-radius:var(--rhine-radius-control); font:var(--rhine-text-body)/var(--rhine-leading-body) var(--rhine-font); transition:border-color var(--rhine-duration-hover) var(--rhine-ease-standard),background-color var(--rhine-duration-hover) var(--rhine-ease-standard); }
|
|
40
44
|
.rhine-field input::placeholder { color:var(--rhine-muted); }
|
|
41
45
|
.rhine-field input[aria-invalid=true] { border-color:var(--rhine-error); }
|
|
42
46
|
.rhine-field input:disabled { background:var(--rhine-selected); color:var(--rhine-muted); }
|
|
@@ -44,7 +48,7 @@
|
|
|
44
48
|
.rhine-field__hint { color:var(--rhine-muted); }
|
|
45
49
|
.rhine-field__error { color:var(--rhine-error); }
|
|
46
50
|
.rhine-tabs__list { display:flex; flex-wrap:wrap; gap:24px; border-bottom:1px solid var(--rhine-line); }
|
|
47
|
-
.rhine-tabs__list button { position:relative; background:none; border:0; padding:12px 0; min-height:44px; color:var(--rhine-muted); font:
|
|
51
|
+
.rhine-tabs__list button { position:relative; background:none; border:0; padding:12px 0; min-height:44px; color:var(--rhine-muted); font:var(--rhine-weight-label) var(--rhine-text-body)/var(--rhine-leading-body) var(--rhine-font); cursor:pointer; transition:color var(--rhine-duration-hover) var(--rhine-ease-standard); }
|
|
48
52
|
.rhine-tabs__list button::after { content:''; position:absolute; bottom:-1px; inset-inline:0; height:2px; background:var(--rhine-green); transform:scaleX(0); transform-origin:left; transition:transform var(--rhine-duration-panel) var(--rhine-ease-standard); }
|
|
49
53
|
.rhine-tabs__list button[aria-selected=true] { color:var(--rhine-ink); }
|
|
50
54
|
.rhine-tabs__list button[aria-selected=true]::after { transform:scaleX(1); }
|
|
@@ -61,7 +65,7 @@
|
|
|
61
65
|
.rhine-notice>div { flex:1 1 200px; min-width:0; overflow-wrap:anywhere; }
|
|
62
66
|
.rhine-notice strong { font-size:14px; font-weight:600; }
|
|
63
67
|
.rhine-notice__body { margin-top:4px; font-size:12px; line-height:20px; }
|
|
64
|
-
.rhine-progress__label { display:flex; justify-content:space-between; gap:
|
|
68
|
+
.rhine-progress__label { display:flex; justify-content:space-between; gap:var(--rhine-space-3); font-size:var(--rhine-text-caption); line-height:var(--rhine-leading-caption); margin-bottom:var(--rhine-space-2); }
|
|
65
69
|
.rhine-progress__label strong { font-variant-numeric:tabular-nums; }
|
|
66
70
|
.rhine-progress__track { height:6px; background:var(--rhine-line); overflow:hidden; }
|
|
67
71
|
.rhine-progress__track>span { display:block; height:100%; background:var(--rhine-green); transform-origin:left; transition:transform var(--rhine-duration-progress) var(--rhine-ease-standard); }
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
/* Component theme. Imported automatically by @linhey/rhine-design/theme, or after styles.css for CSS-only usage. */
|
|
2
|
+
.rhine-theme[data-rhine-theme="arknights"] {
|
|
3
|
+
/* ---- 色彩:暗舱底 + 信号黄 + 警戒橙 ---- */
|
|
4
|
+
--rhine-bg: #0b0d10;
|
|
5
|
+
--rhine-surface: #14161b;
|
|
6
|
+
--rhine-ink: #eef0ec;
|
|
7
|
+
--rhine-muted: #878f96;
|
|
8
|
+
--rhine-line: #272b31;
|
|
9
|
+
--rhine-control: #454c54;
|
|
10
|
+
--rhine-selected: #1c2026;
|
|
11
|
+
--rhine-green: #ffd400;
|
|
12
|
+
--rhine-signal: #ff6a1a;
|
|
13
|
+
--rhine-warning: #ffb020;
|
|
14
|
+
--rhine-error: #ff5449;
|
|
15
|
+
--rhine-warning-bg: #2a2113;
|
|
16
|
+
--rhine-error-bg: #2b1715;
|
|
17
|
+
|
|
18
|
+
/* ---- 形态:圆角归零 ---- */
|
|
19
|
+
--rhine-radius-card: 0px;
|
|
20
|
+
--rhine-radius-control: 0px;
|
|
21
|
+
|
|
22
|
+
/* ---- 主题私有变量 ---- */
|
|
23
|
+
--ak-accent: #ffd400;
|
|
24
|
+
--ak-accent-ink: #0b0d10; /* 压在黄底上的深色 */
|
|
25
|
+
--ak-gridline: rgba(238, 240, 236, .04);
|
|
26
|
+
--ak-panel: #14161b;
|
|
27
|
+
--ak-panel-hi: #1a1d23;
|
|
28
|
+
--ak-cut: 14px;
|
|
29
|
+
--ak-cut-sm: 8px;
|
|
30
|
+
--ak-hazard: repeating-linear-gradient(-45deg, var(--ak-accent) 0 8px, transparent 8px 16px);
|
|
31
|
+
|
|
32
|
+
color-scheme: dark;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* 滚动条:细轨道 + 黄 thumb */
|
|
36
|
+
.rhine-theme[data-rhine-theme="arknights"] * { scrollbar-color: var(--rhine-control) transparent; }
|
|
37
|
+
.rhine-theme[data-rhine-theme="arknights"] ::-webkit-scrollbar { width: 8px; height: 8px; }
|
|
38
|
+
.rhine-theme[data-rhine-theme="arknights"] ::-webkit-scrollbar-thumb { background: var(--rhine-control); }
|
|
39
|
+
.rhine-theme[data-rhine-theme="arknights"] ::-webkit-scrollbar-thumb:hover { background: var(--ak-accent); }
|
|
40
|
+
.rhine-theme[data-rhine-theme="arknights"] ::-webkit-scrollbar-track { background: transparent; }
|
|
41
|
+
|
|
42
|
+
/* 选中文字 */
|
|
43
|
+
.rhine-theme[data-rhine-theme="arknights"] ::selection { background: var(--ak-accent); color: var(--ak-accent-ink); }
|
|
44
|
+
|
|
45
|
+
/* ================= 字体性格 ================= */
|
|
46
|
+
/* 标签、编号、说明全部等宽化,正文保持无衬线可读性 */
|
|
47
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-key-value dt,
|
|
48
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-field__hint,
|
|
49
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-progress__label {
|
|
50
|
+
font-family: var(--rhine-mono);
|
|
51
|
+
letter-spacing: .04em;
|
|
52
|
+
}
|
|
53
|
+
/* 面包屑分隔符换成终端风格 // */
|
|
54
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-breadcrumbs li { font-family: var(--rhine-mono); letter-spacing: .05em; }
|
|
55
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-breadcrumbs a { color: var(--ak-accent); }
|
|
56
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-breadcrumbs [aria-current=page] { color: var(--rhine-ink); }
|
|
57
|
+
|
|
58
|
+
/* 导航:等宽标签 + 当前项黄块左条 */
|
|
59
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-side-nav__group>p {
|
|
60
|
+
font-family: var(--rhine-mono);
|
|
61
|
+
letter-spacing: .14em;
|
|
62
|
+
color: var(--rhine-control);
|
|
63
|
+
}
|
|
64
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-side-nav a {
|
|
65
|
+
border-inline-start-width: 3px;
|
|
66
|
+
position: relative;
|
|
67
|
+
}
|
|
68
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-side-nav a:hover { background: var(--ak-panel-hi); }
|
|
69
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-side-nav a[aria-current=page] {
|
|
70
|
+
background: linear-gradient(90deg, rgba(255, 212, 0, .14), transparent 75%);
|
|
71
|
+
border-color: var(--ak-accent);
|
|
72
|
+
color: var(--ak-accent);
|
|
73
|
+
}
|
|
74
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-side-nav a[aria-current=page] .rhine-icon { color: var(--ak-accent); }
|
|
75
|
+
|
|
76
|
+
/* ================= 面板与容器:斜切 + 角标框架 ================= */
|
|
77
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-surface,
|
|
78
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-empty,
|
|
79
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-fieldset {
|
|
80
|
+
background: var(--ak-panel);
|
|
81
|
+
clip-path: polygon(0 0, calc(100% - var(--ak-cut)) 0, 100% var(--ak-cut), 100% 100%, 0 100%);
|
|
82
|
+
}
|
|
83
|
+
/* 左下角小角标点缀 */
|
|
84
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-surface { position: relative; }
|
|
85
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-surface::after {
|
|
86
|
+
content: '';
|
|
87
|
+
position: absolute;
|
|
88
|
+
left: 0;
|
|
89
|
+
bottom: 0;
|
|
90
|
+
width: 18px;
|
|
91
|
+
height: 18px;
|
|
92
|
+
border-left: 2px solid var(--ak-accent);
|
|
93
|
+
border-bottom: 2px solid var(--ak-accent);
|
|
94
|
+
opacity: .55;
|
|
95
|
+
pointer-events: none;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* ================= 按钮:平行四边形 ================= */
|
|
99
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-button {
|
|
100
|
+
clip-path: polygon(var(--ak-cut-sm) 0, 100% 0, calc(100% - var(--ak-cut-sm)) 100%, 0 100%);
|
|
101
|
+
letter-spacing: .06em;
|
|
102
|
+
font-weight: 600;
|
|
103
|
+
}
|
|
104
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-button:not(.rhine-button--secondary):not(.rhine-button--quiet):not(.rhine-button--danger) {
|
|
105
|
+
background: var(--ak-accent);
|
|
106
|
+
border-color: var(--ak-accent);
|
|
107
|
+
color: var(--ak-accent-ink);
|
|
108
|
+
}
|
|
109
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-button:hover:not(:disabled):not([aria-disabled=true]) {
|
|
110
|
+
background: #ffe14d;
|
|
111
|
+
border-color: #ffe14d;
|
|
112
|
+
color: var(--ak-accent-ink);
|
|
113
|
+
}
|
|
114
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-button--secondary { border-color: var(--rhine-control); }
|
|
115
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-button--secondary:hover:not(:disabled):not([aria-disabled=true]),
|
|
116
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-button--quiet:hover:not(:disabled):not([aria-disabled=true]) {
|
|
117
|
+
background: var(--ak-panel-hi);
|
|
118
|
+
color: var(--ak-accent);
|
|
119
|
+
border-color: var(--ak-accent);
|
|
120
|
+
}
|
|
121
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-button--quiet { color: var(--ak-accent); }
|
|
122
|
+
/* clip-path 会裁掉外 outline,焦点改内描边 */
|
|
123
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-button:focus-visible {
|
|
124
|
+
outline: none;
|
|
125
|
+
box-shadow: inset 0 0 0 2px var(--rhine-ink);
|
|
126
|
+
}
|
|
127
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-button--danger { background: var(--rhine-error); border-color: var(--rhine-error); color: var(--rhine-ink); }
|
|
128
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-button--danger:hover:not(:disabled):not([aria-disabled=true]) { background: #c93a32; border-color: #c93a32; }
|
|
129
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-button:active:not(:disabled):not([aria-disabled=true]) { transform:none; }
|
|
130
|
+
|
|
131
|
+
/* 图标按钮保持方形小切角 */
|
|
132
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-icon-button {
|
|
133
|
+
clip-path: polygon(0 0, calc(100% - var(--ak-cut-sm)) 0, 100% var(--ak-cut-sm), 100% 100%, 0 100%);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* ================= 链接 / 徽标 ================= */
|
|
137
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-link { color: var(--ak-accent); }
|
|
138
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-badge {
|
|
139
|
+
font: 600 11px/20px var(--rhine-mono);
|
|
140
|
+
letter-spacing: .1em;
|
|
141
|
+
padding: 2px 10px;
|
|
142
|
+
clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* ================= 表单 ================= */
|
|
146
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-field>label,
|
|
147
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-radio-group legend {
|
|
148
|
+
font-family: var(--rhine-mono);
|
|
149
|
+
font-size: 12px;
|
|
150
|
+
letter-spacing: .1em;
|
|
151
|
+
color: var(--rhine-muted);
|
|
152
|
+
}
|
|
153
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-field input,
|
|
154
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-field textarea {
|
|
155
|
+
background: #101216;
|
|
156
|
+
border-color: var(--rhine-control);
|
|
157
|
+
}
|
|
158
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-field input:focus,
|
|
159
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-field textarea:focus {
|
|
160
|
+
border-color: var(--ak-accent);
|
|
161
|
+
box-shadow: inset 3px 0 0 var(--ak-accent);
|
|
162
|
+
}
|
|
163
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-check input,
|
|
164
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-radio-group input { accent-color: var(--ak-accent); }
|
|
165
|
+
|
|
166
|
+
/* 开关:方轨道方块 */
|
|
167
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-switch__track { border-radius: 0; }
|
|
168
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-switch__track>span { border-radius: 0; }
|
|
169
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-switch input:checked+.rhine-switch__track { background: var(--ak-accent); border-color: var(--ak-accent); }
|
|
170
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-switch input:checked+.rhine-switch__track>span { background: var(--ak-accent-ink); }
|
|
171
|
+
|
|
172
|
+
/* 下拉浮层 */
|
|
173
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-combobox__list,
|
|
174
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-popover,
|
|
175
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-menu {
|
|
176
|
+
background: var(--ak-panel-hi);
|
|
177
|
+
border-color: var(--rhine-control);
|
|
178
|
+
border-radius: 0;
|
|
179
|
+
box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
|
|
180
|
+
}
|
|
181
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-combobox__list [role=option][data-active=true],
|
|
182
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-combobox__list [role=option][aria-selected=true],
|
|
183
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-menu__item[data-highlighted] {
|
|
184
|
+
background: rgba(255, 212, 0, .12);
|
|
185
|
+
box-shadow: inset 3px 0 0 var(--ak-accent);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* ================= 选择卡 ================= */
|
|
189
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-selection {
|
|
190
|
+
background: var(--ak-panel);
|
|
191
|
+
clip-path: polygon(0 0, calc(100% - var(--ak-cut)) 0, 100% var(--ak-cut), 100% 100%, 0 100%);
|
|
192
|
+
}
|
|
193
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-selection:hover:not([data-disabled=true]) {
|
|
194
|
+
background: var(--ak-panel-hi);
|
|
195
|
+
border-color: var(--ak-accent);
|
|
196
|
+
}
|
|
197
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-selection[data-selected=true] {
|
|
198
|
+
border-color: var(--ak-accent);
|
|
199
|
+
background: var(--rhine-selected);
|
|
200
|
+
box-shadow: inset 0 0 0 1px var(--ak-accent), inset 4px 0 0 var(--ak-accent);
|
|
201
|
+
}
|
|
202
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-selection input { accent-color: var(--ak-accent); }
|
|
203
|
+
|
|
204
|
+
/* ================= Tabs / Segmented ================= */
|
|
205
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-tabs__list button { letter-spacing: .05em; }
|
|
206
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-tabs__list button[aria-selected=true] { color: var(--ak-accent); }
|
|
207
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-tabs__list button::after {
|
|
208
|
+
background: var(--ak-accent);
|
|
209
|
+
height: 3px;
|
|
210
|
+
clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
|
|
211
|
+
}
|
|
212
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-segmented { border-color: var(--rhine-control); background: #101216; }
|
|
213
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-segmented input:checked+span {
|
|
214
|
+
background: var(--ak-accent);
|
|
215
|
+
color: var(--ak-accent-ink);
|
|
216
|
+
font-weight: 600;
|
|
217
|
+
clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* ================= 数据组件 ================= */
|
|
221
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-table th {
|
|
222
|
+
font-family: var(--rhine-mono);
|
|
223
|
+
letter-spacing: .08em;
|
|
224
|
+
border-bottom: 2px solid var(--ak-accent);
|
|
225
|
+
}
|
|
226
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-table tbody tr:hover { background: rgba(255, 212, 0, .06); }
|
|
227
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-metric { font-variant-numeric: tabular-nums; }
|
|
228
|
+
|
|
229
|
+
/* ================= 反馈 ================= */
|
|
230
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-progress__track { height: 8px; background: #1e2126; }
|
|
231
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-progress__track>span {
|
|
232
|
+
background: linear-gradient(90deg, var(--ak-accent), var(--rhine-signal));
|
|
233
|
+
}
|
|
234
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-notice,
|
|
235
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-toast {
|
|
236
|
+
border-left-width: 4px;
|
|
237
|
+
clip-path: polygon(0 0, calc(100% - var(--ak-cut-sm)) 0, 100% var(--ak-cut-sm), 100% 100%, 0 100%);
|
|
238
|
+
}
|
|
239
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-skeleton>span[aria-hidden] { background: #22262c; }
|
|
240
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-disclosure summary>span { color: var(--ak-accent); }
|
|
241
|
+
|
|
242
|
+
/* ================= 浮层 / 对话框 ================= */
|
|
243
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-overlay { background: rgba(4, 5, 7, .72); }
|
|
244
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-dialog {
|
|
245
|
+
background: var(--ak-panel);
|
|
246
|
+
border-color: var(--rhine-control);
|
|
247
|
+
border-radius: 0;
|
|
248
|
+
box-shadow: 0 24px 64px rgba(0, 0, 0, .6);
|
|
249
|
+
clip-path: polygon(0 0, calc(100% - var(--ak-cut)) 0, 100% var(--ak-cut), 100% 100%, 0 100%);
|
|
250
|
+
}
|
|
251
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-tooltip {
|
|
252
|
+
background: var(--ak-accent);
|
|
253
|
+
color: var(--ak-accent-ink);
|
|
254
|
+
border-radius: 0;
|
|
255
|
+
font-family: var(--rhine-mono);
|
|
256
|
+
letter-spacing: .04em;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/* ================= 步骤条 ================= */
|
|
260
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-steps__number { color: var(--ak-accent); }
|
|
261
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-steps li[data-state=current]>div {
|
|
262
|
+
background: rgba(255, 212, 0, .08);
|
|
263
|
+
color: var(--ak-accent);
|
|
264
|
+
}
|
|
265
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-steps li[data-state=current],
|
|
266
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-steps li[data-state=complete] { border-color: var(--ak-accent); }
|
|
267
|
+
|
|
268
|
+
/* 按钮扫光(滑入的高光层) */
|
|
269
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-button {
|
|
270
|
+
background-image: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
|
|
271
|
+
background-repeat: no-repeat;
|
|
272
|
+
background-size: 220% 100%;
|
|
273
|
+
background-position: 130% 0;
|
|
274
|
+
transition:
|
|
275
|
+
background-color var(--rhine-duration-hover) var(--rhine-ease-standard),
|
|
276
|
+
border-color var(--rhine-duration-hover) var(--rhine-ease-standard),
|
|
277
|
+
transform var(--rhine-duration-press) var(--rhine-ease-standard),
|
|
278
|
+
background-position 320ms var(--rhine-ease-standard);
|
|
279
|
+
}
|
|
280
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-button:hover:not(:disabled):not([aria-disabled=true]) {
|
|
281
|
+
background-position: -80% 0;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/* 侧栏导航加序号 */
|
|
285
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-side-nav ul { counter-reset: ak-nav; }
|
|
286
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-side-nav a { counter-increment: ak-nav; }
|
|
287
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-side-nav a::before {
|
|
288
|
+
content: counter(ak-nav, decimal-leading-zero);
|
|
289
|
+
font: 10px/1 var(--rhine-mono);
|
|
290
|
+
color: var(--rhine-control);
|
|
291
|
+
flex: none;
|
|
292
|
+
}
|
|
293
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-side-nav a[aria-current=page]::before { color: var(--ak-accent); }
|
|
294
|
+
|
|
295
|
+
/* 面板悬停:角标点亮 */
|
|
296
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-surface { transition: border-color var(--rhine-duration-hover) var(--rhine-ease-standard); }
|
|
297
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-surface:hover { border-color: var(--rhine-control); }
|
|
298
|
+
.rhine-theme[data-rhine-theme="arknights"] .rhine-surface:hover::after { opacity: 1; }
|
|
299
|
+
.rhine-theme[data-rhine-theme="arknights"][data-rhine-motion=reduced] .rhine-button {
|
|
300
|
+
transition: none;
|
|
301
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/* Component theme. Imported automatically by @linhey/rhine-design/theme, or after styles.css for CSS-only usage. */
|
|
2
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] {
|
|
3
|
+
color-scheme: light;
|
|
4
|
+
--rhine-bg: #eaf0f4;
|
|
5
|
+
--rhine-surface: #fffdf5;
|
|
6
|
+
--rhine-ink: #202323;
|
|
7
|
+
--rhine-muted: #59616a;
|
|
8
|
+
--rhine-line: #b9c1c7;
|
|
9
|
+
--rhine-control: #202323;
|
|
10
|
+
--rhine-selected: #fce4cc;
|
|
11
|
+
--rhine-green: #286043;
|
|
12
|
+
--rhine-signal: #ff8b3d;
|
|
13
|
+
--rhine-warning: #854216;
|
|
14
|
+
--rhine-warning-bg: #fce4cc;
|
|
15
|
+
--rhine-error: #a02e36;
|
|
16
|
+
--rhine-error-bg: #fbe1df;
|
|
17
|
+
--rhine-radius-card: 22px;
|
|
18
|
+
--rhine-radius-control: 12px;
|
|
19
|
+
--rhine-weight-heading: 750;
|
|
20
|
+
--rhine-weight-label: 600;
|
|
21
|
+
--rhine-text-metric: 36px;
|
|
22
|
+
--rhine-leading-metric: 44px;
|
|
23
|
+
--rhine-hard-shadow: 5px 5px 0 var(--rhine-ink);
|
|
24
|
+
--rhine-tag-green: #dcebd7;
|
|
25
|
+
--rhine-tag-orange: #fce0c4;
|
|
26
|
+
--rhine-tag-violet: #e3e0f7;
|
|
27
|
+
background: radial-gradient(circle, #b7c2cc .8px, transparent .9px) 0 0 / 14px 14px, var(--rhine-bg);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] :is(.rhine-surface, .rhine-selection, .rhine-empty, .rhine-fieldset) {
|
|
31
|
+
border: 2px solid var(--rhine-ink);
|
|
32
|
+
border-radius: var(--rhine-radius-card);
|
|
33
|
+
box-shadow: var(--rhine-hard-shadow);
|
|
34
|
+
}
|
|
35
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-button {
|
|
36
|
+
border: 2px solid var(--rhine-ink);
|
|
37
|
+
background: var(--rhine-signal);
|
|
38
|
+
color: var(--rhine-ink);
|
|
39
|
+
box-shadow: 3px 3px 0 var(--rhine-ink);
|
|
40
|
+
font-weight: 700;
|
|
41
|
+
transition: background-color 120ms, transform 80ms, box-shadow 80ms;
|
|
42
|
+
}
|
|
43
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-button--secondary { background: #fff; }
|
|
44
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-button--quiet { background: transparent; border-color: transparent; box-shadow: none; }
|
|
45
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-button--danger { background: var(--rhine-error); color: #fff; }
|
|
46
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-button:hover:not(:disabled):not([aria-disabled=true]) { background: #ffb16e; border-color: var(--rhine-ink); }
|
|
47
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] :is(.rhine-button--secondary, .rhine-button--quiet):hover:not(:disabled):not([aria-disabled=true]) { background: var(--rhine-selected); }
|
|
48
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-button--danger:hover:not(:disabled):not([aria-disabled=true]) { background: #81262d; }
|
|
49
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-button:active:not(:disabled):not([aria-disabled=true]) { transform: translate(3px, 3px); box-shadow: none; }
|
|
50
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-button:disabled { background: #e1e5e8; color: var(--rhine-muted); border-color: #89929a; box-shadow: none; }
|
|
51
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-button[aria-busy=true] { box-shadow: none; }
|
|
52
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] :is(button, input, select, textarea, summary, a, [tabindex]):focus-visible { outline: 3px solid var(--rhine-ink); outline-offset: 4px; }
|
|
53
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-tone-success { --rhine-tone-bg: var(--rhine-tag-green); }
|
|
54
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-tone-neutral { --rhine-tone-bg: #e7ebee; }
|
|
55
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-badge { border: 1px solid currentColor; border-radius: 8px; padding: 3px 9px; font-weight: 600; }
|
|
56
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-type-tag { display: inline-flex; padding: 4px 10px; border: 1.5px solid var(--rhine-ink); border-radius: 8px; color: var(--rhine-ink); font-size: 12px; line-height: 20px; font-weight: 700; }
|
|
57
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-type-tag[data-color=green] { background: var(--rhine-tag-green); }
|
|
58
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-type-tag[data-color=orange] { background: var(--rhine-tag-orange); }
|
|
59
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-type-tag[data-color=violet] { background: var(--rhine-tag-violet); }
|
|
60
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] :is(.rhine-field input, .rhine-field textarea, .rhine-select select, .rhine-segmented) { border-width: 2px; background: #fff; }
|
|
61
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] :is(.rhine-field input, .rhine-field textarea, .rhine-select select):disabled { background: #e1e5e8; border-color: #89929a; }
|
|
62
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-segmented__option span { border-radius: 8px; }
|
|
63
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-segmented input:checked+span { background: var(--rhine-selected); color: var(--rhine-ink); box-shadow: inset 0 0 0 1px var(--rhine-ink); }
|
|
64
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-selection:hover:not([data-disabled=true]) { background: #fff4e8; border-color: var(--rhine-ink); }
|
|
65
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-selection[data-selected=true] { background: var(--rhine-selected); border-color: var(--rhine-ink); }
|
|
66
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-selection[data-disabled=true] { box-shadow: none; }
|
|
67
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] :is(.rhine-dialog, .rhine-popover, .rhine-menu, .rhine-combobox__list) { border: 2px solid var(--rhine-ink); border-radius: 18px; box-shadow: var(--rhine-hard-shadow); }
|
|
68
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-dialog { border-radius: 24px; box-shadow: 8px 8px 0 var(--rhine-ink); }
|
|
69
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-drawer { border-radius: 24px 0 0 24px; box-shadow: -5px 0 0 var(--rhine-ink); }
|
|
70
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-overlay { background: #20232360; backdrop-filter: none; }
|
|
71
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-menu__item { border-radius: 10px; }
|
|
72
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-menu__item[data-highlighted] { box-shadow: inset 0 0 0 2px var(--rhine-ink); }
|
|
73
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-tooltip { border-radius: 8px; }
|
|
74
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] :is(.rhine-notice, .rhine-toast, .rhine-error-summary) { border: 2px solid var(--rhine-tone, var(--rhine-error)); border-radius: 14px; }
|
|
75
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-table th { color: var(--rhine-ink); background: #edf0e9; font-weight: 700; border-bottom: 2px solid var(--rhine-ink); }
|
|
76
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-table :is(th, td) { padding: 16px 12px; }
|
|
77
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-table td { font-size: 14px; }
|
|
78
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-progress__track { height: 10px; border: 1.5px solid var(--rhine-ink); border-radius: 6px; background: #e7ebee; }
|
|
79
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-progress__track>span { background: var(--rhine-signal); }
|
|
80
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-side-nav a[aria-current=page] { color: var(--rhine-ink); border: 2px solid var(--rhine-ink); background: var(--rhine-selected); font-weight: 700; }
|
|
81
|
+
@media(prefers-reduced-motion:reduce) {
|
|
82
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"] .rhine-button:active:not(:disabled):not([aria-disabled=true]) { transform: none; }
|
|
83
|
+
}
|
|
84
|
+
.rhine-theme[data-rhine-theme="neo-brutalism"][data-rhine-motion=reduced] .rhine-button:active:not(:disabled):not([aria-disabled=true]) { transform: none; }
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { createContext, useCallback, useContext, useMemo, useState, type HTMLAttributes } from 'react';
|
|
2
|
+
import './styles.css';
|
|
3
|
+
import './theme-arknights.css';
|
|
4
|
+
import './theme-neo-brutalism.css';
|
|
5
|
+
|
|
6
|
+
export const themes = [
|
|
7
|
+
{ name: 'rhine', label: '莱茵 · 纸面' },
|
|
8
|
+
{ name: 'arknights', label: '明日方舟 · 战术终端' },
|
|
9
|
+
{ name: 'neo-brutalism', label: '橙趣 · 粗描边' },
|
|
10
|
+
] as const;
|
|
11
|
+
|
|
12
|
+
export type ThemeName = typeof themes[number]['name'];
|
|
13
|
+
|
|
14
|
+
export interface ThemeProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
defaultTheme?: ThemeName;
|
|
16
|
+
theme?: ThemeName;
|
|
17
|
+
onThemeChange?: (theme: ThemeName) => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface ThemeContextValue {
|
|
21
|
+
theme: ThemeName;
|
|
22
|
+
setTheme: (theme: ThemeName) => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const ThemeContext = createContext<ThemeContextValue | null>(null);
|
|
26
|
+
|
|
27
|
+
function assertTheme(theme: ThemeName) {
|
|
28
|
+
if (!themes.some(item => item.name === theme)) {
|
|
29
|
+
throw new Error(`Unknown Rhine theme: ${String(theme)}. Use a name from themes.`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function ThemeProvider({ theme: controlledTheme, defaultTheme = 'rhine', onThemeChange, className, children, ...rootProps }: ThemeProviderProps) {
|
|
34
|
+
const parent = useContext(ThemeContext);
|
|
35
|
+
const [internalTheme, setInternalTheme] = useState(defaultTheme);
|
|
36
|
+
const theme = controlledTheme ?? internalTheme;
|
|
37
|
+
const setTheme = useCallback((next: ThemeName) => {
|
|
38
|
+
assertTheme(next);
|
|
39
|
+
if (next === theme) return;
|
|
40
|
+
if (controlledTheme === undefined) setInternalTheme(next);
|
|
41
|
+
onThemeChange?.(next);
|
|
42
|
+
}, [controlledTheme, onThemeChange, theme]);
|
|
43
|
+
const value = useMemo(() => ({ theme, setTheme }), [theme, setTheme]);
|
|
44
|
+
|
|
45
|
+
// Descendant CSS selectors cannot isolate nested theme roots yet.
|
|
46
|
+
if (parent) throw new Error('Nested Rhine ThemeProvider is not supported. Use sibling providers instead.');
|
|
47
|
+
assertTheme(theme);
|
|
48
|
+
|
|
49
|
+
return <ThemeContext.Provider value={value}>
|
|
50
|
+
<div {...rootProps} className={['rhine-theme', className].filter(Boolean).join(' ')} data-rhine-theme={theme}>{children}</div>
|
|
51
|
+
</ThemeContext.Provider>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function useTheme(): ThemeContextValue {
|
|
55
|
+
const context = useContext(ThemeContext);
|
|
56
|
+
if (!context) throw new Error('useTheme must be used within a Rhine ThemeProvider.');
|
|
57
|
+
return context;
|
|
58
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.rhine-timeline { display:grid; gap:var(--rhine-space-1); min-width:0; }
|
|
2
|
+
.rhine-timeline__track { position:relative; height:44px; }
|
|
3
|
+
.rhine-timeline__bars { height:100%; display:flex; gap:1px; align-items:center; }
|
|
4
|
+
.rhine-timeline__bars span { flex:1; min-width:0; height:20px; background:var(--rhine-line); }
|
|
5
|
+
.rhine-timeline [data-status=healthy],.rhine-timeline__legend [data-status=healthy] { background:var(--rhine-health-healthy); }
|
|
6
|
+
.rhine-timeline [data-status=recovered],.rhine-timeline__legend [data-status=recovered] { background:repeating-linear-gradient(135deg,var(--rhine-health-recovered) 0 2px,var(--rhine-surface) 2px 4px); }
|
|
7
|
+
.rhine-timeline [data-status=degraded],.rhine-timeline__legend [data-status=degraded] { background:var(--rhine-health-degraded); }
|
|
8
|
+
.rhine-timeline [data-status=failed],.rhine-timeline__legend [data-status=failed] { background:var(--rhine-health-failed); }
|
|
9
|
+
.rhine-timeline [data-status=unknown],.rhine-timeline__legend [data-status=unknown] { background:var(--rhine-health-unknown); }
|
|
10
|
+
.rhine-timeline__bars [data-selected=true] { height:28px; outline:1px solid var(--rhine-ink); outline-offset:1px; }
|
|
11
|
+
.rhine-timeline__track input { appearance:none; position:absolute; inset:0; margin:0; width:100%; height:44px; background:transparent; cursor:crosshair; color:transparent; }
|
|
12
|
+
.rhine-timeline__track input::-webkit-slider-thumb { appearance:none; width:1px; height:44px; background:transparent; }
|
|
13
|
+
.rhine-timeline__track input::-moz-range-thumb { border:0; width:1px; height:44px; background:transparent; }
|
|
14
|
+
.rhine-timeline__range { display:flex; justify-content:space-between; gap:var(--rhine-space-2); }
|
|
15
|
+
.rhine-timeline__legend { display:flex; flex-wrap:wrap; gap:var(--rhine-space-2) var(--rhine-space-3); margin:0; padding:0; list-style:none; font-size:var(--rhine-text-caption); line-height:var(--rhine-leading-caption); color:var(--rhine-muted); }
|
|
16
|
+
.rhine-timeline__legend li { display:flex; align-items:center; gap:var(--rhine-space-1); }
|
|
17
|
+
.rhine-timeline__legend span { width:8px; height:12px; background:var(--rhine-line); }
|
|
18
|
+
.rhine-timeline--compact { position:relative; gap:0; }
|
|
19
|
+
.rhine-timeline--compact .rhine-timeline__track { height:20px; }
|
|
20
|
+
.rhine-timeline--compact .rhine-timeline__track input { top:-12px; bottom:auto; }
|
|
21
|
+
.rhine-timeline--compact .rhine-timeline__detail { position:absolute; z-index:2; top:100%; inset-inline:0; padding:4px 8px; border:1px solid var(--rhine-line); background:var(--rhine-surface); box-shadow:0 4px 12px #242b2814; pointer-events:none; visibility:hidden; }
|
|
22
|
+
.rhine-timeline--compact:hover .rhine-timeline__detail,.rhine-timeline--compact:focus-within .rhine-timeline__detail { visibility:visible; }
|
|
23
|
+
.rhine-timeline--compact:not(:hover):not(:focus-within) .rhine-timeline__bars [data-selected=true] { height:20px; outline:none; }
|
package/components/tokens.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* Canonical tokens for the component library and design previews. */
|
|
2
|
-
:root {
|
|
2
|
+
:root, :where(.rhine-theme[data-rhine-theme]) {
|
|
3
3
|
--rhine-bg: #f2f1e9;
|
|
4
4
|
--rhine-surface: #fcfcf8;
|
|
5
5
|
--rhine-ink: #242b28;
|
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
--rhine-signal: #c65c34;
|
|
12
12
|
--rhine-warning: #8a472c;
|
|
13
13
|
--rhine-error: #a13e35;
|
|
14
|
+
--rhine-health-healthy: #19b88a;
|
|
15
|
+
--rhine-health-recovered: #42b8c8;
|
|
16
|
+
--rhine-health-degraded: #efa629;
|
|
17
|
+
--rhine-health-failed: #ef6464;
|
|
18
|
+
--rhine-health-unknown: #c5ccd3;
|
|
14
19
|
--rhine-warning-bg: #f4e8dc;
|
|
15
20
|
--rhine-error-bg: #f6e9e4;
|
|
16
21
|
--rhine-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
|