trepur_components 2.3.11 → 2.3.13
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/index.js +3 -3
- package/lib/components/Nav/index.js +36 -36
- package/lib/components/NavItem/index.js +1 -1
- package/lib/components/SplitCard/SplitCard.stories.d.ts +2 -4
- package/lib/components/SplitCard/index.js +83 -0
- package/lib/components/index.d.ts +2 -1
- package/lib/index.js +24 -22
- package/lib/styles/themes/penrithmrt.css +1 -1
- package/lib/utils/matchMedia.js +9 -0
- package/lib/utils/screens.js +10 -0
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ const a = n(
|
|
|
15
15
|
{
|
|
16
16
|
disabled: t,
|
|
17
17
|
className: s(
|
|
18
|
-
"flex
|
|
18
|
+
"flex items-center gap-2 rounded-lg border px-8 py-3 text-center text-lg font-thin",
|
|
19
19
|
{
|
|
20
20
|
"duration-200": !t,
|
|
21
21
|
"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,
|
|
@@ -34,10 +34,10 @@ const a = n(
|
|
|
34
34
|
a.displayName = "Button";
|
|
35
35
|
c.displayName = "Button.Icon";
|
|
36
36
|
u.displayName = "Button.Label";
|
|
37
|
-
const
|
|
37
|
+
const x = Object.assign(a, {
|
|
38
38
|
Icon: c,
|
|
39
39
|
Label: u
|
|
40
40
|
});
|
|
41
41
|
export {
|
|
42
|
-
|
|
42
|
+
x as Button
|
|
43
43
|
};
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { createContext as y, forwardRef as
|
|
1
|
+
import { jsx as e, jsxs as d, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as y, forwardRef as o, useState as c, useMemo as b, useContext as m, useRef as C } from "react";
|
|
3
3
|
import { HamburgerIcon as H } from "../HamburgerIcon/index.js";
|
|
4
4
|
import { faChevronDown as k } from "@fortawesome/fontawesome-free-solid";
|
|
5
5
|
import p from "clsx";
|
|
6
6
|
import { Icon as w } from "../Icon/index.js";
|
|
7
|
-
const l = y(null), v =
|
|
8
|
-
const [
|
|
7
|
+
const l = y(null), v = o(({ children: a }, s) => {
|
|
8
|
+
const [r, t] = c(!1), n = b(
|
|
9
9
|
() => ({
|
|
10
|
-
expanded:
|
|
11
|
-
setExpanded:
|
|
10
|
+
expanded: r,
|
|
11
|
+
setExpanded: t
|
|
12
12
|
}),
|
|
13
|
-
[
|
|
13
|
+
[r, t]
|
|
14
14
|
);
|
|
15
|
-
return /* @__PURE__ */ e(l.Provider, { value:
|
|
16
|
-
}), N =
|
|
17
|
-
const { setExpanded:
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ e(l.Provider, { value: n, children: /* @__PURE__ */ e("div", { children: a }) });
|
|
16
|
+
}), N = o(({ children: a, logo: s }, r) => {
|
|
17
|
+
const { setExpanded: t, expanded: n } = m(l) || {};
|
|
18
|
+
return /* @__PURE__ */ d("div", { ref: r, className: p("relative h-24 w-full bg-nav-bg px-2 py-2"), children: [
|
|
19
|
+
/* @__PURE__ */ d("div", { className: "flex h-full md:hidden", children: [
|
|
20
20
|
/* @__PURE__ */ e("div", { className: "my-auto", children: /* @__PURE__ */ e(
|
|
21
21
|
H,
|
|
22
22
|
{
|
|
23
|
-
onClick: () =>
|
|
23
|
+
onClick: () => t == null ? void 0 : t(!n),
|
|
24
24
|
className: "aspect-square"
|
|
25
25
|
}
|
|
26
26
|
) }),
|
|
27
|
-
/* @__PURE__ */ e("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform", children: /* @__PURE__ */ e(i, { src:
|
|
27
|
+
/* @__PURE__ */ e("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform", children: /* @__PURE__ */ e(i, { src: s }) })
|
|
28
28
|
] }),
|
|
29
29
|
a
|
|
30
30
|
] });
|
|
31
|
-
}),
|
|
32
|
-
({ children: a },
|
|
33
|
-
const { expanded:
|
|
34
|
-
return
|
|
31
|
+
}), g = o(
|
|
32
|
+
({ children: a }, s) => {
|
|
33
|
+
const { expanded: r } = m(l) || {};
|
|
34
|
+
return r ? /* @__PURE__ */ e("div", { className: "h-screen bg-nav-bg px-8 pb-12 pt-2 md:hidden", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-4 md:hidden", children: a }) }) : /* @__PURE__ */ e(h, {});
|
|
35
35
|
}
|
|
36
|
-
),
|
|
36
|
+
), f = o(({ children: a }, s) => /* @__PURE__ */ e(
|
|
37
37
|
"div",
|
|
38
38
|
{
|
|
39
|
-
ref:
|
|
39
|
+
ref: s,
|
|
40
40
|
className: "hidden justify-between md:flex md:gap-4 md:px-4 lg:gap-8 lg:px-20",
|
|
41
41
|
children: a
|
|
42
42
|
}
|
|
43
|
-
)), x =
|
|
44
|
-
({ children: a },
|
|
45
|
-
), u =
|
|
46
|
-
const [
|
|
47
|
-
return /* @__PURE__ */
|
|
43
|
+
)), x = o(
|
|
44
|
+
({ children: a }, s) => /* @__PURE__ */ e("div", { ref: s, className: "my-4 md:flex md:gap-4 lg:gap-8", children: a })
|
|
45
|
+
), u = o(({ label: a, children: s }) => {
|
|
46
|
+
const [r, t] = c(!1), n = C(null);
|
|
47
|
+
return /* @__PURE__ */ d(
|
|
48
48
|
"div",
|
|
49
49
|
{
|
|
50
|
-
ref:
|
|
51
|
-
onClick: () =>
|
|
52
|
-
onMouseLeave: () =>
|
|
53
|
-
className: "
|
|
50
|
+
ref: n,
|
|
51
|
+
onClick: () => t(!0),
|
|
52
|
+
onMouseLeave: () => t(!1),
|
|
53
|
+
className: "relative m-auto text-xl font-normal tracking-wider text-nav-text hover:cursor-pointer",
|
|
54
54
|
children: [
|
|
55
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-px ", children: [
|
|
56
56
|
/* @__PURE__ */ e("p", { children: a }),
|
|
57
57
|
/* @__PURE__ */ e(w, { icon: k })
|
|
58
58
|
] }),
|
|
59
|
-
|
|
59
|
+
r && /* @__PURE__ */ e("div", { className: "absolute -left-5 top-7 w-28 bg-nav-bg", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 gap-y-2 bg-nav-bg px-4 py-4", children: s }) })
|
|
60
60
|
]
|
|
61
61
|
}
|
|
62
62
|
);
|
|
63
|
-
}), i =
|
|
63
|
+
}), i = o(({ className: a, src: s, ...r }, t) => /* @__PURE__ */ e("img", { className: p("h-20", a), ref: t, src: s, ...r }));
|
|
64
64
|
v.displayName = "Nav";
|
|
65
65
|
N.displayName = "Nav.Header";
|
|
66
|
-
|
|
66
|
+
f.displayName = "Nav.DesktopHeader";
|
|
67
67
|
i.displayName = "Nav.Logo";
|
|
68
68
|
x.displayName = "Nav.Section";
|
|
69
|
-
|
|
69
|
+
g.displayName = "Nav.Body";
|
|
70
70
|
u.displayName = "Nav.Folder";
|
|
71
71
|
const I = Object.assign(v, {
|
|
72
72
|
Header: N,
|
|
73
|
-
DesktopHeader:
|
|
73
|
+
DesktopHeader: f,
|
|
74
74
|
Section: x,
|
|
75
75
|
Logo: i,
|
|
76
|
-
Body:
|
|
76
|
+
Body: g,
|
|
77
77
|
Folder: u
|
|
78
78
|
});
|
|
79
79
|
export {
|
|
@@ -7,7 +7,7 @@ const n = o(({ children: t, className: e, href: a, ...m }, l) => /* @__PURE__ */
|
|
|
7
7
|
href: a,
|
|
8
8
|
ref: l,
|
|
9
9
|
className: f(
|
|
10
|
-
"
|
|
10
|
+
"m-auto h-8 py-0 text-nav-text after:block after:scale-x-0 after:border-b-4 after:border-nav-text after:transition-all after:duration-300 after:ease-in-out hover:cursor-pointer hover:after:scale-x-100",
|
|
11
11
|
e
|
|
12
12
|
),
|
|
13
13
|
...m,
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import { SplitCard } from '.';
|
|
2
1
|
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { SplitCard } from './';
|
|
3
3
|
|
|
4
4
|
declare const meta: {
|
|
5
5
|
title: string;
|
|
6
|
-
component: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('
|
|
6
|
+
component: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('./').SplitCardContextProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
7
7
|
LeftContent: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
8
|
RightContent: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
9
9
|
Title: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
10
10
|
Text: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
11
11
|
};
|
|
12
12
|
args: {
|
|
13
|
-
className: string;
|
|
14
13
|
swapDesktop: true;
|
|
15
|
-
swapMobile: true;
|
|
16
14
|
children: import("react/jsx-runtime").JSX.Element[];
|
|
17
15
|
};
|
|
18
16
|
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as g, forwardRef as l, useMemo as N, useContext as p } from "react";
|
|
3
|
+
import h from "../../utils/matchMedia.js";
|
|
4
|
+
import { Screens as M } from "../../utils/screens.js";
|
|
5
|
+
import a from "clsx";
|
|
6
|
+
const m = g(null), x = l(({ id: i, className: e, children: r, swapDesktop: t, swapMobile: n, ...o }, d) => {
|
|
7
|
+
const S = `(min-width: ${M.md})`, c = h(S), u = N(
|
|
8
|
+
() => ({
|
|
9
|
+
swapDesktop: t,
|
|
10
|
+
swapMobile: n,
|
|
11
|
+
isMd: c
|
|
12
|
+
}),
|
|
13
|
+
[t, n, c]
|
|
14
|
+
);
|
|
15
|
+
return /* @__PURE__ */ s(m.Provider, { value: u, children: /* @__PURE__ */ s(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
ref: d,
|
|
19
|
+
...o,
|
|
20
|
+
className: a("grid grid-cols-1 md:grid-cols-2", e),
|
|
21
|
+
children: r
|
|
22
|
+
}
|
|
23
|
+
) });
|
|
24
|
+
}), C = l(({ className: i, children: e, ...r }, t) => {
|
|
25
|
+
const { swapDesktop: n, swapMobile: o, isMd: d } = p(m) || {};
|
|
26
|
+
return /* @__PURE__ */ s(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
ref: t,
|
|
30
|
+
...r,
|
|
31
|
+
className: a(
|
|
32
|
+
"mx-auto flex items-center px-8 py-12 text-center md:px-12 lg:px-20",
|
|
33
|
+
{
|
|
34
|
+
"md:order-last": n,
|
|
35
|
+
"order-last": !d && o
|
|
36
|
+
},
|
|
37
|
+
i
|
|
38
|
+
),
|
|
39
|
+
children: e
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}), f = l(({ className: i, children: e, ...r }, t) => {
|
|
43
|
+
const { swapDesktop: n, swapMobile: o, isMd: d } = p(m) || {};
|
|
44
|
+
return /* @__PURE__ */ s(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
ref: t,
|
|
48
|
+
...r,
|
|
49
|
+
className: a(
|
|
50
|
+
"flex h-full items-center px-8 text-center md:px-12 lg:px-20",
|
|
51
|
+
{
|
|
52
|
+
"md:order-first": n,
|
|
53
|
+
"order-first": !d && o
|
|
54
|
+
},
|
|
55
|
+
i
|
|
56
|
+
),
|
|
57
|
+
children: e
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}), v = l(({ className: i, children: e, ...r }, t) => /* @__PURE__ */ s(
|
|
61
|
+
"p",
|
|
62
|
+
{
|
|
63
|
+
ref: t,
|
|
64
|
+
className: a(
|
|
65
|
+
"items-center text-6xl font-semibold tracking-wider md:text-4xl lg:text-6xl",
|
|
66
|
+
i
|
|
67
|
+
),
|
|
68
|
+
...r,
|
|
69
|
+
children: e
|
|
70
|
+
}
|
|
71
|
+
)), w = l(({ className: i, children: e, ...r }, t) => /* @__PURE__ */ s("p", { ref: t, className: a("text-lg", i), ...r, children: e }));
|
|
72
|
+
x.displayName = "SplitCard";
|
|
73
|
+
C.displayName = "SplitCard.LeftContent";
|
|
74
|
+
f.displayName = "SplitCard.RightContent";
|
|
75
|
+
const k = Object.assign(x, {
|
|
76
|
+
LeftContent: C,
|
|
77
|
+
RightContent: f,
|
|
78
|
+
Title: v,
|
|
79
|
+
Text: w
|
|
80
|
+
});
|
|
81
|
+
export {
|
|
82
|
+
k as SplitCard
|
|
83
|
+
};
|
|
@@ -4,6 +4,7 @@ import { Timeline } from './Timeline';
|
|
|
4
4
|
import { TextArea } from './TextArea';
|
|
5
5
|
import { Testimonial } from './Testimonial';
|
|
6
6
|
import { Stars } from './Stars';
|
|
7
|
+
import { SplitCard } from './SplitCard';
|
|
7
8
|
import { Select } from './Select';
|
|
8
9
|
import { Search } from './Search';
|
|
9
10
|
import { Pill } from './Pill';
|
|
@@ -34,4 +35,4 @@ import { Breadcrumbs } from './Breadcrumbs';
|
|
|
34
35
|
import { AlertBar } from './AlertBar';
|
|
35
36
|
import { Accordion } from './Accordion';
|
|
36
37
|
|
|
37
|
-
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, Stars, Testimonial, TextArea, Timeline, Tubestops, Video, };
|
|
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, };
|
package/lib/index.js
CHANGED
|
@@ -3,15 +3,15 @@ import { AlertBar as m } from "./components/AlertBar/index.js";
|
|
|
3
3
|
import { Breadcrumbs as x } from "./components/Breadcrumbs/index.js";
|
|
4
4
|
import { Button as a } from "./components/Button/index.js";
|
|
5
5
|
import { CalendarComponent as n } from "./components/Calendar/index.js";
|
|
6
|
-
import { Card as
|
|
6
|
+
import { Card as d } from "./components/Card/index.js";
|
|
7
7
|
import { Checkbox as C } from "./components/Checkbox/index.js";
|
|
8
8
|
import { Carousel as c } from "./components/Carousel/index.js";
|
|
9
9
|
import { CarouselThumbnail as I } from "./components/CarouselThumbnail/index.js";
|
|
10
10
|
import { Collapsible as g } from "./components/Collapsible/index.js";
|
|
11
|
-
import { Counter as
|
|
12
|
-
import { DetailUpdater as
|
|
13
|
-
import { Dialog as
|
|
14
|
-
import { Dropdown as
|
|
11
|
+
import { Counter as S } from "./components/Counter/index.js";
|
|
12
|
+
import { DetailUpdater as v } from "./components/DetailUpdater/index.js";
|
|
13
|
+
import { Dialog as D } from "./components/Dialog/index.js";
|
|
14
|
+
import { Dropdown as N } from "./components/Dropdown/index.js";
|
|
15
15
|
import { Form as k } from "./components/Form/index.js";
|
|
16
16
|
import { Footer as G } from "./components/Footer/index.js";
|
|
17
17
|
import { FooterNav as U } from "./components/FooterNav/index.js";
|
|
@@ -27,27 +27,28 @@ import { NavItem as _ } from "./components/NavItem/index.js";
|
|
|
27
27
|
import { Pill as oo } from "./components/Pill/index.js";
|
|
28
28
|
import { Search as eo } from "./components/Search/index.js";
|
|
29
29
|
import { Select as mo } from "./components/Select/index.js";
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
30
|
+
import { SplitCard as xo } from "./components/SplitCard/index.js";
|
|
31
|
+
import { Stars as ao } from "./components/Stars/index.js";
|
|
32
|
+
import { Testimonial as no } from "./components/Testimonial/index.js";
|
|
33
|
+
import { TextArea as uo } from "./components/TextArea/index.js";
|
|
34
|
+
import { Timeline as so } from "./components/Timeline/index.js";
|
|
35
|
+
import { Tubestops as bo } from "./components/Tubestops/index.js";
|
|
36
|
+
import { Video as To } from "./components/Video/index.js";
|
|
36
37
|
export {
|
|
37
38
|
e as Accordion,
|
|
38
39
|
m as AlertBar,
|
|
39
40
|
x as Breadcrumbs,
|
|
40
41
|
a as Button,
|
|
41
42
|
n as CalendarComponent,
|
|
42
|
-
|
|
43
|
+
d as Card,
|
|
43
44
|
c as Carousel,
|
|
44
45
|
I as CarouselThumbnail,
|
|
45
46
|
C as Checkbox,
|
|
46
47
|
g as Collapsible,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
S as Counter,
|
|
49
|
+
v as DetailUpdater,
|
|
50
|
+
D as Dialog,
|
|
51
|
+
N as Dropdown,
|
|
51
52
|
G as Footer,
|
|
52
53
|
U as FooterNav,
|
|
53
54
|
k as Form,
|
|
@@ -63,10 +64,11 @@ export {
|
|
|
63
64
|
oo as Pill,
|
|
64
65
|
eo as Search,
|
|
65
66
|
mo as Select,
|
|
66
|
-
xo as
|
|
67
|
-
ao as
|
|
68
|
-
no as
|
|
69
|
-
uo as
|
|
70
|
-
so as
|
|
71
|
-
bo as
|
|
67
|
+
xo as SplitCard,
|
|
68
|
+
ao as Stars,
|
|
69
|
+
no as Testimonial,
|
|
70
|
+
uo as TextArea,
|
|
71
|
+
so as Timeline,
|
|
72
|
+
bo as Tubestops,
|
|
73
|
+
To as Video
|
|
72
74
|
};
|