@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,8 +2,8 @@ import { jsx as c, jsxs as U, Fragment as j } from "react/jsx-runtime";
|
|
|
2
2
|
import * as i from "react";
|
|
3
3
|
import { u as xe, b as Y, c as ee, d as R, e as Le, a as ke } from "./index-8vgf-x5i.js";
|
|
4
4
|
import { u as O, S as We, a as $e } from "./index-DoOsnuB6.js";
|
|
5
|
-
import { D as Ue, P as Ge } from "./index-
|
|
6
|
-
import { P } from "./index-
|
|
5
|
+
import { D as Ue, P as Ge } from "./index-BedjZUuB.js";
|
|
6
|
+
import { P } from "./index-BaNV0qac.js";
|
|
7
7
|
import { P as G } from "./index-D4Q2rMby.js";
|
|
8
8
|
import { R as Ke } from "./Combination-Cmu9JRkv.js";
|
|
9
9
|
import "./contexts/theme.context.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _, jsxs as Q } from "react/jsx-runtime";
|
|
2
|
-
import { r as _r } from "./index-
|
|
2
|
+
import { r as _r } from "./index-BaNV0qac.js";
|
|
3
3
|
import { Body as Mr } from "./components/Modal/components/Body/Body.js";
|
|
4
4
|
import { Footer as kr } from "./components/Modal/components/Footer/Footer.js";
|
|
5
5
|
import { Header as Lr } from "./components/Modal/components/Header/Header.js";
|
|
6
6
|
import N, { createContext as Rr, forwardRef as Re, useState as Z, useRef as ee, useCallback as R, useEffect as Wr, useMemo as Br, Fragment as Ur, PureComponent as Gr, Children as q, isValidElement as $ } from "react";
|
|
7
7
|
import { P as We, p as l } from "./index-D68N8v8R.js";
|
|
8
8
|
import { c as se, a as Hr, u as jr, R as Vr } from "./Combination-Cmu9JRkv.js";
|
|
9
|
-
import { R as qr } from "./index-
|
|
9
|
+
import { R as qr } from "./index-BtibbG81.js";
|
|
10
10
|
import "./contexts/theme.context.js";
|
|
11
11
|
import { useTheme as $r } from "./contexts/theme.hook.js";
|
|
12
12
|
import "./js.cookie-OLEfuq_g.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { R as h, A as f, P as x, O as g, C as u, T as C, D as b, a as y, b as O } from "../../AlertDialogTrigger-
|
|
2
|
+
import { R as h, A as f, P as x, O as g, C as u, T as C, D as b, a as y, b as O } from "../../AlertDialogTrigger-D4Tm_9M0.js";
|
|
3
3
|
import "../../contexts/theme.context.js";
|
|
4
4
|
import { useTheme as A } from "../../contexts/theme.hook.js";
|
|
5
5
|
import "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import { A as a } from "../../../AlertDialogTrigger-
|
|
2
|
+
import { A as a } from "../../../AlertDialogTrigger-D4Tm_9M0.js";
|
|
3
3
|
import "../../../contexts/theme.context.js";
|
|
4
4
|
import "../../../contexts/theme.hook.js";
|
|
5
5
|
import "react";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as C, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as R, useRef as
|
|
2
|
+
import { forwardRef as R, useRef as p, useId as A, useImperativeHandle as O } from "react";
|
|
3
3
|
import "../../contexts/theme.context.js";
|
|
4
|
-
import { useTheme as
|
|
4
|
+
import { useTheme as T } from "../../contexts/theme.hook.js";
|
|
5
5
|
import "../../js.cookie-OLEfuq_g.js";
|
|
6
|
-
import { useAutocomplete as
|
|
7
|
-
import { List as
|
|
8
|
-
import { labelVariants as
|
|
9
|
-
const
|
|
6
|
+
import { useAutocomplete as V } from "./hooks/useAutocomplete.js";
|
|
7
|
+
import { List as g } from "./components/List.js";
|
|
8
|
+
import { labelVariants as j, autocompleteVariants as y } from "./Autocomplete.variants.js";
|
|
9
|
+
const I = R(
|
|
10
10
|
({
|
|
11
|
-
autoComplete:
|
|
11
|
+
autoComplete: c = "off",
|
|
12
12
|
className: a,
|
|
13
13
|
label: n,
|
|
14
14
|
labelClassName: u,
|
|
@@ -17,24 +17,24 @@ const O = R(
|
|
|
17
17
|
placeHolderEmptyValues: h = "No values...",
|
|
18
18
|
placeHolderEmptyValuesClassName: f,
|
|
19
19
|
placeholder: x,
|
|
20
|
-
theme:
|
|
20
|
+
theme: w,
|
|
21
21
|
variant: r,
|
|
22
|
-
onChange:
|
|
22
|
+
onChange: N
|
|
23
23
|
}, b) => {
|
|
24
|
-
const s =
|
|
25
|
-
|
|
26
|
-
const
|
|
24
|
+
const s = p(null), o = p(null), i = A(), { theme: v } = T(), m = w ?? v;
|
|
25
|
+
O(b, () => o.current, [o]);
|
|
26
|
+
const e = V({
|
|
27
27
|
options: d,
|
|
28
|
-
inputRef:
|
|
28
|
+
inputRef: o,
|
|
29
29
|
wrapperRef: s,
|
|
30
|
-
onChange:
|
|
30
|
+
onChange: N
|
|
31
31
|
});
|
|
32
32
|
return /* @__PURE__ */ C("div", { ref: s, className: "relative flex flex-col", children: [
|
|
33
33
|
n ? /* @__PURE__ */ t(
|
|
34
34
|
"label",
|
|
35
35
|
{
|
|
36
|
-
htmlFor: l ??
|
|
37
|
-
className:
|
|
36
|
+
htmlFor: l ?? i,
|
|
37
|
+
className: j({
|
|
38
38
|
theme: m,
|
|
39
39
|
variant: r,
|
|
40
40
|
className: u
|
|
@@ -45,40 +45,41 @@ const O = R(
|
|
|
45
45
|
/* @__PURE__ */ t(
|
|
46
46
|
"input",
|
|
47
47
|
{
|
|
48
|
-
ref:
|
|
49
|
-
id: l ??
|
|
48
|
+
ref: o,
|
|
49
|
+
id: l ?? i,
|
|
50
50
|
type: "text",
|
|
51
51
|
name: l,
|
|
52
52
|
role: "combobox",
|
|
53
|
-
autoComplete:
|
|
54
|
-
className:
|
|
53
|
+
autoComplete: c,
|
|
54
|
+
className: y({
|
|
55
55
|
theme: m,
|
|
56
56
|
variant: r,
|
|
57
57
|
className: a
|
|
58
58
|
}),
|
|
59
|
-
onChange:
|
|
60
|
-
value:
|
|
61
|
-
placeholder: x
|
|
59
|
+
onChange: e.handleChange,
|
|
60
|
+
value: e.value,
|
|
61
|
+
placeholder: x,
|
|
62
|
+
"aria-expanded": e.showOptions ? "true" : "false"
|
|
62
63
|
}
|
|
63
64
|
),
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
e.showOptions && /* @__PURE__ */ t("div", { className: "absolute z-10 top-full w-full rounded-md mt-1 border shadow-sm", children: /* @__PURE__ */ t(
|
|
66
|
+
g,
|
|
66
67
|
{
|
|
67
68
|
className: a,
|
|
68
|
-
inputRef:
|
|
69
|
+
inputRef: o,
|
|
69
70
|
wrapperRef: s,
|
|
70
|
-
options:
|
|
71
|
+
options: e.newOptions,
|
|
71
72
|
placeholder: h,
|
|
72
73
|
placeholderClassName: f,
|
|
73
74
|
variant: r,
|
|
74
75
|
theme: m,
|
|
75
|
-
onClick:
|
|
76
|
+
onClick: e.handleSelectValue
|
|
76
77
|
}
|
|
77
78
|
) })
|
|
78
79
|
] });
|
|
79
80
|
}
|
|
80
81
|
);
|
|
81
|
-
|
|
82
|
+
I.displayName = "Autocomplete";
|
|
82
83
|
export {
|
|
83
|
-
|
|
84
|
+
I as Autocomplete
|
|
84
85
|
};
|
|
@@ -4,7 +4,7 @@ import "../../contexts/theme.context.js";
|
|
|
4
4
|
import { useTheme as O } from "../../contexts/theme.hook.js";
|
|
5
5
|
import "../../js.cookie-OLEfuq_g.js";
|
|
6
6
|
import { breadcrumbVariants as j, breadcrumbItemVariants as w, chevronVariants as x } from "./Breadcrumb.variants.js";
|
|
7
|
-
import { u as P, L as k } from "../../useBreadcrumb-
|
|
7
|
+
import { u as P, L as k } from "../../useBreadcrumb-DxYsZvj_.js";
|
|
8
8
|
import { P as m } from "../../index-D68N8v8R.js";
|
|
9
9
|
function h() {
|
|
10
10
|
return h = Object.assign || function(e) {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
3
|
+
import "../../contexts/theme.context.js";
|
|
4
|
+
import { useTheme as p } from "../../contexts/theme.hook.js";
|
|
5
|
+
import "../../js.cookie-OLEfuq_g.js";
|
|
6
|
+
import { cardBaseVariants as c, cardVariants as f } from "./Card.variants.js";
|
|
7
|
+
const n = d(
|
|
8
|
+
({ className: o, theme: r, isActive: m, canHover: e, ...s }, i) => {
|
|
9
|
+
const { theme: a } = p();
|
|
10
|
+
return /* @__PURE__ */ t(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
className: c({
|
|
14
|
+
theme: r ?? a,
|
|
15
|
+
isActive: m,
|
|
16
|
+
canHover: e
|
|
17
|
+
}),
|
|
18
|
+
children: /* @__PURE__ */ t(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
ref: i,
|
|
22
|
+
className: f({
|
|
23
|
+
className: o,
|
|
24
|
+
theme: r ?? a,
|
|
25
|
+
isActive: m,
|
|
26
|
+
canHover: e
|
|
27
|
+
}),
|
|
28
|
+
...s
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
n.displayName = "Card";
|
|
36
|
+
export {
|
|
37
|
+
n as Card
|
|
38
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes, PropsWithChildren } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { cardVariants } from './Card.variants';
|
|
4
|
+
export interface CardProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof cardVariants>, PropsWithChildren {
|
|
5
|
+
isActive?: boolean;
|
|
6
|
+
canHover?: boolean;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const cardBaseVariants: (props?: ({
|
|
2
|
+
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
3
|
+
isActive?: boolean | null | undefined;
|
|
4
|
+
canHover?: boolean | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export declare const cardVariants: (props?: ({
|
|
7
|
+
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
8
|
+
isActive?: boolean | null | undefined;
|
|
9
|
+
canHover?: boolean | null | undefined;
|
|
10
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { c as r } from "../../index-BNmRGtA6.js";
|
|
2
|
+
const o = r(
|
|
3
|
+
["border", "border-slate-200", "rounded-xl"],
|
|
4
|
+
{
|
|
5
|
+
variants: {
|
|
6
|
+
theme: {
|
|
7
|
+
colony: "",
|
|
8
|
+
kubefirst: "",
|
|
9
|
+
civo: ""
|
|
10
|
+
},
|
|
11
|
+
isActive: {
|
|
12
|
+
true: "border-transparent",
|
|
13
|
+
false: ""
|
|
14
|
+
},
|
|
15
|
+
canHover: {
|
|
16
|
+
true: ["group", "hover:border-transparent"],
|
|
17
|
+
false: ""
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
theme: "kubefirst"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
), t = r(
|
|
25
|
+
["border", "border-4", "p-3", "text-card-foreground", "rounded-xl"],
|
|
26
|
+
{
|
|
27
|
+
variants: {
|
|
28
|
+
theme: {
|
|
29
|
+
colony: "",
|
|
30
|
+
kubefirst: "",
|
|
31
|
+
civo: ""
|
|
32
|
+
},
|
|
33
|
+
isActive: {
|
|
34
|
+
true: "",
|
|
35
|
+
false: "border-transparent"
|
|
36
|
+
},
|
|
37
|
+
canHover: {
|
|
38
|
+
true: "cursor-pointer border-transparent",
|
|
39
|
+
false: ""
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
compoundVariants: [
|
|
43
|
+
{
|
|
44
|
+
theme: "colony",
|
|
45
|
+
isActive: !0,
|
|
46
|
+
class: ["border-colony-primary", "shadow"]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
theme: "kubefirst",
|
|
50
|
+
isActive: !0,
|
|
51
|
+
class: ["border-kubefirst-primary", "shadow"]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
theme: "civo",
|
|
55
|
+
isActive: !0,
|
|
56
|
+
class: ["border-civo-primary", "shadow"]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
theme: "colony",
|
|
60
|
+
canHover: !0,
|
|
61
|
+
class: "group-hover:border-colony-primary"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
theme: "kubefirst",
|
|
65
|
+
canHover: !0,
|
|
66
|
+
class: "group-hover:border-kubefirst-primary"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
theme: "civo",
|
|
70
|
+
canHover: !0,
|
|
71
|
+
class: "group-hover:border-civo-primary"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
canHover: void 0,
|
|
75
|
+
isActive: void 0,
|
|
76
|
+
class: "border-transparent"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
defaultVariants: {
|
|
80
|
+
theme: "kubefirst"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
export {
|
|
85
|
+
o as cardBaseVariants,
|
|
86
|
+
t as cardVariants
|
|
87
|
+
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { jsxs as N, jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as N, jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import * as u from "react";
|
|
3
3
|
import j, { forwardRef as S, useId as M, useCallback as A } from "react";
|
|
4
4
|
import { u as H } from "../../index-DoOsnuB6.js";
|
|
5
5
|
import { c as K, a as W, d as I } from "../../index-8vgf-x5i.js";
|
|
6
6
|
import { u as $, a as q } from "../../index-BxeV34ij.js";
|
|
7
7
|
import { P as F } from "../../index-D4Q2rMby.js";
|
|
8
|
-
import { P as _ } from "../../index-
|
|
8
|
+
import { P as _ } from "../../index-BaNV0qac.js";
|
|
9
9
|
import { useToggle as V } from "../../hooks/useToggle.js";
|
|
10
10
|
import { checkboxVariants as X, labelVariants as G } from "./Checkbox.variants.js";
|
|
11
11
|
import "../../contexts/theme.context.js";
|
|
12
12
|
import { useTheme as J } from "../../contexts/theme.hook.js";
|
|
13
13
|
import "../../js.cookie-OLEfuq_g.js";
|
|
14
|
-
import { P
|
|
15
|
-
function
|
|
16
|
-
return
|
|
14
|
+
import { P } from "../../index-D68N8v8R.js";
|
|
15
|
+
function E() {
|
|
16
|
+
return E = Object.assign || function(e) {
|
|
17
17
|
for (var s = 1; s < arguments.length; s++) {
|
|
18
18
|
var t = arguments[s];
|
|
19
19
|
for (var o in t)
|
|
20
20
|
Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
|
|
21
21
|
}
|
|
22
22
|
return e;
|
|
23
|
-
},
|
|
23
|
+
}, E.apply(this, arguments);
|
|
24
24
|
}
|
|
25
25
|
function Q(e, s) {
|
|
26
26
|
if (e == null) return {};
|
|
@@ -39,9 +39,9 @@ function U(e, s) {
|
|
|
39
39
|
n = o[r], !(s.indexOf(n) >= 0) && (t[n] = e[n]);
|
|
40
40
|
return t;
|
|
41
41
|
}
|
|
42
|
-
var
|
|
43
|
-
var t = e.color, o = t === void 0 ? "currentColor" : t, n = e.size, r = n === void 0 ? 24 : n,
|
|
44
|
-
return /* @__PURE__ */ j.createElement("svg",
|
|
42
|
+
var O = S(function(e, s) {
|
|
43
|
+
var t = e.color, o = t === void 0 ? "currentColor" : t, n = e.size, r = n === void 0 ? 24 : n, l = Q(e, ["color", "size"]);
|
|
44
|
+
return /* @__PURE__ */ j.createElement("svg", E({
|
|
45
45
|
ref: s,
|
|
46
46
|
xmlns: "http://www.w3.org/2000/svg",
|
|
47
47
|
width: r,
|
|
@@ -52,84 +52,84 @@ var E = S(function(e, s) {
|
|
|
52
52
|
strokeWidth: "2",
|
|
53
53
|
strokeLinecap: "round",
|
|
54
54
|
strokeLinejoin: "round"
|
|
55
|
-
},
|
|
55
|
+
}, l), /* @__PURE__ */ j.createElement("polyline", {
|
|
56
56
|
points: "20 6 9 17 4 12"
|
|
57
57
|
}));
|
|
58
58
|
});
|
|
59
|
-
|
|
60
|
-
color:
|
|
61
|
-
size:
|
|
59
|
+
O.propTypes = {
|
|
60
|
+
color: P.string,
|
|
61
|
+
size: P.oneOfType([P.string, P.number])
|
|
62
62
|
};
|
|
63
|
-
|
|
64
|
-
var
|
|
63
|
+
O.displayName = "Check";
|
|
64
|
+
var R = "Checkbox", [Y, ke] = K(R), [Z, ee] = Y(R), T = u.forwardRef(
|
|
65
65
|
(e, s) => {
|
|
66
66
|
const {
|
|
67
67
|
__scopeCheckbox: t,
|
|
68
68
|
name: o,
|
|
69
69
|
checked: n,
|
|
70
70
|
defaultChecked: r,
|
|
71
|
-
required:
|
|
72
|
-
disabled:
|
|
73
|
-
value:
|
|
74
|
-
onCheckedChange:
|
|
75
|
-
form:
|
|
76
|
-
...
|
|
77
|
-
} = e, [
|
|
71
|
+
required: l,
|
|
72
|
+
disabled: a,
|
|
73
|
+
value: b = "on",
|
|
74
|
+
onCheckedChange: C,
|
|
75
|
+
form: d,
|
|
76
|
+
...p
|
|
77
|
+
} = e, [i, k] = u.useState(null), v = H(s, (c) => k(c)), x = u.useRef(!1), g = i ? d || !!i.closest("form") : !0, [m = !1, w] = W({
|
|
78
78
|
prop: n,
|
|
79
79
|
defaultProp: r,
|
|
80
|
-
onChange:
|
|
81
|
-
}), B =
|
|
82
|
-
return
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
85
|
-
const
|
|
86
|
-
return
|
|
80
|
+
onChange: C
|
|
81
|
+
}), B = u.useRef(m);
|
|
82
|
+
return u.useEffect(() => {
|
|
83
|
+
const c = i == null ? void 0 : i.form;
|
|
84
|
+
if (c) {
|
|
85
|
+
const y = () => w(B.current);
|
|
86
|
+
return c.addEventListener("reset", y), () => c.removeEventListener("reset", y);
|
|
87
87
|
}
|
|
88
|
-
}, [
|
|
89
|
-
/* @__PURE__ */
|
|
88
|
+
}, [i, w]), /* @__PURE__ */ N(Z, { scope: t, state: m, disabled: a, children: [
|
|
89
|
+
/* @__PURE__ */ f(
|
|
90
90
|
_.button,
|
|
91
91
|
{
|
|
92
92
|
type: "button",
|
|
93
93
|
role: "checkbox",
|
|
94
|
-
"aria-checked": m
|
|
95
|
-
"aria-required":
|
|
96
|
-
"data-state": D(
|
|
97
|
-
"data-disabled":
|
|
98
|
-
disabled:
|
|
99
|
-
value:
|
|
100
|
-
...
|
|
101
|
-
ref:
|
|
102
|
-
onKeyDown: I(e.onKeyDown, (
|
|
103
|
-
|
|
94
|
+
"aria-checked": h(m) ? "mixed" : m,
|
|
95
|
+
"aria-required": l,
|
|
96
|
+
"data-state": D(m),
|
|
97
|
+
"data-disabled": a ? "" : void 0,
|
|
98
|
+
disabled: a,
|
|
99
|
+
value: b,
|
|
100
|
+
...p,
|
|
101
|
+
ref: v,
|
|
102
|
+
onKeyDown: I(e.onKeyDown, (c) => {
|
|
103
|
+
c.key === "Enter" && c.preventDefault();
|
|
104
104
|
}),
|
|
105
|
-
onClick: I(e.onClick, (
|
|
106
|
-
|
|
105
|
+
onClick: I(e.onClick, (c) => {
|
|
106
|
+
w((y) => h(y) ? !0 : !y), g && (x.current = c.isPropagationStopped(), x.current || c.stopPropagation());
|
|
107
107
|
})
|
|
108
108
|
}
|
|
109
109
|
),
|
|
110
|
-
|
|
110
|
+
g && /* @__PURE__ */ f(
|
|
111
111
|
te,
|
|
112
112
|
{
|
|
113
|
-
control:
|
|
114
|
-
bubbles: !
|
|
113
|
+
control: i,
|
|
114
|
+
bubbles: !x.current,
|
|
115
115
|
name: o,
|
|
116
|
-
value:
|
|
117
|
-
checked:
|
|
118
|
-
required:
|
|
119
|
-
disabled:
|
|
120
|
-
form:
|
|
116
|
+
value: b,
|
|
117
|
+
checked: m,
|
|
118
|
+
required: l,
|
|
119
|
+
disabled: a,
|
|
120
|
+
form: d,
|
|
121
121
|
style: { transform: "translateX(-100%)" },
|
|
122
|
-
defaultChecked:
|
|
122
|
+
defaultChecked: h(r) ? !1 : r
|
|
123
123
|
}
|
|
124
124
|
)
|
|
125
125
|
] });
|
|
126
126
|
}
|
|
127
127
|
);
|
|
128
|
-
T.displayName =
|
|
129
|
-
var z = "CheckboxIndicator", L =
|
|
128
|
+
T.displayName = R;
|
|
129
|
+
var z = "CheckboxIndicator", L = u.forwardRef(
|
|
130
130
|
(e, s) => {
|
|
131
131
|
const { __scopeCheckbox: t, forceMount: o, ...n } = e, r = ee(z, t);
|
|
132
|
-
return /* @__PURE__ */
|
|
132
|
+
return /* @__PURE__ */ f(F, { present: o || h(r.state) || r.state === !0, children: /* @__PURE__ */ f(
|
|
133
133
|
_.span,
|
|
134
134
|
{
|
|
135
135
|
"data-state": D(r.state),
|
|
@@ -143,27 +143,27 @@ var z = "CheckboxIndicator", L = f.forwardRef(
|
|
|
143
143
|
);
|
|
144
144
|
L.displayName = z;
|
|
145
145
|
var te = (e) => {
|
|
146
|
-
const { control: s, checked: t, bubbles: o = !0, defaultChecked: n, ...r } = e,
|
|
147
|
-
|
|
148
|
-
const
|
|
149
|
-
if (
|
|
150
|
-
const
|
|
151
|
-
|
|
146
|
+
const { control: s, checked: t, bubbles: o = !0, defaultChecked: n, ...r } = e, l = u.useRef(null), a = $(t), b = q(s);
|
|
147
|
+
u.useEffect(() => {
|
|
148
|
+
const d = l.current, p = window.HTMLInputElement.prototype, k = Object.getOwnPropertyDescriptor(p, "checked").set;
|
|
149
|
+
if (a !== t && k) {
|
|
150
|
+
const v = new Event("click", { bubbles: o });
|
|
151
|
+
d.indeterminate = h(t), k.call(d, h(t) ? !1 : t), d.dispatchEvent(v);
|
|
152
152
|
}
|
|
153
|
-
}, [
|
|
154
|
-
const
|
|
155
|
-
return /* @__PURE__ */
|
|
153
|
+
}, [a, t, o]);
|
|
154
|
+
const C = u.useRef(h(t) ? !1 : t);
|
|
155
|
+
return /* @__PURE__ */ f(
|
|
156
156
|
"input",
|
|
157
157
|
{
|
|
158
158
|
type: "checkbox",
|
|
159
159
|
"aria-hidden": !0,
|
|
160
|
-
defaultChecked: n ??
|
|
160
|
+
defaultChecked: n ?? C.current,
|
|
161
161
|
...r,
|
|
162
162
|
tabIndex: -1,
|
|
163
|
-
ref:
|
|
163
|
+
ref: l,
|
|
164
164
|
style: {
|
|
165
165
|
...e.style,
|
|
166
|
-
...
|
|
166
|
+
...b,
|
|
167
167
|
position: "absolute",
|
|
168
168
|
pointerEvents: "none",
|
|
169
169
|
opacity: 0,
|
|
@@ -172,57 +172,62 @@ var te = (e) => {
|
|
|
172
172
|
}
|
|
173
173
|
);
|
|
174
174
|
};
|
|
175
|
-
function
|
|
175
|
+
function h(e) {
|
|
176
176
|
return e === "indeterminate";
|
|
177
177
|
}
|
|
178
178
|
function D(e) {
|
|
179
|
-
return
|
|
179
|
+
return h(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
180
180
|
}
|
|
181
181
|
var re = T, oe = L;
|
|
182
182
|
const ve = S(
|
|
183
183
|
({
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
184
|
+
ariaLabelledBy: e,
|
|
185
|
+
className: s,
|
|
186
|
+
defaultChecked: t,
|
|
187
|
+
disabled: o,
|
|
188
|
+
id: n,
|
|
189
|
+
label: r,
|
|
190
|
+
labelClassName: l,
|
|
191
|
+
name: a,
|
|
192
|
+
theme: b,
|
|
193
|
+
title: C,
|
|
194
|
+
variant: d,
|
|
195
|
+
onChange: p
|
|
196
|
+
}, i) => {
|
|
197
|
+
const [k, v] = V(t), x = M(), { theme: g } = J(), m = A(() => {
|
|
198
|
+
v(), p == null || p();
|
|
199
|
+
}, [p, v]);
|
|
197
200
|
return /* @__PURE__ */ N("div", { className: "flex items-center gap-2", children: [
|
|
198
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ f(
|
|
199
202
|
re,
|
|
200
203
|
{
|
|
201
|
-
id:
|
|
202
|
-
checked:
|
|
203
|
-
ref:
|
|
204
|
-
name:
|
|
205
|
-
disabled:
|
|
204
|
+
id: n ?? x,
|
|
205
|
+
checked: k,
|
|
206
|
+
ref: i,
|
|
207
|
+
name: a,
|
|
208
|
+
disabled: o,
|
|
209
|
+
"aria-labelledby": e,
|
|
210
|
+
title: C,
|
|
206
211
|
className: X({
|
|
207
|
-
className:
|
|
208
|
-
theme:
|
|
209
|
-
variant:
|
|
210
|
-
checked:
|
|
212
|
+
className: s,
|
|
213
|
+
theme: b ?? g,
|
|
214
|
+
variant: d,
|
|
215
|
+
checked: k
|
|
211
216
|
}),
|
|
212
|
-
onCheckedChange:
|
|
213
|
-
children: /* @__PURE__ */
|
|
217
|
+
onCheckedChange: m,
|
|
218
|
+
children: /* @__PURE__ */ f(oe, { children: /* @__PURE__ */ f(O, { className: "w-4 h-4 stroke-2" }) })
|
|
214
219
|
}
|
|
215
220
|
),
|
|
216
|
-
|
|
221
|
+
r ? /* @__PURE__ */ f(
|
|
217
222
|
"label",
|
|
218
223
|
{
|
|
219
|
-
htmlFor:
|
|
224
|
+
htmlFor: a ?? n,
|
|
220
225
|
className: G({
|
|
221
|
-
variant:
|
|
222
|
-
theme:
|
|
223
|
-
className:
|
|
226
|
+
variant: d,
|
|
227
|
+
theme: b,
|
|
228
|
+
className: l
|
|
224
229
|
}),
|
|
225
|
-
children:
|
|
230
|
+
children: r
|
|
226
231
|
}
|
|
227
232
|
) : null
|
|
228
233
|
] });
|