@q1travel/design-system 0.17.3 → 0.19.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/contracts/design.dark.md +41 -19
- package/contracts/design.md +27 -5
- package/contracts/token-naming.md +3 -1
- package/dist-pkg/design-system.d.ts +17 -0
- package/dist-pkg/design-system.js +881 -848
- package/dist-pkg/style.css +251 -94
- package/dist-pkg/tokens.css +65 -23
- package/package.json +1 -1
package/contracts/design.dark.md
CHANGED
|
@@ -14,10 +14,10 @@ colors:
|
|
|
14
14
|
secondary: "#a0a0a0"
|
|
15
15
|
tertiary: "#006efe"
|
|
16
16
|
neutral: "#1a1a1a"
|
|
17
|
-
background-100: "#
|
|
17
|
+
background-100: "#121212"
|
|
18
18
|
background-200: "#000000"
|
|
19
19
|
text-primary: "#ededed"
|
|
20
|
-
text-secondary: "#
|
|
20
|
+
text-secondary: "#b4b4b4"
|
|
21
21
|
text-muted: "#8f8f8f"
|
|
22
22
|
brand-preview-light-bg: "#ffffff"
|
|
23
23
|
brand-preview-light-fg: "#171717"
|
|
@@ -25,15 +25,16 @@ colors:
|
|
|
25
25
|
brand-preview-dark-fg: "#ededed"
|
|
26
26
|
mask-visible: "#ffffff"
|
|
27
27
|
mask-opaque: "#000000"
|
|
28
|
+
gray-50: "#161616"
|
|
28
29
|
gray-100: "#1a1a1a"
|
|
29
|
-
gray-200: "#
|
|
30
|
-
gray-300: "#
|
|
31
|
-
gray-400: "#
|
|
32
|
-
gray-500: "#
|
|
33
|
-
gray-600: "#
|
|
34
|
-
gray-700: "#
|
|
35
|
-
gray-800: "#
|
|
36
|
-
gray-900: "#
|
|
30
|
+
gray-200: "#222222"
|
|
31
|
+
gray-300: "#2b2b2b"
|
|
32
|
+
gray-400: "#333333"
|
|
33
|
+
gray-500: "#585858"
|
|
34
|
+
gray-600: "#7d7d7d"
|
|
35
|
+
gray-700: "#878787"
|
|
36
|
+
gray-800: "#8f8f8f"
|
|
37
|
+
gray-900: "#b4b4b4"
|
|
37
38
|
gray-1000: "#ededed"
|
|
38
39
|
primary-100: "#15103a"
|
|
39
40
|
primary-200: "#1a1547"
|
|
@@ -122,28 +123,47 @@ semantic-colors:
|
|
|
122
123
|
action-on-primary: "#ffffff"
|
|
123
124
|
action-text: "{colors.primary-900}"
|
|
124
125
|
surface-canvas: "{colors.background-100}"
|
|
125
|
-
surface-subtle: "{colors.gray-
|
|
126
|
-
surface-panel: "{colors.
|
|
126
|
+
surface-subtle: "{colors.gray-50}"
|
|
127
|
+
surface-panel: "{colors.gray-100}"
|
|
128
|
+
surface-sunken: "{colors.gray-50}"
|
|
129
|
+
surface-raised: "{colors.gray-200}"
|
|
130
|
+
surface-overlay: "{colors.gray-300}"
|
|
131
|
+
surface-hover: "color-mix(in srgb, var(--q1-color-text-primary) 6%, transparent)"
|
|
132
|
+
surface-selected: "#1f1e38"
|
|
133
|
+
surface-inverse: "{colors.gray-1000}"
|
|
134
|
+
text-on-inverse: "#0a0a0a"
|
|
127
135
|
surface-media: "#0a0a0a"
|
|
128
136
|
text-on-media: "#ffffff"
|
|
129
|
-
border: "{colors.gray-
|
|
137
|
+
border: "{colors.gray-400}"
|
|
130
138
|
border-strong: "{colors.gray-400}"
|
|
131
|
-
border-
|
|
139
|
+
border-active: "{colors.primary-900}"
|
|
140
|
+
border-subtle: "#2a2a2a"
|
|
132
141
|
text-primary: "{colors.text-primary}"
|
|
133
142
|
text-secondary: "{colors.text-secondary}"
|
|
134
143
|
text-muted: "{colors.text-muted}"
|
|
135
144
|
text-soft: "#9a9a9c"
|
|
145
|
+
text-disabled: "{colors.gray-500}"
|
|
136
146
|
overlay-scrim: "rgba(2, 6, 23, 0.44)"
|
|
137
147
|
selection-background: "{colors.text-primary}"
|
|
138
148
|
selection-foreground: "{colors.background-100}"
|
|
139
|
-
focus-ring: "{colors.primary}"
|
|
140
|
-
focus: "{colors.primary-
|
|
149
|
+
focus-ring: "{colors.primary-900}"
|
|
150
|
+
focus: "{colors.primary-900}"
|
|
141
151
|
status-success: "{colors.green-900}"
|
|
152
|
+
status-success-text: "{colors.green-900}"
|
|
153
|
+
status-success-surface: "{colors.green-100}"
|
|
154
|
+
status-success-border: "#255a2f"
|
|
142
155
|
status-warning: "{colors.amber-700}"
|
|
156
|
+
status-warning-text: "#fac053"
|
|
157
|
+
status-warning-surface: "{colors.amber-100}"
|
|
158
|
+
status-warning-border: "#754b10"
|
|
143
159
|
status-danger: "{colors.red-900}"
|
|
144
|
-
status-danger-text: "#
|
|
160
|
+
status-danger-text: "#f97770"
|
|
145
161
|
status-danger-surface: "{colors.red-100}"
|
|
146
|
-
status-danger-border: "#
|
|
162
|
+
status-danger-border: "#7e2f31"
|
|
163
|
+
status-info: "{colors.blue-900}"
|
|
164
|
+
status-info-text: "{colors.blue-900}"
|
|
165
|
+
status-info-surface: "{colors.blue-100}"
|
|
166
|
+
status-info-border: "#194f81"
|
|
147
167
|
typography:
|
|
148
168
|
heading-72:
|
|
149
169
|
fontFamily: Noto Sans SC
|
|
@@ -428,7 +448,9 @@ These components ship in the package. Compose from this list before writing new
|
|
|
428
448
|
- Tabs switch between peer views of the same subject. They are not a way to shorten a page.
|
|
429
449
|
- ContextSwitcher is the two-level selection model; the consumer owns the state behind it.
|
|
430
450
|
|
|
431
|
-
**Identity and media.** Avatar, AvatarGroup, Book, Browser, BrowserDots, BrowserControls, BrowserAddress, BrowserTabs, BrowserPlaceholder, Phone, Video, ThemeSwitcher.
|
|
451
|
+
**Identity and media.** Avatar, AvatarGroup, Book, Browser, BrowserDots, BrowserControls, BrowserAddress, BrowserTabs, BrowserPlaceholder, Phone, Video, ThemeSwitcher, ProductLockup, Q1travelSymbol.
|
|
452
|
+
|
|
453
|
+
- ProductLockup combines a product icon, product name, and brand endorsement into one identity mark. The endorsement is smaller and uses secondary text color.
|
|
432
454
|
|
|
433
455
|
**Text utilities.** Code, CodeInline, CodeTokens, CodeBlock, Snippet, Kbd, MiddleTruncate, TextWithCopyButton.
|
|
434
456
|
|
package/contracts/design.md
CHANGED
|
@@ -25,9 +25,10 @@ colors:
|
|
|
25
25
|
brand-preview-dark-fg: "#ededed"
|
|
26
26
|
mask-visible: "#ffffff"
|
|
27
27
|
mask-opaque: "#000000"
|
|
28
|
+
gray-50: "#fafafa"
|
|
28
29
|
gray-100: "#f2f2f2"
|
|
29
|
-
gray-200: "#
|
|
30
|
-
gray-300: "#
|
|
30
|
+
gray-200: "#eeeeee"
|
|
31
|
+
gray-300: "#ebebeb"
|
|
31
32
|
gray-400: "#eaeaea"
|
|
32
33
|
gray-500: "#c9c9c9"
|
|
33
34
|
gray-600: "#a8a8a8"
|
|
@@ -124,26 +125,45 @@ semantic-colors:
|
|
|
124
125
|
surface-canvas: "{colors.background-100}"
|
|
125
126
|
surface-subtle: "{colors.background-200}"
|
|
126
127
|
surface-panel: "{colors.background-100}"
|
|
128
|
+
surface-sunken: "{colors.background-100}"
|
|
129
|
+
surface-raised: "{colors.background-100}"
|
|
130
|
+
surface-overlay: "{colors.background-100}"
|
|
131
|
+
surface-hover: "color-mix(in srgb, var(--q1-color-text-primary) 4%, transparent)"
|
|
132
|
+
surface-selected: "{colors.primary-100}"
|
|
133
|
+
surface-inverse: "{colors.gray-1000}"
|
|
134
|
+
text-on-inverse: "{colors.background-100}"
|
|
127
135
|
surface-media: "#0a0a0a"
|
|
128
136
|
text-on-media: "#ffffff"
|
|
129
137
|
border: "{colors.gray-400}"
|
|
130
138
|
border-strong: "{colors.gray-500}"
|
|
139
|
+
border-active: "{colors.primary-700}"
|
|
131
140
|
border-subtle: "rgba(203, 213, 225, 0.82)"
|
|
132
141
|
text-primary: "{colors.text-primary}"
|
|
133
142
|
text-secondary: "{colors.text-secondary}"
|
|
134
143
|
text-muted: "{colors.text-muted}"
|
|
135
144
|
text-soft: "#6e6e73"
|
|
145
|
+
text-disabled: "#b7b7b7"
|
|
136
146
|
overlay-scrim: "rgba(2, 6, 23, 0.44)"
|
|
137
147
|
selection-background: "{colors.text-primary}"
|
|
138
148
|
selection-foreground: "{colors.background-100}"
|
|
139
149
|
focus-ring: "{colors.primary}"
|
|
140
150
|
focus: "{colors.primary-700}"
|
|
141
151
|
status-success: "{colors.green-700}"
|
|
152
|
+
status-success-text: "{colors.green-900}"
|
|
153
|
+
status-success-surface: "{colors.green-100}"
|
|
154
|
+
status-success-border: "#a8d9ad"
|
|
142
155
|
status-warning: "{colors.amber-900}"
|
|
156
|
+
status-warning-text: "{colors.amber-900}"
|
|
157
|
+
status-warning-surface: "{colors.amber-100}"
|
|
158
|
+
status-warning-border: "#edc47d"
|
|
143
159
|
status-danger: "{colors.red-700}"
|
|
144
|
-
status-danger-text: "#
|
|
160
|
+
status-danger-text: "#c62828"
|
|
145
161
|
status-danger-surface: "{colors.red-100}"
|
|
146
|
-
status-danger-border: "#
|
|
162
|
+
status-danger-border: "#f5b9b8"
|
|
163
|
+
status-info: "{colors.blue-700}"
|
|
164
|
+
status-info-text: "#0064b8"
|
|
165
|
+
status-info-surface: "{colors.blue-100}"
|
|
166
|
+
status-info-border: "#abcff0"
|
|
147
167
|
typography:
|
|
148
168
|
heading-72:
|
|
149
169
|
fontFamily: Noto Sans SC
|
|
@@ -428,7 +448,9 @@ These components ship in the package. Compose from this list before writing new
|
|
|
428
448
|
- Tabs switch between peer views of the same subject. They are not a way to shorten a page.
|
|
429
449
|
- ContextSwitcher is the two-level selection model; the consumer owns the state behind it.
|
|
430
450
|
|
|
431
|
-
**Identity and media.** Avatar, AvatarGroup, Book, Browser, BrowserDots, BrowserControls, BrowserAddress, BrowserTabs, BrowserPlaceholder, Phone, Video, ThemeSwitcher.
|
|
451
|
+
**Identity and media.** Avatar, AvatarGroup, Book, Browser, BrowserDots, BrowserControls, BrowserAddress, BrowserTabs, BrowserPlaceholder, Phone, Video, ThemeSwitcher, ProductLockup, Q1travelSymbol.
|
|
452
|
+
|
|
453
|
+
- ProductLockup combines a product icon, product name, and brand endorsement into one identity mark. The endorsement is smaller and uses secondary text color.
|
|
432
454
|
|
|
433
455
|
**Text utilities.** Code, CodeInline, CodeTokens, CodeBlock, Snippet, Kbd, MiddleTruncate, TextWithCopyButton.
|
|
434
456
|
|
|
@@ -96,7 +96,9 @@ Examples:
|
|
|
96
96
|
|
|
97
97
|
`--q1-color-status-danger` is the bright red for fills and strokes only; use `--q1-color-status-danger-text` for text and weak notices without an underline. `--q1-color-status-danger-surface` and `--q1-color-status-danger-border` keep the background and stroke roles separate. `--q1-color-text-soft`, `--q1-color-border-subtle`, and `--q1-color-overlay-scrim` cover tertiary text, quiet separators, and overlay scrims.
|
|
98
98
|
|
|
99
|
-
`--q1-color-focus` resolves to `--q1-color-primary-700
|
|
99
|
+
`--q1-color-focus` resolves to `--q1-color-primary-700` in light mode and `--q1-color-primary-900` in dark mode. `--q1-shadow-focus` draws a 2px canvas gap and a 2px focus ring for controls that use a shadow. Button-family controls use a 2px outline with a 2px offset; inputs use `--q1-color-border-active` plus a 1px inset stroke and the gapless translucent `--q1-shadow-focus-input` glow for pointer and keyboard focus. Invalid inputs use `--q1-shadow-focus-input-danger` for a red inset stroke and glow. Text links keep a fine underline at rest, deepen it on hover, and use a 3px focus-color underline for keyboard focus. Forced colors use a system Highlight outline.
|
|
100
|
+
|
|
101
|
+
Migration: `--q1-color-bg-panel` remains `#ffffff` in light mode and changes from `#0a0a0a` to `#1a1a1a` in dark mode. The dark canvas, raised surface, and overlay now use `#121212`, `#222222`, and `#2b2b2b`. Downstream overrides that manually raised panel or overlay backgrounds should be reviewed. `--q1-shadow-focus` keeps a canvas gap and uses a 2px focus ring; input focus adds a 1px inset stroke while preserving the translucent glow. Consumers with custom focus visuals should update their screenshots and forced-colors fallback. The unused `--q1-shadow-card` name is removed before release.
|
|
100
102
|
|
|
101
103
|
### Component Tokens
|
|
102
104
|
|
|
@@ -16,6 +16,7 @@ import { Ref } from 'react';
|
|
|
16
16
|
import { RefAttributes } from 'react';
|
|
17
17
|
import { RefObject } from 'react';
|
|
18
18
|
import { SelectHTMLAttributes } from 'react';
|
|
19
|
+
import { SVGProps } from 'react';
|
|
19
20
|
import { TableHTMLAttributes } from 'react';
|
|
20
21
|
import { TextareaHTMLAttributes } from 'react';
|
|
21
22
|
|
|
@@ -1380,6 +1381,20 @@ export declare type PillProps = {
|
|
|
1380
1381
|
|
|
1381
1382
|
export declare type PopoverLayout = 'vertical' | 'horizontal';
|
|
1382
1383
|
|
|
1384
|
+
export declare function ProductLockup({ name, icon, endorsement, size, className, 'aria-label': ariaLabel, ...rest }: ProductLockupProps): JSX.Element;
|
|
1385
|
+
|
|
1386
|
+
export declare type ProductLockupProps = {
|
|
1387
|
+
/** 产品名称,以文字渲染,随主题承色。 */
|
|
1388
|
+
name: string;
|
|
1389
|
+
/** 产品图标,视为装饰,不参与朗读。默认为品牌符号。 */
|
|
1390
|
+
icon?: ReactNode;
|
|
1391
|
+
/** 背书文字。 */
|
|
1392
|
+
endorsement?: string;
|
|
1393
|
+
size?: ProductLockupSize;
|
|
1394
|
+
} & Omit<HTMLAttributes<HTMLSpanElement>, 'children' | 'role'>;
|
|
1395
|
+
|
|
1396
|
+
export declare type ProductLockupSize = 'sm' | 'md';
|
|
1397
|
+
|
|
1383
1398
|
export declare function Progress({ value, max, tone, slim, stops, label, }: {
|
|
1384
1399
|
value: number;
|
|
1385
1400
|
max?: number;
|
|
@@ -1414,6 +1429,8 @@ export declare type ProjectBannerProps = {
|
|
|
1414
1429
|
action: ProjectBannerAction;
|
|
1415
1430
|
};
|
|
1416
1431
|
|
|
1432
|
+
export declare function Q1travelSymbol(props: SVGProps<SVGSVGElement>): JSX.Element;
|
|
1433
|
+
|
|
1417
1434
|
export declare function Radio({ ...props }: RadioProps): JSX.Element;
|
|
1418
1435
|
|
|
1419
1436
|
/** Radio 的完整 props。 */
|