trepur_components 2.3.30 → 2.3.32
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/Link/index.js +50 -0
- package/lib/components/Nav/index.js +41 -40
- package/lib/components/NavItem/NavItem.stories.d.ts +1 -0
- package/lib/components/NavItem/index.d.ts +1 -0
- package/lib/components/NavItem/index.js +30 -19
- package/lib/components/index.d.ts +2 -1
- package/lib/index.js +44 -42
- package/package.json +1 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as a } from "react";
|
|
3
|
+
import { Icon as p } from "../Icon/index.js";
|
|
4
|
+
import s from "clsx";
|
|
5
|
+
const c = a(
|
|
6
|
+
({
|
|
7
|
+
className: e,
|
|
8
|
+
children: o,
|
|
9
|
+
loading: t = !1,
|
|
10
|
+
variant: r = "primary",
|
|
11
|
+
size: n = "sm",
|
|
12
|
+
href: m,
|
|
13
|
+
target: g,
|
|
14
|
+
...u
|
|
15
|
+
}) => /* @__PURE__ */ b("div", { className: "inline-block", children: /* @__PURE__ */ b(
|
|
16
|
+
"a",
|
|
17
|
+
{
|
|
18
|
+
href: m,
|
|
19
|
+
target: g,
|
|
20
|
+
className: s(
|
|
21
|
+
"flex items-center gap-3 rounded border text-center",
|
|
22
|
+
{
|
|
23
|
+
"duration-200": !t,
|
|
24
|
+
"border-button-primary-border bg-button-primary-bg text-button-primary-text hover:bg-button-primary-hover active:bg-button-primary-active": r === "primary" && !t,
|
|
25
|
+
"border-button-secondary-border bg-button-secondary-bg text-button-secondary-text hover:bg-button-secondary-hover active:bg-button-secondary-active": r === "secondary" && !t,
|
|
26
|
+
"border-button-ghost-border bg-button-ghost-bg text-button-ghost-text hover:bg-button-ghost-hover active:bg-button-ghost-active": r === "ghost" && !t,
|
|
27
|
+
"border-button-bordered-border text-button-ghost-text hover:bg-button-ghost-hover active:bg-button-ghost-active": r === "bordered" && !t,
|
|
28
|
+
"border-button-basic-border bg-button-basic-bg text-button-basic-text hover:bg-button-basic-hover active:bg-button-basic-active": r === "basic" && !t,
|
|
29
|
+
"w-40 animate-pulse border-loading bg-loading": t,
|
|
30
|
+
"px-12 py-3 text-base font-normal leading-4": n === "sm",
|
|
31
|
+
"px-12 py-3 text-lg font-normal leading-8": n === "md",
|
|
32
|
+
"px-12 py-4 text-xl font-normal leading-8": n === "lg"
|
|
33
|
+
},
|
|
34
|
+
e
|
|
35
|
+
),
|
|
36
|
+
...u,
|
|
37
|
+
children: !t && o
|
|
38
|
+
}
|
|
39
|
+
) })
|
|
40
|
+
), i = a(({ className: e, ...o }, t) => /* @__PURE__ */ b("p", { className: s("text-md", e), ref: t, ...o })), d = a(({ icon: e }, o) => /* @__PURE__ */ b(p, { size: "md", ref: o, icon: e }));
|
|
41
|
+
c.displayName = "Link";
|
|
42
|
+
d.displayName = "Link.Icon";
|
|
43
|
+
i.displayName = "Link.Label";
|
|
44
|
+
const v = Object.assign(c, {
|
|
45
|
+
Icon: d,
|
|
46
|
+
Label: i
|
|
47
|
+
});
|
|
48
|
+
export {
|
|
49
|
+
v as Link
|
|
50
|
+
};
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { jsx as e, jsxs as p, Fragment as H } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as
|
|
2
|
+
import { createContext as w, forwardRef as l, useState as v, useMemo as C, useContext as m, useRef as k } from "react";
|
|
3
3
|
import { HamburgerIcon as M } from "../HamburgerIcon/index.js";
|
|
4
4
|
import { faChevronDown as j } from "@fortawesome/fontawesome-free-solid";
|
|
5
|
-
import
|
|
5
|
+
import n from "clsx";
|
|
6
6
|
import { Icon as D } from "../Icon/index.js";
|
|
7
7
|
import { NavItem as F } from "../NavItem/index.js";
|
|
8
|
-
const i =
|
|
9
|
-
const [
|
|
8
|
+
const i = w(null), N = l(({ className: t, children: r, loading: a }, o) => {
|
|
9
|
+
const [s, d] = v(!1), c = C(
|
|
10
10
|
() => ({
|
|
11
|
-
expanded:
|
|
12
|
-
setExpanded:
|
|
11
|
+
expanded: s,
|
|
12
|
+
setExpanded: d,
|
|
13
13
|
loading: a
|
|
14
14
|
}),
|
|
15
|
-
[
|
|
15
|
+
[s, d, a]
|
|
16
16
|
);
|
|
17
|
-
return /* @__PURE__ */ e(i.Provider, { value:
|
|
17
|
+
return /* @__PURE__ */ e(i.Provider, { value: c, children: /* @__PURE__ */ e("div", { className: t, ref: o, children: r }) });
|
|
18
18
|
}), f = l(
|
|
19
19
|
({ className: t, children: r }, a) => /* @__PURE__ */ e(
|
|
20
20
|
"div",
|
|
21
21
|
{
|
|
22
22
|
ref: a,
|
|
23
|
-
className:
|
|
23
|
+
className: n("relative h-24 w-full bg-nav-bg px-2 py-2", t),
|
|
24
24
|
children: r
|
|
25
25
|
}
|
|
26
26
|
)
|
|
27
27
|
), g = l(({ className: t, children: r }, a) => {
|
|
28
|
-
const { loading:
|
|
29
|
-
return /* @__PURE__ */ p("div", { ref: a, className:
|
|
30
|
-
!
|
|
28
|
+
const { loading: o, setExpanded: s, expanded: d } = m(i) || {};
|
|
29
|
+
return /* @__PURE__ */ p("div", { ref: a, className: n("flex h-full md:hidden", t), children: [
|
|
30
|
+
!o && /* @__PURE__ */ e("div", { className: "my-auto", children: /* @__PURE__ */ e(
|
|
31
31
|
M,
|
|
32
32
|
{
|
|
33
33
|
variant: "ghost",
|
|
34
|
-
onClick: () =>
|
|
34
|
+
onClick: () => s == null ? void 0 : s(!d),
|
|
35
35
|
className: "aspect-square"
|
|
36
36
|
}
|
|
37
37
|
) }),
|
|
@@ -41,7 +41,7 @@ const i = C(null), N = l(({ className: t, children: r, loading: a }, s) => {
|
|
|
41
41
|
"div",
|
|
42
42
|
{
|
|
43
43
|
ref: a,
|
|
44
|
-
className:
|
|
44
|
+
className: n(
|
|
45
45
|
"hidden justify-between md:flex md:gap-4 md:px-4 lg:gap-8 lg:px-20",
|
|
46
46
|
t
|
|
47
47
|
),
|
|
@@ -49,12 +49,12 @@ const i = C(null), N = l(({ className: t, children: r, loading: a }, s) => {
|
|
|
49
49
|
}
|
|
50
50
|
)), x = l(
|
|
51
51
|
({ className: t, children: r }, a) => {
|
|
52
|
-
const { expanded:
|
|
53
|
-
return
|
|
52
|
+
const { expanded: o } = m(i) || {};
|
|
53
|
+
return o ? /* @__PURE__ */ e(
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
56
56
|
ref: a,
|
|
57
|
-
className:
|
|
57
|
+
className: n(
|
|
58
58
|
"h-screen bg-nav-bg px-8 pb-12 pt-2 md:hidden",
|
|
59
59
|
t
|
|
60
60
|
),
|
|
@@ -64,55 +64,56 @@ const i = C(null), N = l(({ className: t, children: r, loading: a }, s) => {
|
|
|
64
64
|
}
|
|
65
65
|
), h = l(
|
|
66
66
|
({ className: t, children: r }, a) => {
|
|
67
|
-
const { loading:
|
|
68
|
-
return
|
|
67
|
+
const { loading: o } = m(i) || {};
|
|
68
|
+
return o ? /* @__PURE__ */ e(
|
|
69
69
|
"div",
|
|
70
70
|
{
|
|
71
71
|
ref: a,
|
|
72
|
-
className:
|
|
73
|
-
children: [...Array(5)].map((
|
|
72
|
+
className: n("my-4 md:flex md:gap-4 lg:gap-6", t),
|
|
73
|
+
children: [...Array(5)].map((s, d) => /* @__PURE__ */ e(F, { loading: !0 }, d))
|
|
74
74
|
}
|
|
75
75
|
) : /* @__PURE__ */ e(
|
|
76
76
|
"div",
|
|
77
77
|
{
|
|
78
78
|
ref: a,
|
|
79
|
-
className:
|
|
79
|
+
className: n("my-4 md:flex md:gap-4 lg:gap-6", t),
|
|
80
80
|
children: r
|
|
81
81
|
}
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
|
-
), b = l(({ className: t, label: r, children: a, active:
|
|
85
|
-
const [
|
|
84
|
+
), b = l(({ className: t, label: r, children: a, active: o = !1 }) => {
|
|
85
|
+
const [s, d] = v(!1), c = k(null);
|
|
86
86
|
return /* @__PURE__ */ p(
|
|
87
87
|
"div",
|
|
88
88
|
{
|
|
89
|
-
ref:
|
|
90
|
-
|
|
91
|
-
onMouseLeave: () =>
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
ref: c,
|
|
90
|
+
onMouseEnter: () => d(!0),
|
|
91
|
+
onMouseLeave: () => d(!1),
|
|
92
|
+
onClick: () => d(!s),
|
|
93
|
+
className: n(
|
|
94
|
+
"relative m-auto py-0 text-nav-text md: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",
|
|
94
95
|
{
|
|
95
|
-
"font-bold":
|
|
96
|
-
"font-light": !
|
|
96
|
+
"font-bold": o,
|
|
97
|
+
"font-light": !o
|
|
97
98
|
},
|
|
98
99
|
t
|
|
99
100
|
),
|
|
100
101
|
children: [
|
|
101
|
-
/* @__PURE__ */ p("div", { className: "flex items-center gap-1", children: [
|
|
102
|
+
/* @__PURE__ */ p("div", { className: "flex justify-center items-center gap-1", children: [
|
|
102
103
|
/* @__PURE__ */ e("p", { className: "text-lg", children: r }),
|
|
103
104
|
/* @__PURE__ */ e(D, { size: "xs", icon: j })
|
|
104
105
|
] }),
|
|
105
|
-
|
|
106
|
+
s && /* @__PURE__ */ e("div", { className: "rounded-md md:absolute md:-left-5 top-7 z-50 w-40 bg-nav-bg", children: /* @__PURE__ */ e("div", { className: "rounded-md grid grid-cols-1 gap-y-2 bg-nav-bg px-1 py-2 w-full", children: a }) })
|
|
106
107
|
]
|
|
107
108
|
}
|
|
108
109
|
);
|
|
109
|
-
}), y = l(({ className: t, src: r, ...a },
|
|
110
|
-
const { loading:
|
|
111
|
-
return
|
|
110
|
+
}), y = l(({ className: t, src: r, ...a }, o) => {
|
|
111
|
+
const { loading: s } = m(i) || {};
|
|
112
|
+
return s ? /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("div", { className: "h-20 w-20 animate-pulse bg-gray-300" }) }) : /* @__PURE__ */ e(
|
|
112
113
|
"img",
|
|
113
114
|
{
|
|
114
|
-
className:
|
|
115
|
-
ref:
|
|
115
|
+
className: n("h-20 flex-none", t),
|
|
116
|
+
ref: o,
|
|
116
117
|
src: r,
|
|
117
118
|
...a
|
|
118
119
|
}
|
|
@@ -126,7 +127,7 @@ y.displayName = "Nav.Logo";
|
|
|
126
127
|
h.displayName = "Nav.Section";
|
|
127
128
|
x.displayName = "Nav.Body";
|
|
128
129
|
b.displayName = "Nav.Folder";
|
|
129
|
-
const
|
|
130
|
+
const q = Object.assign(N, {
|
|
130
131
|
Header: f,
|
|
131
132
|
DesktopHeader: u,
|
|
132
133
|
MobileHeader: g,
|
|
@@ -136,5 +137,5 @@ const A = Object.assign(N, {
|
|
|
136
137
|
Folder: b
|
|
137
138
|
});
|
|
138
139
|
export {
|
|
139
|
-
|
|
140
|
+
q as Nav
|
|
140
141
|
};
|
|
@@ -7,6 +7,7 @@ declare const meta: {
|
|
|
7
7
|
href?: string | undefined;
|
|
8
8
|
active?: boolean | undefined;
|
|
9
9
|
loading?: boolean | undefined;
|
|
10
|
+
isInFolder?: boolean | undefined;
|
|
10
11
|
} & import('react').RefAttributes<HTMLAnchorElement>> & {
|
|
11
12
|
Label: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
12
13
|
};
|
|
@@ -4,6 +4,7 @@ declare const NavItem: import('react').ForwardRefExoticComponent<HTMLAttributes<
|
|
|
4
4
|
href?: string | undefined;
|
|
5
5
|
active?: boolean | undefined;
|
|
6
6
|
loading?: boolean | undefined;
|
|
7
|
+
isInFolder?: boolean | undefined;
|
|
7
8
|
} & import('react').RefAttributes<HTMLAnchorElement>> & {
|
|
8
9
|
Label: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
9
10
|
};
|
|
@@ -1,28 +1,39 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as o } from "react";
|
|
3
3
|
import n from "clsx";
|
|
4
|
-
const l = o(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
className:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
const l = o(
|
|
5
|
+
({
|
|
6
|
+
loading: t = !1,
|
|
7
|
+
active: a,
|
|
8
|
+
children: r,
|
|
9
|
+
className: m,
|
|
10
|
+
href: i,
|
|
11
|
+
isInFolder: f = !1,
|
|
12
|
+
...c
|
|
13
|
+
}, d) => t ? /* @__PURE__ */ e("div", { className: "m-auto", children: /* @__PURE__ */ e("div", { className: "h-7 w-20 animate-pulse rounded-md bg-gray-300" }) }) : /* @__PURE__ */ e(
|
|
14
|
+
"a",
|
|
15
|
+
{
|
|
16
|
+
href: i,
|
|
17
|
+
ref: d,
|
|
18
|
+
className: n(
|
|
19
|
+
"group text-center w-full m-auto inline-block py-0 text-nav-text",
|
|
20
|
+
{
|
|
21
|
+
"font-bold": a,
|
|
22
|
+
"font-light": !a,
|
|
23
|
+
"rounded-md hover:bg-gray-300 py-1": f
|
|
24
|
+
},
|
|
25
|
+
m
|
|
26
|
+
),
|
|
27
|
+
...c,
|
|
28
|
+
children: /* @__PURE__ */ e("span", { className: "text-center inline-block after:block after:scale-x-0 after:border-b-2 after:border-nav-text after:transition-all after:duration-300 after:ease-in-out group-hover:cursor-pointer group-hover:after:scale-x-100", children: r })
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
), s = o(({ className: t, ...a }, r) => /* @__PURE__ */ e(
|
|
21
32
|
"p",
|
|
22
33
|
{
|
|
23
34
|
className: n("flex-none text-nowrap text-lg", t),
|
|
24
35
|
ref: r,
|
|
25
|
-
...
|
|
36
|
+
...a
|
|
26
37
|
}
|
|
27
38
|
));
|
|
28
39
|
l.displayName = "NavItem";
|
|
@@ -12,6 +12,7 @@ import { NavItem } from './NavItem';
|
|
|
12
12
|
import { Nav } from './Nav';
|
|
13
13
|
import { Modal } from './Modal';
|
|
14
14
|
import { MenuButton } from './MenuButton';
|
|
15
|
+
import { Link } from './Link';
|
|
15
16
|
import { Input } from './Input';
|
|
16
17
|
import { ImageCard } from './ImageCard';
|
|
17
18
|
import { Image } from './Image';
|
|
@@ -35,4 +36,4 @@ import { Breadcrumbs } from './Breadcrumbs';
|
|
|
35
36
|
import { AlertBar } from './AlertBar';
|
|
36
37
|
import { Accordion } from './Accordion';
|
|
37
38
|
|
|
38
|
-
export { Accordion, AlertBar, Breadcrumbs, Button, CalendarComponent, Card, Checkbox, Carousel, CarouselThumbnail, Collapsible, Counter, DetailUpdater, Dialog, Dropdown, Form, Footer, FooterNav, Greeting, Icon, Image, ImageCard, Input, MenuButton, Modal, Nav, NavItem, Pill, Search, Select, SplitCard, Stars, Testimonial, TextArea, Timeline, Tubestops, Video };
|
|
39
|
+
export { Accordion, AlertBar, Breadcrumbs, Button, CalendarComponent, Card, Checkbox, Carousel, CarouselThumbnail, Collapsible, Counter, DetailUpdater, Dialog, Dropdown, Form, Footer, FooterNav, Greeting, Icon, Image, ImageCard, Input, Link, MenuButton, Modal, Nav, NavItem, Pill, Search, Select, SplitCard, Stars, Testimonial, TextArea, Timeline, Tubestops, Video };
|
package/lib/index.js
CHANGED
|
@@ -12,28 +12,29 @@ import { Counter as S } from "./components/Counter/index.js";
|
|
|
12
12
|
import { DetailUpdater as v } from "./components/DetailUpdater/index.js";
|
|
13
13
|
import { Dialog as D } from "./components/Dialog/index.js";
|
|
14
14
|
import { Dropdown as N } from "./components/Dropdown/index.js";
|
|
15
|
-
import { Form as
|
|
15
|
+
import { Form as M } from "./components/Form/index.js";
|
|
16
16
|
import { Footer as G } from "./components/Footer/index.js";
|
|
17
|
-
import { FooterNav as
|
|
18
|
-
import { Greeting as
|
|
19
|
-
import { Icon as
|
|
20
|
-
import { Image as
|
|
21
|
-
import { ImageCard as
|
|
22
|
-
import { Input as
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
17
|
+
import { FooterNav as P } from "./components/FooterNav/index.js";
|
|
18
|
+
import { Greeting as V } from "./components/Greeting/index.js";
|
|
19
|
+
import { Icon as q } from "./components/Icon/index.js";
|
|
20
|
+
import { Image as z } from "./components/Image/index.js";
|
|
21
|
+
import { ImageCard as H } from "./components/ImageCard/index.js";
|
|
22
|
+
import { Input as K } from "./components/Input/index.js";
|
|
23
|
+
import { Link as Q } from "./components/Link/index.js";
|
|
24
|
+
import { MenuButton as W } from "./components/MenuButton/index.js";
|
|
25
|
+
import { Modal as Y } from "./components/Modal/index.js";
|
|
26
|
+
import { Nav as _ } from "./components/Nav/index.js";
|
|
27
|
+
import { NavItem as oo } from "./components/NavItem/index.js";
|
|
28
|
+
import { Pill as eo } from "./components/Pill/index.js";
|
|
29
|
+
import { Search as mo } from "./components/Search/index.js";
|
|
30
|
+
import { Select as xo } from "./components/Select/index.js";
|
|
31
|
+
import { SplitCard as ao } from "./components/SplitCard/index.js";
|
|
32
|
+
import { Stars as no } from "./components/Stars/index.js";
|
|
33
|
+
import { Testimonial as uo } from "./components/Testimonial/index.js";
|
|
34
|
+
import { TextArea as so } from "./components/TextArea/index.js";
|
|
35
|
+
import { Timeline as bo } from "./components/Timeline/index.js";
|
|
36
|
+
import { Tubestops as To } from "./components/Tubestops/index.js";
|
|
37
|
+
import { Video as Bo } from "./components/Video/index.js";
|
|
37
38
|
export {
|
|
38
39
|
e as Accordion,
|
|
39
40
|
m as AlertBar,
|
|
@@ -50,25 +51,26 @@ export {
|
|
|
50
51
|
D as Dialog,
|
|
51
52
|
N as Dropdown,
|
|
52
53
|
G as Footer,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
Q as
|
|
61
|
-
W as
|
|
62
|
-
Y as
|
|
63
|
-
_ as
|
|
64
|
-
oo as
|
|
65
|
-
eo as
|
|
66
|
-
mo as
|
|
67
|
-
xo as
|
|
68
|
-
ao as
|
|
69
|
-
no as
|
|
70
|
-
uo as
|
|
71
|
-
so as
|
|
72
|
-
bo as
|
|
73
|
-
To as
|
|
54
|
+
P as FooterNav,
|
|
55
|
+
M as Form,
|
|
56
|
+
V as Greeting,
|
|
57
|
+
q as Icon,
|
|
58
|
+
z as Image,
|
|
59
|
+
H as ImageCard,
|
|
60
|
+
K as Input,
|
|
61
|
+
Q as Link,
|
|
62
|
+
W as MenuButton,
|
|
63
|
+
Y as Modal,
|
|
64
|
+
_ as Nav,
|
|
65
|
+
oo as NavItem,
|
|
66
|
+
eo as Pill,
|
|
67
|
+
mo as Search,
|
|
68
|
+
xo as Select,
|
|
69
|
+
ao as SplitCard,
|
|
70
|
+
no as Stars,
|
|
71
|
+
uo as Testimonial,
|
|
72
|
+
so as TextArea,
|
|
73
|
+
bo as Timeline,
|
|
74
|
+
To as Tubestops,
|
|
75
|
+
Bo as Video
|
|
74
76
|
};
|