@konstructio/ui 0.0.8 → 0.0.10
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/{Modal-Ca3bkvvt.js → Modal-L73dmnHv.js} +240 -235
- package/dist/components/AlertDialog/AlertDialog.js +37 -30
- package/dist/components/AlertDialog/AlertDialog.types.d.ts +7 -2
- package/dist/components/Autocomplete/Autocomplete.js +42 -37
- package/dist/components/Autocomplete/components/List/List.js +60 -0
- package/dist/components/Autocomplete/components/{List.types.d.ts → List/List.types.d.ts} +3 -3
- package/dist/components/Autocomplete/components/{List.variants.js → List/List.variants.js} +1 -1
- package/dist/components/Autocomplete/components/index.d.ts +1 -0
- package/dist/components/Autocomplete/components/index.js +4 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +44 -39
- package/dist/components/Card/Card.js +30 -25
- package/dist/components/Checkbox/Checkbox.js +56 -51
- package/dist/components/Dropdown/components/ListItem/ListItem.js +18 -17
- package/dist/components/Dropdown/components/Wrapper.js +15 -15
- package/dist/components/Input/Input.js +4 -4
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Footer/Footer.js +5 -4
- package/dist/components/Modal/components/Header/Header.js +4 -3
- package/dist/components/Modal/components/Wrapper/Wrapper.js +4 -3
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +78 -69
- package/dist/components/ProgressBar/ProgressBar.js +6 -6
- package/dist/components/Radio/Radio.js +21 -18
- package/dist/components/RadioGroup/RadioGroup.js +26 -22
- package/dist/components/RadioGroup/RadioGroup.types.d.ts +4 -3
- package/dist/components/Range/Range.js +40 -40
- package/dist/components/Slider/Slider.js +25 -25
- package/dist/components/Switch/Switch.js +30 -30
- package/dist/components/Tag/Tag.js +5 -4
- package/dist/components/TagSelect/TagSelect.js +24 -24
- package/dist/components/TextArea/TextArea.js +17 -16
- package/dist/components/Toast/Toast.js +103 -97
- package/dist/components/Tooltip/Tooltip.js +12 -12
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/package.json +16 -3
- package/package.json +16 -3
- package/dist/components/Autocomplete/components/List.js +0 -57
- /package/dist/components/Autocomplete/components/{List.d.ts → List/List.d.ts} +0 -0
- /package/dist/components/Autocomplete/components/{List.types.js → List/List.types.js} +0 -0
- /package/dist/components/Autocomplete/components/{List.variants.d.ts → List/List.variants.d.ts} +0 -0
|
@@ -1,45 +1,46 @@
|
|
|
1
1
|
import { jsxs as y, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import p, { forwardRef as b, useId as _, useState as E, useCallback as w } from "react";
|
|
3
2
|
import { R as j } from "../../index-BtibbG81.js";
|
|
3
|
+
import p, { forwardRef as d, useId as E, useState as T, useCallback as x } from "react";
|
|
4
4
|
import "../../contexts/theme.context.js";
|
|
5
|
-
import { useTheme as
|
|
5
|
+
import { useTheme as $ } from "../../contexts/theme.hook.js";
|
|
6
6
|
import "../../js.cookie-OLEfuq_g.js";
|
|
7
|
-
import {
|
|
7
|
+
import { cn as h } from "../../utils/index.js";
|
|
8
|
+
import { labelVariants as L, buttonVariants as P, numberInputVariants as W } from "./NumberInput.variants.js";
|
|
8
9
|
import { P as a } from "../../index-D68N8v8R.js";
|
|
9
|
-
function
|
|
10
|
-
return
|
|
11
|
-
for (var
|
|
12
|
-
var r = arguments[
|
|
10
|
+
function v() {
|
|
11
|
+
return v = Object.assign || function(e) {
|
|
12
|
+
for (var o = 1; o < arguments.length; o++) {
|
|
13
|
+
var r = arguments[o];
|
|
13
14
|
for (var t in r)
|
|
14
15
|
Object.prototype.hasOwnProperty.call(r, t) && (e[t] = r[t]);
|
|
15
16
|
}
|
|
16
17
|
return e;
|
|
17
|
-
},
|
|
18
|
+
}, v.apply(this, arguments);
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
+
function V(e, o) {
|
|
20
21
|
if (e == null) return {};
|
|
21
|
-
var r =
|
|
22
|
+
var r = M(e, o), t, n;
|
|
22
23
|
if (Object.getOwnPropertySymbols) {
|
|
23
|
-
var
|
|
24
|
-
for (n = 0; n <
|
|
25
|
-
t =
|
|
24
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
25
|
+
for (n = 0; n < i.length; n++)
|
|
26
|
+
t = i[n], !(o.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (r[t] = e[t]);
|
|
26
27
|
}
|
|
27
28
|
return r;
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
+
function M(e, o) {
|
|
30
31
|
if (e == null) return {};
|
|
31
|
-
var r = {}, t = Object.keys(e), n,
|
|
32
|
-
for (
|
|
33
|
-
n = t[
|
|
32
|
+
var r = {}, t = Object.keys(e), n, i;
|
|
33
|
+
for (i = 0; i < t.length; i++)
|
|
34
|
+
n = t[i], !(o.indexOf(n) >= 0) && (r[n] = e[n]);
|
|
34
35
|
return r;
|
|
35
36
|
}
|
|
36
|
-
var
|
|
37
|
-
var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size,
|
|
38
|
-
return /* @__PURE__ */ p.createElement("svg",
|
|
39
|
-
ref:
|
|
37
|
+
var O = d(function(e, o) {
|
|
38
|
+
var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, i = n === void 0 ? 24 : n, f = V(e, ["color", "size"]);
|
|
39
|
+
return /* @__PURE__ */ p.createElement("svg", v({
|
|
40
|
+
ref: o,
|
|
40
41
|
xmlns: "http://www.w3.org/2000/svg",
|
|
41
|
-
width:
|
|
42
|
-
height:
|
|
42
|
+
width: i,
|
|
43
|
+
height: i,
|
|
43
44
|
viewBox: "0 0 24 24",
|
|
44
45
|
fill: "none",
|
|
45
46
|
stroke: t,
|
|
@@ -53,45 +54,45 @@ var d = b(function(e, i) {
|
|
|
53
54
|
y2: "12"
|
|
54
55
|
}));
|
|
55
56
|
});
|
|
56
|
-
|
|
57
|
+
O.propTypes = {
|
|
57
58
|
color: a.string,
|
|
58
59
|
size: a.oneOfType([a.string, a.number])
|
|
59
60
|
};
|
|
60
|
-
|
|
61
|
-
function
|
|
62
|
-
return
|
|
63
|
-
for (var
|
|
64
|
-
var r = arguments[
|
|
61
|
+
O.displayName = "Minus";
|
|
62
|
+
function b() {
|
|
63
|
+
return b = Object.assign || function(e) {
|
|
64
|
+
for (var o = 1; o < arguments.length; o++) {
|
|
65
|
+
var r = arguments[o];
|
|
65
66
|
for (var t in r)
|
|
66
67
|
Object.prototype.hasOwnProperty.call(r, t) && (e[t] = r[t]);
|
|
67
68
|
}
|
|
68
69
|
return e;
|
|
69
|
-
},
|
|
70
|
+
}, b.apply(this, arguments);
|
|
70
71
|
}
|
|
71
|
-
function
|
|
72
|
+
function R(e, o) {
|
|
72
73
|
if (e == null) return {};
|
|
73
|
-
var r =
|
|
74
|
+
var r = S(e, o), t, n;
|
|
74
75
|
if (Object.getOwnPropertySymbols) {
|
|
75
|
-
var
|
|
76
|
-
for (n = 0; n <
|
|
77
|
-
t =
|
|
76
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
77
|
+
for (n = 0; n < i.length; n++)
|
|
78
|
+
t = i[n], !(o.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (r[t] = e[t]);
|
|
78
79
|
}
|
|
79
80
|
return r;
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
+
function S(e, o) {
|
|
82
83
|
if (e == null) return {};
|
|
83
|
-
var r = {}, t = Object.keys(e), n,
|
|
84
|
-
for (
|
|
85
|
-
n = t[
|
|
84
|
+
var r = {}, t = Object.keys(e), n, i;
|
|
85
|
+
for (i = 0; i < t.length; i++)
|
|
86
|
+
n = t[i], !(o.indexOf(n) >= 0) && (r[n] = e[n]);
|
|
86
87
|
return r;
|
|
87
88
|
}
|
|
88
|
-
var
|
|
89
|
-
var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size,
|
|
90
|
-
return /* @__PURE__ */ p.createElement("svg",
|
|
91
|
-
ref:
|
|
89
|
+
var g = d(function(e, o) {
|
|
90
|
+
var r = e.color, t = r === void 0 ? "currentColor" : r, n = e.size, i = n === void 0 ? 24 : n, f = R(e, ["color", "size"]);
|
|
91
|
+
return /* @__PURE__ */ p.createElement("svg", b({
|
|
92
|
+
ref: o,
|
|
92
93
|
xmlns: "http://www.w3.org/2000/svg",
|
|
93
|
-
width:
|
|
94
|
-
height:
|
|
94
|
+
width: i,
|
|
95
|
+
height: i,
|
|
95
96
|
viewBox: "0 0 24 24",
|
|
96
97
|
fill: "none",
|
|
97
98
|
stroke: t,
|
|
@@ -110,37 +111,39 @@ var O = b(function(e, i) {
|
|
|
110
111
|
y2: "12"
|
|
111
112
|
}));
|
|
112
113
|
});
|
|
113
|
-
|
|
114
|
+
g.propTypes = {
|
|
114
115
|
color: a.string,
|
|
115
116
|
size: a.oneOfType([a.string, a.number])
|
|
116
117
|
};
|
|
117
|
-
|
|
118
|
-
const
|
|
118
|
+
g.displayName = "Plus";
|
|
119
|
+
const Q = d(
|
|
119
120
|
({
|
|
120
121
|
className: e,
|
|
121
|
-
init:
|
|
122
|
+
init: o,
|
|
122
123
|
label: r,
|
|
123
124
|
max: t = -1 / 0,
|
|
124
125
|
min: n = 1 / 0,
|
|
125
|
-
name:
|
|
126
|
+
name: i,
|
|
126
127
|
theme: f,
|
|
127
128
|
onChange: s
|
|
128
|
-
},
|
|
129
|
-
const { theme:
|
|
129
|
+
}, k) => {
|
|
130
|
+
const { theme: I } = $(), m = f ?? I, N = E(), [c, w] = T(() => o || 0), z = x(() => {
|
|
130
131
|
let l = 0;
|
|
131
|
-
n === 1 / 0 ? l = c - 1 : l = Math.max(n, c - 1),
|
|
132
|
-
}, [c, n, s]),
|
|
132
|
+
n === 1 / 0 ? l = c - 1 : l = Math.max(n, c - 1), w(l), s == null || s(l);
|
|
133
|
+
}, [c, n, s]), _ = x(() => {
|
|
133
134
|
let l = 0;
|
|
134
|
-
t === -1 / 0 ? l = c + 1 : l = Math.min(t, c + 1),
|
|
135
|
+
t === -1 / 0 ? l = c + 1 : l = Math.min(t, c + 1), w(l), s == null || s(l);
|
|
135
136
|
}, [c, t, s]);
|
|
136
137
|
return /* @__PURE__ */ y("div", { className: "flex flex-col gap-1", children: [
|
|
137
138
|
r ? /* @__PURE__ */ u(
|
|
138
139
|
"label",
|
|
139
140
|
{
|
|
140
|
-
htmlFor:
|
|
141
|
-
className:
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
htmlFor: i ?? N,
|
|
142
|
+
className: h(
|
|
143
|
+
L({
|
|
144
|
+
theme: m
|
|
145
|
+
})
|
|
146
|
+
),
|
|
144
147
|
children: r
|
|
145
148
|
}
|
|
146
149
|
) : null,
|
|
@@ -149,10 +152,12 @@ const J = b(
|
|
|
149
152
|
"button",
|
|
150
153
|
{
|
|
151
154
|
type: "button",
|
|
152
|
-
onClick:
|
|
153
|
-
className:
|
|
155
|
+
onClick: z,
|
|
156
|
+
className: h(
|
|
157
|
+
P({ theme: m, button: "rigth" })
|
|
158
|
+
),
|
|
154
159
|
children: [
|
|
155
|
-
/* @__PURE__ */ u(
|
|
160
|
+
/* @__PURE__ */ u(O, { className: "w-4 h-4" }),
|
|
156
161
|
/* @__PURE__ */ u(j, { children: "Decrement" })
|
|
157
162
|
]
|
|
158
163
|
}
|
|
@@ -160,11 +165,13 @@ const J = b(
|
|
|
160
165
|
/* @__PURE__ */ u(
|
|
161
166
|
"input",
|
|
162
167
|
{
|
|
163
|
-
ref:
|
|
168
|
+
ref: k,
|
|
164
169
|
type: "number",
|
|
165
170
|
value: c,
|
|
166
|
-
name:
|
|
167
|
-
className:
|
|
171
|
+
name: i,
|
|
172
|
+
className: h(
|
|
173
|
+
W({ className: e, theme: m })
|
|
174
|
+
),
|
|
168
175
|
readOnly: !0,
|
|
169
176
|
"aria-label": r
|
|
170
177
|
}
|
|
@@ -173,10 +180,12 @@ const J = b(
|
|
|
173
180
|
"button",
|
|
174
181
|
{
|
|
175
182
|
type: "button",
|
|
176
|
-
onClick:
|
|
177
|
-
className:
|
|
183
|
+
onClick: _,
|
|
184
|
+
className: h(
|
|
185
|
+
P({ theme: m, button: "left" })
|
|
186
|
+
),
|
|
178
187
|
children: [
|
|
179
|
-
/* @__PURE__ */ u(
|
|
188
|
+
/* @__PURE__ */ u(g, { className: "w-4 h-4" }),
|
|
180
189
|
/* @__PURE__ */ u(j, { children: "Increment" })
|
|
181
190
|
]
|
|
182
191
|
}
|
|
@@ -186,5 +195,5 @@ const J = b(
|
|
|
186
195
|
}
|
|
187
196
|
);
|
|
188
197
|
export {
|
|
189
|
-
|
|
198
|
+
Q as NumberInput
|
|
190
199
|
};
|
|
@@ -3,7 +3,7 @@ import "../../contexts/theme.context.js";
|
|
|
3
3
|
import { useTheme as l } from "../../contexts/theme.hook.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "../../js.cookie-OLEfuq_g.js";
|
|
6
|
-
import { cn as
|
|
6
|
+
import { cn as o } from "../../utils/index.js";
|
|
7
7
|
import { progressBarVariants as d, progressBarProgress as c } from "./ProgressBar.variants.js";
|
|
8
8
|
const j = ({
|
|
9
9
|
label: r,
|
|
@@ -11,20 +11,20 @@ const j = ({
|
|
|
11
11
|
percent: s,
|
|
12
12
|
status: n
|
|
13
13
|
}) => {
|
|
14
|
-
const { theme: a } = l(),
|
|
14
|
+
const { theme: a } = l(), t = m ?? a;
|
|
15
15
|
return /* @__PURE__ */ e("div", { className: "w-full", children: [
|
|
16
|
-
/* @__PURE__ */ e("div", { className:
|
|
16
|
+
/* @__PURE__ */ e("div", { className: o("flex", r ? "justify-between" : "justify-end"), children: [
|
|
17
17
|
r ? /* @__PURE__ */ i("label", { className: "font-semibold", children: r }) : null,
|
|
18
18
|
/* @__PURE__ */ e("span", { className: "font-semibold", children: [
|
|
19
19
|
s,
|
|
20
20
|
"%"
|
|
21
21
|
] })
|
|
22
22
|
] }),
|
|
23
|
-
/* @__PURE__ */ i("div", { className: d({ theme:
|
|
23
|
+
/* @__PURE__ */ i("div", { className: o(d({ theme: t })), children: /* @__PURE__ */ i(
|
|
24
24
|
"div",
|
|
25
25
|
{
|
|
26
|
-
className:
|
|
27
|
-
c({ theme:
|
|
26
|
+
className: o(
|
|
27
|
+
c({ theme: t, status: n }),
|
|
28
28
|
s > 0 && s < 99 ? "transition-width duration-500" : "transition-colors duration-0"
|
|
29
29
|
),
|
|
30
30
|
style: { width: `${s}%` }
|
|
@@ -3,19 +3,20 @@ import { forwardRef as x, useId as N, useCallback as b } from "react";
|
|
|
3
3
|
import "../../contexts/theme.context.js";
|
|
4
4
|
import { useTheme as j } from "../../contexts/theme.hook.js";
|
|
5
5
|
import "../../js.cookie-OLEfuq_g.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import { cn as F } from "../../utils/index.js";
|
|
7
|
+
import { radioVariants as R } from "./Radio.variants.js";
|
|
8
|
+
const q = x(
|
|
8
9
|
({
|
|
9
|
-
checked:
|
|
10
|
-
className:
|
|
10
|
+
checked: m = !1,
|
|
11
|
+
className: i,
|
|
11
12
|
defaultChecked: a,
|
|
12
|
-
label:
|
|
13
|
-
name:
|
|
14
|
-
theme:
|
|
15
|
-
value:
|
|
13
|
+
label: c,
|
|
14
|
+
name: t,
|
|
15
|
+
theme: l,
|
|
16
|
+
value: s,
|
|
16
17
|
onChange: e
|
|
17
|
-
},
|
|
18
|
-
const
|
|
18
|
+
}, p) => {
|
|
19
|
+
const d = N(), { theme: n } = j(), o = `${d}-${t}`, f = b(
|
|
19
20
|
(h) => {
|
|
20
21
|
e == null || e(h);
|
|
21
22
|
},
|
|
@@ -30,29 +31,31 @@ const I = x(
|
|
|
30
31
|
/* @__PURE__ */ r(
|
|
31
32
|
"input",
|
|
32
33
|
{
|
|
33
|
-
ref:
|
|
34
|
+
ref: p,
|
|
34
35
|
id: o,
|
|
35
36
|
type: "radio",
|
|
36
|
-
name:
|
|
37
|
-
value:
|
|
38
|
-
checked:
|
|
37
|
+
name: t,
|
|
38
|
+
value: s,
|
|
39
|
+
checked: m,
|
|
39
40
|
defaultChecked: a,
|
|
40
41
|
className: "hidden peer",
|
|
41
|
-
onChange: () => f(
|
|
42
|
+
onChange: () => f(s)
|
|
42
43
|
}
|
|
43
44
|
),
|
|
44
45
|
/* @__PURE__ */ r(
|
|
45
46
|
"span",
|
|
46
47
|
{
|
|
47
|
-
className: F(
|
|
48
|
+
className: F(
|
|
49
|
+
R({ className: i, theme: l ?? n })
|
|
50
|
+
)
|
|
48
51
|
}
|
|
49
52
|
),
|
|
50
|
-
/* @__PURE__ */ r("span", { className: "ml-2", children:
|
|
53
|
+
/* @__PURE__ */ r("span", { className: "ml-2", children: c })
|
|
51
54
|
]
|
|
52
55
|
}
|
|
53
56
|
);
|
|
54
57
|
}
|
|
55
58
|
);
|
|
56
59
|
export {
|
|
57
|
-
|
|
60
|
+
q as Radio
|
|
58
61
|
};
|
|
@@ -1,37 +1,41 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as k, useCallback as l } from "react";
|
|
1
|
+
import { jsx as o, Fragment as N } from "react/jsx-runtime";
|
|
3
2
|
import { S as R } from "../../index-DoOsnuB6.js";
|
|
3
|
+
import { useState as T, useCallback as a } from "react";
|
|
4
4
|
import "../../contexts/theme.context.js";
|
|
5
|
-
import { useTheme as
|
|
5
|
+
import { useTheme as b } from "../../contexts/theme.hook.js";
|
|
6
6
|
import "../../js.cookie-OLEfuq_g.js";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
import { cn as e } from "../../utils/index.js";
|
|
8
|
+
import { Radio as j } from "../Radio/Radio.js";
|
|
9
|
+
const D = ({
|
|
10
|
+
asChild: r,
|
|
11
|
+
className: c,
|
|
12
|
+
defaultValue: s,
|
|
13
|
+
name: i,
|
|
14
|
+
options: p,
|
|
15
|
+
theme: d,
|
|
16
|
+
wrapperClassName: f,
|
|
17
|
+
onValueChange: m
|
|
15
18
|
}) => {
|
|
16
|
-
const
|
|
19
|
+
const S = r ? R : "div", { theme: h } = b(), [n, x] = T(s), l = a(
|
|
17
20
|
(t) => {
|
|
18
|
-
|
|
21
|
+
x(t), m == null || m(t);
|
|
19
22
|
},
|
|
20
|
-
[
|
|
23
|
+
[m]
|
|
21
24
|
);
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
|
|
25
|
+
return /* @__PURE__ */ o(S, { className: e("flex gap-2", f), children: /* @__PURE__ */ o(N, { children: p.map(({ value: t, ...k }) => /* @__PURE__ */ o(
|
|
26
|
+
j,
|
|
24
27
|
{
|
|
25
28
|
value: t,
|
|
26
|
-
theme:
|
|
27
|
-
name:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
theme: d ?? h,
|
|
30
|
+
name: i,
|
|
31
|
+
className: e(c),
|
|
32
|
+
checked: n === t,
|
|
33
|
+
onChange: () => l(t),
|
|
34
|
+
...k
|
|
31
35
|
},
|
|
32
36
|
t
|
|
33
37
|
)) }) });
|
|
34
38
|
};
|
|
35
39
|
export {
|
|
36
|
-
|
|
40
|
+
D as RadioGroup
|
|
37
41
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { RadioProps } from '../Radio/Radio.types';
|
|
2
2
|
export interface RadioGroupProps {
|
|
3
|
+
asChild?: boolean;
|
|
4
|
+
className?: RadioProps['className'];
|
|
5
|
+
defaultValue?: string;
|
|
3
6
|
label?: string;
|
|
4
7
|
name: string;
|
|
5
8
|
options: Omit<RadioProps, 'name'>[];
|
|
6
|
-
asChild?: boolean;
|
|
7
9
|
theme?: RadioProps['theme'];
|
|
8
|
-
|
|
9
|
-
defaultValue?: string;
|
|
10
|
+
wrapperClassName?: string;
|
|
10
11
|
onValueChange?: (value: string) => void;
|
|
11
12
|
}
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { cn as C } from "../../utils/index.js";
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { R as V, T as v, a as T, b as c } from "../../index-z-AJyzdv.js";
|
|
3
|
+
import { forwardRef as b, useRef as j, useState as k, useImperativeHandle as w, useEffect as y, useCallback as C } from "react";
|
|
5
4
|
import "../../contexts/theme.context.js";
|
|
6
5
|
import { useTheme as S } from "../../contexts/theme.hook.js";
|
|
7
6
|
import "../../js.cookie-OLEfuq_g.js";
|
|
8
|
-
import {
|
|
9
|
-
|
|
7
|
+
import { cn as t } from "../../utils/index.js";
|
|
8
|
+
import { rangeVariants as $, trackVariants as E, rangeOutsideVariants as H, thumbVariants as i } from "./Range.variants.js";
|
|
9
|
+
const J = b(
|
|
10
10
|
({
|
|
11
|
-
label:
|
|
12
|
-
defaultValue:
|
|
13
|
-
name:
|
|
14
|
-
theme:
|
|
15
|
-
size:
|
|
16
|
-
showValue:
|
|
17
|
-
...
|
|
18
|
-
},
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}, [
|
|
23
|
-
const
|
|
24
|
-
(
|
|
11
|
+
label: m,
|
|
12
|
+
defaultValue: o = [0, 100],
|
|
13
|
+
name: u,
|
|
14
|
+
theme: h,
|
|
15
|
+
size: l,
|
|
16
|
+
showValue: f,
|
|
17
|
+
...d
|
|
18
|
+
}, p) => {
|
|
19
|
+
const a = j(null), [s, x] = k(o), { theme: N } = S(), r = h ?? N;
|
|
20
|
+
w(p, () => a.current, [a]), y(() => {
|
|
21
|
+
a.current && (a.current.value = `[${s.toString()}]`);
|
|
22
|
+
}, [s]);
|
|
23
|
+
const g = C(
|
|
24
|
+
(R) => x(R),
|
|
25
25
|
[]
|
|
26
26
|
);
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ n("div", { className: "w-full relative flex flex-col gap-3", children: [
|
|
28
|
+
/* @__PURE__ */ n(
|
|
29
29
|
"div",
|
|
30
30
|
{
|
|
31
|
-
className:
|
|
31
|
+
className: t(
|
|
32
32
|
"flex items-center",
|
|
33
|
-
|
|
33
|
+
m ? "justify-between" : "justify-end"
|
|
34
34
|
),
|
|
35
35
|
children: [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
m ? /* @__PURE__ */ e("label", { children: m }) : null,
|
|
37
|
+
f ? /* @__PURE__ */ n("span", { className: "text-xs", children: [
|
|
38
|
+
s[0],
|
|
39
39
|
" - ",
|
|
40
|
-
|
|
40
|
+
s[1]
|
|
41
41
|
] }) : null
|
|
42
42
|
]
|
|
43
43
|
}
|
|
44
44
|
),
|
|
45
|
-
/* @__PURE__ */ e("input", { ref:
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
|
|
45
|
+
/* @__PURE__ */ e("input", { ref: a, name: u, className: "hidden", type: "text" }),
|
|
46
|
+
/* @__PURE__ */ n(
|
|
47
|
+
V,
|
|
48
48
|
{
|
|
49
|
-
value:
|
|
50
|
-
className: $({ theme:
|
|
51
|
-
onValueChange:
|
|
52
|
-
...
|
|
49
|
+
value: s,
|
|
50
|
+
className: t($({ theme: r })),
|
|
51
|
+
onValueChange: g,
|
|
52
|
+
...d,
|
|
53
53
|
children: [
|
|
54
|
-
/* @__PURE__ */ e(
|
|
55
|
-
|
|
54
|
+
/* @__PURE__ */ e(v, { className: t(E({ theme: r, size: l })), children: /* @__PURE__ */ e(
|
|
55
|
+
T,
|
|
56
56
|
{
|
|
57
|
-
className: H({ theme:
|
|
57
|
+
className: t(H({ theme: r }))
|
|
58
58
|
}
|
|
59
59
|
) }),
|
|
60
|
-
/* @__PURE__ */ e(
|
|
61
|
-
/* @__PURE__ */ e(
|
|
60
|
+
/* @__PURE__ */ e(c, { className: t(i({ theme: r, size: l })) }),
|
|
61
|
+
/* @__PURE__ */ e(c, { className: t(i({ theme: r, size: l })) })
|
|
62
62
|
]
|
|
63
63
|
}
|
|
64
64
|
)
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { R as g,
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { R as v, T, b as V } from "../../index-z-AJyzdv.js";
|
|
3
|
+
import { forwardRef as b, useRef as R, useState as g, useImperativeHandle as j, useEffect as k, useCallback as w } from "react";
|
|
4
4
|
import "../../contexts/theme.context.js";
|
|
5
|
-
import { useTheme as
|
|
5
|
+
import { useTheme as y } from "../../contexts/theme.hook.js";
|
|
6
6
|
import "../../js.cookie-OLEfuq_g.js";
|
|
7
|
-
import { cn as
|
|
7
|
+
import { cn as a } from "../../utils/index.js";
|
|
8
8
|
import { sliderVariants as C, trackVariants as S, thumbVariants as E } from "./Slider.variants.js";
|
|
9
|
-
const J =
|
|
10
|
-
({ label:
|
|
11
|
-
const e =
|
|
12
|
-
|
|
9
|
+
const J = b(
|
|
10
|
+
({ label: s, defaultValue: i = [0], name: c, theme: o, size: m, showValue: u, ...f }, h) => {
|
|
11
|
+
const e = R(null), [r, d] = g(i), { theme: p } = y(), n = o ?? p;
|
|
12
|
+
j(h, () => e.current, [e]), k(() => {
|
|
13
13
|
e.current && (e.current.value = r.toString());
|
|
14
14
|
}, [r]);
|
|
15
|
-
const
|
|
16
|
-
(
|
|
15
|
+
const x = w(
|
|
16
|
+
(N) => d(N),
|
|
17
17
|
[]
|
|
18
18
|
);
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ l("div", { className: "w-full relative flex flex-col gap-3", children: [
|
|
20
|
+
/* @__PURE__ */ l(
|
|
21
21
|
"div",
|
|
22
22
|
{
|
|
23
|
-
className:
|
|
23
|
+
className: a(
|
|
24
24
|
"flex items-center",
|
|
25
|
-
|
|
25
|
+
s ? "justify-between" : "justify-end"
|
|
26
26
|
),
|
|
27
27
|
children: [
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
s ? /* @__PURE__ */ t("label", { children: s }) : null,
|
|
29
|
+
u ? /* @__PURE__ */ t("span", { className: "text-xs", children: r }) : null
|
|
30
30
|
]
|
|
31
31
|
}
|
|
32
32
|
),
|
|
33
|
-
/* @__PURE__ */ t("input", { ref: e, name:
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
|
|
33
|
+
/* @__PURE__ */ t("input", { ref: e, name: c, className: "hidden", type: "number" }),
|
|
34
|
+
/* @__PURE__ */ l(
|
|
35
|
+
v,
|
|
36
36
|
{
|
|
37
37
|
value: r,
|
|
38
|
-
className: C({ theme:
|
|
39
|
-
onValueChange:
|
|
40
|
-
...
|
|
38
|
+
className: a(C({ theme: n })),
|
|
39
|
+
onValueChange: x,
|
|
40
|
+
...f,
|
|
41
41
|
children: [
|
|
42
|
-
/* @__PURE__ */ t(
|
|
43
|
-
/* @__PURE__ */ t(
|
|
42
|
+
/* @__PURE__ */ t(T, { className: a(S({ theme: n, size: m })) }),
|
|
43
|
+
/* @__PURE__ */ t(V, { className: a(E({ theme: n, size: m })) })
|
|
44
44
|
]
|
|
45
45
|
}
|
|
46
46
|
)
|