@ztwoint/z-ui 0.1.46 → 0.1.49
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/alert/alert.const.d.ts +0 -3
- package/dist/components/alert/alert.const.js +16 -31
- package/dist/components/alert/alert.js +32 -44
- package/dist/components/assets/icons/check.d.ts +8 -0
- package/dist/components/assets/icons/check.js +17 -0
- package/dist/components/assets/icons/x-mark.d.ts +8 -0
- package/dist/components/assets/icons/x-mark.js +17 -0
- package/dist/components/button/button.d.ts +3 -3
- package/dist/components/button/button.js +58 -58
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-header.js +17 -17
- package/dist/components/nav-header/nav-item/nav-item.d.ts +4 -2
- package/dist/components/nav-header/nav-item/nav-item.js +29 -28
- package/dist/components/select/z2-select.js +131 -78
- package/dist/components/table/components/cell/avatar-cell.d.ts +15 -0
- package/dist/components/table/components/cell/avatar-cell.js +74 -0
- package/dist/components/table/components/cell/boolean-cell.d.ts +1 -2
- package/dist/components/table/components/cell/boolean-cell.js +5 -5
- package/dist/components/table/components/cell/description-cell.d.ts +7 -0
- package/dist/components/table/components/cell/description-cell.js +16 -0
- package/dist/components/table/components/cell/index.d.ts +10 -1
- package/dist/components/table/components/cell/label-cell.d.ts +10 -0
- package/dist/components/table/components/cell/label-cell.js +47 -0
- package/dist/components/table/components/cell/link-cell.d.ts +10 -0
- package/dist/components/table/components/cell/link-cell.js +35 -0
- package/dist/components/table/components/cell/number-cell.d.ts +5 -3
- package/dist/components/table/components/cell/number-cell.js +40 -3
- package/dist/components/table/components/index.d.ts +1 -1
- package/dist/components/table/components/table-cell.d.ts +1 -1
- package/dist/components/table/components/table-cell.js +41 -32
- package/dist/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.d.ts +10 -0
- package/dist/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.js +33 -0
- package/dist/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.utils.d.ts +13 -0
- package/dist/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.utils.js +20 -0
- package/dist/components/table/components/table-filter/filters/boolean.js +52 -44
- package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.utils.js +16 -16
- package/dist/components/table/components/table-filter/table-filter-button.js +88 -57
- package/dist/components/table/components/table-filter/table-filter-column-button.js +81 -51
- package/dist/components/table/components/table-filter/table-filter.context.d.ts +1 -0
- package/dist/components/table/components/table-filter/table-filter.hook.d.ts +1 -0
- package/dist/components/table/components/table-filter/table-filter.hook.js +17 -14
- package/dist/components/table/components/table-footer.js +6 -6
- package/dist/components/table/components/table-header/stories/basic-header.d.ts +1 -1
- package/dist/components/table/components/table-header/table-header.js +27 -33
- package/dist/components/table/index.d.ts +1 -1
- package/dist/components/table/table-provider.js +37 -8
- package/dist/components/table/table.const.d.ts +15 -9
- package/dist/components/table/table.const.js +15 -9
- package/dist/components/table/table.js +39 -34
- package/dist/components/table/table.type.d.ts +36 -5
- package/dist/components/table/table.utils.d.ts +1 -1
- package/dist/components/table/table.utils.js +5 -3
- package/dist/components/table-card/table-card.js +116 -89
- package/dist/components/tooltip/tooltip.js +24 -22
- package/dist/css/config/colors/backgrounds.css +8 -8
- package/dist/css/config/colors/components/avatar.css +12 -12
- package/dist/css/config/colors/components/badge.css +42 -42
- package/dist/css/config/colors/components/checkbox.css +2 -2
- package/dist/css/config/colors/components/featured-icon.css +18 -18
- package/dist/css/config/colors/components/progress-bar.css +2 -2
- package/dist/css/config/colors/components/radio-button.css +2 -2
- package/dist/css/config/colors/components/scroll-overlay.css +4 -4
- package/dist/css/config/colors/components/tab.css +7 -7
- package/dist/css/config/colors/components/toggle-switch.css +1 -1
- package/dist/css/config/colors/components/toggle.css +6 -6
- package/dist/css/config/colors/icons.css +20 -20
- package/dist/css/config/colors/overlay.css +1 -1
- package/dist/css/config/colors/semantic/alert.css +44 -0
- package/dist/css/config/colors/semantic/background.css +51 -0
- package/dist/css/config/colors/semantic/base.css +395 -0
- package/dist/css/config/colors/semantic/button.css +131 -0
- package/dist/css/config/colors/semantic/drop-shadow.css +30 -0
- package/dist/css/config/colors/semantic/dropdown.css +12 -0
- package/dist/css/config/colors/semantic/index.css +16 -0
- package/dist/css/config/colors/semantic/input.css +56 -0
- package/dist/css/config/colors/semantic/overlay.css +13 -0
- package/dist/css/config/colors/semantic/stroke.css +90 -0
- package/dist/css/config/colors/semantic/surface.css +135 -0
- package/dist/css/config/colors/semantic/text.css +113 -0
- package/dist/css/config/colors/semantic/tooltip.css +12 -0
- package/dist/css/config/colors/shape.css +40 -40
- package/dist/css/config/colors/stroke.css +19 -19
- package/dist/css/config/colors/surfaces.css +47 -47
- package/dist/css/config/colors/text.css +37 -37
- package/dist/css/config/components/index.css +0 -2
- package/dist/css/config/config-deprecated.css +3 -5
- package/dist/css/config/config.css +5 -3
- package/dist/css/config/other-variables.css +9 -0
- package/dist/css/config/shadows.css +15 -0
- package/dist/css/config/typography/2xl.css +7 -14
- package/dist/css/config/typography/3xl.css +7 -14
- package/dist/css/config/typography/4xl.css +7 -14
- package/dist/css/config/typography/base.css +7 -14
- package/dist/css/config/typography/lg.css +7 -14
- package/dist/css/config/typography/sm.css +7 -14
- package/dist/css/config/typography/xl.css +7 -14
- package/dist/css/config/typography/xs.css +7 -14
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/index.js +62 -64
- package/dist/types/components/alert/alert.const.d.ts +0 -3
- package/dist/types/components/assets/icons/check.d.ts +8 -0
- package/dist/types/components/assets/icons/x-mark.d.ts +8 -0
- package/dist/types/components/button/button.d.ts +3 -3
- package/dist/types/components/nav-header/nav-item/nav-item.d.ts +4 -2
- package/dist/types/components/table/components/cell/avatar-cell.d.ts +15 -0
- package/dist/types/components/table/components/cell/boolean-cell.d.ts +1 -2
- package/dist/types/components/table/components/cell/description-cell.d.ts +7 -0
- package/dist/types/components/table/components/cell/index.d.ts +10 -1
- package/dist/types/components/table/components/cell/label-cell.d.ts +10 -0
- package/dist/types/components/table/components/cell/link-cell.d.ts +10 -0
- package/dist/types/components/table/components/cell/number-cell.d.ts +5 -3
- package/dist/types/components/table/components/index.d.ts +1 -1
- package/dist/types/components/table/components/table-cell.d.ts +1 -1
- package/dist/types/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.d.ts +10 -0
- package/dist/types/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.utils.d.ts +13 -0
- package/dist/types/components/table/components/table-filter/table-filter.context.d.ts +1 -0
- package/dist/types/components/table/components/table-filter/table-filter.hook.d.ts +1 -0
- package/dist/types/components/table/components/table-header/stories/basic-header.d.ts +1 -1
- package/dist/types/components/table/index.d.ts +1 -1
- package/dist/types/components/table/table.const.d.ts +15 -9
- package/dist/types/components/table/table.type.d.ts +36 -5
- package/dist/types/components/table/table.utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/table/components/cell/text-cell.d.ts +0 -7
- package/dist/components/table/components/cell/text-cell.js +0 -5
- package/dist/css/config/colors/components/alert.css +0 -84
- package/dist/css/config/colors/components/button.css +0 -93
- package/dist/css/config/colors/components/select.css +0 -128
- package/dist/css/config/colors/components/text-button.css +0 -67
- package/dist/css/config/colors/defaults.css +0 -393
- package/dist/css/config/colors/semantic-colors.css +0 -353
- package/dist/css/config/components/button.css +0 -160
- package/dist/css/config/components/input.css +0 -56
- package/dist/node_modules/@heroicons/react/24/solid/esm/CheckCircleIcon.js +0 -26
- package/dist/node_modules/@heroicons/react/24/solid/esm/XCircleIcon.js +0 -26
- package/dist/types/components/table/components/cell/text-cell.d.ts +0 -7
- /package/dist/css/config/typography/{typography.css → index.css} +0 -0
|
@@ -4,6 +4,3 @@ export declare const alertVariants: (props?: ({
|
|
|
4
4
|
export declare const iconVariants: (props?: ({
|
|
5
5
|
variant?: "success" | "warning" | "danger" | "accent" | "neutral" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
|
|
7
|
-
export declare const buttonVariants: (props?: ({
|
|
8
|
-
appearance?: "stroke" | "ghost" | null | undefined;
|
|
9
|
-
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
|
|
@@ -1,48 +1,33 @@
|
|
|
1
|
-
import { cva as
|
|
2
|
-
const
|
|
1
|
+
import { cva as t } from "class-variance-authority";
|
|
2
|
+
const e = t(
|
|
3
3
|
"relative w-full rounded-lg border pl-2.5 pr-0.5 py-2.5 text-sm flex flex-col gap-2 items-start",
|
|
4
4
|
// Flex, column, gap for flexible content & action placement
|
|
5
5
|
{
|
|
6
6
|
variants: {
|
|
7
7
|
variant: {
|
|
8
|
-
success: "alert-
|
|
9
|
-
warning: "alert-
|
|
10
|
-
danger: "alert-
|
|
11
|
-
accent: "alert-
|
|
12
|
-
neutral: "alert-
|
|
8
|
+
success: "border-alert-stroke-success bg-alert-surface-success text-text-success-primary",
|
|
9
|
+
warning: "border-alert-stroke-warning bg-alert-surface-warning text-text-warning-primary",
|
|
10
|
+
danger: "border-alert-stroke-danger bg-alert-surface-danger text-text-danger-primary",
|
|
11
|
+
accent: "border-alert-stroke-accent bg-alert-surface-accent text-text-brand-primary",
|
|
12
|
+
neutral: "border-alert-stroke-neutral bg-alert-surface-neutral text-text-neutral-primary"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
defaultVariants: {
|
|
16
16
|
variant: "accent"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
),
|
|
19
|
+
), a = t("h-5 w-5 flex-shrink-0", {
|
|
20
20
|
variants: {
|
|
21
21
|
variant: {
|
|
22
|
-
success: "
|
|
23
|
-
warning: "
|
|
24
|
-
danger: "
|
|
25
|
-
accent: "
|
|
26
|
-
neutral: "
|
|
22
|
+
success: "text-text-success-secondary",
|
|
23
|
+
warning: "text-text-warning-secondary",
|
|
24
|
+
danger: "text-text-danger-secondary",
|
|
25
|
+
accent: "text-text-brand-secondary",
|
|
26
|
+
neutral: "text-text-neutral-primary"
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
})
|
|
30
|
-
"inline-flex items-center justify-center gap-1 rounded-md px-2 py-2 text-sm transition focus:outline-none focus:ring-2",
|
|
31
|
-
// Responsive and basic
|
|
32
|
-
{
|
|
33
|
-
variants: {
|
|
34
|
-
appearance: {
|
|
35
|
-
ghost: "bg-transparent hover:cursor-pointer",
|
|
36
|
-
stroke: "bg-(--color-neutral-00) hover:cursor-pointer"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
defaultVariants: {
|
|
40
|
-
appearance: "ghost"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
);
|
|
29
|
+
});
|
|
44
30
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
r as iconVariants
|
|
31
|
+
e as alertVariants,
|
|
32
|
+
a as iconVariants
|
|
48
33
|
};
|
|
@@ -1,52 +1,40 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
2
|
import * as x from "react";
|
|
3
3
|
import u from "../assets/icons/x.js";
|
|
4
4
|
import N from "../assets/icons/left-arrow.js";
|
|
5
5
|
import { cn as l } from "../../lib/utils.js";
|
|
6
|
-
import { iconVariants as
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { iconVariants as n, alertVariants as k } from "./alert.const.js";
|
|
7
|
+
import { Button as h } from "../button/button.js";
|
|
8
|
+
function A({
|
|
9
|
+
className: i,
|
|
9
10
|
variant: r,
|
|
10
|
-
title:
|
|
11
|
-
description:
|
|
12
|
-
leadingIcon:
|
|
11
|
+
title: c,
|
|
12
|
+
description: f,
|
|
13
|
+
leadingIcon: s,
|
|
13
14
|
showActions: p = !1,
|
|
14
|
-
onClose:
|
|
15
|
+
onClose: t,
|
|
15
16
|
onAction: m,
|
|
16
|
-
actionLabel:
|
|
17
|
+
actionLabel: o,
|
|
17
18
|
...d
|
|
18
19
|
}) {
|
|
19
|
-
return /* @__PURE__ */ e("div", { role: "alert", className: l(
|
|
20
|
-
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
|
|
25
|
-
p && (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
type: "button",
|
|
30
|
-
onClick: i,
|
|
31
|
-
className: l(h({ appearance: "ghost" })),
|
|
32
|
-
"aria-label": "Close alert",
|
|
33
|
-
children: /* @__PURE__ */ e(u, { className: l(c({ variant: r }), "h-2.2 w-2.2") })
|
|
34
|
-
}
|
|
35
|
-
),
|
|
36
|
-
m && /* @__PURE__ */ s(
|
|
37
|
-
"button",
|
|
20
|
+
return /* @__PURE__ */ e("div", { role: "alert", className: l(k({ variant: r }), i), ...d, children: /* @__PURE__ */ a("div", { className: "flex flex-row flex-wrap w-full items-start gap-1", children: [
|
|
21
|
+
s && /* @__PURE__ */ e("span", { className: l(n({ variant: r }), "flex-shrink-0"), children: (x.isValidElement(s), s) }),
|
|
22
|
+
/* @__PURE__ */ a("div", { className: "flex flex-col gap-1", children: [
|
|
23
|
+
c && /* @__PURE__ */ e(w, { className: "flex-shrink-0", children: c }),
|
|
24
|
+
/* @__PURE__ */ a("div", { className: "flex flex-row flex-wrap w-full items-center", children: [
|
|
25
|
+
f && /* @__PURE__ */ e("span", { className: "flex-shrink-1", children: /* @__PURE__ */ e(v, { children: f }) }),
|
|
26
|
+
p && (t || m) && /* @__PURE__ */ a("div", { className: "flex items-center self-end flex-shrink-0", children: [
|
|
27
|
+
t && /* @__PURE__ */ e(h, { type: "button", variant: "ghost", size: "medium", onClick: t, children: /* @__PURE__ */ e(u, { className: l(n({ variant: r }), "h-2.2 w-2.2") }) }),
|
|
28
|
+
m && /* @__PURE__ */ e(
|
|
29
|
+
h,
|
|
38
30
|
{
|
|
39
31
|
type: "button",
|
|
32
|
+
variant: "stroke",
|
|
33
|
+
size: "medium",
|
|
40
34
|
onClick: m,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
),
|
|
45
|
-
"aria-label": n,
|
|
46
|
-
children: [
|
|
47
|
-
/* @__PURE__ */ e(N, { className: l(c({ variant: r }), "h-2.2 w-2.2") }),
|
|
48
|
-
n && n
|
|
49
|
-
]
|
|
35
|
+
"aria-label": o,
|
|
36
|
+
leftIcon: /* @__PURE__ */ e(N, { className: l(n({ variant: r }), "h-2.2 w-2.2") }),
|
|
37
|
+
children: o
|
|
50
38
|
}
|
|
51
39
|
)
|
|
52
40
|
] })
|
|
@@ -55,14 +43,14 @@ function C({
|
|
|
55
43
|
d.children
|
|
56
44
|
] }) });
|
|
57
45
|
}
|
|
58
|
-
function
|
|
59
|
-
return /* @__PURE__ */ e("div", { className: l("tracking-tight leading-none-medium-sm",
|
|
46
|
+
function w({ className: i, ...r }) {
|
|
47
|
+
return /* @__PURE__ */ e("div", { className: l("tracking-tight leading-none-medium-sm", i), ...r });
|
|
60
48
|
}
|
|
61
|
-
function
|
|
62
|
-
return /* @__PURE__ */ e("div", { className: l("leading-none-regular-sm",
|
|
49
|
+
function v({ className: i, ...r }) {
|
|
50
|
+
return /* @__PURE__ */ e("div", { className: l("leading-none-regular-sm", i), ...r });
|
|
63
51
|
}
|
|
64
52
|
export {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
53
|
+
A as Alert,
|
|
54
|
+
v as AlertDescription,
|
|
55
|
+
w as AlertTitle
|
|
68
56
|
};
|
|
@@ -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
|
+
export declare function Check({ title, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default Check;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsxs as e, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
function s({ title: r = "badge 13", ...t }) {
|
|
3
|
+
return /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", ...t, children: [
|
|
4
|
+
/* @__PURE__ */ l("title", { children: r }),
|
|
5
|
+
/* @__PURE__ */ l("g", { fill: "currentColor", children: /* @__PURE__ */ l(
|
|
6
|
+
"path",
|
|
7
|
+
{
|
|
8
|
+
d: "M16,0C7.163,0,0,7.163,0,16s7.163,16,16,16,16-7.163,16-16C31.974,7.174,24.826,.026,16,0Zm7.707,11.707l-10,10c-.195,.195-.451,.293-.707,.293s-.512-.098-.707-.293l-4-4c-.391-.391-.391-1.023,0-1.414s1.023-.391,1.414,0l3.293,3.293,9.293-9.293c.391-.391,1.023-.391,1.414,0s.391,1.023,0,1.414Z",
|
|
9
|
+
fill: "currentColor"
|
|
10
|
+
}
|
|
11
|
+
) })
|
|
12
|
+
] });
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
s as Check,
|
|
16
|
+
s as default
|
|
17
|
+
};
|
|
@@ -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
|
+
export declare function XMark({ title, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default XMark;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsxs as s, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
function i({ title: r = "badge 13", ...t }) {
|
|
3
|
+
return /* @__PURE__ */ s("svg", { height: "48", width: "48", viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg", ...t, children: [
|
|
4
|
+
/* @__PURE__ */ l("title", { children: r }),
|
|
5
|
+
/* @__PURE__ */ l("g", { fill: "currentColor", children: /* @__PURE__ */ l(
|
|
6
|
+
"path",
|
|
7
|
+
{
|
|
8
|
+
d: "M24,1C11.3,1,1,11.3,1,24s10.3,23,23,23s23-10.3,23-23S36.7,1,24,1z M32.7,31.3c0.4,0.4,0.4,1,0,1.4 C32.5,32.9,32.3,33,32,33s-0.5-0.1-0.7-0.3L24,25.4l-7.3,7.3C16.5,32.9,16.3,33,16,33s-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4 l7.3-7.3l-7.3-7.3c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l7.3,7.3l7.3-7.3c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4L25.4,24L32.7,31.3z",
|
|
9
|
+
fill: "currentColor"
|
|
10
|
+
}
|
|
11
|
+
) })
|
|
12
|
+
] });
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
i as XMark,
|
|
16
|
+
i as default
|
|
17
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "stroke" | "
|
|
5
|
-
shade?: "danger" | "neutral" | "brand" |
|
|
6
|
-
size?: "small" | "large" | null | undefined;
|
|
4
|
+
variant?: "stroke" | "filled" | "ghost" | null | undefined;
|
|
5
|
+
shade?: "danger" | "neutral" | "brand" | null | undefined;
|
|
6
|
+
size?: "small" | "large" | "medium" | null | undefined;
|
|
7
7
|
iconOnly?: boolean | null | undefined;
|
|
8
8
|
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
|
|
9
9
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, Omit<VariantProps<typeof buttonVariants>, 'iconOnly'> {
|
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { Slot as
|
|
4
|
-
import { cva as
|
|
1
|
+
import { jsx as e, jsxs as x, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import k from "react";
|
|
3
|
+
import { Slot as w } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as N } from "class-variance-authority";
|
|
5
5
|
import { cn as d } from "../../lib/utils.js";
|
|
6
|
-
const
|
|
7
|
-
"box-border
|
|
6
|
+
const C = N(
|
|
7
|
+
"box-border leading-none-medium-sm flex items-center justify-center whitespace-nowrap rounded-lg select-none hover:cursor-pointer disabled:cursor-not-allowed active:outline-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring-default",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
|
-
filled: ["
|
|
12
|
-
stroke: [
|
|
13
|
-
|
|
11
|
+
filled: [""],
|
|
12
|
+
stroke: [
|
|
13
|
+
"ring-[0.5px] ring-btn-secondary-stroke-default hover:ring-btn-secondary-stroke-hover active:ring-btn-secondary-stroke-pressed disabled:ring-btn-secondary-stroke-disabled",
|
|
14
|
+
"bg-btn-secondary-surface-default hover:bg-btn-secondary-surface-hover active:bg-btn-secondary-surface-pressed disabled:bg-btn-secondary-surface-disabled"
|
|
15
|
+
],
|
|
16
|
+
ghost: [
|
|
17
|
+
"hover:text-text-neutral-secondary active:text-text-neutral-muted disabled:text-text-neutral-muted"
|
|
18
|
+
]
|
|
14
19
|
},
|
|
15
20
|
shade: {
|
|
16
|
-
brand: "
|
|
17
|
-
neutral: "
|
|
18
|
-
danger: "
|
|
19
|
-
neutralGhost: "border-none text-text-neutral-primary hover:text-text-neutral-secondary active:text-text-neutral-muted disabled:text-text-neutral-muted"
|
|
21
|
+
brand: "",
|
|
22
|
+
neutral: "",
|
|
23
|
+
danger: ""
|
|
20
24
|
},
|
|
21
25
|
size: {
|
|
22
|
-
large: "gap-1",
|
|
23
|
-
|
|
26
|
+
large: "gap-1.5 p-2.5 h-8.5",
|
|
27
|
+
medium: "gap-1 p-2 h-7.5",
|
|
28
|
+
small: "gap-0.5 p-1.5 h-6.5"
|
|
24
29
|
},
|
|
25
30
|
iconOnly: {
|
|
26
31
|
true: "[&>span]:m-0"
|
|
@@ -28,89 +33,84 @@ const z = O(
|
|
|
28
33
|
},
|
|
29
34
|
compoundVariants: [
|
|
30
35
|
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class: "
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
iconOnly: !0,
|
|
37
|
-
size: "small",
|
|
38
|
-
class: "p-1.5 h-6.5"
|
|
36
|
+
variant: "filled",
|
|
37
|
+
shade: "brand",
|
|
38
|
+
class: "bg-btn-primary-brand-surface-default hover:bg-btn-primary-brand-surface-hover active:bg-btn-primary-brand-surface-pressed disabled:bg-btn-primary-brand-surface-disabled ring-[0.5px] ring-btn-primary-brand-stroke-default hover:ring-btn-primary-brand-stroke-hover active:ring-btn-primary-brand-stroke-pressed disabled:ring-btn-primary-brand-stroke-disabled text-text-inverted-primary disabled:text-text-neutral-muted"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
class: "
|
|
41
|
+
variant: "filled",
|
|
42
|
+
shade: "neutral",
|
|
43
|
+
class: "bg-btn-primary-neutral-surface-default hover:bg-btn-primary-neutral-surface-hover active:bg-btn-primary-neutral-surface-pressed disabled:bg-btn-primary-neutral-surface-disabled ring-[0.5px] ring-btn-primary-neutral-stroke-default hover:ring-btn-primary-neutral-stroke-hover active:ring-btn-primary-neutral-stroke-pressed disabled:ring-btn-primary-neutral-stroke-disabled text-text-inverted-primary disabled:text-text-neutral-muted"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
class: "
|
|
46
|
+
variant: "filled",
|
|
47
|
+
shade: "danger",
|
|
48
|
+
class: "bg-btn-primary-danger-surface-default hover:bg-btn-primary-danger-surface-hover active:bg-btn-primary-danger-surface-pressed disabled:bg-btn-primary-danger-surface-disabled ring-[0.5px] ring-btn-primary-danger-stroke-default hover:ring-btn-primary-danger-stroke-hover active:ring-btn-primary-danger-stroke-pressed disabled:ring-btn-primary-danger-stroke-disabled text-text-inverted-primary disabled:text-text-neutral-muted"
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
variant: "stroke",
|
|
52
52
|
shade: "neutral",
|
|
53
|
-
class: "
|
|
53
|
+
class: "text-text-neutral-primary disabled:text-text-neutral-muted"
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
variant: "stroke",
|
|
57
|
-
shade: "
|
|
58
|
-
class: "
|
|
57
|
+
shade: "brand",
|
|
58
|
+
class: "text-text-brand-secondary disabled:text-text-neutral-muted"
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
variant: "stroke",
|
|
62
|
-
shade: "
|
|
63
|
-
class: "
|
|
62
|
+
shade: "danger",
|
|
63
|
+
class: "text-text-danger-secondary disabled:text-text-neutral-muted"
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
variant: "ghost",
|
|
67
67
|
shade: "neutral",
|
|
68
|
-
class: "
|
|
68
|
+
class: "text-text-neutral-primary"
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
variant: "ghost",
|
|
72
72
|
shade: "brand",
|
|
73
|
-
class: "
|
|
73
|
+
class: "text-text-brand-secondary"
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
variant: "ghost",
|
|
77
77
|
shade: "danger",
|
|
78
|
-
class: "
|
|
78
|
+
class: "text-text-danger-secondary"
|
|
79
79
|
}
|
|
80
80
|
],
|
|
81
81
|
defaultVariants: {
|
|
82
82
|
variant: "filled",
|
|
83
83
|
shade: "neutral",
|
|
84
|
-
size: "
|
|
84
|
+
size: "medium",
|
|
85
85
|
iconOnly: !1
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
),
|
|
88
|
+
), O = k.forwardRef(
|
|
89
89
|
({
|
|
90
|
-
className:
|
|
91
|
-
shade:
|
|
90
|
+
className: b,
|
|
91
|
+
shade: u = "neutral",
|
|
92
92
|
size: c,
|
|
93
|
-
variant:
|
|
94
|
-
asChild:
|
|
95
|
-
leftIcon:
|
|
96
|
-
rightIcon:
|
|
97
|
-
label:
|
|
98
|
-
children:
|
|
99
|
-
...
|
|
93
|
+
variant: m = "filled",
|
|
94
|
+
asChild: i = !1,
|
|
95
|
+
leftIcon: r,
|
|
96
|
+
rightIcon: t,
|
|
97
|
+
label: p,
|
|
98
|
+
children: l,
|
|
99
|
+
...g
|
|
100
100
|
}, y) => {
|
|
101
|
-
const f =
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
const f = i ? w : "button", a = p || l, n = !a && !!(r || t), o = n ? r || t : null, v = d(
|
|
102
|
+
C({ shade: u, size: c, variant: m, iconOnly: n }),
|
|
103
|
+
b
|
|
104
104
|
), s = "w-3.5 h-3.5 min-w-max";
|
|
105
|
-
return /* @__PURE__ */ e(f, { className:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
return /* @__PURE__ */ e(f, { className: v, ref: y, ...g, children: i ? l : n ? o ? /* @__PURE__ */ e("span", { className: s, children: o }) : null : /* @__PURE__ */ x(h, { children: [
|
|
106
|
+
r && /* @__PURE__ */ e("span", { className: d(s), children: r }),
|
|
107
|
+
a && /* @__PURE__ */ e("span", { children: a }),
|
|
108
|
+
t && /* @__PURE__ */ e("span", { className: d(s), children: t })
|
|
109
109
|
] }) });
|
|
110
110
|
}
|
|
111
111
|
);
|
|
112
|
-
|
|
112
|
+
O.displayName = "Button";
|
|
113
113
|
export {
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
O as Button,
|
|
115
|
+
C as buttonVariants
|
|
116
116
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
|
-
import { cn as
|
|
3
|
+
import { cn as h } from "../../lib/utils.js";
|
|
4
4
|
import { useZ2SideNavBar as C } from "./context.js";
|
|
5
5
|
import x from "../assets/icons/window-left-copy.js";
|
|
6
6
|
import { Button as v } from "../button/button.js";
|
|
7
7
|
const w = n.forwardRef(
|
|
8
8
|
({
|
|
9
9
|
className: o,
|
|
10
|
-
children:
|
|
10
|
+
children: r,
|
|
11
11
|
showCollapseButton: g = !0,
|
|
12
|
-
icon:
|
|
12
|
+
icon: s,
|
|
13
13
|
title: a,
|
|
14
14
|
forceMultiLine: d = !1,
|
|
15
15
|
...c
|
|
16
16
|
}, m) => {
|
|
17
|
-
const { toggleCollapsed: f, isCollapsed: i } = C(), [y, u] = n.useState(d),
|
|
17
|
+
const { toggleCollapsed: f, isCollapsed: i } = C(), [y, u] = n.useState(d), p = n.useRef(null), b = y || !!r;
|
|
18
18
|
return n.useEffect(() => {
|
|
19
19
|
if (d) {
|
|
20
20
|
u(!0);
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
if (
|
|
23
|
+
if (p.current && !i && a) {
|
|
24
24
|
const t = document.createElement("span");
|
|
25
25
|
t.style.visibility = "hidden", t.style.position = "absolute", t.style.whiteSpace = "nowrap", t.style.fontSize = "14px", t.style.fontWeight = "450", t.textContent = a, document.body.appendChild(t);
|
|
26
26
|
const N = t.offsetWidth;
|
|
@@ -30,7 +30,7 @@ const w = n.forwardRef(
|
|
|
30
30
|
"div",
|
|
31
31
|
{
|
|
32
32
|
ref: m,
|
|
33
|
-
className:
|
|
33
|
+
className: h(
|
|
34
34
|
"flex flex-col items-center gap-1.5 self-stretch border-b border-gray-200 p-2",
|
|
35
35
|
o
|
|
36
36
|
),
|
|
@@ -39,7 +39,7 @@ const w = n.forwardRef(
|
|
|
39
39
|
v,
|
|
40
40
|
{
|
|
41
41
|
variant: "ghost",
|
|
42
|
-
shade: "
|
|
42
|
+
shade: "neutral",
|
|
43
43
|
size: "small",
|
|
44
44
|
onClick: f,
|
|
45
45
|
title: "Collapse sidebar",
|
|
@@ -51,19 +51,19 @@ const w = n.forwardRef(
|
|
|
51
51
|
"div",
|
|
52
52
|
{
|
|
53
53
|
ref: m,
|
|
54
|
-
className:
|
|
54
|
+
className: h(
|
|
55
55
|
"flex flex-col items-start gap-5 self-stretch border-b border-gray-100 w-60 px-2.5 py-4 pl-4 relative",
|
|
56
56
|
o
|
|
57
57
|
),
|
|
58
58
|
...c,
|
|
59
59
|
children: [
|
|
60
60
|
/* @__PURE__ */ l("div", { className: "header-icons-container flex justify-between items-center self-stretch relative", children: [
|
|
61
|
-
|
|
61
|
+
s && /* @__PURE__ */ e("div", { className: "database-icon-container flex p-1.5 justify-center items-center gap-1 rounded-lg bg-gray-50 relative", children: /* @__PURE__ */ e("div", { className: "w-3.5 h-3.5 aspect-square relative", children: s }) }),
|
|
62
62
|
g && /* @__PURE__ */ e(
|
|
63
63
|
v,
|
|
64
64
|
{
|
|
65
65
|
variant: "ghost",
|
|
66
|
-
shade: "
|
|
66
|
+
shade: "neutral",
|
|
67
67
|
size: "small",
|
|
68
68
|
onClick: f,
|
|
69
69
|
title: "Collapse sidebar",
|
|
@@ -76,9 +76,9 @@ const w = n.forwardRef(
|
|
|
76
76
|
/* @__PURE__ */ e(
|
|
77
77
|
"div",
|
|
78
78
|
{
|
|
79
|
-
ref:
|
|
79
|
+
ref: p,
|
|
80
80
|
className: "secondary-text line-clamp-1 self-stretch overflow-hidden text-gray-600 text-ellipsis text-sm font-normal leading-none tracking-tight relative",
|
|
81
|
-
children:
|
|
81
|
+
children: r
|
|
82
82
|
}
|
|
83
83
|
)
|
|
84
84
|
] })
|
|
@@ -88,21 +88,21 @@ const w = n.forwardRef(
|
|
|
88
88
|
"div",
|
|
89
89
|
{
|
|
90
90
|
ref: m,
|
|
91
|
-
className:
|
|
91
|
+
className: h(
|
|
92
92
|
"flex items-center gap-2.5 border-b header-default-layout w-full pr-2.5 pl-3 py-2.5 stroke-solid-light relative",
|
|
93
93
|
o
|
|
94
94
|
),
|
|
95
95
|
...c,
|
|
96
96
|
children: [
|
|
97
|
-
|
|
97
|
+
s && /* @__PURE__ */ e("div", { className: "icon-container flex p-1.5 justify-center items-center gap-1 rounded-lg bg-gray-50 relative", children: /* @__PURE__ */ e("div", { className: "w-3.5 h-3.5 aspect-square relative", children: s }) }),
|
|
98
98
|
/* @__PURE__ */ l(
|
|
99
99
|
"div",
|
|
100
100
|
{
|
|
101
|
-
ref:
|
|
101
|
+
ref: p,
|
|
102
102
|
className: "text-content flex flex-col items-start gap-2.5 flex-1 relative",
|
|
103
103
|
children: [
|
|
104
104
|
/* @__PURE__ */ e("div", { className: "leading-none-medium-sm text-neutral-primary", children: a }),
|
|
105
|
-
|
|
105
|
+
r && /* @__PURE__ */ e("div", { className: "secondary-text line-clamp-1 self-stretch overflow-hidden text-(--color-neutral-600) text-ellipsis text-xs font-normal leading-none tracking-tight relative", children: r })
|
|
106
106
|
]
|
|
107
107
|
}
|
|
108
108
|
),
|
|
@@ -110,7 +110,7 @@ const w = n.forwardRef(
|
|
|
110
110
|
v,
|
|
111
111
|
{
|
|
112
112
|
variant: "ghost",
|
|
113
|
-
shade: "
|
|
113
|
+
shade: "neutral",
|
|
114
114
|
size: "small",
|
|
115
115
|
onClick: f,
|
|
116
116
|
title: "Collapse sidebar",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
export interface NavItemProps extends ButtonProps {
|
|
2
|
+
export interface NavItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
3
|
isActive?: boolean;
|
|
4
|
+
leftIcon?: React.ReactNode;
|
|
5
|
+
rightIcon?: React.ReactNode;
|
|
6
|
+
label?: string;
|
|
5
7
|
}
|
|
6
8
|
export declare const NavItem: React.ForwardRefExoticComponent<NavItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import u from "react";
|
|
3
|
+
import { cn as f } from "../../../lib/utils.js";
|
|
4
|
+
const p = u.forwardRef(
|
|
5
|
+
({ leftIcon: n, label: o, rightIcon: r, className: t, isActive: a, children: l, ...c }, d) => {
|
|
6
|
+
const i = o ?? l, s = "w-3.5 h-3.5 min-w-max";
|
|
7
|
+
return /* @__PURE__ */ m(
|
|
8
|
+
"button",
|
|
9
|
+
{
|
|
10
|
+
ref: d,
|
|
11
|
+
className: f(
|
|
12
|
+
"h-7.5 inline-flex items-center justify-center p-2 gap-1 rounded-lg",
|
|
13
|
+
"hover:bg-background-inverted-elevated text-inverted-primary",
|
|
14
|
+
"leading-none-medium-sm",
|
|
15
|
+
"select-none hover:cursor-pointer disabled:cursor-not-allowed focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring-default",
|
|
16
|
+
a && "bg-background-inverted-elevated",
|
|
17
|
+
t
|
|
18
|
+
),
|
|
19
|
+
...c,
|
|
20
|
+
children: [
|
|
21
|
+
n && /* @__PURE__ */ e("span", { className: s, children: n }),
|
|
22
|
+
i && /* @__PURE__ */ e("span", { children: i }),
|
|
23
|
+
r && /* @__PURE__ */ e("span", { className: s, children: r })
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
27
28
|
);
|
|
28
|
-
|
|
29
|
+
p.displayName = "NavItem";
|
|
29
30
|
export {
|
|
30
|
-
|
|
31
|
+
p as NavItem
|
|
31
32
|
};
|