@redneckz/wildless-cms-uni-blocks 0.14.44 → 0.14.45

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 (85) hide show
  1. package/bundle/bundle.umd.js +27 -24
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/dist/components/CardTransfer/CardTransfer.js +8 -4
  4. package/dist/components/CardTransfer/CardTransfer.js.map +1 -1
  5. package/dist/components/CarouselLinks/CarouselLinkButton.js +3 -3
  6. package/dist/components/CarouselLinks/CarouselLinkButton.js.map +1 -1
  7. package/dist/components/Header/DropdownMenu.js +2 -1
  8. package/dist/components/Header/DropdownMenu.js.map +1 -1
  9. package/dist/components/LinkDocs/LinkDocItem.js +2 -2
  10. package/dist/components/LinkDocs/LinkDocItem.js.map +1 -1
  11. package/dist/ui-kit/Button/LikeButton.js +5 -9
  12. package/dist/ui-kit/Button/LikeButton.js.map +1 -1
  13. package/dist/ui-kit/Img/ImgAsPicture.js +2 -2
  14. package/dist/ui-kit/Img/ImgAsPicture.js.map +1 -1
  15. package/dist/ui-kit/SVG.js +4 -1
  16. package/dist/ui-kit/SVG.js.map +1 -1
  17. package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  18. package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  19. package/lib/components/CardTransfer/CardTransfer.js +8 -4
  20. package/lib/components/CardTransfer/CardTransfer.js.map +1 -1
  21. package/lib/components/CarouselLinks/CarouselLinkButton.js +3 -3
  22. package/lib/components/CarouselLinks/CarouselLinkButton.js.map +1 -1
  23. package/lib/components/Header/DropdownMenu.js +2 -1
  24. package/lib/components/Header/DropdownMenu.js.map +1 -1
  25. package/lib/components/LinkDocs/LinkDocItem.js +2 -2
  26. package/lib/components/LinkDocs/LinkDocItem.js.map +1 -1
  27. package/lib/ui-kit/Button/LikeButton.js +5 -9
  28. package/lib/ui-kit/Button/LikeButton.js.map +1 -1
  29. package/lib/ui-kit/Img/ImgAsPicture.js +2 -2
  30. package/lib/ui-kit/Img/ImgAsPicture.js.map +1 -1
  31. package/lib/ui-kit/SVG.js +4 -1
  32. package/lib/ui-kit/SVG.js.map +1 -1
  33. package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  34. package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  35. package/mobile/bundle/bundle.umd.js +25 -23
  36. package/mobile/bundle/bundle.umd.min.js +1 -1
  37. package/mobile/dist/components/CardTransfer/CardTransfer.js +8 -4
  38. package/mobile/dist/components/CardTransfer/CardTransfer.js.map +1 -1
  39. package/mobile/dist/components/CarouselLinks/CarouselLinkButton.js +3 -3
  40. package/mobile/dist/components/CarouselLinks/CarouselLinkButton.js.map +1 -1
  41. package/mobile/dist/components/Header/DropdownMenu.js +2 -1
  42. package/mobile/dist/components/Header/DropdownMenu.js.map +1 -1
  43. package/mobile/dist/components/LinkDocs/LinkDocItem.js +2 -2
  44. package/mobile/dist/components/LinkDocs/LinkDocItem.js.map +1 -1
  45. package/mobile/dist/ui-kit/Button/LikeButton.js +5 -9
  46. package/mobile/dist/ui-kit/Button/LikeButton.js.map +1 -1
  47. package/mobile/dist/ui-kit/Img/ImgAsPicture.js +2 -2
  48. package/mobile/dist/ui-kit/Img/ImgAsPicture.js.map +1 -1
  49. package/mobile/dist/ui-kit/SVG.js +4 -1
  50. package/mobile/dist/ui-kit/SVG.js.map +1 -1
  51. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  52. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  53. package/mobile/lib/components/CardTransfer/CardTransfer.js +8 -4
  54. package/mobile/lib/components/CardTransfer/CardTransfer.js.map +1 -1
  55. package/mobile/lib/components/CarouselLinks/CarouselLinkButton.js +3 -3
  56. package/mobile/lib/components/CarouselLinks/CarouselLinkButton.js.map +1 -1
  57. package/mobile/lib/components/Header/DropdownMenu.js +2 -1
  58. package/mobile/lib/components/Header/DropdownMenu.js.map +1 -1
  59. package/mobile/lib/components/LinkDocs/LinkDocItem.js +2 -2
  60. package/mobile/lib/components/LinkDocs/LinkDocItem.js.map +1 -1
  61. package/mobile/lib/ui-kit/Button/LikeButton.js +5 -9
  62. package/mobile/lib/ui-kit/Button/LikeButton.js.map +1 -1
  63. package/mobile/lib/ui-kit/Img/ImgAsPicture.js +2 -2
  64. package/mobile/lib/ui-kit/Img/ImgAsPicture.js.map +1 -1
  65. package/mobile/lib/ui-kit/SVG.js +4 -1
  66. package/mobile/lib/ui-kit/SVG.js.map +1 -1
  67. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +1 -1
  68. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
  69. package/mobile/src/components/CardTransfer/CardTransfer.tsx +10 -7
  70. package/mobile/src/components/CarouselLinks/CarouselLinkButton.tsx +5 -3
  71. package/mobile/src/components/Header/DropdownMenu.tsx +5 -2
  72. package/mobile/src/components/LinkDocs/LinkDocItem.tsx +4 -5
  73. package/mobile/src/ui-kit/Button/LikeButton.tsx +18 -17
  74. package/mobile/src/ui-kit/Img/ImgAsPicture.tsx +4 -2
  75. package/mobile/src/ui-kit/SVG.tsx +16 -3
  76. package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
  77. package/package.json +1 -1
  78. package/src/components/CardTransfer/CardTransfer.tsx +10 -7
  79. package/src/components/CarouselLinks/CarouselLinkButton.tsx +5 -3
  80. package/src/components/Header/DropdownMenu.tsx +5 -2
  81. package/src/components/LinkDocs/LinkDocItem.tsx +4 -5
  82. package/src/ui-kit/Button/LikeButton.tsx +18 -17
  83. package/src/ui-kit/Img/ImgAsPicture.tsx +4 -2
  84. package/src/ui-kit/SVG.tsx +16 -3
  85. package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
