trepur_components 2.3.22 → 2.3.24
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 +3 -0
- package/lib/components/Button/index.d.ts +1 -0
- package/lib/components/Button/index.js +19 -16
- package/lib/components/Nav/index.js +71 -62
- package/lib/components/NavItem/index.js +10 -17
- package/lib/styles/themes/penrithmrt.css +2 -32
- package/lib/tailwind/preset.ts +1 -40
- package/lib/tailwind/spacing.ts +0 -1
- package/package.json +2 -1
|
@@ -7,6 +7,7 @@ export interface ButtonProps {
|
|
|
7
7
|
type?: 'button' | 'link';
|
|
8
8
|
href?: string;
|
|
9
9
|
target?: string;
|
|
10
|
+
size?: 'sm' | 'md' | 'lg';
|
|
10
11
|
}
|
|
11
12
|
declare const Button: import('react').ForwardRefExoticComponent<((HTMLAttributes<HTMLButtonElement> | HTMLAttributes<HTMLAnchorElement>) & ButtonProps) & import('react').RefAttributes<HTMLButtonElement | HTMLAnchorElement>> & {
|
|
12
13
|
Icon: import('react').ForwardRefExoticComponent<{
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as n } from "react";
|
|
3
|
-
import { Icon as
|
|
3
|
+
import { Icon as g } from "../Icon/index.js";
|
|
4
4
|
import s from "clsx";
|
|
5
|
-
const
|
|
5
|
+
const l = n(({ children: o, ...e }) => /* @__PURE__ */ r("button", { type: "button", ...e, children: o })), x = n(({ children: o, ...e }) => /* @__PURE__ */ r("div", { className: "inline-block", children: /* @__PURE__ */ r("a", { type: "button", className: "inline-grid", ...e, children: o }) })), c = n(
|
|
6
6
|
({
|
|
7
7
|
className: o,
|
|
8
8
|
children: e,
|
|
9
9
|
loading: t = !1,
|
|
10
10
|
variant: b = "primary",
|
|
11
11
|
type: i = "button",
|
|
12
|
-
disabled:
|
|
13
|
-
href:
|
|
12
|
+
disabled: h,
|
|
13
|
+
href: m,
|
|
14
14
|
target: p,
|
|
15
|
-
|
|
15
|
+
size: a = "md"
|
|
16
16
|
}) => /* @__PURE__ */ r(
|
|
17
|
-
i === "button" ?
|
|
17
|
+
i === "button" ? l : x,
|
|
18
18
|
{
|
|
19
|
-
href:
|
|
19
|
+
href: m,
|
|
20
20
|
target: p,
|
|
21
21
|
disabled: t,
|
|
22
22
|
className: s(
|
|
23
|
-
"
|
|
23
|
+
"flex items-center gap-3 rounded border text-center",
|
|
24
24
|
{
|
|
25
25
|
"duration-200": !t,
|
|
26
26
|
"border-button-primary-border bg-button-primary-bg text-button-primary-text hover:bg-button-primary-hover active:bg-button-primary-active": b === "primary" && !t,
|
|
@@ -28,20 +28,23 @@ const g = n(({ children: o, ...e }) => /* @__PURE__ */ r("button", { type: "butt
|
|
|
28
28
|
"border-button-ghost-border bg-button-ghost-bg text-button-ghost-text hover:bg-button-ghost-hover active:bg-button-ghost-active": b === "ghost" && !t,
|
|
29
29
|
"border-button-bordered-border text-button-ghost-text hover:bg-button-ghost-hover active:bg-button-ghost-active": b === "bordered" && !t,
|
|
30
30
|
"border-button-basic-border bg-button-basic-bg text-button-basic-text hover:bg-button-basic-hover active:bg-button-basic-active": b === "basic" && !t,
|
|
31
|
-
"w-40 animate-pulse border-loading bg-loading": t
|
|
31
|
+
"w-40 animate-pulse border-loading bg-loading": t,
|
|
32
|
+
"px-12 py-3 text-base font-normal leading-4": a === "sm",
|
|
33
|
+
"px-12 py-3 text-lg font-normal leading-8": a === "md",
|
|
34
|
+
"px-12 py-4 text-xl font-normal leading-8": a === "lg"
|
|
32
35
|
},
|
|
33
36
|
o
|
|
34
37
|
),
|
|
35
38
|
children: !t && e
|
|
36
39
|
}
|
|
37
40
|
)
|
|
38
|
-
),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const I = Object.assign(
|
|
43
|
-
Icon:
|
|
44
|
-
Label:
|
|
41
|
+
), u = n(({ className: o, ...e }, t) => /* @__PURE__ */ r("p", { className: s("text-md", o), ref: t, ...e })), d = n(({ icon: o }, e) => /* @__PURE__ */ r(g, { size: "md", ref: e, icon: o }));
|
|
42
|
+
c.displayName = "Button";
|
|
43
|
+
d.displayName = "Button.Icon";
|
|
44
|
+
u.displayName = "Button.Label";
|
|
45
|
+
const I = Object.assign(c, {
|
|
46
|
+
Icon: d,
|
|
47
|
+
Label: u
|
|
45
48
|
});
|
|
46
49
|
export {
|
|
47
50
|
I as Button
|
|
@@ -1,115 +1,124 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { HamburgerIcon as
|
|
4
|
-
import { faChevronDown as
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as C, forwardRef as o, useState as m, useMemo as k, useContext as p, useRef as w } from "react";
|
|
3
|
+
import { HamburgerIcon as M } from "../HamburgerIcon/index.js";
|
|
4
|
+
import { faChevronDown as j } from "@fortawesome/fontawesome-free-solid";
|
|
5
5
|
import n from "clsx";
|
|
6
|
-
import { Icon as
|
|
7
|
-
const c =
|
|
8
|
-
const [
|
|
6
|
+
import { Icon as D } from "../Icon/index.js";
|
|
7
|
+
const c = C(null), v = o(({ className: a, children: t }, s) => {
|
|
8
|
+
const [r, d] = m(!1), l = k(
|
|
9
9
|
() => ({
|
|
10
|
-
expanded:
|
|
10
|
+
expanded: r,
|
|
11
11
|
setExpanded: d
|
|
12
12
|
}),
|
|
13
|
-
[
|
|
13
|
+
[r, d]
|
|
14
14
|
);
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
}), N =
|
|
17
|
-
({ className:
|
|
15
|
+
return /* @__PURE__ */ e(c.Provider, { value: l, children: /* @__PURE__ */ e("div", { className: a, ref: s, children: t }) });
|
|
16
|
+
}), N = o(
|
|
17
|
+
({ className: a, children: t }, s) => /* @__PURE__ */ e(
|
|
18
18
|
"div",
|
|
19
19
|
{
|
|
20
|
-
ref:
|
|
21
|
-
className: n("relative h-24 w-full bg-nav-bg px-2 py-2",
|
|
20
|
+
ref: s,
|
|
21
|
+
className: n("relative h-24 w-full bg-nav-bg px-2 py-2", a),
|
|
22
22
|
children: t
|
|
23
23
|
}
|
|
24
24
|
)
|
|
25
|
-
),
|
|
26
|
-
const { setExpanded:
|
|
27
|
-
return /* @__PURE__ */ i("div", { ref:
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
|
|
25
|
+
), f = o(({ className: a, children: t }, s) => {
|
|
26
|
+
const { setExpanded: r, expanded: d } = p(c) || {};
|
|
27
|
+
return /* @__PURE__ */ i("div", { ref: s, className: n("flex h-full md:hidden", a), children: [
|
|
28
|
+
/* @__PURE__ */ e("div", { className: "my-auto", children: /* @__PURE__ */ e(
|
|
29
|
+
M,
|
|
30
30
|
{
|
|
31
31
|
variant: "ghost",
|
|
32
|
-
onClick: () =>
|
|
32
|
+
onClick: () => r == null ? void 0 : r(!d),
|
|
33
33
|
className: "aspect-square"
|
|
34
34
|
}
|
|
35
35
|
) }),
|
|
36
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ e("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform", children: t })
|
|
37
37
|
] });
|
|
38
|
-
}),
|
|
38
|
+
}), g = o(({ className: a, children: t }, s) => /* @__PURE__ */ e(
|
|
39
39
|
"div",
|
|
40
40
|
{
|
|
41
|
-
ref:
|
|
41
|
+
ref: s,
|
|
42
42
|
className: n(
|
|
43
43
|
"hidden justify-between md:flex md:gap-4 md:px-4 lg:gap-8 lg:px-20",
|
|
44
|
-
|
|
44
|
+
a
|
|
45
45
|
),
|
|
46
46
|
children: t
|
|
47
47
|
}
|
|
48
|
-
)),
|
|
49
|
-
({ className:
|
|
50
|
-
const { expanded:
|
|
51
|
-
return
|
|
48
|
+
)), x = o(
|
|
49
|
+
({ className: a, children: t }, s) => {
|
|
50
|
+
const { expanded: r } = p(c) || {};
|
|
51
|
+
return r ? /* @__PURE__ */ e(
|
|
52
52
|
"div",
|
|
53
53
|
{
|
|
54
|
-
ref:
|
|
54
|
+
ref: s,
|
|
55
55
|
className: n(
|
|
56
56
|
"h-screen bg-nav-bg px-8 pb-12 pt-2 md:hidden",
|
|
57
|
-
|
|
57
|
+
a
|
|
58
58
|
),
|
|
59
|
-
children: /* @__PURE__ */
|
|
59
|
+
children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-4 md:hidden", children: t })
|
|
60
60
|
}
|
|
61
|
-
) : /* @__PURE__ */
|
|
61
|
+
) : /* @__PURE__ */ e(H, {});
|
|
62
62
|
}
|
|
63
|
-
),
|
|
64
|
-
({ className:
|
|
63
|
+
), u = o(
|
|
64
|
+
({ className: a, children: t }, s) => /* @__PURE__ */ e(
|
|
65
65
|
"div",
|
|
66
66
|
{
|
|
67
|
-
ref:
|
|
68
|
-
className: n("my-4 md:flex md:gap-4 lg:gap-
|
|
67
|
+
ref: s,
|
|
68
|
+
className: n("my-4 md:flex md:gap-4 lg:gap-6", a),
|
|
69
69
|
children: t
|
|
70
70
|
}
|
|
71
71
|
)
|
|
72
|
-
),
|
|
73
|
-
const [
|
|
72
|
+
), b = o(({ className: a, label: t, children: s, active: r = !1 }) => {
|
|
73
|
+
const [d, l] = m(!1), y = w(null);
|
|
74
74
|
return /* @__PURE__ */ i(
|
|
75
75
|
"div",
|
|
76
76
|
{
|
|
77
|
-
ref:
|
|
78
|
-
onClick: () =>
|
|
79
|
-
onMouseLeave: () =>
|
|
77
|
+
ref: y,
|
|
78
|
+
onClick: () => l(!0),
|
|
79
|
+
onMouseLeave: () => l(!1),
|
|
80
80
|
className: n(
|
|
81
|
-
"relative m-auto text-
|
|
81
|
+
"relative m-auto py-0 text-nav-text after:block after:scale-x-0 after:border-b-2 after:border-nav-text after:transition-all after:duration-300 after:ease-in-out hover:cursor-pointer hover:after:scale-x-100",
|
|
82
82
|
{
|
|
83
|
-
"font-bold":
|
|
84
|
-
"font-
|
|
85
|
-
}
|
|
83
|
+
"font-bold": r,
|
|
84
|
+
"font-light": !r
|
|
85
|
+
},
|
|
86
|
+
a
|
|
86
87
|
),
|
|
87
88
|
children: [
|
|
88
|
-
/* @__PURE__ */ i("div", { className: "flex items-center gap-
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
90
|
+
/* @__PURE__ */ e("p", { className: "text-lg", children: t }),
|
|
91
|
+
/* @__PURE__ */ e(D, { size: "xs", icon: j })
|
|
91
92
|
] }),
|
|
92
|
-
|
|
93
|
+
d && /* @__PURE__ */ e("div", { className: "absolute -left-5 top-7 z-50 w-40 bg-nav-bg", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-y-2 bg-nav-bg px-4 py-4", children: s }) })
|
|
93
94
|
]
|
|
94
95
|
}
|
|
95
96
|
);
|
|
96
|
-
}),
|
|
97
|
+
}), h = o(({ className: a, src: t, ...s }, r) => /* @__PURE__ */ e(
|
|
98
|
+
"img",
|
|
99
|
+
{
|
|
100
|
+
className: n("h-20 flex-none", a),
|
|
101
|
+
ref: r,
|
|
102
|
+
src: t,
|
|
103
|
+
...s
|
|
104
|
+
}
|
|
105
|
+
));
|
|
97
106
|
v.displayName = "Nav";
|
|
98
107
|
N.displayName = "Nav.Header";
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
108
|
+
g.displayName = "Nav.DesktopHeader";
|
|
109
|
+
f.displayName = "Nav.MobileHeader";
|
|
110
|
+
h.displayName = "Nav.Logo";
|
|
111
|
+
u.displayName = "Nav.Section";
|
|
112
|
+
x.displayName = "Nav.Body";
|
|
113
|
+
b.displayName = "Nav.Folder";
|
|
105
114
|
const R = Object.assign(v, {
|
|
106
115
|
Header: N,
|
|
107
|
-
DesktopHeader:
|
|
108
|
-
MobileHeader:
|
|
109
|
-
Section:
|
|
110
|
-
Logo:
|
|
111
|
-
Body:
|
|
112
|
-
Folder:
|
|
116
|
+
DesktopHeader: g,
|
|
117
|
+
MobileHeader: f,
|
|
118
|
+
Section: u,
|
|
119
|
+
Logo: h,
|
|
120
|
+
Body: x,
|
|
121
|
+
Folder: b
|
|
113
122
|
});
|
|
114
123
|
export {
|
|
115
124
|
R as Nav
|
|
@@ -1,34 +1,27 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as o } from "react";
|
|
3
3
|
import c from "clsx";
|
|
4
|
-
const
|
|
4
|
+
const s = o(({ active: e, children: t, className: a, href: l, ...m }, f) => /* @__PURE__ */ r(
|
|
5
5
|
"a",
|
|
6
6
|
{
|
|
7
|
-
href:
|
|
7
|
+
href: l,
|
|
8
8
|
ref: f,
|
|
9
9
|
className: c(
|
|
10
|
-
"m-auto
|
|
10
|
+
"m-auto py-0 text-nav-text after:block after:scale-x-0 after:border-b-2 after:border-nav-text after:transition-all after:duration-300 after:ease-in-out hover:cursor-pointer hover:after:scale-x-100",
|
|
11
11
|
{
|
|
12
12
|
"font-bold": e,
|
|
13
|
-
"font-
|
|
13
|
+
"font-light": !e
|
|
14
14
|
},
|
|
15
15
|
a
|
|
16
16
|
),
|
|
17
|
-
...
|
|
17
|
+
...m,
|
|
18
18
|
children: t
|
|
19
19
|
}
|
|
20
|
-
)),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
...t
|
|
26
|
-
}
|
|
27
|
-
));
|
|
28
|
-
n.displayName = "NavItem";
|
|
29
|
-
s.displayName = "NavItem.Label";
|
|
30
|
-
const N = Object.assign(n, {
|
|
31
|
-
Label: s
|
|
20
|
+
)), n = o(({ className: e, ...t }, a) => /* @__PURE__ */ r("p", { className: "flex-none text-nowrap text-lg", ref: a, ...t }));
|
|
21
|
+
s.displayName = "NavItem";
|
|
22
|
+
n.displayName = "NavItem.Label";
|
|
23
|
+
const N = Object.assign(s, {
|
|
24
|
+
Label: n
|
|
32
25
|
});
|
|
33
26
|
export {
|
|
34
27
|
N as NavItem
|
|
@@ -1,36 +1,6 @@
|
|
|
1
1
|
body.theme-penrithmrt {
|
|
2
|
-
--color-ink: #495863;
|
|
3
|
-
--color-transparent: transparent;
|
|
4
|
-
--color-white: #ffffff;
|
|
5
|
-
--color-black: #000000;
|
|
6
|
-
--color-red: #bb0a1e;
|
|
7
|
-
--color-grey: #2c373b;
|
|
8
|
-
--color-light-grey: #495c63;
|
|
9
|
-
--color-lightest-grey: #f5f5f5;
|
|
10
|
-
--color-primary-strict: #ff007d;
|
|
11
|
-
--color-border: #d0d0d0;
|
|
12
|
-
--color-border-lightest: #eeeeee;
|
|
13
|
-
--color-border-light: #d8d8d8;
|
|
14
|
-
--color-border-dark: #616161;
|
|
15
|
-
--color-facebook: #3b5999;
|
|
16
|
-
--color-whatsapp: #25d366;
|
|
17
|
-
--color-twitter: #55acee;
|
|
18
|
-
--color-linkedin: #0a66c2;
|
|
19
|
-
--color-email: #c71610;
|
|
20
|
-
--color-github: #171515;
|
|
21
|
-
--color-instagram: #8a3ab9;
|
|
22
|
-
--color-interactive-facebook: #2d4474;
|
|
23
|
-
--color-interactive-whatsapp: #25d566;
|
|
24
|
-
--color-interactive-twitter: #55acee;
|
|
25
|
-
--color-interactive-linkedin: #0a66c2;
|
|
26
|
-
--color-interactive-instagram: #6d2e92;
|
|
27
|
-
--color-interactive-email: #9f110c;
|
|
28
|
-
--color-interactive-github: #000000;
|
|
29
|
-
--color-gold: #e2b13c;
|
|
30
|
-
--color-linkedin: #0e76a8;
|
|
31
|
-
|
|
32
2
|
--color-primary: #3C2F71;
|
|
33
|
-
--color-secondary: #
|
|
3
|
+
--color-secondary: #E94439;
|
|
34
4
|
--color-tertiary: #921457;
|
|
35
5
|
|
|
36
6
|
--color-loading: #a3a3a3;
|
|
@@ -55,7 +25,7 @@ body.theme-penrithmrt {
|
|
|
55
25
|
|
|
56
26
|
--color-button-secondary-active: #c71f1f;
|
|
57
27
|
--color-button-secondary-border: #c71f1f;
|
|
58
|
-
--color-button-secondary-bg: #
|
|
28
|
+
--color-button-secondary-bg: #E94439;
|
|
59
29
|
--color-button-secondary-text: #ffffff;
|
|
60
30
|
--color-button-secondary-hover: #c71f1f;
|
|
61
31
|
|
package/lib/tailwind/preset.ts
CHANGED
|
@@ -23,46 +23,7 @@ const presetConfig: Config = {
|
|
|
23
23
|
colors,
|
|
24
24
|
|
|
25
25
|
fontFamily: {
|
|
26
|
-
|
|
27
|
-
sans: ['DM Sans', 'Noto Sans JP', ...defaultTheme.fontFamily.sans],
|
|
28
|
-
},
|
|
29
|
-
fontSize: {
|
|
30
|
-
xs: [
|
|
31
|
-
'0.75rem',
|
|
32
|
-
{
|
|
33
|
-
lineHeight: '1.1rem',
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
xl: [
|
|
37
|
-
'1.25rem',
|
|
38
|
-
{
|
|
39
|
-
lineHeight: '1.875rem',
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
'2xl': [
|
|
43
|
-
'1.5rem',
|
|
44
|
-
{
|
|
45
|
-
lineHeight: '2.25rem',
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
'3xl': [
|
|
49
|
-
'1.875rem',
|
|
50
|
-
{
|
|
51
|
-
lineHeight: '2.75rem',
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
'4xl': [
|
|
55
|
-
'2.25rem',
|
|
56
|
-
{
|
|
57
|
-
lineHeight: '3.25rem',
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
'5xl': [
|
|
61
|
-
'3rem',
|
|
62
|
-
{
|
|
63
|
-
lineHeight: '4rem',
|
|
64
|
-
},
|
|
65
|
-
],
|
|
26
|
+
sans: ['Poppins', 'sans-serif'],
|
|
66
27
|
},
|
|
67
28
|
keyframes: {
|
|
68
29
|
'rest-bounce': {
|
package/lib/tailwind/spacing.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trepur_components",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.24",
|
|
4
4
|
"description": "component lib",
|
|
5
5
|
"author": "trepur_ttenneb",
|
|
6
6
|
"private": false,
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"@fortawesome/fontawesome-free-regular": "^5.1.0-3",
|
|
48
48
|
"@fortawesome/fontawesome-free-solid": "^5.1.0-3",
|
|
49
49
|
"@fortawesome/fontawesome-svg-core": "^6.5.2",
|
|
50
|
+
"@fortawesome/free-solid-svg-icons": "^6.5.2",
|
|
50
51
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
51
52
|
"class-variance-authority": "^0.7.0",
|
|
52
53
|
"classnames": "^2.5.1",
|