@q1travel/design-system 0.21.0 → 0.22.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 +2 -0
- package/contracts/design.md +2 -0
- package/contracts/implementation-map.md +5 -0
- package/dist-pkg/design-system.d.ts +75 -1
- package/dist-pkg/design-system.js +4202 -3923
- package/dist-pkg/style.css +97 -12
- package/package.json +1 -1
package/contracts/design.dark.md
CHANGED
|
@@ -430,6 +430,8 @@ These components ship in the package. Compose from this list before writing new
|
|
|
430
430
|
|
|
431
431
|
`q1-design ls` prints this list from the installed package, and `q1-design doc <name>` prints one component's public API. Use those when the package is installed; use this section when it is not.
|
|
432
432
|
|
|
433
|
+
**Record activity.** Timeline, TimelineItem, Marker, Message, Mention, Composer, Attachment. Timeline uses chronological ol/li with tone dots or Avatar; Marker keeps system events quiet and dates centered. Message supports pending/failed and caller actions; Mention renders caller-owned inline member references using action-text and the selected surface. Composer is a textarea combobox with listbox mentions, Enter sends and Shift+Enter inserts a newline; IME composition never sends or picks. Attachment reuses Progress and named removal. Network, permissions and notifications remain caller-owned.
|
|
434
|
+
|
|
433
435
|
**Actions.** Button, ButtonLink, IconButton, SplitButton, LoadMoreButton, ClearButton, CopyButton, FilterChip, Link, Toolbar.
|
|
434
436
|
|
|
435
437
|
- Button carries the action. ButtonLink navigates but reads as a button, for a page-level call to action. Link reads as text, inside a sentence. Substituting one for another makes the page read wrong.
|
package/contracts/design.md
CHANGED
|
@@ -430,6 +430,8 @@ These components ship in the package. Compose from this list before writing new
|
|
|
430
430
|
|
|
431
431
|
`q1-design ls` prints this list from the installed package, and `q1-design doc <name>` prints one component's public API. Use those when the package is installed; use this section when it is not.
|
|
432
432
|
|
|
433
|
+
**Record activity.** Timeline, TimelineItem, Marker, Message, Mention, Composer, Attachment. Timeline uses chronological ol/li with tone dots or Avatar; Marker keeps system events quiet and dates centered. Message supports pending/failed and caller actions; Mention renders caller-owned inline member references using action-text and the selected surface. Composer is a textarea combobox with listbox mentions, Enter sends and Shift+Enter inserts a newline; IME composition never sends or picks. Attachment reuses Progress and named removal. Network, permissions and notifications remain caller-owned.
|
|
434
|
+
|
|
433
435
|
**Actions.** Button, ButtonLink, IconButton, SplitButton, LoadMoreButton, ClearButton, CopyButton, FilterChip, Link, Toolbar.
|
|
434
436
|
|
|
435
437
|
- Button carries the action. ButtonLink navigates but reads as a button, for a page-level call to action. Link reads as text, inside a sentence. Substituting one for another makes the page read wrong.
|
|
@@ -9,6 +9,7 @@ README owns the repository inventory and generated-file boundary. This file owns
|
|
|
9
9
|
| Reference intent | q1travel semantic | Canonical surface | Token source | State | Responsive | Accessibility |
|
|
10
10
|
| --- | --- | --- | --- | --- | --- | --- |
|
|
11
11
|
| Bounded documentation frame | Public design-system shell | `AppShell`, `Sidebar`, `Topbar` | `--q1-color-bg-canvas`, `--q1-color-border`, spacing tokens | Route changes reset document scroll | Frame width and sidebar collapse through layout CSS | Landmarks, keyboard search, focus-visible ring |
|
|
12
|
+
| Aligned date-range field | Date-range trigger shares the FieldSize scale | `Calendar`, `RangeField` (`fieldSize`; `size` remains grid-only) | `--q1-control-height-default`, `--q1-space-6`, `--q1-space-8`, `--q1-space-2`, `--q1-touch-target-min` | Draft, apply, clear and popover keyboard behavior preserved; clear/caret centered | Default md40 matches Select/Input; coarse44 matches Select | Named sibling buttons, APG date-picker dialog and focus return |
|
|
12
13
|
| Compact dashboard filters | Consumer-owned filter picker | `FilterChip` | `--q1-space-7` (28px), border-strong, text-secondary, action-text, shared focus | Unset dashed CirclePlus; set solid leading CircleX clear, label, divider, value and ChevronDown | Ellipsis bounds long values; shared TouchTarget preserves coarse 44px targets | Sibling native buttons, clear before picker in Tab order, focus returns to picker |
|
|
13
14
|
| Compact search and command menu | Fast documentation navigation | `CommandMenu`, `Topbar` search trigger | Surface, border, text, focus tokens | Open, active option, escape close | Dialog width clamps on small screens | `role="dialog"`, `aria-modal`, keyboard navigation |
|
|
14
15
|
| Foundation page rhythm | Scannable reference pages | `PageHeader`, `SpecSection`, `SpecTable` | Heading, copy, border, spacing tokens | None beyond links and focus | Tables scroll horizontally when needed | Semantic headings and tables |
|
|
@@ -90,3 +91,7 @@ Click, ArrowLeft/ArrowRight, Home, and End notify activation; controlled selecti
|
|
|
90
91
|
changes only when the parent updates `value`. Keyboard navigation follows the
|
|
91
92
|
focused enabled tab while the parent update is pending, and a later value update
|
|
92
93
|
does not pull focus from the activated button. Consumers own URL synchronization.
|
|
94
|
+
|
|
95
|
+
## Record activity (owner approved 2026-10-06)
|
|
96
|
+
|
|
97
|
+
Timeline / TimelineItem (ol/li, 8px token dot or Avatar), Marker (quiet actor/time, date separator), Message (default/pending/failed, caller actions) / Mention (inline action-text on selected surface), Composer (Tier A textarea combobox/listbox, IME guard, Enter send / Shift+Enter newline), Attachment (Progress, retry/remove) are public package components. `/patterns/record-activity` composes order facts, Switch, chronological activity and a pinned Composer. Existing tokens only; data, permissions, network and notifications remain caller-owned.
|
|
@@ -23,6 +23,18 @@ import { TextareaHTMLAttributes } from 'react';
|
|
|
23
23
|
|
|
24
24
|
export declare function addDays(date: Date, amount: number): Date;
|
|
25
25
|
|
|
26
|
+
export declare function Attachment({ name, size, type, progress, error, onRetry, onRemove, }: AttachmentProps): JSX.Element;
|
|
27
|
+
|
|
28
|
+
export declare type AttachmentProps = {
|
|
29
|
+
name: string;
|
|
30
|
+
size?: ReactNode;
|
|
31
|
+
type?: 'file' | 'image';
|
|
32
|
+
progress?: number;
|
|
33
|
+
error?: ReactNode;
|
|
34
|
+
onRetry?: () => void;
|
|
35
|
+
onRemove?: () => void;
|
|
36
|
+
};
|
|
37
|
+
|
|
26
38
|
export declare function AuthCard({ title, description, action, className }: AuthCardProps): JSX.Element;
|
|
27
39
|
|
|
28
40
|
/** Focused presentational card for account entry and connection flows. */
|
|
@@ -584,6 +596,27 @@ export declare type CommandMenuSection = {
|
|
|
584
596
|
items: CommandMenuItem[];
|
|
585
597
|
};
|
|
586
598
|
|
|
599
|
+
export declare function Composer({ onSubmit, onAttach, attachments, mentions, disabled, }: ComposerProps): JSX.Element;
|
|
600
|
+
|
|
601
|
+
export declare type ComposerMention = {
|
|
602
|
+
id: string;
|
|
603
|
+
label: string;
|
|
604
|
+
description?: string;
|
|
605
|
+
};
|
|
606
|
+
|
|
607
|
+
export declare type ComposerProps = {
|
|
608
|
+
onSubmit: (submission: ComposerSubmission) => void;
|
|
609
|
+
onAttach?: () => void;
|
|
610
|
+
attachments?: ReactNode;
|
|
611
|
+
mentions?: ComposerMention[];
|
|
612
|
+
disabled?: boolean;
|
|
613
|
+
};
|
|
614
|
+
|
|
615
|
+
export declare type ComposerSubmission = {
|
|
616
|
+
text: string;
|
|
617
|
+
mentionIds: string[];
|
|
618
|
+
};
|
|
619
|
+
|
|
587
620
|
export declare function ContextCard({ name, identity, rows, action, onAction, actionHref, placement, align, children, }: ContextCardProps): JSX.Element;
|
|
588
621
|
|
|
589
622
|
declare type ContextCardAction = {
|
|
@@ -1155,6 +1188,21 @@ declare type LoadMoreButtonOwnProps = {
|
|
|
1155
1188
|
|
|
1156
1189
|
export declare type LoadMoreButtonProps = LoadMoreButtonOwnProps & Omit<ComponentPropsWithoutRef<'button'>, keyof LoadMoreButtonOwnProps>;
|
|
1157
1190
|
|
|
1191
|
+
export declare function Marker({ actor, time, variant, children, }: MarkerProps): JSX.Element;
|
|
1192
|
+
|
|
1193
|
+
export declare type MarkerProps = {
|
|
1194
|
+
actor?: ReactNode;
|
|
1195
|
+
time?: ReactNode;
|
|
1196
|
+
variant?: 'default' | 'separator';
|
|
1197
|
+
children: ReactNode;
|
|
1198
|
+
};
|
|
1199
|
+
|
|
1200
|
+
export declare function Mention({ children }: MentionProps): JSX.Element;
|
|
1201
|
+
|
|
1202
|
+
export declare type MentionProps = {
|
|
1203
|
+
children: ReactNode;
|
|
1204
|
+
};
|
|
1205
|
+
|
|
1158
1206
|
export declare function Menu({ label, entries, withChevron, align, triggerContent }: {
|
|
1159
1207
|
label: string;
|
|
1160
1208
|
entries: MenuEntry[];
|
|
@@ -1217,6 +1265,19 @@ declare type MenuLinkBase = {
|
|
|
1217
1265
|
suffix?: ReactNode;
|
|
1218
1266
|
};
|
|
1219
1267
|
|
|
1268
|
+
export declare function Message({ author, avatar, time, children, attachments, actions, status, onRetry, }: MessageProps): JSX.Element;
|
|
1269
|
+
|
|
1270
|
+
export declare type MessageProps = {
|
|
1271
|
+
author: ReactNode;
|
|
1272
|
+
avatar?: ReactNode;
|
|
1273
|
+
time?: ReactNode;
|
|
1274
|
+
children: ReactNode;
|
|
1275
|
+
attachments?: ReactNode;
|
|
1276
|
+
actions?: ReactNode;
|
|
1277
|
+
status?: 'default' | 'pending' | 'failed';
|
|
1278
|
+
onRetry?: () => void;
|
|
1279
|
+
};
|
|
1280
|
+
|
|
1220
1281
|
export declare function MiddleTruncate({ text, tailLength, mono }: {
|
|
1221
1282
|
text: string;
|
|
1222
1283
|
tailLength?: number;
|
|
@@ -1516,10 +1577,12 @@ export declare function Radio({ ...props }: RadioProps): JSX.Element;
|
|
|
1516
1577
|
/** Radio 的完整 props。 */
|
|
1517
1578
|
export declare type RadioProps = ControlOptionOwnProps & (FieldShellProps | FieldBareProps) & ControlOptionNativeInputProps;
|
|
1518
1579
|
|
|
1519
|
-
export declare function RangeField({ layout, trigger, size, minValue, maxValue, pinnedTimezone, today, value, onChange, }: {
|
|
1580
|
+
export declare function RangeField({ layout, trigger, size, fieldSize, minValue, maxValue, pinnedTimezone, today, value, onChange, }: {
|
|
1520
1581
|
layout?: PopoverLayout;
|
|
1521
1582
|
trigger?: TriggerKind;
|
|
1522
1583
|
size?: CalendarSize;
|
|
1584
|
+
/** 仅控制触发器高度;size 保留月历网格的 large/small 尺寸语义。 */
|
|
1585
|
+
fieldSize?: FieldSize;
|
|
1523
1586
|
minValue?: Date;
|
|
1524
1587
|
maxValue?: Date;
|
|
1525
1588
|
pinnedTimezone?: string;
|
|
@@ -1986,6 +2049,17 @@ export declare type ThemeSwitcherProps = {
|
|
|
1986
2049
|
|
|
1987
2050
|
export declare type ThresholdTone = 'primary' | 'success' | 'warning' | 'danger';
|
|
1988
2051
|
|
|
2052
|
+
export declare function Timeline({ className, ...props }: TimelineProps): JSX.Element;
|
|
2053
|
+
|
|
2054
|
+
export declare function TimelineItem({ tone, indicator, children, className, ...props }: TimelineItemProps): JSX.Element;
|
|
2055
|
+
|
|
2056
|
+
export declare type TimelineItemProps = HTMLAttributes<HTMLLIElement> & {
|
|
2057
|
+
tone?: 'neutral' | 'success' | 'danger' | 'warning';
|
|
2058
|
+
indicator?: ReactNode;
|
|
2059
|
+
};
|
|
2060
|
+
|
|
2061
|
+
export declare type TimelineProps = HTMLAttributes<HTMLOListElement>;
|
|
2062
|
+
|
|
1989
2063
|
declare type ToastAction = {
|
|
1990
2064
|
label: string;
|
|
1991
2065
|
/** 点击后先执行回调再关闭该提示。 */
|