@kolking/react-ui 1.6.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/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 +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.js +22 -22
- package/dist/styles/_theme-default.scss +36 -35
- package/dist/styles/style.css +1 -1
- package/package.json +2 -1
|
@@ -1,42 +1,51 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import * as
|
|
4
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as _, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import h from "classnames";
|
|
3
|
+
import * as m from "react";
|
|
4
|
+
import { forwardRef as S, useMemo as x, useState as A, useEffect as N, useCallback as E } from "react";
|
|
5
5
|
import { cssProps as C } from "../../utils/helpers.js";
|
|
6
6
|
import { getStringColor as k, getGravatarUri as M, getInitials as R } from "./helpers.js";
|
|
7
|
-
const b = (a,
|
|
7
|
+
const b = (a, t) => /* @__PURE__ */ m.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 50 50", ref: t, ...a }, /* @__PURE__ */ m.createElement("path", { fill: "currentColor", d: "M25 31c4.97 0 9-4.253 9-9.5S29.97 12 25 12s-9 4.253-9 9.5 4.03 9.5 9 9.5Zm19 19c0-8.837-8.507-15-19-15S6 41.163 6 50h38Z" })), j = S(b), y = "Avatar_avatar_PNlL5", I = "Avatar_image_Jwmxk", P = "Avatar_initials_i0r2T", e = {
|
|
8
8
|
avatar: y,
|
|
9
|
-
image:
|
|
10
|
-
|
|
9
|
+
image: I,
|
|
10
|
+
initials: P,
|
|
11
11
|
default: "Avatar_default_v75Mg"
|
|
12
12
|
}, J = ({
|
|
13
13
|
size: a = 50,
|
|
14
|
-
name:
|
|
14
|
+
name: t,
|
|
15
15
|
email: o,
|
|
16
|
-
src:
|
|
16
|
+
src: c,
|
|
17
17
|
colorize: v,
|
|
18
18
|
className: d,
|
|
19
|
-
style:
|
|
20
|
-
children:
|
|
19
|
+
style: u,
|
|
20
|
+
children: g,
|
|
21
21
|
...f
|
|
22
22
|
}) => {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const r = t == null ? void 0 : t.trim(), p = v && r ? k(r) : void 0, s = x(() => c || (o ? M(a, o) : void 0), [c, a, o]), [l, n] = A(s);
|
|
24
|
+
N(() => {
|
|
25
|
+
n(s);
|
|
26
26
|
}, [s]);
|
|
27
27
|
const w = E(() => {
|
|
28
|
-
|
|
28
|
+
n(void 0);
|
|
29
29
|
}, []);
|
|
30
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ _(
|
|
31
31
|
"div",
|
|
32
32
|
{
|
|
33
33
|
...f,
|
|
34
34
|
"data-avatar": !0,
|
|
35
|
-
className:
|
|
36
|
-
style: { ...
|
|
35
|
+
className: h(e.avatar, d),
|
|
36
|
+
style: { ...u, ...C({ size: a, backgroundColor: p }) },
|
|
37
37
|
children: [
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
l ? /* @__PURE__ */ i(
|
|
39
|
+
"img",
|
|
40
|
+
{
|
|
41
|
+
"data-avatar-image": !0,
|
|
42
|
+
className: e.image,
|
|
43
|
+
src: l,
|
|
44
|
+
alt: r ?? "",
|
|
45
|
+
onError: w
|
|
46
|
+
}
|
|
47
|
+
) : r ? /* @__PURE__ */ i("span", { "data-avatar-initials": !0, className: e.initials, children: R(r) }) : /* @__PURE__ */ i(j, { "aria-hidden": !0, "data-avatar-default": !0, className: e.default }),
|
|
48
|
+
g
|
|
40
49
|
]
|
|
41
50
|
}
|
|
42
51
|
);
|
|
@@ -2,19 +2,19 @@ import { jsx as B } from "react/jsx-runtime";
|
|
|
2
2
|
import b from "classnames";
|
|
3
3
|
import { useRef as m, useEffect as h } from "react";
|
|
4
4
|
import { cssProps as w } from "../../utils/helpers.js";
|
|
5
|
-
const E = "Badge_badge_-mEE7", M = "Badge_gray_7jA-J", P = "
|
|
5
|
+
const E = "Badge_badge_-mEE7", M = "Badge_gray_7jA-J", P = "Badge_brown_x1GS7", x = "Badge_red_zPgCR", H = "Badge_orange_EoLmF", I = "Badge_yellow_qvbb6", R = "Badge_green_XX-1c", X = "Badge_teal_VHoFK", j = "Badge_cyan_1ksBn", C = "Badge_blue_YulfT", F = "Badge_indigo_2KXUy", K = "Badge_purple_o55fQ", O = "Badge_accent_BIYve", d = {
|
|
6
6
|
badge: E,
|
|
7
7
|
gray: M,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
brown: P,
|
|
9
|
+
red: x,
|
|
10
|
+
orange: H,
|
|
11
|
+
yellow: I,
|
|
12
|
+
green: R,
|
|
13
|
+
teal: X,
|
|
14
|
+
cyan: j,
|
|
15
|
+
blue: C,
|
|
16
|
+
indigo: F,
|
|
17
|
+
purple: K,
|
|
18
18
|
accent: O
|
|
19
19
|
}, q = ({
|
|
20
20
|
size: l,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
2
|
+
import { PolymorphicProps } from '../../utils/helpers';
|
|
3
|
+
export type Breadcrumb<T extends React.ElementType = 'a'> = PolymorphicProps<T, {
|
|
4
|
+
as?: T;
|
|
3
5
|
label: React.ReactNode;
|
|
4
|
-
}
|
|
5
|
-
export type BreadcrumbsProps = React.
|
|
6
|
+
}>;
|
|
7
|
+
export type BreadcrumbsProps = React.OlHTMLAttributes<HTMLOListElement> & {
|
|
6
8
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
7
|
-
items: Breadcrumb[];
|
|
9
|
+
items: Breadcrumb<React.ElementType>[];
|
|
8
10
|
separator?: React.ReactNode;
|
|
9
11
|
margin?: React.CSSProperties['margin'];
|
|
10
12
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { cssProps as
|
|
4
|
-
const
|
|
5
|
-
breadcrumbs:
|
|
6
|
-
},
|
|
1
|
+
import { jsx as a, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import h from "classnames";
|
|
3
|
+
import { cssProps as f } from "../../utils/helpers.js";
|
|
4
|
+
const g = "Breadcrumbs_breadcrumbs_a3ubb", j = {
|
|
5
|
+
breadcrumbs: g
|
|
6
|
+
}, v = ({
|
|
7
7
|
size: t,
|
|
8
8
|
items: s = [],
|
|
9
9
|
separator: b = "›",
|
|
@@ -16,13 +16,13 @@ const f = "Breadcrumbs_breadcrumbs_a3ubb", g = {
|
|
|
16
16
|
{
|
|
17
17
|
...n,
|
|
18
18
|
"data-breadcrumbs": !0,
|
|
19
|
-
className:
|
|
20
|
-
style: { ...m, ...
|
|
21
|
-
children: s.map(({ label: u, ...e }, r) => {
|
|
22
|
-
const c = r === s.length - 1,
|
|
23
|
-
return /* @__PURE__ */
|
|
19
|
+
className: h(j.breadcrumbs, o),
|
|
20
|
+
style: { ...m, ...f({ size: t, margin: d }) },
|
|
21
|
+
children: s.map(({ label: u, as: l, ...e }, r) => {
|
|
22
|
+
const c = r === s.length - 1, i = l ?? (e.href ? "a" : "span");
|
|
23
|
+
return /* @__PURE__ */ p("li", { children: [
|
|
24
24
|
/* @__PURE__ */ a(
|
|
25
|
-
|
|
25
|
+
i,
|
|
26
26
|
{
|
|
27
27
|
...e,
|
|
28
28
|
"data-breadcrumbs-item": r,
|
|
@@ -36,5 +36,5 @@ const f = "Breadcrumbs_breadcrumbs_a3ubb", g = {
|
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
38
|
export {
|
|
39
|
-
|
|
39
|
+
v as Breadcrumbs
|
|
40
40
|
};
|
|
@@ -3,17 +3,17 @@ import y, { useRef as D, useImperativeHandle as _, useEffect as E } from "react"
|
|
|
3
3
|
import { createPortal as k } from "react-dom";
|
|
4
4
|
import { FocusTrap as h } from "focus-trap-react";
|
|
5
5
|
import s from "classnames";
|
|
6
|
-
import {
|
|
6
|
+
import { cssProps as L } from "../../utils/helpers.js";
|
|
7
7
|
import { Button as N } from "../Button/Button.js";
|
|
8
8
|
import { Heading as b } from "../Heading/Heading.js";
|
|
9
|
-
import {
|
|
9
|
+
import { Icon as w } from "../Icon/Icon.js";
|
|
10
10
|
const x = "Dialog_overlay_C98Qt", R = "Dialog_dialog_G3gxL", T = "Dialog_footer_N-aEV", I = "Dialog_close_JSEkn", i = {
|
|
11
11
|
overlay: x,
|
|
12
12
|
dialog: R,
|
|
13
13
|
footer: T,
|
|
14
14
|
close: I
|
|
15
15
|
}, P = { escapeDeactivates: !1 }, Q = y.forwardRef(
|
|
16
|
-
({ open: t = !1, size: e, width: l, style:
|
|
16
|
+
({ open: t = !1, size: e, width: l, style: g, className: m, children: u, requestClose: n, ...p }, v) => {
|
|
17
17
|
const c = D(null);
|
|
18
18
|
return _(v, () => c.current), E(() => {
|
|
19
19
|
const r = c.current;
|
|
@@ -44,8 +44,8 @@ const x = "Dialog_overlay_C98Qt", R = "Dialog_dialog_G3gxL", T = "Dialog_footer_
|
|
|
44
44
|
role: "alertdialog",
|
|
45
45
|
"aria-modal": "true",
|
|
46
46
|
"data-dialog-wrapper": !0,
|
|
47
|
-
className: s(i.dialog,
|
|
48
|
-
style: { ...
|
|
47
|
+
className: s(i.dialog, m),
|
|
48
|
+
style: { ...g, ...L({ size: e, width: l }) },
|
|
49
49
|
children: u
|
|
50
50
|
}
|
|
51
51
|
)
|
|
@@ -58,12 +58,12 @@ const x = "Dialog_overlay_C98Qt", R = "Dialog_dialog_G3gxL", T = "Dialog_footer_
|
|
|
58
58
|
), V = ({ className: t, children: e, ...l }) => /* @__PURE__ */ o(b, { as: "h4", ...l, "data-dialog-title": !0, title: e, className: t }), z = (t) => /* @__PURE__ */ o("div", { ...t, "data-dialog-content": !0 }), A = ({ className: t, ...e }) => /* @__PURE__ */ o("div", { ...e, "data-dialog-footer": !0, className: s(i.footer, t) }), K = ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
59
59
|
N,
|
|
60
60
|
{
|
|
61
|
-
...e,
|
|
62
61
|
type: "button",
|
|
63
62
|
variant: "tertiary",
|
|
63
|
+
"aria-label": "close dialog",
|
|
64
|
+
icon: /* @__PURE__ */ o(w, { name: "close" }),
|
|
65
|
+
...e,
|
|
64
66
|
"data-dialog-close": !0,
|
|
65
|
-
"aria-label": "dismiss dialog",
|
|
66
|
-
icon: /* @__PURE__ */ o(L, { name: "close" }),
|
|
67
67
|
className: s(i.close, t)
|
|
68
68
|
}
|
|
69
69
|
);
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as h, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import i from "classnames";
|
|
3
|
+
import p, { useRef as x, useImperativeHandle as b, useEffect as k } from "react";
|
|
4
4
|
import { cssProps as R } from "../../utils/helpers.js";
|
|
5
|
-
import { I as y, s as
|
|
6
|
-
const q =
|
|
7
|
-
({ size: c, error:
|
|
8
|
-
const
|
|
9
|
-
return
|
|
10
|
-
r != null && e.current != null && (e.current.indeterminate = !
|
|
11
|
-
}, [e, r,
|
|
5
|
+
import { I as y, s as l } from "../../Input-D46mAsdt.js";
|
|
6
|
+
const q = p.forwardRef(
|
|
7
|
+
({ size: c, error: n, label: t, className: u, style: f, required: m, indeterminate: r, ...o }, d) => {
|
|
8
|
+
const s = o.checked, e = x(null);
|
|
9
|
+
return b(d, () => e.current), k(() => {
|
|
10
|
+
r != null && e.current != null && (e.current.indeterminate = !s && r);
|
|
11
|
+
}, [e, r, s]), /* @__PURE__ */ h(
|
|
12
12
|
"label",
|
|
13
13
|
{
|
|
14
|
-
"data-
|
|
14
|
+
"data-checkbox": !0,
|
|
15
15
|
"data-required": m,
|
|
16
|
-
className:
|
|
17
|
-
style: { ...
|
|
16
|
+
className: i(l.checkbox, u),
|
|
17
|
+
style: { ...f, ...R({ size: c }) },
|
|
18
18
|
children: [
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
t && /* @__PURE__ */
|
|
19
|
+
/* @__PURE__ */ a(y, { ...o, ref: e, type: "checkbox", size: c, error: n }),
|
|
20
|
+
t && /* @__PURE__ */ a("div", { "data-checkbox-label": !0, className: l.label, children: t })
|
|
21
21
|
]
|
|
22
22
|
}
|
|
23
23
|
);
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { InputProps } from './Input';
|
|
3
|
-
export type NumericProps = Omit<InputProps, 'children'
|
|
4
|
-
|
|
3
|
+
export type NumericProps = Omit<InputProps, 'children'> & {
|
|
4
|
+
labelIncrease?: string;
|
|
5
|
+
labelDecrease?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const Numeric: React.ForwardRefExoticComponent<Omit<InputProps, "children"> & {
|
|
8
|
+
labelIncrease?: string;
|
|
9
|
+
labelDecrease?: string;
|
|
10
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as f, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import y from "classnames";
|
|
3
|
+
import _, { useRef as h, useImperativeHandle as v, useCallback as c } from "react";
|
|
4
4
|
import { Icon as i } from "../Icon/Icon.js";
|
|
5
5
|
import { Button as o } from "../Button/Button.js";
|
|
6
|
-
import { I as
|
|
7
|
-
const
|
|
8
|
-
numeric:
|
|
9
|
-
increase:
|
|
10
|
-
decrease:
|
|
11
|
-
},
|
|
12
|
-
({
|
|
13
|
-
const e =
|
|
14
|
-
|
|
15
|
-
const
|
|
6
|
+
import { I as w } from "../../Input-D46mAsdt.js";
|
|
7
|
+
const E = "styles_numeric_dzUSE", R = "styles_increase_5S-Jo", g = "styles_decrease_j8UR6", s = {
|
|
8
|
+
numeric: E,
|
|
9
|
+
increase: R,
|
|
10
|
+
decrease: g
|
|
11
|
+
}, x = _.forwardRef(
|
|
12
|
+
({ labelIncrease: l = "increase", labelDecrease: u = "decrease", className: d, ...a }, m) => {
|
|
13
|
+
const e = h(null);
|
|
14
|
+
v(m, () => e.current);
|
|
15
|
+
const p = c(() => {
|
|
16
16
|
var n, r;
|
|
17
17
|
(n = e.current) == null || n.stepUp(), (r = e.current) == null || r.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
18
|
-
}, []),
|
|
18
|
+
}, []), b = c(() => {
|
|
19
19
|
var n, r;
|
|
20
20
|
(n = e.current) == null || n.stepDown(), (r = e.current) == null || r.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
21
21
|
}, []);
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
|
|
22
|
+
return /* @__PURE__ */ f(
|
|
23
|
+
w,
|
|
24
24
|
{
|
|
25
25
|
...a,
|
|
26
26
|
ref: e,
|
|
27
27
|
type: "number",
|
|
28
28
|
wrapperType: "numeric",
|
|
29
|
-
className:
|
|
29
|
+
className: y(s.numeric, d),
|
|
30
30
|
children: [
|
|
31
31
|
/* @__PURE__ */ t(
|
|
32
32
|
o,
|
|
33
33
|
{
|
|
34
34
|
type: "button",
|
|
35
35
|
variant: "secondary",
|
|
36
|
-
"aria-label":
|
|
36
|
+
"aria-label": l,
|
|
37
37
|
disabled: a.disabled,
|
|
38
38
|
className: s.increase,
|
|
39
39
|
icon: /* @__PURE__ */ t(i, { name: "triangle-up" }),
|
|
40
|
-
onClick:
|
|
40
|
+
onClick: p
|
|
41
41
|
}
|
|
42
42
|
),
|
|
43
43
|
/* @__PURE__ */ t(
|
|
@@ -45,11 +45,11 @@ const v = "styles_numeric_dzUSE", w = "styles_increase_5S-Jo", E = "styles_decre
|
|
|
45
45
|
{
|
|
46
46
|
type: "button",
|
|
47
47
|
variant: "secondary",
|
|
48
|
-
"aria-label":
|
|
48
|
+
"aria-label": u,
|
|
49
49
|
disabled: a.disabled,
|
|
50
50
|
className: s.decrease,
|
|
51
51
|
icon: /* @__PURE__ */ t(i, { name: "triangle-down" }),
|
|
52
|
-
onClick:
|
|
52
|
+
onClick: b
|
|
53
53
|
}
|
|
54
54
|
)
|
|
55
55
|
]
|
|
@@ -58,5 +58,5 @@ const v = "styles_numeric_dzUSE", w = "styles_increase_5S-Jo", E = "styles_decre
|
|
|
58
58
|
}
|
|
59
59
|
);
|
|
60
60
|
export {
|
|
61
|
-
|
|
61
|
+
x as Numeric
|
|
62
62
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import c from "classnames";
|
|
3
3
|
import f from "react";
|
|
4
4
|
import { cssProps as n } from "../../utils/helpers.js";
|
|
5
|
-
import { I as u, s } from "../../Input-D46mAsdt.js";
|
|
6
|
-
const
|
|
7
|
-
({ size: r, error:
|
|
5
|
+
import { I as u, s as t } from "../../Input-D46mAsdt.js";
|
|
6
|
+
const j = f.forwardRef(
|
|
7
|
+
({ size: r, error: e, label: a, className: s, style: d, required: i, ...m }, l) => /* @__PURE__ */ p(
|
|
8
8
|
"label",
|
|
9
9
|
{
|
|
10
|
-
"data-
|
|
11
|
-
"data-required":
|
|
12
|
-
className: c(
|
|
13
|
-
style: { ...
|
|
10
|
+
"data-radio": !0,
|
|
11
|
+
"data-required": i,
|
|
12
|
+
className: c(t.radio, s),
|
|
13
|
+
style: { ...d, ...n({ size: r }) },
|
|
14
14
|
children: [
|
|
15
|
-
/* @__PURE__ */ o(u, { ...m, ref:
|
|
16
|
-
a && /* @__PURE__ */ o("div", { className:
|
|
15
|
+
/* @__PURE__ */ o(u, { ...m, ref: l, type: "radio", size: r, error: e }),
|
|
16
|
+
a && /* @__PURE__ */ o("div", { "data-radio-label": !0, className: t.label, children: a })
|
|
17
17
|
]
|
|
18
18
|
}
|
|
19
19
|
)
|
|
20
20
|
);
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
j as Radio
|
|
23
23
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { V } from "../../
|
|
5
|
-
import {
|
|
1
|
+
import { jsxs as _, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import N from "classnames";
|
|
3
|
+
import R, { useRef as x, useState as T, useEffect as j, useCallback as P } from "react";
|
|
4
|
+
import { cssProps as V, wrapNode as A } from "../../utils/helpers.js";
|
|
5
|
+
import { V as E } from "../../ValidationTooltip-D8d9O6Re.js";
|
|
6
6
|
const J = "styles_range_j9iED", D = "styles_range_thumb_6aftN", F = "styles_range_wrapper_LTcAf", H = "styles_range_track_HdlJx", L = "styles_ticks_YaeJb", n = {
|
|
7
7
|
range: J,
|
|
8
8
|
range_thumb: D,
|
|
@@ -10,40 +10,40 @@ const J = "styles_range_j9iED", D = "styles_range_thumb_6aftN", F = "styles_rang
|
|
|
10
10
|
range_track: H,
|
|
11
11
|
ticks: L
|
|
12
12
|
};
|
|
13
|
-
function f(r,
|
|
14
|
-
r == null || r.style.setProperty("--progress", `${(s -
|
|
13
|
+
function f(r, t, e, s) {
|
|
14
|
+
r == null || r.style.setProperty("--progress", `${(s - t) / (e - t)}`);
|
|
15
15
|
}
|
|
16
16
|
const M = ({ ticks: r }) => {
|
|
17
|
-
const
|
|
18
|
-
return
|
|
19
|
-
}, B =
|
|
20
|
-
({ size: r, height:
|
|
17
|
+
const t = typeof r == "number" ? [...Array(r)] : r;
|
|
18
|
+
return t.length < 2 ? null : /* @__PURE__ */ a("ul", { "data-range-ticks": !0, className: n.ticks, children: t.map((e, s) => /* @__PURE__ */ a("li", { children: e !== void 0 && /* @__PURE__ */ a("small", { children: e }) }, s)) });
|
|
19
|
+
}, B = R.forwardRef(
|
|
20
|
+
({ size: r, height: t, error: e, ticks: s, className: m, style: y, children: u, onChange: c, ...i }, h) => {
|
|
21
21
|
const { min: l = 0, max: o = 100, defaultValue: v = 50, value: p = v } = i, d = x(null), [k, b] = T(null);
|
|
22
22
|
j(() => {
|
|
23
23
|
f(d.current, l, o, p);
|
|
24
24
|
}, [l, o, p]);
|
|
25
|
-
const
|
|
26
|
-
(
|
|
27
|
-
f(d.current, l, o, parseFloat(
|
|
25
|
+
const w = P(
|
|
26
|
+
(g) => {
|
|
27
|
+
f(d.current, l, o, parseFloat(g.currentTarget.value)), c == null || c(g);
|
|
28
28
|
},
|
|
29
29
|
[l, o, c]
|
|
30
30
|
);
|
|
31
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ _(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
34
|
ref: d,
|
|
35
|
-
"data-
|
|
35
|
+
"data-range": !0,
|
|
36
36
|
"data-disabled": i.disabled,
|
|
37
37
|
"data-invalid": e ? !0 : void 0,
|
|
38
|
-
className:
|
|
39
|
-
style: { ...y, ...
|
|
38
|
+
className: N(n.range, m),
|
|
39
|
+
style: { ...y, ...V({ size: r, height: t }) },
|
|
40
40
|
children: [
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ _("div", { "data-range-wrapper": !0, className: n.range_wrapper, children: [
|
|
42
|
+
/* @__PURE__ */ a("div", { "data-range-track": !0, className: n.range_track }),
|
|
43
|
+
/* @__PURE__ */ a("div", { ref: b, "data-range-thumb": !0, className: n.range_thumb, children: u !== void 0 && A(u, "small") }),
|
|
44
|
+
/* @__PURE__ */ a(E, { content: e, placement: "top", anchor: k, children: /* @__PURE__ */ a("input", { ...i, ref: h, type: "range", onChange: w }) })
|
|
45
45
|
] }),
|
|
46
|
-
s !== void 0 && /* @__PURE__ */
|
|
46
|
+
s !== void 0 && /* @__PURE__ */ a(M, { ticks: s })
|
|
47
47
|
]
|
|
48
48
|
}
|
|
49
49
|
);
|
|
@@ -8,25 +8,25 @@ const _ = "styles_label_p-D4Y", w = "styles_input_VteBP", s = {
|
|
|
8
8
|
label: _,
|
|
9
9
|
input: w
|
|
10
10
|
}, V = m.forwardRef(
|
|
11
|
-
({ size: a, error:
|
|
11
|
+
({ size: a, error: e, label: i, required: l, checkedColor: c, className: o, style: r, ...n }, p) => /* @__PURE__ */ d(
|
|
12
12
|
"label",
|
|
13
13
|
{
|
|
14
|
-
"data-
|
|
14
|
+
"data-switch": !0,
|
|
15
15
|
"data-required": l,
|
|
16
|
-
className: h(s.switch,
|
|
17
|
-
style: { ...
|
|
16
|
+
className: h(s.switch, o),
|
|
17
|
+
style: { ...r, ...u({ size: a, checkedColor: c }) },
|
|
18
18
|
children: [
|
|
19
|
-
/* @__PURE__ */ t(f, { content:
|
|
19
|
+
/* @__PURE__ */ t(f, { content: e, children: /* @__PURE__ */ t(
|
|
20
20
|
"input",
|
|
21
21
|
{
|
|
22
|
-
...
|
|
22
|
+
...n,
|
|
23
23
|
ref: p,
|
|
24
24
|
type: "checkbox",
|
|
25
|
-
"data-invalid":
|
|
25
|
+
"data-invalid": e ? !0 : void 0,
|
|
26
26
|
className: s.input
|
|
27
27
|
}
|
|
28
28
|
) }),
|
|
29
|
-
|
|
29
|
+
i && /* @__PURE__ */ t("div", { "data-switch-label": !0, className: s.label, children: i })
|
|
30
30
|
]
|
|
31
31
|
}
|
|
32
32
|
)
|
|
@@ -14,39 +14,39 @@ const j = "Heading_h1_jZARG", u = "Heading_heading_OG4PS", p = "Heading_h2_juB1Q
|
|
|
14
14
|
as: s = "h2",
|
|
15
15
|
size: y = s,
|
|
16
16
|
title: c,
|
|
17
|
-
margin:
|
|
18
|
-
marginStart:
|
|
19
|
-
marginEnd:
|
|
17
|
+
margin: e,
|
|
18
|
+
marginStart: n,
|
|
19
|
+
marginEnd: o,
|
|
20
20
|
className: d,
|
|
21
21
|
children: i,
|
|
22
|
-
style:
|
|
23
|
-
...
|
|
22
|
+
style: t,
|
|
23
|
+
...r
|
|
24
24
|
}) => {
|
|
25
25
|
const _ = `var(--font-size-${y})`;
|
|
26
26
|
return i ? /* @__PURE__ */ f(
|
|
27
27
|
"header",
|
|
28
28
|
{
|
|
29
|
-
...
|
|
29
|
+
...r,
|
|
30
30
|
"data-heading": s,
|
|
31
31
|
className: g(h.heading, d),
|
|
32
32
|
style: {
|
|
33
|
-
...
|
|
34
|
-
...H({ fontSize: _, margin:
|
|
33
|
+
...t,
|
|
34
|
+
...H({ fontSize: _, margin: e, marginStart: n, marginEnd: o })
|
|
35
35
|
},
|
|
36
36
|
children: [
|
|
37
|
-
/* @__PURE__ */ a(s, { children: c }),
|
|
37
|
+
/* @__PURE__ */ a(s, { "data-heading-title": !0, children: c }),
|
|
38
38
|
/* @__PURE__ */ a("div", { "data-heading-accessory": !0, className: h.accessory, children: i })
|
|
39
39
|
]
|
|
40
40
|
}
|
|
41
41
|
) : /* @__PURE__ */ a(
|
|
42
42
|
s,
|
|
43
43
|
{
|
|
44
|
-
...
|
|
44
|
+
...r,
|
|
45
45
|
"data-heading": s,
|
|
46
46
|
className: g(h[s], d),
|
|
47
47
|
style: {
|
|
48
|
-
...
|
|
49
|
-
...H({ fontSize: _, margin:
|
|
48
|
+
...t,
|
|
49
|
+
...H({ fontSize: _, margin: e, marginStart: n, marginEnd: o })
|
|
50
50
|
},
|
|
51
51
|
children: c
|
|
52
52
|
}
|