@comitor/ui 2.0.0 → 2.1.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.
Files changed (131) hide show
  1. package/LICENSE +35 -0
  2. package/README.md +14 -6
  3. package/dist/components/ui/action-bar-constants.d.ts +31 -0
  4. package/dist/components/ui/action-bar-constants.js +9 -0
  5. package/dist/components/ui/action-bar-constants.js.map +1 -0
  6. package/dist/components/ui/action-bar.d.ts +67 -0
  7. package/dist/components/ui/action-bar.js +522 -0
  8. package/dist/components/ui/action-bar.js.map +1 -0
  9. package/dist/components/ui/badge-overflow.d.ts +30 -0
  10. package/dist/components/ui/badge-overflow.js +179 -0
  11. package/dist/components/ui/badge-overflow.js.map +1 -0
  12. package/dist/components/ui/banner.d.ts +79 -0
  13. package/dist/components/ui/banner.js +518 -0
  14. package/dist/components/ui/banner.js.map +1 -0
  15. package/dist/components/ui/circular-progress.d.ts +50 -0
  16. package/dist/components/ui/circular-progress.js +266 -0
  17. package/dist/components/ui/circular-progress.js.map +1 -0
  18. package/dist/components/ui/cropper-constants.d.ts +34 -0
  19. package/dist/components/ui/cropper-constants.js +10 -0
  20. package/dist/components/ui/cropper-constants.js.map +1 -0
  21. package/dist/components/ui/cropper.d.ts +106 -0
  22. package/dist/components/ui/cropper.js +1269 -0
  23. package/dist/components/ui/cropper.js.map +1 -0
  24. package/dist/components/ui/drawer.d.ts +1 -1
  25. package/dist/components/ui/drawer.js +2 -2
  26. package/dist/components/ui/drawer.js.map +1 -1
  27. package/dist/components/ui/kanban-constants.d.ts +61 -0
  28. package/dist/components/ui/kanban-constants.js +21 -0
  29. package/dist/components/ui/kanban-constants.js.map +1 -0
  30. package/dist/components/ui/kanban.d.ts +72 -0
  31. package/dist/components/ui/kanban.js +787 -0
  32. package/dist/components/ui/kanban.js.map +1 -0
  33. package/dist/components/ui/key-value-constants.d.ts +33 -0
  34. package/dist/components/ui/key-value-constants.js +11 -0
  35. package/dist/components/ui/key-value-constants.js.map +1 -0
  36. package/dist/components/ui/key-value.d.ts +96 -0
  37. package/dist/components/ui/key-value.js +641 -0
  38. package/dist/components/ui/key-value.js.map +1 -0
  39. package/dist/components/ui/mask-input-constants.d.ts +99 -0
  40. package/dist/components/ui/mask-input-constants.js +601 -0
  41. package/dist/components/ui/mask-input-constants.js.map +1 -0
  42. package/dist/components/ui/mask-input.d.ts +36 -0
  43. package/dist/components/ui/mask-input.js +558 -0
  44. package/dist/components/ui/mask-input.js.map +1 -0
  45. package/dist/components/ui/mention.d.ts +31 -0
  46. package/dist/components/ui/mention.js +128 -0
  47. package/dist/components/ui/mention.js.map +1 -0
  48. package/dist/components/ui/phone-input-constants.d.ts +54 -0
  49. package/dist/components/ui/phone-input-constants.js +9 -0
  50. package/dist/components/ui/phone-input-constants.js.map +1 -0
  51. package/dist/components/ui/phone-input.d.ts +85 -0
  52. package/dist/components/ui/phone-input.js +743 -0
  53. package/dist/components/ui/phone-input.js.map +1 -0
  54. package/dist/components/ui/rating.d.ts +56 -0
  55. package/dist/components/ui/rating.js +646 -0
  56. package/dist/components/ui/rating.js.map +1 -0
  57. package/dist/components/ui/responsive-dialog.d.ts +35 -0
  58. package/dist/components/ui/responsive-dialog.js +193 -0
  59. package/dist/components/ui/responsive-dialog.js.map +1 -0
  60. package/dist/components/ui/scroll-spy.d.ts +42 -0
  61. package/dist/components/ui/scroll-spy.js +334 -0
  62. package/dist/components/ui/scroll-spy.js.map +1 -0
  63. package/dist/components/ui/stepper-constants.d.ts +29 -0
  64. package/dist/components/ui/stepper-constants.js +9 -0
  65. package/dist/components/ui/stepper-constants.js.map +1 -0
  66. package/dist/components/ui/stepper.d.ts +80 -0
  67. package/dist/components/ui/stepper.js +902 -0
  68. package/dist/components/ui/stepper.js.map +1 -0
  69. package/dist/components/ui/tags-input.d.ts +41 -0
  70. package/dist/components/ui/tags-input.js +127 -0
  71. package/dist/components/ui/tags-input.js.map +1 -0
  72. package/dist/components/ui/time-picker-constants.d.ts +48 -0
  73. package/dist/components/ui/time-picker-constants.js +14 -0
  74. package/dist/components/ui/time-picker-constants.js.map +1 -0
  75. package/dist/components/ui/time-picker.d.ts +115 -0
  76. package/dist/components/ui/time-picker.js +1620 -0
  77. package/dist/components/ui/time-picker.js.map +1 -0
  78. package/dist/components/ui/timeline.d.ts +32 -0
  79. package/dist/components/ui/timeline.js +559 -0
  80. package/dist/components/ui/timeline.js.map +1 -0
  81. package/dist/components/ui/tour-constants.d.ts +39 -0
  82. package/dist/components/ui/tour-constants.js +12 -0
  83. package/dist/components/ui/tour-constants.js.map +1 -0
  84. package/dist/components/ui/tour.d.ts +124 -0
  85. package/dist/components/ui/tour.js +1207 -0
  86. package/dist/components/ui/tour.js.map +1 -0
  87. package/dist/data-grid/data-grid-cell-wrapper.js +1 -1
  88. package/dist/data-grid/data-grid-cell-wrapper.js.map +1 -1
  89. package/dist/data-grid/data-grid-context-menu.js +1 -1
  90. package/dist/data-grid/data-grid-context-menu.js.map +1 -1
  91. package/dist/data-grid/data-grid-paste-dialog.js +1 -1
  92. package/dist/data-grid/data-grid-paste-dialog.js.map +1 -1
  93. package/dist/data-grid/data-grid-row.js +1 -1
  94. package/dist/data-grid/data-grid-row.js.map +1 -1
  95. package/dist/data-grid/data-grid-search.js +1 -1
  96. package/dist/data-grid/data-grid-search.js.map +1 -1
  97. package/dist/data-grid/data-grid.js +1 -1
  98. package/dist/data-grid/data-grid.js.map +1 -1
  99. package/dist/data-grid/sortable.js +1 -1
  100. package/dist/data-grid/sortable.js.map +1 -1
  101. package/dist/data-grid/use-data-grid-undo-redo.js +2 -2
  102. package/dist/data-grid/use-data-grid-undo-redo.js.map +1 -1
  103. package/dist/data-grid/use-data-grid.js +3 -3
  104. package/dist/data-grid/use-data-grid.js.map +1 -1
  105. package/dist/index.d.ts +31 -0
  106. package/dist/index.js +42 -0
  107. package/dist/index.js.map +1 -1
  108. package/dist/lib/compose-refs.js.map +1 -0
  109. package/dist/lib/use-as-ref.js.map +1 -0
  110. package/dist/lib/use-is-mobile.d.ts +10 -0
  111. package/dist/lib/use-is-mobile.js +21 -0
  112. package/dist/lib/use-is-mobile.js.map +1 -0
  113. package/dist/lib/use-isomorphic-layout-effect.js.map +1 -0
  114. package/dist/lib/use-lazy-ref.js.map +1 -0
  115. package/dist/lib/visually-hidden-input.d.ts +12 -0
  116. package/dist/lib/visually-hidden-input.js +105 -0
  117. package/dist/lib/visually-hidden-input.js.map +1 -0
  118. package/package.json +5 -1
  119. package/styles.css +19 -0
  120. package/dist/data-grid/compose-refs.js.map +0 -1
  121. package/dist/data-grid/use-as-ref.js.map +0 -1
  122. package/dist/data-grid/use-isomorphic-layout-effect.js.map +0 -1
  123. package/dist/data-grid/use-lazy-ref.js.map +0 -1
  124. /package/dist/{data-grid → lib}/compose-refs.d.ts +0 -0
  125. /package/dist/{data-grid → lib}/compose-refs.js +0 -0
  126. /package/dist/{data-grid → lib}/use-as-ref.d.ts +0 -0
  127. /package/dist/{data-grid → lib}/use-as-ref.js +0 -0
  128. /package/dist/{data-grid → lib}/use-isomorphic-layout-effect.d.ts +0 -0
  129. /package/dist/{data-grid → lib}/use-isomorphic-layout-effect.js +0 -0
  130. /package/dist/{data-grid → lib}/use-lazy-ref.d.ts +0 -0
  131. /package/dist/{data-grid → lib}/use-lazy-ref.js +0 -0
