@plurix/ecom-components 1.10.0 → 1.10.7
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/dist/main.d.ts +2 -0
- package/dist/main.js +6 -4
- package/dist/packages/Skeleton/components/SkeletonAnimation/SkeletonAnimation.d.ts +9 -0
- package/dist/packages/Skeleton/components/SkeletonAnimation/SkeletonAnimation.js +14 -0
- package/dist/packages/Skeleton/components/SkeletonContainer/SkeletonContainer.d.ts +15 -0
- package/dist/packages/Skeleton/components/SkeletonContainer/SkeletonContainer.js +22 -0
- package/dist/packages/Skeleton/components/SkeletonRender/SkeletonRender.d.ts +21 -0
- package/dist/packages/Skeleton/components/SkeletonRender/SkeletonRender.js +57 -0
- package/dist/packages/Skeleton/components/SkeletonTable/SkeletonTable.d.ts +12 -0
- package/dist/packages/Skeleton/components/SkeletonTable/SkeletonTable.js +18 -0
- package/dist/packages/Skeleton/components/SkeletonWrapper/SkeletonWrapper.d.ts +10 -0
- package/dist/packages/Skeleton/components/SkeletonWrapper/SkeletonWrapper.js +20 -0
- package/dist/packages/Skeleton/hooks/useResponsiveImages.d.ts +9 -0
- package/dist/packages/Skeleton/hooks/useResponsiveImages.js +34 -0
- package/dist/packages/Skeleton/index.d.ts +32 -0
- package/dist/packages/Skeleton/index.js +91 -0
- package/dist/packages/Skeleton/types/types.d.ts +42 -0
- package/dist/packages/Skeleton/types/types.js +1 -0
- package/dist/packages/Skeleton/utils/createStyleAnimation.d.ts +7 -0
- package/dist/packages/Skeleton/utils/createStyleAnimation.js +7 -0
- package/dist/packages/Skeleton/utils/createStyleCell.d.ts +18 -0
- package/dist/packages/Skeleton/utils/createStyleCell.js +19 -0
- package/dist/packages/Skeleton/utils/createStyleContainers.d.ts +33 -0
- package/dist/packages/Skeleton/utils/createStyleContainers.js +45 -0
- package/dist/packages/Skeleton/utils/createStyleTable.d.ts +12 -0
- package/dist/packages/Skeleton/utils/createStyleTable.js +9 -0
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -8,3 +8,5 @@ export * from './packages/Regionalization/types';
|
|
|
8
8
|
export { Modal } from './packages/Modal/Modal';
|
|
9
9
|
export * from './types/ChangeOrderModal';
|
|
10
10
|
export { ChangeOrderModal } from './packages/ChangeOrderModal/ChangeOrderModal';
|
|
11
|
+
export { Skeleton } from './packages/Skeleton';
|
|
12
|
+
export type { SkeletonProps } from './packages/Skeleton';
|
package/dist/main.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { CartClubAlert as e } from "./packages/CartClubAlert/CartClubAlert.js";
|
|
2
2
|
import { Carousel as p } from "./packages/Carousel/Carousel.js";
|
|
3
|
-
import { Coupons as
|
|
4
|
-
import { Onboarding as
|
|
3
|
+
import { Coupons as m } from "./packages/Coupons/Coupons.js";
|
|
4
|
+
import { Onboarding as a } from "./packages/Onboarding/Onboarding.js";
|
|
5
5
|
import { Tour as n } from "./packages/Tour/Tour.js";
|
|
6
6
|
import { Regionalization as d } from "./packages/Regionalization/Regionalization.js";
|
|
7
7
|
import { Modal as u } from "./packages/Modal/Modal.js";
|
|
8
8
|
import { ChangeOrderModal as b } from "./packages/ChangeOrderModal/ChangeOrderModal.js";
|
|
9
|
+
import { Skeleton as M } from "./packages/Skeleton/index.js";
|
|
9
10
|
export {
|
|
10
11
|
p as Carousel,
|
|
11
12
|
e as CartClubAlert,
|
|
12
13
|
b as ChangeOrderModal,
|
|
13
|
-
|
|
14
|
+
m as Coupons,
|
|
14
15
|
u as Modal,
|
|
15
|
-
|
|
16
|
+
a as Onboarding,
|
|
16
17
|
d as Regionalization,
|
|
18
|
+
M as Skeleton,
|
|
17
19
|
n as Tour
|
|
18
20
|
};
|
|
@@ -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 @@
|
|
|
1
|
+
|
|
@@ -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;
|