@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
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { jsxs as x, jsx as
|
|
1
|
+
import { jsxs as x, jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import * as h from "react";
|
|
3
3
|
import { forwardRef as I, useState as _, useRef as H, useId as A, useImperativeHandle as M, useEffect as $, useCallback as j } from "react";
|
|
4
4
|
import { c as z, a as B, d as q } from "../../index-8vgf-x5i.js";
|
|
5
5
|
import { u as F } from "../../index-DoOsnuB6.js";
|
|
6
6
|
import { u as O, a as V } from "../../index-BxeV34ij.js";
|
|
7
|
-
import { P } from "../../index-
|
|
7
|
+
import { P } from "../../index-BaNV0qac.js";
|
|
8
8
|
import { cn as D } from "../../utils/index.js";
|
|
9
9
|
import "../../contexts/theme.context.js";
|
|
10
10
|
import { useTheme as L } from "../../contexts/theme.hook.js";
|
|
11
11
|
import "../../js.cookie-OLEfuq_g.js";
|
|
12
12
|
import { switchVariants as U, thumbVariants as W } from "./Switch.variants.js";
|
|
13
|
-
var k = "Switch", [X,
|
|
14
|
-
(e,
|
|
13
|
+
var k = "Switch", [X, de] = z(k), [G, J] = X(k), g = h.forwardRef(
|
|
14
|
+
(e, s) => {
|
|
15
15
|
const {
|
|
16
16
|
__scopeSwitch: t,
|
|
17
|
-
name:
|
|
18
|
-
checked:
|
|
17
|
+
name: c,
|
|
18
|
+
checked: n,
|
|
19
19
|
defaultChecked: p,
|
|
20
|
-
required:
|
|
20
|
+
required: o,
|
|
21
21
|
disabled: a,
|
|
22
22
|
value: i = "on",
|
|
23
23
|
onCheckedChange: m,
|
|
24
|
-
form:
|
|
25
|
-
...
|
|
26
|
-
} = e, [
|
|
27
|
-
prop:
|
|
24
|
+
form: r,
|
|
25
|
+
...d
|
|
26
|
+
} = e, [l, b] = h.useState(null), v = F(s, (C) => b(C)), f = h.useRef(!1), w = l ? r || !!l.closest("form") : !0, [S = !1, E] = B({
|
|
27
|
+
prop: n,
|
|
28
28
|
defaultProp: p,
|
|
29
29
|
onChange: m
|
|
30
30
|
});
|
|
31
31
|
return /* @__PURE__ */ x(G, { scope: t, checked: S, disabled: a, children: [
|
|
32
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ u(
|
|
33
33
|
P.button,
|
|
34
34
|
{
|
|
35
35
|
type: "button",
|
|
36
36
|
role: "switch",
|
|
37
37
|
"aria-checked": S,
|
|
38
|
-
"aria-required":
|
|
38
|
+
"aria-required": o,
|
|
39
39
|
"data-state": N(S),
|
|
40
40
|
"data-disabled": a ? "" : void 0,
|
|
41
41
|
disabled: a,
|
|
42
42
|
value: i,
|
|
43
|
-
...
|
|
43
|
+
...d,
|
|
44
44
|
ref: v,
|
|
45
45
|
onClick: q(e.onClick, (C) => {
|
|
46
46
|
E((T) => !T), w && (f.current = C.isPropagationStopped(), f.current || C.stopPropagation());
|
|
47
47
|
})
|
|
48
48
|
}
|
|
49
49
|
),
|
|
50
|
-
w && /* @__PURE__ */
|
|
50
|
+
w && /* @__PURE__ */ u(
|
|
51
51
|
K,
|
|
52
52
|
{
|
|
53
|
-
control:
|
|
53
|
+
control: l,
|
|
54
54
|
bubbles: !f.current,
|
|
55
|
-
name:
|
|
55
|
+
name: c,
|
|
56
56
|
value: i,
|
|
57
57
|
checked: S,
|
|
58
|
-
required:
|
|
58
|
+
required: o,
|
|
59
59
|
disabled: a,
|
|
60
|
-
form:
|
|
60
|
+
form: r,
|
|
61
61
|
style: { transform: "translateX(-100%)" }
|
|
62
62
|
}
|
|
63
63
|
)
|
|
@@ -66,35 +66,35 @@ var k = "Switch", [X, ue] = z(k), [G, J] = X(k), g = h.forwardRef(
|
|
|
66
66
|
);
|
|
67
67
|
g.displayName = k;
|
|
68
68
|
var R = "SwitchThumb", y = h.forwardRef(
|
|
69
|
-
(e,
|
|
70
|
-
const { __scopeSwitch: t, ...
|
|
71
|
-
return /* @__PURE__ */
|
|
69
|
+
(e, s) => {
|
|
70
|
+
const { __scopeSwitch: t, ...c } = e, n = J(R, t);
|
|
71
|
+
return /* @__PURE__ */ u(
|
|
72
72
|
P.span,
|
|
73
73
|
{
|
|
74
|
-
"data-state": N(
|
|
75
|
-
"data-disabled":
|
|
76
|
-
...
|
|
77
|
-
ref:
|
|
74
|
+
"data-state": N(n.checked),
|
|
75
|
+
"data-disabled": n.disabled ? "" : void 0,
|
|
76
|
+
...c,
|
|
77
|
+
ref: s
|
|
78
78
|
}
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
82
|
y.displayName = R;
|
|
83
83
|
var K = (e) => {
|
|
84
|
-
const { control:
|
|
84
|
+
const { control: s, checked: t, bubbles: c = !0, ...n } = e, p = h.useRef(null), o = O(t), a = V(s);
|
|
85
85
|
return h.useEffect(() => {
|
|
86
|
-
const i = p.current, m = window.HTMLInputElement.prototype,
|
|
87
|
-
if (
|
|
88
|
-
const
|
|
89
|
-
|
|
86
|
+
const i = p.current, m = window.HTMLInputElement.prototype, d = Object.getOwnPropertyDescriptor(m, "checked").set;
|
|
87
|
+
if (o !== t && d) {
|
|
88
|
+
const l = new Event("click", { bubbles: c });
|
|
89
|
+
d.call(i, t), i.dispatchEvent(l);
|
|
90
90
|
}
|
|
91
|
-
}, [
|
|
91
|
+
}, [o, t, c]), /* @__PURE__ */ u(
|
|
92
92
|
"input",
|
|
93
93
|
{
|
|
94
94
|
type: "checkbox",
|
|
95
95
|
"aria-hidden": !0,
|
|
96
96
|
defaultChecked: t,
|
|
97
|
-
...
|
|
97
|
+
...n,
|
|
98
98
|
tabIndex: -1,
|
|
99
99
|
ref: p,
|
|
100
100
|
style: {
|
|
@@ -112,19 +112,19 @@ function N(e) {
|
|
|
112
112
|
return e ? "checked" : "unchecked";
|
|
113
113
|
}
|
|
114
114
|
var Q = g, Y = y;
|
|
115
|
-
const
|
|
115
|
+
const le = I(
|
|
116
116
|
({
|
|
117
117
|
name: e,
|
|
118
|
-
defaultChecked:
|
|
118
|
+
defaultChecked: s,
|
|
119
119
|
alignment: t = "horizontal",
|
|
120
|
-
theme:
|
|
121
|
-
thumbClassName:
|
|
120
|
+
theme: c,
|
|
121
|
+
thumbClassName: n,
|
|
122
122
|
className: p,
|
|
123
|
-
label:
|
|
123
|
+
label: o
|
|
124
124
|
}, a) => {
|
|
125
|
-
const [i, m] = _(
|
|
126
|
-
M(a, () =>
|
|
127
|
-
|
|
125
|
+
const [i, m] = _(s ?? !1), r = H(null), d = A(), { theme: l } = L(), b = c ?? l, v = e ? `${d}-${e}` : d;
|
|
126
|
+
M(a, () => r.current, [r]), $(() => {
|
|
127
|
+
r.current && (r.current.value = `${i}`);
|
|
128
128
|
}, [i]);
|
|
129
129
|
const f = j(
|
|
130
130
|
(w) => m(w),
|
|
@@ -138,39 +138,49 @@ const de = I(
|
|
|
138
138
|
t === "vertical" ? "flex-col" : "flex-row"
|
|
139
139
|
),
|
|
140
140
|
children: [
|
|
141
|
-
|
|
141
|
+
o ? /* @__PURE__ */ u(
|
|
142
142
|
"label",
|
|
143
143
|
{
|
|
144
144
|
className: "text-base",
|
|
145
145
|
htmlFor: v,
|
|
146
146
|
style: { paddingRight: 15 },
|
|
147
|
-
children:
|
|
147
|
+
children: o
|
|
148
148
|
}
|
|
149
149
|
) : null,
|
|
150
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ u(
|
|
151
151
|
Q,
|
|
152
152
|
{
|
|
153
153
|
id: v,
|
|
154
|
-
defaultChecked:
|
|
154
|
+
defaultChecked: s,
|
|
155
155
|
onCheckedChange: f,
|
|
156
156
|
className: U({ theme: b, className: p }),
|
|
157
|
-
|
|
157
|
+
"aria-label": o,
|
|
158
|
+
children: /* @__PURE__ */ u(
|
|
158
159
|
Y,
|
|
159
160
|
{
|
|
160
161
|
className: W({
|
|
161
162
|
theme: b,
|
|
162
|
-
className:
|
|
163
|
+
className: n
|
|
163
164
|
})
|
|
164
165
|
}
|
|
165
166
|
)
|
|
166
167
|
}
|
|
167
168
|
),
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ u(
|
|
170
|
+
"input",
|
|
171
|
+
{
|
|
172
|
+
ref: r,
|
|
173
|
+
name: e,
|
|
174
|
+
type: "text",
|
|
175
|
+
className: "hidden",
|
|
176
|
+
"aria-hidden": "true"
|
|
177
|
+
}
|
|
178
|
+
)
|
|
169
179
|
]
|
|
170
180
|
}
|
|
171
181
|
);
|
|
172
182
|
}
|
|
173
183
|
);
|
|
174
184
|
export {
|
|
175
|
-
|
|
185
|
+
le as Switch
|
|
176
186
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as D, jsx as c, Fragment as ne } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
3
|
import { useState as xe, useRef as Re, useEffect as be, useMemo as te, isValidElement as oe, useCallback as ge } from "react";
|
|
4
|
-
import { P as L, r as Se, d as Ie } from "../../index-
|
|
4
|
+
import { P as L, r as Se, d as Ie } from "../../index-BaNV0qac.js";
|
|
5
5
|
import { c as Ne, a as Ae, b as X, d as b, u as Fe } from "../../index-8vgf-x5i.js";
|
|
6
6
|
import { u as se, S as j } from "../../index-DoOsnuB6.js";
|
|
7
7
|
import { c as _e } from "../../index-BBjak_0p.js";
|
|
8
|
-
import { B as De, R as Le, P as Oe } from "../../index-
|
|
8
|
+
import { B as De, R as Le, P as Oe } from "../../index-BedjZUuB.js";
|
|
9
9
|
import { P as Me } from "../../index-D4Q2rMby.js";
|
|
10
|
-
import { V as ae, R as ke } from "../../index-
|
|
10
|
+
import { V as ae, R as ke } from "../../index-BtibbG81.js";
|
|
11
11
|
import "../../contexts/theme.context.js";
|
|
12
12
|
import { useTheme as Ve } from "../../contexts/theme.hook.js";
|
|
13
13
|
import "../../js.cookie-OLEfuq_g.js";
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { forwardRef as N, useRef as
|
|
1
|
+
import { jsx as e, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as N, useRef as w, useImperativeHandle as x, useMemo as R, isValidElement as T } from "react";
|
|
3
3
|
import { S as i } from "../../index-DoOsnuB6.js";
|
|
4
4
|
import "../../contexts/theme.context.js";
|
|
5
5
|
import { useTheme as V } from "../../contexts/theme.hook.js";
|
|
6
6
|
import "../../js.cookie-OLEfuq_g.js";
|
|
7
7
|
import { cn as a } from "../../utils/index.js";
|
|
8
|
-
import { tooltipVariants as
|
|
9
|
-
import { useTooltip as
|
|
8
|
+
import { tooltipVariants as b, arrowVariants as j } from "./Tooltip.variants.js";
|
|
9
|
+
import { useTooltip as C } from "./hooks/useTooltip.js";
|
|
10
10
|
const z = N(
|
|
11
|
-
({ children:
|
|
12
|
-
const d =
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
() => T(
|
|
16
|
-
[
|
|
11
|
+
({ children: t, content: l, className: n, theme: p, position: r, wrapperClassName: c }, f) => {
|
|
12
|
+
const d = w(null), { theme: h } = V(), s = p ?? h, { isVisible: u, componentRef: o } = C();
|
|
13
|
+
x(f, () => o.current, [o]);
|
|
14
|
+
const v = R(
|
|
15
|
+
() => T(t) ? t : /* @__PURE__ */ e("p", { className: "p-2", children: t }),
|
|
16
|
+
[t]
|
|
17
17
|
);
|
|
18
|
-
return /* @__PURE__ */ e("div", { className: a("w-full", c), children: /* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */ e(i, { ref: o, className: a("cursor-pointer ",
|
|
20
|
-
/* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ e("div", { className: a("w-full", c), children: /* @__PURE__ */ m("div", { className: "relative w-max", children: [
|
|
19
|
+
/* @__PURE__ */ e(i, { ref: o, className: a("cursor-pointer ", n), children: v }),
|
|
20
|
+
/* @__PURE__ */ m(
|
|
21
21
|
"div",
|
|
22
22
|
{
|
|
23
23
|
ref: d,
|
|
24
|
-
className:
|
|
25
|
-
"
|
|
24
|
+
className: b({ theme: s, position: r }),
|
|
25
|
+
"data-visible": u,
|
|
26
26
|
children: [
|
|
27
27
|
/* @__PURE__ */ e(
|
|
28
28
|
"span",
|
|
29
29
|
{
|
|
30
|
-
className:
|
|
30
|
+
className: j({ theme: s, position: r })
|
|
31
31
|
}
|
|
32
32
|
),
|
|
33
|
-
/* @__PURE__ */ e(i, { children:
|
|
33
|
+
/* @__PURE__ */ e(i, { children: l })
|
|
34
34
|
]
|
|
35
35
|
}
|
|
36
36
|
)
|
package/dist/components/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Button as a } from "./Button/Button.js";
|
|
|
5
5
|
import { Checkbox as u } from "./Checkbox/Checkbox.js";
|
|
6
6
|
import { Dropdown as d } from "./Dropdown/Dropdown.js";
|
|
7
7
|
import { Input as i } from "./Input/Input.js";
|
|
8
|
-
import { M as T } from "../Modal-
|
|
8
|
+
import { M as T } from "../Modal-Ca3bkvvt.js";
|
|
9
9
|
import { NumberInput as b } from "./NumberInput/NumberInput.js";
|
|
10
10
|
import { ProgressBar as B } from "./ProgressBar/ProgressBar.js";
|
|
11
11
|
import { Radio as h } from "./Radio/Radio.js";
|