alif-ui 2.0.0 → 2.0.2
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/dist/components/Alert/Alert.types.d.ts +6 -5
- package/dist/components/Alert/Alert.types.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbsMenu/BreadcrumbsMenu.js +1 -0
- package/dist/components/Dates/InputTimePicker/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/components/Dates/InputTimePicker/TimePicker/TimePicker.js +1 -0
- package/dist/components/Dates/PickerOptions/PickerOptions.d.ts.map +1 -1
- package/dist/components/Dates/PickerOptions/PickerOptions.js +2 -0
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.js +1 -0
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.js +1 -0
- package/dist/components/NativeDrawer/NativeDrawer.d.ts.map +1 -1
- package/dist/components/NativeDrawer/NativeDrawer.js +1 -0
- package/dist/components/NativeModal/NativeModal.d.ts.map +1 -1
- package/dist/components/NativeModal/NativeModal.js +1 -0
- package/dist/components/Snackbar/SnackbarCard/SnackbarCard.d.ts.map +1 -1
- package/dist/components/Snackbar/SnackbarCard/SnackbarCard.js +1 -0
- package/package.json +1 -1
- package/skills/alif-ui/references/components.md +105 -28
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
2
|
export type Variant = 'light' | 'outline' | 'filled';
|
|
3
3
|
export type Color = 'warning' | 'error' | 'success' | 'info';
|
|
4
|
-
export interface AlertProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
export interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
5
5
|
/**
|
|
6
|
-
* The title of the alert.
|
|
6
|
+
* The title of the alert. Accepts plain text or any React node.
|
|
7
7
|
*/
|
|
8
|
-
title?:
|
|
8
|
+
title?: ReactNode;
|
|
9
9
|
/**
|
|
10
|
-
* The description of the alert.
|
|
10
|
+
* The description of the alert. Accepts plain text or any React node
|
|
11
|
+
* (e.g. a link or formatted text).
|
|
11
12
|
*/
|
|
12
|
-
description?:
|
|
13
|
+
description?: ReactNode;
|
|
13
14
|
/**
|
|
14
15
|
* The variant of the alert.
|
|
15
16
|
* @default 'light'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.types.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Alert/Alert.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEvD,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AACrD,MAAM,MAAM,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAE7D,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Alert.types.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Alert/Alert.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEvD,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AACrD,MAAM,MAAM,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAE7D,MAAM,WAAW,UAAW,SAAQ,IAAI,CACvC,cAAc,CAAC,cAAc,CAAC,EAC9B,OAAO,CACP;IACA;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimePicker.d.ts","sourceRoot":"","sources":["../../../../../src/lib/components/Dates/InputTimePicker/TimePicker/TimePicker.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAcrD,eAAO,MAAM,UAAU,GAAI,mJAcxB,eAAe,GAAG;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB,
|
|
1
|
+
{"version":3,"file":"TimePicker.d.ts","sourceRoot":"","sources":["../../../../../src/lib/components/Dates/InputTimePicker/TimePicker/TimePicker.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAcrD,eAAO,MAAM,UAAU,GAAI,mJAcxB,eAAe,GAAG;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB,gCAwHA,CAAC"}
|
|
@@ -58,6 +58,7 @@ var S = ({ value: S, onChange: C, onScroll: w, maxTime: T, minTime: E, hoursStep
|
|
|
58
58
|
M && /* @__PURE__ */ b("div", {
|
|
59
59
|
className: i.confirmationBlock,
|
|
60
60
|
children: /* @__PURE__ */ b(r, {
|
|
61
|
+
type: "button",
|
|
61
62
|
size: "s",
|
|
62
63
|
className: i.confirmationButton,
|
|
63
64
|
onClick: () => C?.(c(R, B)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PickerOptions.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/Dates/PickerOptions/PickerOptions.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAM3D,eAAO,MAAM,aAAa,GAAI,CAAC,EAAG,6DAM/B,kBAAkB,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"PickerOptions.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/Dates/PickerOptions/PickerOptions.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAM3D,eAAO,MAAM,aAAa,GAAI,CAAC,EAAG,6DAM/B,kBAAkB,CAAC,CAAC,CAAC,uCAmCvB,CAAC"}
|
|
@@ -13,6 +13,7 @@ var s = ({ options: s = [], isRange: c, onChange: l, onConfirm: u, disabledOptio
|
|
|
13
13
|
children: [/* @__PURE__ */ a("div", {
|
|
14
14
|
className: n.dateOptions,
|
|
15
15
|
children: p.map(({ text: e, value: n }) => /* @__PURE__ */ a(t, {
|
|
16
|
+
type: "button",
|
|
16
17
|
onClick: () => l(n),
|
|
17
18
|
disabled: r(n, d),
|
|
18
19
|
variant: "function",
|
|
@@ -21,6 +22,7 @@ var s = ({ options: s = [], isRange: c, onChange: l, onConfirm: u, disabledOptio
|
|
|
21
22
|
children: e
|
|
22
23
|
}, e))
|
|
23
24
|
}), u && /* @__PURE__ */ a(t, {
|
|
25
|
+
type: "button",
|
|
24
26
|
onClick: u,
|
|
25
27
|
size: "s",
|
|
26
28
|
children: i[f]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAa7C,eAAO,MAAM,MAAM;sLAkBhB,WAAW;;;;
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAa7C,eAAO,MAAM,MAAM;sLAkBhB,WAAW;;;;CAgEb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Modal/Modal.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAM3C,eAAO,MAAM,KAAK;8FASf,UAAU;;;;
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Modal/Modal.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAM3C,eAAO,MAAM,KAAK;8FASf,UAAU;;;;CAiCZ,CAAC"}
|
|
@@ -24,6 +24,7 @@ var f = ({ children: o, device: s = "desktop", centered: c = !0, withCloseButton
|
|
|
24
24
|
style: l(s, f, h),
|
|
25
25
|
className: e(a.root, p && a.scrollable, m),
|
|
26
26
|
children: [o, f && /* @__PURE__ */ u(r, {
|
|
27
|
+
type: "button",
|
|
27
28
|
variant: "ghost",
|
|
28
29
|
color: "tertiary",
|
|
29
30
|
className: a.closeButton,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeDrawer.d.ts","sourceRoot":"","sources":["../../../src/lib/components/NativeDrawer/NativeDrawer.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAQzD,eAAO,MAAM,YAAY;iOAqBtB,iBAAiB;;;;
|
|
1
|
+
{"version":3,"file":"NativeDrawer.d.ts","sourceRoot":"","sources":["../../../src/lib/components/NativeDrawer/NativeDrawer.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAQzD,eAAO,MAAM,YAAY;iOAqBtB,iBAAiB;;;;CAuDnB,CAAC"}
|
|
@@ -41,6 +41,7 @@ var f = ({ isOpen: s, onClose: c, children: l, position: f = "right", variant: p
|
|
|
41
41
|
children: /* @__PURE__ */ d("div", {
|
|
42
42
|
className: i.panel,
|
|
43
43
|
children: [l, v && /* @__PURE__ */ u(n, {
|
|
44
|
+
type: "button",
|
|
44
45
|
variant: "ghost",
|
|
45
46
|
color: "tertiary",
|
|
46
47
|
className: i.closeButton,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeModal.d.ts","sourceRoot":"","sources":["../../../src/lib/components/NativeModal/NativeModal.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAQvD,eAAO,MAAM,WAAW;4LAiBrB,gBAAgB;;;;
|
|
1
|
+
{"version":3,"file":"NativeModal.d.ts","sourceRoot":"","sources":["../../../src/lib/components/NativeModal/NativeModal.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAQvD,eAAO,MAAM,WAAW;4LAiBrB,gBAAgB;;;;CAgDlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SnackbarCard.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/Snackbar/SnackbarCard/SnackbarCard.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAoBzD,eAAO,MAAM,YAAY,GAAI,qBAAqB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"SnackbarCard.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/Snackbar/SnackbarCard/SnackbarCard.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAoBzD,eAAO,MAAM,YAAY,GAAI,qBAAqB,iBAAiB,gCAmGlE,CAAC"}
|
package/package.json
CHANGED
|
@@ -48,7 +48,7 @@ With `variant="heading"` the tag is derived from `size` automatically (`size="h2
|
|
|
48
48
|
|
|
49
49
|
### `Badge`
|
|
50
50
|
|
|
51
|
-
`size?: 'xs' | 's' | 'm'` · `variant?: 'filled' | 'light'` · `color?: 'info' | 'success' | 'neutral' | 'warning' | 'danger' | \`#${string}
|
|
51
|
+
`size?: 'xs' | 's' | 'm'` · `variant?: 'filled' | 'light'` · `color?: 'info' | 'success' | 'neutral' | 'warning' | 'danger' | \`#${string}\``·`clickable?`. A custom hex is allowed here.
|
|
52
52
|
|
|
53
53
|
### `Indicator`
|
|
54
54
|
|
|
@@ -121,7 +121,13 @@ The surface primitive — use it instead of a styled `<div>` for cards, panels a
|
|
|
121
121
|
### `InputOtp`
|
|
122
122
|
|
|
123
123
|
```tsx
|
|
124
|
-
<InputOtp
|
|
124
|
+
<InputOtp
|
|
125
|
+
value={code}
|
|
126
|
+
onChange={setCode}
|
|
127
|
+
length={6}
|
|
128
|
+
onComplete={verify}
|
|
129
|
+
integerOnly
|
|
130
|
+
/>
|
|
125
131
|
```
|
|
126
132
|
|
|
127
133
|
`value: string` · `onChange: (code: string) => void` · `length?: number` · `onComplete?: (code: string) => void` · `variant?: 'main' | 'filled'` · `size?: 's' | 'm' | 'l'` · `hasError?` · `mask?` · `integerOnly?` · `autoFocus?` · `placeholder?` · `disabled?` · `inputClassName?` / `inputStyle?`.
|
|
@@ -157,8 +163,18 @@ Same shape as `Checkbox`: `Radio` takes `label`, `description`, `labelPosition`,
|
|
|
157
163
|
### `Slider`, `RangeSlider`
|
|
158
164
|
|
|
159
165
|
```tsx
|
|
160
|
-
<Slider
|
|
161
|
-
|
|
166
|
+
<Slider
|
|
167
|
+
value={amount}
|
|
168
|
+
onChange={setAmount}
|
|
169
|
+
min={0}
|
|
170
|
+
max={1000}
|
|
171
|
+
step={50}
|
|
172
|
+
withTooltip
|
|
173
|
+
marks={[
|
|
174
|
+
{ value: 0, label: '0' },
|
|
175
|
+
{ value: 1000, label: '1000' },
|
|
176
|
+
]}
|
|
177
|
+
/>
|
|
162
178
|
```
|
|
163
179
|
|
|
164
180
|
`Slider`: `value: number`, `onChange: (value: number) => void`, `min?`, `max?`, `step?`, `marks?: { label: string; value: number }[]`, `withTooltip?`, `disabled?`.
|
|
@@ -213,7 +229,7 @@ const options: SelectOption<string>[] = [
|
|
|
213
229
|
options={options}
|
|
214
230
|
filterable
|
|
215
231
|
showClearIcon
|
|
216
|
-
|
|
232
|
+
/>;
|
|
217
233
|
```
|
|
218
234
|
|
|
219
235
|
`value: T | SelectOption<T> | null` (**required**) · `onChange: (value: T | null, option: SelectOption<T> | null) => void` (**required**, two arguments) · `options: SelectOption<T>[] | SelectGroupOption<T>[]` · `filterable?` (search inside the dropdown) · `onSearch?: (value, event?) => void` · `disableClientFilter?` (for server-side search) · `showClearIcon?` · `alignItemsCenter?` · `itemClassName?` · `onBlur?`, plus from `Input`: `size`, `label`, `placeholder`, `fullWidth`, `name`, `id`, `hasError`, `disabled`, `hintLeftSection`, `hintRightSection`, and from `List`: `loading`, `skeletonCount`, `customEmptyText`, `maxHeight`, `onLoadMore`, `hasMore`, `loadingMore`, `loadMoreOffset`.
|
|
@@ -228,13 +244,25 @@ Same props as `Select` except: `values: string[] | number[] | SelectOption[]` (*
|
|
|
228
244
|
### `List`, `List.Item`, `List.Group`
|
|
229
245
|
|
|
230
246
|
```tsx
|
|
231
|
-
<List
|
|
232
|
-
|
|
247
|
+
<List
|
|
248
|
+
size="m"
|
|
249
|
+
maxHeight={320}
|
|
250
|
+
loading={isLoading}
|
|
251
|
+
skeletonCount={5}
|
|
252
|
+
onLoadMore={fetchNext}
|
|
253
|
+
hasMore={hasNextPage}
|
|
254
|
+
loadingMore={isFetchingNext}
|
|
255
|
+
>
|
|
233
256
|
<List.Group title="Recent" collapsible>
|
|
234
257
|
{items.map((item) => (
|
|
235
|
-
<List.Item
|
|
236
|
-
|
|
237
|
-
|
|
258
|
+
<List.Item
|
|
259
|
+
key={item.id}
|
|
260
|
+
value={item.id}
|
|
261
|
+
label={item.name}
|
|
262
|
+
secondaryText={item.email}
|
|
263
|
+
leftSection={<Avatar name={item.name} />}
|
|
264
|
+
onClick={(value, option) => open(value)}
|
|
265
|
+
/>
|
|
238
266
|
))}
|
|
239
267
|
</List.Group>
|
|
240
268
|
</List>
|
|
@@ -249,7 +277,14 @@ Same props as `Select` except: `values: string[] | number[] | SelectOption[]` (*
|
|
|
249
277
|
Chip-style selector built on native inputs (radio/checkbox).
|
|
250
278
|
|
|
251
279
|
```tsx
|
|
252
|
-
<Tab.Group
|
|
280
|
+
<Tab.Group
|
|
281
|
+
value={period}
|
|
282
|
+
onChange={setPeriod}
|
|
283
|
+
variant="main"
|
|
284
|
+
size="m"
|
|
285
|
+
rounded
|
|
286
|
+
fullWidth
|
|
287
|
+
>
|
|
253
288
|
<Tab value="day">Day</Tab>
|
|
254
289
|
<Tab value="week">Week</Tab>
|
|
255
290
|
</Tab.Group>
|
|
@@ -266,7 +301,10 @@ Data-driven segmented switch — no children.
|
|
|
266
301
|
<SegmentedControl
|
|
267
302
|
value={view}
|
|
268
303
|
onChange={setView}
|
|
269
|
-
data={[
|
|
304
|
+
data={[
|
|
305
|
+
{ value: 'list', label: 'List' },
|
|
306
|
+
{ value: 'grid', label: 'Grid', leftIcon: <OutlineSystemGridView /> },
|
|
307
|
+
]}
|
|
270
308
|
fullWidth
|
|
271
309
|
/>
|
|
272
310
|
```
|
|
@@ -306,7 +344,9 @@ Controlled only — `value` and `onChange` are required.
|
|
|
306
344
|
<Tabs value={tab} onChange={setTab} size="m" keepMounted={false}>
|
|
307
345
|
<Tabs.Menu grow divider>
|
|
308
346
|
<Tabs.Tab value="profile">Profile</Tabs.Tab>
|
|
309
|
-
<Tabs.Tab value="settings" leftIcon={<OutlineSystemSettings />}>
|
|
347
|
+
<Tabs.Tab value="settings" leftIcon={<OutlineSystemSettings />}>
|
|
348
|
+
Settings
|
|
349
|
+
</Tabs.Tab>
|
|
310
350
|
</Tabs.Menu>
|
|
311
351
|
|
|
312
352
|
<Tabs.Panel value="profile">…</Tabs.Panel>
|
|
@@ -325,7 +365,10 @@ Router-agnostic — you supply the link component.
|
|
|
325
365
|
|
|
326
366
|
```tsx
|
|
327
367
|
<Breadcrumbs
|
|
328
|
-
links={[
|
|
368
|
+
links={[
|
|
369
|
+
{ label: 'Home', path: '/' },
|
|
370
|
+
{ label: 'Users', path: '/users' },
|
|
371
|
+
]}
|
|
329
372
|
linkComponent={Link}
|
|
330
373
|
linkProps={(path) => ({ to: path })}
|
|
331
374
|
maxItems={3}
|
|
@@ -341,7 +384,10 @@ Router-agnostic — you supply the link component.
|
|
|
341
384
|
### `AppLayout`, `Navbar`, `Sidebar`
|
|
342
385
|
|
|
343
386
|
```tsx
|
|
344
|
-
<AppLayout
|
|
387
|
+
<AppLayout
|
|
388
|
+
navbar={<Navbar variant="with-border">…</Navbar>}
|
|
389
|
+
sidebar={<AppSidebar />}
|
|
390
|
+
>
|
|
345
391
|
{children}
|
|
346
392
|
</AppLayout>
|
|
347
393
|
```
|
|
@@ -361,14 +407,22 @@ Parts: `Sidebar.Header` (`logo?: { default: ReactNode; compact: ReactNode }`), `
|
|
|
361
407
|
```tsx
|
|
362
408
|
const [isOpen, setIsOpen] = useState(false);
|
|
363
409
|
|
|
364
|
-
<Modal
|
|
410
|
+
<Modal
|
|
411
|
+
isOpen={isOpen}
|
|
412
|
+
onClose={() => setIsOpen(false)}
|
|
413
|
+
centered
|
|
414
|
+
scrollable
|
|
415
|
+
withCloseButton
|
|
416
|
+
>
|
|
365
417
|
<Modal.Header title="Heading" description="Optional description" />
|
|
366
418
|
<Modal.Content>…</Modal.Content>
|
|
367
419
|
<Modal.Actions>
|
|
368
|
-
<Button variant="outline" onClick={() => setIsOpen(false)}>
|
|
420
|
+
<Button variant="outline" onClick={() => setIsOpen(false)}>
|
|
421
|
+
Cancel
|
|
422
|
+
</Button>
|
|
369
423
|
<Button onClick={submit}>Confirm</Button>
|
|
370
424
|
</Modal.Actions>
|
|
371
|
-
</Modal
|
|
425
|
+
</Modal>;
|
|
372
426
|
```
|
|
373
427
|
|
|
374
428
|
`isOpen: boolean` (**required**) · `onClose: () => void` (**required**) · `centered?` · `scrollable?` · `withCloseButton?` · `device?: 'desktop' | 'mobile'` · `closeOnClickOutside?` (default `true`) · `zIndex?` · `transitionProps?` (see `Transition`).
|
|
@@ -382,7 +436,9 @@ Same base as `Modal` (`isOpen`, `onClose`, `closeOnClickOutside`, `zIndex`) plus
|
|
|
382
436
|
|
|
383
437
|
```tsx
|
|
384
438
|
<Popover position="bottom-start" width="trigger" triggerType="click" withArrow>
|
|
385
|
-
<Popover.Trigger
|
|
439
|
+
<Popover.Trigger>
|
|
440
|
+
<Button>Open</Button>
|
|
441
|
+
</Popover.Trigger>
|
|
386
442
|
<Popover.Dropdown>…</Popover.Dropdown>
|
|
387
443
|
</Popover>
|
|
388
444
|
```
|
|
@@ -394,8 +450,14 @@ Same base as `Modal` (`isOpen`, `onClose`, `closeOnClickOutside`, `zIndex`) plus
|
|
|
394
450
|
Popover preconfigured as an action menu; the trigger is a **prop**, not a child.
|
|
395
451
|
|
|
396
452
|
```tsx
|
|
397
|
-
<Menu
|
|
398
|
-
|
|
453
|
+
<Menu
|
|
454
|
+
trigger={<Button size="s">Actions</Button>}
|
|
455
|
+
position="bottom-end"
|
|
456
|
+
maxHeight={280}
|
|
457
|
+
>
|
|
458
|
+
<Menu.Item leftIcon={<OutlineSystemMail />} onClick={openMail}>
|
|
459
|
+
Messages
|
|
460
|
+
</Menu.Item>
|
|
399
461
|
<Menu.Item disabled>Archive</Menu.Item>
|
|
400
462
|
<Menu.Sub label="More">
|
|
401
463
|
<Menu.Item onClick={exportCsv}>Export CSV</Menu.Item>
|
|
@@ -411,7 +473,9 @@ Popover preconfigured as an action menu; the trigger is a **prop**, not a child.
|
|
|
411
473
|
|
|
412
474
|
```tsx
|
|
413
475
|
<Tooltip label="Copy to clipboard" position="top">
|
|
414
|
-
<Button variant="ghost"
|
|
476
|
+
<Button variant="ghost">
|
|
477
|
+
<SolidSystemCopy />
|
|
478
|
+
</Button>
|
|
415
479
|
</Tooltip>
|
|
416
480
|
```
|
|
417
481
|
|
|
@@ -431,14 +495,21 @@ Mount the host once near the app root, then call the imperative API from anywher
|
|
|
431
495
|
|
|
432
496
|
```tsx
|
|
433
497
|
// once
|
|
434
|
-
<Snackbar position="top-right" duration={4000}
|
|
498
|
+
<Snackbar position="top-right" duration={4000} />;
|
|
435
499
|
|
|
436
500
|
// anywhere
|
|
437
501
|
snackbar.success('Saved');
|
|
438
|
-
snackbar.error('Something went wrong', {
|
|
502
|
+
snackbar.error('Something went wrong', {
|
|
503
|
+
description: err.message,
|
|
504
|
+
withCloseButton: true,
|
|
505
|
+
});
|
|
439
506
|
snackbar('Plain message', { position: 'bottom-center' });
|
|
440
507
|
const id = snackbar.loading('Uploading…');
|
|
441
|
-
snackbar.promise(uploadFile(file), {
|
|
508
|
+
snackbar.promise(uploadFile(file), {
|
|
509
|
+
loading: 'Uploading…',
|
|
510
|
+
success: 'Uploaded',
|
|
511
|
+
error: 'Failed',
|
|
512
|
+
});
|
|
442
513
|
snackbar.custom((id) => <MyCard onClose={() => snackbar.dismiss(id)} />);
|
|
443
514
|
snackbar.dismiss(id); // or snackbar.dismiss() for all
|
|
444
515
|
```
|
|
@@ -448,7 +519,7 @@ Per-call `SnackbarOptions`: `id?`, `duration?` (`0` = sticky), `position?`, `des
|
|
|
448
519
|
|
|
449
520
|
### `Alert`
|
|
450
521
|
|
|
451
|
-
Inline message block. `title?:
|
|
522
|
+
Inline message block. `title?: ReactNode` · `description?: ReactNode` (plain text or any node — links, formatted text) · `variant?: 'light' | 'outline' | 'filled'` · `color?: 'info' | 'success' | 'warning' | 'error'` · `icon?: ReactNode` · `onClose?: () => void` (renders the close button).
|
|
452
523
|
|
|
453
524
|
---
|
|
454
525
|
|
|
@@ -485,11 +556,17 @@ Inline message block. `title?: string` · `description?: string` · `variant?: '
|
|
|
485
556
|
```tsx
|
|
486
557
|
<Table verticalSpacing="m" highlightOnHover stickyHeader withRowBorders>
|
|
487
558
|
<Table.Thead>
|
|
488
|
-
<Table.Tr
|
|
559
|
+
<Table.Tr>
|
|
560
|
+
<Table.Th>Name</Table.Th>
|
|
561
|
+
<Table.Th>Role</Table.Th>
|
|
562
|
+
</Table.Tr>
|
|
489
563
|
</Table.Thead>
|
|
490
564
|
<Table.Tbody>
|
|
491
565
|
{rows.map((row) => (
|
|
492
|
-
<Table.Tr key={row.id}
|
|
566
|
+
<Table.Tr key={row.id}>
|
|
567
|
+
<Table.Td>{row.name}</Table.Td>
|
|
568
|
+
<Table.Td>{row.role}</Table.Td>
|
|
569
|
+
</Table.Tr>
|
|
493
570
|
))}
|
|
494
571
|
</Table.Tbody>
|
|
495
572
|
</Table>
|