@q1travel/design-system 0.7.3 → 0.8.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.
@@ -1,6 +1,6 @@
1
1
  # Overlay Foundation Contract
2
2
 
3
- > 状态:Accepted(O1–O7 已确认;仅允许进入 Foundation RED 阶段,未授权 GREEN 或生产实现)。
3
+ > 状态:Accepted(O1–O7 已确认;Foundation GREEN 与首批组件接入已落地;D7 Web migration 与实际 ticket/blocking graph 仍 pending)。
4
4
  > Issue:[#27](https://github.com/q1travel/q1travel-design-system/issues/27)
5
5
  > 日期:2026-08-06
6
6
  > 所有者:`@q1travel/design-system`
@@ -19,9 +19,9 @@
19
19
 
20
20
  ## 2. 决策边界
21
21
 
22
- ### 2.1 本稿确认
22
+ ### 2.1 D0/RED 阶段确认(历史边界)
23
23
 
24
- 本稿已按 O1–O7 完成 ADR review,可作为 Foundation RED 阶段的行为约束。以下边界仍然有效:
24
+ 本稿已按 O1–O7 完成 ADR review,可作为 Foundation RED 阶段的行为约束。以下边界记录的是 D0/RED 阶段的授权范围;当前实现与 provenance 状态以 §7.1 为准:
25
25
 
26
26
  - 不修改现有 overlay 组件实现;
27
27
  - 不新增公开 `OverlayHost`、stack 或 hook API;
@@ -189,6 +189,19 @@ D7 q1travel-web adoption/migration
189
189
  - D6 不等于 npm publish;source、PR、CI/review、merge、registry/release、consumer adoption 和 production/smoke 是独立 gates。
190
190
  - D7 不属于本仓库 #27 的实现 PR;Web 只能在 package contract、发布和 consumer evidence 都满足后另行授权。
191
191
 
192
+ ### 7.1 当前实现与 acceptance/provenance closeout(2026-08-06)
193
+
194
+ 本节把 D0–D7 的当前事实与原始 ADR 边界分开记录,不把 package implementation、release、Web adoption 或 issue tracker 状态混为同一个 gate:
195
+
196
+ - **D0 — ADR/contract:已完成。** O1–O7 已确认,本文件是当前 canonical contract。
197
+ - **D1/D2 — Foundation RED/GREEN:已完成。** `9d0d56da527e66f3d2e793364bf0b2c9e2ebd828` 引入 shared `overlayCore`、`useOverlay` 与 Foundation runtime;当前 targeted runtime/browser contract `node --test scripts/check-overlay-foundation-red.test.mjs` 通过(2/2)。
198
+ - **D3–D5 — 首批组件接入:实现已进入 main。** `Modal`、`DestructiveActionModal`、`Sheet`、`Drawer` 均通过 `useOverlay` 接入;Sheet 保持 `blocking=true/outsidePointer=false`,DestructiveActionModal 的 loading policy 保留。实现证据不等于已建立对应的独立 GitHub blocking tickets。
199
+ - **D6 — package/release provenance:已完成。** 0.7.3 exact package source 为 `224f723f3a4e7bb3d5256ae2364783362b2f8eaf`,`v0.7.3` 已解析到该 source,registry provenance 已由 `b40a3b5ad49156c3d8b0409b226c15b37468f8c7` 写入 remote `main`。
200
+ - **D7 — q1travel-web adoption/migration:pending。** 本次没有修改 Web,也没有把 Web migration 伪装成 package acceptance;Web 仍需独立 ticket、consumer evidence 与单独授权。
201
+ - **Ticket graph:pending。** 当前 GitHub 中没有 Foundation、Modal、Sheet、Drawer、Web migration 的独立 blocking ticket 记录;本 contract 的 D3–D7 图是交付边界,不是 GitHub tracker 已建立的 blocking edges。
202
+
203
+ 因此,#27 的 package-side implementation/provenance evidence 已具备;issue acceptance 仍不能在缺少独立 ticket graph、contract 状态同步与 D7 Web gate 的情况下被解释为全链路完成。
204
+
192
205
  ## 8. 已确认的 ADR decisions
193
206
 
194
207
  以下结论已在本次 #27 review 中确认。它们定义 RED 阶段的边界,不授权生产实现:
@@ -205,7 +218,7 @@ D7 q1travel-web adoption/migration
205
218
 
206
219
  ## 9. 非目标
207
220
 
208
- - 不在本票中修复 Modal、Sheet、Drawer、DestructiveActionModal 的现有实现差异。
221
+ - D0/RED 阶段不在本票中修复 Modal、Sheet、Drawer、DestructiveActionModal 的现有实现差异;当前 D2–D5 实现状态以 §7.1 为准。
209
222
  - 不在本票中新增动画、视觉 redesign、尺寸/radius/color token 或组件 API。
210
223
  - 不在本票中迁移 Web,也不以 Web PR、Web 测试通过或本地浏览器结果替代 package contract acceptance。
211
224
  - 不以关闭 #27、创建 PR、merge、publish 或 release 作为本 contract 的隐含后续动作。
@@ -0,0 +1,53 @@
1
+ # Pagination 公共 API 迁移合同
2
+
3
+ Status: accepted locally
4
+
5
+ Decision date: 2026-08-07
6
+
7
+ Related: q1travel-design-system#26, #108, #109
8
+
9
+ Published baseline: `@q1travel/design-system@0.7.3`
10
+
11
+ Planned breaking release: `0.8.0`
12
+
13
+ ## Public naming decision
14
+
15
+ `Pagination` → `DocsPagination` is the accepted documentation-navigation replacement.
16
+
17
+ The published `Pagination` component in `0.7.3` is the documentation previous/next navigation rail. Its replacement is `DocsPagination`. The new product data-set component owns the public name `Pagination`.
18
+
19
+ | Boundary | Public meaning | Consumer boundary |
20
+ | --- | --- | --- |
21
+ | `0.7.3` and earlier | `Pagination` means documentation previous/next navigation | Existing consumers remain on the published baseline. |
22
+ | `0.8.0` candidate | `DocsPagination` means documentation previous/next navigation; `Pagination` means controlled product pagination | Consumers migrate their old documentation import to `DocsPagination`. |
23
+
24
+ This is a breaking public API boundary. The candidate does not add a same-name compatibility alias or a fallback that makes one `Pagination` export mean two different contracts.
25
+
26
+ ## Pagination models
27
+
28
+ The `0.8.0` candidate freezes two independent product models:
29
+
30
+ - Known-total: controlled `page` and `onChange`, with either `total` or `totalPages`; numeric page controls and range summary are allowed.
31
+ - Unknown-tail: controlled `page` and `onChange`, with `hasNextPage`; it does not fabricate `total`, a last page, or numeric page-window controls.
32
+ - `true-cursor` remains deferred until a real consumer supplies the cursor ownership, request boundary, and acceptance evidence. It is not inferred from `total`, `page`, or `hasNextPage`.
33
+
34
+ TypeScript is the public input boundary for the mutually exclusive models. The package does not own q1travel-web data fetching, query-string state, router navigation, or cursor token parsing.
35
+
36
+ ## Route and link ownership
37
+
38
+ The documentation route `/components/pagination` is retained. It documents both the product `Pagination` boundary and the separate `DocsPagination` sequence-navigation boundary.
39
+
40
+ `DocsPagination` accepts consumer-owned real `href` values and renders native links. It does not import a q1travel-web router or decide URL construction.
41
+
42
+ ## Compatibility, removal, and rollback
43
+
44
+ - The compatibility window is the published `0.7.3` baseline: existing documentation-navigation consumers can remain on `Pagination` at that version while they migrate to `DocsPagination`.
45
+ - The old documentation-navigation API is removed from the `Pagination` name only in the planned breaking `0.8.0` release. No same-version alias is added to the candidate.
46
+ - Before publishing `0.8.0`, the release gate must verify the exact package tarball, generated declarations, known q1travel consumer migration, and a rollback path that pins the consumer to `0.7.3`.
47
+ - Unknown third-party consumers cannot be enumerated from q1travel repositories; that limitation is part of the release risk and is not evidence that migration is complete.
48
+
49
+ ## Web migration gate
50
+
51
+ q1travel-web migration remains a separate gate. This package candidate does not modify q1travel-web, does not claim consumer adoption, and does not publish or deploy. Web migration may start only after a verified published package release and a separately authorized consumer change.
52
+
53
+ This contract records the public boundary; it does not perform the `0.8.0` version bump, npm publish, Web migration, issue closure, or production validation.
@@ -637,6 +637,18 @@ export declare function DestructiveActionModal({ open, onClose, title, descripti
637
637
  onConfirm: () => string | null;
638
638
  }): ReactNode;
639
639
 
640
+ export declare type DocsPageLink = {
641
+ title: string;
642
+ href: string;
643
+ };
644
+
645
+ export declare function DocsPagination({ previous, next }: DocsPaginationProps): JSX.Element;
646
+
647
+ export declare type DocsPaginationProps = {
648
+ previous?: DocsPageLink;
649
+ next?: DocsPageLink;
650
+ };
651
+
640
652
  export declare function DotsMenu({ entries, size, disabled, align, }: {
641
653
  entries: DotsMenuEntry[];
642
654
  size?: 'sm' | 'md' | 'lg';
@@ -829,6 +841,18 @@ export declare function Kbd({ meta, shift, alt, ctrl, small, children, }: {
829
841
  children?: ReactNode;
830
842
  }): JSX.Element;
831
843
 
844
+ export declare type KnownTotalPaginationProps = PaginationCommonProps & ({
845
+ total: number;
846
+ totalPages?: never;
847
+ hasNextPage?: never;
848
+ showPageNumbers?: boolean;
849
+ } | {
850
+ total?: never;
851
+ totalPages: number;
852
+ hasNextPage?: never;
853
+ showPageNumbers?: boolean;
854
+ });
855
+
832
856
  export declare function Label({ htmlFor, required, children, }: {
833
857
  htmlFor?: string;
834
858
  required?: boolean;
@@ -997,14 +1021,31 @@ declare type NoteSize = 'small' | 'default' | 'large';
997
1021
 
998
1022
  export declare type NoteTone = 'info' | 'success' | 'warning' | 'error' | 'secondary';
999
1023
 
1000
- declare type PageLink = {
1001
- title: string;
1024
+ export declare function Pagination({ page, pageSize: pageSizeProp, total, totalPages: totalPagesProp, hasNextPage, onChange, loading, showPageNumbers, summary, pageSizeSlot, prevLabel, nextLabel, compact, className, }: PaginationProps): JSX.Element;
1025
+
1026
+ declare type PaginationCommonProps = {
1027
+ page: number;
1028
+ pageSize?: number;
1029
+ onChange: (page: number) => void;
1030
+ loading?: boolean;
1031
+ summary?: ReactNode | ((args: PaginationSummaryArgs) => ReactNode);
1032
+ pageSizeSlot?: ReactNode;
1033
+ prevLabel?: string;
1034
+ nextLabel?: string;
1035
+ compact?: boolean;
1036
+ className?: string;
1002
1037
  };
1003
1038
 
1004
- export declare function Pagination({ previous, next }: {
1005
- previous?: PageLink;
1006
- next?: PageLink;
1007
- }): JSX.Element;
1039
+ export declare type PaginationProps = KnownTotalPaginationProps | UnknownTailPaginationProps;
1040
+
1041
+ export declare type PaginationSummaryArgs = {
1042
+ page: number;
1043
+ totalPages?: number;
1044
+ total?: number;
1045
+ pageSize: number;
1046
+ start: number;
1047
+ end: number;
1048
+ };
1008
1049
 
1009
1050
  export declare function PeriodCombobox({ presets, activeLabel, onPick, }: {
1010
1051
  presets: CalendarPreset[];
@@ -1424,6 +1465,13 @@ declare type TooltipTriggerProps = {
1424
1465
 
1425
1466
  export declare type TriggerKind = 'default' | 'compact';
1426
1467
 
1468
+ export declare type UnknownTailPaginationProps = PaginationCommonProps & {
1469
+ total?: never;
1470
+ totalPages?: never;
1471
+ hasNextPage: boolean;
1472
+ showPageNumbers?: false;
1473
+ };
1474
+
1427
1475
  export declare function useCopy(): {
1428
1476
  copied: boolean;
1429
1477
  copy: (value: string, successMessage?: string) => Promise<void>;