@@ -1189,7 +1189,10 @@
1189
1189
  });
1190
1190
 
1191
1191
  const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
1192
- return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill: pathFill, ...options }, i) => (jsx("path", { d: d, fill: pathFill || 'currentColor', ...commonOptions, ...options }, i))) }));
1192
+ return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill: pathFill, ...options }, i) => {
1193
+ const resultOptions = { ...commonOptions, ...options };
1194
+ return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
1195
+ }) }));
1193
1196
  });
1194
1197
 
1195
1198
  const CHECK_PATHS = [
@@ -1415,7 +1418,7 @@
1415
1418
  ? image.sources
1416
1419
  .filter((_) => _?.src)
1417
1420
  .sort(sourcesComparator)
1418
- .map(({ src, format, media }, index) => (jsx("source", { srcSet: adjustSrc(router, pathPrefix)(src), type: formatToMimeType(format), media: media ? `(max-width: ${media}px)` : '', ...image.size }, `${index}_${src}`)))
1421
+ .map(({ src, format, media }, index) => (jsx("source", { srcSet: adjustSrc(router, pathPrefix)(src), type: formatToMimeType(format), media: media ? `(max-width: ${media}px)` : '', width: image.size?.width, height: image.size?.height }, `${index}_${src}`)))
1419
1422
  : null, image?.src
1420
1423
  ? renderImg({ ...image, src: adjustSrc(router, pathPrefix)(image.src) }, imageClassName)
1421
1424
  : null] }));
