@ztwoint/z-ui 0.1.90 → 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.
@@ -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 m, jsx as a } from "react/jsx-runtime";
2
- import { useRef as d, 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 I = ({
8
- onFilesSelected: o,
9
- accept: n = D,
10
- multiple: f = !0,
11
- className: s = "",
12
- disabled: e = !1
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 i = d(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));
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__ */ m(
29
+ return /* @__PURE__ */ t(
27
30
  "div",
28
31
  {
29
- className: y(
30
- "flex flex-col items-center justify-center gap-8 p-12 max-w-112 w-full rounded-3xl file-upload-12-dash-border bg-neutral-light",
31
- e && "opacity-60 bg-gray-100 cursor-not-allowed disabled",
32
- s
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__ */ a(v, {}),
48
- /* @__PURE__ */ a(x, { accept: n }),
49
- /* @__PURE__ */ a(
50
- "input",
38
+ /* @__PURE__ */ t(
39
+ "div",
51
40
  {
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
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
- I as FileUploadArea
91
+ L as FileUploadArea
70
92
  };
@@ -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";