@kolking/react-ui 1.5.0 → 1.7.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/dist/{Input-DbQTM4UI.js → Input-D46mAsdt.js} +1 -1
- package/dist/ValidationTooltip-D8d9O6Re.js +31 -0
- package/dist/components/Avatar/Avatar.js +29 -20
- package/dist/components/Badge/Badge.js +11 -11
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +13 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +40 -0
- package/dist/components/Breadcrumbs/index.d.ts +1 -0
- package/dist/components/Breadcrumbs/index.js +4 -0
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Dialog/Dialog.d.ts +9 -5
- package/dist/components/Dialog/Dialog.js +68 -45
- package/dist/components/Dialog/useDialog.d.ts +2 -1
- package/dist/components/Dialog/useDialog.js +29 -42
- package/dist/components/Dialog/withDialog.d.ts +1 -1
- package/dist/components/Fields/Checkbox.js +15 -15
- package/dist/components/Fields/Input.js +2 -2
- package/dist/components/Fields/Numeric.d.ts +8 -2
- package/dist/components/Fields/Numeric.js +22 -22
- package/dist/components/Fields/Radio.js +11 -11
- package/dist/components/Fields/Range.d.ts +20 -0
- package/dist/components/Fields/Range.js +54 -0
- package/dist/components/Fields/Select.js +1 -1
- package/dist/components/Fields/Switch.js +11 -11
- package/dist/components/Fields/Textarea.js +1 -1
- package/dist/components/Fields/ValidationTooltip.d.ts +1 -1
- package/dist/components/Fields/ValidationTooltip.js +3 -2
- package/dist/components/Fields/index.d.ts +1 -0
- package/dist/components/Fields/index.js +14 -12
- package/dist/components/Heading/Heading.js +12 -12
- package/dist/components/Icon/Icon.js +7 -7
- package/dist/components/Menu/Menu.d.ts +6 -2
- package/dist/components/Menu/Menu.js +57 -51
- package/dist/components/Menu/MenuContext.d.ts +1 -0
- package/dist/components/Menu/MenuItem.d.ts +2 -3
- package/dist/components/Menu/MenuItem.js +23 -29
- package/dist/components/Notice/Notice.js +30 -30
- package/dist/components/Progress/ProgressBar.js +30 -23
- package/dist/components/Progress/ProgressCircular.js +13 -12
- package/dist/components/Segmented/Segmented.js +42 -34
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/components/Tag/Tag.js +12 -12
- package/dist/components/ToggleButton/ToggleButton.d.ts +15 -1
- package/dist/components/ToggleButton/ToggleButton.js +17 -12
- package/dist/components/ToggleButton/ToggleGroup.js +34 -31
- package/dist/components/Tooltip/Tooltip.d.ts +2 -1
- package/dist/components/Tooltip/Tooltip.js +59 -56
- package/dist/index.d.ts +1 -0
- package/dist/index.js +66 -62
- package/dist/styles/_theme-default.scss +36 -35
- package/dist/styles/style.css +1 -1
- package/dist/styles.module-D1F3R7Vi.js +11 -0
- package/dist/utils/helpers.d.ts +1 -1
- package/dist/utils/helpers.js +3 -3
- package/package.json +3 -1
- package/dist/ValidationTooltip-BgSwl0hJ.js +0 -30
- package/dist/components/Dialog/DialogFocusTrap.d.ts +0 -2
- package/dist/components/Dialog/DialogFocusTrap.js +0 -17
- package/dist/styles.module-CUhWny5T.js +0 -11
|
@@ -1,78 +1,84 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { flushSync as
|
|
4
|
-
import { useFloating as
|
|
5
|
-
import
|
|
6
|
-
import { MenuContext as
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsxs as B, Fragment as L, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import O, { useState as r, useRef as p, useMemo as W, useEffect as _ } from "react";
|
|
3
|
+
import { flushSync as b } from "react-dom";
|
|
4
|
+
import { useFloating as k, offset as A, flip as D, size as H, autoUpdate as U, useInteractions as q, useDismiss as G, useRole as J, useClick as K, useListNavigation as Q, FloatingPortal as T, FloatingFocusManager as V, FloatingList as X } from "@floating-ui/react";
|
|
5
|
+
import Y from "classnames";
|
|
6
|
+
import { MenuContext as Z } from "./MenuContext.js";
|
|
7
|
+
import { cssProps as $ } from "../../utils/helpers.js";
|
|
8
|
+
import { s as ee } from "../../styles.module-D1F3R7Vi.js";
|
|
9
|
+
const me = ({
|
|
10
|
+
size: g,
|
|
11
|
+
placement: h = "bottom-start",
|
|
10
12
|
trigger: a,
|
|
11
|
-
minWidth:
|
|
12
|
-
maxWidth:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
minWidth: R,
|
|
14
|
+
maxWidth: v,
|
|
15
|
+
minHeight: x,
|
|
16
|
+
maxHeight: F,
|
|
17
|
+
className: P,
|
|
18
|
+
children: y,
|
|
19
|
+
onSelect: l,
|
|
20
|
+
...z
|
|
16
21
|
}) => {
|
|
17
|
-
const [
|
|
18
|
-
open:
|
|
19
|
-
placement:
|
|
22
|
+
const [m, c] = r(!1), [i, M] = r(null), [w, C] = r({}), u = p([]), f = p(null), { refs: o, context: e, floatingStyles: E } = k({
|
|
23
|
+
open: m,
|
|
24
|
+
placement: h,
|
|
20
25
|
onOpenChange: c,
|
|
21
|
-
whileElementsMounted:
|
|
26
|
+
whileElementsMounted: U,
|
|
22
27
|
middleware: [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
A(5),
|
|
29
|
+
D({ padding: 10 }),
|
|
30
|
+
H({
|
|
26
31
|
padding: 10,
|
|
27
|
-
apply({ rects: n, availableWidth: s, availableHeight:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
apply({ rects: n, availableWidth: s, availableHeight: j }) {
|
|
33
|
+
b(() => {
|
|
34
|
+
C({
|
|
35
|
+
minHeight: x,
|
|
36
|
+
minWidth: R ?? n.reference.width,
|
|
37
|
+
maxWidth: v ?? s,
|
|
38
|
+
maxHeight: F ?? j
|
|
33
39
|
});
|
|
34
40
|
});
|
|
35
41
|
}
|
|
36
42
|
})
|
|
37
43
|
]
|
|
38
|
-
}), { getReferenceProps:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
listRef:
|
|
44
|
+
}), { getReferenceProps: I, getFloatingProps: N, getItemProps: d } = q([
|
|
45
|
+
G(e),
|
|
46
|
+
J(e, { role: "menu" }),
|
|
47
|
+
K(e, { event: "mousedown" }),
|
|
48
|
+
Q(e, {
|
|
49
|
+
listRef: u,
|
|
44
50
|
loop: !0,
|
|
45
51
|
activeIndex: i,
|
|
46
|
-
onNavigate:
|
|
52
|
+
onNavigate: M
|
|
47
53
|
})
|
|
48
|
-
]), S =
|
|
49
|
-
() => ({ active: i, setOpen: c, getItemProps:
|
|
50
|
-
[i,
|
|
54
|
+
]), S = W(
|
|
55
|
+
() => ({ active: i, setOpen: c, getItemProps: d, onSelect: l }),
|
|
56
|
+
[i, d, l]
|
|
51
57
|
);
|
|
52
|
-
return
|
|
58
|
+
return _(() => {
|
|
53
59
|
var s;
|
|
54
60
|
const n = (s = o.domReference.current) == null ? void 0 : s.closest("[data-floating-root]");
|
|
55
|
-
n && (
|
|
56
|
-
}, [o]), /* @__PURE__ */
|
|
57
|
-
|
|
61
|
+
n && (f.current = n);
|
|
62
|
+
}, [o]), /* @__PURE__ */ B(L, { children: [
|
|
63
|
+
O.cloneElement(a, {
|
|
58
64
|
ref: o.setReference,
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
...I(a.props),
|
|
66
|
+
"data-menu-trigger": !0
|
|
61
67
|
}),
|
|
62
|
-
/* @__PURE__ */ t(
|
|
68
|
+
/* @__PURE__ */ t(Z.Provider, { value: S, children: m && /* @__PURE__ */ t(T, { root: f, children: /* @__PURE__ */ t(V, { context: e, modal: !1, initialFocus: -1, children: /* @__PURE__ */ t(
|
|
63
69
|
"div",
|
|
64
70
|
{
|
|
65
|
-
...
|
|
71
|
+
...z,
|
|
72
|
+
...N(),
|
|
66
73
|
ref: o.setFloating,
|
|
67
|
-
"data-menu":
|
|
68
|
-
className:
|
|
69
|
-
style: { ...
|
|
70
|
-
|
|
71
|
-
children: /* @__PURE__ */ t(K, { elementsRef: m, children: v })
|
|
74
|
+
"data-menu": !0,
|
|
75
|
+
className: Y(ee.menu, P),
|
|
76
|
+
style: { ...E, ...w, ...$({ size: g }) },
|
|
77
|
+
children: /* @__PURE__ */ t(X, { elementsRef: u, children: y })
|
|
72
78
|
}
|
|
73
79
|
) }) }) })
|
|
74
80
|
] });
|
|
75
81
|
};
|
|
76
82
|
export {
|
|
77
|
-
|
|
83
|
+
me as Menu
|
|
78
84
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export type MenuItemProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
2
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
1
|
+
export type MenuItemProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'title'> & {
|
|
3
2
|
scheme?: 'default' | 'negative' | 'positive' | 'warning';
|
|
4
3
|
icon?: React.ReactElement;
|
|
5
4
|
title?: React.ReactNode;
|
|
6
5
|
};
|
|
7
|
-
export declare const MenuItem: ({
|
|
6
|
+
export declare const MenuItem: ({ scheme, icon, title, children, className, onClick, ...props }: MenuItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,50 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useContext as
|
|
3
|
-
import { useListItem as
|
|
4
|
-
import
|
|
1
|
+
import { jsx as I, jsxs as g, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as j, useCallback as y } from "react";
|
|
3
|
+
import { useListItem as M } from "@floating-ui/react";
|
|
4
|
+
import N from "classnames";
|
|
5
5
|
import { MenuContext as w } from "./MenuContext.js";
|
|
6
|
-
import {
|
|
7
|
-
import { s as
|
|
8
|
-
|
|
9
|
-
return typeof t == "string" ? /* @__PURE__ */ i("span", { children: t }) : t;
|
|
10
|
-
}
|
|
11
|
-
const D = ({
|
|
12
|
-
size: t,
|
|
6
|
+
import { wrapNode as n } from "../../utils/helpers.js";
|
|
7
|
+
import { s as i } from "../../styles.module-D1F3R7Vi.js";
|
|
8
|
+
const B = ({
|
|
13
9
|
scheme: p = "default",
|
|
14
|
-
icon:
|
|
10
|
+
icon: u,
|
|
15
11
|
title: r,
|
|
16
12
|
children: s,
|
|
17
13
|
className: f,
|
|
18
|
-
|
|
19
|
-
onClick: e,
|
|
14
|
+
onClick: t,
|
|
20
15
|
...d
|
|
21
16
|
}) => {
|
|
22
|
-
const { active:
|
|
23
|
-
(
|
|
24
|
-
o(!1), e == null || e(
|
|
17
|
+
const { active: c, setOpen: o, getItemProps: x, onSelect: e } = j(w), { ref: b, index: m } = M(), a = m === c, l = y(
|
|
18
|
+
(v) => {
|
|
19
|
+
o(!1), e == null || e(m), t == null || t(v);
|
|
25
20
|
},
|
|
26
|
-
[o, e]
|
|
21
|
+
[m, o, e, t]
|
|
27
22
|
);
|
|
28
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ I(
|
|
29
24
|
"button",
|
|
30
25
|
{
|
|
31
26
|
...d,
|
|
32
27
|
ref: b,
|
|
33
28
|
type: "button",
|
|
34
29
|
role: "menuitem",
|
|
35
|
-
"data-menu":
|
|
36
|
-
"data-active":
|
|
37
|
-
tabIndex:
|
|
38
|
-
className:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
r && a(r)
|
|
30
|
+
"data-menu-item": !0,
|
|
31
|
+
"data-active": a,
|
|
32
|
+
tabIndex: a ? 0 : -1,
|
|
33
|
+
className: N(i.menuitem, i[p], f),
|
|
34
|
+
...x({ onClick: l }),
|
|
35
|
+
children: s ? n(s, "span") : /* @__PURE__ */ g(h, { children: [
|
|
36
|
+
u,
|
|
37
|
+
r !== void 0 && n(r, "span")
|
|
44
38
|
] })
|
|
45
39
|
}
|
|
46
40
|
);
|
|
47
41
|
};
|
|
48
42
|
export {
|
|
49
|
-
|
|
43
|
+
B as MenuItem
|
|
50
44
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsxs as i, jsx as
|
|
1
|
+
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import v from "classnames";
|
|
3
3
|
import { cssProps as p, getErrorMessage as y } from "../../utils/helpers.js";
|
|
4
4
|
import { Icon as w } from "../Icon/Icon.js";
|
|
5
|
-
const h = "
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
const h = "Notice_container_d9QoU", z = "Notice_content_cvC5c", j = "Notice_message_hI1yz", x = "Notice_accessory_AjvqC", C = "Notice_vertical_DsMZQ", F = "Notice_plain_l9FV5", I = "Notice_info_tgW7c", k = "Notice_error_ClIfR", M = "Notice_success_-vXfu", Q = "Notice_warning_zFUFN", U = "Notice_neutral_Vryzr", c = {
|
|
6
|
+
container: h,
|
|
7
|
+
content: z,
|
|
8
|
+
message: j,
|
|
9
|
+
accessory: x,
|
|
10
|
+
vertical: C,
|
|
11
|
+
plain: F,
|
|
12
|
+
info: I,
|
|
13
|
+
error: k,
|
|
14
|
+
success: M,
|
|
15
|
+
warning: Q,
|
|
16
|
+
neutral: U
|
|
17
17
|
}, a = {
|
|
18
18
|
info: "info-circle",
|
|
19
19
|
warning: "warning",
|
|
@@ -21,33 +21,33 @@ const h = "Notice_info_tgW7c", z = "Notice_error_ClIfR", j = "Notice_success_-vX
|
|
|
21
21
|
success: "checkmark-circle",
|
|
22
22
|
neutral: "info-outline"
|
|
23
23
|
}, E = ({
|
|
24
|
-
error:
|
|
25
|
-
scheme:
|
|
26
|
-
layout:
|
|
24
|
+
error: t,
|
|
25
|
+
scheme: e = t ? "error" : "neutral",
|
|
26
|
+
layout: n = "horizontal",
|
|
27
27
|
variant: l = "default",
|
|
28
28
|
size: _,
|
|
29
29
|
icon: s,
|
|
30
30
|
accessory: r,
|
|
31
31
|
margin: N,
|
|
32
|
-
padding:
|
|
33
|
-
className:
|
|
34
|
-
style:
|
|
35
|
-
children:
|
|
36
|
-
...
|
|
32
|
+
padding: d,
|
|
33
|
+
className: m,
|
|
34
|
+
style: u,
|
|
35
|
+
children: f,
|
|
36
|
+
...g
|
|
37
37
|
}) => /* @__PURE__ */ i(
|
|
38
38
|
"div",
|
|
39
39
|
{
|
|
40
|
-
...
|
|
41
|
-
"data-notice":
|
|
42
|
-
"data-layout":
|
|
43
|
-
className: v(c.container, c[
|
|
44
|
-
style: { ...
|
|
40
|
+
...g,
|
|
41
|
+
"data-notice": e,
|
|
42
|
+
"data-layout": n,
|
|
43
|
+
className: v(c.container, c[e], c[n], c[l], m),
|
|
44
|
+
style: { ...u, ...p({ size: _, margin: N, padding: d }) },
|
|
45
45
|
children: [
|
|
46
|
-
/* @__PURE__ */ i("div", { className: c.content, children: [
|
|
47
|
-
s !== void 0 ? s : a[
|
|
48
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ i("div", { "data-notice-content": !0, className: c.content, children: [
|
|
47
|
+
s !== void 0 ? s : a[e] && /* @__PURE__ */ o(w, { name: a[e] }),
|
|
48
|
+
/* @__PURE__ */ o("div", { "data-notice-message": !0, className: c.message, children: t ? y(t) : f })
|
|
49
49
|
] }),
|
|
50
|
-
r && /* @__PURE__ */
|
|
50
|
+
r && /* @__PURE__ */ o("div", { "data-notice-accessory": !0, className: c.accessory, children: r })
|
|
51
51
|
]
|
|
52
52
|
}
|
|
53
53
|
);
|
|
@@ -1,43 +1,50 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import u from "react";
|
|
3
3
|
import _ from "classnames";
|
|
4
|
-
import { cssProps as
|
|
5
|
-
const
|
|
6
|
-
progress:
|
|
7
|
-
|
|
8
|
-
}, R =
|
|
4
|
+
import { cssProps as v, clamp as b } from "../../utils/helpers.js";
|
|
5
|
+
const w = "Progress_progress_LSrhF", P = "Progress_indicator_KDwMt", e = {
|
|
6
|
+
progress: w,
|
|
7
|
+
indicator: P
|
|
8
|
+
}, R = u.forwardRef(
|
|
9
9
|
({
|
|
10
10
|
value: s,
|
|
11
11
|
width: o,
|
|
12
12
|
height: t,
|
|
13
13
|
color: i,
|
|
14
|
-
trackColor:
|
|
15
|
-
minWidth:
|
|
16
|
-
maxWidth:
|
|
17
|
-
margin:
|
|
18
|
-
style:
|
|
19
|
-
className:
|
|
20
|
-
...
|
|
21
|
-
},
|
|
22
|
-
const r = s ?
|
|
14
|
+
trackColor: n,
|
|
15
|
+
minWidth: c,
|
|
16
|
+
maxWidth: p,
|
|
17
|
+
margin: d,
|
|
18
|
+
style: m,
|
|
19
|
+
className: l,
|
|
20
|
+
...g
|
|
21
|
+
}, f) => {
|
|
22
|
+
const r = s ? b(s, 0, 100) : void 0;
|
|
23
23
|
return /* @__PURE__ */ a(
|
|
24
24
|
"div",
|
|
25
25
|
{
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
"aria-label": r ? `${r} percent` : "indeterminate",
|
|
27
|
+
...g,
|
|
28
|
+
ref: f,
|
|
28
29
|
role: "progressbar",
|
|
29
30
|
"aria-valuemin": 0,
|
|
30
31
|
"aria-valuemax": 100,
|
|
31
32
|
"aria-valuenow": r,
|
|
32
|
-
"
|
|
33
|
-
"data-progress": "bar",
|
|
33
|
+
"data-progress-bar": !0,
|
|
34
34
|
"data-progress-value": r ?? "indeterminate",
|
|
35
|
-
className: _(e.progress,
|
|
35
|
+
className: _(e.progress, l),
|
|
36
36
|
style: {
|
|
37
|
-
...
|
|
38
|
-
...
|
|
37
|
+
...m,
|
|
38
|
+
...v({ width: o, height: t, color: i, trackColor: n, minWidth: c, maxWidth: p, margin: d })
|
|
39
39
|
},
|
|
40
|
-
children: /* @__PURE__ */ a(
|
|
40
|
+
children: /* @__PURE__ */ a(
|
|
41
|
+
"span",
|
|
42
|
+
{
|
|
43
|
+
"data-progress-bar-indicator": !0,
|
|
44
|
+
className: e.indicator,
|
|
45
|
+
style: { width: `${r}%` }
|
|
46
|
+
}
|
|
47
|
+
)
|
|
41
48
|
}
|
|
42
49
|
);
|
|
43
50
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as c, jsx as
|
|
1
|
+
import { jsxs as c, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import j from "react";
|
|
3
3
|
import N from "classnames";
|
|
4
4
|
import { cssProps as k, clamp as w } from "../../utils/helpers.js";
|
|
5
|
-
const b = "Progress_inner_Zoiac", h = "Progress_container_tFVew", x = "Progress_range_uqjFb", y = "Progress_progress_MHEjj", C = "Progress_track_jWvrX",
|
|
5
|
+
const b = "Progress_inner_Zoiac", h = "Progress_container_tFVew", x = "Progress_range_uqjFb", y = "Progress_progress_MHEjj", C = "Progress_track_jWvrX", n = {
|
|
6
6
|
inner: b,
|
|
7
7
|
container: h,
|
|
8
8
|
range: x,
|
|
@@ -29,20 +29,21 @@ const H = j.forwardRef(
|
|
|
29
29
|
children: t,
|
|
30
30
|
...v
|
|
31
31
|
}, P) => {
|
|
32
|
-
const
|
|
32
|
+
const a = e !== null ? w(e, r, s) : void 0;
|
|
33
33
|
return /* @__PURE__ */ c(
|
|
34
34
|
"div",
|
|
35
35
|
{
|
|
36
|
+
"aria-label": a ? `${a} percent` : "indeterminate",
|
|
36
37
|
...v,
|
|
37
38
|
ref: P,
|
|
38
39
|
role: "progressbar",
|
|
39
40
|
"aria-valuemin": r,
|
|
40
41
|
"aria-valuemax": s,
|
|
41
|
-
"aria-valuenow":
|
|
42
|
-
"data-progress":
|
|
42
|
+
"aria-valuenow": a,
|
|
43
|
+
"data-progress-circular": !0,
|
|
43
44
|
"data-countdown": l,
|
|
44
|
-
"data-progress-value":
|
|
45
|
-
className: N(
|
|
45
|
+
"data-progress-value": a ?? "indeterminate",
|
|
46
|
+
className: N(n.container, _),
|
|
46
47
|
style: {
|
|
47
48
|
...f,
|
|
48
49
|
...k({
|
|
@@ -52,15 +53,15 @@ const H = j.forwardRef(
|
|
|
52
53
|
color: d,
|
|
53
54
|
trackColor: p,
|
|
54
55
|
margin: m,
|
|
55
|
-
value: F(r, s,
|
|
56
|
+
value: F(r, s, a)
|
|
56
57
|
})
|
|
57
58
|
},
|
|
58
59
|
children: [
|
|
59
|
-
/* @__PURE__ */ c("svg", { "aria-hidden": !0, className:
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ c("svg", { "aria-hidden": !0, className: n.progress, children: [
|
|
61
|
+
/* @__PURE__ */ o("circle", { fill: "none", className: n.track }),
|
|
62
|
+
/* @__PURE__ */ o("circle", { fill: "none", className: n.range })
|
|
62
63
|
] }),
|
|
63
|
-
t && /* @__PURE__ */
|
|
64
|
+
t && /* @__PURE__ */ o("div", { className: n.inner, children: t })
|
|
64
65
|
]
|
|
65
66
|
}
|
|
66
67
|
);
|
|
@@ -1,49 +1,57 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import i from "classnames";
|
|
3
|
+
import { Composite as l, CompositeItem as h } from "@floating-ui/react";
|
|
4
|
+
import { cssProps as f, wrapNode as u } from "../../utils/helpers.js";
|
|
5
|
+
const S = "Segmented_segmented_UOs8Z", y = {
|
|
6
|
+
segmented: S
|
|
7
|
+
}, _ = ({
|
|
8
|
+
size: s,
|
|
9
|
+
items: r,
|
|
9
10
|
selected: t,
|
|
10
|
-
disabled:
|
|
11
|
-
margin:
|
|
12
|
-
className:
|
|
13
|
-
style:
|
|
14
|
-
onSelect:
|
|
15
|
-
...
|
|
16
|
-
}) => /* @__PURE__ */
|
|
17
|
-
|
|
11
|
+
disabled: m,
|
|
12
|
+
margin: n,
|
|
13
|
+
className: a,
|
|
14
|
+
style: d,
|
|
15
|
+
onSelect: g,
|
|
16
|
+
...p
|
|
17
|
+
}) => /* @__PURE__ */ o(
|
|
18
|
+
l,
|
|
18
19
|
{
|
|
19
|
-
...
|
|
20
|
+
...p,
|
|
20
21
|
role: "radiogroup",
|
|
21
|
-
"data-segmented":
|
|
22
|
-
|
|
22
|
+
"data-segmented": !0,
|
|
23
|
+
"data-disabled": m,
|
|
24
|
+
className: i(y.segmented, a),
|
|
23
25
|
style: {
|
|
24
|
-
...
|
|
25
|
-
...
|
|
26
|
-
size:
|
|
27
|
-
margin:
|
|
28
|
-
length:
|
|
26
|
+
...d,
|
|
27
|
+
...f({
|
|
28
|
+
size: s,
|
|
29
|
+
margin: n,
|
|
30
|
+
length: r.length.toString(),
|
|
29
31
|
selected: t.toString()
|
|
30
32
|
})
|
|
31
33
|
},
|
|
32
|
-
children:
|
|
33
|
-
|
|
34
|
+
children: r.map((c, e) => /* @__PURE__ */ o(
|
|
35
|
+
h,
|
|
34
36
|
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
render: /* @__PURE__ */ o(
|
|
38
|
+
"button",
|
|
39
|
+
{
|
|
40
|
+
role: "radio",
|
|
41
|
+
type: "button",
|
|
42
|
+
disabled: m,
|
|
43
|
+
"data-segmented-item": e,
|
|
44
|
+
"aria-checked": e === t,
|
|
45
|
+
"data-selected": e === t,
|
|
46
|
+
onClick: () => e !== t && g(e),
|
|
47
|
+
children: u(c, "span")
|
|
48
|
+
}
|
|
49
|
+
)
|
|
42
50
|
},
|
|
43
51
|
e
|
|
44
52
|
))
|
|
45
53
|
}
|
|
46
54
|
);
|
|
47
55
|
export {
|
|
48
|
-
|
|
56
|
+
_ as Segmented
|
|
49
57
|
};
|
|
@@ -11,10 +11,10 @@ const f = "Spinner_container_CGGmW", g = "Spinner_spinner_vU3LR", S = "Spinner_t
|
|
|
11
11
|
({ size: e, color: a, overlay: s, overlayColor: i, className: t, style: o, ...c }, l) => /* @__PURE__ */ r(
|
|
12
12
|
"span",
|
|
13
13
|
{
|
|
14
|
+
"aria-label": "loading",
|
|
14
15
|
...c,
|
|
15
16
|
ref: l,
|
|
16
17
|
role: "status",
|
|
17
|
-
"aria-label": "loading",
|
|
18
18
|
"data-spinner": !0,
|
|
19
19
|
"data-overlay": s,
|
|
20
20
|
className: d(n.container, t),
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n, jsxs as f, Fragment as T } from "react/jsx-runtime";
|
|
2
2
|
import c from "classnames";
|
|
3
3
|
import { wrapNode as t, cssProps as p } from "../../utils/helpers.js";
|
|
4
4
|
const y = "Tag_tag_-ovOm", _ = {
|
|
5
5
|
tag: y,
|
|
6
6
|
"default-gray": "Tag_default-gray_Ju2wo",
|
|
7
7
|
"solid-gray": "Tag_solid-gray_q6GO4",
|
|
8
|
+
"default-brown": "Tag_default-brown_csCrz",
|
|
9
|
+
"solid-brown": "Tag_solid-brown_5IxVx",
|
|
8
10
|
"default-red": "Tag_default-red_5NeXY",
|
|
9
11
|
"solid-red": "Tag_solid-red_uPhj-",
|
|
10
12
|
"default-orange": "Tag_default-orange_fuy0F",
|
|
@@ -23,8 +25,6 @@ const y = "Tag_tag_-ovOm", _ = {
|
|
|
23
25
|
"solid-indigo": "Tag_solid-indigo_2gfJj",
|
|
24
26
|
"default-purple": "Tag_default-purple_oBbek",
|
|
25
27
|
"solid-purple": "Tag_solid-purple_e10WH",
|
|
26
|
-
"default-brown": "Tag_default-brown_csCrz",
|
|
27
|
-
"solid-brown": "Tag_solid-brown_5IxVx",
|
|
28
28
|
"default-accent": "Tag_default-accent_uUXnO",
|
|
29
29
|
"solid-accent": "Tag_solid-accent_bbTSM"
|
|
30
30
|
}, j = ({
|
|
@@ -33,23 +33,23 @@ const y = "Tag_tag_-ovOm", _ = {
|
|
|
33
33
|
scheme: l = "gray",
|
|
34
34
|
title: e,
|
|
35
35
|
icon: d,
|
|
36
|
-
iconPosition:
|
|
36
|
+
iconPosition: o = "start",
|
|
37
37
|
className: r,
|
|
38
38
|
style: u,
|
|
39
|
-
children:
|
|
40
|
-
...
|
|
41
|
-
}) => /* @__PURE__ */
|
|
39
|
+
children: g,
|
|
40
|
+
...i
|
|
41
|
+
}) => /* @__PURE__ */ n(
|
|
42
42
|
"span",
|
|
43
43
|
{
|
|
44
|
-
...
|
|
44
|
+
...i,
|
|
45
45
|
"data-tag": a,
|
|
46
46
|
"data-scheme": l,
|
|
47
47
|
className: c(_.tag, _[`${a}-${l}`], r),
|
|
48
48
|
style: { ...u, ...p({ size: s }) },
|
|
49
|
-
children:
|
|
50
|
-
|
|
51
|
-
e && t(e, "span"),
|
|
52
|
-
|
|
49
|
+
children: g ? t(g, "span") : /* @__PURE__ */ f(T, { children: [
|
|
50
|
+
o === "start" && d,
|
|
51
|
+
e !== void 0 && t(e, "span"),
|
|
52
|
+
o === "end" && d
|
|
53
53
|
] })
|
|
54
54
|
}
|
|
55
55
|
);
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { ButtonProps } from '../Button';
|
|
2
3
|
export type ToggleButtonProps = Omit<ButtonProps, 'variant'> & {
|
|
3
4
|
selected?: boolean;
|
|
4
5
|
};
|
|
5
|
-
export declare const ToggleButton:
|
|
6
|
+
export declare const ToggleButton: React.ForwardRefExoticComponent<Omit<ButtonProps, "variant"> & {
|
|
7
|
+
selected?: boolean;
|
|
8
|
+
} & React.RefAttributes<(<T extends React.ElementType = "button">(props: {
|
|
9
|
+
as?: T | undefined;
|
|
10
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
11
|
+
variant?: "primary" | "secondary" | "tertiary";
|
|
12
|
+
scheme?: "default" | "negative" | "positive" | "warning";
|
|
13
|
+
minWidth?: React.CSSProperties["minWidth"];
|
|
14
|
+
maxWidth?: React.CSSProperties["maxWidth"];
|
|
15
|
+
busy?: boolean;
|
|
16
|
+
title?: React.ReactNode;
|
|
17
|
+
icon?: React.ReactElement;
|
|
18
|
+
iconPosition?: "start" | "end";
|
|
19
|
+
} & Omit<React.PropsWithoutRef<React.ComponentProps<T>>, "title" | "size" | "as" | "icon" | "scheme" | "minWidth" | "maxWidth" | "variant" | "busy" | "iconPosition"> & React.RefAttributes<unknown>) => React.ReactElement | null)>>;
|