@q1travel/design-system 0.22.0 → 0.23.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.
@@ -214,6 +214,22 @@ export declare function BrowserTabs({ tabs, className }: {
214
214
 
215
215
  export declare type BrowserVariant = 'light' | 'dark';
216
216
 
217
+ export declare function Bubble({ direction, avatar, name, time, children, status, pending, error, retry, onRetry, actions, className, ...props }: BubbleProps): JSX.Element;
218
+
219
+ export declare type BubbleProps = Omit<ComponentPropsWithoutRef<'article'>, 'children'> & {
220
+ direction?: 'incoming' | 'outgoing';
221
+ avatar?: ReactNode;
222
+ name?: ReactNode;
223
+ time?: ReactNode;
224
+ children: ReactNode;
225
+ status?: 'default' | 'pending' | 'error';
226
+ pending?: ReactNode;
227
+ error?: ReactNode;
228
+ retry?: ReactNode;
229
+ onRetry?: () => void;
230
+ actions?: ReactNode;
231
+ };
232
+
217
233
  export declare function Button(props: ButtonProps): JSX.Element;
218
234
 
219
235
  declare type ButtonAccessibleName = {
@@ -315,13 +331,12 @@ export declare type ButtonSize = 'sm' | 'md' | 'lg';
315
331
 
316
332
  export declare type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'warning' | 'danger';
317
333
 
318
- /** 标准日期区间选择器;复用 RangeField 的草稿、弹层和键盘行为。 */
334
+ /** 标准日期与区间选择器;复用 RangeField 的草稿、弹层和键盘行为。 */
319
335
  export declare function Calendar(props: CalendarProps): JSX.Element;
320
336
 
321
- export declare function CalendarGrid({ value, onChange, size, minValue, maxValue, today, }: {
322
- value: RangeValue;
323
- onChange: (next: RangeValue) => void;
337
+ export declare function CalendarGrid(props: CalendarSelectionProps & {
324
338
  size?: CalendarSize;
339
+ withTime?: boolean;
325
340
  minValue?: Date;
326
341
  maxValue?: Date;
327
342
  today?: Date;
@@ -334,6 +349,16 @@ export declare type CalendarPreset = {
334
349
 
335
350
  export declare type CalendarProps = ComponentProps<typeof RangeField>;
336
351
 
352
+ export declare type CalendarSelectionProps = {
353
+ mode?: 'range';
354
+ value: RangeValue;
355
+ onChange: (next: RangeValue) => void;
356
+ } | {
357
+ mode: 'single';
358
+ value: Date | null;
359
+ onChange: (next: Date | null) => void;
360
+ };
361
+
337
362
  export declare type CalendarSize = 'large' | 'small';
338
363
 
339
364
  export declare function Card(props: CardProps): JSX.Element;
@@ -393,7 +418,7 @@ export declare type ChartProps = {
393
418
  className?: string;
394
419
  };
395
420
 
396
- export declare function Checkbox({ ...props }: CheckboxProps): JSX.Element;
421
+ export declare function Checkbox({ shape, tone, size, ...props }: CheckboxProps): JSX.Element;
397
422
 
398
423
  declare type CheckboxOnlyProps = {
399
424
  /** 半选:视觉态而非第三个值,由父级逻辑驱动(如"部分子项已选")。AT 读作 mixed。 */
@@ -401,7 +426,14 @@ declare type CheckboxOnlyProps = {
401
426
  };
402
427
 
403
428
  /** Checkbox 的完整 props。消费方包一层时用它标注,无需知道内部由哪几块组合而成。 */
404
- export declare type CheckboxProps = ControlOptionOwnProps & (FieldShellProps | FieldBareProps) & CheckboxOnlyProps & ControlOptionNativeInputProps;
429
+ export declare type CheckboxProps = ControlOptionOwnProps & (FieldShellProps | FieldBareProps) & CheckboxOnlyProps & {
430
+ /** 圆形仅用于任务与清单完成;表单多选保留默认方形。 */
431
+ shape?: 'square' | 'circle';
432
+ /** 仅圆形生效;业务方自行映射优先级。 */
433
+ tone?: 'neutral' | 'info' | 'warning' | 'danger';
434
+ /** 圆形清单 sm / 详情 md;默认 sm。 */
435
+ size?: 'sm' | 'md';
436
+ } & Omit<ControlOptionNativeInputProps, 'size'>;
405
437
 
406
438
  export declare function Choicebox({ type, label, description, extra, className, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, ...rest }: ChoiceboxProps): JSX.Element;
407
439
 
@@ -596,7 +628,11 @@ export declare type CommandMenuSection = {
596
628
  items: CommandMenuItem[];
597
629
  };
598
630
 
599
- export declare function Composer({ onSubmit, onAttach, attachments, mentions, disabled, }: ComposerProps): JSX.Element;
631
+ export declare function Composer({ onSubmit, onAttach, attachments, mentions, commands, onCommand, disabled, }: ComposerProps): JSX.Element;
632
+
633
+ export declare type ComposerCommand = ComposerMention & {
634
+ keywords?: string[];
635
+ };
600
636
 
601
637
  export declare type ComposerMention = {
602
638
  id: string;
@@ -606,7 +642,9 @@ export declare type ComposerMention = {
606
642
 
607
643
  export declare type ComposerProps = {
608
644
  onSubmit: (submission: ComposerSubmission) => void;
609
- onAttach?: () => void;
645
+ onAttach?: (() => void) | ((files: File[]) => void);
646
+ commands?: ComposerCommand[];
647
+ onCommand?: (id: string, argumentText: string) => void;
610
648
  attachments?: ReactNode;
611
649
  mentions?: ComposerMention[];
612
650
  disabled?: boolean;
@@ -865,6 +903,9 @@ export declare function EmptyState({ icon, title, description, actions, headingL
865
903
  headingLevel?: 2 | 3 | 4 | 5 | 6;
866
904
  }): JSX.Element;
867
905
 
906
+ /** Public host for consumer-owned sibling portals. Package overlays share this Foundation root. */
907
+ export declare function ensurePopoverRoot(): HTMLElement | null;
908
+
868
909
  export declare function Entity({ leading, title, subtitle, trailing, }: {
869
910
  leading?: ReactNode;
870
911
  title: string;
@@ -963,7 +1004,12 @@ export declare type FileTreeNode = {
963
1004
  };
964
1005
 
965
1006
  /** 筛选选择器入口;弹层、筛选值与 expanded 状态归调用方。 */
966
- export declare function FilterChip({ label, value, onClear, disabled, className, ...props }: FilterChipProps): JSX.Element;
1007
+ export declare const FilterChip: ForwardRefExoticComponent< {
1008
+ label: string;
1009
+ /** undefined 表示未设置;0、空字符串和 null 仍是已设置。 */
1010
+ value?: ReactNode;
1011
+ onClear?: () => void;
1012
+ } & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "value"> & RefAttributes<HTMLButtonElement>>;
967
1013
 
968
1014
  export declare type FilterChipProps = {
969
1015
  label: string;
@@ -998,6 +1044,21 @@ export declare type GaugeToneDirection = 'quota' | 'health';
998
1044
  /** One coordinator per document, shared with all package overlays. Null during SSR. */
999
1045
  export declare function getOverlayCoordinator(doc?: Document | null): OverlayCoordinator | null;
1000
1046
 
1047
+ /** Hoverable supplemental information; activation belongs to the trigger. */
1048
+ export declare function HoverCard({ trigger, children, openDelay, closeDelay, side, align, className }: HoverCardProps): JSX.Element;
1049
+
1050
+ export declare type HoverCardProps = {
1051
+ /** A named native button, or a component forwarding native button attributes. */
1052
+ trigger: ReactElement<ButtonHTMLAttributes<HTMLButtonElement>>;
1053
+ /** Supplemental, noninteractive content; essential information belongs in the page. */
1054
+ children: ReactNode;
1055
+ openDelay?: number;
1056
+ closeDelay?: number;
1057
+ side?: PopoverSide;
1058
+ align?: PopoverAlign;
1059
+ className?: string;
1060
+ };
1061
+
1001
1062
  export declare function IconButton({ 'aria-label': canonicalAriaLabel, ariaLabel: legacyAriaLabel, 'aria-pressed': ariaPressed, disabled, loading, onClick, onBlur, onKeyDown, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp, onLostPointerCapture, ...rest }: IconButtonProps): JSX.Element;
1002
1063
 
1003
1064
  declare type IconButtonAccessibleName = {
@@ -1193,7 +1254,7 @@ export declare function Marker({ actor, time, variant, children, }: MarkerProps)
1193
1254
  export declare type MarkerProps = {
1194
1255
  actor?: ReactNode;
1195
1256
  time?: ReactNode;
1196
- variant?: 'default' | 'separator';
1257
+ variant?: 'default' | 'separator' | 'unread';
1197
1258
  children: ReactNode;
1198
1259
  };
1199
1260
 
@@ -1265,7 +1326,7 @@ declare type MenuLinkBase = {
1265
1326
  suffix?: ReactNode;
1266
1327
  };
1267
1328
 
1268
- export declare function Message({ author, avatar, time, children, attachments, actions, status, onRetry, }: MessageProps): JSX.Element;
1329
+ export declare function Message({ author, avatar, time, children, attachments, actions, acknowledgements, status, onRetry, }: MessageProps): JSX.Element;
1269
1330
 
1270
1331
  export declare type MessageProps = {
1271
1332
  author: ReactNode;
@@ -1274,10 +1335,31 @@ export declare type MessageProps = {
1274
1335
  children: ReactNode;
1275
1336
  attachments?: ReactNode;
1276
1337
  actions?: ReactNode;
1338
+ acknowledgements?: ReactNode;
1277
1339
  status?: 'default' | 'pending' | 'failed';
1278
1340
  onRetry?: () => void;
1279
1341
  };
1280
1342
 
1343
+ export declare function MessageScroller({ label, items, conversationKey, nearBottomThreshold, announcement, jumpLabel, before, empty, className, style }: MessageScrollerProps): JSX.Element;
1344
+
1345
+ export declare type MessageScrollerItem = {
1346
+ id: string | number;
1347
+ content: ReactNode;
1348
+ };
1349
+
1350
+ export declare type MessageScrollerProps = {
1351
+ label: string;
1352
+ items: readonly MessageScrollerItem[];
1353
+ conversationKey?: string | number;
1354
+ nearBottomThreshold?: number;
1355
+ announcement?: string;
1356
+ jumpLabel?: string;
1357
+ before?: ReactNode;
1358
+ empty?: ReactNode;
1359
+ className?: string;
1360
+ style?: CSSProperties;
1361
+ };
1362
+
1281
1363
  export declare function MiddleTruncate({ text, tailLength, mono }: {
1282
1364
  text: string;
1283
1365
  tailLength?: number;
@@ -1520,8 +1602,60 @@ export declare type PillProps = {
1520
1602
  title?: string;
1521
1603
  } & AnchorHTMLAttributes<HTMLAnchorElement>;
1522
1604
 
1605
+ export declare function Popover({ open: controlledOpen, defaultOpen, onOpenChange, onClose, trigger, anchorRef, children, side, align, placement: requestedPlacement, modal, ariaModal, role: requestedRole, ariaLabel, ariaLabelledBy, ariaDescribedBy, offset, matchWidth, selectedValue, initialFocus, id: suppliedId, className, dismissExcludeRefs }: PopoverProps): JSX.Element;
1606
+
1607
+ export declare type PopoverAlign = 'start' | 'center' | 'end';
1608
+
1609
+ export declare type PopoverInitialFocus = 'first' | 'last' | 'none';
1610
+
1523
1611
  export declare type PopoverLayout = 'vertical' | 'horizontal';
1524
1612
 
1613
+ export declare type PopoverPlacement = 'auto' | 'auto-end' | 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end';
1614
+
1615
+ export declare type PopoverProps = PopoverSharedProps & (({
1616
+ trigger: ReactNode;
1617
+ anchorRef?: never;
1618
+ open?: boolean;
1619
+ defaultOpen?: boolean;
1620
+ } & ({
1621
+ ariaLabel: string;
1622
+ ariaLabelledBy?: never;
1623
+ } | {
1624
+ ariaLabel?: never;
1625
+ ariaLabelledBy: string;
1626
+ })) | {
1627
+ trigger?: never;
1628
+ anchorRef: RefObject<HTMLElement | null>;
1629
+ open: boolean;
1630
+ defaultOpen?: never;
1631
+ ariaLabel?: string;
1632
+ ariaLabelledBy?: string;
1633
+ });
1634
+
1635
+ export declare type PopoverRole = 'dialog' | 'menu' | 'listbox';
1636
+
1637
+ declare type PopoverSharedProps = {
1638
+ children: ReactNode;
1639
+ onOpenChange?: (open: boolean) => void;
1640
+ onClose?: () => void;
1641
+ placement?: PopoverPlacement;
1642
+ side?: PopoverSide;
1643
+ align?: PopoverAlign;
1644
+ role?: PopoverRole;
1645
+ modal?: boolean;
1646
+ ariaModal?: boolean;
1647
+ ariaDescribedBy?: string;
1648
+ offset?: number;
1649
+ matchWidth?: boolean | number;
1650
+ selectedValue?: string | number;
1651
+ initialFocus?: PopoverInitialFocus;
1652
+ id?: string;
1653
+ className?: string;
1654
+ dismissExcludeRefs?: ReadonlyArray<RefObject<HTMLElement | null>>;
1655
+ };
1656
+
1657
+ export declare type PopoverSide = 'bottom' | 'top' | 'left' | 'right';
1658
+
1525
1659
  export declare function ProductLockup({ name, icon, brand, size, className, 'aria-label': ariaLabel, ...rest }: ProductLockupProps): JSX.Element;
1526
1660
 
1527
1661
  export declare type ProductLockupProps = {
@@ -1577,7 +1711,7 @@ export declare function Radio({ ...props }: RadioProps): JSX.Element;
1577
1711
  /** Radio 的完整 props。 */
1578
1712
  export declare type RadioProps = ControlOptionOwnProps & (FieldShellProps | FieldBareProps) & ControlOptionNativeInputProps;
1579
1713
 
1580
- export declare function RangeField({ layout, trigger, size, fieldSize, minValue, maxValue, pinnedTimezone, today, value, onChange, }: {
1714
+ export declare function RangeField(props: CalendarSelectionProps & {
1581
1715
  layout?: PopoverLayout;
1582
1716
  trigger?: TriggerKind;
1583
1717
  size?: CalendarSize;
@@ -1586,18 +1720,18 @@ export declare function RangeField({ layout, trigger, size, fieldSize, minValue,
1586
1720
  minValue?: Date;
1587
1721
  maxValue?: Date;
1588
1722
  pinnedTimezone?: string;
1589
- /** 透传给内部 CalendarGrid(默认真实当前日期);文档 demo 传固定值保持演示可控。 */
1590
1723
  today?: Date;
1591
- value: RangeValue;
1592
- onChange: (next: RangeValue) => void;
1724
+ /** 显式启用本地 24 小时时间编辑;默认仅选择日期。 */
1725
+ withTime?: boolean;
1593
1726
  }): JSX.Element;
1594
1727
 
1595
- export declare function RangeInputs({ value, onApply, pinnedTimezone, }: {
1728
+ export declare function RangeInputs(props: (CalendarSelectionProps | {
1729
+ mode?: 'range';
1596
1730
  value: RangeValue;
1597
- /** 兼容保留;当前组件不提供时间值或时间编辑能力。 */
1731
+ onChange?: (next: RangeValue) => void;
1732
+ }) & {
1598
1733
  withTime: boolean;
1599
1734
  onApply: () => void;
1600
- /** 固定时区:传入时时区从可选 select 变只读文本、不可切换。 */
1601
1735
  pinnedTimezone?: string;
1602
1736
  }): JSX.Element;
1603
1737
 
@@ -1732,13 +1866,15 @@ export declare function Separator({ orientation, decorative, className, }: {
1732
1866
 
1733
1867
  export declare type SeparatorOrientation = 'horizontal' | 'vertical';
1734
1868
 
1735
- export declare function Sheet({ open, onClose, title, side, size, dismissable, children, footer }: {
1869
+ export declare function Sheet({ open, onClose, title, side, size, dismissable, mobileFullscreen, children, footer }: {
1736
1870
  open: boolean;
1737
1871
  onClose: () => void;
1738
1872
  title: string;
1739
1873
  side?: SheetSide;
1740
1874
  size?: SheetSize;
1741
1875
  dismissable?: boolean;
1876
+ /** 窄屏全视口面板;默认保留浮层间距。 */
1877
+ mobileFullscreen?: boolean;
1742
1878
  children: ReactNode;
1743
1879
  footer?: ReactNode;
1744
1880
  }): ReactNode;
@@ -2051,6 +2187,13 @@ export declare type ThresholdTone = 'primary' | 'success' | 'warning' | 'danger'
2051
2187
 
2052
2188
  export declare function Timeline({ className, ...props }: TimelineProps): JSX.Element;
2053
2189
 
2190
+ export declare function TimelineCollapsedGroup({ summary, children }: TimelineCollapsedGroupProps): JSX.Element;
2191
+
2192
+ export declare type TimelineCollapsedGroupProps = {
2193
+ summary: ReactNode;
2194
+ children: ReactNode;
2195
+ };
2196
+
2054
2197
  export declare function TimelineItem({ tone, indicator, children, className, ...props }: TimelineItemProps): JSX.Element;
2055
2198
 
2056
2199
  export declare type TimelineItemProps = HTMLAttributes<HTMLLIElement> & {
@@ -2107,6 +2250,42 @@ export declare function Toggle({ checked, defaultOn, onChange, disabled, size, o
2107
2250
  ariaLabel?: string;
2108
2251
  }): JSX.Element;
2109
2252
 
2253
+ export declare function ToggleGroup(props: ToggleGroupProps): JSX.Element;
2254
+
2255
+ declare type ToggleGroupBaseProps = {
2256
+ items: ToggleGroupItem[];
2257
+ ariaLabel: string;
2258
+ size?: ButtonSize;
2259
+ disabled?: boolean;
2260
+ };
2261
+
2262
+ export declare type ToggleGroupItem = {
2263
+ value: string;
2264
+ disabled?: boolean;
2265
+ } & ({
2266
+ label: string;
2267
+ icon?: ReactNode;
2268
+ ariaLabel?: string;
2269
+ } | {
2270
+ label?: never;
2271
+ icon: ReactNode;
2272
+ ariaLabel: string;
2273
+ });
2274
+
2275
+ export declare type ToggleGroupProps = ToggleGroupBaseProps & ({
2276
+ type: 'single';
2277
+ value?: string;
2278
+ defaultValue?: string;
2279
+ onValueChange?: (value: string) => void;
2280
+ allowEmpty?: boolean;
2281
+ } | {
2282
+ type: 'multiple';
2283
+ value?: string[];
2284
+ defaultValue?: string[];
2285
+ onValueChange?: (value: string[]) => void;
2286
+ allowEmpty?: never;
2287
+ });
2288
+
2110
2289
  export declare type ToggleSize = 'sm' | 'md' | 'lg';
2111
2290
 
2112
2291
  export declare function Toolbar({ 'aria-label': ariaLabel, orientation, children, className, }: ToolbarProps): JSX.Element;