package/LICENSE CHANGED
@@ -19,3 +19,38 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
+
23
+ --------------------------------------------------------------------------------
24
+
25
+ THIRD-PARTY NOTICES
26
+
27
+ Portions of this package are derived from the following MIT-licensed works:
28
+
29
+ - tablecn (https://github.com/sadmann7/tablecn) — the `data-grid` entry.
30
+ - Dice UI (https://github.com/sadmann7/diceui) — ActionBar, BadgeOverflow, Banner,
31
+ CircularProgress, Cropper, Kanban, KeyValue, MaskInput, Mention, PhoneInput,
32
+ Rating, ResponsiveDialog, ScrollSpy, Stepper, TagsInput, TimePicker, Timeline,
33
+ Tour, and the shared helpers in `lib/` (compose-refs, use-as-ref,
34
+ use-isomorphic-layout-effect, use-lazy-ref, visually-hidden-input).
35
+
36
+ MIT License
37
+
38
+ Copyright (c) 2024 Sadman Sakib
39
+
40
+ Permission is hereby granted, free of charge, to any person obtaining a copy
41
+ of this software and associated documentation files (the "Software"), to deal
42
+ in the Software without restriction, including without limitation the rights
43
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
44
+ copies of the Software, and to permit persons to whom the Software is
45
+ furnished to do so, subject to the following conditions:
46
+
47
+ The above copyright notice and this permission notice shall be included in all
48
+ copies or substantial portions of the Software.
49
+
50
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
51
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
52
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
53
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
54
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
55
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
56
+ SOFTWARE.
package/README.md CHANGED
@@ -8,8 +8,10 @@ component ghép sẵn và khung ứng dụng (shell) kiểu workspace × app.
8
8
  - Token brand nằm ở **`styles.css`** — đổi token, bump version, mọi app nhận cùng một thay đổi.
9
9
  - Server-component-friendly: `"use client"` chỉ nằm ở file thật sự cần.
10
10
 
11
- > Trạng thái: `1.8.0` — 52 file primitive (Tier 1) · 31 file composite (Tier 2) · 25 file shell
12
- > (Tier 3) · 4 file chart · 5 file uploader. API chốt từ `1.0.0`.
11
+ > Trạng thái: `2.1.0` — 79 file primitive (Tier 1, gồm 18 component port từ
12
+ > [Dice UI](docs/diceui.md)) · 32 file composite (Tier 2) · 25 file shell (Tier 3) · 4 file chart ·
13
+ > 32 file data-grid · 5 file uploader. API chốt từ `1.0.0`. (Đếm bằng `ls src/<tầng>`; con số trôi
14
+ > theo mỗi bản — đếm lại, đừng chép.)
13
15
  >
14
16
  > Tài liệu đầy đủ: **https://design-system.comitor.ai** —
15
17
  > [Get started](https://design-system.comitor.ai/get-started) ·
@@ -157,21 +159,21 @@ và prop chỉ còn nghĩa "không hoạt hình". https://design-system.comitor.
157
159
  Ranh giới server/client là cạm bẫy cùng họ, và hỏng theo **hai kiểu ngược nhau**: 7 helper dựng chuỗi
158
160
  class (`buttonVariants`, `toggleVariants`…) gọi từ Server Component thì **ném lỗi to**, còn một hằng
159
161
  dữ liệu lọt vào sau file `"use client"` thì ra `undefined` — **không throw, không warning** — trong
160
- khi TypeScript vẫn khai kiểu literal. Danh sách đầy đủ 97 tên, ai gọi được ai không:
162
+ khi TypeScript vẫn khai kiểu literal. Danh sách đầy đủ, ai gọi được ai không:
161
163
  https://design-system.comitor.ai/foundations/server-client
162
164
 
163
165
  ## 5. Bảng component
164
166
 
165
- Số file nguồn hiện tại: **52 primitive · 31 composite · 25 shell · 4 chart · 33 data-grid · 5 uploader**. Mỗi component có trang
167
+ Số file nguồn hiện tại: **79 primitive · 32 composite · 25 shell · 4 chart · 32 data-grid · 5 uploader**. Mỗi component có trang
166
168
  riêng kèm demo, bảng prop và cạm bẫy của nó:
167
169
 
168
170
  | Tầng | Là gì | Trang |
169
171
  |---|---|---|
170
- | **Tier 1 — primitive** · 52 file · `@comitor/ui` | shadcn/ui style `new-york`, đã tùy biến token theo brand Comitor | https://design-system.comitor.ai/components |
172
+ | **Tier 1 — primitive** · 79 file · `@comitor/ui` | shadcn/ui style `new-york`, đã tùy biến token theo brand Comitor — cộng 18 component port từ Dice UI ở `2.1.0`: `Kanban`, `Stepper`, `Timeline`, `TimePicker`, `TagsInput`, `Mention`, `ActionBar`, `PhoneInput`, `MaskInput`, `Rating`, `CircularProgress`, `Banner`, `ResponsiveDialog`, `Tour`, `KeyValue`, `Cropper`, `ScrollSpy`, `BadgeOverflow` | https://design-system.comitor.ai/components · vì sao chọn chúng, và mọi chỗ đã đổi so với thượng nguồn: [docs/diceui.md](docs/diceui.md) |
171
173
  | **Tier 2 — composite** · 31 file · `@comitor/ui` | Giá trị thật của gói: pattern lặp ở mọi app, ghép từ nhiều primitive (`DataTable`, `PageHeader`, `Combobox`, `DatePicker`, `StatCard`…) | https://design-system.comitor.ai/composites |
172
174
  | **Tier 3 — shell** · 25 file · `@comitor/ui/shell` | Khung ứng dụng workspace × app: sidebar, header, theme, ba trục hiển thị (tương phản · mật độ · cỡ chữ) | https://design-system.comitor.ai/shell |
173
175
  | **chart** · 4 file · `@comitor/ui/chart` | Lớp shadcn bọc recharts, cùng ba bản dựng sẵn theo brand. ⚠ Ba wrapper `Comitor*Chart` **mặc định TẮT** hiệu ứng vẽ dần (`isAnimationActive = false`) — bật lại là biểu đồ kẹt ở khung đầu: có trục, có lưới, KHÔNG có dữ liệu. Mặc định đó KHÔNG áp cho `<ChartContainer>` + recharts do app tự lắp | https://design-system.comitor.ai/components/chart |
174
- | **data-grid** · 36 file · `@comitor/ui/data-grid` | `DataGrid` — lưới sửa trực tiếp kiểu bảng tính, cho màn nhập liệu hàng loạt. Port từ [tablecn](https://www.tablecn.com/data-grid) (MIT) sang primitive + token của gói. ⚠ Là tầng DUY NHẤT có peer **`@tanstack/react-table`**, tầng duy nhất mặc định **tiếng Anh** (prop `locale`, xem dưới), và mọi thứ trong nó là client component | [docs/data-grid.md](docs/data-grid.md) |
176
+ | **data-grid** · 32 file · `@comitor/ui/data-grid` | `DataGrid` — lưới sửa trực tiếp kiểu bảng tính, cho màn nhập liệu hàng loạt. Port từ [tablecn](https://www.tablecn.com/data-grid) (MIT) sang primitive + token của gói. ⚠ Là tầng DUY NHẤT có peer **`@tanstack/react-table`**, tầng duy nhất mặc định **tiếng Anh** (prop `locale`, xem dưới), và mọi thứ trong nó là client component | [docs/data-grid.md](docs/data-grid.md) |
175
177
  | **uploader** · 5 file · `@comitor/ui/uploader` | `FileUpload` (tệp) · `ImageUploadField` (ảnh) · `useFileUpload` — kéo thả, xem trước, tiến độ. Peer optional: `@uppy/core` + `@uppy/xhr-upload` | https://design-system.comitor.ai/components |
176
178
  | **form** · `@comitor/ui/form` | Binding shadcn ⇄ react-hook-form | https://design-system.comitor.ai/components/form |
177
179
 
@@ -280,3 +282,9 @@ https://design-system.comitor.ai/foundations/colors
280
282
  ## 8. Giấy phép
281
283
 
282
284
  MIT © Comitor
285
+
286
+ Hai phần được port từ mã nguồn MIT của **Sadman Sakib** (© 2024), giữ nguyên điều kiện của giấy
287
+ phép gốc — toàn văn thông báo bản quyền nằm cuối [LICENSE](LICENSE):
288
+
289
+ - `@comitor/ui/data-grid` — từ [tablecn](https://tablecn.com) ([docs/data-grid.md](docs/data-grid.md));
290
+ - 18 component Tier 1 của `2.1.0` — từ [Dice UI](https://diceui.com) ([docs/diceui.md](docs/diceui.md)).
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Nhãn mặc định của `ActionBar`.
3
+ *
4
+ * Module **CỐ Ý không có `"use client"`** — xem `src/chart/chart-colors.ts` để biết lý do đầy đủ:
5
+ * mọi export của một file `"use client"` đến tay Server Component dưới dạng client-reference
6
+ * proxy, đọc ra `undefined` mà KHÔNG throw, KHÔNG warning.
7
+ *
8
+ * ⚠ Barrel `src/index.ts` xuất module này TRỰC TIẾP. `action-bar.tsx` chỉ được `import`, KHÔNG
9
+ * được `export` lại (re-export qua file client là vô hiệu, và đụng tên với `export *`).
10
+ */
11
+ /**
12
+ * Toàn bộ chuỗi hiển thị và chuỗi a11y của `ActionBar` — truyền một phần qua prop `labels` của
13
+ * `ActionBar`, phần còn lại lấy từ `DEFAULT_ACTION_BAR_LABELS`.
14
+ *
15
+ * Khoá có số chèn vào là HÀM: nối chuỗi ở phía app là cách chắc chắn sai trật tự từ ở ngôn ngữ khác.
16
+ */
17
+ interface ActionBarLabels {
18
+ /** `aria-label` của thanh (`role="toolbar"`) — prop `aria-label` của `ActionBar` vẫn thắng. */
19
+ toolbar: string;
20
+ /** Dòng đếm `ActionBarSelection` hiện khi có prop `count`: "Đã chọn 3". */
21
+ selected: (count: number) => string;
22
+ /**
23
+ * Tên cho trình đọc màn hình của `ActionBarClose` — nút chỉ có icon X. Đóng thanh ở khuôn dùng
24
+ * chuẩn là BỎ CHỌN (app xoá vùng chọn trong `onOpenChange(false)`), nên tên nói đúng việc đó.
25
+ */
26
+ close: string;
27
+ }
28
+ /** Nhãn tiếng Việt mặc định — mọi khoá đều override được qua prop `labels`. */
29
+ declare const DEFAULT_ACTION_BAR_LABELS: ActionBarLabels;
30
+
31
+ export { type ActionBarLabels, DEFAULT_ACTION_BAR_LABELS };
@@ -0,0 +1,9 @@
1
+ const DEFAULT_ACTION_BAR_LABELS = {
2
+ toolbar: "Thao t\xE1c h\xE0ng lo\u1EA1t",
3
+ selected: (count) => `\u0110\xE3 ch\u1ECDn ${count}`,
4
+ close: "B\u1ECF ch\u1ECDn"
5
+ };
6
+ export {
7
+ DEFAULT_ACTION_BAR_LABELS
8
+ };
9
+ //# sourceMappingURL=action-bar-constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ui/action-bar-constants.ts"],"sourcesContent":["/**\n * Nhãn mặc định của `ActionBar`.\n *\n * Module **CỐ Ý không có `\"use client\"`** — xem `src/chart/chart-colors.ts` để biết lý do đầy đủ:\n * mọi export của một file `\"use client\"` đến tay Server Component dưới dạng client-reference\n * proxy, đọc ra `undefined` mà KHÔNG throw, KHÔNG warning.\n *\n * ⚠ Barrel `src/index.ts` xuất module này TRỰC TIẾP. `action-bar.tsx` chỉ được `import`, KHÔNG\n * được `export` lại (re-export qua file client là vô hiệu, và đụng tên với `export *`).\n */\n\n/**\n * Toàn bộ chuỗi hiển thị và chuỗi a11y của `ActionBar` — truyền một phần qua prop `labels` của\n * `ActionBar`, phần còn lại lấy từ `DEFAULT_ACTION_BAR_LABELS`.\n *\n * Khoá có số chèn vào là HÀM: nối chuỗi ở phía app là cách chắc chắn sai trật tự từ ở ngôn ngữ khác.\n */\nexport interface ActionBarLabels {\n /** `aria-label` của thanh (`role=\"toolbar\"`) — prop `aria-label` của `ActionBar` vẫn thắng. */\n toolbar: string;\n /** Dòng đếm `ActionBarSelection` hiện khi có prop `count`: \"Đã chọn 3\". */\n selected: (count: number) => string;\n /**\n * Tên cho trình đọc màn hình của `ActionBarClose` — nút chỉ có icon X. Đóng thanh ở khuôn dùng\n * chuẩn là BỎ CHỌN (app xoá vùng chọn trong `onOpenChange(false)`), nên tên nói đúng việc đó.\n */\n close: string;\n}\n\n/** Nhãn tiếng Việt mặc định — mọi khoá đều override được qua prop `labels`. */\nexport const DEFAULT_ACTION_BAR_LABELS: ActionBarLabels = {\n toolbar: \"Thao tác hàng loạt\",\n selected: (count) => `Đã chọn ${count}`,\n close: \"Bỏ chọn\"\n};\n"],"mappings":"AA8BO,MAAM,4BAA6C;AAAA,EACxD,SAAS;AAAA,EACT,UAAU,CAAC,UAAU,wBAAW,KAAK;AAAA,EACrC,OAAO;AACT;","names":[]}
@@ -0,0 +1,67 @@
1
+ import * as React from 'react';
2
+ import { ActionBarLabels } from './action-bar-constants.js';
3
+ import { Button } from './button.js';
4
+ import 'class-variance-authority/types';
5
+ import 'class-variance-authority';
6
+
7
+ type Direction = "ltr" | "rtl";
8
+ type Orientation = "horizontal" | "vertical";
9
+ interface DivProps extends React.ComponentProps<"div"> {
10
+ asChild?: boolean;
11
+ }
12
+ interface ActionBarProps extends DivProps {
13
+ open?: boolean;
14
+ onOpenChange?: (open: boolean) => void;
15
+ onEscapeKeyDown?: (event: KeyboardEvent) => void;
16
+ align?: "start" | "center" | "end";
17
+ alignOffset?: number;
18
+ side?: "top" | "bottom";
19
+ sideOffset?: number;
20
+ portalContainer?: Element | DocumentFragment | null;
21
+ dir?: Direction;
22
+ orientation?: Orientation;
23
+ loop?: boolean;
24
+ /**
25
+ * Chuỗi hiển thị và chuỗi a11y (tên thanh, dòng "Đã chọn N", tên nút đóng) — mặc định
26
+ * `DEFAULT_ACTION_BAR_LABELS` (tiếng Việt); truyền một phần là đủ.
27
+ *
28
+ * ⚠ Thêm so với thượng nguồn: bản gốc không có chuỗi nào — thanh `role="toolbar"` không tên và
29
+ * nút đóng chỉ chứa `<X />` là một nút KHÔNG TÊN với trình đọc màn hình.
30
+ */
31
+ labels?: Partial<ActionBarLabels>;
32
+ }
33
+ declare function ActionBar(props: ActionBarProps): React.JSX.Element | null;
34
+ interface ActionBarSelectionProps extends DivProps {
35
+ /**
36
+ * Số mục đang chọn. Có giá trị thì phần tử tự in `labels.selected(count)` ("Đã chọn 3") TRƯỚC
37
+ * `children` — nên `children` chỉ còn là dấu ngăn + nút đóng.
38
+ *
39
+ * ⚠ Thêm so với thượng nguồn: bản gốc để app tự viết chữ ("{n} selected"), tức chuỗi hiển thị
40
+ * không đi qua `labels`. Bỏ qua khi `asChild` (Slot chỉ nhận đúng MỘT phần tử con).
41
+ */
42
+ count?: number;
43
+ }
44
+ declare function ActionBarSelection(props: ActionBarSelectionProps): React.JSX.Element;
45
+ declare function ActionBarGroup(props: DivProps): React.JSX.Element;
46
+ interface ActionBarItemProps extends Omit<React.ComponentProps<typeof Button>, "onSelect"> {
47
+ onSelect?: (event: Event) => void;
48
+ }
49
+ declare function ActionBarItem(props: ActionBarItemProps): React.JSX.Element;
50
+ interface ActionBarCloseProps extends React.ComponentProps<"button"> {
51
+ asChild?: boolean;
52
+ }
53
+ /**
54
+ * Nút đóng thanh (thường là "bỏ chọn"). Không truyền `children` thì vẽ icon X.
55
+ *
56
+ * ⚠ Khác thượng nguồn: có tên cho trình đọc màn hình — `aria-label` mặc định `labels.close`
57
+ * ("Bỏ chọn"). Bản gốc chỉ render `children`, và khuôn dùng của chính thượng nguồn là
58
+ * `<ActionBarClose><X /></ActionBarClose>`: một nút KHÔNG TÊN. Nếu `children` là CHỮ nhìn thấy
59
+ * được thì truyền `aria-label` trùng với chữ đó (WCAG 2.5.3), hoặc `aria-label={undefined}`.
60
+ */
61
+ declare function ActionBarClose(props: ActionBarCloseProps): React.JSX.Element;
62
+ interface ActionBarSeparatorProps extends DivProps {
63
+ orientation?: Orientation;
64
+ }
65
+ declare function ActionBarSeparator(props: ActionBarSeparatorProps): React.JSX.Element;
66
+
67
+ export { ActionBar, ActionBarClose, type ActionBarCloseProps, ActionBarGroup, ActionBarItem, type ActionBarItemProps, type ActionBarProps, ActionBarSelection, type ActionBarSelectionProps, ActionBarSeparator, type ActionBarSeparatorProps };