@ztwoint/z-ui 0.1.14 → 0.1.16
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/components/assets/icons/circle-check-filled.js +29 -0
- package/dist/components/assets/icons/media-record.js +34 -0
- package/dist/components/assets/icons/upload.js +61 -0
- package/dist/components/dialog/dialog.js +110 -0
- package/dist/components/file-upload-area/file-upload-area.const.js +4 -0
- package/dist/components/file-upload-area/file-upload-area.js +71 -0
- package/dist/components/file-upload-area/text-preset.js +13 -0
- package/dist/components/file-upload-area/upload-icon-component.js +7 -0
- package/dist/components/stepper/stepper.d.ts +1 -12
- package/dist/components/stepper/stepper.js +60 -0
- package/dist/components/stepper/stepper.types.d.ts +12 -0
- package/dist/components/stepper-item/stepper-item.js +41 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +69 -55
- package/dist/types/components/stepper/stepper.d.ts +1 -12
- package/dist/types/components/stepper/stepper.types.d.ts +12 -0
- package/dist/types/index.d.ts +5 -0
- package/package.json +1 -1
- /package/dist/components/{stepper/stepper-item → stepper-item}/stepper-item.d.ts +0 -0
- /package/dist/types/components/{stepper/stepper-item → stepper-item}/stepper-item.d.ts +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
function i({
|
|
3
|
+
fill: r = "currentColor",
|
|
4
|
+
width: t = "1em",
|
|
5
|
+
height: c = "1em",
|
|
6
|
+
...l
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ e(
|
|
9
|
+
"svg",
|
|
10
|
+
{
|
|
11
|
+
height: c,
|
|
12
|
+
width: t,
|
|
13
|
+
...l,
|
|
14
|
+
viewBox: "0 0 20 20",
|
|
15
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
16
|
+
children: /* @__PURE__ */ e("g", { fill: r, children: /* @__PURE__ */ e(
|
|
17
|
+
"path",
|
|
18
|
+
{
|
|
19
|
+
d: "m10,2C5.589,2,2,5.589,2,10s3.589,8,8,8,8-3.589,8-8S14.411,2,10,2Zm4.284,5.621l-4.75,6c-.183.231-.458.37-.753.379-.01,0-.021,0-.031,0-.283,0-.554-.12-.743-.331l-2.25-2.5c-.369-.411-.336-1.043.074-1.412.41-.37,1.042-.336,1.412.074l1.458,1.62,4.015-5.071c.343-.432.971-.506,1.405-.164.433.343.506.972.163,1.405Z",
|
|
20
|
+
fill: r,
|
|
21
|
+
strokeWidth: "0"
|
|
22
|
+
}
|
|
23
|
+
) })
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
i as default
|
|
29
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
function c({
|
|
3
|
+
fill: e = "currentColor",
|
|
4
|
+
width: o = "1em",
|
|
5
|
+
height: n = "1em",
|
|
6
|
+
...t
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ r(
|
|
9
|
+
"svg",
|
|
10
|
+
{
|
|
11
|
+
height: n,
|
|
12
|
+
width: o,
|
|
13
|
+
...t,
|
|
14
|
+
viewBox: "0 0 20 20",
|
|
15
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
16
|
+
children: /* @__PURE__ */ r("g", { fill: e, children: /* @__PURE__ */ r(
|
|
17
|
+
"circle",
|
|
18
|
+
{
|
|
19
|
+
cx: "10",
|
|
20
|
+
cy: "10",
|
|
21
|
+
fill: "none",
|
|
22
|
+
r: "7",
|
|
23
|
+
stroke: e,
|
|
24
|
+
strokeLinecap: "round",
|
|
25
|
+
strokeLinejoin: "round",
|
|
26
|
+
strokeWidth: "2"
|
|
27
|
+
}
|
|
28
|
+
) })
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
c as default
|
|
34
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as n, jsxs as k } from "react/jsx-runtime";
|
|
2
|
+
function u({
|
|
3
|
+
fill: e = "currentColor",
|
|
4
|
+
secondaryfill: o,
|
|
5
|
+
strokewidth: r = 2,
|
|
6
|
+
width: t = "1em",
|
|
7
|
+
height: i = "1em",
|
|
8
|
+
...s
|
|
9
|
+
}) {
|
|
10
|
+
return o = o || e, /* @__PURE__ */ n(
|
|
11
|
+
"svg",
|
|
12
|
+
{
|
|
13
|
+
height: i,
|
|
14
|
+
width: t,
|
|
15
|
+
...s,
|
|
16
|
+
viewBox: "0 0 20 20",
|
|
17
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18
|
+
children: /* @__PURE__ */ k("g", { fill: e, children: [
|
|
19
|
+
/* @__PURE__ */ n(
|
|
20
|
+
"polyline",
|
|
21
|
+
{
|
|
22
|
+
fill: "none",
|
|
23
|
+
points: "7.25 5.75 10 3 12.75 5.75",
|
|
24
|
+
stroke: o,
|
|
25
|
+
strokeLinecap: "round",
|
|
26
|
+
strokeLinejoin: "round",
|
|
27
|
+
strokeWidth: r
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ n(
|
|
31
|
+
"line",
|
|
32
|
+
{
|
|
33
|
+
fill: "none",
|
|
34
|
+
stroke: o,
|
|
35
|
+
strokeLinecap: "round",
|
|
36
|
+
strokeLinejoin: "round",
|
|
37
|
+
strokeWidth: r,
|
|
38
|
+
x1: "10",
|
|
39
|
+
x2: "10",
|
|
40
|
+
y1: "13",
|
|
41
|
+
y2: "3"
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ n(
|
|
45
|
+
"path",
|
|
46
|
+
{
|
|
47
|
+
d: "m6,9.07c-1.216.268-2.168,1.277-2.328,2.557l-.25,2c-.224,1.791,1.172,3.372,2.977,3.372h7.203c1.804,0,3.201-1.582,2.977-3.372l-.25-2c-.16-1.281-1.113-2.289-2.328-2.557",
|
|
48
|
+
fill: "none",
|
|
49
|
+
stroke: e,
|
|
50
|
+
strokeLinecap: "round",
|
|
51
|
+
strokeLinejoin: "round",
|
|
52
|
+
strokeWidth: r
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
] })
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
u as default
|
|
61
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "@radix-ui/react-dialog";
|
|
3
|
+
import { cn as l } from "../../lib/utils.js";
|
|
4
|
+
function c({ ...t }) {
|
|
5
|
+
return /* @__PURE__ */ e(o.Root, { "data-slot": "dialog", ...t });
|
|
6
|
+
}
|
|
7
|
+
function f({ ...t }) {
|
|
8
|
+
return /* @__PURE__ */ e(o.Trigger, { "data-slot": "dialog-trigger", ...t });
|
|
9
|
+
}
|
|
10
|
+
function r({ ...t }) {
|
|
11
|
+
return /* @__PURE__ */ e(o.Portal, { "data-slot": "dialog-portal", ...t });
|
|
12
|
+
}
|
|
13
|
+
function u({ ...t }) {
|
|
14
|
+
return /* @__PURE__ */ e(o.Close, { "data-slot": "dialog-close", ...t });
|
|
15
|
+
}
|
|
16
|
+
function s({
|
|
17
|
+
className: t,
|
|
18
|
+
...a
|
|
19
|
+
}) {
|
|
20
|
+
return /* @__PURE__ */ e(
|
|
21
|
+
o.Overlay,
|
|
22
|
+
{
|
|
23
|
+
"data-slot": "dialog-overlay",
|
|
24
|
+
className: l(
|
|
25
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
26
|
+
t
|
|
27
|
+
),
|
|
28
|
+
...a
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
function m({
|
|
33
|
+
className: t,
|
|
34
|
+
children: a,
|
|
35
|
+
...i
|
|
36
|
+
}) {
|
|
37
|
+
return /* @__PURE__ */ n(r, { "data-slot": "dialog-portal", children: [
|
|
38
|
+
/* @__PURE__ */ e(s, {}),
|
|
39
|
+
/* @__PURE__ */ e(
|
|
40
|
+
o.Content,
|
|
41
|
+
{
|
|
42
|
+
"data-slot": "dialog-content",
|
|
43
|
+
className: l(
|
|
44
|
+
"surface-neutral-default data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 shadow-lg duration-200 sm:max-w-lg",
|
|
45
|
+
t
|
|
46
|
+
),
|
|
47
|
+
...i,
|
|
48
|
+
children: a
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
] });
|
|
52
|
+
}
|
|
53
|
+
function p({ className: t, ...a }) {
|
|
54
|
+
return /* @__PURE__ */ e(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
"data-slot": "dialog-header",
|
|
58
|
+
className: l("flex flex-col gap-2 text-center sm:text-left", t),
|
|
59
|
+
...a
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
function x({ className: t, ...a }) {
|
|
64
|
+
return /* @__PURE__ */ e(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
"data-slot": "dialog-footer",
|
|
68
|
+
className: l("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", t),
|
|
69
|
+
...a
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
function D({
|
|
74
|
+
className: t,
|
|
75
|
+
...a
|
|
76
|
+
}) {
|
|
77
|
+
return /* @__PURE__ */ e(
|
|
78
|
+
o.Title,
|
|
79
|
+
{
|
|
80
|
+
"data-slot": "dialog-title",
|
|
81
|
+
className: l("text-lg leading-none font-semibold", t),
|
|
82
|
+
...a
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
function Z({
|
|
87
|
+
className: t,
|
|
88
|
+
...a
|
|
89
|
+
}) {
|
|
90
|
+
return /* @__PURE__ */ e(
|
|
91
|
+
o.Description,
|
|
92
|
+
{
|
|
93
|
+
"data-slot": "dialog-description",
|
|
94
|
+
className: l("text-muted-foreground text-sm", t),
|
|
95
|
+
...a
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
export {
|
|
100
|
+
c as Z2Dialog,
|
|
101
|
+
u as Z2DialogClose,
|
|
102
|
+
m as Z2DialogContent,
|
|
103
|
+
Z as Z2DialogDescription,
|
|
104
|
+
x as Z2DialogFooter,
|
|
105
|
+
p as Z2DialogHeader,
|
|
106
|
+
s as Z2DialogOverlay,
|
|
107
|
+
r as Z2DialogPortal,
|
|
108
|
+
D as Z2DialogTitle,
|
|
109
|
+
f as Z2DialogTrigger
|
|
110
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsxs as d, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as m, useState as h } from "react";
|
|
3
|
+
import { DEFAULT_ACCEPT as D } from "./file-upload-area.const.js";
|
|
4
|
+
import { UploadIconComponent as v } from "./upload-icon-component.js";
|
|
5
|
+
import x from "./text-preset.js";
|
|
6
|
+
import { cn as y } from "../../lib/utils.js";
|
|
7
|
+
const w = ({
|
|
8
|
+
onFilesSelected: o,
|
|
9
|
+
accept: n = D,
|
|
10
|
+
multiple: f = !0,
|
|
11
|
+
className: s = "",
|
|
12
|
+
disabled: e = !1
|
|
13
|
+
}) => {
|
|
14
|
+
const i = m(null), [C, t] = h(!1), p = (r) => {
|
|
15
|
+
e || (r.preventDefault(), r.stopPropagation(), t(!0));
|
|
16
|
+
}, u = (r) => {
|
|
17
|
+
e || (r.preventDefault(), r.stopPropagation(), t(!1));
|
|
18
|
+
}, c = (r) => {
|
|
19
|
+
e || (r.preventDefault(), r.stopPropagation(), t(!1), r.dataTransfer.files && r.dataTransfer.files.length > 0 && o(Array.from(r.dataTransfer.files)));
|
|
20
|
+
}, l = () => {
|
|
21
|
+
var r;
|
|
22
|
+
e || (r = i.current) == null || r.click();
|
|
23
|
+
}, g = (r) => {
|
|
24
|
+
e || r.target.files && r.target.files.length > 0 && o(Array.from(r.target.files));
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ d(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
className: y(
|
|
30
|
+
"flex flex-col items-center justify-center gap-8 p-12 max-w-112 rounded-2xl border-[.5px] border-dashed stroke-solid-high bg-neutral-light",
|
|
31
|
+
e && "opacity-60 bg-gray-100 cursor-not-allowed",
|
|
32
|
+
s
|
|
33
|
+
),
|
|
34
|
+
onDragOver: p,
|
|
35
|
+
onDragLeave: u,
|
|
36
|
+
onDrop: c,
|
|
37
|
+
onClick: l,
|
|
38
|
+
tabIndex: e ? -1 : 0,
|
|
39
|
+
role: "button",
|
|
40
|
+
"aria-label": "File upload area. Click or drag and drop files.",
|
|
41
|
+
"aria-disabled": e,
|
|
42
|
+
onKeyDown: e ? void 0 : (r) => {
|
|
43
|
+
(r.key === "Enter" || r.key === " ") && l();
|
|
44
|
+
},
|
|
45
|
+
"data-testid": "file-upload-area",
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ a(v, {}),
|
|
48
|
+
/* @__PURE__ */ a(x, { accept: n }),
|
|
49
|
+
/* @__PURE__ */ a(
|
|
50
|
+
"input",
|
|
51
|
+
{
|
|
52
|
+
ref: i,
|
|
53
|
+
type: "file",
|
|
54
|
+
className: "hidden",
|
|
55
|
+
accept: n.join(","),
|
|
56
|
+
multiple: f,
|
|
57
|
+
tabIndex: -1,
|
|
58
|
+
"data-testid": "file-upload-input",
|
|
59
|
+
onChange: g,
|
|
60
|
+
onClick: (r) => r.stopPropagation(),
|
|
61
|
+
disabled: e
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
export {
|
|
69
|
+
w as FileUploadArea,
|
|
70
|
+
w as default
|
|
71
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
function n({ accept: r }) {
|
|
3
|
+
return /* @__PURE__ */ e("div", { className: "flex flex-col items-center text-center gap-2.5", children: [
|
|
4
|
+
/* @__PURE__ */ t("p", { className: "leading-none-medium-sm text-neutral-primary", children: "Click or drag & drop files here" }),
|
|
5
|
+
/* @__PURE__ */ e("p", { className: "leading-none-regular-sm text-neutral-secondary", children: [
|
|
6
|
+
"Supported formats: ",
|
|
7
|
+
r.map((a) => a.replace(".", "").toUpperCase()).join(", ")
|
|
8
|
+
] })
|
|
9
|
+
] });
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
n as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import e from "../assets/icons/upload.js";
|
|
3
|
+
const r = () => /* @__PURE__ */ o("div", { className: "flex items-center justify-center p-3 gap-2.5 rounded-xl bg-neutral-on-top shadow-[var(--shadow-custom)]", children: /* @__PURE__ */ o(e, { className: "w-5 h-5" }) });
|
|
4
|
+
export {
|
|
5
|
+
r as UploadIconComponent,
|
|
6
|
+
r as default
|
|
7
|
+
};
|
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
export type StepperItemType = {
|
|
4
|
-
id: string;
|
|
5
|
-
label: string;
|
|
6
|
-
state?: StepperState;
|
|
7
|
-
};
|
|
8
|
-
export type StepperHandle = {
|
|
9
|
-
handleNext: (label?: string) => void;
|
|
10
|
-
handlePrev: (label?: string) => void;
|
|
11
|
-
reset: () => void;
|
|
12
|
-
setStepState: (index: number, state: StepperState) => void;
|
|
13
|
-
};
|
|
2
|
+
import { StepperHandle, StepperItemType } from './stepper.types';
|
|
14
3
|
declare const Z2Stepper: React.ForwardRefExoticComponent<{
|
|
15
4
|
items: StepperItemType[];
|
|
16
5
|
} & React.RefAttributes<StepperHandle>>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as l, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as c, useState as h, useImperativeHandle as x } from "react";
|
|
3
|
+
import { Z2StepperItem as w } from "../stepper-item/stepper-item.js";
|
|
4
|
+
function b() {
|
|
5
|
+
return /* @__PURE__ */ l("div", { className: "w-3 h-[1.5px] border-solid border-1 stroke-solid-high" });
|
|
6
|
+
}
|
|
7
|
+
const S = c(
|
|
8
|
+
({ items: f }, u) => {
|
|
9
|
+
const [o, d] = h(() => f.map((t, a) => ({
|
|
10
|
+
...t,
|
|
11
|
+
state: t.state ?? (a === 0 ? "active" : "disabled")
|
|
12
|
+
}))), i = (t, a, n = "handleNext") => {
|
|
13
|
+
let r;
|
|
14
|
+
if (a) {
|
|
15
|
+
if (r = t.findIndex((e) => e.id === a), r === -1)
|
|
16
|
+
throw new Error(`${n}: step with id '${a}' not found`);
|
|
17
|
+
} else if (r = t.findIndex((e) => e.state === "active"), r === -1) throw new Error(`${n}: no active step found`);
|
|
18
|
+
return r;
|
|
19
|
+
};
|
|
20
|
+
return x(u, () => ({
|
|
21
|
+
handleNext: (t, a) => {
|
|
22
|
+
d((n) => {
|
|
23
|
+
const r = i(n, t, "handleNext");
|
|
24
|
+
return r === n.length - 1 ? n.map(
|
|
25
|
+
(e, s) => s === r ? { ...e, state: "completed" } : e
|
|
26
|
+
) : n.map((e, s) => s === r ? { ...e, state: "completed" } : s === r + 1 ? { ...e, state: "active", label: a ?? e.label } : e);
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
handlePrev: (t, a) => {
|
|
30
|
+
d((n) => {
|
|
31
|
+
const r = i(n, t, "handlePrev");
|
|
32
|
+
return r <= 0 ? n : n.map((e, s) => s === r ? { ...e, state: "disabled" } : s === r - 1 ? { ...e, state: "active", label: a ?? e.label } : e);
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
reset: () => {
|
|
36
|
+
d(
|
|
37
|
+
(t) => t.map((a, n) => ({
|
|
38
|
+
...a,
|
|
39
|
+
state: n === 0 ? "active" : "disabled"
|
|
40
|
+
}))
|
|
41
|
+
);
|
|
42
|
+
},
|
|
43
|
+
setStepState: (t, a) => {
|
|
44
|
+
if (!t) throw new Error("setStepState: id is required");
|
|
45
|
+
d((n) => {
|
|
46
|
+
const r = n.findIndex((e) => e.id === t);
|
|
47
|
+
if (r === -1) throw new Error(`setStepState: step with id '${t}' not found`);
|
|
48
|
+
return n.map((e, s) => s === r ? { ...e, state: a } : e);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
})), /* @__PURE__ */ l("div", { className: "w-fit flex flex-row items-center gap-6", children: o.map((t, a) => /* @__PURE__ */ p("div", { className: "flex flex-row items-center gap-6", children: [
|
|
52
|
+
/* @__PURE__ */ l(w, { label: t.label, state: t.state }),
|
|
53
|
+
a < o.length - 1 && /* @__PURE__ */ l(b, {})
|
|
54
|
+
] }, t.id)) });
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
S.displayName = "Z2Stepper";
|
|
58
|
+
export {
|
|
59
|
+
S as default
|
|
60
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type StepperState = 'active' | 'completed' | 'disabled';
|
|
2
|
+
export type StepperItemType = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
state?: StepperState;
|
|
6
|
+
};
|
|
7
|
+
export type StepperHandle = {
|
|
8
|
+
handleNext: (activeId?: string, label?: string) => void;
|
|
9
|
+
handlePrev: (activeId?: string, label?: string) => void;
|
|
10
|
+
reset: () => void;
|
|
11
|
+
setStepState: (activeId: string, state: StepperState) => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsxs as m, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
import { cva as p } from "class-variance-authority";
|
|
4
|
+
import { cn as l } from "../../lib/utils.js";
|
|
5
|
+
import f from "../assets/icons/circle-check-filled.js";
|
|
6
|
+
import n from "../assets/icons/media-record.js";
|
|
7
|
+
const h = p("w-fit flex items-center select-none gap-2", {
|
|
8
|
+
variants: {
|
|
9
|
+
state: {
|
|
10
|
+
active: "",
|
|
11
|
+
completed: "opacity-100",
|
|
12
|
+
disabled: "cursor-not-allowed"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
state: "active"
|
|
17
|
+
}
|
|
18
|
+
}), u = "rounded-full transition-colors w-4 h-4 border-none", g = c.forwardRef(
|
|
19
|
+
({ label: a, state: e = "active", className: o, ...s }, d) => {
|
|
20
|
+
let t, r;
|
|
21
|
+
return e === "completed" ? (t = /* @__PURE__ */ i(f, { fill: "blue", width: 16, height: 16 }), r = "text-neutral-primary leading-none-medium-sm") : e === "active" ? (t = /* @__PURE__ */ i(n, { fill: "blue", width: 16, height: 16 }), r = "text-neutral-primary leading-none-medium-sm") : (t = /* @__PURE__ */ i(n, { fill: "gray", width: 16, height: 16 }), r = "text-neutral-secondary leading-none-medium-sm"), /* @__PURE__ */ m(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
ref: d,
|
|
25
|
+
className: l(h({ state: e }), o),
|
|
26
|
+
"aria-disabled": e === "disabled",
|
|
27
|
+
title: e || "disabled",
|
|
28
|
+
"aria-label": a,
|
|
29
|
+
...s,
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ i("span", { className: u, children: t }),
|
|
32
|
+
/* @__PURE__ */ i("span", { className: l(r), children: a })
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
g.displayName = "Z2StepperItem";
|
|
39
|
+
export {
|
|
40
|
+
g as Z2StepperItem
|
|
41
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -6,3 +6,8 @@ export * from './components/country-flags/country-flags';
|
|
|
6
6
|
export * from './components/collapsible-side-nav-bar';
|
|
7
7
|
export * from './components/tab/tab';
|
|
8
8
|
export * from './components/tooltip/tooltip';
|
|
9
|
+
export * from './components/dialog/dialog';
|
|
10
|
+
export * from './components/file-upload-area/file-upload-area';
|
|
11
|
+
export * from './components/dialog/dialog';
|
|
12
|
+
export * from './components/file-upload-area/file-upload-area';
|
|
13
|
+
export * from './components/stepper/stepper';
|
package/dist/index.js
CHANGED
|
@@ -1,67 +1,81 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import { Alert as
|
|
2
|
+
import { Alert as a, AlertDescription as p, AlertTitle as i } from "./components/alert/alert.js";
|
|
3
3
|
import { AlertCirclesIcon as m } from "./components/alert/icons/circles-icon.js";
|
|
4
|
-
import { Button as
|
|
5
|
-
import { NavHeader as
|
|
4
|
+
import { Button as x, buttonVariants as Z } from "./components/button/button.js";
|
|
5
|
+
import { NavHeader as n } from "./components/nav-header/nav-header.js";
|
|
6
6
|
import { NavItem as v } from "./components/nav-header/nav-item/nav-item.js";
|
|
7
|
-
import { Input as
|
|
8
|
-
import { CountryFlags as
|
|
9
|
-
import { Z2SideNavBarProvider as
|
|
10
|
-
import { Z2SideNavBar as T, Z2SidebarVariants as
|
|
11
|
-
import { Z2SideNavBarHeader as
|
|
12
|
-
import { Z2SideNavBarContent as
|
|
13
|
-
import { Z2SideNavBarFooter as
|
|
14
|
-
import { Z2SideNavBarGroup as
|
|
7
|
+
import { Input as g } from "./components/input/input.js";
|
|
8
|
+
import { CountryFlags as C } from "./components/country-flags/country-flags.js";
|
|
9
|
+
import { Z2SideNavBarProvider as B } from "./components/collapsible-side-nav-bar/side-nav-bar-provider.js";
|
|
10
|
+
import { Z2SideNavBar as T, Z2SidebarVariants as I } from "./components/collapsible-side-nav-bar/side-nav-bar.js";
|
|
11
|
+
import { Z2SideNavBarHeader as c } from "./components/collapsible-side-nav-bar/side-nav-bar-header.js";
|
|
12
|
+
import { Z2SideNavBarContent as P } from "./components/collapsible-side-nav-bar/side-nav-bar-content.js";
|
|
13
|
+
import { Z2SideNavBarFooter as H } from "./components/collapsible-side-nav-bar/side-nav-bar-footer.js";
|
|
14
|
+
import { Z2SideNavBarGroup as F } from "./components/collapsible-side-nav-bar/side-nav-bar-group.js";
|
|
15
15
|
import { Z2SideNavBarItem as W } from "./components/collapsible-side-nav-bar/side-nav-bar-item.js";
|
|
16
16
|
import { Z2SideNavBarSeparator as h } from "./components/collapsible-side-nav-bar/side-nav-bar-separator.js";
|
|
17
|
-
import { useZ2SideNavBar as
|
|
18
|
-
import { Z2Popover as
|
|
19
|
-
import { ChevronUpIcon as
|
|
20
|
-
import { default as
|
|
21
|
-
import { default as
|
|
22
|
-
import { default as
|
|
23
|
-
import { default as
|
|
24
|
-
import { default as
|
|
25
|
-
import { SIDEBAR_WIDTH as
|
|
26
|
-
import { Z2Tabs as
|
|
27
|
-
import { Z2Tooltip as
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
17
|
+
import { useZ2SideNavBar as O } from "./components/collapsible-side-nav-bar/context.js";
|
|
18
|
+
import { Z2Popover as U } from "./components/collapsible-side-nav-bar/popover/popover.js";
|
|
19
|
+
import { ChevronUpIcon as G } from "./components/assets/icons/chevron-up-icon.js";
|
|
20
|
+
import { default as k } from "./components/assets/icons/sub-nav-indicator.js";
|
|
21
|
+
import { default as z } from "./components/assets/icons/circles-icon.js";
|
|
22
|
+
import { default as K } from "./components/assets/icons/database-copy.js";
|
|
23
|
+
import { default as Q } from "./components/assets/icons/window-left-copy.js";
|
|
24
|
+
import { default as Y } from "./components/assets/icons/sidebar-left-show-copy.js";
|
|
25
|
+
import { SIDEBAR_WIDTH as oo, SIDEBAR_WIDTH_COLLAPSED as ro } from "./components/collapsible-side-nav-bar/constants.js";
|
|
26
|
+
import { Z2Tabs as to, Z2TabsContent as ao, Z2TabsList as po, Z2TabsTrigger as io } from "./components/tab/tab.js";
|
|
27
|
+
import { Z2Tooltip as mo } from "./components/tooltip/tooltip.js";
|
|
28
|
+
import { Z2Dialog as xo, Z2DialogClose as Zo, Z2DialogContent as no, Z2DialogDescription as so, Z2DialogFooter as vo, Z2DialogHeader as Do, Z2DialogOverlay as go, Z2DialogPortal as So, Z2DialogTitle as Co, Z2DialogTrigger as uo } from "./components/dialog/dialog.js";
|
|
29
|
+
import { FileUploadArea as No } from "./components/file-upload-area/file-upload-area.js";
|
|
30
|
+
import "./components/stepper/stepper.js";
|
|
31
|
+
import { Z2PopoverTrigger as Io } from "./components/collapsible-side-nav-bar/popover/popover-trigger.js";
|
|
32
|
+
import { Z2PopoverContent as co } from "./components/collapsible-side-nav-bar/popover/popover-content.js";
|
|
30
33
|
export {
|
|
31
|
-
|
|
34
|
+
a as Alert,
|
|
32
35
|
m as AlertCirclesIcon,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
p as AlertDescription,
|
|
37
|
+
i as AlertTitle,
|
|
38
|
+
x as Button,
|
|
39
|
+
G as ChevronUpIcon,
|
|
40
|
+
z as CirclesIcon,
|
|
41
|
+
C as CountryFlags,
|
|
42
|
+
K as DatabaseCopy,
|
|
43
|
+
No as FileUploadArea,
|
|
44
|
+
g as Input,
|
|
45
|
+
n as NavHeader,
|
|
42
46
|
v as NavItem,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
oo as SIDEBAR_WIDTH,
|
|
48
|
+
ro as SIDEBAR_WIDTH_COLLAPSED,
|
|
49
|
+
Y as SidebarLeftShowCopy,
|
|
50
|
+
k as SubNavIndicator,
|
|
51
|
+
Q as WindowLeftCopy,
|
|
52
|
+
xo as Z2Dialog,
|
|
53
|
+
Zo as Z2DialogClose,
|
|
54
|
+
no as Z2DialogContent,
|
|
55
|
+
so as Z2DialogDescription,
|
|
56
|
+
vo as Z2DialogFooter,
|
|
57
|
+
Do as Z2DialogHeader,
|
|
58
|
+
go as Z2DialogOverlay,
|
|
59
|
+
So as Z2DialogPortal,
|
|
60
|
+
Co as Z2DialogTitle,
|
|
61
|
+
uo as Z2DialogTrigger,
|
|
62
|
+
U as Z2Popover,
|
|
63
|
+
co as Z2PopoverContent,
|
|
64
|
+
Io as Z2PopoverTrigger,
|
|
51
65
|
T as Z2SideNavBar,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
66
|
+
P as Z2SideNavBarContent,
|
|
67
|
+
H as Z2SideNavBarFooter,
|
|
68
|
+
F as Z2SideNavBarGroup,
|
|
69
|
+
c as Z2SideNavBarHeader,
|
|
56
70
|
W as Z2SideNavBarItem,
|
|
57
|
-
|
|
71
|
+
B as Z2SideNavBarProvider,
|
|
58
72
|
h as Z2SideNavBarSeparator,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
73
|
+
I as Z2SidebarVariants,
|
|
74
|
+
to as Z2Tabs,
|
|
75
|
+
ao as Z2TabsContent,
|
|
76
|
+
po as Z2TabsList,
|
|
77
|
+
io as Z2TabsTrigger,
|
|
78
|
+
mo as Z2Tooltip,
|
|
79
|
+
Z as buttonVariants,
|
|
80
|
+
O as useZ2SideNavBar
|
|
67
81
|
};
|
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export type StepperItemType = {
|
|
4
|
-
id: string;
|
|
5
|
-
label: string;
|
|
6
|
-
state?: StepperState;
|
|
7
|
-
};
|
|
8
|
-
export type StepperHandle = {
|
|
9
|
-
handleNext: (label?: string) => void;
|
|
10
|
-
handlePrev: (label?: string) => void;
|
|
11
|
-
reset: () => void;
|
|
12
|
-
setStepState: (index: number, state: StepperState) => void;
|
|
13
|
-
};
|
|
2
|
+
import { StepperHandle, StepperItemType } from './stepper.types';
|
|
14
3
|
declare const Z2Stepper: React.ForwardRefExoticComponent<{
|
|
15
4
|
items: StepperItemType[];
|
|
16
5
|
} & React.RefAttributes<StepperHandle>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type StepperState = 'active' | 'completed' | 'disabled';
|
|
2
|
+
export type StepperItemType = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
state?: StepperState;
|
|
6
|
+
};
|
|
7
|
+
export type StepperHandle = {
|
|
8
|
+
handleNext: (activeId?: string, label?: string) => void;
|
|
9
|
+
handlePrev: (activeId?: string, label?: string) => void;
|
|
10
|
+
reset: () => void;
|
|
11
|
+
setStepState: (activeId: string, state: StepperState) => void;
|
|
12
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,3 +7,8 @@ export * from './components/country-flags/country-flags';
|
|
|
7
7
|
export * from './components/collapsible-side-nav-bar';
|
|
8
8
|
export * from './components/tab/tab';
|
|
9
9
|
export * from './components/tooltip/tooltip';
|
|
10
|
+
export * from './components/dialog/dialog';
|
|
11
|
+
export * from './components/file-upload-area/file-upload-area';
|
|
12
|
+
export * from './components/dialog/dialog';
|
|
13
|
+
export * from './components/file-upload-area/file-upload-area';
|
|
14
|
+
export * from './components/stepper/stepper';
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|