@ztwoint/z-ui 0.1.13 → 0.1.14
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/upload.d.ts +8 -0
- package/dist/components/assets/icons/z2-icon.js +4 -4
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/button.js +6 -6
- package/dist/components/file-upload-area/file-upload-area.const.d.ts +1 -0
- package/dist/components/file-upload-area/file-upload-area.d.ts +42 -0
- package/dist/components/file-upload-area/text-preset.d.ts +4 -0
- package/dist/components/file-upload-area/upload-icon-component.d.ts +3 -0
- package/dist/components/nav-header/nav-item/nav-item.js +15 -15
- package/dist/css/config/colors/backgrounds.css +19 -7
- package/dist/css/config/colors/defaults.css +4 -0
- package/dist/css/config/config.css +0 -1
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/types/components/assets/icons/upload.d.ts +8 -0
- package/dist/types/components/button/button.d.ts +1 -1
- package/dist/types/components/file-upload-area/file-upload-area.const.d.ts +1 -0
- package/dist/types/components/file-upload-area/file-upload-area.d.ts +42 -0
- package/dist/types/components/file-upload-area/text-preset.d.ts +4 -0
- package/dist/types/components/file-upload-area/upload-icon-component.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
type IconProps = SVGProps<SVGSVGElement> & {
|
|
3
|
+
secondaryfill?: string;
|
|
4
|
+
strokewidth?: number;
|
|
5
|
+
title?: string;
|
|
6
|
+
};
|
|
7
|
+
declare function Upload({ fill, secondaryfill, strokewidth, width, height, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default Upload;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
function e({ title:
|
|
3
|
-
return /* @__PURE__ */
|
|
4
|
-
/* @__PURE__ */ C("title", { children:
|
|
1
|
+
import { jsxs as t, jsx as C } from "react/jsx-runtime";
|
|
2
|
+
function e({ title: L = "Z2-Logo", ...i }) {
|
|
3
|
+
return /* @__PURE__ */ t("svg", { height: "22", width: "27", viewBox: "0 0 27 22", xmlns: "http://www.w3.org/2000/svg", ...i, children: [
|
|
4
|
+
/* @__PURE__ */ C("title", { children: L }),
|
|
5
5
|
/* @__PURE__ */ C("g", { fill: "none", children: /* @__PURE__ */ C(
|
|
6
6
|
"path",
|
|
7
7
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
4
|
variant?: "stroke" | "ghost" | "filled" | null | undefined;
|
|
5
5
|
shade?: "danger" | "neutral" | "brand" | "neutralGhost" | null | undefined;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as e, jsxs as x, Fragment as g } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
2
|
+
import O from "react";
|
|
3
|
+
import { Slot as z } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as w } from "class-variance-authority";
|
|
5
5
|
import { cn as d } from "../../lib/utils.js";
|
|
6
|
-
const N =
|
|
6
|
+
const N = w(
|
|
7
7
|
"box-border h-7.5 leading-none-medium-sm flex items-center justify-center whitespace-nowrap rounded-lg select-none hover:cursor-pointer active:outline-none border-solid",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
@@ -70,7 +70,7 @@ const N = z(
|
|
|
70
70
|
iconOnly: !1
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
), k =
|
|
73
|
+
), k = O.forwardRef(
|
|
74
74
|
({
|
|
75
75
|
className: i,
|
|
76
76
|
shade: c,
|
|
@@ -83,7 +83,7 @@ const N = z(
|
|
|
83
83
|
children: l,
|
|
84
84
|
...p
|
|
85
85
|
}, y) => {
|
|
86
|
-
const v = o ?
|
|
86
|
+
const v = o ? z : "button", r = m || l, n = !r && !!(a || t), u = n ? a || t : null, h = d(
|
|
87
87
|
N({ shade: c, size: b, variant: f, iconOnly: n, className: i })
|
|
88
88
|
), s = "w-3.5 h-3.5";
|
|
89
89
|
return /* @__PURE__ */ e(v, { className: h, ref: y, ...p, children: o ? l : n ? u ? /* @__PURE__ */ e("span", { className: s, children: u }) : null : /* @__PURE__ */ x(g, { children: [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DEFAULT_ACCEPT: string[];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type FileUploadAreaProps = {
|
|
3
|
+
onFilesSelected: (files: File[]) => void;
|
|
4
|
+
accept?: string[];
|
|
5
|
+
multiple?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* FileUploadArea component provides a drag-and-drop and click-to-upload area for file selection.
|
|
11
|
+
*
|
|
12
|
+
* Features:
|
|
13
|
+
* - Drag and drop file upload
|
|
14
|
+
* - Click to open file dialog
|
|
15
|
+
* - Supports multiple file formats (default: CSV, XLS, XLSX)
|
|
16
|
+
* - Supports multiple file selection
|
|
17
|
+
* - Disabled state (blocks all interaction and changes style)
|
|
18
|
+
* - Custom className for styling
|
|
19
|
+
* - Accessible and keyboard-navigable
|
|
20
|
+
*
|
|
21
|
+
* @component
|
|
22
|
+
* @param {FileUploadAreaProps} props - The props for FileUploadArea
|
|
23
|
+
* @returns {JSX.Element}
|
|
24
|
+
*
|
|
25
|
+
* @example <caption>Default usage</caption>
|
|
26
|
+
* <FileUploadArea onFilesSelected={files => console.log(files)} />
|
|
27
|
+
*
|
|
28
|
+
* @example <caption>Custom formats and single file</caption>
|
|
29
|
+
* <FileUploadArea
|
|
30
|
+
* onFilesSelected={files => console.log(files)}
|
|
31
|
+
* accept={[".pdf", ".docx"]}
|
|
32
|
+
* multiple={false}
|
|
33
|
+
* />
|
|
34
|
+
*
|
|
35
|
+
* @example <caption>Disabled</caption>
|
|
36
|
+
* <FileUploadArea onFilesSelected={() => {}} disabled />
|
|
37
|
+
*
|
|
38
|
+
* @example <caption>Async handler</caption>
|
|
39
|
+
* <FileUploadArea onFilesSelected={async files => await uploadFiles(files)} />
|
|
40
|
+
*/
|
|
41
|
+
export declare const FileUploadArea: React.FC<FileUploadAreaProps>;
|
|
42
|
+
export default FileUploadArea;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Button as
|
|
4
|
-
import { cn as
|
|
5
|
-
const d =
|
|
6
|
-
({ leftIcon:
|
|
7
|
-
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import v from "react";
|
|
3
|
+
import { Button as f } from "../../button/button.js";
|
|
4
|
+
import { cn as c } from "../../../lib/utils.js";
|
|
5
|
+
const d = v.forwardRef(
|
|
6
|
+
({ leftIcon: r, label: t, rightIcon: a, onClick: o, className: m, isActive: l, asChild: e, children: n, ...i }, s) => /* @__PURE__ */ u(
|
|
7
|
+
f,
|
|
8
8
|
{
|
|
9
9
|
variant: "ghost",
|
|
10
10
|
shade: "neutralGhost",
|
|
11
11
|
size: "large",
|
|
12
|
-
leftIcon:
|
|
12
|
+
leftIcon: r,
|
|
13
13
|
rightIcon: a,
|
|
14
|
-
label:
|
|
14
|
+
label: t,
|
|
15
15
|
onClick: o,
|
|
16
|
-
className:
|
|
17
|
-
"text-inverted hover:surface-neutral-elevated active:surface-neutral-elevated ",
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
className: c(
|
|
17
|
+
"text-inverted-primary hover:text-inverted-primary hover:surface-neutral-elevated active:surface-neutral-elevated ",
|
|
18
|
+
l && "surface-neutral-elevated",
|
|
19
|
+
m
|
|
20
20
|
),
|
|
21
21
|
asChild: e,
|
|
22
|
-
...
|
|
23
|
-
ref:
|
|
22
|
+
...i,
|
|
23
|
+
ref: s,
|
|
24
24
|
children: e ? n : null
|
|
25
25
|
}
|
|
26
26
|
)
|
|
@@ -3,18 +3,30 @@
|
|
|
3
3
|
background-color: var(--color-neutral-00);
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
@utility bg-neutral-
|
|
6
|
+
@utility bg-neutral-on-top {
|
|
7
|
+
background-color: var(--color-neutral-00);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@utility bg-neutral-light {
|
|
11
|
+
background-color: var(--color-neutral-25);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@utility bg-neutral-high {
|
|
15
|
+
background-color: var(--color-neutral-100);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@utility bg-neutral-medium {
|
|
7
19
|
background-color: var(--color-neutral-50);
|
|
8
20
|
}
|
|
9
21
|
|
|
10
|
-
@utility bg-neutral-elevated {
|
|
11
|
-
background-color: var(--color-
|
|
22
|
+
@utility bg-neutral-inverted-elevated {
|
|
23
|
+
background-color: var(--color-alpha-two-100);
|
|
12
24
|
}
|
|
13
25
|
|
|
14
|
-
@utility bg-neutral-attention {
|
|
15
|
-
background-color: var(--color-
|
|
26
|
+
@utility bg-neutral-inverted-attention {
|
|
27
|
+
background-color: var(--color-alpha-two-200);
|
|
16
28
|
}
|
|
17
29
|
|
|
18
|
-
@utility bg-neutral-
|
|
19
|
-
background-color:
|
|
30
|
+
@utility bg-neutral-inverted-brand {
|
|
31
|
+
background-color: #001534;
|
|
20
32
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@theme {
|
|
2
2
|
--color-neutral-00: #ffffff;
|
|
3
|
+
--color-neutral-25: #fafafa;
|
|
3
4
|
--color-neutral-50: #f6f6f6;
|
|
4
5
|
--color-neutral-100: #e7e7e7;
|
|
5
6
|
--color-neutral-150: #e0e0e0;
|
|
@@ -134,4 +135,7 @@
|
|
|
134
135
|
--color-purple-alt-800: #c5adfb;
|
|
135
136
|
--color-purple-alt-900: #dccefc;
|
|
136
137
|
--color-purple-alt-950: #f3efff;
|
|
138
|
+
|
|
139
|
+
--shadow-custom:
|
|
140
|
+
0px 2px 4px 0px var(--color-alpha-one-50), 0px 0px 0px 0.5px var(--color-neutral-150);
|
|
137
141
|
}
|