@@ -1423,7 +1426,7 @@
1423
1426
  const renderImg = (image, imageClassName = '') => (jsx("img", { src: image.src, className: style('object-contain', imageClassName), alt: image.alt || image.title, title: image.title || '', style: {
1424
1427
  width: image.size?.width ? `${image.size?.width}px` : '100%',
1425
1428
  height: image.size?.height ? `${image.size?.height}px` : 'auto',
1426
- }, ...image.size }));
1429
+ }, width: image.size?.width, height: image.size?.height }));
1427
1430
  const adjustSrc = (router, pathPrefix) => (src) => src && !isURL(src) ? adjustHref(router)(joinPath(pathPrefix, src)) : src;
1428
1431
  const formatToMimeType = (format) => format ? `image/${String(format)}` : undefined;
1429
1432
 
@@ -1755,7 +1758,7 @@
1755
1758
  });
1756
1759
  }
1757
1760
  };
1758
- return dotCount ? (jsx("div", { className: style('flex gap-xs', containerStyles[listType], version ? 'group' : '', className), ...(version ? { 'data-ver': version } : {}), children: new Array(dotCount).fill(null).map((_, idx) => (jsx("div", { className: `${dotStyle} ${idx === activeIndex ? activeDotStyles[listType] : inactiveDotStyle}`, role: "button", "aria-hidden": true, onClick: () => handleClick(idx) }, String(idx)))) })) : null;
1761
+ return dotCount ? (jsx("div", { className: style('flex gap-xs', containerStyles[listType], version ? 'group' : '', className), "data-ver": version, children: new Array(dotCount).fill(null).map((_, idx) => (jsx("div", { className: `${dotStyle} ${idx === activeIndex ? activeDotStyles[listType] : inactiveDotStyle}`, role: "button", "aria-hidden": true, onClick: () => handleClick(idx) }, String(idx)))) })) : null;
1759
1762
  });
1760
1763
 
1761
1764
  const areArraysEqual = (as, bs) => as === bs || Boolean(as && bs && as?.length === bs?.length && as.every((_, i) => _ === bs[i]));
@@ -2664,16 +2667,19 @@
2664
2667
  };
2665
2668
  const INITIAL_FORM_STATE = {
2666
2669
  amount: 1500,
2667
- _amount: 1500,
2668
2670
  };
2669
2671
  const CardTransfer = JSX(({ className = '', title = DEFAULT_TITLE, label = DEFAULT_LABEL, placeholder = DEFAULT_PLACEHOLDER, button, formType = 'private', ...rest }) => {
2670
- const [{ amount, _amount }, { field }] = useForm(INITIAL_FORM_STATE);
2671
- const isDisabled = amount <= 0;
2672
+ const [{ amount }, { field }] = useForm(INITIAL_FORM_STATE);
2673
+ const [isDisabled, setDisabled] = useState(false);
2674
+ useEffect(() => {
2675
+ setDisabled(amount <= 0);
2676
+ }, [amount]);
2672
2677
  const buttonStyle = isDisabled
2673
2678
  ? getDisabledButtonClasses({ version: button?.version })
2674
2679
  : getRegularButtonClasses({ className: 'text-white', version: button?.version });
2675
2680
  const link = useLink();
2676
- return (jsxs(BlockWrapper, { className: style('flex flex-col items-center', className), defaultPadding: "p-6xl", ...rest, children: [title ? (jsx(Heading, { className: "pb-lg xl:pb-4xl self-start xl:self-center", headingType: "h3", title: title })) : null, jsxs("form", { className: "w-full xl:max-w-[468px]", method: "POST", action: FORM_URL_MAP[formType], children: [jsx(CurrencyInput, { name: "_amount", valid: !isDisabled, placeholder: placeholder, label: label, ...field('_amount', { parse: Number, format: String }) }), jsx("input", { type: "hidden", name: "amount", value: _amount }), button?.text ? (jsx("button", { type: "submit", className: style('w-full p-m mt-lg', buttonStyle), disabled: isDisabled, ...link(button), children: button.text })) : null] })] }));
2681
+ const { onClick } = link(button || {});
2682
+ return (jsxs(BlockWrapper, { className: style('flex flex-col items-center', className), defaultPadding: "p-6xl", ...rest, children: [title ? (jsx(Heading, { className: "pb-lg xl:pb-4xl self-start xl:self-center", headingType: "h3", title: title })) : null, jsxs("form", { className: "w-full xl:max-w-[468px]", method: "POST", action: FORM_URL_MAP[formType], children: [jsx(CurrencyInput, { valid: !isDisabled, placeholder: placeholder, label: label, ...field('amount', { parse: Number, format: String }) }), jsx("input", { type: "hidden", name: "amount", value: amount }), button?.text ? (jsx("button", { type: "submit", className: style('w-full p-m mt-lg', buttonStyle), disabled: isDisabled, onClick: onClick, children: button.text })) : null] })] }));
2677
2683
  });
