alif-ui 2.0.1 → 2.0.3
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/Field/InputBaseWrapper/InputBaseWrapper.js +47 -44
- package/dist/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.js +2 -2
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +73 -72
- package/dist/components/Select/Select.types.d.ts +1 -1
- package/dist/components/Select/Select.types.d.ts.map +1 -1
- package/dist/components/Select/SelectMultiple/SelectMultiple.d.ts +1 -1
- package/dist/components/Select/SelectMultiple/SelectMultiple.d.ts.map +1 -1
- package/dist/components/Select/SelectMultiple/SelectMultiple.js +65 -64
- package/dist/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/components/Sidebar/SidebarCollapse/SidebarCollapse.d.ts +1 -1
- package/dist/components/Sidebar/SidebarCollapse/SidebarCollapse.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarCollapse/SidebarCollapse.js +30 -30
- package/dist/components/Sidebar/SidebarCollapse/SidebarCollapse.types.d.ts +5 -0
- package/dist/components/Sidebar/SidebarCollapse/SidebarCollapse.types.d.ts.map +1 -1
- 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"}
|
|
@@ -13,51 +13,54 @@ var u = ({ id: u, value: d, label: f, onClear: p, leftSection: m, leftIcon: h, r
|
|
|
13
13
|
let { locale: j } = t(), M = d != null && d !== "", N = A === "s" || !E, P = e(r.root, !T && r.rootBorderless, y && r.rootError, b && r.rootDisabled, w && r.rootFullWidth, S), F = e(r.label, "uiFont", (M || D) && r.labelFloated, N && r.labelHidden, N && M && r.labelHiddenWithValue), I = e(r.content, (N || !f) && r.contentCentered), L = e(r.clearButton, !M && r.clearButtonHidden), R = () => {
|
|
14
14
|
v?.current?.focus();
|
|
15
15
|
};
|
|
16
|
-
return /* @__PURE__ */ l("div", {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
16
|
+
return /* @__PURE__ */ l("div", {
|
|
17
|
+
className: e(w && "uiFullWidth"),
|
|
18
|
+
children: [/* @__PURE__ */ l("div", {
|
|
19
|
+
onClick: x,
|
|
20
|
+
className: P,
|
|
21
|
+
style: i(A, C),
|
|
22
|
+
children: [m, /* @__PURE__ */ l("div", {
|
|
23
|
+
className: r.wrapper,
|
|
24
|
+
onClick: R,
|
|
25
|
+
children: [
|
|
26
|
+
h,
|
|
27
|
+
/* @__PURE__ */ l("div", {
|
|
28
|
+
className: r.inputContainer,
|
|
29
|
+
onMouseDown: (e) => {
|
|
30
|
+
e.target === e.currentTarget && e.preventDefault();
|
|
31
|
+
},
|
|
32
|
+
children: [f && /* @__PURE__ */ c("label", {
|
|
33
|
+
htmlFor: u,
|
|
34
|
+
className: F,
|
|
35
|
+
children: f
|
|
36
|
+
}), /* @__PURE__ */ c("div", {
|
|
37
|
+
className: I,
|
|
38
|
+
children: _
|
|
39
|
+
})]
|
|
40
|
+
}),
|
|
41
|
+
p && /* @__PURE__ */ c(s, {
|
|
42
|
+
type: "button",
|
|
43
|
+
disabled: b,
|
|
44
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
45
|
+
className: L,
|
|
46
|
+
onClick: () => {
|
|
47
|
+
R(), p?.();
|
|
48
|
+
},
|
|
49
|
+
"aria-label": a[j].clearText,
|
|
50
|
+
children: /* @__PURE__ */ c(n, {})
|
|
51
|
+
}),
|
|
52
|
+
g
|
|
53
|
+
]
|
|
54
|
+
})]
|
|
55
|
+
}), /* @__PURE__ */ l(o, {
|
|
56
|
+
className: r.hinter,
|
|
57
|
+
hasError: y,
|
|
58
|
+
children: [O && /* @__PURE__ */ c("div", { children: O }), k && /* @__PURE__ */ c("div", {
|
|
59
|
+
className: r.hintRight,
|
|
60
|
+
children: k
|
|
61
|
+
})]
|
|
52
62
|
})]
|
|
53
|
-
})
|
|
54
|
-
className: r.hinter,
|
|
55
|
-
hasError: y,
|
|
56
|
-
children: [O && /* @__PURE__ */ c("div", { children: O }), k && /* @__PURE__ */ c("div", {
|
|
57
|
-
className: r.hintRight,
|
|
58
|
-
children: k
|
|
59
|
-
})]
|
|
60
|
-
})] });
|
|
63
|
+
});
|
|
61
64
|
};
|
|
62
65
|
//#endregion
|
|
63
66
|
export { u as InputBaseWrapper };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Pagination/Pagination.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAMrD,eAAO,MAAM,UAAU,GAAI,yQAiBxB,eAAe,
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Pagination/Pagination.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAMrD,eAAO,MAAM,UAAU,GAAI,yQAiBxB,eAAe,uCAsIjB,CAAC"}
|
|
@@ -21,7 +21,7 @@ var g = ({ page: g, totalPages: _, itemsPerPage: v = 10, itemsPerPageOptions: y,
|
|
|
21
21
|
siblingCount: D
|
|
22
22
|
});
|
|
23
23
|
if (!P || P.length < 1 || g < 1) return null;
|
|
24
|
-
let F = _, I = 63 + String(
|
|
24
|
+
let F = _, I = Math.max(v, ...(y ?? []).map((e) => e.value)), L = 63 + String(I).length * (S === "m" ? 10 : 8) + "px";
|
|
25
25
|
return /* @__PURE__ */ h("div", {
|
|
26
26
|
className: e(f.root, C),
|
|
27
27
|
style: u(S, w),
|
|
@@ -91,7 +91,7 @@ var g = ({ page: g, totalPages: _, itemsPerPage: v = 10, itemsPerPageOptions: y,
|
|
|
91
91
|
orientation: "vertical",
|
|
92
92
|
className: f.divider
|
|
93
93
|
}), /* @__PURE__ */ m(c, {
|
|
94
|
-
style: { width:
|
|
94
|
+
style: { width: L },
|
|
95
95
|
size: S,
|
|
96
96
|
filterable: !1,
|
|
97
97
|
fullWidth: !1,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SelectProps } from './Select.types';
|
|
2
|
-
export declare const Select: <T>({ id, name, value, options, label, placeholder, customEmptyText, maxHeight, size, fullWidth, alignItemsCenter, className, itemClassName, style, filterable, disableClientFilter, keepMounted, showClearIcon, disabled, loading, skeletonCount, onLoadMore, hasMore, loadingMore, loadMoreOffset, hasError, hintLeftSection, hintRightSection, onChange, onSearch, onBlur, }: SelectProps<T>) => import('react').JSX.Element;
|
|
2
|
+
export declare const Select: <T>({ id, name, value, options, label, placeholder, customEmptyText, maxHeight, size, fullWidth, alignItemsCenter, className, itemClassName, style, filterable, disableClientFilter, keepMounted, showClearIcon, disabled, loading, skeletonCount, onLoadMore, hasMore, loadingMore, loadMoreOffset, hasError, leftIcon, hintLeftSection, hintRightSection, onChange, onSearch, onBlur, }: SelectProps<T>) => import('react').JSX.Element;
|
|
3
3
|
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Select/Select.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAe,MAAM,gBAAgB,CAAC;AAO1D,eAAO,MAAM,MAAM,GAAI,CAAC,EAAG,
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Select/Select.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAe,MAAM,gBAAgB,CAAC;AAO1D,eAAO,MAAM,MAAM,GAAI,CAAC,EAAG,uXAiCxB,WAAW,CAAC,CAAC,CAAC,gCAiMhB,CAAC"}
|
|
@@ -3,131 +3,132 @@ import { classNames as e } from "../../utils/class-names.js";
|
|
|
3
3
|
import { OutlineNavigationChevronDown as t } from "../../icons/components/OutlineNavigationChevronDown.js";
|
|
4
4
|
import { useComponentId as n } from "../../hooks/useComponentId/useComponentId.js";
|
|
5
5
|
import { PopoverWithFallback as r } from "../NativePopover/PopoverWithFallback.js";
|
|
6
|
-
import { Input as
|
|
7
|
-
import { List as
|
|
8
|
-
import
|
|
9
|
-
import { flattenOptions as
|
|
10
|
-
import { useSelectNavigation as
|
|
11
|
-
import { useEffect as
|
|
12
|
-
import { jsx as
|
|
6
|
+
import { Input as ee } from "../Input/Input.js";
|
|
7
|
+
import { List as i } from "../List/List.js";
|
|
8
|
+
import a from "../../lib/components/Select/Select.module.js";
|
|
9
|
+
import { flattenOptions as o, getFieldValue as s, isGroupedOptions as c, isObjectValue as te, matchesSearch as l, restoreSearchValue as u } from "./Select.utils.js";
|
|
10
|
+
import { useSelectNavigation as d } from "./useSelectNavigation.js";
|
|
11
|
+
import { useEffect as f, useMemo as p, useState as m } from "react";
|
|
12
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
13
13
|
//#region src/lib/components/Select/Select.tsx
|
|
14
|
-
var
|
|
15
|
-
let G = n(
|
|
14
|
+
var _ = ({ id: _, name: v, value: y, options: b = [], label: x, placeholder: S, customEmptyText: C, maxHeight: w, size: T = "m", fullWidth: ne = !0, alignItemsCenter: re, className: ie, itemClassName: ae, style: E, filterable: D = !0, disableClientFilter: O = !1, keepMounted: k = !0, showClearIcon: A = !0, disabled: j, loading: M = !1, skeletonCount: N = 2, onLoadMore: P, hasMore: F, loadingMore: I, loadMoreOffset: L, hasError: R, leftIcon: z, hintLeftSection: B, hintRightSection: V, onChange: H, onSearch: U, onBlur: W }) => {
|
|
15
|
+
let G = n(_), [K, q] = m(!1), [J, Y] = m(""), X = p(() => te(y) ? y.value : y, [y]), Z = p(() => !D || O || s(b, X) === J ? b : c(b) ? b.map((e) => ({
|
|
16
16
|
...e,
|
|
17
|
-
options: e.options.filter(
|
|
18
|
-
})).filter((e) => e.options.length > 0) :
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
options: e.options.filter(l(J))
|
|
18
|
+
})).filter((e) => e.options.length > 0) : b.filter(l(J)), [
|
|
19
|
+
D,
|
|
20
|
+
O,
|
|
21
|
+
b,
|
|
22
22
|
X,
|
|
23
23
|
J
|
|
24
|
-
]), Q =
|
|
25
|
-
|
|
26
|
-
},
|
|
24
|
+
]), Q = p(() => o(Z), [Z]), oe = p(() => Q.findIndex((e) => e.value === X), [Q, X]), se = () => {
|
|
25
|
+
H(null, null), Y("");
|
|
26
|
+
}, ce = (e) => {
|
|
27
27
|
let { value: t } = e.target;
|
|
28
|
-
Y(t),
|
|
29
|
-
},
|
|
30
|
-
let e =
|
|
28
|
+
Y(t), U?.(t, e), !K && D && q(!0);
|
|
29
|
+
}, le = () => {
|
|
30
|
+
let e = u(y, b, X);
|
|
31
31
|
Y(e), q(!1);
|
|
32
32
|
}, $ = (e) => {
|
|
33
33
|
let t = Q.find((t) => t.value === e);
|
|
34
|
-
t && !t.disabled && (
|
|
35
|
-
}, { handleKeyDown:
|
|
34
|
+
t && !t.disabled && (H(e, t), Y(s(b, e)), q(!1));
|
|
35
|
+
}, { handleKeyDown: ue, comboboxProps: de, listProps: fe, getOptionProps: pe } = d({
|
|
36
36
|
id: G,
|
|
37
37
|
options: Q,
|
|
38
38
|
isOpen: K,
|
|
39
39
|
searchValue: J,
|
|
40
|
-
selectedIndex:
|
|
41
|
-
hasMore:
|
|
40
|
+
selectedIndex: oe,
|
|
41
|
+
hasMore: F,
|
|
42
42
|
onOpen: () => q(!0),
|
|
43
43
|
onSelect: $
|
|
44
44
|
});
|
|
45
|
-
|
|
45
|
+
f(() => {
|
|
46
46
|
if (!K) {
|
|
47
|
-
let e =
|
|
47
|
+
let e = u(y, b, X);
|
|
48
48
|
Y(e);
|
|
49
49
|
}
|
|
50
50
|
}, [
|
|
51
|
-
|
|
51
|
+
b,
|
|
52
52
|
K,
|
|
53
53
|
X,
|
|
54
|
-
|
|
54
|
+
y
|
|
55
55
|
]);
|
|
56
|
-
let
|
|
56
|
+
let me = () => {
|
|
57
57
|
let e = 0, t = (t) => {
|
|
58
58
|
let n = X === t.value;
|
|
59
|
-
return /* @__PURE__ */
|
|
60
|
-
...
|
|
59
|
+
return /* @__PURE__ */ h(i.Item, {
|
|
60
|
+
...pe(e++),
|
|
61
61
|
"aria-selected": n,
|
|
62
62
|
value: t.value,
|
|
63
63
|
label: t.label,
|
|
64
64
|
secondaryText: t.secondaryText,
|
|
65
65
|
disabled: t.disabled,
|
|
66
|
-
alignItemCenter:
|
|
66
|
+
alignItemCenter: re,
|
|
67
67
|
selected: n,
|
|
68
68
|
onClick: $,
|
|
69
|
-
className:
|
|
69
|
+
className: ae,
|
|
70
70
|
leftSection: t.leftSection,
|
|
71
71
|
rightSection: t.rightSection
|
|
72
72
|
}, String(t.value));
|
|
73
73
|
};
|
|
74
|
-
return
|
|
74
|
+
return c(Z) ? Z.map((e, n) => /* @__PURE__ */ h(i.Group, {
|
|
75
75
|
title: e.title,
|
|
76
76
|
collapsible: e.collapsible,
|
|
77
77
|
defaultOpen: e.defaultOpen,
|
|
78
78
|
children: e.options.map(t)
|
|
79
79
|
}, n)) : Z.map(t);
|
|
80
80
|
};
|
|
81
|
-
return /* @__PURE__ */
|
|
81
|
+
return /* @__PURE__ */ g(r, {
|
|
82
82
|
width: "trigger",
|
|
83
83
|
isOpen: K,
|
|
84
|
-
keepMounted:
|
|
85
|
-
onClose:
|
|
84
|
+
keepMounted: k,
|
|
85
|
+
onClose: le,
|
|
86
86
|
offset: 4,
|
|
87
|
-
children: [/* @__PURE__ */
|
|
88
|
-
style:
|
|
89
|
-
onBlur:
|
|
90
|
-
className: e(
|
|
91
|
-
children: /* @__PURE__ */
|
|
87
|
+
children: [/* @__PURE__ */ h(r.Trigger, {
|
|
88
|
+
style: E,
|
|
89
|
+
onBlur: W,
|
|
90
|
+
className: e(ne && "uiFullWidth", j && a.disabled, ie),
|
|
91
|
+
children: /* @__PURE__ */ h(ee, {
|
|
92
92
|
fullWidth: !0,
|
|
93
|
-
onClear:
|
|
93
|
+
onClear: A ? se : void 0,
|
|
94
94
|
value: J,
|
|
95
|
-
size:
|
|
96
|
-
|
|
95
|
+
size: T,
|
|
96
|
+
leftIcon: z,
|
|
97
|
+
rightIcon: /* @__PURE__ */ h(t, {
|
|
97
98
|
onMouseDown: (e) => e.preventDefault(),
|
|
98
99
|
"aria-label": "Toggle dropdown",
|
|
99
|
-
className: e(K &&
|
|
100
|
+
className: e(K && a.chevronActive, a.chevron)
|
|
100
101
|
}),
|
|
101
|
-
onChange:
|
|
102
|
-
onKeyDown:
|
|
103
|
-
...
|
|
104
|
-
"aria-autocomplete":
|
|
105
|
-
readOnly: !
|
|
102
|
+
onChange: ce,
|
|
103
|
+
onKeyDown: ue,
|
|
104
|
+
...de,
|
|
105
|
+
"aria-autocomplete": D ? "list" : "none",
|
|
106
|
+
readOnly: !D,
|
|
106
107
|
id: G,
|
|
107
|
-
name:
|
|
108
|
-
disabled:
|
|
109
|
-
label:
|
|
110
|
-
placeholder:
|
|
111
|
-
hasError:
|
|
108
|
+
name: v,
|
|
109
|
+
disabled: j,
|
|
110
|
+
label: x,
|
|
111
|
+
placeholder: S,
|
|
112
|
+
hasError: R,
|
|
112
113
|
onFieldClick: () => q((e) => !e),
|
|
113
|
-
hintLeftSection:
|
|
114
|
-
hintRightSection:
|
|
114
|
+
hintLeftSection: B,
|
|
115
|
+
hintRightSection: V
|
|
115
116
|
})
|
|
116
|
-
}), /* @__PURE__ */
|
|
117
|
-
...
|
|
118
|
-
loading:
|
|
119
|
-
skeletonCount:
|
|
120
|
-
size:
|
|
121
|
-
fullWidth:
|
|
122
|
-
customEmptyText:
|
|
123
|
-
maxHeight:
|
|
124
|
-
onLoadMore:
|
|
125
|
-
hasMore:
|
|
126
|
-
loadingMore:
|
|
127
|
-
loadMoreOffset:
|
|
128
|
-
children:
|
|
117
|
+
}), /* @__PURE__ */ h(r.Dropdown, { children: /* @__PURE__ */ h(i, {
|
|
118
|
+
...fe,
|
|
119
|
+
loading: M,
|
|
120
|
+
skeletonCount: N,
|
|
121
|
+
size: T === "l" ? "l" : "m",
|
|
122
|
+
fullWidth: !0,
|
|
123
|
+
customEmptyText: C,
|
|
124
|
+
maxHeight: w,
|
|
125
|
+
onLoadMore: P,
|
|
126
|
+
hasMore: F,
|
|
127
|
+
loadingMore: I,
|
|
128
|
+
loadMoreOffset: L,
|
|
129
|
+
children: me()
|
|
129
130
|
}) })]
|
|
130
131
|
});
|
|
131
132
|
};
|
|
132
133
|
//#endregion
|
|
133
|
-
export {
|
|
134
|
+
export { _ as Select };
|
|
@@ -9,7 +9,7 @@ export interface SelectGroupOption<T = unknown> extends Pick<ListGroupProps, 'co
|
|
|
9
9
|
*/
|
|
10
10
|
options: SelectOption<T>[];
|
|
11
11
|
}
|
|
12
|
-
export interface SelectProps<T> extends Pick<InputProps, 'size' | 'label' | 'placeholder' | 'fullWidth' | 'name' | 'id' | 'hasError' | 'disabled' | 'className' | 'style' | 'hintRightSection' | 'hintLeftSection'>, Pick<ListProps, 'loading' | 'skeletonCount' | 'customEmptyText' | 'maxHeight' | 'onLoadMore' | 'hasMore' | 'loadingMore' | 'loadMoreOffset'> {
|
|
12
|
+
export interface SelectProps<T> extends Pick<InputProps, 'size' | 'label' | 'placeholder' | 'fullWidth' | 'name' | 'id' | 'hasError' | 'disabled' | 'className' | 'style' | 'leftIcon' | 'hintRightSection' | 'hintLeftSection'>, Pick<ListProps, 'loading' | 'skeletonCount' | 'customEmptyText' | 'maxHeight' | 'onLoadMore' | 'hasMore' | 'loadingMore' | 'loadMoreOffset'> {
|
|
13
13
|
/**
|
|
14
14
|
* The selected value of the select component.
|
|
15
15
|
* **Note:** This can be a primitive value of type `T` or an object of type `SelectOption`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.types.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Select/Select.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;AAE5C,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,OAAO,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC;AAE1D,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,IAAI,CAC3D,cAAc,EACd,aAAa,GAAG,aAAa,GAAG,OAAO,CACvC;IACA;;OAEG;IACH,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,WAAW,CAAC,CAAC,CAC7B,SACC,IAAI,CACH,UAAU,EACR,MAAM,GACN,OAAO,GACP,aAAa,GACb,WAAW,GACX,MAAM,GACN,IAAI,GACJ,UAAU,GACV,UAAU,GACV,WAAW,GACX,OAAO,GACP,kBAAkB,GAClB,iBAAiB,CACnB,EACD,IAAI,CACH,SAAS,EACP,SAAS,GACT,eAAe,GACf,iBAAiB,GACjB,WAAW,GACX,YAAY,GACZ,SAAS,GACT,aAAa,GACb,gBAAgB,CAClB;IACF;;;;;;;;OAQG;IACH,KAAK,EAAE,CAAC,GAAG,WAAW,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,QAAQ,EAAE,CACT,KAAK,EAAE,CAAC,GAAG,IAAI,EACf,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,WAAW,GAAG,IAAI,KACxC,IAAI,CAAC;IAEV;;;OAGG;IACH,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,WAAW,EAAE,GAAG,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;IAEpE;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE1E;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;IAE3C;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
|
1
|
+
{"version":3,"file":"Select.types.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Select/Select.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGtC,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;AAE5C,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,OAAO,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC;AAE1D,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,IAAI,CAC3D,cAAc,EACd,aAAa,GAAG,aAAa,GAAG,OAAO,CACvC;IACA;;OAEG;IACH,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,WAAW,CAAC,CAAC,CAC7B,SACC,IAAI,CACH,UAAU,EACR,MAAM,GACN,OAAO,GACP,aAAa,GACb,WAAW,GACX,MAAM,GACN,IAAI,GACJ,UAAU,GACV,UAAU,GACV,WAAW,GACX,OAAO,GACP,UAAU,GACV,kBAAkB,GAClB,iBAAiB,CACnB,EACD,IAAI,CACH,SAAS,EACP,SAAS,GACT,eAAe,GACf,iBAAiB,GACjB,WAAW,GACX,YAAY,GACZ,SAAS,GACT,aAAa,GACb,gBAAgB,CAClB;IACF;;;;;;;;OAQG;IACH,KAAK,EAAE,CAAC,GAAG,WAAW,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,QAAQ,EAAE,CACT,KAAK,EAAE,CAAC,GAAG,IAAI,EACf,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,WAAW,GAAG,IAAI,KACxC,IAAI,CAAC;IAEV;;;OAGG;IACH,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,WAAW,EAAE,GAAG,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;IAEpE;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAE1E;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;IAE3C;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SelectMultipleProps } from './SelectMultiple.types';
|
|
2
|
-
export declare const SelectMultiple: <T>({ id, name, ref, values, options, label, placeholder, customEmptyText, maxHeight, size, fullWidth, alignItemsCenter, className, itemClassName, style, disabled, loading, skeletonCount, onLoadMore, hasMore, loadingMore, loadMoreOffset, hasError, filterable, disableClientFilter, keepMounted, showClearIcon, closeOnSelect, clearInputOnSelect, hintLeftSection, hintRightSection, onChange, onSearch, onBlur, }: SelectMultipleProps<T>) => import('react').JSX.Element;
|
|
2
|
+
export declare const SelectMultiple: <T>({ id, name, ref, values, options, label, placeholder, customEmptyText, maxHeight, size, fullWidth, alignItemsCenter, className, itemClassName, style, disabled, loading, skeletonCount, onLoadMore, hasMore, loadingMore, loadMoreOffset, hasError, leftIcon, filterable, disableClientFilter, keepMounted, showClearIcon, closeOnSelect, clearInputOnSelect, hintLeftSection, hintRightSection, onChange, onSearch, onBlur, }: SelectMultipleProps<T>) => import('react').JSX.Element;
|
|
3
3
|
//# sourceMappingURL=SelectMultiple.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectMultiple.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/Select/SelectMultiple/SelectMultiple.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAgB7D,eAAO,MAAM,cAAc,GAAI,CAAC,EAAG,
|
|
1
|
+
{"version":3,"file":"SelectMultiple.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/Select/SelectMultiple/SelectMultiple.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAgB7D,eAAO,MAAM,cAAc,GAAI,CAAC,EAAG,gaAoChC,mBAAmB,CAAC,CAAC,CAAC,gCA0QxB,CAAC"}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { classNames as e } from "../../../utils/class-names.js";
|
|
3
3
|
import { syncRefs as t } from "../../../utils/sync-refs.js";
|
|
4
4
|
import { Badge as n } from "../../Badge/Badge.js";
|
|
5
|
-
import { OutlineNavigationChevronDown as
|
|
6
|
-
import { OutlineSystemClose as
|
|
7
|
-
import { useComponentId as
|
|
8
|
-
import { PopoverWithFallback as
|
|
9
|
-
import { InputBaseWrapper as
|
|
10
|
-
import { InputBase as
|
|
5
|
+
import { OutlineNavigationChevronDown as r } from "../../../icons/components/OutlineNavigationChevronDown.js";
|
|
6
|
+
import { OutlineSystemClose as ee } from "../../../icons/components/OutlineSystemClose.js";
|
|
7
|
+
import { useComponentId as te } from "../../../hooks/useComponentId/useComponentId.js";
|
|
8
|
+
import { PopoverWithFallback as i } from "../../NativePopover/PopoverWithFallback.js";
|
|
9
|
+
import { InputBaseWrapper as a } from "../../Field/InputBaseWrapper/InputBaseWrapper.js";
|
|
10
|
+
import { InputBase as ne } from "../../Field/InputBase/InputBase.js";
|
|
11
11
|
import { List as o } from "../../List/List.js";
|
|
12
12
|
import { flattenOptions as s, isGroupedOptions as c, isObjectValue as l, matchesSearch as u } from "../Select.utils.js";
|
|
13
13
|
import { useSelectNavigation as d } from "../useSelectNavigation.js";
|
|
@@ -15,66 +15,66 @@ import f from "../../../lib/components/Select/SelectMultiple/SelectMultiple.modu
|
|
|
15
15
|
import { useEffect as re, useMemo as p, useRef as m, useState as h } from "react";
|
|
16
16
|
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
17
17
|
//#region src/lib/components/Select/SelectMultiple/SelectMultiple.tsx
|
|
18
|
-
var v = ({ id: v, name: y, ref:
|
|
19
|
-
let V = m(null), H = m(null), U =
|
|
20
|
-
if (J) return
|
|
21
|
-
let e = s(
|
|
18
|
+
var v = ({ id: v, name: y, ref: ie, values: b, options: x, label: ae, placeholder: oe, customEmptyText: se, maxHeight: ce, size: S, fullWidth: le = !0, alignItemsCenter: ue, className: de, itemClassName: fe, style: pe, disabled: C, loading: me, skeletonCount: w, onLoadMore: T, hasMore: E, loadingMore: D, loadMoreOffset: O, hasError: k, leftIcon: A, filterable: j, disableClientFilter: M, keepMounted: N = !0, showClearIcon: P = !0, closeOnSelect: F = !1, clearInputOnSelect: I = !1, hintLeftSection: L, hintRightSection: R, onChange: z, onSearch: B, onBlur: he }) => {
|
|
19
|
+
let V = m(null), H = m(null), U = te(v), [W, G] = h(!1), [K, q] = h(""), J = p(() => !b.length || b.length > 0 && l(b[0]), [b]), Y = p(() => J ? b.map((e) => e.value) : b, [b, J]), ge = p(() => {
|
|
20
|
+
if (J) return b;
|
|
21
|
+
let e = s(x);
|
|
22
22
|
return Y.map((t) => e.find((e) => e.value === t)).filter((e) => !!e);
|
|
23
23
|
}, [
|
|
24
24
|
J,
|
|
25
|
-
|
|
25
|
+
x,
|
|
26
26
|
Y,
|
|
27
|
-
|
|
28
|
-
]), X = p(() => !j || M ?
|
|
27
|
+
b
|
|
28
|
+
]), X = p(() => !j || M ? x : c(x) ? x.map((e) => ({
|
|
29
29
|
...e,
|
|
30
30
|
options: e.options.filter(u(K))
|
|
31
|
-
})).filter((e) => e.options.length > 0) :
|
|
31
|
+
})).filter((e) => e.options.length > 0) : x.filter(u(K)), [
|
|
32
32
|
M,
|
|
33
33
|
j,
|
|
34
|
-
|
|
34
|
+
x,
|
|
35
35
|
K
|
|
36
|
-
]), Z = p(() => s(X), [X]),
|
|
36
|
+
]), Z = p(() => s(X), [X]), _e = (e) => {
|
|
37
37
|
let t = e.target.value;
|
|
38
38
|
q(t), B?.(t), G(!0);
|
|
39
39
|
}, Q = (e) => {
|
|
40
40
|
let t = Z.find((t) => t.value === e);
|
|
41
|
-
t && !t.disabled && (Y.includes(e) ? z(Y.filter((t) => t !== e), J ?
|
|
42
|
-
}, { handleKeyDown:
|
|
41
|
+
t && !t.disabled && (Y.includes(e) ? z(Y.filter((t) => t !== e), J ? b.filter((t) => t.value !== e) : void 0) : z([...Y, e], J ? [...b, t] : void 0), H.current?.focus(), I && (q(""), B?.("")), F && G(!1));
|
|
42
|
+
}, { handleKeyDown: ve, comboboxProps: ye, listProps: be, getOptionProps: xe } = d({
|
|
43
43
|
id: U,
|
|
44
44
|
options: Z,
|
|
45
45
|
isOpen: W,
|
|
46
46
|
searchValue: K,
|
|
47
|
-
hasMore:
|
|
47
|
+
hasMore: E,
|
|
48
48
|
onOpen: () => G(!0),
|
|
49
49
|
onSelect: Q
|
|
50
|
-
}),
|
|
51
|
-
z(Y.filter((t) => t !== e), J ?
|
|
50
|
+
}), Se = (e) => {
|
|
51
|
+
z(Y.filter((t) => t !== e), J ? b.filter((t) => t.value !== e) : void 0);
|
|
52
52
|
}, $ = () => {
|
|
53
53
|
G(!1), B?.(""), q("");
|
|
54
|
-
},
|
|
54
|
+
}, Ce = () => {
|
|
55
55
|
z([], []), $();
|
|
56
56
|
};
|
|
57
57
|
re(() => {
|
|
58
58
|
V.current && (V.current.scrollLeft = W ? V.current.scrollWidth : 0);
|
|
59
59
|
}, [
|
|
60
60
|
X,
|
|
61
|
-
|
|
61
|
+
b,
|
|
62
62
|
W
|
|
63
63
|
]);
|
|
64
|
-
let
|
|
64
|
+
let we = () => {
|
|
65
65
|
let e = 0, t = (t) => {
|
|
66
66
|
let n = Y.includes(t.value);
|
|
67
67
|
return /* @__PURE__ */ g(o.Item, {
|
|
68
|
-
...
|
|
68
|
+
...xe(e++),
|
|
69
69
|
"aria-selected": n,
|
|
70
70
|
value: t.value,
|
|
71
71
|
label: t.label,
|
|
72
72
|
secondaryText: t.secondaryText,
|
|
73
73
|
disabled: t.disabled,
|
|
74
|
-
alignItemCenter:
|
|
74
|
+
alignItemCenter: ue,
|
|
75
75
|
selected: n,
|
|
76
76
|
onClick: Q,
|
|
77
|
-
className:
|
|
77
|
+
className: fe,
|
|
78
78
|
leftSection: t.leftSection,
|
|
79
79
|
rightSection: t.rightSection
|
|
80
80
|
}, String(t.value));
|
|
@@ -86,80 +86,81 @@ var v = ({ id: v, name: y, ref: b, values: x, options: S, label: ie, placeholder
|
|
|
86
86
|
children: e.options.map(t)
|
|
87
87
|
}, n)) : X.map(t);
|
|
88
88
|
};
|
|
89
|
-
return /* @__PURE__ */ _(
|
|
89
|
+
return /* @__PURE__ */ _(i, {
|
|
90
90
|
isOpen: W,
|
|
91
91
|
keepMounted: N,
|
|
92
92
|
width: "trigger",
|
|
93
93
|
onClose: $,
|
|
94
94
|
offset: 4,
|
|
95
|
-
children: [/* @__PURE__ */ g(
|
|
96
|
-
style:
|
|
97
|
-
onBlur:
|
|
98
|
-
onKeyDown:
|
|
99
|
-
className: e(f.root,
|
|
100
|
-
children: /* @__PURE__ */ g(
|
|
95
|
+
children: [/* @__PURE__ */ g(i.Trigger, {
|
|
96
|
+
style: pe,
|
|
97
|
+
onBlur: he,
|
|
98
|
+
onKeyDown: ve,
|
|
99
|
+
className: e(f.root, le && "uiFullWidth", C && f.disabled, de),
|
|
100
|
+
children: /* @__PURE__ */ g(a, {
|
|
101
101
|
bordered: !0,
|
|
102
102
|
fullWidth: !0,
|
|
103
103
|
keepLabel: !0,
|
|
104
|
-
value: K ||
|
|
104
|
+
value: K || b.length > 0 ? "filled" : "",
|
|
105
105
|
id: U,
|
|
106
|
-
label:
|
|
107
|
-
hasError:
|
|
108
|
-
size:
|
|
109
|
-
disabled:
|
|
110
|
-
onClear: P ?
|
|
106
|
+
label: ae,
|
|
107
|
+
hasError: k,
|
|
108
|
+
size: S,
|
|
109
|
+
disabled: C,
|
|
110
|
+
onClear: P ? Ce : void 0,
|
|
111
111
|
onClick: () => G((e) => !e),
|
|
112
112
|
inputRef: H,
|
|
113
113
|
hintLeftSection: L,
|
|
114
114
|
hintRightSection: R,
|
|
115
|
-
|
|
115
|
+
leftIcon: A,
|
|
116
|
+
rightIcon: /* @__PURE__ */ g(r, { className: e(f.chevron, W && f.chevronActive) }),
|
|
116
117
|
children: /* @__PURE__ */ _("div", {
|
|
117
118
|
ref: V,
|
|
118
119
|
className: f.tags,
|
|
119
|
-
children: [
|
|
120
|
+
children: [ge.map((e, t) => /* @__PURE__ */ _(n, {
|
|
120
121
|
variant: "light",
|
|
121
122
|
color: "neutral",
|
|
122
|
-
size:
|
|
123
|
+
size: S === "l" ? "s" : "xs",
|
|
123
124
|
className: f.tag,
|
|
124
125
|
children: [
|
|
125
126
|
e.leftSection,
|
|
126
127
|
e.label,
|
|
127
128
|
e.rightSection,
|
|
128
|
-
/* @__PURE__ */ g(
|
|
129
|
+
/* @__PURE__ */ g(ee, {
|
|
129
130
|
className: f.tagCloseIcon,
|
|
130
131
|
onClick: (t) => {
|
|
131
|
-
t.stopPropagation(),
|
|
132
|
+
t.stopPropagation(), Se(e.value);
|
|
132
133
|
}
|
|
133
134
|
})
|
|
134
135
|
]
|
|
135
|
-
}, t)), j && /* @__PURE__ */ g(
|
|
136
|
+
}, t)), j && /* @__PURE__ */ g(ne, {
|
|
136
137
|
id: U,
|
|
137
|
-
ref: t(H,
|
|
138
|
+
ref: t(H, ie),
|
|
138
139
|
name: y,
|
|
139
|
-
placeholder:
|
|
140
|
+
placeholder: oe,
|
|
140
141
|
value: K,
|
|
141
|
-
onChange:
|
|
142
|
-
...
|
|
142
|
+
onChange: _e,
|
|
143
|
+
...ye,
|
|
143
144
|
"aria-autocomplete": "list",
|
|
144
|
-
disabled:
|
|
145
|
+
disabled: C,
|
|
145
146
|
className: f.inputBase
|
|
146
147
|
})]
|
|
147
148
|
})
|
|
148
149
|
})
|
|
149
|
-
}), /* @__PURE__ */ g(
|
|
150
|
-
...
|
|
150
|
+
}), /* @__PURE__ */ g(i.Dropdown, { children: /* @__PURE__ */ g(o, {
|
|
151
|
+
...be,
|
|
151
152
|
"aria-multiselectable": !0,
|
|
152
|
-
loading:
|
|
153
|
-
skeletonCount:
|
|
154
|
-
size:
|
|
155
|
-
fullWidth:
|
|
156
|
-
customEmptyText:
|
|
157
|
-
maxHeight:
|
|
158
|
-
onLoadMore:
|
|
159
|
-
hasMore:
|
|
160
|
-
loadingMore:
|
|
161
|
-
loadMoreOffset:
|
|
162
|
-
children:
|
|
153
|
+
loading: me,
|
|
154
|
+
skeletonCount: w,
|
|
155
|
+
size: S === "l" ? "l" : "m",
|
|
156
|
+
fullWidth: !0,
|
|
157
|
+
customEmptyText: se,
|
|
158
|
+
maxHeight: ce,
|
|
159
|
+
onLoadMore: T,
|
|
160
|
+
hasMore: E,
|
|
161
|
+
loadingMore: D,
|
|
162
|
+
loadMoreOffset: O,
|
|
163
|
+
children: we()
|
|
163
164
|
}) })]
|
|
164
165
|
});
|
|
165
166
|
};
|
|
@@ -5,7 +5,7 @@ export declare const Sidebar: {
|
|
|
5
5
|
Items: ({ children }: import('react').PropsWithChildren) => import('react').JSX.Element;
|
|
6
6
|
Item: <T>({ children, icon, counter, rightSection, path, active, onClick, className, style, linkComponent: LinkComponent, linkProps, }: import('./SidebarItem/SidebarItem.types').SidebarItemProps<T>) => import('react').JSX.Element;
|
|
7
7
|
Group: ({ children, label, className, style, }: import('./SidebarGroup/SidebarGroup.types').SidebarGroupProps) => import('react').JSX.Element;
|
|
8
|
-
Collapse: <T>({ children, icon, label, counter, className, style, }: import('./SidebarCollapse/SidebarCollapse.types').SidebarCollapseProps) => import('react').JSX.Element;
|
|
8
|
+
Collapse: <T>({ children, icon, label, counter, rightSection, className, style, }: import('./SidebarCollapse/SidebarCollapse.types').SidebarCollapseProps) => import('react').JSX.Element;
|
|
9
9
|
Footer: ({ children, className, style, withDivider, }: import('./SidebarFooter/SidebarFooter.types').SidebarFooterProps) => import('react').JSX.Element;
|
|
10
10
|
Element: ({ children, icon, className, style, }: import('./SidebarElement/SidebarElement.types').SidebarElementProps) => import('react').JSX.Element;
|
|
11
11
|
Profile: ({ name, subtitle, avatar, rightSection, className, style, }: import('./SidebarProfile/SidebarProfile.types').SidebarProfileProps) => import('react').JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SidebarCollapseProps } from './SidebarCollapse.types';
|
|
2
|
-
export declare const SidebarCollapse: <T>({ children, icon, label, counter, className, style, }: SidebarCollapseProps) => import('react').JSX.Element;
|
|
2
|
+
export declare const SidebarCollapse: <T>({ children, icon, label, counter, rightSection, className, style, }: SidebarCollapseProps) => import('react').JSX.Element;
|
|
3
3
|
//# sourceMappingURL=SidebarCollapse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarCollapse.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/Sidebar/SidebarCollapse/SidebarCollapse.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAM/D,eAAO,MAAM,eAAe,GAAI,CAAC,EAAG,
|
|
1
|
+
{"version":3,"file":"SidebarCollapse.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/Sidebar/SidebarCollapse/SidebarCollapse.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAM/D,eAAO,MAAM,eAAe,GAAI,CAAC,EAAG,qEAQjC,oBAAoB,gCAkGtB,CAAC"}
|
|
@@ -7,52 +7,52 @@ import i from "../../../lib/components/Sidebar/SidebarItem/SidebarItem.module.js
|
|
|
7
7
|
import { SidebarItemContent as a } from "../SidebarItem/SidebarItemContent.js";
|
|
8
8
|
import o from "../../../lib/components/Sidebar/SidebarCollapse/SidebarCollapse.module.js";
|
|
9
9
|
import { Children as s, isValidElement as c, useEffect as l, useId as u } from "react";
|
|
10
|
-
import {
|
|
10
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
11
11
|
//#region src/lib/components/Sidebar/SidebarCollapse/SidebarCollapse.tsx
|
|
12
|
-
var
|
|
13
|
-
let
|
|
12
|
+
var m = ({ children: m, icon: h, label: g, counter: _, rightSection: v, className: y, style: b }) => {
|
|
13
|
+
let x = u(), { isCompactSize: S, openCollapseId: C, setOpenCollapseId: w, collapseGroupName: T } = r(), E = x === C, D = s.toArray(m).map((e) => c(e) ? e.props.active : !1).find(Boolean);
|
|
14
14
|
return l(() => {
|
|
15
|
-
|
|
15
|
+
D && w(x);
|
|
16
16
|
}, [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
]), /* @__PURE__ */
|
|
21
|
-
open:
|
|
22
|
-
name:
|
|
23
|
-
style:
|
|
17
|
+
D,
|
|
18
|
+
x,
|
|
19
|
+
w
|
|
20
|
+
]), /* @__PURE__ */ p("details", {
|
|
21
|
+
open: E,
|
|
22
|
+
name: T,
|
|
23
|
+
style: b,
|
|
24
24
|
onToggle: (e) => {
|
|
25
25
|
let { open: t } = e.currentTarget;
|
|
26
|
-
e.target === e.currentTarget && t !==
|
|
26
|
+
e.target === e.currentTarget && t !== E && w(t ? x : null);
|
|
27
27
|
},
|
|
28
|
-
className: e(o.sidebarCollapse,
|
|
29
|
-
children: [/* @__PURE__ */
|
|
30
|
-
"aria-label":
|
|
28
|
+
className: e(o.sidebarCollapse, y),
|
|
29
|
+
children: [/* @__PURE__ */ f("summary", {
|
|
30
|
+
"aria-label": g,
|
|
31
31
|
onClick: (e) => {
|
|
32
|
-
e.preventDefault(), !
|
|
32
|
+
e.preventDefault(), !S && w(E ? null : x);
|
|
33
33
|
},
|
|
34
|
-
className: e(i.sidebarItem,
|
|
35
|
-
children: /* @__PURE__ */
|
|
36
|
-
icon:
|
|
37
|
-
counter:
|
|
38
|
-
rightSection: /* @__PURE__ */ d("span", {
|
|
34
|
+
className: e(i.sidebarItem, S && i.sidebarItemCompact, D && (S || !E) && i.itemActive, o.summary),
|
|
35
|
+
children: /* @__PURE__ */ f(a, {
|
|
36
|
+
icon: h,
|
|
37
|
+
counter: _,
|
|
38
|
+
rightSection: /* @__PURE__ */ p(d, { children: [v, /* @__PURE__ */ f("span", {
|
|
39
39
|
className: o.collapseIcon,
|
|
40
40
|
"aria-hidden": "true",
|
|
41
|
-
children:
|
|
42
|
-
}),
|
|
43
|
-
children:
|
|
41
|
+
children: f(E ? t : n, {})
|
|
42
|
+
})] }),
|
|
43
|
+
children: g
|
|
44
44
|
})
|
|
45
|
-
}), !
|
|
45
|
+
}), !S && /* @__PURE__ */ f("div", {
|
|
46
46
|
className: o.clip,
|
|
47
|
-
children: /* @__PURE__ */
|
|
48
|
-
id:
|
|
47
|
+
children: /* @__PURE__ */ f("div", {
|
|
48
|
+
id: x,
|
|
49
49
|
role: "group",
|
|
50
|
-
"aria-label":
|
|
50
|
+
"aria-label": g,
|
|
51
51
|
className: o.collapseContent,
|
|
52
|
-
children:
|
|
52
|
+
children: m
|
|
53
53
|
})
|
|
54
54
|
})]
|
|
55
55
|
});
|
|
56
56
|
};
|
|
57
57
|
//#endregion
|
|
58
|
-
export {
|
|
58
|
+
export { m as SidebarCollapse };
|
|
@@ -17,6 +17,11 @@ export interface SidebarCollapseProps {
|
|
|
17
17
|
* The number to be displayed on the collapse button. Usually used for notifications.
|
|
18
18
|
*/
|
|
19
19
|
counter?: number | string;
|
|
20
|
+
/**
|
|
21
|
+
* Additional content to render on the right side of the collapse button,
|
|
22
|
+
* before the chevron icon.
|
|
23
|
+
*/
|
|
24
|
+
rightSection?: ReactNode;
|
|
20
25
|
/**
|
|
21
26
|
* Additional class names to apply to the collapse button.
|
|
22
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarCollapse.types.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/Sidebar/SidebarCollapse/SidebarCollapse.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;CACtB"}
|
|
1
|
+
{"version":3,"file":"SidebarCollapse.types.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/Sidebar/SidebarCollapse/SidebarCollapse.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE1B;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;CACtB"}
|
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>
|