@bug-on/md3-react 0.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.
- package/README.md +215 -0
- package/dist/assets/fonts/GoogleSansFlex-VariableFont.woff2 +0 -0
- package/dist/assets/fonts/MaterialSymbolsOutlined-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
- package/dist/assets/fonts/MaterialSymbolsRounded-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
- package/dist/assets/fonts/MaterialSymbolsSharp-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
- package/dist/assets/loading-indicator.svg +19 -0
- package/dist/assets/material-symbols-cdn.css +65 -0
- package/dist/assets/material-symbols-self-hosted.css +109 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/useMediaQuery.d.ts +11 -0
- package/dist/hooks/useRipple.d.ts +26 -0
- package/dist/index.d.ts +65 -0
- package/dist/index.js +9059 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +8929 -0
- package/dist/index.mjs.map +1 -0
- package/dist/lib/material-symbols-preconnect.d.ts +42 -0
- package/dist/lib/theme-utils.d.ts +63 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/material-symbols-cdn.css +65 -0
- package/dist/material-symbols-self-hosted.css +109 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/md3.d.ts +14 -0
- package/dist/typography.css +22 -0
- package/dist/ui/badge.d.ts +125 -0
- package/dist/ui/button-group.d.ts +59 -0
- package/dist/ui/button.d.ts +148 -0
- package/dist/ui/card.d.ts +62 -0
- package/dist/ui/checkbox.d.ts +82 -0
- package/dist/ui/chip.d.ts +110 -0
- package/dist/ui/code-block.d.ts +14 -0
- package/dist/ui/dialog.d.ts +111 -0
- package/dist/ui/divider.d.ts +164 -0
- package/dist/ui/drawer.d.ts +39 -0
- package/dist/ui/dropdown.d.ts +29 -0
- package/dist/ui/fab-menu.d.ts +204 -0
- package/dist/ui/fab.d.ts +162 -0
- package/dist/ui/icon-button.d.ts +131 -0
- package/dist/ui/icon.d.ts +88 -0
- package/dist/ui/loading-indicator.d.ts +42 -0
- package/dist/ui/navigation-rail.d.ts +29 -0
- package/dist/ui/progress-indicator/circular.d.ts +3 -0
- package/dist/ui/progress-indicator/hooks.d.ts +3 -0
- package/dist/ui/progress-indicator/index.d.ts +21 -0
- package/dist/ui/progress-indicator/linear-flat.d.ts +10 -0
- package/dist/ui/progress-indicator/linear-wavy.d.ts +18 -0
- package/dist/ui/progress-indicator/linear.d.ts +3 -0
- package/dist/ui/progress-indicator/types.d.ts +151 -0
- package/dist/ui/progress-indicator/utils.d.ts +3 -0
- package/dist/ui/radio-button.d.ts +106 -0
- package/dist/ui/ripple.d.ts +126 -0
- package/dist/ui/scroll-area.d.ts +27 -0
- package/dist/ui/shared/constants.d.ts +86 -0
- package/dist/ui/shared/touch-target.d.ts +38 -0
- package/dist/ui/snackbar/index.d.ts +6 -0
- package/dist/ui/snackbar/snackbar.d.ts +196 -0
- package/dist/ui/switch/index.d.ts +7 -0
- package/dist/ui/switch/switch.d.ts +30 -0
- package/dist/ui/switch/switch.stories.d.ts +48 -0
- package/dist/ui/switch/switch.tokens.d.ts +67 -0
- package/dist/ui/switch/switch.types.d.ts +59 -0
- package/dist/ui/tabs/index.d.ts +10 -0
- package/dist/ui/tabs/tab.d.ts +43 -0
- package/dist/ui/tabs/tabs-content.d.ts +36 -0
- package/dist/ui/tabs/tabs-list.d.ts +40 -0
- package/dist/ui/tabs/tabs.d.ts +60 -0
- package/dist/ui/tabs/tabs.tokens.d.ts +94 -0
- package/dist/ui/tabs/tabs.types.d.ts +172 -0
- package/dist/ui/text-field/index.d.ts +11 -0
- package/dist/ui/text-field/subcomponents/active-indicator.d.ts +24 -0
- package/dist/ui/text-field/subcomponents/floating-label.d.ts +43 -0
- package/dist/ui/text-field/subcomponents/leading-icon.d.ts +23 -0
- package/dist/ui/text-field/subcomponents/outline-container.d.ts +42 -0
- package/dist/ui/text-field/subcomponents/prefix-suffix.d.ts +24 -0
- package/dist/ui/text-field/subcomponents/supporting-text.d.ts +37 -0
- package/dist/ui/text-field/subcomponents/trailing-icon.d.ts +41 -0
- package/dist/ui/text-field/text-field.d.ts +49 -0
- package/dist/ui/text-field/text-field.tokens.d.ts +76 -0
- package/dist/ui/text-field/text-field.types.d.ts +126 -0
- package/dist/ui/theme-provider/index.d.ts +18 -0
- package/dist/ui/toc.d.ts +74 -0
- package/dist/ui/tooltip/index.d.ts +8 -0
- package/dist/ui/tooltip/plain-tooltip.d.ts +2 -0
- package/dist/ui/tooltip/rich-tooltip.d.ts +2 -0
- package/dist/ui/tooltip/tooltip-box.d.ts +2 -0
- package/dist/ui/tooltip/tooltip-caret-shape.d.ts +9 -0
- package/dist/ui/tooltip/tooltip.tokens.d.ts +26 -0
- package/dist/ui/tooltip/tooltip.types.d.ts +56 -0
- package/dist/ui/tooltip/use-tooltip-position.d.ts +8 -0
- package/dist/ui/tooltip/use-tooltip-state.d.ts +2 -0
- package/dist/ui/typography/index.d.ts +16 -0
- package/dist/ui/typography/type-scale-tokens.d.ts +162 -0
- package/dist/ui/typography/typography-key-tokens.d.ts +40 -0
- package/dist/ui/typography/typography-tokens.d.ts +220 -0
- package/dist/ui/typography/typography.d.ts +265 -0
- package/package.json +80 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file fab-menu.tsx
|
|
3
|
+
*
|
|
4
|
+
* Component FAB Menu theo phong cách MD3 Expressive.
|
|
5
|
+
*
|
|
6
|
+
* Cung cấp một Floating Action Button (FAB) dạng toggle để mở một danh sách các hành động có hiệu ứng stagger (xếp tầng).
|
|
7
|
+
* Tuân thủ mô hình FloatingActionButtonMenu của MD3 với sự hỗ trợ tiếp cận (accessibility) đầy đủ
|
|
8
|
+
* (điều hướng bàn phím, quản lý focus, các vai trò ARIA).
|
|
9
|
+
*
|
|
10
|
+
* @see https://m3.material.io/components/floating-action-button/overview
|
|
11
|
+
*/
|
|
12
|
+
import * as React from "react";
|
|
13
|
+
/**
|
|
14
|
+
* Định dạng dữ liệu cho từng hành động (item) trong biểu mẫu menu của FAB.
|
|
15
|
+
*
|
|
16
|
+
* Nếu bỏ qua thuộc tính `label`, item sẽ render dạng ô vuông chỉ có icon.
|
|
17
|
+
*/
|
|
18
|
+
export interface FABMenuItemData {
|
|
19
|
+
/** Một ID duy nhất để dùng cho key react và quản lý focus. */
|
|
20
|
+
id: string;
|
|
21
|
+
/** Label hiển thị cạnh icon (tuỳ chọn). Không thêm thuộc tính này nếu muốn hiển thị chỉ có icon (icon-only). */
|
|
22
|
+
label?: string;
|
|
23
|
+
/** Node của Icon — thường là một component SVG Icon duy nhất. */
|
|
24
|
+
icon: React.ReactNode;
|
|
25
|
+
/** Gọi hàm ngay lập tức khi item được kích hoạt (click hoặc nhấn Enter/Phím cách). */
|
|
26
|
+
onClick: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* Khi `true`, vô hiệu hoá item về mặt hình thức lẫn tương tác rẽ nhánh.
|
|
29
|
+
* Vẫn dùng `aria-disabled` thay vì HTML `disabled` nhằm giữ nó lấy được focus phục vụ cho accessibility.
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
/** Thêm CSS classes bổ sung dùng cho wrapper chính của item. */
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Các props điều khiển Component chính `FABMenu`.
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* FABMenu quản lý vòng đời trạng thái mở/đóng menu (open/close), quản lý focus, điều khiển phím,
|
|
41
|
+
* và điều hướng hiệu ứng chuyển động. Trạng thái `expanded` được truyền từ ngoài (controlled state),
|
|
42
|
+
* do đó bạn có thể quản lý qua react state, hoặc dùng router hay business logic khác.
|
|
43
|
+
*/
|
|
44
|
+
export interface FABMenuProps {
|
|
45
|
+
/** FAB Menu có đang mở (mở rộng)/hiển thị hay không. */
|
|
46
|
+
expanded: boolean;
|
|
47
|
+
/** Hàm handler kích hoạt khi Toggle FAB được người dùng tương tác, hoặc khi dismiss backdrop. */
|
|
48
|
+
onToggle: (expanded: boolean) => void;
|
|
49
|
+
/** Danh sách các action items (Spec MD3 đề nghị 2-6 item là hoàn hảo). */
|
|
50
|
+
items: FABMenuItemData[];
|
|
51
|
+
/**
|
|
52
|
+
* Vai trò màu (color role container) MD3 cho cái nút FAB lẫn các menu items.
|
|
53
|
+
* @default "primary"
|
|
54
|
+
*/
|
|
55
|
+
colorVariant?: "primary" | "secondary" | "tertiary";
|
|
56
|
+
/**
|
|
57
|
+
* Kích cỡ khởi tạo cho cái ToggleFAB (FAB biến hình thành cục đóng dấu X khi nó expanded).
|
|
58
|
+
* @default "baseline"
|
|
59
|
+
*/
|
|
60
|
+
fabSize?: "baseline" | "medium" | "large";
|
|
61
|
+
/**
|
|
62
|
+
* Căn lề của danh sách menu items tương quan với cái Toggle FAB.
|
|
63
|
+
* - `"end"`: Các items dồn hết theo lề phía tay phải (trailing edge, default cực hữu hiệu đối với RTL design).
|
|
64
|
+
* - `"start"`: Các items dồn hết dọc theo lề trái.
|
|
65
|
+
* - `"center"`: Các item sẽ được căn ra giữa chiều dọc, căn giữa tâm khối với cái FAB.
|
|
66
|
+
* @default "end"
|
|
67
|
+
*/
|
|
68
|
+
alignment?: "start" | "end" | "center";
|
|
69
|
+
/** Thuộc tính cho CSS component root để đè. */
|
|
70
|
+
className?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Nếu `true`, khi menu đang hiện ra, click chuột ra phía sau (màn xám mờ backdrop) để đóng menu.
|
|
73
|
+
* @default true
|
|
74
|
+
*/
|
|
75
|
+
closeOnBackdropClick?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Nếu `true`, focus sẽ tự động chạy xuống item CUỐI (sát bên trên cái nút FAB) khi menu vừa loé mờ ra.
|
|
78
|
+
* Nếu `false`, focus sẽ bay lên item ĐẦU TIÊN của danh sách (cao nhất trên màn hình).
|
|
79
|
+
* @default true
|
|
80
|
+
*/
|
|
81
|
+
focusLast?: boolean;
|
|
82
|
+
/** Bắt buộc truyền `aria-label` cho ToggleFAB để đáp ứng Accessibility. */
|
|
83
|
+
"aria-label"?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Props thuộc component `ToggleFAB` đứng độc lập.
|
|
87
|
+
*/
|
|
88
|
+
export interface ToggleFABProps {
|
|
89
|
+
/** Nút có đang trong trạng thái được kích hoạt check (expanded). */
|
|
90
|
+
expanded: boolean;
|
|
91
|
+
/** Gọi khi xảy ra sự kiện Toggle nút. */
|
|
92
|
+
onToggle: (expanded: boolean) => void;
|
|
93
|
+
/**
|
|
94
|
+
* Function sinh Icon - nhận về tiến độ `progress` trong khoảng `0` -> `1` (Từ Chưa Expanded -> Đã Expanded)
|
|
95
|
+
* Dùng cho các hiệu ứng morphing Icon khi animtion render (VD: Từ Cộng thành Đóng).
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```tsx
|
|
99
|
+
* icon={(progress) => progress > 0.5 ? <Icon name="close" /> : <Icon name="add" />}
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
icon: (progress: number) => React.ReactNode;
|
|
103
|
+
/** Vai trò màu container chuẩn MD3. @default "primary" */
|
|
104
|
+
colorVariant?: "primary" | "secondary" | "tertiary";
|
|
105
|
+
/** Kích thước của cục FAB ban đầu (Sau khi nhấn sẽ thu tròn). @default "baseline" */
|
|
106
|
+
fabSize?: "baseline" | "medium" | "large";
|
|
107
|
+
/** CSS Class linh tinh bổ sung thêm. */
|
|
108
|
+
className?: string;
|
|
109
|
+
/** Thuộc tính đọc thẻ accessibility. Bắt buộc có. */
|
|
110
|
+
"aria-label"?: string;
|
|
111
|
+
/** Kiểm soát giá trị của ID để link với menu qua aria-controls. */
|
|
112
|
+
"aria-controls"?: string;
|
|
113
|
+
/** Trỏ id component. */
|
|
114
|
+
id?: string;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Props thuộc component một món item đơn lẻ `FABMenuItem`.
|
|
118
|
+
*/
|
|
119
|
+
export interface FABMenuItemProps {
|
|
120
|
+
/** Node của icon hiện. */
|
|
121
|
+
icon: React.ReactNode;
|
|
122
|
+
/** Tên nhãn mô tả kế bên icon cho item này. Hoặc ẩn nó đi nếu không mong đợi. */
|
|
123
|
+
label?: string;
|
|
124
|
+
/** Hàm bắn ra khi item được kích. */
|
|
125
|
+
onClick: () => void;
|
|
126
|
+
/** Vô hiệu hóa hành vi tương tác item mà vẫn cho phép bàn phím tab bấm dính lấy focus. @default false */
|
|
127
|
+
disabled?: boolean;
|
|
128
|
+
/** Container tông màu. @default "primary" */
|
|
129
|
+
colorVariant?: "primary" | "secondary" | "tertiary";
|
|
130
|
+
/** Custom CSS className. */
|
|
131
|
+
className?: string;
|
|
132
|
+
/** Số index liệt kê trong mảng dùng tính render delay (Dành cho animation cấu trúc `custom`). */
|
|
133
|
+
index?: number;
|
|
134
|
+
/** Tổng danh sách items có mảng. */
|
|
135
|
+
totalItems?: number;
|
|
136
|
+
/** Giá trị logic `tabIndex` dùng điều khiển thao tác phím Tab thủ công. */
|
|
137
|
+
tabIndex?: number;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Nút Toggle FAB (Biến hình) có thể được dùng độc lập đứng một mình (standalone) hoặc kết nối để kích hoạt mở cả nùi Menu ở dưới con `FABMenu`.
|
|
141
|
+
*
|
|
142
|
+
* Sức ép hiệu ứng kích thước khung nền sẽ chuyển từ vuôn/vát cạnh sang hình tròn hẵn (square → circle), chuyển biến cả màu sắc
|
|
143
|
+
* khi mà cờ `expanded` chuyển tiếp từ false sang → true.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```tsx
|
|
147
|
+
* const [open, setOpen] = React.useState(false);
|
|
148
|
+
* <ToggleFAB
|
|
149
|
+
* expanded={open}
|
|
150
|
+
* onToggle={setOpen}
|
|
151
|
+
* colorVariant="primary"
|
|
152
|
+
* aria-label="Toggle actions"
|
|
153
|
+
* icon={(progress) => progress > 0.5 ? <Icon name="close" /> : <Icon name="add" />}
|
|
154
|
+
* />
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
export declare const ToggleFAB: React.NamedExoticComponent<ToggleFABProps & React.RefAttributes<HTMLButtonElement>>;
|
|
158
|
+
/**
|
|
159
|
+
* Một item thực hiện một loại hành động duy nhất trong `FABMenu`.
|
|
160
|
+
*
|
|
161
|
+
* Render hình dạng viên thuốc bao quanh icon cùng với label diễn giải.
|
|
162
|
+
* Khi `label` bỏ trống, nó sẽ render thành một cục thẻ gạch ốp màu vuông vức chứa chữ mỗi cái icon.
|
|
163
|
+
* Component chứa gợn sóng MD3 Ripple cùng 48dp chuẩn vùng target đụng diện chuẩn WCAG 2.5.5 cho cảm ứng.
|
|
164
|
+
*
|
|
165
|
+
* @remarks
|
|
166
|
+
* Những thành phần khi bị tắt (vô hiệu tương tác) thì chỉ được dùng role `aria-disabled="true"` ở lớp div bề mặt thay vì lấy
|
|
167
|
+
* thuộc tính gốc `disabled` của HTML. Nhờ đó, item tuy xám mờ không bấm được phím chuột vẫn sẽ có khả năng focus qua vòng đời tab phím bàn phím
|
|
168
|
+
* (quy chuẩn chặt chẽ của Material Design 3).
|
|
169
|
+
*/
|
|
170
|
+
export declare function FABMenuItem({ icon, label, onClick, disabled, colorVariant, className, tabIndex, }: FABMenuItemProps): import("react/jsx-runtime").JSX.Element;
|
|
171
|
+
/**
|
|
172
|
+
* MD3 Expressive FAB Menu.
|
|
173
|
+
*
|
|
174
|
+
* Bộ mở rộng Floating Action Button. Khi tương tác bật vào toggle-button (FAB con lai), sẽ trút ra mớ tác vụ menu ở xếp dọc (hoặc lan ra) từ trên đè ngược xuống trên nó.
|
|
175
|
+
*
|
|
176
|
+
* Accessibility thực thi chuẩn MD3 toàn phần:
|
|
177
|
+
* - thẻ `role="menu"` trang bị cho thẻ hộp div làm luống container
|
|
178
|
+
* - trang bị thẻ `role="menuitem"` trên mảng items thành phần con
|
|
179
|
+
* - Lifecycle Focus cho trải nghiệm hoàn mỹ: Mở phím bật -> Focus thẳng lên item cao/thấp đầu/cuối cùng menu; Đóng tắt menu -> Focus trả về ngược lại ToggleFAB
|
|
180
|
+
* - Tính năng Bàn Phím: Lách Escape nhấn tắt nhắm, Nhấn phím hướng lên-xuống(ArrowUp/Down) để di chuyển, Móc Tab(hoặc là Shift+Tab) nhảy lăng quăng qua các item.
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```tsx
|
|
184
|
+
* const [open, setOpen] = React.useState(false);
|
|
185
|
+
*
|
|
186
|
+
* const items = [
|
|
187
|
+
* { id: 'share', icon: <Icon name="share" />, label: 'Chia sẻ', onClick: () => console.log('Share') },
|
|
188
|
+
* { id: 'edit', icon: <Icon name="edit" />, label: 'Chỉnh sửa', onClick: () => console.log('Edit') },
|
|
189
|
+
* { id: 'delete', icon: <Icon name="delete" />, label: 'Xóa bớt', disabled: true, onClick: () => {} }
|
|
190
|
+
* ];
|
|
191
|
+
*
|
|
192
|
+
* <FABMenu
|
|
193
|
+
* expanded={open}
|
|
194
|
+
* onToggle={setOpen}
|
|
195
|
+
* aria-label="Các công cụ thao tác nhanh"
|
|
196
|
+
* alignment="center"
|
|
197
|
+
* colorVariant="tertiary"
|
|
198
|
+
* items={items}
|
|
199
|
+
* />
|
|
200
|
+
* ```
|
|
201
|
+
*
|
|
202
|
+
* @see https://m3.material.io/components/floating-action-button/overview
|
|
203
|
+
*/
|
|
204
|
+
export declare function FABMenu({ expanded, onToggle, items, colorVariant, fabSize, alignment, className, closeOnBackdropClick, focusLast, "aria-label": ariaLabel, }: FABMenuProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/ui/fab.d.ts
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file fab.tsx
|
|
3
|
+
*
|
|
4
|
+
* MD3 Expressive Floating Action Button (FAB).
|
|
5
|
+
*
|
|
6
|
+
* Supports four sizes, an extended variant with animated label reveal,
|
|
7
|
+
* shape morphing, a `lowered` elevation variant, and an optional
|
|
8
|
+
* `FABPosition` container for absolute positioning within a layout.
|
|
9
|
+
*
|
|
10
|
+
* @see https://m3.material.io/components/floating-action-button/overview
|
|
11
|
+
*/
|
|
12
|
+
import type { HTMLMotionProps } from "motion/react";
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
type MotionButtonProps = Omit<HTMLMotionProps<"button">, "children" | "color">;
|
|
15
|
+
/**
|
|
16
|
+
* Tham số Props dùng cho component thao tác nổi `FAB`.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* - Đảm bảo rằng đối với loại FAB chỉ show ra mỗi con Icon mà không có nhãn hiển thị (icon-only), bắt buộc phải có thuộc tính `aria-label` nhằm phục vụ (accessibility).
|
|
20
|
+
* - Ở hình thể mở rộng (khi `extended={true}`), phần nội dung truyền vào `children` chính là chuỗi Text được thể hiện cùng nút, và nó sẽ khiến nút button có label mặc định nên bạn có thể chém bớt tham số `aria-label`.
|
|
21
|
+
* - Thuộc tính cờ `lowered` (chìm) giúp giáng cấp hiệu ứng tạo bóng Shadow của thẻ, rải mảng cái shadow theo phong thái MD3 "lowered" FAB;
|
|
22
|
+
* sử dụng khi nút FAB này vốn bị bọc bên trong bề mặt chìm đè lên component gì khác mà vốn tụi nó đã nhún ở mực sâu (Ví dụ Bottom App Bar) để thiết lập Hierarchy hài hoà.
|
|
23
|
+
*
|
|
24
|
+
* @see https://m3.material.io/components/floating-action-button/overview
|
|
25
|
+
*/
|
|
26
|
+
export interface FABProps extends MotionButtonProps {
|
|
27
|
+
/**
|
|
28
|
+
* Icon đại diện render — thông thường là truyền thẻ component Icon.
|
|
29
|
+
* Sẽ được tráo đổi thành Spinner tự động quay khi giá trị `loading={true}`.
|
|
30
|
+
*/
|
|
31
|
+
icon: React.ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Kích thước hiển thị FAB. Tuân chuẩn.
|
|
34
|
+
* - `sm`: Small (40dp) — Được khuyên dùng cho các không gian kín/trong lòng Content.
|
|
35
|
+
* - `md`: Regular (56dp) — Action thứ yếu hoặc tiêu điểm màn hình. (Phần đông người dùng xài).
|
|
36
|
+
* - `lg`: Large (96dp) — Trọng tâm thao tác quan trọng lớn nhát.
|
|
37
|
+
* - `xl`: Extra-large (136dp) — Gây tiếng vang, dạng Spotlight cực bùng nổ của app.
|
|
38
|
+
* @default "md"
|
|
39
|
+
*/
|
|
40
|
+
size?: "sm" | "md" | "lg" | "xl";
|
|
41
|
+
/**
|
|
42
|
+
* Container vai trò hệ thống tông màu MD3 dùng phết nền.
|
|
43
|
+
* @default "primary"
|
|
44
|
+
*/
|
|
45
|
+
colorStyle?: "primary" | "secondary" | "tertiary" | "surface";
|
|
46
|
+
/**
|
|
47
|
+
* Kích hoạt khi giá trị được đổi là `true`, sẽ diễn tả Animation bung chữ kèm theo độ dãn hình dài cho cái FAB.
|
|
48
|
+
* Chiều rộng tự cơi nới để thích ứng chuỗi `children`.
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
51
|
+
extended?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Nơi đón lấy chữ được render cùng khi `extended={true}` bật lên.
|
|
54
|
+
* Khuyến nghị là Text string thuần.
|
|
55
|
+
*/
|
|
56
|
+
children?: React.ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* Nhấn `true`, thì rút lại shadow đi một cấp xuống độ nổi nông cạn.
|
|
59
|
+
* Mảng bám ở Bottom bar hay Top bar Surface để ránh rườm rà.
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
lowered?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Nhấp chuột sang `true`, đổi Icon thành cối xay Spinner chờ kết quả. Đồng loạt chặn click tương tác.
|
|
65
|
+
* @default false
|
|
66
|
+
*/
|
|
67
|
+
loading?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Có 2 chuẩn hình của Loading chờ.
|
|
70
|
+
* @default "loading-indicator"
|
|
71
|
+
*/
|
|
72
|
+
loadingVariant?: "loading-indicator" | "circular";
|
|
73
|
+
/**
|
|
74
|
+
* Hiện thẻ FAB lên layout không (Kiểm soát bằng motion scale Entrance/Exit).
|
|
75
|
+
* @default true
|
|
76
|
+
*/
|
|
77
|
+
visible?: boolean;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Interface cho component bọc thẻ `FABPosition` — Gắn lớp absolute position nhét cục FAB vào một góc cố định của góc nào đó tại trình duyệt/bề mặt render.
|
|
81
|
+
*
|
|
82
|
+
* @see {@link FABPosition}
|
|
83
|
+
*/
|
|
84
|
+
export interface FABPositionProps {
|
|
85
|
+
/**
|
|
86
|
+
* Góc để niêm chặt nút FAB.
|
|
87
|
+
* @default "bottom-right"
|
|
88
|
+
*/
|
|
89
|
+
position?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
90
|
+
/** Kẹp một nùi element. Mong chờ thả Node `<FAB>` vào đây.*/
|
|
91
|
+
children: React.ReactNode;
|
|
92
|
+
/** CSS Class hỗ trợ chỉnh override */
|
|
93
|
+
className?: string;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Element bao bọc thẻ định vị Absolute cho component `<FAB>`.
|
|
97
|
+
*
|
|
98
|
+
* Component dùng để cắm phao Neo cái FAB vào sát ở góc của screen kèm theo một cái offset space theo responsive an toàn mà lại trơn chu nhạy nhẽo.
|
|
99
|
+
* Nhưng có quy tắc gốc đó là phần tử bao bọc cha mẹ của nó PHẢI có thẻ tag css `position: relative` (hoặc ở cấp tổ tiêm của trang nào đó phải đẻ gốc rễ ra posisition).
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```tsx
|
|
103
|
+
* <div className="relative min-h-screen">
|
|
104
|
+
* // Cái nút sẽ xà xuống dưới cùng bên lề Trái
|
|
105
|
+
* <FABPosition position="bottom-left">
|
|
106
|
+
* <FAB icon={<Icon name="edit" />} aria-label="Compose New Mail" />
|
|
107
|
+
* </FABPosition>
|
|
108
|
+
* </div>
|
|
109
|
+
* ```
|
|
110
|
+
*
|
|
111
|
+
* @see {@link FAB}
|
|
112
|
+
* @see https://m3.material.io/components/floating-action-button/guidelines
|
|
113
|
+
*/
|
|
114
|
+
export declare function FABPosition({ position, children, className, }: FABPositionProps): import("react/jsx-runtime").JSX.Element;
|
|
115
|
+
/**
|
|
116
|
+
* Action nổi chính theo phong cách MD3 Expressive Floating Action Button (FAB).
|
|
117
|
+
*
|
|
118
|
+
* Phơi nhiễm các action tạo nhịp điệu kích hoạt cho người sử dụng với đủ bộ trang hoàn trọn kích thước Size (SM->XL),
|
|
119
|
+
* mang nhiều màu sắc Color role khác biệt, cung cấp một sức nén cho Label để kéo toẹt cái ống dài ra (gọi là Dạng Mở Rộng - Extended) tạo nên hành động sinh động,
|
|
120
|
+
* Trạng thái load/nhấp hiện xuất cùng animation thu scale thoát cảnh bắt mắt đầy nghệ thuật.
|
|
121
|
+
*
|
|
122
|
+
* @remarks
|
|
123
|
+
* - Chỉ định bắt buộc `aria-label` cho những mẫu icon bị đơn côi trơ trọi (icon-only FABs).
|
|
124
|
+
* - Trường hợp xài mode Mở Rộng qua việc truyền hàm `extended={true}`, nút FAB này tự ngộ nhận thân thế, lấy `children` dùng làm Aria label luôn hễ như `children` đó đang chứa text string.
|
|
125
|
+
* Khi ấy bạn tha hồ cắt bỏ thuộc tính `aria-label` ra.
|
|
126
|
+
* - Lúc cho biến mất (`visible={false}`), bộ nút tung chiêu lùi về sau làm quả rút bóng thoát Scale-out qua effect spring uyển chuyển.
|
|
127
|
+
* - Sài kèm `FABPosition` bao đùm nó lại nếu bạn muốn xích nó cố định ngấm chân sâu góc màn hình hiển thị.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```tsx
|
|
131
|
+
* // FAB cơ bản, nhỏ xinh, chỉ hiện icon.
|
|
132
|
+
* <FAB icon={<Icon name="search" />} aria-label="Nhấn tìm kiếm" size="sm" />
|
|
133
|
+
*
|
|
134
|
+
* // Dịch sang dòng Extended có dòng caption chữ dài thòn
|
|
135
|
+
* const [isOpen, setOpen] = React.useState(false);
|
|
136
|
+
* <FAB
|
|
137
|
+
* icon={<Icon name="edit" />}
|
|
138
|
+
* extended={isOpen}
|
|
139
|
+
* onClick={() => setOpen(!isOpen)}
|
|
140
|
+
* >
|
|
141
|
+
* Viết tâm thư
|
|
142
|
+
* </FAB>
|
|
143
|
+
*
|
|
144
|
+
* // FAB to lớn nhất dùng trạng thái chờ load Submit lên Server
|
|
145
|
+
* <FAB
|
|
146
|
+
* icon={<Icon name="upload" />}
|
|
147
|
+
* size="lg"
|
|
148
|
+
* loading={isUploading}
|
|
149
|
+
* colorStyle="secondary"
|
|
150
|
+
* aria-label="Upload Files lên mây xanh"
|
|
151
|
+
* />
|
|
152
|
+
*
|
|
153
|
+
* // Cố định dưới chân tay phải
|
|
154
|
+
* <FABPosition position="bottom-right">
|
|
155
|
+
* <FAB icon={<Icon name="add" />} aria-label="Dấu Cộng sinh nảy" />
|
|
156
|
+
* </FABPosition>
|
|
157
|
+
* ```
|
|
158
|
+
*
|
|
159
|
+
* @see https://m3.material.io/components/floating-action-button/overview
|
|
160
|
+
*/
|
|
161
|
+
export declare const FAB: React.NamedExoticComponent<Omit<FABProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
162
|
+
export {};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file icon-button.tsx
|
|
3
|
+
*
|
|
4
|
+
* MD3 Expressive Icon Button component.
|
|
5
|
+
*
|
|
6
|
+
* An icon-only button with shape morphing, ripple effect, loading state,
|
|
7
|
+
* and toggle variant. Requires `aria-label` for accessibility since there
|
|
8
|
+
* is no visible text label.
|
|
9
|
+
*
|
|
10
|
+
* @see https://m3.material.io/components/icon-buttons/overview
|
|
11
|
+
*/
|
|
12
|
+
import type { HTMLMotionProps } from "motion/react";
|
|
13
|
+
import * as React from "react";
|
|
14
|
+
type MotionButtonProps = Omit<HTMLMotionProps<"button">, "children" | "color">;
|
|
15
|
+
/**
|
|
16
|
+
* Base props for the Icon Button component.
|
|
17
|
+
*
|
|
18
|
+
* @see {@link IconButtonProps} for the full discriminated union.
|
|
19
|
+
* @see https://m3.material.io/components/icon-buttons/overview
|
|
20
|
+
*/
|
|
21
|
+
export interface BaseIconButtonProps extends MotionButtonProps {
|
|
22
|
+
/**
|
|
23
|
+
* Visual color style following MD3 color roles.
|
|
24
|
+
* @default "standard"
|
|
25
|
+
*/
|
|
26
|
+
colorStyle?: "standard" | "filled" | "tonal" | "outlined";
|
|
27
|
+
/**
|
|
28
|
+
* Button container size.
|
|
29
|
+
* Sizes: XS=32dp, SM=40dp, MD=56dp, LG=96dp, XL=136dp.
|
|
30
|
+
* @default "sm"
|
|
31
|
+
*/
|
|
32
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
33
|
+
/**
|
|
34
|
+
* Container shape controlling border-radius morphing.
|
|
35
|
+
* - `round`: fully circular (CornerFull).
|
|
36
|
+
* - `square`: rounded square (CornerMedium–CornerExtraLarge per size).
|
|
37
|
+
* @default "round"
|
|
38
|
+
*/
|
|
39
|
+
shape?: "round" | "square";
|
|
40
|
+
/**
|
|
41
|
+
* When `true`, replaces the icon with an animated loading indicator.
|
|
42
|
+
* Interaction is blocked and `aria-busy` is set.
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
loading?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Spinner style shown while `loading={true}`.
|
|
48
|
+
* @default "loading-indicator"
|
|
49
|
+
*/
|
|
50
|
+
loadingVariant?: "loading-indicator" | "circular";
|
|
51
|
+
/** Icon content — typically a single SVG icon component. */
|
|
52
|
+
children: React.ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* Accessible label — **REQUIRED** because icon buttons have no visible text.
|
|
55
|
+
*
|
|
56
|
+
* @example "Close", "Add to favourites", "Toggle dark mode"
|
|
57
|
+
* @see https://m3.material.io/components/icon-buttons/accessibility
|
|
58
|
+
*/
|
|
59
|
+
"aria-label": string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Complete `IconButton` props — discriminated union that enforces
|
|
63
|
+
* `selected` is only valid with `variant="toggle"`.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```tsx
|
|
67
|
+
* // Standard
|
|
68
|
+
* <IconButton aria-label="Close" onClick={handleClose}>
|
|
69
|
+
* <XIcon />
|
|
70
|
+
* </IconButton>
|
|
71
|
+
*
|
|
72
|
+
* // Toggle
|
|
73
|
+
* <IconButton
|
|
74
|
+
* variant="toggle"
|
|
75
|
+
* selected={isLiked}
|
|
76
|
+
* aria-label={isLiked ? "Unlike" : "Like"}
|
|
77
|
+
* colorStyle="filled"
|
|
78
|
+
* onClick={() => setIsLiked(!isLiked)}
|
|
79
|
+
* >
|
|
80
|
+
* <HeartIcon />
|
|
81
|
+
* </IconButton>
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
* @see https://m3.material.io/components/icon-buttons/overview
|
|
85
|
+
*/
|
|
86
|
+
export type IconButtonProps = BaseIconButtonProps & ({
|
|
87
|
+
variant?: "default";
|
|
88
|
+
selected?: never;
|
|
89
|
+
} | {
|
|
90
|
+
variant: "toggle";
|
|
91
|
+
selected: boolean;
|
|
92
|
+
});
|
|
93
|
+
/**
|
|
94
|
+
* MD3 Expressive Icon Button.
|
|
95
|
+
*
|
|
96
|
+
* An icon-only button with spring shape morphing, ripple effect, loading state support,
|
|
97
|
+
* and an optional toggle variant. Compliant with MD3 Expressive sizing and WCAG 2.5.5
|
|
98
|
+
* (touch target minimum for XS and SM sizes).
|
|
99
|
+
*
|
|
100
|
+
* @remarks
|
|
101
|
+
* - `aria-label` is **required** — icon buttons have no visible text label.
|
|
102
|
+
* - `variant="toggle"` requires `selected: boolean`.
|
|
103
|
+
* - Touch target is automatically extended to 48dp for `xs` and `sm` sizes.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```tsx
|
|
107
|
+
* <IconButton aria-label="Close" onClick={handleClose}>
|
|
108
|
+
* <XIcon />
|
|
109
|
+
* </IconButton>
|
|
110
|
+
*
|
|
111
|
+
* <IconButton
|
|
112
|
+
* variant="toggle"
|
|
113
|
+
* selected={isBookmarked}
|
|
114
|
+
* aria-label={isBookmarked ? "Remove bookmark" : "Bookmark"}
|
|
115
|
+
* colorStyle="filled"
|
|
116
|
+
* onClick={toggleBookmark}
|
|
117
|
+
* >
|
|
118
|
+
* <BookmarkIcon />
|
|
119
|
+
* </IconButton>
|
|
120
|
+
* ```
|
|
121
|
+
*
|
|
122
|
+
* @see https://m3.material.io/components/icon-buttons/overview
|
|
123
|
+
*/
|
|
124
|
+
export declare const IconButton: React.NamedExoticComponent<(Omit<BaseIconButtonProps & {
|
|
125
|
+
variant?: "default";
|
|
126
|
+
selected?: never;
|
|
127
|
+
}, "ref"> | Omit<BaseIconButtonProps & {
|
|
128
|
+
variant: "toggle";
|
|
129
|
+
selected: boolean;
|
|
130
|
+
}, "ref">) & React.RefAttributes<HTMLButtonElement>>;
|
|
131
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Props cho component {@link Icon}.
|
|
4
|
+
*
|
|
5
|
+
* Tất cả các trục biến thiên (variable font axes) được map trực tiếp sang `font-variation-settings`.
|
|
6
|
+
*/
|
|
7
|
+
export interface IconProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
8
|
+
/**
|
|
9
|
+
* Tên của Material Symbol theo định dạng snake_case.
|
|
10
|
+
* @example "home", "arrow_forward", "settings"
|
|
11
|
+
* @see https://fonts.google.com/icons
|
|
12
|
+
*/
|
|
13
|
+
name: string;
|
|
14
|
+
/**
|
|
15
|
+
* Kiểu hình học (Geometric style variant) — tương ứng với font family được tải.
|
|
16
|
+
* @default "outlined"
|
|
17
|
+
*/
|
|
18
|
+
variant?: "outlined" | "rounded" | "sharp";
|
|
19
|
+
/**
|
|
20
|
+
* Trục FILL. `0` = outlined (viền), `1` = filled (tràn màu).
|
|
21
|
+
* Có hiệu ứng spring khi `animateFill` là true.
|
|
22
|
+
* @default 0
|
|
23
|
+
*/
|
|
24
|
+
fill?: 0 | 1;
|
|
25
|
+
/**
|
|
26
|
+
* Trục wght — độ dày của nét (stroke weight). Nên khớp với độ dày text xung quanh.
|
|
27
|
+
* @default 400
|
|
28
|
+
*/
|
|
29
|
+
weight?: 100 | 200 | 300 | 400 | 500 | 600 | 700;
|
|
30
|
+
/**
|
|
31
|
+
* Trục GRAD — tinh chỉnh độ dày thị giác mà không ảnh hưởng tới layout.
|
|
32
|
+
* Dùng mức `-25` trên nền tối để bù trừ hiệu ứng phát sáng (halation).
|
|
33
|
+
* @default 0
|
|
34
|
+
*/
|
|
35
|
+
grade?: -50 | -25 | 0 | 100 | 200;
|
|
36
|
+
/**
|
|
37
|
+
* Trục opsz — kích thước quang học (optical size) tính bằng dp. Dùng để thiết lập `font-size` nếu không truyền `size`.
|
|
38
|
+
* Hãy để giá trị khớp với pixel sẽ render ra để thấy chất lượng tốt nhất.
|
|
39
|
+
* @default 24
|
|
40
|
+
*/
|
|
41
|
+
opticalSize?: 20 | 24 | 40 | 48;
|
|
42
|
+
/**
|
|
43
|
+
* Ghi đè trực tiếp `font-size` bằng px. Trục `opsz` vẫn sẽ tuân theo thuộc tính `opticalSize`.
|
|
44
|
+
* @example size={18} opticalSize={20}
|
|
45
|
+
*/
|
|
46
|
+
size?: number | "inherit";
|
|
47
|
+
/**
|
|
48
|
+
* Kích hoạt hiệu ứng spring mượt mà khi chuyển đổi giá trị FILL (sử dụng cấu hình `SPRING_TRANSITION_FAST`).
|
|
49
|
+
* Yêu cầu dependency `motion/react`.
|
|
50
|
+
* @default false
|
|
51
|
+
* @example <Icon name="favorite" fill={isLiked ? 1 : 0} animateFill />
|
|
52
|
+
*/
|
|
53
|
+
animateFill?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Component hiển thị Icon bằng Material Symbols (variable font).
|
|
57
|
+
*
|
|
58
|
+
* Hãy đảm bảo đã import CSS chứa font trước khi dùng:
|
|
59
|
+
* ```ts
|
|
60
|
+
* import '@bug-on/md3-react/material-symbols.css';
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @remarks
|
|
64
|
+
* - Đặt tên icon dùng snake_case: `"arrow_forward"`, KHÔNG PHẢI `"ArrowForward"`.
|
|
65
|
+
* - Thuộc tính `aria-hidden="true"` được tự động thêm vào — bạn cần thêm label đọc bằng giọng nói (accessible labels) ở phần tử cha.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```tsx
|
|
69
|
+
* // Icon cơ bản
|
|
70
|
+
* <Icon name="home" />
|
|
71
|
+
*
|
|
72
|
+
* // Tùy chỉnh trực quan (filled, nét dày)
|
|
73
|
+
* <Icon name="favorite" variant="rounded" fill={1} weight={300} />
|
|
74
|
+
*
|
|
75
|
+
* // Animate khi trạng thái thay đổi
|
|
76
|
+
* <Icon name="bookmark" fill={saved ? 1 : 0} animateFill />
|
|
77
|
+
*
|
|
78
|
+
* // Đổi kích thước icon cụ thể
|
|
79
|
+
* <Icon name="close" size={18} opticalSize={20} />
|
|
80
|
+
*
|
|
81
|
+
* // Kết hợp với các component khác
|
|
82
|
+
* <Button icon={<Icon name="add" />}>Thêm vào giỏ</Button>
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* @see https://fonts.google.com/icons
|
|
86
|
+
* @see https://m3.material.io/styles/icons/overview
|
|
87
|
+
*/
|
|
88
|
+
export declare const Icon: React.NamedExoticComponent<IconProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface LoadingIndicatorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
3
|
+
/**
|
|
4
|
+
* Visual style variant.
|
|
5
|
+
* - `uncontained` (default): bare indicator, no container background
|
|
6
|
+
* - `contained`: indicator inside a circular container
|
|
7
|
+
* (MD3 spec: 38dp container / 24dp active indicator)
|
|
8
|
+
*/
|
|
9
|
+
variant?: "uncontained" | "contained";
|
|
10
|
+
/**
|
|
11
|
+
* Indicator size in dp (pixels). Clamped to the MD3 spec range [24dp, 240dp].
|
|
12
|
+
* Defaults to 48dp.
|
|
13
|
+
*
|
|
14
|
+
* Size guidelines:
|
|
15
|
+
* - Small displays: 24–48dp
|
|
16
|
+
* - Medium displays: 48–80dp
|
|
17
|
+
* - Large/XL displays (desktop): up to 240dp
|
|
18
|
+
*
|
|
19
|
+
* @default 48
|
|
20
|
+
*/
|
|
21
|
+
size?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Determinate progress value between 0 and 1.
|
|
24
|
+
* - **Omit** (default) for indeterminate mode: continuous morphing loop.
|
|
25
|
+
* - **Provide** for determinate mode: Circle→SoftBurst morph + counterclockwise rotation.
|
|
26
|
+
*
|
|
27
|
+
* @example `progress={0.7}` shows 70% progress
|
|
28
|
+
*/
|
|
29
|
+
progress?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Active indicator color override. Falls back to MD3 system color tokens.
|
|
32
|
+
* Supports any valid CSS color value or CSS variable.
|
|
33
|
+
* @example "#ff5722" | "var(--brand-color)"
|
|
34
|
+
*/
|
|
35
|
+
color?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Required accessible label describing what is loading.
|
|
38
|
+
* @example "Loading news article"
|
|
39
|
+
*/
|
|
40
|
+
"aria-label": string;
|
|
41
|
+
}
|
|
42
|
+
export declare const LoadingIndicator: React.ForwardRefExoticComponent<LoadingIndicatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type NavigationRailVariant = "collapsed" | "expanded" | "modal";
|
|
3
|
+
export type NavigationRailLabelVisibility = "labeled" | "auto" | "unlabeled";
|
|
4
|
+
export interface NavigationRailItemProps {
|
|
5
|
+
selected: boolean;
|
|
6
|
+
icon: React.ReactNode;
|
|
7
|
+
label?: React.ReactNode;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
badge?: React.ReactNode;
|
|
11
|
+
"aria-label"?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface NavigationRailProps {
|
|
15
|
+
variant?: NavigationRailVariant;
|
|
16
|
+
labelVisibility?: NavigationRailLabelVisibility;
|
|
17
|
+
header?: React.ReactNode;
|
|
18
|
+
fab?: React.ReactNode;
|
|
19
|
+
footer?: React.ReactNode;
|
|
20
|
+
narrow?: boolean;
|
|
21
|
+
open?: boolean;
|
|
22
|
+
xr?: boolean | "contained" | "spatialized";
|
|
23
|
+
onClose?: () => void;
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
className?: string;
|
|
26
|
+
style?: React.CSSProperties;
|
|
27
|
+
}
|
|
28
|
+
export declare const NavigationRailItem: React.NamedExoticComponent<NavigationRailItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
29
|
+
export declare const NavigationRail: React.NamedExoticComponent<NavigationRailProps & React.RefAttributes<HTMLElement>>;
|