2678
2684
 
2679
2685
  const useCarouselControls = (props, initialIndex = 0) => {
@@ -2888,10 +2894,10 @@
2888
2894
  const LINK_CLASS_NAME = `absolute border
2889
2895
  bg-white flex justify-between group-hover/link:text-primary-main`;
2890
2896
  const LINK_BORDER_CLASS_NAME = 'hidden xl:block absolute w-full h-full border border-white';
2891
- const CarouselLinkButton = JSX(({ text, href = '', target = '', className = '' }) => {
2897
+ const CarouselLinkButton = JSX(({ className = '', ...linkProps }) => {
2892
2898
  const link = useLink();
2893
- const adjustedProps = link({ href, target });
2894
- return text ? (jsx("div", { className: style('flex relative group/link pl-s pb-s min-w-[16rem] xl:min-w-[20rem]', className), children: jsxs("div", { className: "relative min-h-16 w-full", children: [jsxs("a", { className: style(LINK_CLASS_NAME, 'sm:rounded-md rounded-none w-full px-xl py-lg whitespace-nowrap z-10'), role: "link", ...adjustedProps, children: [jsx(Text, { size: "text-l", font: "font-light", color: "text-primary-text", children: text }), jsx(Img, { className: "group-hover/link:brightness-100 hidden xl:block ml-2xs", image: { icon: 'ArrowRightIcon', iconVersion: 'black' }, imageClassName: "group-hover/link:text-primary-main hidden xl:block", width: "24", height: "24" })] }), jsx("div", { className: style(LINK_BORDER_CLASS_NAME, '-bottom-1.5 -left-1.5') }), jsx("div", { className: style(LINK_BORDER_CLASS_NAME, '-bottom-3 -left-3') })] }) })) : null;
2899
+ const { text, href, target, onClick } = link(linkProps);
2900
+ return text ? (jsx("div", { className: style('flex relative group/link pl-s pb-s min-w-[16rem] xl:min-w-[20rem]', className), children: jsxs("div", { className: "relative min-h-16 w-full", children: [jsxs("a", { className: style(LINK_CLASS_NAME, 'sm:rounded-md rounded-none w-full px-xl py-lg whitespace-nowrap z-10'), role: "link", href: href, target: target, onClick: onClick, children: [jsx(Text, { size: "text-l", font: "font-light", color: "text-primary-text", children: text }), jsx(Img, { className: "group-hover/link:brightness-100 hidden xl:block ml-2xs", image: { icon: 'ArrowRightIcon', iconVersion: 'black' }, imageClassName: "group-hover/link:text-primary-main hidden xl:block", width: "24", height: "24" })] }), jsx("div", { className: style(LINK_BORDER_CLASS_NAME, '-bottom-1.5 -left-1.5') }), jsx("div", { className: style(LINK_BORDER_CLASS_NAME, '-bottom-3 -left-3') })] }) })) : null;
2895
2901
  });
2896
2902
 
2897
2903
  const MAX_LINKS_COUNT = 3;
@@ -3622,11 +3628,11 @@
3622
3628
  return `${parseFloat((bytes / Math.pow(KILO, i)).toFixed(decimals))} ${KILO_SIZES[i]}`;
3623
3629
  };
3624
3630
 
3625
- const LinkDocItem = JSX(({ icon, text, fileFormat, fileSize, ...linkProps }) => {
3631
+ const LinkDocItem = JSX(({ icon, text, href, target, fileFormat, fileSize }) => {
3626
3632
  const prefix = fileFormat || fileSize ? ',' : '';
3627
3633
  const size = fileSize ?? '';
3628
3634
  const format = fileFormat ? String(fileFormat) : '';
3629
- return (jsxs("a", { className: "flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main", role: "link", ...linkProps, children: [icon, text ? (jsxs(Text, { size: "text-l", font: "font-light", children: [text, jsx(Text, { color: "text-secondary-text", children: linkProps?.href && `${size} ${prefix} ${format}` })] })) : null] }));
3635
+ return (jsxs("a", { className: "flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main", role: "link", href: href, target: target, children: [icon, text ? (jsxs(Text, { size: "text-l", font: "font-light", children: [text, jsx(Text, { color: "text-secondary-text", children: href && `${size} ${prefix} ${format}` })] })) : null] }));
3630
3636
  });
3631
3637
 
3632
3638
  const linkIconStyle = 'min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md';
@@ -5399,16 +5405,12 @@
5399
5405
 
5400
5406
  const LikeButton = JSX(({ className, onClick, ariaLabel }) => (jsx("button", { type: "button", className: `border-0 w-9 bg-inherit cursor-pointer ${className || ''}`, onClick: onClick, "aria-label": ariaLabel, children: renderLikeIcon() })));
5401
5407
  const renderLikeIcon = () => {
5402
- const params = {
5403
- stroke: '#292D32',
5404
- strokeLinecap: 'round',
5405
- strokeLinejoin: 'round',
5406
- strokeWidth: '1.5',
5407
- };
5408
- return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [jsx("path", { ...params, strokeMiterlimit: "10",
5409
- /* eslint-disable max-len */
5410
- d: "M21.48 11.95c.5-1.4-.4-2.6-1.9-2.6h-4c-.6 0-1.1-.5-1-1.2l.5-3.2c.2-.9-.4-1.9-1.3-2.2-.8-.3-1.8.1-2.2.7l-4.1 6.1M7.48 18.35l3.1 2.4c.4.4 1.3.6 1.9.6h3.8c1.2 0 2.5-.9 2.8-2.1l1.24-3.77" }), jsx("path", { ...params, d: "M2.38 18.35v-9.8c0-1.4.6-1.9 2-1.9h1c1.4 0 2 .5 2 1.9v9.8c0 1.4-.6 1.9-2 1.9h-1c-1.4 0-2-.5-2-1.9Z" })] }));
5408
+ const handPath = 'M21.48 11.95c.5-1.4-.4-2.6-1.9-2.6h-4c-.6 0-1.1-.5-1-1.2l.5-3.2c.2-.9-.4-1.9-1.3-2.2-.8-.3-1.8.1-2.2.7l-4.1' +
5409
+ ' 6.1M7.48 18.35l3.1 2.4c.4.4 1.3.6 1.9.6h3.8c1.2 0 2.5-.9 2.8-2.1l1.24-3.77';
5410
+ const cuffPath = 'M2.38 18.35v-9.8c0-1.4.6-1.9 2-1.9h1c1.4 0 2 .5 2 1.9v9.8c0 1.4-.6 1.9-2 1.9h-1c-1.4 0-2-.5-2-1.9Z';
5411
+ return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [renderLinkIconPath(handPath), renderLinkIconPath(cuffPath)] }));
5411
5412
  };
5413
+ const renderLinkIconPath = (d) => (jsx("path", { stroke: "#292D32", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5", strokeMiterlimit: "10", d: d }));
5412
5414
 
5413
5415
  const LikeControl = JSX(({ className = '' }) => {
5414
5416
  const router = useRouter();
@@ -5436,7 +5438,7 @@
5436
5438
 
5437
5439
  const joinList = (sep) => (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: `sep-${i}` }, el) : [el]), []);
5438
5440
 
5439
- const packageVersion = "0.14.43";
5441
+ const packageVersion = "0.14.44";
5440
5442
 
5441
5443
  exports.Blocks = Blocks;
5442
5444
  exports.ContentPage = ContentPage;