@plurix/ecom-components 1.11.6 → 1.12.0

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.
Files changed (29) hide show
  1. package/dist/main.d.ts +4 -0
  2. package/dist/main.js +12 -8
  3. package/dist/packages/ContactCard/ContactCard.d.ts +22 -0
  4. package/dist/packages/ContactCard/ContactCard.js +40 -0
  5. package/dist/packages/Skeleton/components/SkeletonAnimation/SkeletonAnimation.d.ts +9 -0
  6. package/dist/packages/Skeleton/components/SkeletonAnimation/SkeletonAnimation.js +14 -0
  7. package/dist/packages/Skeleton/components/SkeletonContainer/SkeletonContainer.d.ts +15 -0
  8. package/dist/packages/Skeleton/components/SkeletonContainer/SkeletonContainer.js +22 -0
  9. package/dist/packages/Skeleton/components/SkeletonRender/SkeletonRender.d.ts +21 -0
  10. package/dist/packages/Skeleton/components/SkeletonRender/SkeletonRender.js +57 -0
  11. package/dist/packages/Skeleton/components/SkeletonTable/SkeletonTable.d.ts +12 -0
  12. package/dist/packages/Skeleton/components/SkeletonTable/SkeletonTable.js +18 -0
  13. package/dist/packages/Skeleton/components/SkeletonWrapper/SkeletonWrapper.d.ts +10 -0
  14. package/dist/packages/Skeleton/components/SkeletonWrapper/SkeletonWrapper.js +20 -0
  15. package/dist/packages/Skeleton/hooks/useResponsiveImages.d.ts +9 -0
  16. package/dist/packages/Skeleton/hooks/useResponsiveImages.js +34 -0
  17. package/dist/packages/Skeleton/index.d.ts +32 -0
  18. package/dist/packages/Skeleton/index.js +91 -0
  19. package/dist/packages/Skeleton/types/types.d.ts +42 -0
  20. package/dist/packages/Skeleton/types/types.js +1 -0
  21. package/dist/packages/Skeleton/utils/createStyleAnimation.d.ts +7 -0
  22. package/dist/packages/Skeleton/utils/createStyleAnimation.js +7 -0
  23. package/dist/packages/Skeleton/utils/createStyleCell.d.ts +18 -0
  24. package/dist/packages/Skeleton/utils/createStyleCell.js +19 -0
  25. package/dist/packages/Skeleton/utils/createStyleContainers.d.ts +33 -0
  26. package/dist/packages/Skeleton/utils/createStyleContainers.js +45 -0
  27. package/dist/packages/Skeleton/utils/createStyleTable.d.ts +12 -0
  28. package/dist/packages/Skeleton/utils/createStyleTable.js +9 -0
  29. package/package.json +1 -1
package/dist/main.d.ts CHANGED
@@ -6,8 +6,12 @@ export { Tour } from './packages/Tour/Tour';
6
6
  export { Regionalization } from './packages/Regionalization/Regionalization';
7
7
  export * from './packages/Regionalization/types';
8
8
  export { Modal } from './packages/Modal/Modal';
9
+ export { ContactCard } from './packages/ContactCard/ContactCard';
10
+ export * from './packages/ContactCard/ContactCard';
9
11
  export * from './types/ChangeOrderModal';
10
12
  export { ChangeOrderModal } from './packages/ChangeOrderModal/ChangeOrderModal';
13
+ export { Skeleton } from './packages/Skeleton';
14
+ export type { SkeletonProps } from './packages/Skeleton';
11
15
  export { SearchSuggestions } from './packages/SearchSugestions/components/SearchSuggestions';
12
16
  export type { SearchSuggestionsProps } from './packages/SearchSugestions/types/SearchSuggestionsProps';
13
17
  export type { SearchSuggestionsApiResponse, Searches } from './packages/SearchSugestions/types/ResponseApi';
package/dist/main.js CHANGED
@@ -3,18 +3,22 @@ import { Carousel as p } from "./packages/Carousel/Carousel.js";
3
3
  import { Coupons as f } from "./packages/Coupons/Coupons.js";
4
4
  import { Onboarding as x } from "./packages/Onboarding/Onboarding.js";
5
5
  import { Tour as l } from "./packages/Tour/Tour.js";
