@redneckz/wildless-cms-uni-blocks 0.14.546 → 0.14.548
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 -19
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/ButtonsBlock/ButtonsBlock.js +1 -1
- package/dist/components/ButtonsBlock/ButtonsBlock.js.map +1 -1
- package/dist/ui-kit/BenefitsList/DefaultBenefitsList.js +1 -7
- package/dist/ui-kit/BenefitsList/DefaultBenefitsList.js.map +1 -1
- package/dist/ui-kit/LinkButton/ArrowButton.js +1 -1
- package/dist/ui-kit/LinkButton/ArrowButton.js.map +1 -1
- package/dist/ui-kit/LinkButton/ButtonInner.js +1 -1
- package/dist/ui-kit/LinkButton/ButtonInner.js.map +1 -1
- package/dist/ui-kit/LinkButton/renderButtonsSection.js +3 -3
- package/dist/ui-kit/LinkButton/renderButtonsSection.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ButtonsBlock/ButtonsBlock.js +1 -1
- package/lib/components/ButtonsBlock/ButtonsBlock.js.map +1 -1
- package/lib/ui-kit/BenefitsList/DefaultBenefitsList.js +1 -7
- package/lib/ui-kit/BenefitsList/DefaultBenefitsList.js.map +1 -1
- package/lib/ui-kit/LinkButton/ArrowButton.js +1 -1
- package/lib/ui-kit/LinkButton/ArrowButton.js.map +1 -1
- package/lib/ui-kit/LinkButton/ButtonInner.js +1 -1
- package/lib/ui-kit/LinkButton/ButtonInner.js.map +1 -1
- package/lib/ui-kit/LinkButton/renderButtonsSection.js +3 -3
- package/lib/ui-kit/LinkButton/renderButtonsSection.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +10 -19
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/ButtonsBlock/ButtonsBlock.js +1 -1
- package/mobile/dist/components/ButtonsBlock/ButtonsBlock.js.map +1 -1
- package/mobile/dist/ui-kit/BenefitsList/DefaultBenefitsList.js +1 -7
- package/mobile/dist/ui-kit/BenefitsList/DefaultBenefitsList.js.map +1 -1
- package/mobile/dist/ui-kit/LinkButton/ArrowButton.js +1 -1
- package/mobile/dist/ui-kit/LinkButton/ArrowButton.js.map +1 -1
- package/mobile/dist/ui-kit/LinkButton/ButtonInner.js +1 -1
- package/mobile/dist/ui-kit/LinkButton/ButtonInner.js.map +1 -1
- package/mobile/dist/ui-kit/LinkButton/renderButtonsSection.js +3 -3
- package/mobile/dist/ui-kit/LinkButton/renderButtonsSection.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ButtonsBlock/ButtonsBlock.js +1 -1
- package/mobile/lib/components/ButtonsBlock/ButtonsBlock.js.map +1 -1
- package/mobile/lib/ui-kit/BenefitsList/DefaultBenefitsList.js +1 -7
- package/mobile/lib/ui-kit/BenefitsList/DefaultBenefitsList.js.map +1 -1
- package/mobile/lib/ui-kit/LinkButton/ArrowButton.js +1 -1
- package/mobile/lib/ui-kit/LinkButton/ArrowButton.js.map +1 -1
- package/mobile/lib/ui-kit/LinkButton/ButtonInner.js +1 -1
- package/mobile/lib/ui-kit/LinkButton/ButtonInner.js.map +1 -1
- package/mobile/lib/ui-kit/LinkButton/renderButtonsSection.js +3 -3
- package/mobile/lib/ui-kit/LinkButton/renderButtonsSection.js.map +1 -1
- package/mobile/src/components/ButtonsBlock/ButtonsBlock.tsx +1 -1
- package/mobile/src/ui-kit/BenefitsList/DefaultBenefitsList.tsx +1 -23
- package/mobile/src/ui-kit/LinkButton/ArrowButton.tsx +1 -1
- package/mobile/src/ui-kit/LinkButton/ButtonInner.tsx +1 -1
- package/mobile/src/ui-kit/LinkButton/renderButtonsSection.tsx +4 -4
- package/package.json +1 -1
- package/src/components/ButtonsBlock/ButtonsBlock.tsx +1 -1
- package/src/ui-kit/BenefitsList/DefaultBenefitsList.tsx +1 -23
- package/src/ui-kit/LinkButton/ArrowButton.tsx +1 -1
- package/src/ui-kit/LinkButton/ButtonInner.tsx +1 -1
- package/src/ui-kit/LinkButton/renderButtonsSection.tsx +4 -4
|
@@ -1,34 +1,12 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { deviation } from '../../utils/deviation';
|
|
3
2
|
import { style } from '../../utils/style';
|
|
4
3
|
import { BenefitItem } from '../BenefitItem/BenefitItem';
|
|
5
|
-
import { type BenefitItemContent } from '../BenefitItem/BenefitItemContent';
|
|
6
4
|
import { type BenefitsListProps } from './BenefitsListProps';
|
|
7
5
|
|
|
8
|
-
const MAX_BENEFITS_LEN_DEVIATION = 16;
|
|
9
|
-
|
|
10
|
-
const benefitLength = (_: BenefitItemContent) =>
|
|
11
|
-
Math.max(_?.label?.length || 0, _?.description?.length || 0, _?.__html?.length || 0);
|
|
12
|
-
|
|
13
|
-
const isDistortedBenefits = (benefits: BenefitItemContent[]) =>
|
|
14
|
-
deviation(benefits.map(benefitLength)) > MAX_BENEFITS_LEN_DEVIATION;
|
|
15
|
-
|
|
16
|
-
const hasIcon = (_: BenefitItemContent) =>
|
|
17
|
-
_ && 'icon' in _ && _.icon && (_.icon.icon || _.icon.src);
|
|
18
|
-
|
|
19
|
-
const isTextualBenefits = (benefits: BenefitItemContent[]) => !benefits.some(hasIcon);
|
|
20
|
-
|
|
21
6
|
export const DefaultBenefitsList = JSX<BenefitsListProps>(
|
|
22
7
|
({ className, benefitsVersion = 'normal', benefits }) =>
|
|
23
8
|
benefits?.length ? (
|
|
24
|
-
<div
|
|
25
|
-
className={style(
|
|
26
|
-
'flex gap-x-m gap-y-s',
|
|
27
|
-
isDistortedBenefits(benefits) || isTextualBenefits(benefits) ? 'flex-col' : 'flex-wrap',
|
|
28
|
-
className,
|
|
29
|
-
)}
|
|
30
|
-
role="list"
|
|
31
|
-
>
|
|
9
|
+
<div className={style('flex gap-x-m gap-y-s flex-col', className)} role="list">
|
|
32
10
|
{benefits.map((_, i) => (
|
|
33
11
|
<BenefitItem key={String(i)} benefitsVersion={benefitsVersion} {..._} />
|
|
34
12
|
))}
|
|
@@ -13,7 +13,7 @@ export const ArrowButton = JSX<LinkButtonProps>(({ className, disabled, ...rest
|
|
|
13
13
|
disabled
|
|
14
14
|
? 'bg-secondary-light text-secondary-text'
|
|
15
15
|
: 'bg-white text-primary-text hover:text-primary-main',
|
|
16
|
-
className
|
|
16
|
+
className,
|
|
17
17
|
)}
|
|
18
18
|
disabled={disabled}
|
|
19
19
|
{...rest}
|
|
@@ -7,7 +7,7 @@ import { type LinkButtonProps } from './LinkButtonProps';
|
|
|
7
7
|
/** @deprecated */
|
|
8
8
|
export const ButtonInner = JSX<LinkButtonProps>((props) => {
|
|
9
9
|
const { text, aboveText, appendLeft, appendRight, version = 'primary' } = props;
|
|
10
|
-
const iconHideStyle = isWithText(props)
|
|
10
|
+
const iconHideStyle = isWithText(props) && 'hidden lg:block';
|
|
11
11
|
|
|
12
12
|
return (
|
|
13
13
|
<div className={style(buttonStyle(props), 'flex gap-xs')}>
|
|
@@ -22,7 +22,7 @@ export const renderButtonsSection = (
|
|
|
22
22
|
'flex',
|
|
23
23
|
isVertical
|
|
24
24
|
? 'flex-col gap-xs justify-items-stretch'
|
|
25
|
-
: 'flex-wrap @xl:flex-nowrap gap-lg sm:gap-m',
|
|
25
|
+
: 'flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto',
|
|
26
26
|
className,
|
|
27
27
|
)}
|
|
28
28
|
role="group"
|
|
@@ -56,14 +56,14 @@ const DEFAULT_ICON_W = 24;
|
|
|
56
56
|
const getIconVersion = (icon: Picture | undefined, version = 'secondary') => {
|
|
57
57
|
const iconVersionDefault = version === 'secondary' ? 'color' : 'white';
|
|
58
58
|
|
|
59
|
-
return icon?.iconVersion
|
|
59
|
+
return icon?.iconVersion || iconVersionDefault;
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
const renderButtonIcon = (icon: Picture) =>
|
|
63
|
-
isIcon(icon)
|
|
63
|
+
isIcon(icon) && (
|
|
64
64
|
<Img
|
|
65
65
|
image={icon}
|
|
66
66
|
width={String(icon?.size?.width || DEFAULT_ICON_W)}
|
|
67
67
|
height={String(DEFAULT_ICON_W)}
|
|
68
68
|
/>
|
|
69
|
-
)
|
|
69
|
+
);
|