@q1travel/design-system 0.7.3 → 0.9.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/overlay-foundation.md +17 -4
- package/contracts/pagination-migration.md +97 -0
- package/contracts/table-migration.md +168 -0
- package/dist-pkg/design-system.d.ts +120 -6
- package/dist-pkg/design-system.js +2704 -2404
- package/dist-pkg/style.css +225 -21
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Overlay Foundation Contract
|
|
2
2
|
|
|
3
|
-
> 状态:Accepted(O1–O7
|
|
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
|
-
-
|
|
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,97 @@
|
|
|
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
|
+
## #111 Shared slots and loading accessibility
|
|
37
|
+
|
|
38
|
+
Status: accepted locally
|
|
39
|
+
|
|
40
|
+
Decision date: 2026-08-07
|
|
41
|
+
|
|
42
|
+
This contract applies to the current known-total and unknown-tail models. A future true-cursor model must reuse these shared semantics, but this decision does not add a cursor prop or infer cursor ownership before #110 supplies a real consumer and request boundary.
|
|
43
|
+
|
|
44
|
+
### Shared public types
|
|
45
|
+
|
|
46
|
+
`PaginationCommonProps` is the named public type for props shared by every product-pagination model. `PaginationSummaryArgs` remains the public callback input type. The model-specific types extend the common type and remain mutually exclusive.
|
|
47
|
+
|
|
48
|
+
### Summary
|
|
49
|
+
|
|
50
|
+
- The summary is rendered before the controls inside the named pagination `nav`.
|
|
51
|
+
- The summary uses `aria-live="polite"` and `aria-atomic="true"`. Page changes and loading completion may update this region; consumer-provided text must be concise and stable enough to announce.
|
|
52
|
+
- A summary callback receives `page`, `pageSize`, `total`, `totalPages`, `start`, and `end`. Unknown-tail supplies no fabricated `total` or `totalPages` and uses `start: 0` and `end: 0` unless the consumer supplies a different summary node.
|
|
53
|
+
- The package owns the default summary formatting, but does not own data-fetching status or consumer-specific result wording.
|
|
54
|
+
|
|
55
|
+
### `pageSizeSlot`
|
|
56
|
+
|
|
57
|
+
- `pageSizeSlot` is a consumer-owned `ReactNode`, rendered before the pagination buttons in the controls region.
|
|
58
|
+
- The package positions the node but does not create, control, label, or synchronize a page-size control.
|
|
59
|
+
- If the slot contains an interactive control, the consumer must provide a programmatic label association, such as a `label`/`htmlFor` pair or `aria-label`/`aria-labelledby`. A bare text wrapper is not an accessible label contract.
|
|
60
|
+
- The slot may wrap in compact or narrow layouts; the consumer remains responsible for the control's value, state, and update handling.
|
|
61
|
+
|
|
62
|
+
### Loading, focus, and completion
|
|
63
|
+
|
|
64
|
+
- While `loading` is true, the pagination `nav` exposes `aria-busy="true"` and the existing Spinner exposes the polite status text `加载中…`.
|
|
65
|
+
- Structural boundary controls and empty-state controls remain natively disabled.
|
|
66
|
+
- Actionable pagination controls remain focusable while loading and expose `aria-disabled="true"`. Their click and keyboard handlers are inert until loading ends. This preserves the user's current focus rather than moving focus to a newly rendered control.
|
|
67
|
+
- The current-page marker and `aria-current="page"` remain stable while loading.
|
|
68
|
+
- After a real loading-to-idle transition, a separate polite, atomic completion region announces `分页已更新`. The summary may additionally announce the new range or page.
|
|
69
|
+
|
|
70
|
+
### Responsive and unavailable states
|
|
71
|
+
|
|
72
|
+
- `compact` and the existing tokenized responsive layout own dense and narrow presentation; the shared semantics do not change at smaller widths.
|
|
73
|
+
- `total={0}` exposes the existing `暂无数据` summary and does not fabricate page numbers.
|
|
74
|
+
- Error or unavailable presentation is consumer-owned composition around `Pagination` (for example, an adjacent alert and a disabled/empty pagination state); #111 does not add an `error` or `unavailable` prop.
|
|
75
|
+
|
|
76
|
+
### Required evidence
|
|
77
|
+
|
|
78
|
+
The package contract must be backed by generated public declarations, a TypeScript consumer fixture, static markup assertions for summary/slot/busy semantics, and browser assertions for native keyboard activation, visible focus, loading `aria-disabled`, focus retention, completion announcement, empty state, and labelled page-size controls. Web migration, true-cursor adoption, publication, and issue closure remain independent gates.
|
|
79
|
+
|
|
80
|
+
## Route and link ownership
|
|
81
|
+
|
|
82
|
+
The documentation route `/components/pagination` is retained. It documents both the product `Pagination` boundary and the separate `DocsPagination` sequence-navigation boundary.
|
|
83
|
+
|
|
84
|
+
`DocsPagination` accepts consumer-owned real `href` values and renders native links. It does not import a q1travel-web router or decide URL construction.
|
|
85
|
+
|
|
86
|
+
## Compatibility, removal, and rollback
|
|
87
|
+
|
|
88
|
+
- 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`.
|
|
89
|
+
- 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.
|
|
90
|
+
- 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`.
|
|
91
|
+
- 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.
|
|
92
|
+
|
|
93
|
+
## Web migration gate
|
|
94
|
+
|
|
95
|
+
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.
|
|
96
|
+
|
|
97
|
+
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.
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Table 公共合同
|
|
2
|
+
|
|
3
|
+
Status: accepted locally
|
|
4
|
+
|
|
5
|
+
Decision date: 2026-08-08
|
|
6
|
+
|
|
7
|
+
Related: q1travel-design-system#25
|
|
8
|
+
|
|
9
|
+
This contract freezes the first public boundary for a shared `Table`. It records
|
|
10
|
+
the behavior and ownership decisions needed before implementation; it does not
|
|
11
|
+
implement the component, change q1travel-web, create migration tickets, or
|
|
12
|
+
claim consumer adoption.
|
|
13
|
+
|
|
14
|
+
## Public boundary
|
|
15
|
+
|
|
16
|
+
`Table` is a consumer-controlled, native-semantic table. It renders the rows and
|
|
17
|
+
columns supplied by the consumer, but it does not fetch data, own router state,
|
|
18
|
+
infer a data-set selection, or implement pagination.
|
|
19
|
+
|
|
20
|
+
The first implementation is split into three responsibilities:
|
|
21
|
+
|
|
22
|
+
| Responsibility | Frozen public boundary | Ownership |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| Core | `columns`, `data`, stable `rowKey`, native `table` / `thead` / `tbody` / `th` semantics, composed rows, and consumer-owned loading/empty/error content | Table owns structure and semantics; the consumer owns data and state content |
|
|
25
|
+
| Interaction | Controlled selection, current-page select-all, bulk actions, action columns, and keyboard-operable row activation | The consumer owns selected state and action effects; Table owns selection wiring and accessible interaction states |
|
|
26
|
+
| Layout and data behavior | Controlled sorting with `aria-sort`, `stickyHeader`, `maxBodyHeight`, explicit density, `minWidth`, column-group composition, `renderRow`, and `showHeader` | Table owns layout wiring and state attributes; the consumer owns sort state, render decisions, and data ordering |
|
|
27
|
+
|
|
28
|
+
The public component must not require a business-specific workflow, request
|
|
29
|
+
library, router, or product-side data model.
|
|
30
|
+
|
|
31
|
+
## Core contract
|
|
32
|
+
|
|
33
|
+
- `columns` and `data` are consumer-owned inputs. A column identifies its
|
|
34
|
+
heading and cell rendering without requiring Table to know the domain model.
|
|
35
|
+
- `rowKey` is a stable consumer-owned key. Table must not use the array index as
|
|
36
|
+
the identity for selection, updates, or row activation.
|
|
37
|
+
- The default structure uses native table elements and `th scope="col"`.
|
|
38
|
+
Table does not promote the surface to `role="grid"` or add arrow-key grid
|
|
39
|
+
navigation in this contract.
|
|
40
|
+
- `renderRow` and composed cells may extend row presentation, but they must
|
|
41
|
+
preserve the table's heading, cell, focus, and selection semantics.
|
|
42
|
+
- Loading, empty, and error states are explicit consumer-owned surfaces. Table
|
|
43
|
+
must not invent fetch status, error copy, recovery actions, or business
|
|
44
|
+
permissions. An empty result may be rendered as an adjacent Empty State
|
|
45
|
+
rather than as an artificial table row.
|
|
46
|
+
- `showHeader` is a presentation option, not permission to remove the
|
|
47
|
+
accessible relationship between cells and their column headings. A consumer
|
|
48
|
+
that hides the visual header remains responsible for an accessible table
|
|
49
|
+
name and header semantics.
|
|
50
|
+
|
|
51
|
+
The current documentation-only `striped`, `bordered`, `divided`, `interactive`,
|
|
52
|
+
and virtualized specimens do not automatically become public variant props.
|
|
53
|
+
They remain evidence and comparison material until a consumer-backed contract
|
|
54
|
+
requires each capability.
|
|
55
|
+
|
|
56
|
+
## Controlled interaction contract
|
|
57
|
+
|
|
58
|
+
### Selection
|
|
59
|
+
|
|
60
|
+
- Selection is controlled by the consumer. Table receives the selected row keys
|
|
61
|
+
and reports the next selected-key collection through its change callback; it
|
|
62
|
+
does not keep an independent authoritative selection store.
|
|
63
|
+
- A row is selectable only when the consumer exposes it as selectable. Selection
|
|
64
|
+
controls use native checkboxes with accessible names and a visible
|
|
65
|
+
`:focus-visible` state.
|
|
66
|
+
- The header select-all control operates on the currently rendered/selectable
|
|
67
|
+
page only.
|
|
68
|
+
- Selecting all adds the selectable keys visible on the current page to the
|
|
69
|
+
consumer's existing selected keys. Clearing all removes only those current
|
|
70
|
+
page keys. Keys belonging to other pages are preserved in both operations.
|
|
71
|
+
- The header state is derived from current-page selectable rows: unchecked when
|
|
72
|
+
none are selected, mixed when only some are selected, and checked when all
|
|
73
|
+
current-page selectable rows are selected.
|
|
74
|
+
- Table must not infer that the entire data set is selected, emit a hidden
|
|
75
|
+
"select all pages" sentinel, fetch other pages, or rewrite keys it cannot see.
|
|
76
|
+
- Bulk actions and action-column content are consumer-provided. Table may
|
|
77
|
+
expose the current selection boundary to the action surface, but it does not
|
|
78
|
+
execute business mutations or decide confirmation, retry, or success copy.
|
|
79
|
+
|
|
80
|
+
### Row activation
|
|
81
|
+
|
|
82
|
+
- A consumer may provide row activation. The activation target must be
|
|
83
|
+
keyboard-operable with the same outcome as pointer activation and must expose
|
|
84
|
+
a visible focus state.
|
|
85
|
+
- Enter and Space activation must not be implemented by turning the entire
|
|
86
|
+
table into a grid. Arrow-key row navigation, roving focus, and cell editing
|
|
87
|
+
are outside this first contract.
|
|
88
|
+
- A row action must not conflict with a nested native link, button, checkbox,
|
|
89
|
+
or other interactive cell control; nested controls retain their native
|
|
90
|
+
behavior.
|
|
91
|
+
|
|
92
|
+
### Sorting
|
|
93
|
+
|
|
94
|
+
- Sorting is controlled: the consumer owns the active sort key and direction,
|
|
95
|
+
receives the sort-change event, and owns data ordering or server requests.
|
|
96
|
+
- A sortable heading is a native button inside the heading cell. The heading
|
|
97
|
+
exposes `aria-sort` with the applicable `none`, `ascending`, or `descending`
|
|
98
|
+
value. The sort icon is decorative and is not the only state cue.
|
|
99
|
+
- Table does not silently sort data, fetch a new page, mutate URL/query state,
|
|
100
|
+
or fabricate a total while sorting.
|
|
101
|
+
|
|
102
|
+
## Layout and responsive contract
|
|
103
|
+
|
|
104
|
+
- `density` is explicit consumer input; Table must not infer density from a
|
|
105
|
+
parent page or from being rendered inside a data surface.
|
|
106
|
+
- `stickyHeader` and `maxBodyHeight` are layout capabilities. When they create a
|
|
107
|
+
scroll region, the region must remain usable with keyboard focus and must not
|
|
108
|
+
create an unnecessary second scrollbar.
|
|
109
|
+
- `minWidth` and column-group composition are consumer-visible layout inputs;
|
|
110
|
+
intrinsic table sizing remains the default and JavaScript measurement is not
|
|
111
|
+
required for normal layout.
|
|
112
|
+
- The implementation must remain usable at small, laptop, desktop, and wide
|
|
113
|
+
widths, with horizontal overflow owned by the table surface when columns
|
|
114
|
+
cannot fit.
|
|
115
|
+
- Light and dark themes use canonical q1travel tokens. No Web page-local
|
|
116
|
+
`--ds-*` token becomes a new public Table token.
|
|
117
|
+
|
|
118
|
+
## Accessibility and state evidence
|
|
119
|
+
|
|
120
|
+
The component follows the existing native-semantic accessibility bar:
|
|
121
|
+
|
|
122
|
+
- native table structure and column-heading relationships;
|
|
123
|
+
- native buttons, links, and checkboxes for interactive cells;
|
|
124
|
+
- visible focus for every focusable control;
|
|
125
|
+
- accessible names for select-all, row, and action controls;
|
|
126
|
+
- redundant selected, sorted, loading, empty, and error cues;
|
|
127
|
+
- consumer-owned async announcements and recovery actions where state changes.
|
|
128
|
+
|
|
129
|
+
The implementation gate must add generated public declarations, a TypeScript
|
|
130
|
+
consumer fixture, package-level markup assertions, and browser evidence for:
|
|
131
|
+
|
|
132
|
+
1. controlled selection and current-page select-all while preserving off-page
|
|
133
|
+
keys;
|
|
134
|
+
2. indeterminate and checked header states;
|
|
135
|
+
3. sortable headings and `aria-sort` transitions through native keyboard input;
|
|
136
|
+
4. row activation, nested-control isolation, focus visibility, and disabled
|
|
137
|
+
rows/controls where applicable;
|
|
138
|
+
5. loading, empty, error, dense, narrow, light, and dark states; and
|
|
139
|
+
6. sticky/max-height behavior without losing focus or introducing an unwanted
|
|
140
|
+
scroll trap.
|
|
141
|
+
|
|
142
|
+
The existing Table documentation page and its browser checks prove only the
|
|
143
|
+
page-local specimen. They are not package or consumer evidence for this
|
|
144
|
+
contract.
|
|
145
|
+
|
|
146
|
+
## Pagination and migration boundary
|
|
147
|
+
|
|
148
|
+
- `Table` receives the visible data it must render and does not own `page`,
|
|
149
|
+
`pageSize`, `total`, cursor tokens, query-string state, or data fetching.
|
|
150
|
+
- Dataset pagination is composed with the public `Pagination` component;
|
|
151
|
+
documentation sequence navigation remains the separate `DocsPagination`
|
|
152
|
+
boundary.
|
|
153
|
+
- The current-page select-all rule remains valid when the consumer changes
|
|
154
|
+
pages: off-page selected keys stay in the consumer's controlled collection,
|
|
155
|
+
while the header state is recalculated from the newly visible page.
|
|
156
|
+
- q1travel-web migration is a separate gate. It may begin only after the
|
|
157
|
+
package export, generated types, focused tests, published package identity,
|
|
158
|
+
and consumer adoption have each been independently verified.
|
|
159
|
+
- This contract does not modify q1travel-web, publish the package, migrate a
|
|
160
|
+
consumer, close #25, or create implementation issues.
|
|
161
|
+
|
|
162
|
+
## Implementation sequence
|
|
163
|
+
|
|
164
|
+
`Table core` → `Interaction` → `Layout` → `export/types/tests` → `published
|
|
165
|
+
package verification` → `q1travel-web migration`
|
|
166
|
+
|
|
167
|
+
Each arrow is a separate acceptance gate. A passing documentation specimen,
|
|
168
|
+
local package build, or source-level assertion does not establish the next gate.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AnchorHTMLAttributes } from 'react';
|
|
2
2
|
import { ButtonHTMLAttributes } from 'react';
|
|
3
3
|
import { ComponentPropsWithoutRef } from 'react';
|
|
4
|
+
import { CSSProperties } from 'react';
|
|
4
5
|
import { FocusEventHandler } from 'react';
|
|
5
6
|
import { HTMLAttributes } from 'react';
|
|
6
7
|
import { InputHTMLAttributes } from 'react';
|
|
@@ -12,6 +13,7 @@ import { ReactNode } from 'react';
|
|
|
12
13
|
import { Ref } from 'react';
|
|
13
14
|
import { RefObject } from 'react';
|
|
14
15
|
import { SelectHTMLAttributes } from 'react';
|
|
16
|
+
import { TableHTMLAttributes } from 'react';
|
|
15
17
|
import { TextareaHTMLAttributes } from 'react';
|
|
16
18
|
|
|
17
19
|
export declare function addDays(date: Date, amount: number): Date;
|
|
@@ -637,6 +639,18 @@ export declare function DestructiveActionModal({ open, onClose, title, descripti
|
|
|
637
639
|
onConfirm: () => string | null;
|
|
638
640
|
}): ReactNode;
|
|
639
641
|
|
|
642
|
+
export declare type DocsPageLink = {
|
|
643
|
+
title: string;
|
|
644
|
+
href: string;
|
|
645
|
+
};
|
|
646
|
+
|
|
647
|
+
export declare function DocsPagination({ previous, next }: DocsPaginationProps): JSX.Element;
|
|
648
|
+
|
|
649
|
+
export declare type DocsPaginationProps = {
|
|
650
|
+
previous?: DocsPageLink;
|
|
651
|
+
next?: DocsPageLink;
|
|
652
|
+
};
|
|
653
|
+
|
|
640
654
|
export declare function DotsMenu({ entries, size, disabled, align, }: {
|
|
641
655
|
entries: DotsMenuEntry[];
|
|
642
656
|
size?: 'sm' | 'md' | 'lg';
|
|
@@ -829,6 +843,18 @@ export declare function Kbd({ meta, shift, alt, ctrl, small, children, }: {
|
|
|
829
843
|
children?: ReactNode;
|
|
830
844
|
}): JSX.Element;
|
|
831
845
|
|
|
846
|
+
export declare type KnownTotalPaginationProps = PaginationCommonProps & ({
|
|
847
|
+
total: number;
|
|
848
|
+
totalPages?: never;
|
|
849
|
+
hasNextPage?: never;
|
|
850
|
+
showPageNumbers?: boolean;
|
|
851
|
+
} | {
|
|
852
|
+
total?: never;
|
|
853
|
+
totalPages: number;
|
|
854
|
+
hasNextPage?: never;
|
|
855
|
+
showPageNumbers?: boolean;
|
|
856
|
+
});
|
|
857
|
+
|
|
832
858
|
export declare function Label({ htmlFor, required, children, }: {
|
|
833
859
|
htmlFor?: string;
|
|
834
860
|
required?: boolean;
|
|
@@ -997,14 +1023,31 @@ declare type NoteSize = 'small' | 'default' | 'large';
|
|
|
997
1023
|
|
|
998
1024
|
export declare type NoteTone = 'info' | 'success' | 'warning' | 'error' | 'secondary';
|
|
999
1025
|
|
|
1000
|
-
declare
|
|
1001
|
-
|
|
1026
|
+
export declare function Pagination({ page, pageSize: pageSizeProp, total, totalPages: totalPagesProp, hasNextPage, onChange, loading, showPageNumbers, summary, pageSizeSlot, prevLabel, nextLabel, compact, className, }: PaginationProps): JSX.Element;
|
|
1027
|
+
|
|
1028
|
+
export declare type PaginationCommonProps = {
|
|
1029
|
+
page: number;
|
|
1030
|
+
pageSize?: number;
|
|
1031
|
+
onChange: (page: number) => void;
|
|
1032
|
+
loading?: boolean;
|
|
1033
|
+
summary?: ReactNode | ((args: PaginationSummaryArgs) => ReactNode);
|
|
1034
|
+
pageSizeSlot?: ReactNode;
|
|
1035
|
+
prevLabel?: string;
|
|
1036
|
+
nextLabel?: string;
|
|
1037
|
+
compact?: boolean;
|
|
1038
|
+
className?: string;
|
|
1002
1039
|
};
|
|
1003
1040
|
|
|
1004
|
-
export declare
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1041
|
+
export declare type PaginationProps = KnownTotalPaginationProps | UnknownTailPaginationProps;
|
|
1042
|
+
|
|
1043
|
+
export declare type PaginationSummaryArgs = {
|
|
1044
|
+
page: number;
|
|
1045
|
+
totalPages?: number;
|
|
1046
|
+
total?: number;
|
|
1047
|
+
pageSize: number;
|
|
1048
|
+
start: number;
|
|
1049
|
+
end: number;
|
|
1050
|
+
};
|
|
1008
1051
|
|
|
1009
1052
|
export declare function PeriodCombobox({ presets, activeLabel, onPick, }: {
|
|
1010
1053
|
presets: CalendarPreset[];
|
|
@@ -1318,6 +1361,70 @@ export declare type TabItem = {
|
|
|
1318
1361
|
tooltip?: string;
|
|
1319
1362
|
};
|
|
1320
1363
|
|
|
1364
|
+
export declare function Table<T>({ data, columns, rowKey, caption, density, stickyHeader, maxBodyHeight, minWidth, colGroup, renderRow, showHeader, sortKey, sortDirection, onSortChange, selection, actions, bulkActions, bulkActionsLabel, rowActivation, className: consumerClassName, style: consumerStyle, ...nativeProps }: TableProps<T>): JSX.Element;
|
|
1365
|
+
|
|
1366
|
+
export declare type TableActions<T> = {
|
|
1367
|
+
header: ReactNode;
|
|
1368
|
+
render: (row: T, rowIndex: number) => ReactNode;
|
|
1369
|
+
};
|
|
1370
|
+
|
|
1371
|
+
export declare type TableColumn<T> = {
|
|
1372
|
+
key: string;
|
|
1373
|
+
header: ReactNode;
|
|
1374
|
+
render: (row: T, rowIndex: number) => ReactNode;
|
|
1375
|
+
sortable?: boolean;
|
|
1376
|
+
sortLabel?: string;
|
|
1377
|
+
};
|
|
1378
|
+
|
|
1379
|
+
export declare type TableDensity = 'comfortable' | 'compact';
|
|
1380
|
+
|
|
1381
|
+
export declare type TableProps<T> = {
|
|
1382
|
+
data: readonly T[];
|
|
1383
|
+
columns: readonly TableColumn<T>[];
|
|
1384
|
+
rowKey: (row: T, rowIndex: number) => TableRowKey;
|
|
1385
|
+
caption?: ReactNode;
|
|
1386
|
+
density?: TableDensity;
|
|
1387
|
+
stickyHeader?: boolean;
|
|
1388
|
+
maxBodyHeight?: CSSProperties['maxHeight'];
|
|
1389
|
+
minWidth?: CSSProperties['minWidth'];
|
|
1390
|
+
colGroup?: ReactNode;
|
|
1391
|
+
renderRow?: (row: T, context: TableRowRenderContext<T>) => ReactNode;
|
|
1392
|
+
showHeader?: boolean;
|
|
1393
|
+
sortKey?: string;
|
|
1394
|
+
sortDirection?: TableSortDirection;
|
|
1395
|
+
onSortChange?: (key: string, direction: TableSortDirection) => void;
|
|
1396
|
+
selection?: TableSelection<T>;
|
|
1397
|
+
actions?: TableActions<T>;
|
|
1398
|
+
bulkActions?: ReactNode;
|
|
1399
|
+
bulkActionsLabel?: string;
|
|
1400
|
+
rowActivation?: TableRowActivation<T>;
|
|
1401
|
+
} & Omit<TableHTMLAttributes<HTMLTableElement>, 'children'>;
|
|
1402
|
+
|
|
1403
|
+
export declare type TableRowActivation<T> = {
|
|
1404
|
+
getRowLabel: (row: T, rowIndex: number) => string;
|
|
1405
|
+
onActivate: (row: T, rowIndex: number) => void;
|
|
1406
|
+
};
|
|
1407
|
+
|
|
1408
|
+
export declare type TableRowKey = string | number;
|
|
1409
|
+
|
|
1410
|
+
export declare type TableRowRenderContext<T> = {
|
|
1411
|
+
row: T;
|
|
1412
|
+
rowIndex: number;
|
|
1413
|
+
rowKey: TableRowKey;
|
|
1414
|
+
rowProps: TableHTMLAttributes<HTMLTableRowElement>;
|
|
1415
|
+
cells: ReactNode;
|
|
1416
|
+
};
|
|
1417
|
+
|
|
1418
|
+
export declare type TableSelection<T> = {
|
|
1419
|
+
selectedKeys: readonly TableRowKey[];
|
|
1420
|
+
onSelectionChange: (selectedKeys: TableRowKey[]) => void;
|
|
1421
|
+
getRowLabel: (row: T, rowIndex: number) => string;
|
|
1422
|
+
getRowDisabled?: (row: T, rowIndex: number) => boolean;
|
|
1423
|
+
selectAllLabel?: string;
|
|
1424
|
+
};
|
|
1425
|
+
|
|
1426
|
+
export declare type TableSortDirection = 'asc' | 'desc';
|
|
1427
|
+
|
|
1321
1428
|
export declare function Tabs({ tabs, ariaLabel, variant, }: {
|
|
1322
1429
|
tabs: TabItem[];
|
|
1323
1430
|
ariaLabel: string;
|
|
@@ -1424,6 +1531,13 @@ declare type TooltipTriggerProps = {
|
|
|
1424
1531
|
|
|
1425
1532
|
export declare type TriggerKind = 'default' | 'compact';
|
|
1426
1533
|
|
|
1534
|
+
export declare type UnknownTailPaginationProps = PaginationCommonProps & {
|
|
1535
|
+
total?: never;
|
|
1536
|
+
totalPages?: never;
|
|
1537
|
+
hasNextPage: boolean;
|
|
1538
|
+
showPageNumbers?: false;
|
|
1539
|
+
};
|
|
1540
|
+
|
|
1427
1541
|
export declare function useCopy(): {
|
|
1428
1542
|
copied: boolean;
|
|
1429
1543
|
copy: (value: string, successMessage?: string) => Promise<void>;
|