@kolking/react-ui 1.6.0 → 1.7.1
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/Avatar/Avatar.js +29 -20
- package/dist/components/Badge/Badge.js +11 -11
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +6 -4
- package/dist/components/Breadcrumbs/Breadcrumbs.js +13 -13
- package/dist/components/Dialog/Dialog.js +8 -8
- package/dist/components/Fields/Checkbox.js +15 -15
- 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.js +23 -23
- package/dist/components/Fields/Switch.js +8 -8
- package/dist/components/Heading/Heading.js +12 -12
- package/dist/components/Icon/Icon.js +7 -7
- package/dist/components/Notice/Notice.js +28 -28
- 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.js +22 -22
- package/dist/styles/_theme-default.scss +36 -35
- package/dist/styles/style.css +1 -1
- package/package.json +2 -1
|
@@ -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)>>;
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import d from "react";
|
|
3
|
+
import { Button as f } from "../Button/Button.js";
|
|
4
|
+
const e = d.forwardRef(
|
|
5
|
+
({ selected: a = !1, role: o, ...r }, t) => /* @__PURE__ */ i(
|
|
6
|
+
f,
|
|
7
|
+
{
|
|
8
|
+
...r,
|
|
9
|
+
ref: t,
|
|
10
|
+
role: o,
|
|
11
|
+
"data-toggle-button": !0,
|
|
12
|
+
"data-selected": a,
|
|
13
|
+
variant: a ? "primary" : "secondary",
|
|
14
|
+
"aria-checked": o === "radio" ? a : void 0,
|
|
15
|
+
"aria-pressed": o !== "radio" ? a : void 0
|
|
16
|
+
}
|
|
17
|
+
)
|
|
13
18
|
);
|
|
14
19
|
export {
|
|
15
|
-
|
|
20
|
+
e as ToggleButton
|
|
16
21
|
};
|
|
@@ -1,43 +1,46 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import x from "
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import t from "react";
|
|
3
|
+
import { Composite as _, CompositeItem as x } from "@floating-ui/react";
|
|
4
|
+
import h from "classnames";
|
|
5
|
+
import { cssProps as k } from "../../utils/helpers.js";
|
|
6
|
+
const B = "ToggleButton_group_yo9Nc", l = {
|
|
7
|
+
group: B
|
|
8
|
+
}, E = ({
|
|
8
9
|
variant: o = "inline",
|
|
9
|
-
selected:
|
|
10
|
-
disabled:
|
|
11
|
-
equalWidth:
|
|
12
|
-
minWidth:
|
|
13
|
-
maxWidth:
|
|
10
|
+
selected: s,
|
|
11
|
+
disabled: p,
|
|
12
|
+
equalWidth: i,
|
|
13
|
+
minWidth: m,
|
|
14
|
+
maxWidth: c,
|
|
14
15
|
className: n,
|
|
15
16
|
style: g,
|
|
16
|
-
children:
|
|
17
|
-
onSelect:
|
|
18
|
-
...
|
|
17
|
+
children: u,
|
|
18
|
+
onSelect: d,
|
|
19
|
+
...a
|
|
19
20
|
}) => {
|
|
20
|
-
const
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
|
|
21
|
+
const f = o === "block" ? "flex" : void 0, y = i ? "0" : void 0;
|
|
22
|
+
return /* @__PURE__ */ e(
|
|
23
|
+
_,
|
|
23
24
|
{
|
|
24
|
-
...
|
|
25
|
+
...a,
|
|
25
26
|
role: "radiogroup",
|
|
26
27
|
"data-toggle-group": !0,
|
|
27
|
-
className:
|
|
28
|
-
style: { ...g, ...
|
|
29
|
-
children:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
className: h(l.group, l[o], n),
|
|
29
|
+
style: { ...g, ...k({ display: f, flexBasis: y, minWidth: m, maxWidth: c }) },
|
|
30
|
+
children: t.Children.map(u, (C, r) => /* @__PURE__ */ e(
|
|
31
|
+
x,
|
|
32
|
+
{
|
|
33
|
+
render: t.cloneElement(C, {
|
|
34
|
+
role: "radio",
|
|
35
|
+
disabled: p,
|
|
36
|
+
selected: r === s,
|
|
37
|
+
onClick: () => d(r)
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
))
|
|
38
41
|
}
|
|
39
42
|
);
|
|
40
43
|
};
|
|
41
44
|
export {
|
|
42
|
-
|
|
45
|
+
E as ToggleGroup
|
|
43
46
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as m, Fragment as S, jsx as
|
|
1
|
+
import { jsxs as m, Fragment as S, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import j, { useRef as w, useState as g, useEffect as R } from "react";
|
|
3
3
|
import k from "classnames";
|
|
4
4
|
import { useFloating as C, offset as U, flip as W, shift as b, arrow as A, autoUpdate as B, useInteractions as D, useDismiss as H, useRole as I, useHover as V, useFocus as $, useClick as q, useMergeRefs as z, FloatingPortal as G, FloatingArrow as J } from "@floating-ui/react";
|
|
5
|
-
const K = "Tooltip_tooltip_u1Uix", L = "Tooltip_arrow_NBFiV", Q = "Tooltip_content_lfpfM",
|
|
5
|
+
const K = "Tooltip_tooltip_u1Uix", L = "Tooltip_arrow_NBFiV", Q = "Tooltip_content_lfpfM", f = {
|
|
6
6
|
tooltip: K,
|
|
7
7
|
arrow: L,
|
|
8
8
|
content: Q
|
|
9
|
-
},
|
|
9
|
+
}, et = ({
|
|
10
10
|
trigger: r = "hover focus",
|
|
11
11
|
placement: c = "top",
|
|
12
12
|
anchor: l,
|
|
@@ -18,7 +18,7 @@ const K = "Tooltip_tooltip_u1Uix", L = "Tooltip_arrow_NBFiV", Q = "Tooltip_conte
|
|
|
18
18
|
children: o,
|
|
19
19
|
...x
|
|
20
20
|
}) => {
|
|
21
|
-
const u = w(null), p = w(null), [d, O] = g(!1), [N, P] = g(!1), { refs:
|
|
21
|
+
const u = w(null), p = w(null), [d, O] = g(!1), [N, P] = g(!1), { refs: t, context: e, floatingStyles: T } = C({
|
|
22
22
|
open: d,
|
|
23
23
|
placement: c,
|
|
24
24
|
onOpenChange: O,
|
|
@@ -32,50 +32,50 @@ const K = "Tooltip_tooltip_u1Uix", L = "Tooltip_arrow_NBFiV", Q = "Tooltip_conte
|
|
|
32
32
|
), { element: u, padding: 8 }))
|
|
33
33
|
]
|
|
34
34
|
}), { getReferenceProps: y, getFloatingProps: E } = D([
|
|
35
|
-
H(
|
|
36
|
-
I(
|
|
37
|
-
V(
|
|
38
|
-
$(
|
|
39
|
-
q(
|
|
35
|
+
H(e),
|
|
36
|
+
I(e, { role: "tooltip" }),
|
|
37
|
+
V(e, { move: !1, enabled: r.includes("hover") }),
|
|
38
|
+
$(e, { enabled: r.includes("focus") }),
|
|
39
|
+
q(e, { enabled: r.includes("click") })
|
|
40
40
|
]), M = z([
|
|
41
|
-
|
|
41
|
+
t.setReference,
|
|
42
42
|
"ref" in o ? o.ref : null
|
|
43
43
|
]);
|
|
44
44
|
return R(() => {
|
|
45
45
|
var n;
|
|
46
|
-
const s = (n =
|
|
46
|
+
const s = (n = t.domReference.current) == null ? void 0 : n.closest("[data-floating-root]");
|
|
47
47
|
!i && s && (p.current = s);
|
|
48
|
-
}, [
|
|
49
|
-
l &&
|
|
50
|
-
}, [
|
|
48
|
+
}, [t, i]), R(() => {
|
|
49
|
+
l && t.setPositionReference(l);
|
|
50
|
+
}, [t, l]), i ? o : /* @__PURE__ */ m(S, { children: [
|
|
51
51
|
j.cloneElement(o, y({ ref: M, ...o.props })),
|
|
52
|
-
d && /* @__PURE__ */
|
|
52
|
+
d && /* @__PURE__ */ a(G, { root: p, children: /* @__PURE__ */ m(
|
|
53
53
|
"div",
|
|
54
54
|
{
|
|
55
55
|
...x,
|
|
56
|
-
ref:
|
|
56
|
+
ref: t.setFloating,
|
|
57
57
|
"data-tooltip": c,
|
|
58
|
-
className: k(
|
|
58
|
+
className: k(f.tooltip, v),
|
|
59
59
|
style: { ...T, minWidth: F, maxWidth: _ },
|
|
60
60
|
...E(),
|
|
61
61
|
children: [
|
|
62
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ a(
|
|
63
63
|
J,
|
|
64
64
|
{
|
|
65
65
|
width: 12,
|
|
66
66
|
height: 6,
|
|
67
67
|
ref: u,
|
|
68
|
-
context:
|
|
69
|
-
className:
|
|
68
|
+
context: e,
|
|
69
|
+
className: f.arrow,
|
|
70
70
|
staticOffset: N ? 8 : null
|
|
71
71
|
}
|
|
72
72
|
),
|
|
73
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ a("div", { "data-tooltip-content": !0, className: f.content, children: h })
|
|
74
74
|
]
|
|
75
75
|
}
|
|
76
76
|
) })
|
|
77
77
|
] });
|
|
78
78
|
};
|
|
79
79
|
export {
|
|
80
|
-
|
|
80
|
+
et as Tooltip
|
|
81
81
|
};
|
|
@@ -5,10 +5,11 @@ $font-family: (
|
|
|
5
5
|
);
|
|
6
6
|
|
|
7
7
|
$font-weight: (
|
|
8
|
-
normal:
|
|
9
|
-
medium:
|
|
10
|
-
bold:
|
|
11
|
-
black:
|
|
8
|
+
normal: 400,
|
|
9
|
+
medium: 600,
|
|
10
|
+
bold: 700,
|
|
11
|
+
black: 800,
|
|
12
|
+
heading: 700,
|
|
12
13
|
);
|
|
13
14
|
|
|
14
15
|
$font-size: (
|
|
@@ -66,11 +67,11 @@ $ease-out-bounce: cubic-bezier(0.1, 1.3, 0.7, 1.1);
|
|
|
66
67
|
$light-colors: (
|
|
67
68
|
black: #000000,
|
|
68
69
|
white: #FFFFFF,
|
|
69
|
-
fg: #
|
|
70
|
+
fg: #101010,
|
|
70
71
|
bg: #FFFFFF,
|
|
72
|
+
input: #FFFFFF,
|
|
71
73
|
popup: #FFFFFF,
|
|
72
74
|
dialog: #FFFFFF,
|
|
73
|
-
input: #FFFFFF,
|
|
74
75
|
backdrop: rgb(0 0 0 / 50%),
|
|
75
76
|
focus: var(--color-accent-400),
|
|
76
77
|
link: var(--color-blue-500),
|
|
@@ -79,28 +80,28 @@ $light-colors: (
|
|
|
79
80
|
);
|
|
80
81
|
|
|
81
82
|
$dark-colors: (
|
|
82
|
-
fg: #
|
|
83
|
-
bg: #
|
|
84
|
-
|
|
83
|
+
fg: #F0F0F0,
|
|
84
|
+
bg: #131313,
|
|
85
|
+
input: #0C0C0C,
|
|
86
|
+
popup: #202020,
|
|
85
87
|
dialog: #191919,
|
|
86
|
-
|
|
87
|
-
backdrop: rgb(0 0 0 / 65%),
|
|
88
|
+
backdrop: rgb(0 0 0 / 70%),
|
|
88
89
|
);
|
|
89
90
|
|
|
90
91
|
$light-palette: (
|
|
91
92
|
colors: (
|
|
92
|
-
gray: #
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
accent: #
|
|
93
|
+
gray: #8D8D96,
|
|
94
|
+
brown: #A08060,
|
|
95
|
+
red: #F03020,
|
|
96
|
+
orange: #FF8000,
|
|
97
|
+
yellow: #FFBB00,
|
|
98
|
+
green: #20B610,
|
|
99
|
+
teal: #30B0C0,
|
|
100
|
+
cyan: #30B0F0,
|
|
101
|
+
blue: #0070F7,
|
|
102
|
+
indigo: #6056ED,
|
|
103
|
+
purple: #A949D9,
|
|
104
|
+
accent: #0070F7,
|
|
104
105
|
),
|
|
105
106
|
tints: (
|
|
106
107
|
50: 95%,
|
|
@@ -117,18 +118,18 @@ $light-palette: (
|
|
|
117
118
|
|
|
118
119
|
$dark-palette: (
|
|
119
120
|
colors: (
|
|
120
|
-
gray: #
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
accent: #
|
|
121
|
+
gray: #656573,
|
|
122
|
+
brown: #A08060,
|
|
123
|
+
red: #F03020,
|
|
124
|
+
orange: #FF8000,
|
|
125
|
+
yellow: #FFBB00,
|
|
126
|
+
green: #20B610,
|
|
127
|
+
teal: #30B0C0,
|
|
128
|
+
cyan: #30B0F0,
|
|
129
|
+
blue: #0080FF,
|
|
130
|
+
indigo: #7369FF,
|
|
131
|
+
purple: #B353E3,
|
|
132
|
+
accent: #0080FF,
|
|
132
133
|
),
|
|
133
134
|
tints: (
|
|
134
135
|
50: 95%,
|