@ztwoint/z-ui 0.1.8 → 0.1.10
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/chevron-down.d.ts +7 -0
- package/dist/components/assets/icons/chevron-down.js +20 -0
- package/dist/components/assets/icons/chevron-up-icon.d.ts +7 -0
- package/dist/components/assets/icons/chevron-up-icon.js +22 -0
- package/dist/components/assets/icons/circles-icon.d.ts +8 -0
- package/dist/components/assets/icons/circles-icon.js +58 -0
- package/dist/components/assets/icons/database-copy.d.ts +7 -0
- package/dist/components/assets/icons/database-copy.js +49 -0
- package/dist/components/assets/icons/home.d.ts +6 -0
- package/dist/components/assets/icons/sidebar-left-show-copy.d.ts +7 -0
- package/dist/components/assets/icons/sidebar-left-show-copy.js +46 -0
- package/dist/components/assets/icons/sub-nav-indicator.d.ts +7 -0
- package/dist/components/assets/icons/sub-nav-indicator.js +48 -0
- package/dist/components/assets/icons/window-left-copy.d.ts +7 -0
- package/dist/components/assets/icons/window-left-copy.js +38 -0
- package/dist/components/assets/icons/z2-icon.d.ts +8 -0
- package/dist/components/assets/icons/z2-icon.js +17 -0
- package/dist/components/button/__tests__/Button.test.d.ts +1 -0
- package/dist/components/button/button.d.ts +16 -0
- package/dist/components/button/button.js +100 -0
- package/dist/components/button/button.stories.d.ts +26 -0
- package/dist/components/collapsible-side-nav-bar/constants.d.ts +2 -0
- package/dist/components/collapsible-side-nav-bar/constants.js +5 -0
- package/dist/components/collapsible-side-nav-bar/context.d.ts +4 -0
- package/dist/components/collapsible-side-nav-bar/context.js +11 -0
- package/dist/components/collapsible-side-nav-bar/index.d.ts +18 -0
- package/dist/components/collapsible-side-nav-bar/popover/index.d.ts +3 -0
- package/dist/components/collapsible-side-nav-bar/popover/popover-content.d.ts +3 -0
- package/dist/components/collapsible-side-nav-bar/popover/popover-content.js +97 -0
- package/dist/components/collapsible-side-nav-bar/popover/popover-trigger.d.ts +3 -0
- package/dist/components/collapsible-side-nav-bar/popover/popover-trigger.js +13 -0
- package/dist/components/collapsible-side-nav-bar/popover/popover.d.ts +9 -0
- package/dist/components/collapsible-side-nav-bar/popover/popover.js +45 -0
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-content.d.ts +3 -0
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-content.js +34 -0
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-footer.d.ts +3 -0
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-footer.js +25 -0
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-group.d.ts +3 -0
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-group.js +25 -0
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-header.d.ts +3 -0
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-header.js +122 -0
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-item.d.ts +3 -0
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-item.js +176 -0
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-provider.d.ts +3 -0
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-provider.js +39 -0
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-separator.d.ts +3 -0
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-separator.js +10 -0
- package/dist/components/collapsible-side-nav-bar/side-nav-bar.d.ts +7 -0
- package/dist/components/collapsible-side-nav-bar/side-nav-bar.js +42 -0
- package/dist/components/collapsible-side-nav-bar/side-nav-bar.stories.d.ts +6 -0
- package/dist/components/collapsible-side-nav-bar/types.d.ts +84 -0
- package/dist/components/country-flags/__tests__/country-flags.test.d.ts +1 -0
- package/dist/components/country-flags/country-flags.d.ts +8 -0
- package/dist/components/country-flags/country-flags.js +34 -0
- package/dist/components/country-flags/country-flags.stories.d.ts +11 -0
- package/dist/components/input/__tests__/Input.test.d.ts +1 -0
- package/dist/components/input/input.d.ts +2 -0
- package/dist/components/input/input.js +11 -0
- package/dist/components/nav-header/index.d.ts +2 -0
- package/dist/components/nav-header/nav-header.d.ts +18 -0
- package/dist/components/nav-header/nav-header.js +40 -0
- package/dist/components/nav-header/nav-header.stories.d.ts +7 -0
- package/dist/components/nav-header/nav-item/nav-item.d.ts +6 -0
- package/dist/components/nav-header/nav-item/nav-item.js +31 -0
- package/dist/components/nav-header/nav-item/nav-item.stories.d.ts +12 -0
- package/dist/components/tab/__tests__/tab.test.d.ts +1 -0
- package/dist/components/tab/tab.d.ts +10 -0
- package/dist/components/tab/tab.js +80 -0
- package/dist/components/tab/tab.stories.d.ts +16 -0
- package/dist/components/tooltip/tooltip.d.ts +21 -0
- package/dist/components/tooltip/tooltip.js +32 -0
- package/dist/components/tooltip/tooltip.stories.d.ts +10 -0
- package/dist/css/config/colors/components/button.css +2 -2
- package/dist/css/styles/tailwind.css +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +61 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +8 -0
- package/dist/main.d.ts +0 -0
- package/dist/test/setup.d.ts +0 -0
- package/dist/test/test-utils.d.ts +5 -0
- package/dist/tokens/typography/typography.stories.d.ts +12 -0
- package/dist/types/components/assets/icons/chevron-down.d.ts +7 -0
- package/dist/types/components/assets/icons/chevron-up-icon.d.ts +7 -0
- package/dist/types/components/assets/icons/circles-icon.d.ts +8 -0
- package/dist/types/components/assets/icons/database-copy.d.ts +7 -0
- package/dist/types/components/assets/icons/home.d.ts +6 -0
- package/dist/types/components/assets/icons/sidebar-left-show-copy.d.ts +7 -0
- package/dist/types/components/assets/icons/sub-nav-indicator.d.ts +7 -0
- package/dist/types/components/assets/icons/window-left-copy.d.ts +7 -0
- package/dist/types/components/assets/icons/z2-icon.d.ts +8 -0
- package/dist/types/components/button/__tests__/Button.test.d.ts +1 -0
- package/dist/types/components/button/button.d.ts +16 -0
- package/dist/types/components/button/button.stories.d.ts +26 -0
- package/dist/types/components/collapsible-side-nav-bar/constants.d.ts +2 -0
- package/dist/types/components/collapsible-side-nav-bar/context.d.ts +4 -0
- package/dist/types/components/collapsible-side-nav-bar/index.d.ts +18 -0
- package/dist/types/components/collapsible-side-nav-bar/popover/index.d.ts +3 -0
- package/dist/types/components/collapsible-side-nav-bar/popover/popover-content.d.ts +3 -0
- package/dist/types/components/collapsible-side-nav-bar/popover/popover-trigger.d.ts +3 -0
- package/dist/types/components/collapsible-side-nav-bar/popover/popover.d.ts +9 -0
- package/dist/types/components/collapsible-side-nav-bar/side-nav-bar-content.d.ts +3 -0
- package/dist/types/components/collapsible-side-nav-bar/side-nav-bar-footer.d.ts +3 -0
- package/dist/types/components/collapsible-side-nav-bar/side-nav-bar-group.d.ts +3 -0
- package/dist/types/components/collapsible-side-nav-bar/side-nav-bar-header.d.ts +3 -0
- package/dist/types/components/collapsible-side-nav-bar/side-nav-bar-item.d.ts +3 -0
- package/dist/types/components/collapsible-side-nav-bar/side-nav-bar-provider.d.ts +3 -0
- package/dist/types/components/collapsible-side-nav-bar/side-nav-bar-separator.d.ts +3 -0
- package/dist/types/components/collapsible-side-nav-bar/side-nav-bar.d.ts +7 -0
- package/dist/types/components/collapsible-side-nav-bar/side-nav-bar.stories.d.ts +6 -0
- package/dist/types/components/collapsible-side-nav-bar/types.d.ts +84 -0
- package/dist/types/components/country-flags/__tests__/country-flags.test.d.ts +1 -0
- package/dist/types/components/country-flags/country-flags.d.ts +8 -0
- package/dist/types/components/country-flags/country-flags.stories.d.ts +11 -0
- package/dist/types/components/input/__tests__/Input.test.d.ts +1 -0
- package/dist/types/components/input/input.d.ts +2 -0
- package/dist/types/components/nav-header/index.d.ts +2 -0
- package/dist/types/components/nav-header/nav-header.d.ts +18 -0
- package/dist/types/components/nav-header/nav-header.stories.d.ts +7 -0
- package/dist/types/components/nav-header/nav-item/nav-item.d.ts +6 -0
- package/dist/types/components/nav-header/nav-item/nav-item.stories.d.ts +12 -0
- package/dist/types/components/tab/__tests__/tab.test.d.ts +1 -0
- package/dist/types/components/tab/tab.d.ts +10 -0
- package/dist/types/components/tab/tab.stories.d.ts +16 -0
- package/dist/types/components/tooltip/tooltip.d.ts +21 -0
- package/dist/types/components/tooltip/tooltip.stories.d.ts +10 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/types/main.d.ts +1 -0
- package/dist/types/test/setup.d.ts +1 -0
- package/dist/types/test/test-utils.d.ts +5 -0
- package/dist/types/tokens/typography/typography.stories.d.ts +12 -0
- package/package.json +2 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { cva as n } from "class-variance-authority";
|
|
4
|
+
import { cn as u } from "../../lib/utils.js";
|
|
5
|
+
import { useZ2SideNavBar as m } from "./context.js";
|
|
6
|
+
const p = n(
|
|
7
|
+
"relative flex flex-col h-full bg-white border-r border-gray-200 transition-all duration-300 ease-in-out",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "h-full",
|
|
12
|
+
floating: "h-full rounded-lg shadow-lg",
|
|
13
|
+
inset: "h-full border-l-0 border-r-0"
|
|
14
|
+
},
|
|
15
|
+
side: {
|
|
16
|
+
left: "left-0",
|
|
17
|
+
right: "right-0"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
variant: "default",
|
|
22
|
+
side: "left"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
), c = f.forwardRef(
|
|
26
|
+
({ className: a, variant: e, side: t, children: i, ...l }, o) => {
|
|
27
|
+
const { isCollapsed: r } = m(), s = u(
|
|
28
|
+
p({ variant: e, side: t }),
|
|
29
|
+
{
|
|
30
|
+
"w-42px": r,
|
|
31
|
+
"w-240px": !r
|
|
32
|
+
},
|
|
33
|
+
a
|
|
34
|
+
);
|
|
35
|
+
return /* @__PURE__ */ d("div", { ref: o, "data-sidebar": !0, className: s, ...l, children: i });
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
c.displayName = "Z2SideNavBar";
|
|
39
|
+
export {
|
|
40
|
+
c as Z2SideNavBar,
|
|
41
|
+
p as Z2SidebarVariants
|
|
42
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface Z2SideNavBarContextType {
|
|
3
|
+
isCollapsed: boolean;
|
|
4
|
+
toggleCollapsed: () => void;
|
|
5
|
+
}
|
|
6
|
+
export interface Z2SideNavBarProviderProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
defaultCollapsed?: boolean;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface Z2SideNavBarProps {
|
|
13
|
+
className?: string;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
variant?: 'default' | 'floating' | 'inset';
|
|
16
|
+
side?: 'left' | 'right';
|
|
17
|
+
}
|
|
18
|
+
export interface Z2SideNavBarHeaderProps {
|
|
19
|
+
className?: string;
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
showCollapseButton?: boolean;
|
|
22
|
+
icon?: React.ReactNode;
|
|
23
|
+
title?: string;
|
|
24
|
+
forceMultiLine?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface Z2SideNavBarContentProps {
|
|
27
|
+
className?: string;
|
|
28
|
+
children?: React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
export interface Z2SideNavBarFooterProps {
|
|
31
|
+
className?: string;
|
|
32
|
+
children?: React.ReactNode;
|
|
33
|
+
}
|
|
34
|
+
export interface Z2SideNavBarGroupProps {
|
|
35
|
+
className?: string;
|
|
36
|
+
children?: React.ReactNode;
|
|
37
|
+
title?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface Z2SubNavItem {
|
|
40
|
+
id: string;
|
|
41
|
+
label: string;
|
|
42
|
+
href?: string;
|
|
43
|
+
onClick?: () => void;
|
|
44
|
+
icon?: React.ReactNode;
|
|
45
|
+
isActive?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface Z2SideNavBarItemProps {
|
|
48
|
+
className?: string;
|
|
49
|
+
children?: React.ReactNode;
|
|
50
|
+
icon?: React.ReactNode;
|
|
51
|
+
label?: string;
|
|
52
|
+
href?: string;
|
|
53
|
+
isActive?: boolean;
|
|
54
|
+
onClick?: () => void;
|
|
55
|
+
tooltip?: string;
|
|
56
|
+
subItems?: Z2SubNavItem[];
|
|
57
|
+
}
|
|
58
|
+
export interface Z2SideNavBarSeparatorProps {
|
|
59
|
+
className?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface Z2PopoverContextType {
|
|
62
|
+
isOpen: boolean;
|
|
63
|
+
setIsOpen: (open: boolean) => void;
|
|
64
|
+
triggerId: string;
|
|
65
|
+
cancelClose?: () => void;
|
|
66
|
+
scheduleClose?: () => void;
|
|
67
|
+
}
|
|
68
|
+
export interface Z2PopoverProps {
|
|
69
|
+
children: React.ReactNode;
|
|
70
|
+
delayDuration?: number;
|
|
71
|
+
}
|
|
72
|
+
export interface Z2PopoverTriggerProps {
|
|
73
|
+
children: React.ReactNode;
|
|
74
|
+
asChild?: boolean;
|
|
75
|
+
}
|
|
76
|
+
export interface Z2PopoverContentProps {
|
|
77
|
+
children: React.ReactNode;
|
|
78
|
+
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
79
|
+
className?: string;
|
|
80
|
+
}
|
|
81
|
+
export interface Z2IconProps {
|
|
82
|
+
className?: string;
|
|
83
|
+
style?: React.CSSProperties;
|
|
84
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as ReactCountryFlag } from 'react-country-flag';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
interface CountryFlagsProps extends Omit<ComponentProps<typeof ReactCountryFlag>, 'countryCode'> {
|
|
4
|
+
countryCode?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const CountryFlags: ({ countryCode, className, ...props }: CountryFlagsProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import a from "react-country-flag";
|
|
3
|
+
import n from "classnames";
|
|
4
|
+
const d = ({
|
|
5
|
+
countryCode: e = "US",
|
|
6
|
+
className: s = "",
|
|
7
|
+
...t
|
|
8
|
+
}) => {
|
|
9
|
+
const r = s.includes("w-"), l = s.includes("h-");
|
|
10
|
+
return /* @__PURE__ */ o(
|
|
11
|
+
a,
|
|
12
|
+
{
|
|
13
|
+
svg: !0,
|
|
14
|
+
countryCode: e,
|
|
15
|
+
...t,
|
|
16
|
+
style: {
|
|
17
|
+
width: "auto",
|
|
18
|
+
height: "revert-layer",
|
|
19
|
+
...t.style
|
|
20
|
+
},
|
|
21
|
+
className: n(
|
|
22
|
+
"inline-block rounded-full object-cover aspect-square brightness-97",
|
|
23
|
+
{
|
|
24
|
+
"w-10": !r,
|
|
25
|
+
"h-10": !l
|
|
26
|
+
},
|
|
27
|
+
s
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
d as CountryFlags
|
|
34
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { CountryFlags } from './country-flags';
|
|
3
|
+
declare const meta: Meta<typeof CountryFlags>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof CountryFlags>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const CustomSize: Story;
|
|
8
|
+
export declare const SmallFlag: Story;
|
|
9
|
+
export declare const LargeFlag: Story;
|
|
10
|
+
export declare const CustomStyling: Story;
|
|
11
|
+
export declare const DifferentCountries: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
const e = (r) => /* @__PURE__ */ o(
|
|
3
|
+
"input",
|
|
4
|
+
{
|
|
5
|
+
className: "border border-gray-300 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",
|
|
6
|
+
...r
|
|
7
|
+
}
|
|
8
|
+
);
|
|
9
|
+
export {
|
|
10
|
+
e as Input
|
|
11
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { NavItemProps } from './nav-item/nav-item';
|
|
3
|
+
export type { NavItemProps } from './nav-item/nav-item';
|
|
4
|
+
export declare const NavHeader: {
|
|
5
|
+
Root: {
|
|
6
|
+
({ className, children, ...props }: React.HTMLAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
List: {
|
|
10
|
+
({ className, children, ...props }: React.HTMLAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
Item: {
|
|
14
|
+
({ className, ...props }: NavItemProps & React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default NavHeader;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as d } from "react";
|
|
3
|
+
import n from "../assets/icons/z2-icon.js";
|
|
4
|
+
import { cn as s } from "../../lib/utils.js";
|
|
5
|
+
import { NavItem as c } from "./nav-item/nav-item.js";
|
|
6
|
+
const N = d({}), i = ({ className: a, children: r, ...t }) => /* @__PURE__ */ e(N.Provider, { value: {}, children: /* @__PURE__ */ l(
|
|
7
|
+
"header",
|
|
8
|
+
{
|
|
9
|
+
className: s(
|
|
10
|
+
"flex items-center h-14 p-3",
|
|
11
|
+
"gap-6",
|
|
12
|
+
// space between icon/separator/list
|
|
13
|
+
"bg-[#001534]",
|
|
14
|
+
a
|
|
15
|
+
),
|
|
16
|
+
...t,
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ e("div", { className: "flex items-center flex-shrink-0", children: /* @__PURE__ */ e(n, { className: "shrink-0" }) }),
|
|
19
|
+
/* @__PURE__ */ e("div", { className: "h-4 w-px bg-white/20", "aria-hidden": "true" }),
|
|
20
|
+
/* @__PURE__ */ e("div", { className: "flex-1 flex items-center min-w-0", children: r })
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
) });
|
|
24
|
+
i.displayName = "NavHeader.Root";
|
|
25
|
+
const m = ({ className: a, children: r, ...t }) => /* @__PURE__ */ e("nav", { className: s("flex flex-row gap-2 ml-0", a), ...t, children: r });
|
|
26
|
+
m.displayName = "NavHeader.List";
|
|
27
|
+
const o = ({
|
|
28
|
+
className: a,
|
|
29
|
+
...r
|
|
30
|
+
}) => /* @__PURE__ */ e("div", { className: s("list-none", a), children: /* @__PURE__ */ e(c, { ...r }) });
|
|
31
|
+
o.displayName = "NavHeader.Item";
|
|
32
|
+
const H = {
|
|
33
|
+
Root: i,
|
|
34
|
+
List: m,
|
|
35
|
+
Item: o
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
H as NavHeader,
|
|
39
|
+
H as default
|
|
40
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { NavHeader } from './nav-header';
|
|
3
|
+
declare const meta: Meta<typeof NavHeader.Root>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof NavHeader.Root>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithTwoActiveItem: Story;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ButtonProps } from '../../button/button';
|
|
3
|
+
export interface NavItemProps extends ButtonProps {
|
|
4
|
+
isActive?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const NavItem: React.ForwardRefExoticComponent<NavItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import c from "react";
|
|
3
|
+
import { Button as i } from "../../button/button.js";
|
|
4
|
+
import { cn as v } from "../../../lib/utils.js";
|
|
5
|
+
const d = c.forwardRef(
|
|
6
|
+
({ leftIcon: t, label: r, rightIcon: a, onClick: o, className: l, isActive: m, asChild: e, children: n, ...s }, u) => /* @__PURE__ */ f(
|
|
7
|
+
i,
|
|
8
|
+
{
|
|
9
|
+
variant: "ghost",
|
|
10
|
+
shade: "neutralGhost",
|
|
11
|
+
size: "large",
|
|
12
|
+
leftIcon: t,
|
|
13
|
+
rightIcon: a,
|
|
14
|
+
label: r,
|
|
15
|
+
onClick: o,
|
|
16
|
+
className: v(
|
|
17
|
+
"text-inverted hover:surface-neutral-elevated active:surface-neutral-elevated ",
|
|
18
|
+
m && "surface-neutral-elevated",
|
|
19
|
+
l
|
|
20
|
+
),
|
|
21
|
+
asChild: e,
|
|
22
|
+
...s,
|
|
23
|
+
ref: u,
|
|
24
|
+
children: e ? n : null
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
);
|
|
28
|
+
d.displayName = "NavItem";
|
|
29
|
+
export {
|
|
30
|
+
d as NavItem
|
|
31
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { NavItem } from './nav-item';
|
|
3
|
+
declare const meta: Meta<typeof NavItem>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof NavItem>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const DefaultActive: Story;
|
|
8
|
+
export declare const DefaultDualIcon: Story;
|
|
9
|
+
export declare const DualIconActive: Story;
|
|
10
|
+
export declare const LinkWithLeftIcon: Story;
|
|
11
|
+
export declare const LinkWithBothIcons: Story;
|
|
12
|
+
export declare const LinkActiveAndInactive: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
3
|
+
declare function Z2Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function Z2TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function Z2TabsTrigger({ className, icon, label, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger> & {
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
label?: React.ReactNode;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function Z2TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { Z2Tabs, Z2TabsList, Z2TabsTrigger, Z2TabsContent };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "@radix-ui/react-tabs";
|
|
3
|
+
import { cn as s } from "../../lib/utils.js";
|
|
4
|
+
function o({ className: a, ...t }) {
|
|
5
|
+
return /* @__PURE__ */ e(
|
|
6
|
+
r.Root,
|
|
7
|
+
{
|
|
8
|
+
"data-slot": "tabs",
|
|
9
|
+
className: s(a),
|
|
10
|
+
orientation: "horizontal",
|
|
11
|
+
...t
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
function c({ className: a, ...t }) {
|
|
16
|
+
return /* @__PURE__ */ e(
|
|
17
|
+
r.List,
|
|
18
|
+
{
|
|
19
|
+
"data-slot": "tabs-list",
|
|
20
|
+
className: s(
|
|
21
|
+
"inline-flex items-center bg-transparent relative",
|
|
22
|
+
"w-full h-11",
|
|
23
|
+
"max-lg:w-full max-lg:max-w-[full] max-lg:overflow-x-auto max-lg:overflow-y-hidden",
|
|
24
|
+
"max-sm:w-full max-sm:px-2",
|
|
25
|
+
// 'after:absolute after:bottom-0 after:left-0 after:w-full after:h-0.5 after:bg-neutral-150',
|
|
26
|
+
a
|
|
27
|
+
),
|
|
28
|
+
...t
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
function p({
|
|
33
|
+
className: a,
|
|
34
|
+
icon: t,
|
|
35
|
+
label: i,
|
|
36
|
+
...n
|
|
37
|
+
}) {
|
|
38
|
+
return /* @__PURE__ */ l(
|
|
39
|
+
r.Trigger,
|
|
40
|
+
{
|
|
41
|
+
"data-slot": "tabs-trigger",
|
|
42
|
+
className: s(
|
|
43
|
+
"flex h-11 p-2.5 justify-center items-center gap-1 relative cursor-pointer",
|
|
44
|
+
"max-lg:min-w-fit max-lg:flex-shrink-0",
|
|
45
|
+
"max-sm:px-1.5 max-sm:py-2 max-sm:gap-0.5",
|
|
46
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",
|
|
47
|
+
"group",
|
|
48
|
+
a
|
|
49
|
+
),
|
|
50
|
+
...n,
|
|
51
|
+
children: [
|
|
52
|
+
t && /* @__PURE__ */ e("div", { className: "w-[14px] h-[14px] flex-shrink-0 flex items-center justify-center tab-icon", children: /* @__PURE__ */ e("div", { className: "w-[14px] h-[14px] [&>*]:!w-[14px] [&>*]:!h-[14px]", children: t }) }),
|
|
53
|
+
i && /* @__PURE__ */ e("div", { className: "flex px-0.5 justify-center items-center gap-1.5 max-sm:px-0.25 max-sm:gap-1", children: /* @__PURE__ */ e(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: s(
|
|
57
|
+
"text-center font-[450] transition-colors duration-200 tab-label",
|
|
58
|
+
"text-sm leading-none tracking-[-0.2px]",
|
|
59
|
+
"max-lg:text-[13px]",
|
|
60
|
+
"max-sm:text-xs"
|
|
61
|
+
),
|
|
62
|
+
children: i
|
|
63
|
+
}
|
|
64
|
+
) })
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
function d({
|
|
70
|
+
className: a,
|
|
71
|
+
...t
|
|
72
|
+
}) {
|
|
73
|
+
return /* @__PURE__ */ e(r.Content, { "data-slot": "tabs-content", className: s(a), ...t });
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
o as Z2Tabs,
|
|
77
|
+
d as Z2TabsContent,
|
|
78
|
+
c as Z2TabsList,
|
|
79
|
+
p as Z2TabsTrigger
|
|
80
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Z2Tabs } from './tab';
|
|
3
|
+
declare const meta: Meta<typeof Z2Tabs>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Z2Tabs>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithCustomIcons: Story;
|
|
8
|
+
export declare const FewZ2Tabs: Story;
|
|
9
|
+
export declare const WithDisabledTab: Story;
|
|
10
|
+
export declare const IconOnly: Story;
|
|
11
|
+
export declare const TextOnly: Story;
|
|
12
|
+
export declare const MixedContent: Story;
|
|
13
|
+
export declare const TwoZ2Tabs: Story;
|
|
14
|
+
export declare const LongLabels: Story;
|
|
15
|
+
export declare const ControlledExample: Story;
|
|
16
|
+
export declare const CustomStyling: Story;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RadixTooltip from '@radix-ui/react-tooltip';
|
|
3
|
+
export interface TooltipProps extends Omit<RadixTooltip.TooltipContentProps, 'children' | 'asChild'> {
|
|
4
|
+
/**
|
|
5
|
+
* The content to show inside the tooltip.
|
|
6
|
+
*/
|
|
7
|
+
message: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The element that triggers the tooltip (usually a button, icon, etc).
|
|
10
|
+
*/
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Delay in ms before showing the tooltip (default: 300)
|
|
14
|
+
*/
|
|
15
|
+
delayDuration?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A reusable Tooltip component using Radix Tooltip primitive.
|
|
19
|
+
* Wraps any element as a trigger and shows a message on hover/focus.
|
|
20
|
+
*/
|
|
21
|
+
export declare const Z2Tooltip: React.FC<TooltipProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as o, jsxs as e } from "react/jsx-runtime";
|
|
2
|
+
import * as t from "@radix-ui/react-tooltip";
|
|
3
|
+
import { cn as s } from "../../lib/utils.js";
|
|
4
|
+
const m = ({
|
|
5
|
+
message: a,
|
|
6
|
+
children: r,
|
|
7
|
+
delayDuration: i = 300,
|
|
8
|
+
side: d = "top",
|
|
9
|
+
className: n,
|
|
10
|
+
...l
|
|
11
|
+
}) => /* @__PURE__ */ o(t.Provider, { delayDuration: i, children: /* @__PURE__ */ e(t.Root, { children: [
|
|
12
|
+
/* @__PURE__ */ o(t.Trigger, { asChild: !0, children: r }),
|
|
13
|
+
/* @__PURE__ */ o(t.Portal, { children: /* @__PURE__ */ e(
|
|
14
|
+
t.Content,
|
|
15
|
+
{
|
|
16
|
+
side: d,
|
|
17
|
+
className: s(
|
|
18
|
+
"bg-[var(--color-neutral-950)] border-none text-white leading-none-regular-sm animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-1 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
|
|
19
|
+
n
|
|
20
|
+
),
|
|
21
|
+
...l,
|
|
22
|
+
children: [
|
|
23
|
+
a,
|
|
24
|
+
/* @__PURE__ */ o(t.Arrow, { className: "bg-[var(--color-neutral-950)] z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
) })
|
|
28
|
+
] }) });
|
|
29
|
+
m.displayName = "Z2Tooltip";
|
|
30
|
+
export {
|
|
31
|
+
m as Z2Tooltip
|
|
32
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Z2Tooltip } from './tooltip';
|
|
3
|
+
declare const meta: Meta<typeof Z2Tooltip>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Z2Tooltip>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const IconTrigger: Story;
|
|
8
|
+
export declare const AllSides: Story;
|
|
9
|
+
export declare const CustomStyling: Story;
|
|
10
|
+
export declare const CustomDelay: Story;
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
/* Shadow utility class */
|
|
89
|
-
@utility
|
|
89
|
+
@utility shadow-default {
|
|
90
90
|
box-shadow:
|
|
91
91
|
0px 1px 2px 0px var(--color-alpha-dark-50),
|
|
92
|
-
0px 0px 0px
|
|
92
|
+
0px 0px 0px 0.5px var(--color-neutral-150);
|
|
93
93
|
}
|