trepur_components 2.3.35 → 2.3.37

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.
@@ -5,6 +5,9 @@ declare const meta: {
5
5
  title: string;
6
6
  component: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLAnchorElement> & import('react').RefAttributes<HTMLAnchorElement>> & {
7
7
  Image: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<import('../Image').ImageProps> & import('../Image').ImageProps & import('react').RefAttributes<HTMLImageElement>>;
8
+ Images: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
9
+ asCarousel?: boolean | undefined;
10
+ } & import('react').RefAttributes<HTMLDivElement>>;
8
11
  Content: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
9
12
  Title: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
10
13
  Subtitle: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
@@ -3,6 +3,9 @@ import { HTMLAttributes } from 'react';
3
3
 
4
4
  declare const ImageCard: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLAnchorElement> & import('react').RefAttributes<HTMLAnchorElement>> & {
5
5
  Image: import('react').ForwardRefExoticComponent<HTMLAttributes<ImageProps> & ImageProps & import('react').RefAttributes<HTMLImageElement>>;
6
+ Images: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
7
+ asCarousel?: boolean | undefined;
8
+ } & import('react').RefAttributes<HTMLDivElement>>;
6
9
  Content: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
7
10
  Title: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
8
11
  Subtitle: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
@@ -1,30 +1,46 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as m } from "react";
3
- import { Image as p } from "../Image/index.js";
4
- import C from "clsx";
5
- const d = m(({ className: a, children: e, onClick: r, ...g }, c) => /* @__PURE__ */ t("a", { ref: c, className: "", href: "", onClick: r, ...g, children: /* @__PURE__ */ t(
6
- "div",
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { forwardRef as r } from "react";
3
+ import { Image as C } from "../Image/index.js";
4
+ import N from "clsx";
5
+ import { Carousel as s } from "../Carousel/index.js";
6
+ const l = r(({ className: e, children: a, onClick: t, ...p }, I) => /* @__PURE__ */ m(
7
+ "a",
7
8
  {
8
- className: C(
9
- "grid max-w-96 overflow-hidden rounded-xl bg-white drop-shadow",
10
- a
11
- ),
12
- children: e
9
+ ref: I,
10
+ className: "inline-block h-full",
11
+ href: "",
12
+ onClick: t,
13
+ ...p,
14
+ children: /* @__PURE__ */ m(
15
+ "div",
16
+ {
17
+ className: N(
18
+ "grid max-w-96 overflow-hidden rounded-xl bg-white drop-shadow",
19
+ e
20
+ ),
21
+ children: a
22
+ }
23
+ )
13
24
  }
14
- ) })), s = m(({ src: a, ...e }) => /* @__PURE__ */ t("div", { className: "h-64 object-cover", children: /* @__PURE__ */ t(p, { src: a, ...e }) })), o = m(({ children: a, ...e }, r) => /* @__PURE__ */ t("div", { className: "px-2 pb-4 pt-2", ref: r, ...e, children: a })), i = m(({ ...a }, e) => /* @__PURE__ */ t("p", { className: "text-lg", ref: e, ...a })), l = m(({ ...a }, e) => /* @__PURE__ */ t("p", { className: "text-sm", ref: e, ...a })), n = m(({ ...a }, e) => /* @__PURE__ */ t("p", { className: "text-md pt-2", ref: e, ...a }));
15
- d.displayName = "ImageCard";
16
- s.displayName = "ImageCard.Image";
17
- i.displayName = "ImageCard.Title";
18
- l.displayName = "ImageCard.Subtitle";
25
+ )), d = r(({ children: e, asCarousel: a = !1, ...t }) => a ? /* @__PURE__ */ m(s, { perView: 1, spacing: 0, className: "h-64", loop: !0, ...t, children: /* @__PURE__ */ m(s.Content, { children: /* @__PURE__ */ m(s.Slides, { children: e }) }) }) : /* @__PURE__ */ m("div", { children: e[0] })), i = r(({ src: e, ...a }) => (
26
+ // <div className="keen-slider__slide h-64">
27
+ /* @__PURE__ */ m("div", { className: "h-64", children: /* @__PURE__ */ m(C, { className: "object-cover", src: e, ...a }) })
28
+ )), o = r(({ children: e, ...a }, t) => /* @__PURE__ */ m("div", { className: "px-2 pb-4 pt-2", ref: t, ...a, children: e })), n = r(({ ...e }, a) => /* @__PURE__ */ m("p", { className: "text-lg", ref: a, ...e })), c = r(({ ...e }, a) => /* @__PURE__ */ m("p", { className: "text-sm", ref: a, ...e })), g = r(({ ...e }, a) => /* @__PURE__ */ m("p", { className: "line-clamp-4 pt-4", ref: a, ...e }));
29
+ l.displayName = "ImageCard";
30
+ i.displayName = "ImageCard.Image";
31
+ d.displayName = "ImageCard.Images";
32
+ n.displayName = "ImageCard.Title";
33
+ c.displayName = "ImageCard.Subtitle";
19
34
  o.displayName = "ImageCard.Content";
