@q1travel/design-system 0.29.1 → 0.30.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 -2
- package/contracts/design.md +2 -2
- package/dist-pkg/design-system.d.ts +66 -3
- package/dist-pkg/design-system.js +5389 -5005
- package/dist-pkg/style.css +188 -17
- package/package.json +2 -2
package/contracts/design.dark.md
CHANGED
|
@@ -480,7 +480,7 @@ These components ship in the package. Compose from this list before writing new
|
|
|
480
480
|
- IconButton requires an accessible name. An icon-only control without one is not deliverable.
|
|
481
481
|
- CornerRemoveButton is a fixed 24px corner removal control for thumbnails, avatars, and tags; require a caller-provided aria-label. Wrap the host and button in `.q1-corner-anchor`; reserve space around the host and avoid clipping the shared 44px coarse-pointer hit region. This does not extend the Button size scale.
|
|
482
482
|
|
|
483
|
-
**Text fields.** FormField, Label, InfoTip, Input, ClearableInput, SearchInput, InputOTP, Textarea, Select, Fieldset, ErrorMessage.
|
|
483
|
+
**Text fields.** FormField, Label, RequiredIndicator, InfoTip, Input, ClearableInput, SearchInput, InputOTP, Textarea, Select, Fieldset, ErrorMessage.
|
|
484
484
|
|
|
485
485
|
- InputOTP collects a fixed six-digit code in one joined group by default; `separator` explicitly enables 3+3 groups. VerificationCodeInput and VerificationCodeInputProps remain deprecated aliases for one minor version; migrate to InputOTP and InputOTPProps before their removal in the next minor version. The old `/components/verification-code-input` route redirects to `/components/input-otp`.
|
|
486
486
|
- FormField owns the label, help text, and error slot. Do not assemble those three around a bare Input.
|
|
@@ -488,7 +488,7 @@ These components ship in the package. Compose from this list before writing new
|
|
|
488
488
|
- FormField positions its visually hidden label and empty live status within its own containing block so an overflowing inline row cannot enlarge the page scroll width.
|
|
489
489
|
- Select is for a short, fixed list. Anything searchable, or longer than roughly seven entries, is a Combobox.
|
|
490
490
|
|
|
491
|
-
**Option fields.** ControlOption, Checkbox, Radio, Choicebox, Combobox, MultiSelect, Switch, Toggle, ToggleGroup, Slider, RangeSlider.
|
|
491
|
+
**Option fields.** ControlOption, Checkbox, Radio, Choicebox, Combobox, MultiSelect, MultiCombobox, Switch, Toggle, ToggleGroup, Slider, RangeSlider.
|
|
492
492
|
|
|
493
493
|
**Checkbox task completion circle.** `Checkbox` adds `shape?: 'square' | 'circle'` (default square). Circle-only `tone?: 'neutral' | 'info' | 'warning' | 'danger'` defaults to neutral; `size?: 'sm' | 'md'` defaults to sm. 圆形只用于任务与清单的完成场景;表单多选一律用方形。 Native checkbox, ref, bare accessible names and Space activation remain intact; Enter does not toggle. Circle rejects indeterminate with a development warning. `readOnly` remains focusable, exposes aria-disabled and prevents toggles, hover previews and press feedback; completed readonly circles keep a desaturated fill and tick.
|
|
494
494
|
|
package/contracts/design.md
CHANGED
|
@@ -480,7 +480,7 @@ These components ship in the package. Compose from this list before writing new
|
|
|
480
480
|
- IconButton requires an accessible name. An icon-only control without one is not deliverable.
|
|
481
481
|
- CornerRemoveButton is a fixed 24px corner removal control for thumbnails, avatars, and tags; require a caller-provided aria-label. Wrap the host and button in `.q1-corner-anchor`; reserve space around the host and avoid clipping the shared 44px coarse-pointer hit region. This does not extend the Button size scale.
|
|
482
482
|
|
|
483
|
-
**Text fields.** FormField, Label, InfoTip, Input, ClearableInput, SearchInput, InputOTP, Textarea, Select, Fieldset, ErrorMessage.
|
|
483
|
+
**Text fields.** FormField, Label, RequiredIndicator, InfoTip, Input, ClearableInput, SearchInput, InputOTP, Textarea, Select, Fieldset, ErrorMessage.
|
|
484
484
|
|
|
485
485
|
- InputOTP collects a fixed six-digit code in one joined group by default; `separator` explicitly enables 3+3 groups. VerificationCodeInput and VerificationCodeInputProps remain deprecated aliases for one minor version; migrate to InputOTP and InputOTPProps before their removal in the next minor version. The old `/components/verification-code-input` route redirects to `/components/input-otp`.
|
|
486
486
|
- FormField owns the label, help text, and error slot. Do not assemble those three around a bare Input.
|
|
@@ -488,7 +488,7 @@ These components ship in the package. Compose from this list before writing new
|
|
|
488
488
|
- FormField positions its visually hidden label and empty live status within its own containing block so an overflowing inline row cannot enlarge the page scroll width.
|
|
489
489
|
- Select is for a short, fixed list. Anything searchable, or longer than roughly seven entries, is a Combobox.
|
|
490
490
|
|
|
491
|
-
**Option fields.** ControlOption, Checkbox, Radio, Choicebox, Combobox, MultiSelect, Switch, Toggle, ToggleGroup, Slider, RangeSlider.
|
|
491
|
+
**Option fields.** ControlOption, Checkbox, Radio, Choicebox, Combobox, MultiSelect, MultiCombobox, Switch, Toggle, ToggleGroup, Slider, RangeSlider.
|
|
492
492
|
|
|
493
493
|
**Checkbox task completion circle.** `Checkbox` adds `shape?: 'square' | 'circle'` (default square). Circle-only `tone?: 'neutral' | 'info' | 'warning' | 'danger'` defaults to neutral; `size?: 'sm' | 'md'` defaults to sm. 圆形只用于任务与清单的完成场景;表单多选一律用方形。 Native checkbox, ref, bare accessible names and Space activation remain intact; Enter does not toggle. Circle rejects indeterminate with a development warning. `readOnly` remains focusable, exposes aria-disabled and prevents toggles, hover previews and press feedback; completed readonly circles keep a desaturated fill and tick.
|
|
494
494
|
|
|
@@ -1568,7 +1568,57 @@ declare type ModalLegacyDismissalProps = {
|
|
|
1568
1568
|
|
|
1569
1569
|
export declare type ModalProps = ModalBaseProps & (ModalLegacyDismissalProps | ModalEscapeActionProps);
|
|
1570
1570
|
|
|
1571
|
-
|
|
1571
|
+
/** 标签触发器与弹层搜索组合;选项变更保持展开,选中值完全受控。 */
|
|
1572
|
+
export declare function MultiCombobox({ options, value, onChange, onOpenChange, selectedOptions, placeholder, searchPlaceholder, onSearch, searchValue, isLoading, loadError, onRetry, emptyText, disabled, readOnly, invalid, errorId, error, clearable, id, name, className, ref, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby }: MultiComboboxProps): JSX.Element;
|
|
1573
|
+
|
|
1574
|
+
export declare type MultiComboboxChangeDetails = {
|
|
1575
|
+
action: 'select' | 'remove' | 'clear';
|
|
1576
|
+
option?: MultiComboboxOption;
|
|
1577
|
+
};
|
|
1578
|
+
|
|
1579
|
+
export declare type MultiComboboxOption = {
|
|
1580
|
+
value: string;
|
|
1581
|
+
label: string;
|
|
1582
|
+
/** 同值可有多个匹配行;rowKey 在本次结果中唯一,提交仍使用 value。 */
|
|
1583
|
+
rowKey?: string;
|
|
1584
|
+
description?: string;
|
|
1585
|
+
keywords?: string[];
|
|
1586
|
+
disabled?: boolean;
|
|
1587
|
+
};
|
|
1588
|
+
|
|
1589
|
+
export declare type MultiComboboxProps = {
|
|
1590
|
+
options: MultiComboboxOption[];
|
|
1591
|
+
value: string[];
|
|
1592
|
+
onChange: (values: string[], details?: MultiComboboxChangeDetails) => void;
|
|
1593
|
+
/** 通知所有开闭路径;调用方可在关闭时清理远端搜索。 */
|
|
1594
|
+
onOpenChange?: (open: boolean) => void;
|
|
1595
|
+
/** 选中标签的规范名称,与搜索结果、停用状态解耦;缺失时按 options / value 回退。 */
|
|
1596
|
+
selectedOptions?: Pick<MultiComboboxOption, 'value' | 'label'>[];
|
|
1597
|
+
placeholder: string;
|
|
1598
|
+
searchPlaceholder?: string;
|
|
1599
|
+
/** 存在时 options 是服务端结果,不再本地过滤;查询保留到调用方清除。 */
|
|
1600
|
+
onSearch?: (query: string) => void;
|
|
1601
|
+
searchValue?: string;
|
|
1602
|
+
isLoading?: boolean;
|
|
1603
|
+
loadError?: ReactNode;
|
|
1604
|
+
onRetry?: () => void;
|
|
1605
|
+
emptyText?: ReactNode;
|
|
1606
|
+
disabled?: boolean;
|
|
1607
|
+
readOnly?: boolean;
|
|
1608
|
+
invalid?: boolean;
|
|
1609
|
+
errorId?: string;
|
|
1610
|
+
error?: string;
|
|
1611
|
+
clearable?: boolean;
|
|
1612
|
+
id?: string;
|
|
1613
|
+
name?: string;
|
|
1614
|
+
className?: string;
|
|
1615
|
+
ref?: Ref<HTMLButtonElement>;
|
|
1616
|
+
'aria-label'?: string;
|
|
1617
|
+
'aria-labelledby'?: string;
|
|
1618
|
+
'aria-describedby'?: string;
|
|
1619
|
+
};
|
|
1620
|
+
|
|
1621
|
+
export declare function MultiSelect({ options: rawOptions, defaultSelected, placeholder, onChange, preserveSelectionOrder, value, disabled, readOnly, id, ref, invalid, errorId, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby }: MultiSelectProps): JSX.Element;
|
|
1572
1622
|
|
|
1573
1623
|
export declare type MultiSelectOption = {
|
|
1574
1624
|
/** 选中值:写入 defaultSelected / onChange,同一组内唯一。 */
|
|
@@ -1581,13 +1631,24 @@ export declare type MultiSelectProps = {
|
|
|
1581
1631
|
/** 纯字符串选项的值与显示文本相同;值与显示文本不同时传 { value, label }。 */
|
|
1582
1632
|
options: ReadonlyArray<string | MultiSelectOption>;
|
|
1583
1633
|
defaultSelected?: string[];
|
|
1634
|
+
/** 存在时由调用方持有选中值;defaultSelected 仅用于非受控初值。 */
|
|
1635
|
+
value?: string[];
|
|
1636
|
+
disabled?: boolean;
|
|
1637
|
+
readOnly?: boolean;
|
|
1638
|
+
id?: string;
|
|
1639
|
+
ref?: Ref<HTMLButtonElement>;
|
|
1640
|
+
invalid?: boolean;
|
|
1641
|
+
errorId?: string;
|
|
1642
|
+
'aria-label'?: string;
|
|
1643
|
+
'aria-labelledby'?: string;
|
|
1644
|
+
'aria-describedby'?: string;
|
|
1584
1645
|
placeholder: string;
|
|
1585
1646
|
onChange?: (next: string[]) => void;
|
|
1586
1647
|
/** 全选时保留已选项的先后顺序,只把未选项按列表顺序追加到末尾;默认 false,全选按列表顺序重排。 */
|
|
1587
1648
|
preserveSelectionOrder?: boolean;
|
|
1588
1649
|
};
|
|
1589
1650
|
|
|
1590
|
-
export declare function Navigation({ className, orientation, variant, ...props }: NavigationProps): JSX.Element;
|
|
1651
|
+
export declare function Navigation({ className, orientation, variant, children, ...props }: NavigationProps): JSX.Element;
|
|
1591
1652
|
|
|
1592
1653
|
export declare function NavigationGroup({ label, icon, expanded, defaultExpanded, onExpandedChange, children, }: NavigationGroupProps): JSX.Element;
|
|
1593
1654
|
|
|
@@ -1973,6 +2034,8 @@ export declare function RelativeTimeCard({ relative, relativeLong, iso, local, u
|
|
|
1973
2034
|
utc: string;
|
|
1974
2035
|
}): JSX.Element;
|
|
1975
2036
|
|
|
2037
|
+
export declare function RequiredIndicator(): JSX.Element;
|
|
2038
|
+
|
|
1976
2039
|
export declare function Scroller({ axis, label, children, }: {
|
|
1977
2040
|
axis: Axis;
|
|
1978
2041
|
label: string;
|
|
@@ -2236,7 +2299,7 @@ export declare function Spinner({ size, tone, label, }: {
|
|
|
2236
2299
|
|
|
2237
2300
|
export declare type SpinnerSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
2238
2301
|
|
|
2239
|
-
export declare type SpinnerTone = 'default' | 'danger' | 'success' | 'info';
|
|
2302
|
+
export declare type SpinnerTone = 'default' | 'danger' | 'success' | 'info' | 'inherit';
|
|
2240
2303
|
|
|
2241
2304
|
export declare function SplitButton({ label, entries, variant, size, align, menuButtonLabel, icon, disabled, loading, loadingLabel, }: {
|
|
2242
2305
|
label: string;
|