@konstructio/ui 0.1.2-alpha.38 → 0.1.2-alpha.39
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/chevron-up-CRyLc5Ml.js +54 -0
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +21 -0
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +34 -0
- package/dist/components/MultiSelectDropdown/components/Item/Item.js +33 -0
- package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +38 -0
- package/dist/components/MultiSelectDropdown/components/List/List.js +29 -0
- package/dist/components/MultiSelectDropdown/components/List/List.variants.js +23 -0
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +96 -0
- package/dist/components/MultiSelectDropdown/components/index.js +8 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +19 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.hook.js +13 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +119 -0
- package/dist/components/MultiSelectDropdown/contexts/index.js +6 -0
- package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +32 -0
- package/dist/components/Tag/Tag.variants.js +1 -0
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +49 -98
- package/dist/components/index.js +84 -82
- package/dist/index.d.ts +33 -1
- package/dist/index.js +92 -90
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import l, { forwardRef as c } from "react";
|
|
2
|
+
import { P as a } from "./index--V_ZsiQe.js";
|
|
3
|
+
function p() {
|
|
4
|
+
return p = Object.assign || function(e) {
|
|
5
|
+
for (var o = 1; o < arguments.length; o++) {
|
|
6
|
+
var t = arguments[o];
|
|
7
|
+
for (var r in t)
|
|
8
|
+
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
|
|
9
|
+
}
|
|
10
|
+
return e;
|
|
11
|
+
}, p.apply(this, arguments);
|
|
12
|
+
}
|
|
13
|
+
function u(e, o) {
|
|
14
|
+
if (e == null) return {};
|
|
15
|
+
var t = v(e, o), r, n;
|
|
16
|
+
if (Object.getOwnPropertySymbols) {
|
|
17
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
18
|
+
for (n = 0; n < i.length; n++)
|
|
19
|
+
r = i[n], !(o.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (t[r] = e[r]);
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
}
|
|
23
|
+
function v(e, o) {
|
|
24
|
+
if (e == null) return {};
|
|
25
|
+
var t = {}, r = Object.keys(e), n, i;
|
|
26
|
+
for (i = 0; i < r.length; i++)
|
|
27
|
+
n = r[i], !(o.indexOf(n) >= 0) && (t[n] = e[n]);
|
|
28
|
+
return t;
|
|
29
|
+
}
|
|
30
|
+
var s = c(function(e, o) {
|
|
31
|
+
var t = e.color, r = t === void 0 ? "currentColor" : t, n = e.size, i = n === void 0 ? 24 : n, f = u(e, ["color", "size"]);
|
|
32
|
+
return /* @__PURE__ */ l.createElement("svg", p({
|
|
33
|
+
ref: o,
|
|
34
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
35
|
+
width: i,
|
|
36
|
+
height: i,
|
|
37
|
+
viewBox: "0 0 24 24",
|
|
38
|
+
fill: "none",
|
|
39
|
+
stroke: r,
|
|
40
|
+
strokeWidth: "2",
|
|
41
|
+
strokeLinecap: "round",
|
|
42
|
+
strokeLinejoin: "round"
|
|
43
|
+
}, f), /* @__PURE__ */ l.createElement("polyline", {
|
|
44
|
+
points: "18 15 12 9 6 15"
|
|
45
|
+
}));
|
|
46
|
+
});
|
|
47
|
+
s.propTypes = {
|
|
48
|
+
color: a.string,
|
|
49
|
+
size: a.oneOfType([a.string, a.number])
|
|
50
|
+
};
|
|
51
|
+
s.displayName = "ChevronUp";
|
|
52
|
+
export {
|
|
53
|
+
s as C
|
|
54
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as l } from "react";
|
|
3
|
+
import { MultiSelectDropdownProvider as c } from "./contexts/MultiSelectDropdown.provider.js";
|
|
4
|
+
import { Wrapper as n } from "./components/Wrapper/Wrapper.js";
|
|
5
|
+
const x = l(
|
|
6
|
+
({ options: t, multiselect: p, value: e, onChange: i, onBlur: f, name: r, ...m }, d) => /* @__PURE__ */ o(
|
|
7
|
+
c,
|
|
8
|
+
{
|
|
9
|
+
defaultOptions: t,
|
|
10
|
+
multiselect: p,
|
|
11
|
+
value: e,
|
|
12
|
+
onChange: i,
|
|
13
|
+
onBlur: f,
|
|
14
|
+
name: r,
|
|
15
|
+
children: /* @__PURE__ */ o(n, { ref: d, ...m, name: r })
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
export {
|
|
20
|
+
x as MultiSelectDropdown
|
|
21
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { c as t } from "../../index-D29mdTf5.js";
|
|
2
|
+
const r = t([
|
|
3
|
+
"flex",
|
|
4
|
+
"flex-col",
|
|
5
|
+
"w-full",
|
|
6
|
+
"relative",
|
|
7
|
+
"text-slate-500",
|
|
8
|
+
"mb-1",
|
|
9
|
+
"cursor-pointer",
|
|
10
|
+
"text-sm",
|
|
11
|
+
"leading-5",
|
|
12
|
+
"tracking-[0.1px]",
|
|
13
|
+
"dark:text-slate-50"
|
|
14
|
+
]), a = t(["cursor-pointer", "mb-1"]), o = t([
|
|
15
|
+
"h-9",
|
|
16
|
+
"border",
|
|
17
|
+
"cursor-pointer",
|
|
18
|
+
"duration-250",
|
|
19
|
+
"ease-in-out",
|
|
20
|
+
"flex",
|
|
21
|
+
"items-center",
|
|
22
|
+
"justify-between",
|
|
23
|
+
"px-2",
|
|
24
|
+
"py-1",
|
|
25
|
+
"rounded-md",
|
|
26
|
+
"transition-all",
|
|
27
|
+
"w-full",
|
|
28
|
+
"border-gray-200"
|
|
29
|
+
]);
|
|
30
|
+
export {
|
|
31
|
+
a as labelVariants,
|
|
32
|
+
o as multiSelectDropdownVariants,
|
|
33
|
+
r as wrapperVariants
|
|
34
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { cn as m } from "../../../../utils/index.js";
|
|
3
|
+
import { wrapperVariants as i } from "./Item.variants.js";
|
|
4
|
+
import { useMultiSelectDropdown as s } from "../../contexts/MultiSelectDropdown.hook.js";
|
|
5
|
+
import { Typography as c } from "../../../Typography/Typography.js";
|
|
6
|
+
import { Tag as p } from "../../../Tag/Tag.js";
|
|
7
|
+
const x = ({ option: r, theme: a, isSelected: o }) => {
|
|
8
|
+
const { onSelectOption: e } = s();
|
|
9
|
+
return /* @__PURE__ */ l(
|
|
10
|
+
"li",
|
|
11
|
+
{
|
|
12
|
+
role: "option",
|
|
13
|
+
"data-theme": a,
|
|
14
|
+
className: m(i({ isSelected: o })),
|
|
15
|
+
onClick: () => e(r),
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ t(c, { variant: "body2", className: "text-slate-800", children: r.label }),
|
|
18
|
+
/* @__PURE__ */ t(
|
|
19
|
+
p,
|
|
20
|
+
{
|
|
21
|
+
id: r.id,
|
|
22
|
+
label: r.tagLabel,
|
|
23
|
+
color: r.tagColor,
|
|
24
|
+
isSelected: o
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
x as Item
|
|
33
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { c as e } from "../../../../index-D29mdTf5.js";
|
|
2
|
+
const r = e(
|
|
3
|
+
[
|
|
4
|
+
"cursor-pointer",
|
|
5
|
+
"py-1.5",
|
|
6
|
+
"px-2",
|
|
7
|
+
"last:pb-2",
|
|
8
|
+
"first:pt-2",
|
|
9
|
+
"h-full",
|
|
10
|
+
"hover:bg-gray-50",
|
|
11
|
+
"focus:bg-gray-50",
|
|
12
|
+
"dark:hover:bg-slate-700",
|
|
13
|
+
"dark:focus:bg-slate-700",
|
|
14
|
+
"flex",
|
|
15
|
+
"items-center",
|
|
16
|
+
"gap-4"
|
|
17
|
+
],
|
|
18
|
+
{
|
|
19
|
+
variants: {
|
|
20
|
+
isSelected: {
|
|
21
|
+
true: "",
|
|
22
|
+
false: ""
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
compoundVariants: [
|
|
26
|
+
{
|
|
27
|
+
isSelected: !0,
|
|
28
|
+
class: ["bg-slate-50"]
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
isSelected: !1
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
export {
|
|
37
|
+
r as wrapperVariants
|
|
38
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cn as s } from "../../../../utils/index.js";
|
|
3
|
+
import { Item as a } from "../Item/Item.js";
|
|
4
|
+
import { wrapperVariants as p } from "./List.variants.js";
|
|
5
|
+
import { useMultiSelectDropdown as l } from "../../contexts/MultiSelectDropdown.hook.js";
|
|
6
|
+
import { Typography as c } from "../../../Typography/Typography.js";
|
|
7
|
+
const y = ({ theme: o }) => {
|
|
8
|
+
const { options: r, selectedOptions: i } = l();
|
|
9
|
+
return /* @__PURE__ */ e("ul", { role: "listbox", "data-theme": o, className: s(p()), children: r.length > 0 ? r.map((t) => /* @__PURE__ */ e(
|
|
10
|
+
a,
|
|
11
|
+
{
|
|
12
|
+
option: t,
|
|
13
|
+
isSelected: i.some(
|
|
14
|
+
(m) => m.id === t.id
|
|
15
|
+
)
|
|
16
|
+
},
|
|
17
|
+
t.id
|
|
18
|
+
)) : /* @__PURE__ */ e(
|
|
19
|
+
c,
|
|
20
|
+
{
|
|
21
|
+
variant: "body2",
|
|
22
|
+
className: "text-zinc-800 dark:text-slate-50 italic px-2 py-2",
|
|
23
|
+
children: "No options"
|
|
24
|
+
}
|
|
25
|
+
) });
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
y as List
|
|
29
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { c as o } from "../../../../index-D29mdTf5.js";
|
|
2
|
+
const a = o([
|
|
3
|
+
"absolute",
|
|
4
|
+
"bg-white",
|
|
5
|
+
"border",
|
|
6
|
+
"duration-100",
|
|
7
|
+
"flex",
|
|
8
|
+
"flex-col",
|
|
9
|
+
"mt-0.5",
|
|
10
|
+
"rounded",
|
|
11
|
+
"shadow-xs",
|
|
12
|
+
"top-full",
|
|
13
|
+
"transition-all",
|
|
14
|
+
"w-full",
|
|
15
|
+
"z-10",
|
|
16
|
+
"animate-in",
|
|
17
|
+
"fade-in-50",
|
|
18
|
+
"overflow-hidden",
|
|
19
|
+
"border-gray-200"
|
|
20
|
+
]);
|
|
21
|
+
export {
|
|
22
|
+
a as wrapperVariants
|
|
23
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import "../Item/Item.js";
|
|
2
|
+
import { List as v } from "../List/List.js";
|
|
3
|
+
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
4
|
+
import * as c from "react";
|
|
5
|
+
import { forwardRef as N, useId as b, useImperativeHandle as C } from "react";
|
|
6
|
+
import { Tag as O } from "../../../Tag/Tag.js";
|
|
7
|
+
import { cn as a } from "../../../../utils/index.js";
|
|
8
|
+
import { useMultiSelectDropdown as R } from "../../hooks/useMultiSelectDropdown.js";
|
|
9
|
+
import { labelVariants as S, multiSelectDropdownVariants as k, wrapperVariants as D } from "../../MultiSelectDropdown.variants.js";
|
|
10
|
+
import { C as M } from "../../../../chevron-up-CRyLc5Ml.js";
|
|
11
|
+
import { useMultiSelectDropdown as y } from "../../contexts/MultiSelectDropdown.hook.js";
|
|
12
|
+
const I = (r) => /* @__PURE__ */ c.createElement("svg", { width: 9, height: 9, viewBox: "0 0 9 9", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...r }, /* @__PURE__ */ c.createElement("path", { d: "M8.16667 0.8225L7.34417 0L4.08333 3.26083L0.8225 0L0 0.8225L3.26083 4.08333L0 7.34417L0.8225 8.16667L4.08333 4.90583L7.34417 8.16667L8.16667 7.34417L4.90583 4.08333L8.16667 0.8225Z", fill: "#364153" })), Z = N(
|
|
13
|
+
({ label: r, labelClassName: p, name: l, placeholder: d = "", theme: h, wrapperClassName: f }, u) => {
|
|
14
|
+
const i = b(), { selectedOptions: n, isOpen: o, onOpen: w, onRemoveOption: L, inputRef: s } = y(), { wrapperRef: g, handleOpen: x } = R();
|
|
15
|
+
return C(u, () => s.current, [s]), /* @__PURE__ */ m(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
ref: g,
|
|
19
|
+
className: a(
|
|
20
|
+
D({
|
|
21
|
+
className: f
|
|
22
|
+
})
|
|
23
|
+
),
|
|
24
|
+
"data-theme": h,
|
|
25
|
+
children: [
|
|
26
|
+
r ? /* @__PURE__ */ e(
|
|
27
|
+
"label",
|
|
28
|
+
{
|
|
29
|
+
htmlFor: l ?? i,
|
|
30
|
+
className: a(
|
|
31
|
+
S({
|
|
32
|
+
className: p
|
|
33
|
+
})
|
|
34
|
+
),
|
|
35
|
+
onClick: () => w(!0),
|
|
36
|
+
children: r
|
|
37
|
+
}
|
|
38
|
+
) : null,
|
|
39
|
+
/* @__PURE__ */ m(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
id: l ?? i,
|
|
43
|
+
className: a(k()),
|
|
44
|
+
role: "combobox",
|
|
45
|
+
onClick: x,
|
|
46
|
+
"aria-expanded": o,
|
|
47
|
+
children: [
|
|
48
|
+
n.length === 0 ? /* @__PURE__ */ e("span", { className: "text-base text-inherit select-none", children: d }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: n.map((t) => /* @__PURE__ */ e(
|
|
49
|
+
O,
|
|
50
|
+
{
|
|
51
|
+
id: t.id,
|
|
52
|
+
label: t.tagLabel,
|
|
53
|
+
color: t.tagColor || "gray-800",
|
|
54
|
+
className: "select-none gap-2",
|
|
55
|
+
rightIcon: /* @__PURE__ */ e(
|
|
56
|
+
I,
|
|
57
|
+
{
|
|
58
|
+
className: "w-2 h-2",
|
|
59
|
+
onClick: () => L(t)
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
"data-value": t.label
|
|
63
|
+
},
|
|
64
|
+
t.id
|
|
65
|
+
)) }),
|
|
66
|
+
/* @__PURE__ */ e(
|
|
67
|
+
M,
|
|
68
|
+
{
|
|
69
|
+
className: a(
|
|
70
|
+
"w-4 h-4 text-inherit transition-all duration-50 shrink-0",
|
|
71
|
+
o ? "rotate-0" : "rotate-180"
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ e(
|
|
79
|
+
"input",
|
|
80
|
+
{
|
|
81
|
+
ref: s,
|
|
82
|
+
type: "text",
|
|
83
|
+
name: l,
|
|
84
|
+
className: "hidden",
|
|
85
|
+
readOnly: !0
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
o ? /* @__PURE__ */ e(v, {}) : null
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
export {
|
|
95
|
+
Z as Wrapper
|
|
96
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createContext as t } from "react";
|
|
2
|
+
const n = {
|
|
3
|
+
options: [],
|
|
4
|
+
selectedOptions: [],
|
|
5
|
+
isOpen: !1,
|
|
6
|
+
inputRef: null,
|
|
7
|
+
onSelectOption() {
|
|
8
|
+
throw new Error("Function not implemented.");
|
|
9
|
+
},
|
|
10
|
+
onRemoveOption() {
|
|
11
|
+
throw new Error("Function not implemented.");
|
|
12
|
+
},
|
|
13
|
+
onOpen() {
|
|
14
|
+
throw new Error("Function not implemented.");
|
|
15
|
+
}
|
|
16
|
+
}, o = t(n);
|
|
17
|
+
export {
|
|
18
|
+
o as MultiSelectDropdownContext
|
|
19
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useContext as o } from "react";
|
|
2
|
+
import { MultiSelectDropdownContext as e } from "./MultiSelectDropdown.context.js";
|
|
3
|
+
const i = () => {
|
|
4
|
+
const t = o(e);
|
|
5
|
+
if (!t)
|
|
6
|
+
throw new Error(
|
|
7
|
+
"useMultiSelectDropdown must be used within a MultiSelectDropdownProvider"
|
|
8
|
+
);
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
i as useMultiSelectDropdown
|
|
13
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { jsx as P } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as V, useState as R, useEffect as b, useCallback as p } from "react";
|
|
3
|
+
import { MultiSelectDropdownContext as k } from "./MultiSelectDropdown.context.js";
|
|
4
|
+
import { useToggle as y } from "../../../hooks/useToggle.js";
|
|
5
|
+
const T = ({
|
|
6
|
+
children: x,
|
|
7
|
+
defaultOptions: o = [],
|
|
8
|
+
multiselect: c = !0,
|
|
9
|
+
value: a,
|
|
10
|
+
onChange: f,
|
|
11
|
+
onBlur: S,
|
|
12
|
+
name: I
|
|
13
|
+
}) => {
|
|
14
|
+
const m = V(null), [u, h] = y(!1), [g, O] = R(o), [i, v] = R([]), r = a !== void 0;
|
|
15
|
+
b(() => {
|
|
16
|
+
if (r) {
|
|
17
|
+
const t = a || [];
|
|
18
|
+
v(t);
|
|
19
|
+
const n = new Set(t.map((s) => s.id));
|
|
20
|
+
O(
|
|
21
|
+
c ? o.filter((s) => !n.has(s.id)) : o.map((s) => ({
|
|
22
|
+
...s,
|
|
23
|
+
isSelected: n.has(s.id)
|
|
24
|
+
}))
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
}, [a, r, o, c]);
|
|
28
|
+
const d = p(
|
|
29
|
+
(t) => {
|
|
30
|
+
const n = t.map(({ id: e, value: w, label: M }) => ({
|
|
31
|
+
id: e,
|
|
32
|
+
value: w ?? M
|
|
33
|
+
})), s = JSON.stringify(n);
|
|
34
|
+
m.current && (m.current.value = s), f && f({
|
|
35
|
+
target: {
|
|
36
|
+
value: t,
|
|
37
|
+
name: I ?? ""
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
[f, I]
|
|
42
|
+
), l = p(
|
|
43
|
+
(t) => {
|
|
44
|
+
const n = u;
|
|
45
|
+
h(t), n && t === !1 && S && S();
|
|
46
|
+
},
|
|
47
|
+
[u, h, S]
|
|
48
|
+
), j = p(
|
|
49
|
+
(t) => {
|
|
50
|
+
if (r) {
|
|
51
|
+
const e = [
|
|
52
|
+
...c ? i : [],
|
|
53
|
+
t
|
|
54
|
+
];
|
|
55
|
+
d(e), l(!1);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const n = [
|
|
59
|
+
...c ? i : [],
|
|
60
|
+
t
|
|
61
|
+
];
|
|
62
|
+
v(n);
|
|
63
|
+
const s = n.map((e) => e.id);
|
|
64
|
+
O(() => c ? o.filter(
|
|
65
|
+
(e) => !s.includes(e.id)
|
|
66
|
+
) : o.map((e) => ({
|
|
67
|
+
...e,
|
|
68
|
+
isSelected: s.includes(e.id)
|
|
69
|
+
}))), d(n), l(!1);
|
|
70
|
+
},
|
|
71
|
+
[
|
|
72
|
+
o,
|
|
73
|
+
d,
|
|
74
|
+
c,
|
|
75
|
+
i,
|
|
76
|
+
l,
|
|
77
|
+
r
|
|
78
|
+
]
|
|
79
|
+
), D = p(
|
|
80
|
+
(t) => {
|
|
81
|
+
if (r) {
|
|
82
|
+
const e = i.filter(
|
|
83
|
+
(w) => w.id !== t.id
|
|
84
|
+
);
|
|
85
|
+
d(e);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const n = i.filter(
|
|
89
|
+
(e) => e.id !== t.id
|
|
90
|
+
);
|
|
91
|
+
v(n);
|
|
92
|
+
const s = n.map((e) => e.id);
|
|
93
|
+
O(
|
|
94
|
+
() => o.filter(
|
|
95
|
+
(e) => !s.includes(e.id)
|
|
96
|
+
)
|
|
97
|
+
), d(n);
|
|
98
|
+
},
|
|
99
|
+
[o, d, i, r]
|
|
100
|
+
);
|
|
101
|
+
return /* @__PURE__ */ P(
|
|
102
|
+
k.Provider,
|
|
103
|
+
{
|
|
104
|
+
value: {
|
|
105
|
+
options: g,
|
|
106
|
+
selectedOptions: i,
|
|
107
|
+
isOpen: u,
|
|
108
|
+
inputRef: m,
|
|
109
|
+
onSelectOption: j,
|
|
110
|
+
onRemoveOption: D,
|
|
111
|
+
onOpen: l
|
|
112
|
+
},
|
|
113
|
+
children: x
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
export {
|
|
118
|
+
T as MultiSelectDropdownProvider
|
|
119
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useRef as l, useEffect as c, useCallback as u } from "react";
|
|
2
|
+
import { useMultiSelectDropdown as i } from "../contexts/MultiSelectDropdown.hook.js";
|
|
3
|
+
const f = () => {
|
|
4
|
+
const n = l(null), { onOpen: e } = i();
|
|
5
|
+
c(() => {
|
|
6
|
+
const t = new AbortController(), a = (o) => {
|
|
7
|
+
o.key === "Escape" && e(!1);
|
|
8
|
+
}, r = (o) => {
|
|
9
|
+
n.current?.contains(o.target) || e(!1);
|
|
10
|
+
};
|
|
11
|
+
return document.addEventListener("keydown", a, {
|
|
12
|
+
signal: t.signal
|
|
13
|
+
}), document.addEventListener("mousedown", r, {
|
|
14
|
+
signal: t.signal
|
|
15
|
+
}), () => {
|
|
16
|
+
t.abort();
|
|
17
|
+
};
|
|
18
|
+
}, [e, n]);
|
|
19
|
+
const s = u(
|
|
20
|
+
(t) => {
|
|
21
|
+
t.target?.closest("[data-value]") || e(!0);
|
|
22
|
+
},
|
|
23
|
+
[e]
|
|
24
|
+
);
|
|
25
|
+
return {
|
|
26
|
+
wrapperRef: n,
|
|
27
|
+
handleOpen: s
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
f as useMultiSelectDropdown
|
|
32
|
+
};
|
|
@@ -15,6 +15,7 @@ const f = e(
|
|
|
15
15
|
variants: {
|
|
16
16
|
color: {
|
|
17
17
|
gray: ["bg-[#f4f4f5]", "text-[#71717a]"],
|
|
18
|
+
"gray-800": ["bg-gray-100", "text-gray-800"],
|
|
18
19
|
cyan: ["bg-[#ecfeff]", "text-[#0e7490]"],
|
|
19
20
|
gold: ["bg-[#fef9c3]", "text-[#a16207]"],
|
|
20
21
|
green: ["bg-[#dcfce7]", "text-[#15803d]"],
|
|
@@ -1,135 +1,86 @@
|
|
|
1
1
|
import "../Item/Item.js";
|
|
2
|
-
import { List as
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import
|
|
5
|
-
import { Tag as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { useTagSelect as
|
|
8
|
-
import { labelVariants as
|
|
9
|
-
import { X as
|
|
10
|
-
import {
|
|
11
|
-
import { useTagSelect as
|
|
12
|
-
|
|
13
|
-
return u = Object.assign || function(e) {
|
|
14
|
-
for (var o = 1; o < arguments.length; o++) {
|
|
15
|
-
var t = arguments[o];
|
|
16
|
-
for (var r in t)
|
|
17
|
-
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
|
|
18
|
-
}
|
|
19
|
-
return e;
|
|
20
|
-
}, u.apply(this, arguments);
|
|
21
|
-
}
|
|
22
|
-
function L(e, o) {
|
|
23
|
-
if (e == null) return {};
|
|
24
|
-
var t = W(e, o), r, n;
|
|
25
|
-
if (Object.getOwnPropertySymbols) {
|
|
26
|
-
var a = Object.getOwnPropertySymbols(e);
|
|
27
|
-
for (n = 0; n < a.length; n++)
|
|
28
|
-
r = a[n], !(o.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (t[r] = e[r]);
|
|
29
|
-
}
|
|
30
|
-
return t;
|
|
31
|
-
}
|
|
32
|
-
function W(e, o) {
|
|
33
|
-
if (e == null) return {};
|
|
34
|
-
var t = {}, r = Object.keys(e), n, a;
|
|
35
|
-
for (a = 0; a < r.length; a++)
|
|
36
|
-
n = r[a], !(o.indexOf(n) >= 0) && (t[n] = e[n]);
|
|
37
|
-
return t;
|
|
38
|
-
}
|
|
39
|
-
var d = w(function(e, o) {
|
|
40
|
-
var t = e.color, r = t === void 0 ? "currentColor" : t, n = e.size, a = n === void 0 ? 24 : n, c = L(e, ["color", "size"]);
|
|
41
|
-
return /* @__PURE__ */ b.createElement("svg", u({
|
|
42
|
-
ref: o,
|
|
43
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
44
|
-
width: a,
|
|
45
|
-
height: a,
|
|
46
|
-
viewBox: "0 0 24 24",
|
|
47
|
-
fill: "none",
|
|
48
|
-
stroke: r,
|
|
49
|
-
strokeWidth: "2",
|
|
50
|
-
strokeLinecap: "round",
|
|
51
|
-
strokeLinejoin: "round"
|
|
52
|
-
}, c), /* @__PURE__ */ b.createElement("polyline", {
|
|
53
|
-
points: "18 15 12 9 6 15"
|
|
54
|
-
}));
|
|
55
|
-
});
|
|
56
|
-
d.propTypes = {
|
|
57
|
-
color: p.string,
|
|
58
|
-
size: p.oneOfType([p.string, p.number])
|
|
59
|
-
};
|
|
60
|
-
d.displayName = "ChevronUp";
|
|
61
|
-
const G = w(
|
|
2
|
+
import { List as g } from "../List/List.js";
|
|
3
|
+
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
4
|
+
import { forwardRef as w, useId as T, useImperativeHandle as b } from "react";
|
|
5
|
+
import { Tag as C } from "../../../Tag/Tag.js";
|
|
6
|
+
import { cn as r } from "../../../../utils/index.js";
|
|
7
|
+
import { useTagSelect as S } from "../../hooks/useTagSelect.js";
|
|
8
|
+
import { labelVariants as k, tagSelectVariants as R, wrapperVariants as I } from "../../TagSelect.variants.js";
|
|
9
|
+
import { X as O } from "../../../../x-DPU9OdYH.js";
|
|
10
|
+
import { C as V } from "../../../../chevron-up-CRyLc5Ml.js";
|
|
11
|
+
import { useTagSelect as j } from "../../contexts/TagSelect.hook.js";
|
|
12
|
+
const B = w(
|
|
62
13
|
({
|
|
63
|
-
label:
|
|
64
|
-
labelClassName:
|
|
14
|
+
label: o,
|
|
15
|
+
labelClassName: c,
|
|
65
16
|
name: t,
|
|
66
|
-
placeholder:
|
|
67
|
-
theme:
|
|
68
|
-
wrapperClassName:
|
|
69
|
-
},
|
|
70
|
-
const
|
|
71
|
-
return
|
|
17
|
+
placeholder: p = "Select a value...",
|
|
18
|
+
theme: d,
|
|
19
|
+
wrapperClassName: f
|
|
20
|
+
}, h) => {
|
|
21
|
+
const i = T(), { selectedTags: n, isOpen: s, onOpen: u, onRemoveTag: x, inputRef: l } = j(), { wrapperRef: N, handleOpen: v } = S();
|
|
22
|
+
return b(h, () => l.current, [l]), /* @__PURE__ */ m(
|
|
72
23
|
"div",
|
|
73
24
|
{
|
|
74
|
-
ref:
|
|
75
|
-
className:
|
|
76
|
-
|
|
77
|
-
className:
|
|
25
|
+
ref: N,
|
|
26
|
+
className: r(
|
|
27
|
+
I({
|
|
28
|
+
className: f
|
|
78
29
|
})
|
|
79
30
|
),
|
|
80
|
-
"data-theme":
|
|
31
|
+
"data-theme": d,
|
|
81
32
|
children: [
|
|
82
|
-
|
|
33
|
+
o ? /* @__PURE__ */ e(
|
|
83
34
|
"label",
|
|
84
35
|
{
|
|
85
|
-
htmlFor: t ??
|
|
86
|
-
className:
|
|
87
|
-
|
|
88
|
-
className:
|
|
36
|
+
htmlFor: t ?? i,
|
|
37
|
+
className: r(
|
|
38
|
+
k({
|
|
39
|
+
className: c
|
|
89
40
|
})
|
|
90
41
|
),
|
|
91
|
-
onClick: () =>
|
|
92
|
-
children:
|
|
42
|
+
onClick: () => u(!0),
|
|
43
|
+
children: o
|
|
93
44
|
}
|
|
94
45
|
) : null,
|
|
95
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ m(
|
|
96
47
|
"div",
|
|
97
48
|
{
|
|
98
|
-
id: t ??
|
|
99
|
-
className:
|
|
49
|
+
id: t ?? i,
|
|
50
|
+
className: r(R()),
|
|
100
51
|
role: "combobox",
|
|
101
|
-
onClick:
|
|
102
|
-
"aria-expanded":
|
|
52
|
+
onClick: v,
|
|
53
|
+
"aria-expanded": s,
|
|
103
54
|
children: [
|
|
104
|
-
|
|
105
|
-
|
|
55
|
+
n.length === 0 ? /* @__PURE__ */ e("span", { className: "text-base text-inherit select-none", children: p }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: n.map((a) => /* @__PURE__ */ e(
|
|
56
|
+
C,
|
|
106
57
|
{
|
|
107
|
-
...
|
|
58
|
+
...a,
|
|
108
59
|
className: "select-none",
|
|
109
|
-
rightIcon: /* @__PURE__ */
|
|
110
|
-
"data-value":
|
|
60
|
+
rightIcon: /* @__PURE__ */ e(O, { className: "w-3 h-3", onClick: () => x(a) }),
|
|
61
|
+
"data-value": a.label
|
|
111
62
|
},
|
|
112
|
-
|
|
63
|
+
a.id
|
|
113
64
|
)) }),
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
|
|
65
|
+
/* @__PURE__ */ e(
|
|
66
|
+
V,
|
|
116
67
|
{
|
|
117
|
-
className:
|
|
68
|
+
className: r(
|
|
118
69
|
"w-4 h-4 text-inherit transition-all duration-50 shrink-0",
|
|
119
|
-
|
|
70
|
+
s ? "rotate-0" : "rotate-180"
|
|
120
71
|
)
|
|
121
72
|
}
|
|
122
73
|
)
|
|
123
74
|
]
|
|
124
75
|
}
|
|
125
76
|
),
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
|
|
77
|
+
/* @__PURE__ */ e("input", { ref: l, type: "text", name: t, className: "hidden" }),
|
|
78
|
+
s ? /* @__PURE__ */ e(g, {}) : null
|
|
128
79
|
]
|
|
129
80
|
}
|
|
130
81
|
);
|
|
131
82
|
}
|
|
132
83
|
);
|
|
133
84
|
export {
|
|
134
|
-
|
|
85
|
+
B as Wrapper
|
|
135
86
|
};
|
package/dist/components/index.js
CHANGED
|
@@ -3,100 +3,102 @@ import { AlertDialog as p } from "./AlertDialog/AlertDialog.js";
|
|
|
3
3
|
import { Autocomplete as x } from "./Autocomplete/Autocomplete.js";
|
|
4
4
|
import { Badge as a } from "./Badge/Badge.js";
|
|
5
5
|
import { Breadcrumb as d } from "./Breadcrumb/Breadcrumb.js";
|
|
6
|
-
import { Button as
|
|
6
|
+
import { Button as l } from "./Button/Button.js";
|
|
7
7
|
import { Card as u } from "./Card/Card.js";
|
|
8
8
|
import { Checkbox as c } from "./Checkbox/Checkbox.js";
|
|
9
9
|
import { DatePicker as D } from "./Datepicker/DatePicker.js";
|
|
10
|
-
import { Divider as
|
|
11
|
-
import { Dropdown as
|
|
10
|
+
import { Divider as s } from "./Divider/Divider.js";
|
|
11
|
+
import { Dropdown as C } from "./Dropdown/Dropdown.js";
|
|
12
12
|
import { DropdownButton as h } from "./DropdownButton/DropdownButton.js";
|
|
13
|
-
import { Filter as
|
|
14
|
-
import { Input as
|
|
15
|
-
import { Loading as
|
|
16
|
-
import { M as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
13
|
+
import { Filter as w } from "./Filter/Filter.js";
|
|
14
|
+
import { Input as R } from "./Input/Input.js";
|
|
15
|
+
import { Loading as M } from "./Loading/Loading.js";
|
|
16
|
+
import { M as F } from "../Modal-CtAG97Ts.js";
|
|
17
|
+
import { MultiSelectDropdown as I } from "./MultiSelectDropdown/MultiSelectDropdown.js";
|
|
18
|
+
import { NumberInput as y } from "./NumberInput/NumberInput.js";
|
|
19
|
+
import { PhoneNumberInput as O } from "./PhoneNumberInput/PhoneNumberInput.js";
|
|
20
|
+
import { PieChart as j } from "./PieChart/PieChart.js";
|
|
21
|
+
import { ProgressBar as E } from "./ProgressBar/ProgressBar.js";
|
|
22
|
+
import { Radio as J } from "./Radio/Radio.js";
|
|
23
|
+
import { RadioCard as Q } from "./RadioCard/RadioCard.js";
|
|
24
|
+
import { RadioCardGroup as W } from "./RadioCardGroup/RadioCardGroup.js";
|
|
25
|
+
import { RadioGroup as Y } from "./RadioGroup/RadioGroup.js";
|
|
26
|
+
import { Range as _ } from "./Range/Range.js";
|
|
27
|
+
import { Sidebar as oo } from "./Sidebar/Sidebar.js";
|
|
28
|
+
import { Slider as eo } from "./Slider/Slider.js";
|
|
29
|
+
import { Switch as po } from "./Switch/Switch.js";
|
|
30
|
+
import { Table as xo } from "./Table/Table.js";
|
|
31
|
+
import { Tabs as ao } from "./Tabs/Tabs.js";
|
|
32
|
+
import { Tag as no } from "./Tag/Tag.js";
|
|
33
|
+
import { TagSelect as go } from "./TagSelect/TagSelect.js";
|
|
34
|
+
import { TextArea as To } from "./TextArea/TextArea.js";
|
|
35
|
+
import { TimePicker as bo } from "./TimePicker/TimePicker.js";
|
|
36
|
+
import { Toast as So } from "./Toast/Toast.js";
|
|
37
|
+
import { Tooltip as Bo } from "./Tooltip/Tooltip.js";
|
|
38
|
+
import { Typography as No } from "./Typography/Typography.js";
|
|
39
|
+
import { VirtualizedTable as vo } from "./VirtualizedTable/VirtualizedTable.js";
|
|
40
|
+
import { BadgeMultiSelect as Po } from "./Filter/components/BadgeDropdown/BadgeMultiSelect.js";
|
|
41
|
+
import { DateFilterDropdown as Ao } from "./Filter/components/DateFilterDropdown/DateFilterDropdown.js";
|
|
42
|
+
import { Footer as ko } from "./Sidebar/components/Footer/Footer.js";
|
|
43
|
+
import { Logo as Go } from "./Sidebar/components/Logo/Logo.js";
|
|
44
|
+
import { Navigation as Lo } from "./Sidebar/components/Navigation/Navigation.js";
|
|
45
|
+
import { NavigationGroup as zo } from "./Sidebar/components/NavigationGroup/NavigationGroup.js";
|
|
46
|
+
import { NavigationOption as Vo } from "./Sidebar/components/NavigationOption/NavigationOption.js";
|
|
47
|
+
import { NavigationSeparator as qo } from "./Sidebar/components/NavigationSeparator/NavigationSeparator.js";
|
|
48
|
+
import { Content as Ho } from "./Tabs/components/Content.js";
|
|
49
|
+
import { List as Ko } from "./Tabs/components/List.js";
|
|
50
|
+
import { Trigger as Uo } from "./Tabs/components/Trigger.js";
|
|
51
|
+
import { TruncateText as Xo } from "./VirtualizedTable/components/TruncateText/TruncateText.js";
|
|
51
52
|
export {
|
|
52
53
|
e as Alert,
|
|
53
54
|
p as AlertDialog,
|
|
54
55
|
x as Autocomplete,
|
|
55
56
|
a as Badge,
|
|
56
|
-
|
|
57
|
+
Po as BadgeMultiSelect,
|
|
57
58
|
d as Breadcrumb,
|
|
58
|
-
|
|
59
|
+
l as Button,
|
|
59
60
|
u as Card,
|
|
60
61
|
c as Checkbox,
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
Ho as Content,
|
|
63
|
+
Ao as DateFilterDropdown,
|
|
63
64
|
D as DatePicker,
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
s as Divider,
|
|
66
|
+
C as Dropdown,
|
|
66
67
|
h as DropdownButton,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
zo as
|
|
77
|
-
Vo as
|
|
78
|
-
|
|
79
|
-
y as
|
|
80
|
-
O as
|
|
81
|
-
j as
|
|
82
|
-
E as
|
|
83
|
-
J as
|
|
84
|
-
Q as
|
|
85
|
-
W as
|
|
86
|
-
Y as
|
|
87
|
-
_ as
|
|
88
|
-
oo as
|
|
89
|
-
eo as
|
|
90
|
-
po as
|
|
91
|
-
xo as
|
|
92
|
-
ao as
|
|
93
|
-
no as
|
|
94
|
-
|
|
95
|
-
To as
|
|
96
|
-
bo as
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
Uo as
|
|
100
|
-
|
|
101
|
-
|
|
68
|
+
w as Filter,
|
|
69
|
+
ko as Footer,
|
|
70
|
+
R as Input,
|
|
71
|
+
Ko as List,
|
|
72
|
+
M as Loading,
|
|
73
|
+
Go as Logo,
|
|
74
|
+
F as Modal,
|
|
75
|
+
I as MultiSelectDropdown,
|
|
76
|
+
Lo as Navigation,
|
|
77
|
+
zo as NavigationGroup,
|
|
78
|
+
Vo as NavigationOption,
|
|
79
|
+
qo as NavigationSeparator,
|
|
80
|
+
y as NumberInput,
|
|
81
|
+
O as PhoneNumberInput,
|
|
82
|
+
j as PieChart,
|
|
83
|
+
E as ProgressBar,
|
|
84
|
+
J as Radio,
|
|
85
|
+
Q as RadioCard,
|
|
86
|
+
W as RadioCardGroup,
|
|
87
|
+
Y as RadioGroup,
|
|
88
|
+
_ as Range,
|
|
89
|
+
oo as Sidebar,
|
|
90
|
+
eo as Slider,
|
|
91
|
+
po as Switch,
|
|
92
|
+
xo as Table,
|
|
93
|
+
ao as Tabs,
|
|
94
|
+
no as Tag,
|
|
95
|
+
go as TagSelect,
|
|
96
|
+
To as TextArea,
|
|
97
|
+
bo as TimePicker,
|
|
98
|
+
So as Toast,
|
|
99
|
+
Bo as Tooltip,
|
|
100
|
+
Uo as Trigger,
|
|
101
|
+
Xo as TruncateText,
|
|
102
|
+
No as Typography,
|
|
103
|
+
vo as VirtualizedTable
|
|
102
104
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -373,6 +373,31 @@ declare interface ModalProps extends PropsWithChildren, VariantProps<typeof moda
|
|
|
373
373
|
|
|
374
374
|
declare const modalVariants: (props?: ClassProp | undefined) => string;
|
|
375
375
|
|
|
376
|
+
export declare const MultiSelectDropdown: FC<MultiSelectDropdownProps>;
|
|
377
|
+
|
|
378
|
+
declare type MultiSelectDropdownOption = {
|
|
379
|
+
id: string | number;
|
|
380
|
+
label: string;
|
|
381
|
+
tagLabel: string;
|
|
382
|
+
tagColor?: TagProps['color'];
|
|
383
|
+
value?: string;
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
declare interface MultiSelectDropdownProps extends VariantProps<typeof multiSelectDropdownVariants>, Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'onBlur'> {
|
|
387
|
+
label?: string;
|
|
388
|
+
options: MultiSelectDropdownOption[];
|
|
389
|
+
name?: string;
|
|
390
|
+
placeholder?: string;
|
|
391
|
+
labelClassName?: string;
|
|
392
|
+
wrapperClassName?: string;
|
|
393
|
+
multiselect?: boolean;
|
|
394
|
+
value?: MultiSelectDropdownOption[];
|
|
395
|
+
onChange?: OnChangeFn_2;
|
|
396
|
+
onBlur?: VoidFunction;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
declare const multiSelectDropdownVariants: (props?: ClassProp | undefined) => string;
|
|
400
|
+
|
|
376
401
|
declare type MultiSelectFilter = {
|
|
377
402
|
key: string;
|
|
378
403
|
label: string;
|
|
@@ -468,6 +493,13 @@ declare type OnChangeFn = (params: {
|
|
|
468
493
|
};
|
|
469
494
|
}) => void;
|
|
470
495
|
|
|
496
|
+
declare type OnChangeFn_2 = (params: {
|
|
497
|
+
target: {
|
|
498
|
+
value: MultiSelectDropdownOption[];
|
|
499
|
+
name: string;
|
|
500
|
+
};
|
|
501
|
+
}) => void;
|
|
502
|
+
|
|
471
503
|
declare type Option_2 = {
|
|
472
504
|
value: string;
|
|
473
505
|
};
|
|
@@ -862,7 +894,7 @@ declare interface TabsProps extends ReactTabs.TabsProps, PropsWithChildren {
|
|
|
862
894
|
export declare const Tag: FC<TagProps>;
|
|
863
895
|
|
|
864
896
|
declare type TagProps = {
|
|
865
|
-
color?: 'gray' | 'cyan' | 'gold' | 'green' | 'light blue' | 'lime' | 'pink' | 'purple' | 'emerald' | 'fuscia' | 'indigo' | 'light-orange' | 'dark-sky-blue' | 'mistery';
|
|
897
|
+
color?: 'gray' | 'gray-800' | 'cyan' | 'gold' | 'green' | 'light blue' | 'lime' | 'pink' | 'purple' | 'emerald' | 'fuscia' | 'indigo' | 'light-orange' | 'dark-sky-blue' | 'mistery';
|
|
866
898
|
id: string | number;
|
|
867
899
|
label: string;
|
|
868
900
|
rightIcon?: ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -4,109 +4,111 @@ import { AlertDialog as x } from "./components/AlertDialog/AlertDialog.js";
|
|
|
4
4
|
import { Autocomplete as a } from "./components/Autocomplete/Autocomplete.js";
|
|
5
5
|
import { Badge as n } from "./components/Badge/Badge.js";
|
|
6
6
|
import { Breadcrumb as g } from "./components/Breadcrumb/Breadcrumb.js";
|
|
7
|
-
import { Button as
|
|
7
|
+
import { Button as u } from "./components/Button/Button.js";
|
|
8
8
|
import { Card as c } from "./components/Card/Card.js";
|
|
9
9
|
import { Checkbox as h } from "./components/Checkbox/Checkbox.js";
|
|
10
|
-
import { DatePicker as
|
|
11
|
-
import { Divider as
|
|
12
|
-
import { Dropdown as
|
|
13
|
-
import { DropdownButton as
|
|
14
|
-
import { Filter as
|
|
15
|
-
import { BadgeMultiSelect as
|
|
16
|
-
import { DateFilterDropdown as
|
|
17
|
-
import { Input as
|
|
10
|
+
import { DatePicker as D } from "./components/Datepicker/DatePicker.js";
|
|
11
|
+
import { Divider as S } from "./components/Divider/Divider.js";
|
|
12
|
+
import { Dropdown as B } from "./components/Dropdown/Dropdown.js";
|
|
13
|
+
import { DropdownButton as P } from "./components/DropdownButton/DropdownButton.js";
|
|
14
|
+
import { Filter as R } from "./components/Filter/Filter.js";
|
|
15
|
+
import { BadgeMultiSelect as M } from "./components/Filter/components/BadgeDropdown/BadgeMultiSelect.js";
|
|
16
|
+
import { DateFilterDropdown as F } from "./components/Filter/components/DateFilterDropdown/DateFilterDropdown.js";
|
|
17
|
+
import { Input as I } from "./components/Input/Input.js";
|
|
18
18
|
import { Loading as y } from "./components/Loading/Loading.js";
|
|
19
19
|
import { M as O } from "./Modal-CtAG97Ts.js";
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
20
|
+
import { MultiSelectDropdown as j } from "./components/MultiSelectDropdown/MultiSelectDropdown.js";
|
|
21
|
+
import { NumberInput as E } from "./components/NumberInput/NumberInput.js";
|
|
22
|
+
import { PhoneNumberInput as J } from "./components/PhoneNumberInput/PhoneNumberInput.js";
|
|
23
|
+
import { PieChart as Q } from "./components/PieChart/PieChart.js";
|
|
24
|
+
import { ProgressBar as W } from "./components/ProgressBar/ProgressBar.js";
|
|
25
|
+
import { Radio as Y } from "./components/Radio/Radio.js";
|
|
26
|
+
import { RadioCard as _ } from "./components/RadioCard/RadioCard.js";
|
|
27
|
+
import { RadioCardGroup as oo } from "./components/RadioCardGroup/RadioCardGroup.js";
|
|
28
|
+
import { RadioGroup as eo } from "./components/RadioGroup/RadioGroup.js";
|
|
29
|
+
import { Range as po } from "./components/Range/Range.js";
|
|
30
|
+
import { Footer as xo } from "./components/Sidebar/components/Footer/Footer.js";
|
|
31
|
+
import { Logo as ao } from "./components/Sidebar/components/Logo/Logo.js";
|
|
32
|
+
import { Navigation as no } from "./components/Sidebar/components/Navigation/Navigation.js";
|
|
33
|
+
import { NavigationGroup as lo } from "./components/Sidebar/components/NavigationGroup/NavigationGroup.js";
|
|
34
|
+
import { NavigationOption as To } from "./components/Sidebar/components/NavigationOption/NavigationOption.js";
|
|
35
|
+
import { NavigationSeparator as bo } from "./components/Sidebar/components/NavigationSeparator/NavigationSeparator.js";
|
|
36
|
+
import { Sidebar as so } from "./components/Sidebar/Sidebar.js";
|
|
37
|
+
import { Slider as Co } from "./components/Slider/Slider.js";
|
|
38
|
+
import { Switch as vo } from "./components/Switch/Switch.js";
|
|
39
|
+
import { Table as No } from "./components/Table/Table.js";
|
|
40
|
+
import { Content as wo } from "./components/Tabs/components/Content.js";
|
|
41
|
+
import { List as Ao } from "./components/Tabs/components/List.js";
|
|
42
|
+
import { Tabs as ko } from "./components/Tabs/Tabs.js";
|
|
43
|
+
import { Trigger as Go } from "./components/Tabs/components/Trigger.js";
|
|
44
|
+
import { Tag as Lo } from "./components/Tag/Tag.js";
|
|
45
|
+
import { TagSelect as zo } from "./components/TagSelect/TagSelect.js";
|
|
46
|
+
import { TextArea as Vo } from "./components/TextArea/TextArea.js";
|
|
47
|
+
import { TimePicker as qo } from "./components/TimePicker/TimePicker.js";
|
|
48
|
+
import { Toast as Ho } from "./components/Toast/Toast.js";
|
|
49
|
+
import { Tooltip as Ko } from "./components/Tooltip/Tooltip.js";
|
|
50
|
+
import { Typography as Uo } from "./components/Typography/Typography.js";
|
|
51
|
+
import { TruncateText as Xo } from "./components/VirtualizedTable/components/TruncateText/TruncateText.js";
|
|
52
|
+
import { VirtualizedTable as Zo } from "./components/VirtualizedTable/VirtualizedTable.js";
|
|
53
|
+
import { ThemeContext as $o } from "./contexts/theme.context.js";
|
|
54
|
+
import { useTheme as rr } from "./contexts/theme.hook.js";
|
|
55
|
+
import { ThemeProvider as tr } from "./contexts/theme.provider.js";
|
|
56
|
+
import { useToggle as mr } from "./hooks/useToggle.js";
|
|
56
57
|
export {
|
|
57
58
|
p as Alert,
|
|
58
59
|
x as AlertDialog,
|
|
59
60
|
a as Autocomplete,
|
|
60
61
|
n as Badge,
|
|
61
|
-
|
|
62
|
+
M as BadgeMultiSelect,
|
|
62
63
|
g as Breadcrumb,
|
|
63
|
-
|
|
64
|
+
u as Button,
|
|
64
65
|
c as Card,
|
|
65
66
|
h as Checkbox,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
wo as Content,
|
|
68
|
+
F as DateFilterDropdown,
|
|
69
|
+
D as DatePicker,
|
|
70
|
+
S as Divider,
|
|
71
|
+
B as Dropdown,
|
|
72
|
+
P as DropdownButton,
|
|
73
|
+
R as Filter,
|
|
74
|
+
xo as Footer,
|
|
75
|
+
I as Input,
|
|
76
|
+
Ao as List,
|
|
76
77
|
y as Loading,
|
|
77
|
-
|
|
78
|
+
ao as Logo,
|
|
78
79
|
O as Modal,
|
|
79
|
-
|
|
80
|
-
no as
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
E as
|
|
85
|
-
J as
|
|
86
|
-
Q as
|
|
87
|
-
W as
|
|
88
|
-
Y as
|
|
89
|
-
_ as
|
|
90
|
-
oo as
|
|
91
|
-
eo as
|
|
92
|
-
|
|
93
|
-
so as
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
zo as
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
qo as
|
|
104
|
-
Ho as
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
80
|
+
j as MultiSelectDropdown,
|
|
81
|
+
no as Navigation,
|
|
82
|
+
lo as NavigationGroup,
|
|
83
|
+
To as NavigationOption,
|
|
84
|
+
bo as NavigationSeparator,
|
|
85
|
+
E as NumberInput,
|
|
86
|
+
J as PhoneNumberInput,
|
|
87
|
+
Q as PieChart,
|
|
88
|
+
W as ProgressBar,
|
|
89
|
+
Y as Radio,
|
|
90
|
+
_ as RadioCard,
|
|
91
|
+
oo as RadioCardGroup,
|
|
92
|
+
eo as RadioGroup,
|
|
93
|
+
po as Range,
|
|
94
|
+
so as Sidebar,
|
|
95
|
+
Co as Slider,
|
|
96
|
+
vo as Switch,
|
|
97
|
+
No as Table,
|
|
98
|
+
ko as Tabs,
|
|
99
|
+
Lo as Tag,
|
|
100
|
+
zo as TagSelect,
|
|
101
|
+
Vo as TextArea,
|
|
102
|
+
$o as ThemeContext,
|
|
103
|
+
tr as ThemeProvider,
|
|
104
|
+
qo as TimePicker,
|
|
105
|
+
Ho as Toast,
|
|
106
|
+
Ko as Tooltip,
|
|
107
|
+
Go as Trigger,
|
|
108
|
+
Xo as TruncateText,
|
|
109
|
+
Uo as Typography,
|
|
110
|
+
Zo as VirtualizedTable,
|
|
109
111
|
e as cn,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
+
rr as useTheme,
|
|
113
|
+
mr as useToggle
|
|
112
114
|
};
|
package/dist/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@konstructio/ui",
|
|
3
3
|
"description": "A set of reusable and customizable React components built for konstruct.io",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.1.2-alpha.
|
|
5
|
+
"version": "0.1.2-alpha.38",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@konstructio/ui",
|
|
3
3
|
"description": "A set of reusable and customizable React components built for konstruct.io",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.1.2-alpha.
|
|
5
|
+
"version": "0.1.2-alpha.39",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|