@ztwoint/z-ui 0.1.89 → 0.1.91
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/index.d.ts +1 -0
- package/dist/components/assets/icons/triangle-warning.d.ts +7 -0
- package/dist/components/assets/icons/triangle-warning.js +34 -0
- package/dist/components/file-upload-area/file-upload-area.d.ts +6 -0
- package/dist/components/file-upload-area/file-upload-area.js +78 -56
- package/dist/components/stepper/stepper.types.d.ts +1 -1
- package/dist/components/stepper-item/stepper-item.d.ts +1 -1
- package/dist/components/stepper-item/stepper-item.js +19 -18
- package/dist/components/table-card/table-card.js +1 -1
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/index.js +35 -33
- package/dist/types/components/assets/icons/index.d.ts +1 -0
- package/dist/types/components/assets/icons/triangle-warning.d.ts +7 -0
- package/dist/types/components/file-upload-area/file-upload-area.d.ts +6 -0
- package/dist/types/components/stepper/stepper.types.d.ts +1 -1
- package/dist/types/components/stepper-item/stepper-item.d.ts +1 -1
- package/package.json +1 -1
|
@@ -36,3 +36,4 @@ export { default as Z2SlashIcon } from './z2-slash';
|
|
|
36
36
|
export { default as Z2DataIcon } from './z2data';
|
|
37
37
|
export { default as Vector3Icon } from './vector_3';
|
|
38
38
|
export { default as TableCols2Icon } from './table-cols-2';
|
|
39
|
+
export { default as TriangleWarningIcon } from './triangle-warning';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
type IconProps = SVGProps<SVGSVGElement> & {
|
|
3
|
+
strokewidth?: number;
|
|
4
|
+
title?: string;
|
|
5
|
+
};
|
|
6
|
+
declare function TriangleWarningFilled({ fill, strokewidth, width, height, title, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default TriangleWarningFilled;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
function l({
|
|
3
|
+
fill: r = "currentColor",
|
|
4
|
+
strokewidth: t = 1,
|
|
5
|
+
width: s = "1em",
|
|
6
|
+
height: c = "1em",
|
|
7
|
+
title: n = "badge 13",
|
|
8
|
+
...i
|
|
9
|
+
}) {
|
|
10
|
+
return /* @__PURE__ */ o(
|
|
11
|
+
"svg",
|
|
12
|
+
{
|
|
13
|
+
height: c,
|
|
14
|
+
width: s,
|
|
15
|
+
viewBox: "0 0 20 20",
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
+
...i,
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ e("title", { children: n }),
|
|
20
|
+
/* @__PURE__ */ e("g", { fill: r, children: /* @__PURE__ */ e(
|
|
21
|
+
"path",
|
|
22
|
+
{
|
|
23
|
+
d: "m17.794,12.5L12.598,3.5c-.542-.939-1.514-1.5-2.598-1.5s-2.056.561-2.598,1.5L2.206,12.5c-.542.938-.543,2.061,0,3,.542.939,1.514,1.5,2.598,1.5h10.393c1.084,0,2.056-.561,2.598-1.5.542-.939.542-2.062,0-3Zm-8.794-5.5c0-.552.447-1,1-1s1,.448,1,1v3.5c0,.552-.447,1-1,1s-1-.448-1-1v-3.5Zm1,8c-.689,0-1.25-.561-1.25-1.25s.561-1.25,1.25-1.25,1.25.561,1.25,1.25-.561,1.25-1.25,1.25Z",
|
|
24
|
+
fill: r,
|
|
25
|
+
strokeWidth: t
|
|
26
|
+
}
|
|
27
|
+
) })
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
l as default
|
|
34
|
+
};
|
|
@@ -5,6 +5,12 @@ export type FileUploadAreaProps = {
|
|
|
5
5
|
multiple?: boolean;
|
|
6
6
|
className?: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
+
isError?: boolean;
|
|
9
|
+
Error: {
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
Title: string;
|
|
12
|
+
Description: string;
|
|
13
|
+
};
|
|
8
14
|
};
|
|
9
15
|
/**
|
|
10
16
|
* FileUploadArea component provides a drag-and-drop and click-to-upload area for file selection.
|
|
@@ -1,70 +1,92 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { DEFAULT_ACCEPT as
|
|
4
|
-
import { UploadIconComponent as
|
|
5
|
-
import
|
|
6
|
-
import { cn as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as t, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as v, useState as D } from "react";
|
|
3
|
+
import { DEFAULT_ACCEPT as y } from "./file-upload-area.const.js";
|
|
4
|
+
import { UploadIconComponent as C } from "./upload-icon-component.js";
|
|
5
|
+
import k from "./text-preset.js";
|
|
6
|
+
import { cn as p } from "../../lib/utils.js";
|
|
7
|
+
import T from "../assets/icons/triangle-warning.js";
|
|
8
|
+
const L = ({
|
|
9
|
+
onFilesSelected: l,
|
|
10
|
+
accept: i = y,
|
|
11
|
+
multiple: c = !0,
|
|
12
|
+
className: d = "",
|
|
13
|
+
disabled: r = !1,
|
|
14
|
+
isError: m = !1,
|
|
15
|
+
Error: n
|
|
13
16
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
|
|
17
|
+
const s = v(null), [w, o] = D(!1), u = (e) => {
|
|
18
|
+
r || (e.preventDefault(), e.stopPropagation(), o(!0));
|
|
19
|
+
}, g = (e) => {
|
|
20
|
+
r || (e.preventDefault(), e.stopPropagation(), o(!1));
|
|
21
|
+
}, x = (e) => {
|
|
22
|
+
r || (e.preventDefault(), e.stopPropagation(), o(!1), e.dataTransfer.files && e.dataTransfer.files.length > 0 && l(Array.from(e.dataTransfer.files)));
|
|
23
|
+
}, f = () => {
|
|
24
|
+
var e;
|
|
25
|
+
r || (e = s.current) == null || e.click();
|
|
26
|
+
}, h = (e) => {
|
|
27
|
+
r || e.target.files && e.target.files.length > 0 && l(Array.from(e.target.files));
|
|
25
28
|
};
|
|
26
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ t(
|
|
27
30
|
"div",
|
|
28
31
|
{
|
|
29
|
-
className:
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
className: p(
|
|
33
|
+
"max-w-115 w-full bg-neutral-light rounded-3xl",
|
|
34
|
+
"flex flex-col items-center file-upload-12-dash-border",
|
|
35
|
+
r && "opacity-60 bg-gray-100 cursor-not-allowed disabled"
|
|
33
36
|
),
|
|
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
37
|
children: [
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
|
|
49
|
-
/* @__PURE__ */ a(
|
|
50
|
-
"input",
|
|
38
|
+
/* @__PURE__ */ t(
|
|
39
|
+
"div",
|
|
51
40
|
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
onClick:
|
|
61
|
-
|
|
41
|
+
className: p(
|
|
42
|
+
"flex flex-col items-center justify-center gap-8 p-12",
|
|
43
|
+
"leading-none-medium-sm leading-3",
|
|
44
|
+
d
|
|
45
|
+
),
|
|
46
|
+
onDragOver: u,
|
|
47
|
+
onDragLeave: g,
|
|
48
|
+
onDrop: x,
|
|
49
|
+
onClick: f,
|
|
50
|
+
tabIndex: r ? -1 : 0,
|
|
51
|
+
role: "button",
|
|
52
|
+
"aria-label": "File upload area. Click or drag and drop files.",
|
|
53
|
+
"aria-disabled": r,
|
|
54
|
+
onKeyDown: r ? void 0 : (e) => {
|
|
55
|
+
(e.key === "Enter" || e.key === " ") && f();
|
|
56
|
+
},
|
|
57
|
+
"data-testid": "file-upload-area",
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ a(C, {}),
|
|
60
|
+
/* @__PURE__ */ a(k, { accept: i }),
|
|
61
|
+
/* @__PURE__ */ a(
|
|
62
|
+
"input",
|
|
63
|
+
{
|
|
64
|
+
ref: s,
|
|
65
|
+
type: "file",
|
|
66
|
+
className: "hidden",
|
|
67
|
+
accept: i.join(","),
|
|
68
|
+
multiple: c,
|
|
69
|
+
tabIndex: -1,
|
|
70
|
+
"data-testid": "file-upload-input",
|
|
71
|
+
onChange: h,
|
|
72
|
+
onClick: (e) => e.stopPropagation(),
|
|
73
|
+
disabled: r
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
]
|
|
62
77
|
}
|
|
63
|
-
)
|
|
78
|
+
),
|
|
79
|
+
m && /* @__PURE__ */ t("div", { className: "flex flex-row gap-2 p-3 items-center justify-center w-full rounded-b-3xl border-solid border-[1.5px] border-stroke-solid-medium", children: [
|
|
80
|
+
n.icon || /* @__PURE__ */ a(T, {}),
|
|
81
|
+
/* @__PURE__ */ t("div", { className: "flex flex-row gap-1", children: [
|
|
82
|
+
/* @__PURE__ */ a("p", { className: "leading-none-medium-sm text-text-danger-primary", children: n.Title }),
|
|
83
|
+
/* @__PURE__ */ a("p", { className: "leading-none-regular-sm text-text-danger-primary opacity-[.7]", children: n.Description })
|
|
84
|
+
] })
|
|
85
|
+
] })
|
|
64
86
|
]
|
|
65
87
|
}
|
|
66
88
|
);
|
|
67
89
|
};
|
|
68
90
|
export {
|
|
69
|
-
|
|
91
|
+
L as FileUploadArea
|
|
70
92
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare const z2StepperItemVariants: (props?: ({
|
|
4
|
-
state?: "disabled" | "active" | "completed" | null | undefined;
|
|
4
|
+
state?: "disabled" | "active" | "completed" | "completed-disabled" | null | undefined;
|
|
5
5
|
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
|
|
6
6
|
export interface Z2StepperItemProps extends React.HTMLAttributes<HTMLButtonElement>, VariantProps<typeof z2StepperItemVariants> {
|
|
7
7
|
label: string;
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { cn as
|
|
5
|
-
import
|
|
1
|
+
import { jsxs as c, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import * as p from "react";
|
|
3
|
+
import { cva as u } from "class-variance-authority";
|
|
4
|
+
import { cn as a } from "../../lib/utils.js";
|
|
5
|
+
import d from "../assets/icons/circle-check-filled.js";
|
|
6
6
|
import o from "../assets/icons/media-record.js";
|
|
7
|
-
const
|
|
7
|
+
const f = u("w-fit flex items-center select-none gap-2", {
|
|
8
8
|
variants: {
|
|
9
9
|
state: {
|
|
10
10
|
active: "cursor-pointer",
|
|
11
11
|
completed: "opacity-100 cursor-pointer",
|
|
12
|
-
disabled: "cursor-not-allowed"
|
|
12
|
+
disabled: "cursor-not-allowed",
|
|
13
|
+
"completed-disabled": "cursor-not-allowed"
|
|
13
14
|
}
|
|
14
15
|
},
|
|
15
16
|
defaultVariants: {
|
|
16
17
|
state: "active"
|
|
17
18
|
}
|
|
18
|
-
}), h = "rounded-full transition-colors w-4 h-4 border-none", b =
|
|
19
|
-
({ label:
|
|
20
|
-
let
|
|
21
|
-
return e === "completed" ? (
|
|
19
|
+
}), h = "rounded-full transition-colors w-4 h-4 border-none", b = p.forwardRef(
|
|
20
|
+
({ label: t, state: e = "active", className: n, ...s }, m) => {
|
|
21
|
+
let l, r;
|
|
22
|
+
return e === "completed" ? (l = /* @__PURE__ */ i(d, { fill: "var(--blue-500)", width: 16, height: 16 }), r = "text-neutral-primary leading-none-medium-sm") : e === "completed-disabled" ? (l = /* @__PURE__ */ i(d, { fill: "var(--neutral-500)", width: 16, height: 16 }), r = "text-neutral-secondary leading-none-medium-sm") : e === "active" ? (l = /* @__PURE__ */ i(o, { fill: "var(--blue-500)", width: 16, height: 16 }), r = "text-neutral-primary leading-none-medium-sm") : (l = /* @__PURE__ */ i(o, { fill: "var(--neutral-500)", width: 16, height: 16 }), r = "text-neutral-secondary leading-none-medium-sm"), /* @__PURE__ */ c(
|
|
22
23
|
"button",
|
|
23
24
|
{
|
|
24
|
-
ref:
|
|
25
|
-
className:
|
|
26
|
-
"aria-disabled": e === "disabled",
|
|
25
|
+
ref: m,
|
|
26
|
+
className: a(f({ state: e }), n),
|
|
27
|
+
"aria-disabled": e === "disabled" || e === "completed-disabled",
|
|
27
28
|
title: e || "disabled",
|
|
28
|
-
disabled: e === "disabled",
|
|
29
|
-
"aria-label":
|
|
29
|
+
disabled: e === "disabled" || e === "completed-disabled",
|
|
30
|
+
"aria-label": t,
|
|
30
31
|
...s,
|
|
31
32
|
children: [
|
|
32
|
-
/* @__PURE__ */ i("span", { className: h, children:
|
|
33
|
-
/* @__PURE__ */ i("span", { className:
|
|
33
|
+
/* @__PURE__ */ i("span", { className: h, children: l }),
|
|
34
|
+
/* @__PURE__ */ i("span", { className: a(r), children: t })
|
|
34
35
|
]
|
|
35
36
|
}
|
|
36
37
|
);
|
|
@@ -22,6 +22,7 @@ import "@radix-ui/react-dialog";
|
|
|
22
22
|
import "../dropdown/z2-dropdown.js";
|
|
23
23
|
import "@radix-ui/react-dropdown-menu";
|
|
24
24
|
import "lucide-react";
|
|
25
|
+
import S from "../assets/icons/octagon-warning-Copy.js";
|
|
25
26
|
import "../input/input.js";
|
|
26
27
|
import "../nav-header/nav-header.js";
|
|
27
28
|
import "../nav-header/nav-item/nav-item.js";
|
|
@@ -31,7 +32,6 @@ import "../stepper-item/stepper-item.js";
|
|
|
31
32
|
import "@radix-ui/react-tabs";
|
|
32
33
|
import "../tooltip/tooltip.js";
|
|
33
34
|
import { Filter as p } from "../table-filter/index.js";
|
|
34
|
-
import S from "../assets/icons/octagon-warning-Copy.js";
|
|
35
35
|
import "../badge/badge.js";
|
|
36
36
|
import "../avatar/avatar.js";
|
|
37
37
|
import "../text-preset/text-preset.js";
|