@redneckz/wildless-cms-uni-blocks 0.6.48 → 0.6.49
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/bundle/bundle.umd.js +10 -5
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Footer/MediaButton.d.ts +3 -0
- package/bundle/components/Footer/SocialMedia.d.ts +3 -0
- package/dist/components/Footer/MediaButton.d.ts +3 -0
- package/dist/components/Footer/MediaButton.js +8 -3
- package/dist/components/Footer/MediaButton.js.map +1 -1
- package/dist/components/Footer/SocialMedia.d.ts +3 -0
- package/dist/components/Footer/SocialMedia.js +1 -1
- package/dist/components/Footer/SocialMedia.js.map +1 -1
- package/lib/components/Footer/MediaButton.d.ts +3 -0
- package/lib/components/Footer/MediaButton.js +8 -3
- package/lib/components/Footer/MediaButton.js.map +1 -1
- package/lib/components/Footer/SocialMedia.d.ts +3 -0
- package/lib/components/Footer/SocialMedia.js +1 -1
- package/lib/components/Footer/SocialMedia.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +9 -4
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Footer/MediaButton.d.ts +3 -0
- package/mobile/dist/components/Footer/MediaButton.d.ts +3 -0
- package/mobile/dist/components/Footer/MediaButton.js +8 -3
- package/mobile/dist/components/Footer/MediaButton.js.map +1 -1
- package/mobile/lib/components/Footer/MediaButton.d.ts +3 -0
- package/mobile/lib/components/Footer/MediaButton.js +8 -3
- package/mobile/lib/components/Footer/MediaButton.js.map +1 -1
- package/mobile/src/components/Footer/MediaButton.tsx +46 -36
- package/package.json +1 -1
- package/src/components/Footer/MediaButton.tsx +46 -36
- package/src/components/Footer/SocialMedia.tsx +20 -10
|
@@ -30,7 +30,11 @@ const ICONS_MAP = [
|
|
|
30
30
|
label: 'Google Play',
|
|
31
31
|
},
|
|
32
32
|
];
|
|
33
|
-
|
|
33
|
+
const BUTTON_SIZE = {
|
|
34
|
+
default: ' w-14 h-14',
|
|
35
|
+
small: ' w-12 h-12',
|
|
36
|
+
};
|
|
37
|
+
export const MediaButton = JSX(({ version = 'primary', isRounded = false, buttonSize = 'default', ...rest }) => {
|
|
34
38
|
const link = useLink();
|
|
35
39
|
const { href, onClick } = link(rest);
|
|
36
40
|
const { icon, label } = ICONS_MAP.find(({ origins }) => origins.some((_) => href?.includes(_))) || {};
|
|
@@ -40,7 +44,8 @@ export const MediaButton = JSX(({ version = 'primary', ...rest }) => {
|
|
|
40
44
|
const classes = version === 'secondary'
|
|
41
45
|
? 'bg-white hover:bg-secondary-hover'
|
|
42
46
|
: 'border-solid border border-main-divider hover:border-transparent hover:bg-primary-main';
|
|
43
|
-
const isPrimary = version === 'primary';
|
|
44
|
-
|
|
47
|
+
const isPrimary = version === 'primary' ? 'hover:text-black' : '';
|
|
48
|
+
const rounded = isRounded ? 'rounded-full' : 'rounded-md';
|
|
49
|
+
return (_jsx("a", { className: `flex items-center justify-center group box-border ${classes} ${rounded} ${isPrimary} ${BUTTON_SIZE[buttonSize]}`, href: href, "aria-label": label, target: "_blank", rel: "noopener noreferrer", onClick: onClick, children: icon ? (_jsx(Img, { image: getIconWithVersion(icon), imageClassName: "group-hover:text-white", width: "24", height: "24", asSVG: true })) : null }));
|
|
45
50
|
});
|
|
46
51
|
//# sourceMappingURL=MediaButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaButton.js","sourceRoot":"","sources":["../../../src/components/Footer/MediaButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG9C,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,MAAM,SAAS,GAIV;IACH;QACE,OAAO,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC;QACjC,IA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;IAE1D,OAAO,CACL,YACE,SAAS,EAAE,qDAAqD,OAAO,IAAI,OAAO,IAAI,SAAS,IAAI,WAAW,CAAC,UAAU,CAAC,EAAE,EAC5H,IAAI,EAAE,IAAI,gBACE,KAAK,EACjB,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,OAAO,EAAE,OAAO,YAEf,IAAI,CAAC,CAAC,CAAC,CACN,KAAC,GAAG,IACF,KAAK,EAAE,kBAAkB,CAAC,IAAI,CAAC,EAC/B,cAAc,EAAC,wBAAwB,EACvC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,KAAK,SACL,CACH,CAAC,CAAC,CAAC,IAAI,GACN,CACL,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -37,49 +37,59 @@ const ICONS_MAP: Array<{
|
|
|
37
37
|
},
|
|
38
38
|
];
|
|
39
39
|
|
|
40
|
+
export type ButtonSize = 'default' | 'small';
|
|
41
|
+
|
|
40
42
|
interface MediaButtonProps {
|
|
41
43
|
href?: string;
|
|
42
44
|
version?: BlockVersion;
|
|
45
|
+
isRounded?: boolean;
|
|
46
|
+
buttonSize?: ButtonSize;
|
|
43
47
|
}
|
|
44
48
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
const BUTTON_SIZE = {
|
|
50
|
+
default: ' w-14 h-14',
|
|
51
|
+
small: ' w-12 h-12',
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const MediaButton = JSX<MediaButtonProps>(
|
|
55
|
+
({ version = 'primary', isRounded = false, buttonSize = 'default', ...rest }) => {
|
|
56
|
+
const link = useLink();
|
|
57
|
+
const { href, onClick } = link(rest);
|
|
48
58
|
|
|
49
|
-
|
|
50
|
-
|
|
59
|
+
const { icon, label } =
|
|
60
|
+
ICONS_MAP.find(({ origins }) => origins.some((_) => href?.includes(_))) || {};
|
|
51
61
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
62
|
+
if (!icon) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
55
65
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
const classes =
|
|
67
|
+
version === 'secondary'
|
|
68
|
+
? 'bg-white hover:bg-secondary-hover'
|
|
69
|
+
: 'border-solid border border-main-divider hover:border-transparent hover:bg-primary-main';
|
|
60
70
|
|
|
61
|
-
|
|
71
|
+
const isPrimary = version === 'primary' ? 'hover:text-black' : '';
|
|
72
|
+
const rounded = isRounded ? 'rounded-full' : 'rounded-md';
|
|
62
73
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
});
|
|
74
|
+
return (
|
|
75
|
+
<a
|
|
76
|
+
className={`flex items-center justify-center group box-border ${classes} ${rounded} ${isPrimary} ${BUTTON_SIZE[buttonSize]}`}
|
|
77
|
+
href={href}
|
|
78
|
+
aria-label={label}
|
|
79
|
+
target="_blank"
|
|
80
|
+
rel="noopener noreferrer"
|
|
81
|
+
onClick={onClick}
|
|
82
|
+
>
|
|
83
|
+
{icon ? (
|
|
84
|
+
<Img
|
|
85
|
+
image={getIconWithVersion(icon)}
|
|
86
|
+
imageClassName="group-hover:text-white"
|
|
87
|
+
width="24"
|
|
88
|
+
height="24"
|
|
89
|
+
asSVG
|
|
90
|
+
/>
|
|
91
|
+
) : null}
|
|
92
|
+
</a>
|
|
93
|
+
);
|
|
94
|
+
},
|
|
95
|
+
);
|
package/package.json
CHANGED
|
@@ -37,49 +37,59 @@ const ICONS_MAP: Array<{
|
|
|
37
37
|
},
|
|
38
38
|
];
|
|
39
39
|
|
|
40
|
+
export type ButtonSize = 'default' | 'small';
|
|
41
|
+
|
|
40
42
|
interface MediaButtonProps {
|
|
41
43
|
href?: string;
|
|
42
44
|
version?: BlockVersion;
|
|
45
|
+
isRounded?: boolean;
|
|
46
|
+
buttonSize?: ButtonSize;
|
|
43
47
|
}
|
|
44
48
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
const BUTTON_SIZE = {
|
|
50
|
+
default: ' w-14 h-14',
|
|
51
|
+
small: ' w-12 h-12',
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const MediaButton = JSX<MediaButtonProps>(
|
|
55
|
+
({ version = 'primary', isRounded = false, buttonSize = 'default', ...rest }) => {
|
|
56
|
+
const link = useLink();
|
|
57
|
+
const { href, onClick } = link(rest);
|
|
48
58
|
|
|
49
|
-
|
|
50
|
-
|
|
59
|
+
const { icon, label } =
|
|
60
|
+
ICONS_MAP.find(({ origins }) => origins.some((_) => href?.includes(_))) || {};
|
|
51
61
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
62
|
+
if (!icon) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
55
65
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
const classes =
|
|
67
|
+
version === 'secondary'
|
|
68
|
+
? 'bg-white hover:bg-secondary-hover'
|
|
69
|
+
: 'border-solid border border-main-divider hover:border-transparent hover:bg-primary-main';
|
|
60
70
|
|
|
61
|
-
|
|
71
|
+
const isPrimary = version === 'primary' ? 'hover:text-black' : '';
|
|
72
|
+
const rounded = isRounded ? 'rounded-full' : 'rounded-md';
|
|
62
73
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
});
|
|
74
|
+
return (
|
|
75
|
+
<a
|
|
76
|
+
className={`flex items-center justify-center group box-border ${classes} ${rounded} ${isPrimary} ${BUTTON_SIZE[buttonSize]}`}
|
|
77
|
+
href={href}
|
|
78
|
+
aria-label={label}
|
|
79
|
+
target="_blank"
|
|
80
|
+
rel="noopener noreferrer"
|
|
81
|
+
onClick={onClick}
|
|
82
|
+
>
|
|
83
|
+
{icon ? (
|
|
84
|
+
<Img
|
|
85
|
+
image={getIconWithVersion(icon)}
|
|
86
|
+
imageClassName="group-hover:text-white"
|
|
87
|
+
width="24"
|
|
88
|
+
height="24"
|
|
89
|
+
asSVG
|
|
90
|
+
/>
|
|
91
|
+
) : null}
|
|
92
|
+
</a>
|
|
93
|
+
);
|
|
94
|
+
},
|
|
95
|
+
);
|
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
3
|
import type { LinkProps } from '../../model/LinkProps';
|
|
4
|
-
import { MediaButton } from './MediaButton';
|
|
4
|
+
import { type ButtonSize, MediaButton } from './MediaButton';
|
|
5
5
|
|
|
6
6
|
export interface SocialMediaProps {
|
|
7
7
|
className?: string;
|
|
8
8
|
media?: Omit<LinkProps, 'text'>[];
|
|
9
9
|
version?: BlockVersion;
|
|
10
|
+
isRounded?: boolean;
|
|
11
|
+
buttonSize?: ButtonSize;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
|
-
export const SocialMedia = JSX<SocialMediaProps>(
|
|
13
|
-
|
|
14
|
-
<div className=
|
|
15
|
-
{
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
export const SocialMedia = JSX<SocialMediaProps>(
|
|
15
|
+
({ className = '', media, version, isRounded = false, buttonSize, children }) => (
|
|
16
|
+
<div className="font-sans">
|
|
17
|
+
<div className={`flex gap-2.5 ${className}`}>
|
|
18
|
+
{media?.map((_, index) => (
|
|
19
|
+
<MediaButton
|
|
20
|
+
key={String(index)}
|
|
21
|
+
version={version}
|
|
22
|
+
isRounded={isRounded}
|
|
23
|
+
buttonSize={buttonSize}
|
|
24
|
+
{..._}
|
|
25
|
+
/>
|
|
26
|
+
))}
|
|
27
|
+
</div>
|
|
28
|
+
<span className="text-s-light text-secondary-text">{children}</span>
|
|
18
29
|
</div>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
));
|
|
30
|
+
),
|
|
31
|
+
);
|