20
- n.displayName = "ImageCard.Text";
21
- const b = Object.assign(d, {
22
- Image: s,
35
+ g.displayName = "ImageCard.Text";
36
+ const y = Object.assign(l, {
37
+ Image: i,
38
+ Images: d,
23
39
  Content: o,
24
- Title: i,
25
- Subtitle: l,
26
- Text: n
40
+ Title: n,
41
+ Subtitle: c,
42
+ Text: g
27
43
  });
28
44
  export {
29
- b as ImageCard
45
+ y as ImageCard
30
46
  };
@@ -18,3 +18,4 @@ type Story = StoryObj<typeof SplitCard>;
18
18
  export declare const Default: Story;
19
19
  export declare const swapDesktop: Story;
20
20
  export declare const swapMobile: Story;
21
+ export declare const loading: Story;
@@ -4,6 +4,7 @@ export interface SplitCardContextProps {
4
4
  swapDesktop?: boolean;
5
5
  swapMobile?: boolean;
6
6
  isMd?: boolean;
7
+ loading?: boolean;
7
8
  }
8
9
  declare const SplitCard: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & SplitCardContextProps & import('react').RefAttributes<HTMLDivElement>> & {
9
10
  LeftContent: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,85 +1,92 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { createContext as u, forwardRef as o, useMemo as N, useContext as c } from "react";
3
- import h from "../../utils/matchMedia.js";
1
+ import { jsx as e, jsxs as N } from "react/jsx-runtime";
2
+ import { createContext as S, forwardRef as n, useMemo as v, useContext as u } from "react";
3
+ import w from "../../utils/matchMedia.js";
4
4
  import { Screens as y } from "../../utils/screens.js";
5
- import d from "clsx";
6
- const a = u(null), g = o(({ className: r, children: l, swapDesktop: t, swapMobile: e, ...i }, s) => {
7
- const f = `(min-width: ${y.md})`, m = h(f), S = N(
8
- () => ({
9
- swapDesktop: t,
10
- swapMobile: e,
11
- isMd: m
12
- }),
13
- [t, e, m]
14
- );
15
- return /* @__PURE__ */ n(a.Provider, { value: S, children: /* @__PURE__ */ n(
16
- "div",
17
- {
18
- ref: s,
19
- ...i,
20
- className: d("grid grid-cols-1 md:grid-cols-2", r),
21
- children: l
22
- }
23
- ) });
24
- }), x = o(({ className: r, children: l, ...t }, e) => {
25
- const { swapDesktop: i, swapMobile: s, isMd: p } = c(a) || {};
26
- return /* @__PURE__ */ n(
5
+ import o from "clsx";
6
+ const p = S(null), g = n(
7
+ ({ className: r, children: a, swapDesktop: t, swapMobile: l, loading: s, ...i }, d) => {
8
+ const C = `(min-width: ${y.md})`, c = w(C), h = v(
9
+ () => ({
10
+ swapDesktop: t,
11
+ swapMobile: l,
12
+ isMd: c,
13
+ loading: s
14
+ }),
15
+ [t, l, c, s]
16
+ );
17
+ return /* @__PURE__ */ e(p.Provider, { value: h, children: /* @__PURE__ */ e(
18
+ "div",
19
+ {
20
+ ref: d,
21
+ ...i,
22
+ className: o("grid grid-cols-1 md:grid-cols-2", r),
23
+ children: a
24
+ }
25
+ ) });
26
+ }
27
+ ), f = n(({ className: r, children: a, ...t }, l) => {
28
+ const { swapDesktop: s, swapMobile: i, isMd: d, loading: m } = u(p) || {};
29
+ return m ? /* @__PURE__ */ e("div", { className: "pl-20 px-12 py-12 h-full w-full flex", children: /* @__PURE__ */ e("div", { className: "m-auto h-80 border-4 rounded border-gray-300 animate-pulse gap-4 grid w-full" }) }) : /* @__PURE__ */ e(
27
30
  "div",
28
31
  {
29
- ref: e,
32
+ ref: l,
30
33
  ...t,
31
- className: d(
34
+ className: o(
32
35
  "mx-auto flex items-center px-4 py-2 text-center md:p-8 lg:py-12",
33
36
  {
34
- "md:order-last lg:pl-12 lg:pr-20": i,
35
- "lg:pl-20 lg:pr-12": !i,
36
- "order-last": !p && s
37
+ "md:order-last lg:pl-12 lg:pr-20": s,
38
+ "lg:pl-20 lg:pr-12": !s,
39
+ "order-last": !d && i
37
40
  },
38
41
  r
39
42
  ),
40
- children: l
43
+ children: a
41
44
  }
42
45
  );
43
- }), C = o(({ className: r, children: l, ...t }, e) => {
44
- const { swapDesktop: i, swapMobile: s, isMd: p } = c(a) || {};
45
- return /* @__PURE__ */ n(
46
+ }), x = n(({ className: r, children: a, ...t }, l) => {
47
+ const { swapDesktop: s, swapMobile: i, isMd: d, loading: m } = u(p) || {};
48
+ return m ? /* @__PURE__ */ e("div", { className: "h-full w-full flex", children: /* @__PURE__ */ N("div", { className: "m-auto gap-4 grid w-10/12", children: [
49
+ /* @__PURE__ */ e("div", { className: "mx-auto h-8 bg-gray-300 rounded-full w-40 animate-pulse" }),
50
+ /* @__PURE__ */ e("div", { className: "h-6 bg-gray-300 rounded-full w-full animate-pulse" }),
51
+ /* @__PURE__ */ e("div", { className: "h-6 bg-gray-300 rounded-full w-full animate-pulse" })
52
+ ] }) }) : /* @__PURE__ */ e(
46
53
  "div",
47
54
  {
48
- ref: e,
55
+ ref: l,
49
56
  ...t,
50
- className: d(
57
+ className: o(
51
58
  "flex h-full items-center px-4 py-2 text-center md:p-8 lg:py-12",
52
59
  {
53
- "md:order-first lg:pl-20 lg:pr-12": i,
54
- "lg:pl-12 lg:pr-20": !i,
55
- "order-first": !p && s
60
+ "md:order-first lg:pl-20 lg:pr-12": s,
61
+ "lg:pl-12 lg:pr-20": !s,
62
+ "order-first": !d && i
56
63
  },
57
64
  r
58
65
  ),
59
- children: l
66
+ children: a
60
67
  }
61
68
  );
62
- }), M = o(({ className: r, children: l, ...t }, e) => /* @__PURE__ */ n(
69
+ }), b = n(({ className: r, children: a, ...t }, l) => /* @__PURE__ */ e(
63
70
  "p",
64
71
  {
65
- ref: e,
66
- className: d(
72
+ ref: l,
73
+ className: o(
67
74
  "items-center font-semibold tracking-wider md:text-4xl lg:text-6xl",
68
75
  r
69
76
  ),
70
77
  ...t,
71
- children: l
78
+ children: a
72
79
  }
73
- )), v = o(({ className: r, children: l, ...t }, e) => /* @__PURE__ */ n("p", { ref: e, className: d("text-lg", r), ...t, children: l }));
80
+ )), M = n(({ className: r, children: a, ...t }, l) => /* @__PURE__ */ e("p", { ref: l, className: o("text-lg", r), ...t, children: a }));
74
81
  g.displayName = "SplitCard";
75
- x.displayName = "SplitCard.LeftContent";
76
- C.displayName = "SplitCard.RightContent";
77
- const j = Object.assign(g, {
78
- LeftContent: x,
79
- RightContent: C,
80
- Title: M,
81
- Text: v
82
+ f.displayName = "SplitCard.LeftContent";
83
+ x.displayName = "SplitCard.RightContent";
84
+ const z = Object.assign(g, {
85
+ LeftContent: f,
86
+ RightContent: x,
87
+ Title: b,
88
+ Text: M
82
89
  });
83
90
  export {
84
- j as SplitCard
91
+ z as SplitCard
85
92
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trepur_components",
3
- "version": "2.3.35",
3
+ "version": "2.3.37",
4
4
  "description": "component lib",
5
5
  "author": "trepur_ttenneb",
6
6
  "private": false,
@@ -50,6 +50,7 @@
50
50
  "@fortawesome/fontawesome-svg-core": "^6.5.2",
51
51
  "@fortawesome/free-solid-svg-icons": "^6.5.2",
52
52
  "@fortawesome/react-fontawesome": "^0.2.0",
53
+ "@tailwindcss/line-clamp": "^0.4.4",
53
54
  "class-variance-authority": "^0.7.0",
54
55
  "classnames": "^2.5.1",
55
56
  "clsx": "^2.1.1",