6
- import { Regionalization as i } from "./packages/Regionalization/Regionalization.js";
7
- import { Modal as C } from "./packages/Modal/Modal.js";
8
- import { ChangeOrderModal as s } from "./packages/ChangeOrderModal/ChangeOrderModal.js";
9
- import { SearchSuggestions as h } from "./packages/SearchSugestions/components/SearchSuggestions/index.js";
6
+ import { Regionalization as d } from "./packages/Regionalization/Regionalization.js";
7
+ import { Modal as i } from "./packages/Modal/Modal.js";
8
+ import { ContactCard as s } from "./packages/ContactCard/ContactCard.js";
9
+ import { ChangeOrderModal as b } from "./packages/ChangeOrderModal/ChangeOrderModal.js";
10
+ import { Skeleton as h } from "./packages/Skeleton/index.js";
11
+ import { SearchSuggestions as O } from "./packages/SearchSugestions/components/SearchSuggestions/index.js";
10
12
  export {
11
13
  p as Carousel,
12
14
  e as CartClubAlert,
13
- s as ChangeOrderModal,
15
+ b as ChangeOrderModal,
16
+ s as ContactCard,
14
17
  f as Coupons,
15
- C as Modal,
18
+ i as Modal,
16
19
  x as Onboarding,
17
- i as Regionalization,
18
- h as SearchSuggestions,
20
+ d as Regionalization,
21
+ O as SearchSuggestions,
22
+ h as Skeleton,
19
23
  l as Tour
20
24
  };
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ export interface ContactCardProps {
3
+ title: string;
4
+ subtitle?: string;
5
+ image?: string;
6
+ alt?: string;
7
+ imgWidth?: number;
8
+ linkItem?: {
9
+ link: string;
10
+ linkText: string;
11
+ };
12
+ backgroundColor?: string;
13
+ color?: string;
14
+ widthContainer?: number;
15
+ heightContainer?: number;
16
+ padding?: number | string;
17
+ alignItems?: string;
18
+ justifyContent?: string;
19
+ marginRightLogo?: number;
20
+ lineHeightContainer?: number | string;
21
+ }
22
+ export declare const ContactCard: ({ title, subtitle, image, alt, imgWidth, linkItem, backgroundColor, color, widthContainer, heightContainer, padding, alignItems, justifyContent, marginRightLogo, lineHeightContainer }: ContactCardProps) => JSX.Element;
@@ -0,0 +1,40 @@
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ const j = ({
3
+ title: o,
4
+ subtitle: n,
5
+ image: r,
6
+ alt: l,
7
+ imgWidth: s,
8
+ linkItem: t,
9
+ backgroundColor: c,
10
+ color: a,
11
+ widthContainer: d,
12
+ heightContainer: h,
13
+ padding: g,
14
+ alignItems: x,
15
+ justifyContent: p,
16
+ marginRightLogo: y,
17
+ lineHeightContainer: C
18
+ }) => /* @__PURE__ */ i("div", { className: "container-card", style: {
19
+ backgroundColor: c || "#25D366",
20
+ color: a || "#FFFFFF",
21
+ height: h,
22
+ width: d,
23
+ display: "flex",
24
+ justifyContent: p || "center",
25
+ padding: g || "16px 24px",
26
+ alignItems: x || "center",
27
+ lineHeight: C || "10px"
28
+ }, children: [
29
+ /* @__PURE__ */ e("div", { className: "logo", style: {
30
+ marginRight: y || 10
31
+ }, children: r && /* @__PURE__ */ e("img", { src: r, alt: l || "", width: s || 50 }) }),
32
+ /* @__PURE__ */ i("div", { className: "text-box", children: [
33
+ /* @__PURE__ */ e("p", { children: o }),
34
+ n && /* @__PURE__ */ e("p", { children: n }),
35
+ t && /* @__PURE__ */ e("a", { href: t.link, children: t.linkText })
36
+ ] })
37
+ ] });
38
+ export {
39
+ j as ContactCard
40
+ };
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ import { StyleAnimation } from '../../types/types';
3
+
4
+ interface SkeletonAnimationProps {
5
+ styleAnimation?: StyleAnimation;
6
+ children?: React.ReactNode;
7
+ }
8
+ export declare const SkeletonAnimation: React.FC<SkeletonAnimationProps>;
9
+ export {};
@@ -0,0 +1,14 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ const o = ({
3
+ styleAnimation: t
4
+ }) => /* @__PURE__ */ e(
5
+ "div",
6
+ {
7
+ "data-testid": "skeleton-animation",
8
+ style: t,
9
+ className: "skeleton-animation"
10
+ }
11
+ );
12
+ export {
13
+ o as SkeletonAnimation
14
+ };
@@ -0,0 +1,15 @@
1
+ import { default as React, RefObject } from 'react';
2
+ import { StyleContainers } from '../../types/types';
3
+
4
+ interface SkeletonContainerProps {
5
+ skeletonContainer?: RefObject<HTMLDivElement>;
6
+ placeholder?: string;
7
+ styleContainers?: StyleContainers | {
8
+ position: 'relative';
9
+ } | {
10
+ cursor: 'progress';
11
+ };
12
+ children?: React.ReactNode;
13
+ }
14
+ export declare const SkeletonContainer: React.FC<SkeletonContainerProps>;
15
+ export {};
@@ -0,0 +1,22 @@
1
+ import { jsxs as s } from "react/jsx-runtime";
2
+ const a = ({
3
+ children: e,
4
+ skeletonContainer: t,
5
+ placeholder: n,
6
+ styleContainers: o
7
+ }) => /* @__PURE__ */ s(
8
+ "div",
9
+ {
10
+ "data-testid": "skeleton-container",
11
+ ref: t,
12
+ style: o,
13
+ className: "skeleton-container",
14
+ children: [
15
+ n,
16
+ e
17
+ ]
18
+ }
19
+ );
20
+ export {
21
+ a as SkeletonContainer
22
+ };
@@ -0,0 +1,21 @@
1
+ import { default as React, RefObject } from 'react';
2
+ import { StyleContainers, StyleTable, StyleCell, StyleAnimation } from '../../types/types';
3
+
4
+ interface SkeletonRenderProps {
5
+ count: number;
6
+ wrappers: number[];
7
+ rows: number;
8
+ tableRows: number[];
9
+ columns: number;
10
+ tableColumns: number[];
11
+ skeletonContainer?: RefObject<HTMLDivElement>;
12
+ placeholder: string | undefined;
13
+ styleContainers?: StyleContainers;
14
+ styleTable?: StyleTable;
15
+ styleCell?: StyleCell;
16
+ styleAnimation?: StyleAnimation;
17
+ animation: boolean | undefined;
18
+ children?: React.ReactNode;
19
+ }
20
+ export declare const SkeletonRender: React.FC<SkeletonRenderProps>;
21
+ export {};
@@ -0,0 +1,57 @@
1
+ import { jsx as r, jsxs as b } from "react/jsx-runtime";
2
+ import { SkeletonContainer as m } from "../SkeletonContainer/SkeletonContainer.js";
3
+ import { SkeletonWrapper as g } from "../SkeletonWrapper/SkeletonWrapper.js";
4
+ import { SkeletonTable as v } from "../SkeletonTable/SkeletonTable.js";
5
+ import { SkeletonAnimation as f } from "../SkeletonAnimation/SkeletonAnimation.js";
6
+ const w = ({
7
+ count: S,
8
+ wrappers: d,
9
+ rows: i,
10
+ tableRows: k,
11
+ columns: h,
12
+ tableColumns: t,
13
+ skeletonContainer: c,
14
+ placeholder: u,
15
+ styleContainers: o,
16
+ styleTable: x,
17
+ styleCell: j,
18
+ styleAnimation: e,
19
+ animation: p
20
+ }) => S > 0 ? /* @__PURE__ */ r(
21
+ m,
22
+ {
23
+ skeletonContainer: c,
24
+ styleContainers: (o == null ? void 0 : o.cursor) && { cursor: "progress" },
25
+ children: d.map((l) => /* @__PURE__ */ r(
26
+ g,
27
+ {
28
+ styleContainers: o,
29
+ placeholder: u,
30
+ children: p && /* @__PURE__ */ r(f, { styleAnimation: e })
31
+ },
32
+ l
33
+ ))
34
+ }
35
+ ) : i > 0 && h > 0 ? /* @__PURE__ */ b(m, { styleContainers: { position: "relative" }, children: [
36
+ /* @__PURE__ */ r(
37
+ v,
38
+ {
39
+ tableRows: k,
40
+ tableColumns: t,
41
+ styleTable: x,
42
+ styleCell: j
43
+ }
44
+ ),
45
+ p && /* @__PURE__ */ r(f, { styleAnimation: e })
46
+ ] }) : /* @__PURE__ */ r(
47
+ m,
48
+ {
49
+ skeletonContainer: c,
50
+ styleContainers: o,
51
+ placeholder: u,
52
+ children: p && /* @__PURE__ */ r(f, { styleAnimation: e })
53
+ }
54
+ );
55
+ export {
56
+ w as SkeletonRender
57
+ };
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ import { StyleTable, StyleCell } from '../../types/types';
3
+
4
+ interface SkeletonTableProps {
5
+ tableRows: number[];
6
+ tableColumns: number[];
7
+ styleTable?: StyleTable;
8
+ styleCell?: StyleCell;
9
+ children?: React.ReactNode;
10
+ }
11
+ export declare const SkeletonTable: React.FC<SkeletonTableProps>;
12
+ export {};
@@ -0,0 +1,18 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ const c = ({
3
+ tableRows: l,
4
+ tableColumns: t,
5
+ styleTable: s,
6
+ styleCell: a
7
+ }) => /* @__PURE__ */ e(
8
+ "table",
9
+ {
10
+ "data-testid": "skeleton-table",
11
+ style: s,
12
+ className: "skeleton-table",
13
+ children: /* @__PURE__ */ e("tbody", { style: { display: "block" }, children: l.map((o) => /* @__PURE__ */ e("tr", { style: { display: "block" }, children: t.map((d) => /* @__PURE__ */ e("td", { style: a }, d)) }, o)) })
14
+ }
15
+ );
16
+ export {
17
+ c as SkeletonTable
18
+ };
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ import { StyleContainers } from '../../types/types';
3
+
4
+ interface SkeletonWrapperProps {
5
+ placeholder?: string;
6
+ styleContainers?: StyleContainers;
7
+ children?: React.ReactNode;
8
+ }
9
+ export declare const SkeletonWrapper: React.FC<SkeletonWrapperProps>;
10
+ export {};
@@ -0,0 +1,20 @@
1
+ import { jsxs as s } from "react/jsx-runtime";
2
+ const a = ({
3
+ children: e,
4
+ placeholder: r,
5
+ styleContainers: t
6
+ }) => /* @__PURE__ */ s(
7
+ "div",
8
+ {
9
+ "data-testid": "skeleton-wrapper",
10
+ style: t,
11
+ className: "skeleton-wrapper",
12
+ children: [
13
+ r,
14
+ e
15
+ ]
16
+ }
17
+ );
18
+ export {
19
+ a as SkeletonWrapper
20
+ };
@@ -0,0 +1,9 @@
1
+ import { ResponsiveImage } from '../types/types';
2
+
3
+ declare const useResponsiveImages: (responsiveImage: undefined | ResponsiveImage | ResponsiveImage[], responsiveImageSSR: undefined | ResponsiveImage) => {
4
+ srcWidth: number;
5
+ srcHeight: number;
6
+ widthSkeletonContainer: number;
7
+ skeletonContainer: import('react').MutableRefObject<HTMLDivElement | null>;
8
+ };
9
+ export default useResponsiveImages;
@@ -0,0 +1,34 @@
1
+ import { useRef as B, useState as f, useEffect as b } from "react";
2
+ const E = (t, c) => {
3
+ const d = B(null), [e, l] = f(0), [u, w] = f(0), [o, h] = f(0), [y, k] = f(0), W = () => {
4
+ d.current && (l(d.current.offsetWidth), w(window.innerWidth));
5
+ }, H = (i) => {
6
+ i.sort((n, r) => n.breakIn && r.breakIn ? n.breakIn > r.breakIn ? 1 : -1 : !n.breakIn && r.breakIn ? 1 : n.breakIn && !r.breakIn ? -1 : n.srcWidth > r.srcWidth ? 1 : -1);
7
+ }, A = (i) => {
8
+ i.sort((n, r) => n.breakIn && r.breakIn && n.breakIn === r.breakIn ? n.srcWidth > r.srcWidth ? 1 : -1 : 0);
9
+ };
10
+ return b(() => (!c && t && window.addEventListener("resize", () => W()), () => window.removeEventListener("resize", () => W())), [t, c]), b(() => {
11
+ t && !c && (W(), Array.isArray(t) ? (H(t), A(t), h(t[0].srcWidth), k(t[0].srcHeight)) : (h(t.srcWidth), k(t.srcHeight)));
12
+ }, [d, t, c]), b(() => {
13
+ if (!c && t && Array.isArray(t) && t[0].breakIn)
14
+ for (const i in t) {
15
+ const n = t[i], r = t[+i + 1];
16
+ if (t[0].breakIn && t[0].breakIn >= u) {
17
+ h(t[0].srcWidth), k(t[0].srcHeight);
18
+ break;
19
+ }
20
+ if (n.breakIn !== void 0 && n.breakIn <= u && r) {
21
+ h(r.srcWidth), k(r.srcHeight);
22
+ break;
23
+ }
24
+ }
25
+ }, [u, t, c]), {
26
+ srcWidth: o,
27
+ srcHeight: y,
28
+ widthSkeletonContainer: e,
29
+ skeletonContainer: d
30
+ };
31
+ };
32
+ export {
33
+ E as default
34
+ };
@@ -0,0 +1,32 @@
1
+ import { default as React } from 'react';
2
+ import { ResponsiveImage } from './types/types';
3
+
4
+ export interface SkeletonProps {
5
+ width?: number | string;
6
+ height?: number | string;
7
+ margin?: number | 'auto';
8
+ padding?: number;
9
+ border?: true;
10
+ borderColor?: string;
11
+ borderRadius?: number;
12
+ circle?: true;
13
+ backgroundColor?: string;
14
+ color?: string;
15
+ cursor?: true;
16
+ placeholder?: string;
17
+ placeholderPosition?: {
18
+ horizontal: 'left' | 'center' | 'right';
19
+ vertical: 'top' | 'center' | 'bottom';
20
+ };
21
+ animation?: true;
22
+ animationColor?: string;
23
+ animationDuration?: number;
24
+ count?: number;
25
+ responsiveImage?: ResponsiveImage | ResponsiveImage[];
26
+ responsiveImageSSR?: ResponsiveImage;
27
+ table?: {
28
+ rows: number;
29
+ columns: number;
30
+ };
31
+ }
32
+ export declare const Skeleton: React.FC<SkeletonProps>;
@@ -0,0 +1,91 @@
1
+ import { jsx as E } from "react/jsx-runtime";
2
+ import { SkeletonRender as F } from "./components/SkeletonRender/SkeletonRender.js";
3
+ import G from "./hooks/useResponsiveImages.js";
4
+ import J from "./utils/createStyleContainers.js";
5
+ import K from "./utils/createStyleTable.js";
6
+ import L from "./utils/createStyleCell.js";
7
+ import M from "./utils/createStyleAnimation.js";
8
+ const $ = (h) => {
9
+ const {
10
+ width: s,
11
+ height: i = "1em",
12
+ margin: l,
13
+ padding: g,
14
+ border: a,
15
+ borderColor: c,
16
+ borderRadius: y,
17
+ circle: C,
18
+ backgroundColor: m = "#ccc",
19
+ color: b,
20
+ cursor: d,
21
+ placeholder: S,
22
+ placeholderPosition: o,
23
+ animation: t,
24
+ animationColor: w,
25
+ animationDuration: v,
26
+ count: r = 0,
27
+ responsiveImage: p,
28
+ responsiveImageSSR: f,
29
+ table: e = { rows: 0, columns: 0 }
30
+ } = h, { skeletonContainer: x, widthSkeletonContainer: k, srcWidth: R, srcHeight: A } = G(p, f), u = {
31
+ left: "flex-start",
32
+ top: "flex-start",
33
+ center: "center",
34
+ right: "flex-end",
35
+ bottom: "flex-end"
36
+ }, I = o ? u[o.horizontal] : void 0, P = o ? u[o.vertical] : void 0, n = (q) => Array.from({ length: q }, (N, B) => B), j = n(r), T = n(e.rows), z = n(e.columns), D = J({
37
+ width: s,
38
+ height: i,
39
+ margin: l,
40
+ padding: g,
41
+ border: a,
42
+ borderColor: c,
43
+ borderRadius: y,
44
+ circle: C,
45
+ backgroundColor: m,
46
+ color: b,
47
+ cursor: d,
48
+ placeholderPosition: o,
49
+ justifyContent: I,
50
+ alignItems: P,
51
+ animation: t,
52
+ count: r,
53
+ responsiveImage: p,
54
+ responsiveImageSSR: f,
55
+ widthSkeletonContainer: k,
56
+ srcWidth: R,
57
+ srcHeight: A
58
+ }), H = K({
59
+ width: s,
60
+ cursor: d,
61
+ animation: t
62
+ }), W = L({
63
+ height: i,
64
+ margin: l,
65
+ border: a,
66
+ borderColor: c,
67
+ backgroundColor: m,
68
+ table: e
69
+ }), _ = M(w, v);
70
+ return /* @__PURE__ */ E(
71
+ F,
72
+ {
73
+ count: r,
74
+ wrappers: j,
75
+ rows: e.rows,
76
+ tableRows: T,
77
+ columns: e.columns,
78
+ tableColumns: z,
79
+ skeletonContainer: x,
80
+ placeholder: S,
81
+ styleContainers: D,
82
+ styleTable: H,
83
+ styleCell: W,
84
+ styleAnimation: _,
85
+ animation: t
86
+ }
87
+ );
88
+ };
89
+ export {
90
+ $ as Skeleton
91
+ };
@@ -0,0 +1,42 @@
1
+ export interface ResponsiveImage {
2
+ srcWidth: number;
3
+ srcHeight: number;
4
+ breakIn?: number;
5
+ }
6
+ export type NumberStringUndefined = number | string | undefined;
7
+ export interface StyleContainers {
8
+ position: 'relative' | undefined;
9
+ display: 'flex' | undefined;
10
+ justifyContent: string | undefined;
11
+ alignItems: string | undefined;
12
+ width: NumberStringUndefined;
13
+ height: NumberStringUndefined;
14
+ margin: NumberStringUndefined;
15
+ padding: number | undefined;
16
+ paddingTop: string | undefined;
17
+ border: '1px solid' | undefined;
18
+ borderColor: string | undefined;
19
+ borderRadius: NumberStringUndefined;
20
+ backgroundColor: string;
21
+ color: string | undefined;
22
+ cursor: 'progress' | undefined;
23
+ }
24
+ export interface StyleTable {
25
+ position: 'relative' | undefined;
26
+ display: 'block';
27
+ width: NumberStringUndefined;
28
+ cursor: 'progress' | undefined;
29
+ }
30
+ export interface StyleCell {
31
+ display: 'inline-block';
32
+ width: NumberStringUndefined;
33
+ height: number | string;
34
+ margin: number | 'auto';
35
+ border: '1px solid' | undefined;
36
+ borderColor: string | undefined;
37
+ backgroundColor: string;
38
+ }
39
+ export interface StyleAnimation {
40
+ backgroundColor: string | '#ddd';
41
+ animationDuration: string | '3000ms';
42
+ }
@@ -0,0 +1,7 @@
1
+ import { StyleAnimation } from '../types/types';
2
+
3
+ interface CreateStyleAnimation {
4
+ (animationColor?: string, animationDuration?: number): StyleAnimation;
5
+ }
6
+ declare const createStyleAnimation: CreateStyleAnimation;
7
+ export default createStyleAnimation;
@@ -0,0 +1,7 @@
1
+ const o = (e, t) => ({
2
+ backgroundColor: e ?? "#ddd",
3
+ animationDuration: t ? `${t}ms` : "3000ms"
4
+ });
5
+ export {
6
+ o as default
7
+ };
@@ -0,0 +1,18 @@
1
+ import { StyleCell } from '../types/types';
2
+
3
+ interface CreateStyleCellParams {
4
+ height: number | string;
5
+ margin: number | 'auto' | undefined;
6
+ border: true | undefined;
7
+ borderColor: string | undefined;
8
+ backgroundColor: string;
9
+ table: {
10
+ rows: number;
11
+ columns: number;
12
+ };
13
+ }
14
+ interface CreateStyleCell {
15
+ (params: CreateStyleCellParams): StyleCell;
16
+ }
17
+ declare const createStyleCell: CreateStyleCell;
18
+ export default createStyleCell;
@@ -0,0 +1,19 @@
1
+ const s = ({
2
+ height: e,
3
+ margin: l,
4
+ border: o,
5
+ borderColor: t,
6
+ backgroundColor: d,
7
+ table: c
8
+ }) => ({
9
+ display: "inline-block",
10
+ backgroundColor: d,
11
+ width: l !== "auto" && l ? `calc(100% / ${c.columns} - ${3 * l}px)` : `calc(100% / ${c.columns} - 6px)`,
12
+ height: e,
13
+ margin: l ?? 2,
14
+ border: o ? "1px solid" : void 0,
15
+ borderColor: o && (t ?? "#000")
16
+ });
17
+ export {
18
+ s as default
19
+ };
@@ -0,0 +1,33 @@
1
+ import { ResponsiveImage, StyleContainers, NumberStringUndefined } from '../types/types';
2
+
3
+ interface CreateStyleContainerParams {
4
+ width: NumberStringUndefined;
5
+ height: number | string;
6
+ margin: NumberStringUndefined;
7
+ padding: number | undefined;
8
+ border: true | undefined;
9
+ borderColor: string | undefined;
10
+ borderRadius: number | undefined;
11
+ circle: true | undefined;
12
+ backgroundColor: string;
13
+ color: string | undefined;
14
+ cursor: true | undefined;
15
+ placeholderPosition: {
16
+ horizontal: string;
17
+ vertical: string;
18
+ } | undefined;
19
+ justifyContent: string | undefined;
20
+ alignItems: string | undefined;
21
+ animation: true | undefined;
22
+ count: number;
23
+ responsiveImage: ResponsiveImage | ResponsiveImage[] | undefined;
24
+ responsiveImageSSR: ResponsiveImage | undefined;
25
+ widthSkeletonContainer: number;
26
+ srcWidth: number | undefined;
27
+ srcHeight: number | undefined;
28
+ }
29
+ interface CreateStyleContainer {
30
+ (params: CreateStyleContainerParams): StyleContainers;
31
+ }
32
+ declare const createStyleContainers: CreateStyleContainer;
33
+ export default createStyleContainers;
@@ -0,0 +1,45 @@
1
+ const q = ({
2
+ width: e,
3
+ height: s,
4
+ margin: i,
5
+ padding: a,
6
+ border: t,
7
+ borderColor: c,
8
+ borderRadius: d,
9
+ circle: v,
10
+ backgroundColor: l,
11
+ color: p,
12
+ cursor: g,
13
+ placeholderPosition: h,
14
+ justifyContent: u,
15
+ alignItems: x,
16
+ animation: C,
17
+ count: f,
18
+ responsiveImage: b,
19
+ responsiveImageSSR: o,
20
+ widthSkeletonContainer: y,
21
+ srcWidth: r,
22
+ srcHeight: n
23
+ }) => {
24
+ const H = f > 0 ? "0 0 5px 0" : void 0, T = v ? "50%" : void 0, $ = b ? r && n && y * n / r : s, j = o ? void 0 : $, k = o ? `${o.srcHeight * 100 / o.srcWidth}%` : void 0;
25
+ return {
26
+ position: C ? "relative" : void 0,
27
+ width: e,
28
+ height: j,
29
+ margin: i || H,
30
+ padding: a,
31
+ paddingTop: k,
32
+ border: t ? "1px solid" : void 0,
33
+ borderColor: t && (c ?? "#000"),
34
+ borderRadius: d || T,
35
+ backgroundColor: l,
36
+ color: p,
37
+ cursor: g ? "progress" : void 0,
38
+ display: h ? "flex" : void 0,
39
+ justifyContent: u,
40
+ alignItems: x
41
+ };
42
+ };
43
+ export {
44
+ q as default
45
+ };
@@ -0,0 +1,12 @@
1
+ import { StyleTable, NumberStringUndefined } from '../types/types';
2
+
3
+ interface CreateStyleTableParams {
4
+ width: NumberStringUndefined;
5
+ animation: true | undefined;
6
+ cursor: true | undefined;
7
+ }
8
+ interface CreateStyleTable {
9
+ (params: CreateStyleTableParams): StyleTable;
10
+ }
11
+ declare const createStyleTable: CreateStyleTable;
12
+ export default createStyleTable;
@@ -0,0 +1,9 @@
1
+ const t = ({ width: e, animation: o, cursor: r }) => ({
2
+ display: "block",
3
+ width: e,
4
+ position: o ? "relative" : void 0,
5
+ cursor: r ? "progress" : void 0
6
+ });
7
+ export {
8
+ t as default
9
+ };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@plurix/ecom-components",
3
3
  "author": "Plurix",
4
4
  "private": false,
5
- "version": "1.11.6",
5
+ "version": "1.12.0",
6
6
  "type": "module",
7
7
  "main": "dist/main.js",
8
8
  "types": "dist/main.d.ts",