@konstructio/ui 0.0.5 → 0.0.6
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/{AlertDialogTrigger-lenvKoGF.js → AlertDialogTrigger-D4Tm_9M0.js} +2 -2
- package/dist/{Modal-Bg9UG35z.js → Modal-Ca3bkvvt.js} +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +31 -30
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Card/Card.d.ts +4 -0
- package/dist/components/Card/Card.js +38 -0
- package/dist/components/Card/Card.types.d.ts +7 -0
- package/dist/components/Card/Card.types.js +1 -0
- package/dist/components/Card/Card.variants.d.ts +10 -0
- package/dist/components/Card/Card.variants.js +87 -0
- package/dist/components/Checkbox/Checkbox.js +106 -101
- package/dist/components/Checkbox/Checkbox.types.d.ts +2 -0
- package/dist/components/Dropdown/components/List/List.js +14 -13
- package/dist/components/Dropdown/components/List/List.types.d.ts +1 -3
- package/dist/components/Dropdown/components/ListItem/ListItem.js +25 -18
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +14 -3
- package/dist/components/Dropdown/components/Wrapper.js +46 -34
- package/dist/components/Modal/Modal.js +2 -2
- package/dist/components/Modal/components/Wrapper/Wrapper.js +2 -2
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +65 -65
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +59 -49
- package/dist/components/Toast/Toast.js +3 -3
- package/dist/components/Tooltip/Tooltip.js +17 -17
- package/dist/components/Tooltip/Tooltip.variants.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/index-BaNV0qac.js +19164 -0
- package/dist/{index-O3j1K921.js → index-BedjZUuB.js} +1 -1
- package/dist/{index-ffjBR8Av.js → index-BtibbG81.js} +1 -1
- package/dist/{index-Ci9Yg4G1.js → index-z-AJyzdv.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/package.json +35 -35
- package/dist/styles.css +1 -1
- package/dist/{useBreadcrumb-tyxjV-a1.js → useBreadcrumb-DxYsZvj_.js} +4 -4
- package/package.json +36 -36
- package/dist/index-OOfdXoxx.js +0 -423
|
@@ -2,9 +2,11 @@ import { InputHTMLAttributes } from 'react';
|
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { checkboxVariants } from './Checkbox.variants';
|
|
4
4
|
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'checked'>, VariantProps<typeof checkboxVariants> {
|
|
5
|
+
ariaLabelledBy?: string;
|
|
5
6
|
className?: string;
|
|
6
7
|
defaultChecked?: boolean;
|
|
7
8
|
disabled?: boolean;
|
|
9
|
+
id?: string;
|
|
8
10
|
label?: string;
|
|
9
11
|
labelClassName?: string;
|
|
10
12
|
name?: string;
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { useNavigationUlList as
|
|
5
|
-
import { useDropdownContext as
|
|
2
|
+
import { forwardRef as p, useRef as a, useImperativeHandle as u } from "react";
|
|
3
|
+
import { cn as c } from "../../../../utils/index.js";
|
|
4
|
+
import { useNavigationUlList as d } from "../../hooks/useNavigationList.js";
|
|
5
|
+
import { useDropdownContext as x } from "../../contexts/dropdown.hook.js";
|
|
6
6
|
import "../../contexts/dropdown.context.js";
|
|
7
|
-
import { ListItem as
|
|
8
|
-
import { listVariants as
|
|
9
|
-
const
|
|
10
|
-
({ options: i, theme:
|
|
11
|
-
const r =
|
|
12
|
-
return
|
|
7
|
+
import { ListItem as v } from "../ListItem/ListItem.js";
|
|
8
|
+
import { listVariants as L } from "./List.variants.js";
|
|
9
|
+
const C = p(
|
|
10
|
+
({ options: i, theme: t, wrapperRef: m, wrapperInputRef: s, name: l }, n) => {
|
|
11
|
+
const r = a(null), { isOpen: f } = x();
|
|
12
|
+
return u(n, () => r.current, [r]), d({ ulRef: r, wrapperRef: m, wrapperInputRef: s }), /* @__PURE__ */ e(
|
|
13
13
|
"ul",
|
|
14
14
|
{
|
|
15
15
|
ref: r,
|
|
16
|
+
title: l,
|
|
16
17
|
role: "listbox",
|
|
17
|
-
className:
|
|
18
|
-
children: i.map((
|
|
18
|
+
className: c(L({ theme: t }), f ? "flex" : "hidden"),
|
|
19
|
+
children: i.map((o) => /* @__PURE__ */ e(v, { theme: t, ...o }, o.value))
|
|
19
20
|
}
|
|
20
21
|
);
|
|
21
22
|
}
|
|
22
23
|
);
|
|
23
24
|
export {
|
|
24
|
-
|
|
25
|
+
C as List
|
|
25
26
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { ComponentRef, RefObject } from 'react';
|
|
2
2
|
import { DropdownProps } from '../../Dropdown.types';
|
|
3
|
-
export type ListProps = {
|
|
4
|
-
options: DropdownProps['options'];
|
|
5
|
-
theme: DropdownProps['theme'];
|
|
3
|
+
export type ListProps = Pick<DropdownProps, 'name' | 'options' | 'theme'> & {
|
|
6
4
|
wrapperRef: RefObject<ComponentRef<'div'> | null>;
|
|
7
5
|
wrapperInputRef: RefObject<ComponentRef<'div'> | null>;
|
|
8
6
|
};
|
|
@@ -1,29 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useCallback as
|
|
3
|
-
import { useDropdownContext as
|
|
1
|
+
import { jsxs as m, jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as u, useCallback as r } from "react";
|
|
3
|
+
import { useDropdownContext as d } from "../../contexts/dropdown.hook.js";
|
|
4
4
|
import "../../contexts/dropdown.context.js";
|
|
5
|
-
import { listItemVariants as
|
|
6
|
-
const
|
|
7
|
-
const { setValue:
|
|
8
|
-
(
|
|
9
|
-
|
|
5
|
+
import { listItemVariants as p } from "./ListItem.variants.js";
|
|
6
|
+
const y = ({ theme: o, ...e }) => {
|
|
7
|
+
const { setValue: n, toggleOpen: s } = d(), c = u(null), t = r(
|
|
8
|
+
(l) => {
|
|
9
|
+
n(l), s(!1);
|
|
10
10
|
},
|
|
11
|
-
[
|
|
11
|
+
[n, s]
|
|
12
|
+
), a = r(
|
|
13
|
+
(l, i) => {
|
|
14
|
+
l.key === "Enter" && t(i);
|
|
15
|
+
},
|
|
16
|
+
[t]
|
|
12
17
|
);
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
-
"
|
|
18
|
+
return /* @__PURE__ */ m(
|
|
19
|
+
"li",
|
|
15
20
|
{
|
|
16
|
-
|
|
17
|
-
role: "
|
|
18
|
-
className:
|
|
19
|
-
|
|
21
|
+
ref: c,
|
|
22
|
+
role: "option",
|
|
23
|
+
className: p({ theme: o }),
|
|
24
|
+
tabIndex: 0,
|
|
25
|
+
onClick: () => t(e),
|
|
26
|
+
onKeyDown: (l) => a(l, e),
|
|
20
27
|
children: [
|
|
21
|
-
e.leftIcon ? /* @__PURE__ */
|
|
28
|
+
e.leftIcon ? /* @__PURE__ */ f("span", { className: "w-4 h-4 flex justify-center items-center", children: e.leftIcon }) : null,
|
|
22
29
|
e.label
|
|
23
30
|
]
|
|
24
31
|
}
|
|
25
|
-
)
|
|
32
|
+
);
|
|
26
33
|
};
|
|
27
34
|
export {
|
|
28
|
-
|
|
35
|
+
y as ListItem
|
|
29
36
|
};
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { c as e } from "../../../../index-BNmRGtA6.js";
|
|
2
|
-
const
|
|
3
|
-
[
|
|
2
|
+
const t = e(
|
|
3
|
+
[
|
|
4
|
+
"cursor-pointer",
|
|
5
|
+
"py-2",
|
|
6
|
+
"px-2",
|
|
7
|
+
"h-full",
|
|
8
|
+
"focus-visible:outline-none",
|
|
9
|
+
"m-0",
|
|
10
|
+
"w-full",
|
|
11
|
+
"flex",
|
|
12
|
+
"items-center",
|
|
13
|
+
"gap-3"
|
|
14
|
+
],
|
|
4
15
|
{
|
|
5
16
|
variants: {
|
|
6
17
|
theme: {
|
|
@@ -15,5 +26,5 @@ const o = e(
|
|
|
15
26
|
}
|
|
16
27
|
);
|
|
17
28
|
export {
|
|
18
|
-
|
|
29
|
+
t as listItemVariants
|
|
19
30
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as D, useId as F, useRef as
|
|
1
|
+
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as D, useId as F, useRef as N, useImperativeHandle as L, useEffect as f } from "react";
|
|
3
3
|
import { cn as $ } from "../../../utils/index.js";
|
|
4
4
|
import "../../../contexts/theme.context.js";
|
|
5
5
|
import { useTheme as A } from "../../../contexts/theme.hook.js";
|
|
@@ -11,52 +11,54 @@ import "../contexts/dropdown.context.js";
|
|
|
11
11
|
import { List as q } from "./List/List.js";
|
|
12
12
|
import { C as z } from "../../../chevron-up-CvquEaNg.js";
|
|
13
13
|
const _ = D(
|
|
14
|
-
({ theme: R, label:
|
|
15
|
-
const
|
|
16
|
-
L(O, () => r.current, [r]),
|
|
14
|
+
({ theme: R, label: p, placeholder: g, name: o, options: a, defaultValue: c }, O) => {
|
|
15
|
+
const d = F(), r = N(null), u = N(null), { wrapperRef: n, wrapperInputRef: h, handleOpen: j, handleOpenIfClosed: y } = U({ ulRef: u }), { isOpen: x, value: e, setValue: w, toggleOpen: b } = W(), { theme: E } = A(), v = R ?? E, i = o ? `${d}-${o}` : d;
|
|
16
|
+
L(O, () => r.current, [r]), f(() => {
|
|
17
17
|
r.current && (r.current.value = e ? e.value : "");
|
|
18
|
-
}, [e]),
|
|
18
|
+
}, [e]), f(() => {
|
|
19
19
|
if (c) {
|
|
20
|
-
const
|
|
21
|
-
(
|
|
20
|
+
const s = a.find(
|
|
21
|
+
(l) => l.value === c
|
|
22
22
|
);
|
|
23
|
-
|
|
23
|
+
s && w(s);
|
|
24
24
|
}
|
|
25
|
-
}, [c,
|
|
26
|
-
var
|
|
27
|
-
const
|
|
28
|
-
return (
|
|
29
|
-
var
|
|
30
|
-
const
|
|
31
|
-
(!
|
|
25
|
+
}, [c, a, w]), f(() => {
|
|
26
|
+
var l;
|
|
27
|
+
const s = new AbortController();
|
|
28
|
+
return (l = n.current) == null || l.addEventListener("focusout", (k) => {
|
|
29
|
+
var I;
|
|
30
|
+
const C = k.relatedTarget;
|
|
31
|
+
(!C || !((I = n.current) != null && I.contains(C))) && b(!1);
|
|
32
32
|
}), () => {
|
|
33
|
-
|
|
33
|
+
s.abort();
|
|
34
34
|
};
|
|
35
|
-
}, [
|
|
36
|
-
const
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
|
|
35
|
+
}, [b, n]);
|
|
36
|
+
const T = () => e != null && e.leftIcon ? /* @__PURE__ */ t("span", { className: "w-4 h-4 flex justify-center items-center", children: e.leftIcon }) : null;
|
|
37
|
+
return /* @__PURE__ */ m("div", { ref: n, className: "flex flex-col w-full relative", children: [
|
|
38
|
+
p ? /* @__PURE__ */ t(
|
|
39
39
|
"label",
|
|
40
40
|
{
|
|
41
|
+
id: i,
|
|
41
42
|
className: "m-2 cursor-pointer",
|
|
42
|
-
htmlFor:
|
|
43
|
-
onClick:
|
|
44
|
-
children:
|
|
43
|
+
htmlFor: i,
|
|
44
|
+
onClick: y,
|
|
45
|
+
children: p
|
|
45
46
|
}
|
|
46
47
|
) : null,
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ m(
|
|
48
49
|
"div",
|
|
49
50
|
{
|
|
50
|
-
ref:
|
|
51
|
-
id:
|
|
51
|
+
ref: h,
|
|
52
|
+
id: i,
|
|
52
53
|
className: H({ theme: v }),
|
|
53
54
|
role: "combobox",
|
|
54
55
|
onClick: j,
|
|
55
|
-
"aria-expanded":
|
|
56
|
+
"aria-expanded": x,
|
|
56
57
|
tabIndex: 0,
|
|
58
|
+
"aria-labelledby": i,
|
|
57
59
|
children: [
|
|
58
|
-
/* @__PURE__ */ t("span", { className: "text-base text-inherit", children: e ? /* @__PURE__ */
|
|
59
|
-
|
|
60
|
+
/* @__PURE__ */ t("span", { className: "text-base text-inherit", children: e ? /* @__PURE__ */ m("span", { className: "flex gap-3 items-center", children: [
|
|
61
|
+
T(),
|
|
60
62
|
e.label
|
|
61
63
|
] }) : g }),
|
|
62
64
|
/* @__PURE__ */ t(
|
|
@@ -64,21 +66,31 @@ const _ = D(
|
|
|
64
66
|
{
|
|
65
67
|
className: $(
|
|
66
68
|
"w-4 h-4 text-inherit transition-all duration-50",
|
|
67
|
-
|
|
69
|
+
x ? "rotate-0" : "rotate-180"
|
|
68
70
|
)
|
|
69
71
|
}
|
|
70
72
|
)
|
|
71
73
|
]
|
|
72
74
|
}
|
|
73
75
|
),
|
|
74
|
-
/* @__PURE__ */ t(
|
|
76
|
+
/* @__PURE__ */ t(
|
|
77
|
+
"input",
|
|
78
|
+
{
|
|
79
|
+
ref: r,
|
|
80
|
+
type: "text",
|
|
81
|
+
name: o,
|
|
82
|
+
className: "hidden",
|
|
83
|
+
"aria-hidden": "true"
|
|
84
|
+
}
|
|
85
|
+
),
|
|
75
86
|
/* @__PURE__ */ t(
|
|
76
87
|
q,
|
|
77
88
|
{
|
|
78
89
|
ref: u,
|
|
90
|
+
name: o,
|
|
79
91
|
wrapperRef: n,
|
|
80
|
-
wrapperInputRef:
|
|
81
|
-
options:
|
|
92
|
+
wrapperInputRef: h,
|
|
93
|
+
options: a,
|
|
82
94
|
theme: v
|
|
83
95
|
}
|
|
84
96
|
)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import "../../index-
|
|
2
|
+
import "../../index-BaNV0qac.js";
|
|
3
3
|
import "./components/Body/Body.js";
|
|
4
4
|
import "./components/Footer/Footer.js";
|
|
5
5
|
import "./components/Header/Header.js";
|
|
6
|
-
import { M as d } from "../../Modal-
|
|
6
|
+
import { M as d } from "../../Modal-Ca3bkvvt.js";
|
|
7
7
|
import "./hooks/useModal.js";
|
|
8
8
|
export {
|
|
9
9
|
d as Modal
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { W as b } from "../../../../Modal-
|
|
3
|
+
import { W as b } from "../../../../Modal-Ca3bkvvt.js";
|
|
4
4
|
import "../../../../Combination-Cmu9JRkv.js";
|
|
5
|
-
import "../../../../index-
|
|
5
|
+
import "../../../../index-BtibbG81.js";
|
|
6
6
|
import "../../../../contexts/theme.context.js";
|
|
7
7
|
import "../../../../contexts/theme.hook.js";
|
|
8
8
|
import "../../../../js.cookie-OLEfuq_g.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Body as e } from "./Body/Body.js";
|
|
2
2
|
import { Footer as t } from "./Footer/Footer.js";
|
|
3
3
|
import { Header as m } from "./Header/Header.js";
|
|
4
|
-
import { W as a } from "../../../Modal-
|
|
4
|
+
import { W as a } from "../../../Modal-Ca3bkvvt.js";
|
|
5
5
|
export {
|
|
6
6
|
e as Body,
|
|
7
7
|
t as Footer,
|
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import { jsxs as y, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import p, { forwardRef as
|
|
3
|
-
import { R as
|
|
2
|
+
import p, { forwardRef as b, useId as _, useState as E, useCallback as w } from "react";
|
|
3
|
+
import { R as j } from "../../index-BtibbG81.js";
|
|
4
4
|
import "../../contexts/theme.context.js";
|
|
5
5
|
import { useTheme as T } from "../../contexts/theme.hook.js";
|
|
6
6
|
import "../../js.cookie-OLEfuq_g.js";
|
|
7
|
-
import { labelVariants as $, buttonVariants as
|
|
7
|
+
import { labelVariants as $, buttonVariants as x, numberInputVariants as L } from "./NumberInput.variants.js";
|
|
8
8
|
import { P as a } from "../../index-D68N8v8R.js";
|
|
9
9
|
function h() {
|
|
10
10
|
return h = Object.assign || function(e) {
|
|
11
|
-
for (var
|
|
12
|
-
var
|
|
13
|
-
for (var t in
|
|
14
|
-
Object.prototype.hasOwnProperty.call(
|
|
11
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
12
|
+
var r = arguments[i];
|
|
13
|
+
for (var t in r)
|
|
14
|
+
Object.prototype.hasOwnProperty.call(r, t) && (e[t] = r[t]);
|
|
15
15
|
}
|
|
16
16
|
return e;
|
|
17
17
|
}, h.apply(this, arguments);
|
|
18
18
|
}
|
|
19
|
-
function W(e,
|
|
19
|
+
function W(e, i) {
|
|
20
20
|
if (e == null) return {};
|
|
21
|
-
var
|
|
21
|
+
var r = V(e, i), t, n;
|
|
22
22
|
if (Object.getOwnPropertySymbols) {
|
|
23
|
-
var
|
|
24
|
-
for (
|
|
25
|
-
t =
|
|
23
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
24
|
+
for (n = 0; n < o.length; n++)
|
|
25
|
+
t = o[n], !(i.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (r[t] = e[t]);
|
|
26
26
|
}
|
|
27
|
-
return
|
|
27
|
+
return r;
|
|
28
28
|
}
|
|
29
|
-
function V(e,
|
|
29
|
+
function V(e, i) {
|
|
30
30
|
if (e == null) return {};
|
|
31
|
-
var
|
|
32
|
-
for (
|
|
33
|
-
|
|
34
|
-
return
|
|
31
|
+
var r = {}, t = Object.keys(e), n, o;
|
|
32
|
+
for (o = 0; o < t.length; o++)
|
|
33
|
+
n = t[o], !(i.indexOf(n) >= 0) && (r[n] = e[n]);
|
|
34
|
+
return r;
|
|
35
35
|
}
|
|
36
|
-
var d =
|
|
37
|
-
var
|
|
36
|
+
var d = b(function(e, i) {
|
|
37
|
+
var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, o = n === void 0 ? 24 : n, f = W(e, ["color", "size"]);
|
|
38
38
|
return /* @__PURE__ */ p.createElement("svg", h({
|
|
39
|
-
ref:
|
|
39
|
+
ref: i,
|
|
40
40
|
xmlns: "http://www.w3.org/2000/svg",
|
|
41
|
-
width:
|
|
42
|
-
height:
|
|
41
|
+
width: o,
|
|
42
|
+
height: o,
|
|
43
43
|
viewBox: "0 0 24 24",
|
|
44
44
|
fill: "none",
|
|
45
45
|
stroke: t,
|
|
@@ -58,40 +58,40 @@ d.propTypes = {
|
|
|
58
58
|
size: a.oneOfType([a.string, a.number])
|
|
59
59
|
};
|
|
60
60
|
d.displayName = "Minus";
|
|
61
|
-
function
|
|
62
|
-
return
|
|
63
|
-
for (var
|
|
64
|
-
var
|
|
65
|
-
for (var t in
|
|
66
|
-
Object.prototype.hasOwnProperty.call(
|
|
61
|
+
function v() {
|
|
62
|
+
return v = Object.assign || function(e) {
|
|
63
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
64
|
+
var r = arguments[i];
|
|
65
|
+
for (var t in r)
|
|
66
|
+
Object.prototype.hasOwnProperty.call(r, t) && (e[t] = r[t]);
|
|
67
67
|
}
|
|
68
68
|
return e;
|
|
69
|
-
},
|
|
69
|
+
}, v.apply(this, arguments);
|
|
70
70
|
}
|
|
71
|
-
function M(e,
|
|
71
|
+
function M(e, i) {
|
|
72
72
|
if (e == null) return {};
|
|
73
|
-
var
|
|
73
|
+
var r = R(e, i), t, n;
|
|
74
74
|
if (Object.getOwnPropertySymbols) {
|
|
75
|
-
var
|
|
76
|
-
for (
|
|
77
|
-
t =
|
|
75
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
76
|
+
for (n = 0; n < o.length; n++)
|
|
77
|
+
t = o[n], !(i.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (r[t] = e[t]);
|
|
78
78
|
}
|
|
79
|
-
return
|
|
79
|
+
return r;
|
|
80
80
|
}
|
|
81
|
-
function R(e,
|
|
81
|
+
function R(e, i) {
|
|
82
82
|
if (e == null) return {};
|
|
83
|
-
var
|
|
84
|
-
for (
|
|
85
|
-
|
|
86
|
-
return
|
|
83
|
+
var r = {}, t = Object.keys(e), n, o;
|
|
84
|
+
for (o = 0; o < t.length; o++)
|
|
85
|
+
n = t[o], !(i.indexOf(n) >= 0) && (r[n] = e[n]);
|
|
86
|
+
return r;
|
|
87
87
|
}
|
|
88
|
-
var O =
|
|
89
|
-
var
|
|
90
|
-
return /* @__PURE__ */ p.createElement("svg",
|
|
91
|
-
ref:
|
|
88
|
+
var O = b(function(e, i) {
|
|
89
|
+
var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, o = n === void 0 ? 24 : n, f = M(e, ["color", "size"]);
|
|
90
|
+
return /* @__PURE__ */ p.createElement("svg", v({
|
|
91
|
+
ref: i,
|
|
92
92
|
xmlns: "http://www.w3.org/2000/svg",
|
|
93
|
-
width:
|
|
94
|
-
height:
|
|
93
|
+
width: o,
|
|
94
|
+
height: o,
|
|
95
95
|
viewBox: "0 0 24 24",
|
|
96
96
|
fill: "none",
|
|
97
97
|
stroke: t,
|
|
@@ -115,45 +115,45 @@ O.propTypes = {
|
|
|
115
115
|
size: a.oneOfType([a.string, a.number])
|
|
116
116
|
};
|
|
117
117
|
O.displayName = "Plus";
|
|
118
|
-
const J =
|
|
118
|
+
const J = b(
|
|
119
119
|
({
|
|
120
120
|
className: e,
|
|
121
|
-
init:
|
|
122
|
-
label:
|
|
121
|
+
init: i,
|
|
122
|
+
label: r,
|
|
123
123
|
max: t = -1 / 0,
|
|
124
|
-
min:
|
|
125
|
-
name:
|
|
124
|
+
min: n = 1 / 0,
|
|
125
|
+
name: o,
|
|
126
126
|
theme: f,
|
|
127
127
|
onChange: s
|
|
128
128
|
}, P) => {
|
|
129
|
-
const { theme: k } = T(), m = f ?? k, I = _(), [c, g] = E(() =>
|
|
129
|
+
const { theme: k } = T(), m = f ?? k, I = _(), [c, g] = E(() => i || 0), N = w(() => {
|
|
130
130
|
let l = 0;
|
|
131
|
-
|
|
132
|
-
}, [c,
|
|
131
|
+
n === 1 / 0 ? l = c - 1 : l = Math.max(n, c - 1), g(l), s == null || s(l);
|
|
132
|
+
}, [c, n, s]), z = w(() => {
|
|
133
133
|
let l = 0;
|
|
134
134
|
t === -1 / 0 ? l = c + 1 : l = Math.min(t, c + 1), g(l), s == null || s(l);
|
|
135
135
|
}, [c, t, s]);
|
|
136
136
|
return /* @__PURE__ */ y("div", { className: "flex flex-col gap-1", children: [
|
|
137
|
-
|
|
137
|
+
r ? /* @__PURE__ */ u(
|
|
138
138
|
"label",
|
|
139
139
|
{
|
|
140
|
-
htmlFor:
|
|
140
|
+
htmlFor: o ?? I,
|
|
141
141
|
className: $({
|
|
142
142
|
theme: m
|
|
143
143
|
}),
|
|
144
|
-
children:
|
|
144
|
+
children: r
|
|
145
145
|
}
|
|
146
146
|
) : null,
|
|
147
|
-
/* @__PURE__ */ y("div", { className: "flex items-center", children: [
|
|
147
|
+
/* @__PURE__ */ y("div", { className: "flex items-center", role: "presentation", children: [
|
|
148
148
|
/* @__PURE__ */ y(
|
|
149
149
|
"button",
|
|
150
150
|
{
|
|
151
151
|
type: "button",
|
|
152
152
|
onClick: N,
|
|
153
|
-
className:
|
|
153
|
+
className: x({ theme: m, button: "rigth" }),
|
|
154
154
|
children: [
|
|
155
155
|
/* @__PURE__ */ u(d, { className: "w-4 h-4" }),
|
|
156
|
-
/* @__PURE__ */ u(
|
|
156
|
+
/* @__PURE__ */ u(j, { children: "Decrement" })
|
|
157
157
|
]
|
|
158
158
|
}
|
|
159
159
|
),
|
|
@@ -163,10 +163,10 @@ const J = v(
|
|
|
163
163
|
ref: P,
|
|
164
164
|
type: "number",
|
|
165
165
|
value: c,
|
|
166
|
-
name:
|
|
166
|
+
name: o,
|
|
167
167
|
className: L({ className: e, theme: m }),
|
|
168
168
|
readOnly: !0,
|
|
169
|
-
|
|
169
|
+
"aria-label": r
|
|
170
170
|
}
|
|
171
171
|
),
|
|
172
172
|
/* @__PURE__ */ y(
|
|
@@ -174,10 +174,10 @@ const J = v(
|
|
|
174
174
|
{
|
|
175
175
|
type: "button",
|
|
176
176
|
onClick: z,
|
|
177
|
-
className:
|
|
177
|
+
className: x({ theme: m, button: "left" }),
|
|
178
178
|
children: [
|
|
179
179
|
/* @__PURE__ */ u(O, { className: "w-4 h-4" }),
|
|
180
|
-
/* @__PURE__ */ u(
|
|
180
|
+
/* @__PURE__ */ u(j, { children: "Increment" })
|
|
181
181
|
]
|
|
182
182
|
}
|
|
183
183
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as R, useRef as V, useState as v, useImperativeHandle as T, useEffect as b, useCallback as j } from "react";
|
|
3
|
-
import { R as k, T as w, a as y, b as l } from "../../index-
|
|
3
|
+
import { R as k, T as w, a as y, b as l } from "../../index-z-AJyzdv.js";
|
|
4
4
|
import { cn as C } from "../../utils/index.js";
|
|
5
5
|
import "../../contexts/theme.context.js";
|
|
6
6
|
import { useTheme as S } from "../../contexts/theme.hook.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as N, useRef as v, useState as T, useImperativeHandle as V, useEffect as b, useCallback as R } from "react";
|
|
3
|
-
import { R as g, T as j, b as k } from "../../index-
|
|
3
|
+
import { R as g, T as j, b as k } from "../../index-z-AJyzdv.js";
|
|
4
4
|
import "../../contexts/theme.context.js";
|
|
5
5
|
import { useTheme as w } from "../../contexts/theme.hook.js";
|
|
6
6
|
import "../../js.cookie-OLEfuq_g.js";
|