trepur_components 2.3.15 → 2.3.17
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/lib/components/Button/Button.stories.d.ts +2 -1
- package/lib/components/Button/index.d.ts +4 -1
- package/lib/components/Button/index.js +25 -21
- package/lib/components/HamburgerIcon/HamburgerIcon.stories.d.ts +2 -0
- package/lib/components/HamburgerIcon/index.js +37 -31
- package/lib/components/Nav/index.js +1 -0
- package/lib/styles/themes/penrithmrt.css +3 -3
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { Button } from './';
|
|
|
3
3
|
|
|
4
4
|
declare const meta: {
|
|
5
5
|
title: string;
|
|
6
|
-
component: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLButtonElement> & import('./').ButtonProps & import('react').RefAttributes<HTMLButtonElement>> & {
|
|
6
|
+
component: import('react').ForwardRefExoticComponent<((import('react').HTMLAttributes<HTMLButtonElement> | import('react').HTMLAttributes<HTMLAnchorElement>) & import('./').ButtonProps) & import('react').RefAttributes<HTMLButtonElement | HTMLAnchorElement>> & {
|
|
7
7
|
Icon: import('react').ForwardRefExoticComponent<{
|
|
8
8
|
icon: any;
|
|
9
9
|
} & import('react').RefAttributes<SVGSVGElement>>;
|
|
@@ -22,3 +22,4 @@ export declare const Secondary: Story;
|
|
|
22
22
|
export declare const Bordered: Story;
|
|
23
23
|
export declare const Ghost: Story;
|
|
24
24
|
export declare const Loading: Story;
|
|
25
|
+
export declare const Link: Story;
|
|
@@ -4,8 +4,11 @@ export interface ButtonProps {
|
|
|
4
4
|
variant?: 'primary' | 'secondary' | 'ghost' | 'bordered';
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
loading?: boolean;
|
|
7
|
+
type?: 'button' | 'link';
|
|
8
|
+
href?: string;
|
|
9
|
+
target?: string;
|
|
7
10
|
}
|
|
8
|
-
declare const Button: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLButtonElement> & ButtonProps & import('react').RefAttributes<HTMLButtonElement>> & {
|
|
11
|
+
declare const Button: import('react').ForwardRefExoticComponent<((HTMLAttributes<HTMLButtonElement> | HTMLAttributes<HTMLAnchorElement>) & ButtonProps) & import('react').RefAttributes<HTMLButtonElement | HTMLAnchorElement>> & {
|
|
9
12
|
Icon: import('react').ForwardRefExoticComponent<{
|
|
10
13
|
icon: any;
|
|
11
14
|
} & import('react').RefAttributes<SVGSVGElement>>;
|
|
@@ -1,43 +1,47 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as b } from "react";
|
|
3
3
|
import { Icon as m } from "../Icon/index.js";
|
|
4
4
|
import s from "clsx";
|
|
5
|
-
const a =
|
|
5
|
+
const g = b(({ children: o, ...e }) => /* @__PURE__ */ r("button", { type: "button", ...e, children: o })), h = b(({ children: o, ...e }) => /* @__PURE__ */ r("div", { className: "inline-block", children: /* @__PURE__ */ r("a", { type: "button", className: "inline-grid", ...e, children: o }) })), a = b(
|
|
6
6
|
({
|
|
7
7
|
className: o,
|
|
8
8
|
children: e,
|
|
9
9
|
loading: t = !1,
|
|
10
|
-
variant:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
variant: n = "primary",
|
|
11
|
+
type: d = "button",
|
|
12
|
+
disabled: l,
|
|
13
|
+
href: p,
|
|
14
|
+
target: i,
|
|
15
|
+
...y
|
|
16
|
+
}) => /* @__PURE__ */ r(
|
|
17
|
+
d === "button" ? g : h,
|
|
15
18
|
{
|
|
19
|
+
href: p,
|
|
20
|
+
target: i,
|
|
16
21
|
disabled: t,
|
|
17
22
|
className: s(
|
|
18
|
-
"flex items-center gap-2 rounded-lg border px-8 py-3 text-center text-lg
|
|
23
|
+
"font-regular flex items-center gap-2 rounded-lg border px-8 py-3 text-center text-lg",
|
|
19
24
|
{
|
|
20
25
|
"duration-200": !t,
|
|
21
|
-
"border-button-primary-border bg-button-primary-bg text-button-primary-text hover:bg-button-primary-hover active:bg-button-primary-active":
|
|
22
|
-
"border-button-secondary-border bg-button-secondary-bg text-button-secondary-text hover:bg-button-secondary-hover active:bg-button-secondary-active":
|
|
23
|
-
"border-button-ghost-border bg-button-ghost-bg text-button-ghost-text hover:bg-button-ghost-hover active:bg-button-ghost-active":
|
|
24
|
-
"border-button-bordered-border text-button-ghost-text hover:bg-button-ghost-hover active:bg-button-ghost-active":
|
|
26
|
+
"border-button-primary-border bg-button-primary-bg text-button-primary-text hover:bg-button-primary-hover active:bg-button-primary-active": n === "primary" && !t,
|
|
27
|
+
"border-button-secondary-border bg-button-secondary-bg text-button-secondary-text hover:bg-button-secondary-hover active:bg-button-secondary-active": n === "secondary" && !t,
|
|
28
|
+
"border-button-ghost-border bg-button-ghost-bg text-button-ghost-text hover:bg-button-ghost-hover active:bg-button-ghost-active": n === "ghost" && !t,
|
|
29
|
+
"border-button-bordered-border text-button-ghost-text hover:bg-button-ghost-hover active:bg-button-ghost-active": n === "bordered" && !t,
|
|
25
30
|
"w-40 animate-pulse border-loading bg-loading": t
|
|
26
31
|
},
|
|
27
32
|
o
|
|
28
33
|
),
|
|
29
|
-
...d,
|
|
30
34
|
children: !t && e
|
|
31
35
|
}
|
|
32
36
|
)
|
|
33
|
-
),
|
|
37
|
+
), c = b(({ className: o, ...e }, t) => /* @__PURE__ */ r("p", { className: s("text-md", o), ref: t, ...e })), u = b(({ icon: o }, e) => /* @__PURE__ */ r(m, { size: "md", ref: e, icon: o }));
|
|
34
38
|
a.displayName = "Button";
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
Icon:
|
|
39
|
-
Label:
|
|
39
|
+
u.displayName = "Button.Icon";
|
|
40
|
+
c.displayName = "Button.Label";
|
|
41
|
+
const I = Object.assign(a, {
|
|
42
|
+
Icon: u,
|
|
43
|
+
Label: c
|
|
40
44
|
});
|
|
41
45
|
export {
|
|
42
|
-
|
|
46
|
+
I as Button
|
|
43
47
|
};
|
|
@@ -1,29 +1,35 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
m(!t), a == null || a(s);
|
|
1
|
+
import { jsx as e, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as p, useState as u } from "react";
|
|
3
|
+
import r from "clsx";
|
|
4
|
+
const s = p(({ className: i, onClick: a, variant: t = "primary" }, l) => {
|
|
5
|
+
const [o, g] = u(!1), m = (n) => {
|
|
6
|
+
g(!o), a == null || a(n);
|
|
8
7
|
};
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
-
|
|
8
|
+
return /* @__PURE__ */ e(
|
|
9
|
+
"button",
|
|
11
10
|
{
|
|
12
|
-
className:
|
|
11
|
+
className: r(
|
|
12
|
+
"h-13 w-13 rounded-xl stroke-white transition-all duration-300 ease-in-out",
|
|
13
|
+
{
|
|
14
|
+
"bg-button-primary-bg hover:bg-button-primary-hover": t === "primary",
|
|
15
|
+
"bg-button-secondary-bg hover:bg-button-secondary-hover": t === "secondary",
|
|
16
|
+
"bg-button-ghost-bg hover:bg-button-ghost-hover": t === "ghost"
|
|
17
|
+
},
|
|
18
|
+
i
|
|
19
|
+
),
|
|
13
20
|
ref: l,
|
|
14
|
-
onClick: (
|
|
15
|
-
|
|
21
|
+
onClick: (n) => {
|
|
22
|
+
m(n);
|
|
16
23
|
},
|
|
17
|
-
|
|
18
|
-
children: /* @__PURE__ */ c(
|
|
24
|
+
children: /* @__PURE__ */ b(
|
|
19
25
|
"svg",
|
|
20
26
|
{
|
|
21
|
-
className:
|
|
27
|
+
className: r(
|
|
22
28
|
"transition-backgroundColor mx-auto transform overflow-visible duration-500",
|
|
23
29
|
{
|
|
24
|
-
"fill-button-primary-text":
|
|
25
|
-
"fill-button-secondary-text":
|
|
26
|
-
"fill-button-ghost-text stroke-button-ghost-text":
|
|
30
|
+
"fill-button-primary-text": t === "primary",
|
|
31
|
+
"fill-button-secondary-text": t === "secondary",
|
|
32
|
+
"fill-button-ghost-text stroke-button-ghost-text": t === "ghost"
|
|
27
33
|
}
|
|
28
34
|
),
|
|
29
35
|
width: "24",
|
|
@@ -31,35 +37,35 @@ const n = g(({ className: i, onClick: a, variant: e = "ghost" }, l) => {
|
|
|
31
37
|
viewBox: "0 0 24 15",
|
|
32
38
|
xmlns: "http://www.w3.org/2000/svg",
|
|
33
39
|
children: [
|
|
34
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ e(
|
|
35
41
|
"path",
|
|
36
42
|
{
|
|
37
|
-
className:
|
|
43
|
+
className: r(
|
|
38
44
|
"origin-top-left transition-transform duration-200 ease-linear",
|
|
39
45
|
{
|
|
40
|
-
"origin-top-left -translate-y-0.5 translate-x-1 rotate-45":
|
|
46
|
+
"origin-top-left -translate-y-0.5 translate-x-1 rotate-45": o
|
|
41
47
|
}
|
|
42
48
|
),
|
|
43
49
|
d: "M0 1.5C0 0.947715 0.447715 0.5 1 0.5H21C21.5523 0.5 22 0.947715 22 1.5C22 2.05228 21.5523 2.5 21 2.5H1C0.447716 2.5 0 2.05228 0 1.5Z"
|
|
44
50
|
}
|
|
45
51
|
),
|
|
46
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ e(
|
|
47
53
|
"path",
|
|
48
54
|
{
|
|
49
|
-
className:
|
|
50
|
-
"opacity-0":
|
|
51
|
-
"opacity-100": !
|
|
55
|
+
className: r("transition-opacity duration-200 ease-linear", {
|
|
56
|
+
"opacity-0": o,
|
|
57
|
+
"opacity-100": !o
|
|
52
58
|
}),
|
|
53
59
|
d: "M0 7.5C0 6.94772 0.447715 6.5 1 6.5H21C21.5523 6.5 22 6.94772 22 7.5C22 8.05228 21.5523 8.5 21 8.5H1C0.447716 8.5 0 8.05228 0 7.5Z"
|
|
54
60
|
}
|
|
55
61
|
),
|
|
56
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ e(
|
|
57
63
|
"path",
|
|
58
64
|
{
|
|
59
|
-
className:
|
|
65
|
+
className: r(
|
|
60
66
|
"origin-bottom-left transition-transform duration-200 ease-linear",
|
|
61
67
|
{
|
|
62
|
-
"origin-bottom-left translate-x-1 translate-y-px -rotate-45":
|
|
68
|
+
"origin-bottom-left translate-x-1 translate-y-px -rotate-45": o
|
|
63
69
|
}
|
|
64
70
|
),
|
|
65
71
|
d: "M0 13.5C0 12.9477 0.447715 12.5 1 12.5H21C21.5523 12.5 22 12.9477 22 13.5C22 14.0523 21.5523 14.5 21 14.5H1C0.447716 14.5 0 14.0523 0 13.5Z"
|
|
@@ -71,8 +77,8 @@ const n = g(({ className: i, onClick: a, variant: e = "ghost" }, l) => {
|
|
|
71
77
|
}
|
|
72
78
|
);
|
|
73
79
|
});
|
|
74
|
-
|
|
75
|
-
const
|
|
80
|
+
s.displayName = "HamburgerIcon";
|
|
81
|
+
const f = Object.assign(s);
|
|
76
82
|
export {
|
|
77
|
-
|
|
83
|
+
f as HamburgerIcon
|
|
78
84
|
};
|
|
@@ -61,9 +61,9 @@ body.theme-penrithmrt {
|
|
|
61
61
|
|
|
62
62
|
--color-button-ghost-active: #242424;
|
|
63
63
|
--color-button-ghost-border: #ffffff00;
|
|
64
|
-
--color-button-ghost-bg: #
|
|
64
|
+
--color-button-ghost-bg: #cbcbcb00;
|
|
65
65
|
--color-button-ghost-text: #3C2F71;
|
|
66
|
-
--color-button-ghost-hover: #
|
|
66
|
+
--color-button-ghost-hover: #c8c7c7;
|
|
67
67
|
|
|
68
68
|
--color-button-bordered-active: #242424;
|
|
69
69
|
--color-button-bordered-border: #9d9d9d;
|
|
@@ -97,6 +97,6 @@ body.theme-penrithmrt {
|
|
|
97
97
|
|
|
98
98
|
/* Nav */
|
|
99
99
|
--color-nav-bg: #f3f4f6;
|
|
100
|
-
--color-nav-shadow-bg: #
|
|
100
|
+
--color-nav-shadow-bg: #d1d5db;
|
|
101
101
|
--color-nav-text: #3C2F71;
|
|
102
102
|
}
|