@q1travel/design-system 0.18.0 → 0.20.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.
@@ -448,7 +448,9 @@ These components ship in the package. Compose from this list before writing new
448
448
  - Tabs switch between peer views of the same subject. They are not a way to shorten a page.
449
449
  - ContextSwitcher is the two-level selection model; the consumer owns the state behind it.
450
450
 
451
- **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. Pass only the brand name through `brand`; the component renders "by" itself.
452
454
 
453
455
  **Text utilities.** Code, CodeInline, CodeTokens, CodeBlock, Snippet, Kbd, MiddleTruncate, TextWithCopyButton.
454
456
 
@@ -448,7 +448,9 @@ These components ship in the package. Compose from this list before writing new
448
448
  - Tabs switch between peer views of the same subject. They are not a way to shorten a page.
449
449
  - ContextSwitcher is the two-level selection model; the consumer owns the state behind it.
450
450
 
451
- **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. Pass only the brand name through `brand`; the component renders "by" itself.
452
454
 
453
455
  **Text utilities.** Code, CodeInline, CodeTokens, CodeBlock, Snippet, Kbd, MiddleTruncate, TextWithCopyButton.
454
456
 
@@ -118,6 +118,24 @@ Examples:
118
118
  Shipped today for the `.form-control` skin: `--q1-input-bg`, `--q1-input-border`,
119
119
  `--q1-input-fg`, `--q1-input-border-focus`, `--q1-input-focus-ring`.
120
120
 
121
+ Shipped for `Table` rows, defined in `tokens.css` for both themes:
122
+
123
+ | Token | Light | Dark | Derivation |
124
+ | --- | --- | --- | --- |
125
+ | `--q1-table-row-bg` | `#ffffff` | `#121212` | `var(--q1-color-bg-canvas)` |
126
+ | `--q1-table-row-bg-hover` | `#f6f6f6` | `#1f1f1f` | `--q1-color-bg-hover` flattened onto the canvas (text-primary at 4% light, 6% dark) |
127
+ | `--q1-table-row-bg-selected` | `#f1efff` | `#1f1e38` | `var(--q1-color-bg-selected)` |
128
+ | `--q1-table-row-bg-selected-hover` | `#edebfa` | `#25243d` | text-primary at half the hover strength (2% light, 3% dark) over the selected surface |
129
+
130
+ Every value is opaque. Table cells, not rows, carry the background and read it from the row, so a
131
+ sticky column always paints the same color as the rest of its row and never lets scrolled content
132
+ show through; row states swap the value instead of stacking a translucent layer. The half-strength
133
+ selected hover keeps `--q1-color-text-muted` at or above 4.5:1. `check-contrast-contract` recomputes
134
+ each derivation and checks the three text levels against all four values. Unlike the input tokens they
135
+ ship with values, because the pre-mixed colors exist nowhere else; `Table` still reads each one with
136
+ a fallback (`bg-canvas`, `bg-subtle`, `bg-selected`) so a stylesheet without them keeps an opaque
137
+ row. A table on a surface other than the canvas overrides all four on the table or its container.
138
+
121
139
  Every component token MUST declare a fallback to the semantic token it replaces, so a
122
140
  consumer that defines none of them sees no change. A component token without a fallback
123
141
  turns an opt-in customisation surface into a required one: the first consumer to upgrade
@@ -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, brand, size, className, 'aria-label': ariaLabel, ...rest }: ProductLockupProps): JSX.Element;
1385
+
1386
+ export declare type ProductLockupProps = {
1387
+ /** 产品名称,以文字渲染,随主题承色。 */
1388
+ name: string;
1389
+ /** 产品图标,视为装饰,不参与朗读。默认为品牌符号。 */
1390
+ icon?: ReactNode;
1391
+ /** 背书品牌名,渲染为「by {brand}」。 */
1392
+ brand?: 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。 */