trepur_components 2.3.9 → 2.3.11
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/_virtual/react.js +4 -0
- package/lib/components/Accordion/Accordion.stories.d.ts +47 -0
- package/lib/components/Accordion/const.d.ts +31 -0
- package/lib/components/Accordion/index.d.ts +5 -0
- package/lib/components/Accordion/index.js +9 -0
- package/lib/components/AlertBar/AlertBar.stories.d.ts +25 -0
- package/lib/components/AlertBar/index.d.ts +15 -0
- package/lib/components/AlertBar/index.js +66 -0
- package/lib/components/Avatar/Avatar.stories.d.ts +10 -0
- package/lib/components/Avatar/index.d.ts +3 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.stories.d.ts +18 -0
- package/lib/components/Breadcrumbs/index.d.ts +15 -0
- package/lib/components/Breadcrumbs/index.js +49 -0
- package/lib/components/Button/Button.stories.d.ts +24 -0
- package/lib/components/Button/index.d.ts +14 -0
- package/lib/components/Button/index.js +43 -0
- package/lib/components/Calendar/Calendar.stories.d.ts +11 -0
- package/lib/components/Calendar/index.d.ts +14 -0
- package/lib/components/Calendar/index.js +49 -0
- package/lib/components/Calendar/style.css.js +1 -0
- package/lib/components/Card/Card.stories.d.ts +11 -0
- package/lib/components/Card/index.d.ts +2 -0
- package/lib/components/Card/index.js +25 -0
- package/lib/components/Carousel/Carousel.stories.d.ts +23 -0
- package/lib/components/Carousel/index.d.ts +70 -0
- package/lib/components/Carousel/index.js +159 -0
- package/lib/components/Carousel/utils.d.ts +1 -0
- package/lib/components/Carousel/utils.js +38 -0
- package/lib/components/CarouselThumbnail/CarouselThumbnail.stories.d.ts +22 -0
- package/lib/components/CarouselThumbnail/const.d.ts +1 -0
- package/lib/components/CarouselThumbnail/const.js +20 -0
- package/lib/components/CarouselThumbnail/index.d.ts +51 -0
- package/lib/components/CarouselThumbnail/index.js +74 -0
- package/lib/components/CarouselThumbnail/utils.d.ts +2 -0
- package/lib/components/CarouselThumbnail/utils.js +65 -0
- package/lib/components/Checkbox/Checkbox.stories.d.ts +17 -0
- package/lib/components/Checkbox/index.d.ts +11 -0
- package/lib/components/Checkbox/index.js +28 -0
- package/lib/components/Collapsible/Collapsible.stories.d.ts +57 -0
- package/lib/components/Collapsible/index.d.ts +19 -0
- package/lib/components/Collapsible/index.js +87 -0
- package/lib/components/Counter/Counter.stories.d.ts +17 -0
- package/lib/components/Counter/index.d.ts +14 -0
- package/lib/components/Counter/index.js +49 -0
- package/lib/components/DetailUpdater/DetailUpdater.stories.d.ts +20 -0
- package/lib/components/DetailUpdater/index.d.ts +18 -0
- package/lib/components/DetailUpdater/index.js +63 -0
- package/lib/components/Dialog/Dialog.stories.d.ts +15 -0
- package/lib/components/Dialog/index.d.ts +12 -0
- package/lib/components/Dialog/index.js +16 -0
- package/lib/components/Dropdown/Dropdown.stories.d.ts +17 -0
- package/lib/components/Dropdown/index.d.ts +13 -0
- package/lib/components/Dropdown/index.js +66 -0
- package/lib/components/Dropdown/utils.d.ts +1 -0
- package/lib/components/Dropdown/utils.js +14 -0
- package/lib/components/FileUploader/FilePreview.d.ts +8 -0
- package/lib/components/FileUploader/FileUploader.stories.d.ts +52 -0
- package/lib/components/FileUploader/index.d.ts +15 -0
- package/lib/components/Footer/Footer.stories.d.ts +19 -0
- package/lib/components/Footer/index.d.ts +16 -0
- package/lib/components/Footer/index.js +36 -0
- package/lib/components/FooterNav/FooterNav.stories.d.ts +22 -0
- package/lib/components/FooterNav/index.d.ts +15 -0
- package/lib/components/FooterNav/index.js +38 -0
- package/lib/components/Form/Form.stories.d.ts +117 -0
- package/lib/components/Form/index.d.ts +13 -0
- package/lib/components/Form/index.js +17 -0
- package/lib/components/Gallery/Gallery.stories.d.ts +16 -0
- package/lib/components/Gallery/index.d.ts +7 -0
- package/lib/components/Greeting/Greeting.stories.d.ts +13 -0
- package/lib/components/Greeting/index.d.ts +7 -0
- package/lib/components/Greeting/index.js +20 -0
- package/lib/components/HamburgerIcon/HamburgerIcon.stories.d.ts +10 -0
- package/lib/components/HamburgerIcon/index.d.ts +2 -0
- package/lib/components/HamburgerIcon/index.js +78 -0
- package/lib/components/Icon/Icon.stories.d.ts +16 -0
- package/lib/components/Icon/index.d.ts +10 -0
- package/lib/components/Icon/index.js +23 -0
- package/lib/components/Image/Image.stories.d.ts +13 -0
- package/lib/components/Image/index.d.ts +5 -0
- package/lib/components/Image/index.js +17 -0
- package/lib/components/ImageCard/ImageCard.stories.d.ts +19 -0
- package/lib/components/ImageCard/index.d.ts +11 -0
- package/lib/components/ImageCard/index.js +32 -0
- package/lib/components/Input/Input.stories.d.ts +22 -0
- package/lib/components/Input/index.d.ts +33 -0
- package/lib/components/Input/index.js +83 -0
- package/lib/components/MenuButton/MenuButton.stories.d.ts +76 -0
- package/lib/components/MenuButton/index.d.ts +14 -0
- package/lib/components/MenuButton/index.js +56 -0
- package/lib/components/Modal/Modal.stories.d.ts +67 -0
- package/lib/components/Modal/index.d.ts +10 -0
- package/lib/components/Modal/index.js +45 -0
- package/lib/components/Nav/Nav.stories.d.ts +31 -0
- package/lib/components/Nav/index.d.ts +20 -0
- package/lib/components/Nav/index.js +81 -0
- package/lib/components/NavItem/NavItem.stories.d.ts +17 -0
- package/lib/components/NavItem/index.d.ts +8 -0
- package/lib/components/NavItem/index.js +31 -0
- package/lib/components/Pill/Pill.stories.d.ts +22 -0
- package/lib/components/Pill/index.d.ts +17 -0
- package/lib/components/Pill/index.js +30 -0
- package/lib/components/Search/Search.stories.d.ts +86 -0
- package/lib/components/Search/index.d.ts +12 -0
- package/lib/components/Search/index.js +42 -0
- package/lib/components/Select/Select.stories.d.ts +56 -0
- package/lib/components/Select/index.d.ts +11 -0
- package/lib/components/Select/index.js +68 -0
- package/lib/components/Showcase/Showcase.stories.d.ts +55 -0
- package/lib/components/Showcase/index.d.ts +15 -0
- package/lib/components/SideNav/SideNav.stories.d.ts +80 -0
- package/lib/components/SideNav/index.d.ts +12 -0
- package/lib/components/SocialButton/SocialButton.stories.d.ts +130 -0
- package/lib/components/SocialButton/index.d.ts +12 -0
- package/lib/components/SplitCard/SplitCard.stories.d.ts +21 -0
- package/lib/components/SplitCard/index.d.ts +14 -0
- package/lib/components/Stars/Star.stories.d.ts +14 -0
- package/lib/components/Stars/index.d.ts +8 -0
- package/lib/components/Stars/index.js +22 -0
- package/lib/components/Testimonial/Testimonial.stories.d.ts +21 -0
- package/lib/components/Testimonial/index.d.ts +13 -0
- package/lib/components/Testimonial/index.js +42 -0
- package/lib/components/TextArea/TextArea.stories.d.ts +21 -0
- package/lib/components/TextArea/index.d.ts +33 -0
- package/lib/components/TextArea/index.js +76 -0
- package/lib/components/Timeline/Timeline.stories.d.ts +21 -0
- package/lib/components/Timeline/index.d.ts +11 -0
- package/lib/components/Timeline/index.js +31 -0
- package/lib/components/Tubestops/Tubestops.stories.d.ts +19 -0
- package/lib/components/Tubestops/index.d.ts +15 -0
- package/lib/components/Tubestops/index.js +77 -0
- package/lib/components/Video/Video.stories.d.ts +23 -0
- package/lib/components/Video/index.d.ts +18 -0
- package/lib/components/Video/index.js +32 -0
- package/{src/components/index.ts → lib/components/index.d.ts} +35 -71
- package/lib/documentation/assets/index.d.ts +3 -0
- package/lib/documentation/typography/Fonts/Fonts.d.ts +2 -0
- package/lib/documentation/typography/Fonts/Fonts.stories.d.ts +10 -0
- package/lib/index.js +72 -0
- package/lib/node_modules/keen-slider/keen-slider.min.css.js +1 -0
- package/lib/node_modules/keen-slider/react.js +591 -0
- package/lib/style.css +1 -0
- package/lib/styles/global.css +19 -0
- package/{src → lib}/styles/themes/local.css +9 -1
- package/lib/styles/themes/penrithmrt.css +101 -0
- package/{tailwind → lib/tailwind}/colors.ts +12 -1
- package/lib/utils/controls.d.ts +36 -0
- package/lib/utils/matchMedia.d.ts +2 -0
- package/lib/utils/screens.d.ts +7 -0
- package/package.json +4 -1
- package/.eslintrc.cjs +0 -72
- package/.husky/pre-commit +0 -4
- package/.prettierignore +0 -10
- package/.prettierrc.json +0 -22
- package/postcss.config.js +0 -8
- package/src/components/Accordion/Accordion.stories.tsx +0 -39
- package/src/components/Accordion/const.tsx +0 -34
- package/src/components/Accordion/index.tsx +0 -22
- package/src/components/AlertBar/AlertBar.stories.tsx +0 -89
- package/src/components/AlertBar/index.tsx +0 -82
- package/src/components/Avatar/Avatar.stories.tsx +0 -14
- package/src/components/Avatar/index.tsx +0 -492
- package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +0 -29
- package/src/components/Breadcrumbs/index.tsx +0 -89
- package/src/components/Button/Button.stories.tsx +0 -24
- package/src/components/Button/index.tsx +0 -59
- package/src/components/Calendar/Calendar.stories.tsx +0 -21
- package/src/components/Calendar/index.tsx +0 -92
- package/src/components/Calendar/style.css +0 -233
- package/src/components/Card/Card.stories.tsx +0 -14
- package/src/components/Card/index.tsx +0 -39
- package/src/components/Carousel/Carousel.stories.tsx +0 -44
- package/src/components/Carousel/index.tsx +0 -301
- package/src/components/Carousel/utils.ts +0 -53
- package/src/components/CarouselThumbnail/CarouselThumbnail.stories.tsx +0 -29
- package/src/components/CarouselThumbnail/const.ts +0 -17
- package/src/components/CarouselThumbnail/index.tsx +0 -169
- package/src/components/CarouselThumbnail/utils.ts +0 -87
- package/src/components/Checkbox/Checkbox.mdx +0 -33
- package/src/components/Checkbox/Checkbox.stories.tsx +0 -27
- package/src/components/Checkbox/index.tsx +0 -44
- package/src/components/Collapsible/Collapsible.stories.tsx +0 -67
- package/src/components/Collapsible/index.tsx +0 -169
- package/src/components/Counter/Counter.stories.tsx +0 -20
- package/src/components/Counter/index.tsx +0 -98
- package/src/components/DetailUpdater/DetailUpdater.stories.tsx +0 -37
- package/src/components/DetailUpdater/index.tsx +0 -107
- package/src/components/Dialog/Dialog.stories.tsx +0 -65
- package/src/components/Dialog/index.tsx +0 -29
- package/src/components/Dropdown/Dropdown.stories.tsx +0 -22
- package/src/components/Dropdown/index.tsx +0 -117
- package/src/components/Dropdown/utils.ts +0 -15
- package/src/components/FileUploader/FilePreview.tsx +0 -45
- package/src/components/FileUploader/FileUploader.stories.tsx +0 -28
- package/src/components/FileUploader/index.tsx +0 -177
- package/src/components/Footer/Footer.stories.tsx +0 -47
- package/src/components/Footer/index.tsx +0 -96
- package/src/components/FooterNav/FooterNav.stories.tsx +0 -32
- package/src/components/FooterNav/index.tsx +0 -75
- package/src/components/Form/Form.stories.tsx +0 -86
- package/src/components/Form/index.tsx +0 -41
- package/src/components/Gallery/Gallery.stories.tsx +0 -39
- package/src/components/Gallery/index.tsx +0 -31
- package/src/components/Greeting/Greeting.stories.tsx +0 -16
- package/src/components/Greeting/index.tsx +0 -49
- package/src/components/HamburgerIcon/HamburgerIcon.stories.tsx +0 -14
- package/src/components/HamburgerIcon/index.tsx +0 -75
- package/src/components/Icon/Icon.stories.tsx +0 -41
- package/src/components/Icon/index.tsx +0 -33
- package/src/components/Image/Image.stories.tsx +0 -17
- package/src/components/Image/index.tsx +0 -25
- package/src/components/ImageCard/ImageCard.stories.tsx +0 -29
- package/src/components/ImageCard/index.tsx +0 -75
- package/src/components/Input/Input.stories.tsx +0 -25
- package/src/components/Input/index.tsx +0 -139
- package/src/components/MenuButton/MenuButton.stories.tsx +0 -46
- package/src/components/MenuButton/index.tsx +0 -66
- package/src/components/Modal/Modal.stories.tsx +0 -82
- package/src/components/Modal/index.tsx +0 -71
- package/src/components/Nav/Nav.stories.tsx +0 -80
- package/src/components/Nav/index.tsx +0 -171
- package/src/components/NavItem/NavItem.stories.tsx +0 -17
- package/src/components/NavItem/index.tsx +0 -39
- package/src/components/Pill/Pill.stories.tsx +0 -51
- package/src/components/Pill/index.tsx +0 -69
- package/src/components/Search/Search.stories.tsx +0 -63
- package/src/components/Search/index.tsx +0 -64
- package/src/components/Select/Select.stories.tsx +0 -55
- package/src/components/Select/index.tsx +0 -97
- package/src/components/Showcase/Showcase.stories.tsx +0 -31
- package/src/components/Showcase/index.tsx +0 -62
- package/src/components/SideNav/SideNav.stories.tsx +0 -50
- package/src/components/SideNav/index.tsx +0 -39
- package/src/components/SocialButton/SocialButton.stories.tsx +0 -88
- package/src/components/SocialButton/index.tsx +0 -63
- package/src/components/SplitCard/SplitCard.stories.tsx +0 -34
- package/src/components/SplitCard/index.tsx +0 -132
- package/src/components/Stars/Star.stories.tsx +0 -18
- package/src/components/Stars/index.tsx +0 -38
- package/src/components/Testimonial/Testimonial.stories.tsx +0 -37
- package/src/components/Testimonial/index.tsx +0 -123
- package/src/components/TextArea/TextArea.stories.tsx +0 -24
- package/src/components/TextArea/index.tsx +0 -133
- package/src/components/Timeline/Timeline.stories.tsx +0 -45
- package/src/components/Timeline/index.tsx +0 -65
- package/src/components/Tubestops/Tubestops.stories.tsx +0 -22
- package/src/components/Tubestops/index.tsx +0 -132
- package/src/components/Video/Video.stories.tsx +0 -58
- package/src/components/Video/assets/example.mp4 +0 -0
- package/src/components/Video/assets/example.ogv +0 -0
- package/src/components/Video/assets/example.webm +0 -0
- package/src/components/Video/index.tsx +0 -92
- package/src/custom.d.ts +0 -14
- package/src/documentation/Colours.mdx +0 -192
- package/src/documentation/Introduction.mdx +0 -13
- package/src/documentation/assets/index.ts +0 -3
- package/src/documentation/assets/trepurComponentsLogo.svg +0 -32
- package/src/documentation/typography/Fonts/Fonts.stories.tsx +0 -14
- package/src/documentation/typography/Fonts/Fonts.tsx +0 -73
- package/src/fonts/Sora/OFL.txt +0 -93
- package/src/fonts/Sora/README.txt +0 -70
- package/src/fonts/Sora/Sora-VariableFont_wght.ttf +0 -0
- package/src/fonts/Sora/static/Sora-Bold.ttf +0 -0
- package/src/fonts/Sora/static/Sora-ExtraBold.ttf +0 -0
- package/src/fonts/Sora/static/Sora-ExtraLight.ttf +0 -0
- package/src/fonts/Sora/static/Sora-Light.ttf +0 -0
- package/src/fonts/Sora/static/Sora-Medium.ttf +0 -0
- package/src/fonts/Sora/static/Sora-Regular.ttf +0 -0
- package/src/fonts/Sora/static/Sora-SemiBold.ttf +0 -0
- package/src/fonts/Sora/static/Sora-Thin.ttf +0 -0
- package/src/styles/global.css +0 -75
- package/src/styles/themes/test.css +0 -28
- package/src/utils/controls.ts +0 -44
- package/src/utils/matchMedia.ts +0 -9
- package/src/utils/screens.ts +0 -7
- package/tailwind.config.ts +0 -13
- package/tsconfig.json +0 -49
- package/tsconfig.node.json +0 -12
- package/vite.config.mjs +0 -64
- /package/{src/index.ts → lib/index.d.ts} +0 -0
- /package/{tailwind → lib/tailwind}/boxShadow.ts +0 -0
- /package/{tailwind → lib/tailwind}/container.ts +0 -0
- /package/{tailwind → lib/tailwind}/preset.ts +0 -0
- /package/{tailwind → lib/tailwind}/spacing.ts +0 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as L, forwardRef as p, useState as j, useMemo as O, useContext as b } from "react";
|
|
3
|
+
import { Icon as D } from "../Icon/index.js";
|
|
4
|
+
import { faChevronRight as T, faChevronLeft as $, faCircle as M } from "@fortawesome/fontawesome-free-solid";
|
|
5
|
+
import v from "clsx";
|
|
6
|
+
import "../../node_modules/keen-slider/keen-slider.min.css.js";
|
|
7
|
+
import { useKeenSlider as W } from "../../node_modules/keen-slider/react.js";
|
|
8
|
+
import { WheelControls as q } from "./utils.js";
|
|
9
|
+
const N = L(null), P = p(
|
|
10
|
+
({
|
|
11
|
+
breakpoints: l,
|
|
12
|
+
children: c,
|
|
13
|
+
className: n,
|
|
14
|
+
loop: t,
|
|
15
|
+
perView: a,
|
|
16
|
+
rubberband: r,
|
|
17
|
+
spacing: u,
|
|
18
|
+
...e
|
|
19
|
+
}, i) => {
|
|
20
|
+
const [h, d] = j(1), [x, y] = j(!1), [f, o] = W(
|
|
21
|
+
{
|
|
22
|
+
breakpoints: l,
|
|
23
|
+
loop: t,
|
|
24
|
+
rubberband: r,
|
|
25
|
+
slideChanged(m) {
|
|
26
|
+
d(m.track.details.rel);
|
|
27
|
+
},
|
|
28
|
+
created() {
|
|
29
|
+
y(!0);
|
|
30
|
+
},
|
|
31
|
+
slides: {
|
|
32
|
+
spacing: u,
|
|
33
|
+
perView: a
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
[q]
|
|
37
|
+
), w = O(
|
|
38
|
+
() => ({
|
|
39
|
+
sliderRef: f,
|
|
40
|
+
instanceRef: o,
|
|
41
|
+
currentSlide: h,
|
|
42
|
+
setCurrentSlide: d,
|
|
43
|
+
perView: a,
|
|
44
|
+
...e
|
|
45
|
+
}),
|
|
46
|
+
[
|
|
47
|
+
e,
|
|
48
|
+
f,
|
|
49
|
+
o.current,
|
|
50
|
+
h,
|
|
51
|
+
d,
|
|
52
|
+
a,
|
|
53
|
+
x
|
|
54
|
+
]
|
|
55
|
+
), g = (m) => {
|
|
56
|
+
var C;
|
|
57
|
+
m.key === "Tab" && ((C = o.current) == null || C.next());
|
|
58
|
+
};
|
|
59
|
+
return /* @__PURE__ */ s(N.Provider, { value: w, children: /* @__PURE__ */ s(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
onKeyDown: g,
|
|
63
|
+
className: v("navigation-wrapper w-full", n),
|
|
64
|
+
ref: i,
|
|
65
|
+
...e,
|
|
66
|
+
children: c
|
|
67
|
+
}
|
|
68
|
+
) });
|
|
69
|
+
}
|
|
70
|
+
), R = p(({ children: l, className: c, ...n }, t) => /* @__PURE__ */ s(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
ref: t,
|
|
74
|
+
className: v(
|
|
75
|
+
"navigation-wrapper flex w-full justify-between gap-4",
|
|
76
|
+
c
|
|
77
|
+
),
|
|
78
|
+
...n,
|
|
79
|
+
children: l
|
|
80
|
+
}
|
|
81
|
+
)), z = p(({ className: l, children: c, rightArrow: n = !1, ...t }) => {
|
|
82
|
+
const { sliderRef: a } = b(N) || {};
|
|
83
|
+
return /* @__PURE__ */ s(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
ref: a,
|
|
87
|
+
className: v("keen-slider w-full pb-4", l),
|
|
88
|
+
...t,
|
|
89
|
+
children: c
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}), I = p(({ className: l, children: c, rightArrow: n = !1, ...t }, a) => {
|
|
93
|
+
const { instanceRef: r } = b(N) || {};
|
|
94
|
+
return /* @__PURE__ */ s(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
ref: a,
|
|
98
|
+
className: v(
|
|
99
|
+
"my-auto text-carousel-arrow-default hover:cursor-pointer hover:text-carousel-arrow-hover",
|
|
100
|
+
l
|
|
101
|
+
),
|
|
102
|
+
onClick: (u) => {
|
|
103
|
+
var e, i;
|
|
104
|
+
n ? u.stopPropagation() !== void 0 || ((e = r.current) == null || e.next()) : u.stopPropagation() !== void 0 || ((i = r.current) == null || i.prev());
|
|
105
|
+
},
|
|
106
|
+
...t,
|
|
107
|
+
children: /* @__PURE__ */ s("a", { children: /* @__PURE__ */ s(D, { icon: n ? T : $, size: "3x" }) })
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
}), K = p(({ className: l, children: c, onClick: n, ...t }, a) => {
|
|
111
|
+
var d, x, y, f;
|
|
112
|
+
const {
|
|
113
|
+
instanceRef: r,
|
|
114
|
+
loop: u,
|
|
115
|
+
currentSlide: e = 1,
|
|
116
|
+
perView: i = 1
|
|
117
|
+
} = b(N) || {}, h = (f = (y = (x = (d = r == null ? void 0 : r.current) == null ? void 0 : d.track) == null ? void 0 : x.details) == null ? void 0 : y.slides) == null ? void 0 : f.length;
|
|
118
|
+
return /* @__PURE__ */ s("div", { className: "flex justify-center", children: [...Array(h).keys()].map((o) => {
|
|
119
|
+
var m, C, k, S;
|
|
120
|
+
const w = ((S = (k = (C = (m = r == null ? void 0 : r.current) == null ? void 0 : m.track) == null ? void 0 : C.details) == null ? void 0 : k.slides) == null ? void 0 : S.length) ?? 1, g = u ? e + i <= w ? o >= e && o < e + i : o >= e || e + i - w - 1 >= o : e === o;
|
|
121
|
+
return /* @__PURE__ */ s(
|
|
122
|
+
"button",
|
|
123
|
+
{
|
|
124
|
+
ref: a,
|
|
125
|
+
type: "button",
|
|
126
|
+
onClick: () => {
|
|
127
|
+
var A;
|
|
128
|
+
(A = r.current) == null || A.moveToIdx(o);
|
|
129
|
+
},
|
|
130
|
+
"aria-label": `carousel-button${t.id ? `-${t.id}` : ""}`,
|
|
131
|
+
children: /* @__PURE__ */ s(
|
|
132
|
+
D,
|
|
133
|
+
{
|
|
134
|
+
className: v(
|
|
135
|
+
"hover:text-carousel-dots-hover",
|
|
136
|
+
g ? "text-carousel-dots-active" : "text-carousel-dots-default"
|
|
137
|
+
),
|
|
138
|
+
icon: M,
|
|
139
|
+
size: "2x"
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}) });
|
|
145
|
+
});
|
|
146
|
+
P.displayName = "Carousel";
|
|
147
|
+
R.displayName = "Carousel.Content";
|
|
148
|
+
I.displayName = "Carousel.Arrow";
|
|
149
|
+
K.displayName = "Carousel.Dots";
|
|
150
|
+
z.displayName = "Carousel.Slides";
|
|
151
|
+
const X = Object.assign(P, {
|
|
152
|
+
Content: R,
|
|
153
|
+
Arrow: I,
|
|
154
|
+
Dots: K,
|
|
155
|
+
Slides: z
|
|
156
|
+
});
|
|
157
|
+
export {
|
|
158
|
+
X as Carousel
|
|
159
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function WheelControls(slider: any): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
function h(n) {
|
|
2
|
+
let i, t, a;
|
|
3
|
+
function o(e, s) {
|
|
4
|
+
t.x -= e.deltaX, t.y -= e.deltaY, n.container.dispatchEvent(
|
|
5
|
+
new CustomEvent(s, {
|
|
6
|
+
detail: {
|
|
7
|
+
x: t.x,
|
|
8
|
+
y: t.y
|
|
9
|
+
}
|
|
10
|
+
})
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
function c(e) {
|
|
14
|
+
t = {
|
|
15
|
+
x: e.pageX,
|
|
16
|
+
y: e.pageY
|
|
17
|
+
}, o(e, "ksDragStart");
|
|
18
|
+
}
|
|
19
|
+
function l(e) {
|
|
20
|
+
o(e, "ksDrag");
|
|
21
|
+
}
|
|
22
|
+
function u(e) {
|
|
23
|
+
o(e, "ksDragEnd");
|
|
24
|
+
}
|
|
25
|
+
function r(e) {
|
|
26
|
+
a || (c(e), a = !0), l(e), clearTimeout(i), i = setTimeout(() => {
|
|
27
|
+
a = !1, u(e);
|
|
28
|
+
}, 50);
|
|
29
|
+
}
|
|
30
|
+
n.on("created", () => {
|
|
31
|
+
n.container.addEventListener("wheel", r, {
|
|
32
|
+
passive: !0
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
h as WheelControls
|
|
38
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { CarouselThumbnail } from './';
|
|
3
|
+
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('./').CarouselThumbnailContextProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
7
|
+
Slides: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
|
+
Slide: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLImageElement> & {
|
|
9
|
+
src: string;
|
|
10
|
+
} & import('react').RefAttributes<HTMLImageElement>>;
|
|
11
|
+
};
|
|
12
|
+
args: {
|
|
13
|
+
children: import("react/jsx-runtime").JSX.Element[];
|
|
14
|
+
loop: true;
|
|
15
|
+
drag: true;
|
|
16
|
+
rubberband: true;
|
|
17
|
+
spacing: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj<typeof CarouselThumbnail>;
|
|
22
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const breakpointsToRender: any;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const i = {
|
|
2
|
+
"(min-width: 320px)": {
|
|
3
|
+
slides: { perView: 1, spacing: 25 }
|
|
4
|
+
},
|
|
5
|
+
"(max-width: 500px)": {
|
|
6
|
+
slides: { perView: 1, spacing: 25 }
|
|
7
|
+
},
|
|
8
|
+
"(min-width: 768px)": {
|
|
9
|
+
slides: { perView: 1, spacing: 25 }
|
|
10
|
+
},
|
|
11
|
+
"(min-width: 1024px)": {
|
|
12
|
+
slides: { perView: 2, spacing: 20 }
|
|
13
|
+
},
|
|
14
|
+
"(min-width: 1280px)": {
|
|
15
|
+
slides: { perView: 2, spacing: 10 }
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
i as breakpointsToRender
|
|
20
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { KeenSliderInstance, KeenSliderHooks, KeenSliderOptions } from 'keen-slider/react';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface CarouselThumbnailContextProps {
|
|
5
|
+
slideWrapperClassName?: string;
|
|
6
|
+
breakpoints?: Record<string, Omit<KeenSliderOptions<{}, {}, KeenSliderHooks>, 'breakpoints'>>;
|
|
7
|
+
defaultAnimation?: {
|
|
8
|
+
duration?: number;
|
|
9
|
+
easing?: (t: number) => number;
|
|
10
|
+
};
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
drag?: boolean;
|
|
13
|
+
dragSpeed?: number;
|
|
14
|
+
initial?: number;
|
|
15
|
+
loop?: boolean;
|
|
16
|
+
mode?: 'snap' | 'free' | 'free-snap';
|
|
17
|
+
range?: {
|
|
18
|
+
align?: boolean;
|
|
19
|
+
min?: number;
|
|
20
|
+
max?: number;
|
|
21
|
+
};
|
|
22
|
+
renderMode?: 'precision' | 'performance' | 'custom';
|
|
23
|
+
rtl?: boolean;
|
|
24
|
+
rubberband?: boolean;
|
|
25
|
+
slides?: any[];
|
|
26
|
+
vertical?: boolean;
|
|
27
|
+
animationStarted?: (slider: KeenSliderInstance<{}, {}, KeenSliderHooks>) => void;
|
|
28
|
+
animationStopped?: (slider: KeenSliderInstance<{}, {}, KeenSliderHooks>) => void;
|
|
29
|
+
animationEnded?: (slider: KeenSliderInstance<{}, {}, KeenSliderHooks>) => void;
|
|
30
|
+
created?: (slider: KeenSliderInstance<{}, {}, KeenSliderHooks>) => void;
|
|
31
|
+
destroyed?: (slider: KeenSliderInstance<{}, {}, KeenSliderHooks>) => void;
|
|
32
|
+
detailsChanged?: (slider: KeenSliderInstance<{}, {}, KeenSliderHooks>) => void;
|
|
33
|
+
dragged?: (slider: KeenSliderInstance<{}, {}, KeenSliderHooks>) => void;
|
|
34
|
+
dragStarted?: (slider: KeenSliderInstance<{}, {}, KeenSliderHooks>) => void;
|
|
35
|
+
dragChecked?: (slider: KeenSliderInstance<{}, {}, KeenSliderHooks>) => void;
|
|
36
|
+
dragEnded?: (slider: KeenSliderInstance<{}, {}, KeenSliderHooks>) => void;
|
|
37
|
+
beforeOptionsChanged?: (slider: KeenSliderInstance<{}, {}, KeenSliderHooks>) => void;
|
|
38
|
+
optionsChanged?: (slider: KeenSliderInstance<{}, {}, KeenSliderHooks>) => void;
|
|
39
|
+
slideChanged?: boolean;
|
|
40
|
+
updated?: (slider: KeenSliderInstance<{}, {}, KeenSliderHooks>) => void;
|
|
41
|
+
spacing?: number;
|
|
42
|
+
number?: number;
|
|
43
|
+
origin?: number | 'auto' | 'center';
|
|
44
|
+
}
|
|
45
|
+
declare const CarouselThumbnail: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & CarouselThumbnailContextProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
46
|
+
Slides: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
47
|
+
Slide: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLImageElement> & {
|
|
48
|
+
src: string;
|
|
49
|
+
} & import('react').RefAttributes<HTMLImageElement>>;
|
|
50
|
+
};
|
|
51
|
+
export { CarouselThumbnail };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx as l, jsxs as f, Fragment as C } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as T, forwardRef as o, useMemo as x, useContext as v } from "react";
|
|
3
|
+
import t from "clsx";
|
|
4
|
+
import "../../node_modules/keen-slider/keen-slider.min.css.js";
|
|
5
|
+
import { useKeenSlider as a } from "../../node_modules/keen-slider/react.js";
|
|
6
|
+
import { breakpointsToRender as N } from "./const.js";
|
|
7
|
+
import { WheelControls as S, ThumbnailPlugin as g } from "./utils.js";
|
|
8
|
+
const m = T(null), u = o(({ children: i, className: e, ...r }, s) => {
|
|
9
|
+
const n = x(
|
|
10
|
+
() => ({
|
|
11
|
+
...r
|
|
12
|
+
}),
|
|
13
|
+
[r]
|
|
14
|
+
);
|
|
15
|
+
return /* @__PURE__ */ l(m.Provider, { value: n, children: /* @__PURE__ */ l(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
ref: s,
|
|
19
|
+
className: t("navigation-wrapper w-full", e),
|
|
20
|
+
...r,
|
|
21
|
+
children: i
|
|
22
|
+
}
|
|
23
|
+
) });
|
|
24
|
+
}), d = o(({ className: i, children: e }) => {
|
|
25
|
+
const { rubberband: r, loop: s, ...n } = v(m) || {}, [b, p] = a(
|
|
26
|
+
{
|
|
27
|
+
breakpoints: N,
|
|
28
|
+
loop: s,
|
|
29
|
+
rubberband: r
|
|
30
|
+
},
|
|
31
|
+
[S]
|
|
32
|
+
), [h] = a(
|
|
33
|
+
{
|
|
34
|
+
initial: 0,
|
|
35
|
+
slides: {
|
|
36
|
+
perView: 4,
|
|
37
|
+
spacing: 10
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
[g(p)]
|
|
41
|
+
);
|
|
42
|
+
return /* @__PURE__ */ f(C, { children: [
|
|
43
|
+
/* @__PURE__ */ l(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
ref: b,
|
|
47
|
+
className: t(
|
|
48
|
+
"keen-slider h-96 w-full rounded-t-2xl pb-4",
|
|
49
|
+
i
|
|
50
|
+
),
|
|
51
|
+
...n,
|
|
52
|
+
children: e
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("div", { ref: h, className: "keen-slider thumbnail h-24 w-16", children: e }) })
|
|
56
|
+
] });
|
|
57
|
+
}), c = o(({ src: i, ...e }) => /* @__PURE__ */ l(
|
|
58
|
+
"img",
|
|
59
|
+
{
|
|
60
|
+
className: "keen-slider__slide rounded-t-2xl object-cover",
|
|
61
|
+
src: i,
|
|
62
|
+
...e
|
|
63
|
+
}
|
|
64
|
+
));
|
|
65
|
+
u.displayName = "CarouselThumbnail";
|
|
66
|
+
d.displayName = "CarouselThumbnail.Slides";
|
|
67
|
+
c.displayName = "CarouselThumbnail.Slide";
|
|
68
|
+
const F = Object.assign(u, {
|
|
69
|
+
Slides: d,
|
|
70
|
+
Slide: c
|
|
71
|
+
});
|
|
72
|
+
export {
|
|
73
|
+
F as CarouselThumbnail
|
|
74
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
function l(a) {
|
|
2
|
+
let e, c, o;
|
|
3
|
+
function r(t, d) {
|
|
4
|
+
c.x -= t.deltaX, c.y -= t.deltaY, a.container.dispatchEvent(
|
|
5
|
+
new CustomEvent(d, {
|
|
6
|
+
detail: {
|
|
7
|
+
x: c.x,
|
|
8
|
+
y: c.y
|
|
9
|
+
}
|
|
10
|
+
})
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
function n(t) {
|
|
14
|
+
c = {
|
|
15
|
+
x: t.pageX,
|
|
16
|
+
y: t.pageY
|
|
17
|
+
}, r(t, "ksDragStart");
|
|
18
|
+
}
|
|
19
|
+
function i(t) {
|
|
20
|
+
r(t, "ksDrag");
|
|
21
|
+
}
|
|
22
|
+
function u(t) {
|
|
23
|
+
r(t, "ksDragEnd");
|
|
24
|
+
}
|
|
25
|
+
function s(t) {
|
|
26
|
+
o || (n(t), o = !0), i(t), clearTimeout(e), e = setTimeout(() => {
|
|
27
|
+
o = !1, u(t);
|
|
28
|
+
}, 50);
|
|
29
|
+
}
|
|
30
|
+
a.on("created", () => {
|
|
31
|
+
a.container.addEventListener("wheel", s, {
|
|
32
|
+
passive: !0
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function v(a) {
|
|
37
|
+
return (e) => {
|
|
38
|
+
function c() {
|
|
39
|
+
e.slides.forEach((n) => {
|
|
40
|
+
n.classList.remove("active");
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function o(n) {
|
|
44
|
+
e.slides[n].classList.add("active");
|
|
45
|
+
}
|
|
46
|
+
function r() {
|
|
47
|
+
e.slides.forEach((n, i) => {
|
|
48
|
+
n.addEventListener("click", () => {
|
|
49
|
+
a.current && a.current.moveToIdx(i);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
e.on("created", () => {
|
|
54
|
+
a.current && (o(e.track.details.rel), r(), a.current.on("animationStarted", (n) => {
|
|
55
|
+
c();
|
|
56
|
+
const i = n.animator.targetIdx || 0;
|
|
57
|
+
o(n.track.absToRel(i)), e.moveToIdx(Math.min(e.track.details.maxIdx, i));
|
|
58
|
+
}));
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
v as ThumbnailPlugin,
|
|
64
|
+
l as WheelControls
|
|
65
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { Checkbox } from './';
|
|
3
|
+
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLLabelElement> & import('./').CheckboxProps & import('react').RefAttributes<HTMLLabelElement>> & {
|
|
7
|
+
Label: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLSpanElement> & import('./').CheckboxProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
8
|
+
};
|
|
9
|
+
args: {
|
|
10
|
+
onClick: import('@storybook/addon-actions').HandlerFunction;
|
|
11
|
+
children: import("react/jsx-runtime").JSX.Element[];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<typeof Checkbox>;
|
|
16
|
+
export declare const Checked: Story;
|
|
17
|
+
export declare const Unchecked: Story;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface CheckboxProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
onClick?: (isChecked: boolean) => void;
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const Checkbox: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLLabelElement> & CheckboxProps & import('react').RefAttributes<HTMLLabelElement>> & {
|
|
9
|
+
Label: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement> & CheckboxProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
10
|
+
};
|
|
11
|
+
export { Checkbox };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsxs as p, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as a, useState as d } from "react";
|
|
3
|
+
const c = a(({ children: e, checked: s, onClick: o }, h) => {
|
|
4
|
+
const [r, b] = d(s);
|
|
5
|
+
return /* @__PURE__ */ p("label", { ref: h, className: "flex items-center gap-4 hover:cursor-pointer", children: [
|
|
6
|
+
/* @__PURE__ */ t(
|
|
7
|
+
"input",
|
|
8
|
+
{
|
|
9
|
+
className: "h-6 w-6 rounded border-2",
|
|
10
|
+
onChange: () => {
|
|
11
|
+
b(!r);
|
|
12
|
+
},
|
|
13
|
+
onClick: () => o == null ? void 0 : o(!r),
|
|
14
|
+
type: "checkbox",
|
|
15
|
+
checked: r
|
|
16
|
+
}
|
|
17
|
+
),
|
|
18
|
+
e
|
|
19
|
+
] });
|
|
20
|
+
}), n = a(({ children: e }, s) => /* @__PURE__ */ t("span", { ref: s, children: e }));
|
|
21
|
+
c.displayName = "Checkbox";
|
|
22
|
+
n.displayName = "Checkbox.Label";
|
|
23
|
+
const l = Object.assign(c, {
|
|
24
|
+
Label: n
|
|
25
|
+
});
|
|
26
|
+
export {
|
|
27
|
+
l as Checkbox
|
|
28
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Collapsible } from '.';
|
|
2
|
+
import { StoryObj } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('.').CollapsibleContextProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
7
|
+
Header: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
|
+
HeaderContent: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
9
|
+
Image: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('../Image').ImageProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
10
|
+
Label: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
11
|
+
Title: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
12
|
+
Subtitle: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
13
|
+
Content: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
|
+
Text: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
15
|
+
};
|
|
16
|
+
parameters: {};
|
|
17
|
+
argTypes: {
|
|
18
|
+
id: {
|
|
19
|
+
description: string;
|
|
20
|
+
control: {
|
|
21
|
+
type: string;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
table: {
|
|
25
|
+
category: string;
|
|
26
|
+
type: {
|
|
27
|
+
summary: string;
|
|
28
|
+
};
|
|
29
|
+
defaultValue: {
|
|
30
|
+
summary: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
className: {
|
|
35
|
+
description: string;
|
|
36
|
+
control: {
|
|
37
|
+
type: string;
|
|
38
|
+
default: boolean;
|
|
39
|
+
};
|
|
40
|
+
table: {
|
|
41
|
+
category: string;
|
|
42
|
+
type: {
|
|
43
|
+
summary: string;
|
|
44
|
+
};
|
|
45
|
+
defaultValue: {
|
|
46
|
+
summary: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
args: {
|
|
52
|
+
children: import("react/jsx-runtime").JSX.Element[];
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export default meta;
|
|
56
|
+
type Story = StoryObj<typeof Collapsible>;
|
|
57
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ImageProps } from '../Image';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface CollapsibleContextProps {
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
expanded?: boolean;
|
|
7
|
+
setExpanded?: (expanded: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const Collapsible: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & CollapsibleContextProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
10
|
+
Header: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
11
|
+
HeaderContent: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
12
|
+
Image: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & ImageProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
13
|
+
Label: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
14
|
+
Title: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
15
|
+
Subtitle: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
16
|
+
Content: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
17
|
+
Text: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
18
|
+
};
|
|
19
|
+
export { Collapsible };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsx as a, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as w, forwardRef as o, useState as H, useMemo as T, useContext as p } from "react";
|
|
3
|
+
import { Icon as I } from "../Icon/index.js";
|
|
4
|
+
import { Image as S } from "../Image/index.js";
|
|
5
|
+
import { faChevronDown as j, faChevronUp as L } from "@fortawesome/fontawesome-free-solid";
|
|
6
|
+
import k from "clsx";
|
|
7
|
+
const n = w(null), c = o(({ id: e, className: l, children: t, loading: s, ...i }, v) => {
|
|
8
|
+
const [r, m] = H(!1), y = T(
|
|
9
|
+
() => ({
|
|
10
|
+
loading: s,
|
|
11
|
+
expanded: r,
|
|
12
|
+
setExpanded: m
|
|
13
|
+
}),
|
|
14
|
+
[s, r, m]
|
|
15
|
+
);
|
|
16
|
+
return /* @__PURE__ */ a(n.Provider, { value: y, children: /* @__PURE__ */ a(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
id: e,
|
|
20
|
+
className: "w-full rounded-2xl bg-white hover:cursor-pointer",
|
|
21
|
+
ref: v,
|
|
22
|
+
...i,
|
|
23
|
+
children: t
|
|
24
|
+
}
|
|
25
|
+
) });
|
|
26
|
+
}), d = o(({ children: e, ...l }, t) => {
|
|
27
|
+
const { expanded: s, setExpanded: i } = p(n) || {};
|
|
28
|
+
return /* @__PURE__ */ g(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
className: "flex h-24 pr-4 sm:pr-8",
|
|
32
|
+
onClick: () => i == null ? void 0 : i(!s),
|
|
33
|
+
ref: t,
|
|
34
|
+
...l,
|
|
35
|
+
children: [
|
|
36
|
+
e,
|
|
37
|
+
/* @__PURE__ */ a("div", { className: "my-auto flex-none", children: /* @__PURE__ */ a(I, { icon: s ? j : L }) })
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}), x = o(({ children: e, ...l }, t) => /* @__PURE__ */ a("div", { className: "mx-4 my-auto grid w-full", ref: t, ...l, children: e })), C = o(({ children: e, src: l, ...t }, s) => /* @__PURE__ */ a("div", { className: "aspect-square flex-none p-4", children: /* @__PURE__ */ a(S, { src: l, className: "h-full rounded-2xl", ...t }) })), b = o(({ ...e }, l) => /* @__PURE__ */ a(
|
|
42
|
+
"p",
|
|
43
|
+
{
|
|
44
|
+
className: "text-xxs text-light-grey truncate md:text-xs",
|
|
45
|
+
ref: l,
|
|
46
|
+
...e
|
|
47
|
+
}
|
|
48
|
+
)), u = o(({ ...e }, l) => /* @__PURE__ */ a("p", { className: "md:text-md truncate text-sm", ref: l, ...e })), N = o(({ ...e }, l) => /* @__PURE__ */ a("p", { className: "truncate text-xs md:text-sm", ref: l, ...e })), f = o(({ children: e, ...l }, t) => {
|
|
49
|
+
const { expanded: s } = p(n) || {};
|
|
50
|
+
return /* @__PURE__ */ a(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
className: k(
|
|
54
|
+
"w-auto overflow-scroll px-4 transition-max-height duration-300",
|
|
55
|
+
{
|
|
56
|
+
"max-h-32": s,
|
|
57
|
+
"max-h-0": !s
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
ref: t,
|
|
61
|
+
...l,
|
|
62
|
+
children: e
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}), h = o(({ ...e }, l) => /* @__PURE__ */ a("p", { className: "text-xs md:text-sm", ref: l, ...e }));
|
|
66
|
+
c.displayName = "Collapsible";
|
|
67
|
+
d.displayName = "Collapsible.Header";
|
|
68
|
+
f.displayName = "Collapsible.Content";
|
|
69
|
+
C.displayName = "Collapsible.Image";
|
|
70
|
+
b.displayName = "Collapsible.Label";
|
|
71
|
+
u.displayName = "Collapsible.Title";
|
|
72
|
+
N.displayName = "Collapsible.Subtitle";
|
|
73
|
+
x.displayName = "Collapsible.HeaderContent";
|
|
74
|
+
h.displayName = "Collapsible.Text";
|
|
75
|
+
const U = Object.assign(c, {
|
|
76
|
+
Header: d,
|
|
77
|
+
HeaderContent: x,
|
|
78
|
+
Image: C,
|
|
79
|
+
Label: b,
|
|
80
|
+
Title: u,
|
|
81
|
+
Subtitle: N,
|
|
82
|
+
Content: f,
|
|
83
|
+
Text: h
|
|
84
|
+
});
|
|
85
|
+
export {
|
|
86
|
+
U as Collapsible
|
|
87
|
+
};
|