@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.
Files changed (29) hide show
  1. package/bundle/bundle.umd.js +10 -5
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/Footer/MediaButton.d.ts +3 -0
  4. package/bundle/components/Footer/SocialMedia.d.ts +3 -0
  5. package/dist/components/Footer/MediaButton.d.ts +3 -0
  6. package/dist/components/Footer/MediaButton.js +8 -3
  7. package/dist/components/Footer/MediaButton.js.map +1 -1
  8. package/dist/components/Footer/SocialMedia.d.ts +3 -0
  9. package/dist/components/Footer/SocialMedia.js +1 -1
  10. package/dist/components/Footer/SocialMedia.js.map +1 -1
  11. package/lib/components/Footer/MediaButton.d.ts +3 -0
  12. package/lib/components/Footer/MediaButton.js +8 -3
  13. package/lib/components/Footer/MediaButton.js.map +1 -1
  14. package/lib/components/Footer/SocialMedia.d.ts +3 -0
  15. package/lib/components/Footer/SocialMedia.js +1 -1
  16. package/lib/components/Footer/SocialMedia.js.map +1 -1
  17. package/mobile/bundle/bundle.umd.js +9 -4
  18. package/mobile/bundle/bundle.umd.min.js +1 -1
  19. package/mobile/bundle/components/Footer/MediaButton.d.ts +3 -0
  20. package/mobile/dist/components/Footer/MediaButton.d.ts +3 -0
  21. package/mobile/dist/components/Footer/MediaButton.js +8 -3
  22. package/mobile/dist/components/Footer/MediaButton.js.map +1 -1
  23. package/mobile/lib/components/Footer/MediaButton.d.ts +3 -0
  24. package/mobile/lib/components/Footer/MediaButton.js +8 -3
  25. package/mobile/lib/components/Footer/MediaButton.js.map +1 -1
  26. package/mobile/src/components/Footer/MediaButton.tsx +46 -36
  27. package/package.json +1 -1
  28. package/src/components/Footer/MediaButton.tsx +46 -36
  29. 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
- export const MediaButton = JSX(({ version = 'primary', ...rest }) => {
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
- return (_jsx("a", { className: `flex items-center justify-center rounded-md w-14 h-14 group box-border ${classes} ${isPrimary ? 'hover:text-black' : ''}`, 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 }));
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,MA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,OAAO,IAAI,CAAC;KACb;IAED,MAAM,OAAO,GACX,OAAO,KAAK,WAAW;QACrB,CAAC,CAAC,mCAAmC;QACrC,CAAC,CAAC,wFAAwF,CAAC;IAE/F,MAAM,SAAS,GAAG,OAAO,KAAK,SAAS,CAAC;IAExC,OAAO,CACL,YACE,SAAS,EAAE,0EAA0E,OAAO,IAC1F,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,EACnC,EAAE,EACF,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,CAAC,CAAC"}
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,IAAI,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE;QAC9B,KAAK,EAAE,UAAU;KAClB;IACD;QACE,OAAO,EAAE,CAAC,QAAQ,CAAC;QACnB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,KAAK,EAAE,WAAW;KACnB;IACD;QACE,OAAO,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AM,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,CAAC;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
- export const MediaButton = JSX<MediaButtonProps>(({ version = 'primary', ...rest }) => {
46
- const link = useLink();
47
- const { href, onClick } = link(rest);
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
- const { icon, label } =
50
- ICONS_MAP.find(({ origins }) => origins.some((_) => href?.includes(_))) || {};
59
+ const { icon, label } =
60
+ ICONS_MAP.find(({ origins }) => origins.some((_) => href?.includes(_))) || {};
51
61
 
52
- if (!icon) {
53
- return null;
54
- }
62
+ if (!icon) {
63
+ return null;
64
+ }
55
65
 
56
- const classes =
57
- version === 'secondary'
58
- ? 'bg-white hover:bg-secondary-hover'
59
- : 'border-solid border border-main-divider hover:border-transparent hover:bg-primary-main';
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
- const isPrimary = version === 'primary';
71
+ const isPrimary = version === 'primary' ? 'hover:text-black' : '';
72
+ const rounded = isRounded ? 'rounded-full' : 'rounded-md';
62
73
 
63
- return (
64
- <a
65
- className={`flex items-center justify-center rounded-md w-14 h-14 group box-border ${classes} ${
66
- isPrimary ? 'hover:text-black' : ''
67
- }`}
68
- href={href}
69
- aria-label={label}
70
- target="_blank"
71
- rel="noopener noreferrer"
72
- onClick={onClick}
73
- >
74
- {icon ? (
75
- <Img
76
- image={getIconWithVersion(icon)}
77
- imageClassName="group-hover:text-white"
78
- width="24"
79
- height="24"
80
- asSVG
81
- />
82
- ) : null}
83
- </a>
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.6.48",
3
+ "version": "0.6.49",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -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
- export const MediaButton = JSX<MediaButtonProps>(({ version = 'primary', ...rest }) => {
46
- const link = useLink();
47
- const { href, onClick } = link(rest);
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
- const { icon, label } =
50
- ICONS_MAP.find(({ origins }) => origins.some((_) => href?.includes(_))) || {};
59
+ const { icon, label } =
60
+ ICONS_MAP.find(({ origins }) => origins.some((_) => href?.includes(_))) || {};
51
61
 
52
- if (!icon) {
53
- return null;
54
- }
62
+ if (!icon) {
63
+ return null;
64
+ }
55
65
 
56
- const classes =
57
- version === 'secondary'
58
- ? 'bg-white hover:bg-secondary-hover'
59
- : 'border-solid border border-main-divider hover:border-transparent hover:bg-primary-main';
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
- const isPrimary = version === 'primary';
71
+ const isPrimary = version === 'primary' ? 'hover:text-black' : '';
72
+ const rounded = isRounded ? 'rounded-full' : 'rounded-md';
62
73
 
63
- return (
64
- <a
65
- className={`flex items-center justify-center rounded-md w-14 h-14 group box-border ${classes} ${
66
- isPrimary ? 'hover:text-black' : ''
67
- }`}
68
- href={href}
69
- aria-label={label}
70
- target="_blank"
71
- rel="noopener noreferrer"
72
- onClick={onClick}
73
- >
74
- {icon ? (
75
- <Img
76
- image={getIconWithVersion(icon)}
77
- imageClassName="group-hover:text-white"
78
- width="24"
79
- height="24"
80
- asSVG
81
- />
82
- ) : null}
83
- </a>
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>(({ className = '', media, version, children }) => (
13
- <div className="font-sans">
14
- <div className={`flex gap-2.5 ${className}`}>
15
- {media?.map((_, index) => (
16
- <MediaButton key={String(index)} version={version} {..._} />
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
- <span className="text-s-light text-secondary-text">{children}</span>
20
- </div>
21
- ));
30
+ ),
31
+ );