@redneckz/wildless-cms-uni-blocks 0.10.7 → 0.10.8
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +59 -40
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.d.ts +5 -0
- package/bundle/components/CarouselRecommendationCard/cardStyle.d.ts +1 -0
- package/bundle/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -1
- package/bundle/components/Tabs/CenteredTabs.d.ts +7 -0
- package/bundle/components/Tabs/LinkTab.d.ts +2 -2
- package/bundle/components/Tabs/TabsContent.d.ts +3 -2
- package/bundle/components/Tabs/renderGroupTab.d.ts +2 -2
- package/bundle/components/Tabs/renderTab.d.ts +3 -3
- package/bundle/components/Tabs/tabItemClasses.d.ts +3 -2
- package/dist/components/Blocks.mobile.js +2 -0
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +2 -2
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.d.ts +5 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.js +17 -0
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.js.map +1 -0
- package/dist/components/CarouselRecommendationCard/cardStyle.d.ts +1 -0
- package/dist/components/CarouselRecommendationCard/cardStyle.js +4 -0
- package/dist/components/CarouselRecommendationCard/cardStyle.js.map +1 -0
- package/dist/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -1
- package/dist/components/CarouselTariffsCard/getPaddingStyle.js +1 -1
- package/dist/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -1
- package/dist/components/CarouselTariffsCard/getPaddingStyle.mobile.js +1 -1
- package/dist/components/CarouselTariffsCard/getPaddingStyle.mobile.js.map +1 -1
- package/dist/components/Footer/Footer.mobile.js +1 -1
- package/dist/components/Footer/Footer.mobile.js.map +1 -1
- package/dist/components/Footer/SocialMedia.mobile.js +1 -1
- package/dist/components/Footer/SocialMedia.mobile.js.map +1 -1
- package/dist/components/Tabs/CenteredTabs.d.ts +7 -0
- package/dist/components/Tabs/CenteredTabs.js +7 -0
- package/dist/components/Tabs/CenteredTabs.js.map +1 -0
- package/dist/components/Tabs/LinkTab.d.ts +2 -2
- package/dist/components/Tabs/LinkTab.js +2 -2
- package/dist/components/Tabs/LinkTab.js.map +1 -1
- package/dist/components/Tabs/ScrollableTabs.js +3 -9
- package/dist/components/Tabs/ScrollableTabs.js.map +1 -1
- package/dist/components/Tabs/Tabs.js +14 -7
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tabs/TabsContent.d.ts +3 -2
- package/dist/components/Tabs/renderGroupTab.d.ts +2 -2
- package/dist/components/Tabs/renderGroupTab.js +4 -4
- package/dist/components/Tabs/renderGroupTab.js.map +1 -1
- package/dist/components/Tabs/renderTab.d.ts +3 -3
- package/dist/components/Tabs/renderTab.js +3 -3
- package/dist/components/Tabs/renderTab.js.map +1 -1
- package/dist/components/Tabs/tabItemClasses.d.ts +3 -2
- package/dist/components/Tabs/tabItemClasses.js +26 -10
- package/dist/components/Tabs/tabItemClasses.js.map +1 -1
- package/dist/hooks/useLink.js +1 -1
- package/dist/hooks/useLink.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Blocks.mobile.js +2 -0
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.mobile.d.ts +16 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.d.ts +5 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.js +15 -0
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.js.map +1 -0
- package/lib/components/CarouselRecommendationCard/cardStyle.d.ts +1 -0
- package/lib/components/CarouselRecommendationCard/cardStyle.js +2 -0
- package/lib/components/CarouselRecommendationCard/cardStyle.js.map +1 -0
- package/lib/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -1
- package/lib/components/CarouselTariffsCard/getPaddingStyle.js +1 -1
- package/lib/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -1
- package/lib/components/CarouselTariffsCard/getPaddingStyle.mobile.js +1 -1
- package/lib/components/CarouselTariffsCard/getPaddingStyle.mobile.js.map +1 -1
- package/lib/components/Footer/Footer.mobile.js +1 -1
- package/lib/components/Footer/Footer.mobile.js.map +1 -1
- package/lib/components/Footer/SocialMedia.mobile.js +1 -1
- package/lib/components/Footer/SocialMedia.mobile.js.map +1 -1
- package/lib/components/Tabs/CenteredTabs.d.ts +7 -0
- package/lib/components/Tabs/CenteredTabs.js +5 -0
- package/lib/components/Tabs/CenteredTabs.js.map +1 -0
- package/lib/components/Tabs/LinkTab.d.ts +2 -2
- package/lib/components/Tabs/LinkTab.js +2 -2
- package/lib/components/Tabs/LinkTab.js.map +1 -1
- package/lib/components/Tabs/ScrollableTabs.js +3 -9
- package/lib/components/Tabs/ScrollableTabs.js.map +1 -1
- package/lib/components/Tabs/Tabs.fixture.d.ts +1 -0
- package/lib/components/Tabs/Tabs.js +14 -7
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Tabs/TabsContent.d.ts +3 -2
- package/lib/components/Tabs/renderGroupTab.d.ts +2 -2
- package/lib/components/Tabs/renderGroupTab.js +5 -5
- package/lib/components/Tabs/renderGroupTab.js.map +1 -1
- package/lib/components/Tabs/renderTab.d.ts +3 -3
- package/lib/components/Tabs/renderTab.js +3 -3
- package/lib/components/Tabs/renderTab.js.map +1 -1
- package/lib/components/Tabs/tabItemClasses.d.ts +3 -2
- package/lib/components/Tabs/tabItemClasses.js +26 -10
- package/lib/components/Tabs/tabItemClasses.js.map +1 -1
- package/lib/hooks/useLink.js +1 -1
- package/lib/hooks/useLink.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +143 -135
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CarouselRecommendationCard/cardStyle.d.ts +1 -0
- package/mobile/bundle/components/Tabs/CenteredTabs.d.ts +7 -0
- package/mobile/bundle/components/Tabs/LinkTab.d.ts +2 -2
- package/mobile/bundle/components/Tabs/TabsContent.d.ts +3 -2
- package/mobile/bundle/components/Tabs/renderGroupTab.d.ts +2 -2
- package/mobile/bundle/components/Tabs/renderTab.d.ts +3 -3
- package/mobile/bundle/components/Tabs/tabItemClasses.d.ts +3 -2
- package/mobile/dist/components/Blocks.js +2 -0
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +4 -4
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/cardStyle.d.ts +1 -0
- package/mobile/dist/components/CarouselRecommendationCard/cardStyle.js +4 -0
- package/mobile/dist/components/CarouselRecommendationCard/cardStyle.js.map +1 -0
- package/mobile/dist/components/CarouselTariffsCard/getPaddingStyle.js +1 -1
- package/mobile/dist/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -1
- package/mobile/dist/components/Footer/Footer.js +1 -1
- package/mobile/dist/components/Footer/Footer.js.map +1 -1
- package/mobile/dist/components/Footer/SocialMedia.js +1 -1
- package/mobile/dist/components/Footer/SocialMedia.js.map +1 -1
- package/mobile/dist/components/Tabs/CenteredTabs.d.ts +7 -0
- package/mobile/dist/components/Tabs/CenteredTabs.js +7 -0
- package/mobile/dist/components/Tabs/CenteredTabs.js.map +1 -0
- package/mobile/dist/components/Tabs/LinkTab.d.ts +2 -2
- package/mobile/dist/components/Tabs/LinkTab.js +2 -2
- package/mobile/dist/components/Tabs/LinkTab.js.map +1 -1
- package/mobile/dist/components/Tabs/ScrollableTabs.js +3 -9
- package/mobile/dist/components/Tabs/ScrollableTabs.js.map +1 -1
- package/mobile/dist/components/Tabs/Tabs.js +14 -7
- package/mobile/dist/components/Tabs/Tabs.js.map +1 -1
- package/mobile/dist/components/Tabs/TabsContent.d.ts +3 -2
- package/mobile/dist/components/Tabs/renderGroupTab.d.ts +2 -2
- package/mobile/dist/components/Tabs/renderGroupTab.js +4 -4
- package/mobile/dist/components/Tabs/renderGroupTab.js.map +1 -1
- package/mobile/dist/components/Tabs/renderTab.d.ts +3 -3
- package/mobile/dist/components/Tabs/renderTab.js +3 -3
- package/mobile/dist/components/Tabs/renderTab.js.map +1 -1
- package/mobile/dist/components/Tabs/tabItemClasses.d.ts +3 -2
- package/mobile/dist/components/Tabs/tabItemClasses.js +26 -10
- package/mobile/dist/components/Tabs/tabItemClasses.js.map +1 -1
- package/mobile/dist/hooks/useLink.js +1 -1
- package/mobile/dist/hooks/useLink.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/Blocks.js +2 -0
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +4 -4
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/cardStyle.d.ts +1 -0
- package/mobile/lib/components/CarouselRecommendationCard/cardStyle.js +2 -0
- package/mobile/lib/components/CarouselRecommendationCard/cardStyle.js.map +1 -0
- package/mobile/lib/components/CarouselTariffsCard/getPaddingStyle.js +1 -1
- package/mobile/lib/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -1
- package/mobile/lib/components/Footer/Footer.js +1 -1
- package/mobile/lib/components/Footer/Footer.js.map +1 -1
- package/mobile/lib/components/Footer/SocialMedia.js +1 -1
- package/mobile/lib/components/Footer/SocialMedia.js.map +1 -1
- package/mobile/lib/components/Tabs/CenteredTabs.d.ts +7 -0
- package/mobile/lib/components/Tabs/CenteredTabs.js +5 -0
- package/mobile/lib/components/Tabs/CenteredTabs.js.map +1 -0
- package/mobile/lib/components/Tabs/LinkTab.d.ts +2 -2
- package/mobile/lib/components/Tabs/LinkTab.js +2 -2
- package/mobile/lib/components/Tabs/LinkTab.js.map +1 -1
- package/mobile/lib/components/Tabs/ScrollableTabs.js +3 -9
- package/mobile/lib/components/Tabs/ScrollableTabs.js.map +1 -1
- package/mobile/lib/components/Tabs/Tabs.js +14 -7
- package/mobile/lib/components/Tabs/Tabs.js.map +1 -1
- package/mobile/lib/components/Tabs/TabsContent.d.ts +3 -2
- package/mobile/lib/components/Tabs/renderGroupTab.d.ts +2 -2
- package/mobile/lib/components/Tabs/renderGroupTab.js +5 -5
- package/mobile/lib/components/Tabs/renderGroupTab.js.map +1 -1
- package/mobile/lib/components/Tabs/renderTab.d.ts +3 -3
- package/mobile/lib/components/Tabs/renderTab.js +3 -3
- package/mobile/lib/components/Tabs/renderTab.js.map +1 -1
- package/mobile/lib/components/Tabs/tabItemClasses.d.ts +3 -2
- package/mobile/lib/components/Tabs/tabItemClasses.js +26 -10
- package/mobile/lib/components/Tabs/tabItemClasses.js.map +1 -1
- package/mobile/lib/hooks/useLink.js +1 -1
- package/mobile/lib/hooks/useLink.js.map +1 -1
- package/mobile/src/components/Blocks.ts +2 -0
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +14 -20
- package/mobile/src/components/CarouselRecommendationCard/cardStyle.ts +2 -0
- package/mobile/src/components/CarouselTariffsCard/getPaddingStyle.tsx +2 -2
- package/mobile/src/components/Footer/Footer.tsx +1 -1
- package/mobile/src/components/Footer/SocialMedia.tsx +1 -1
- package/mobile/src/components/Tabs/CenteredTabs.tsx +12 -0
- package/mobile/src/components/Tabs/LinkTab.tsx +5 -5
- package/mobile/src/components/Tabs/ScrollableTabs.tsx +5 -13
- package/mobile/src/components/Tabs/Tabs.tsx +21 -19
- package/mobile/src/components/Tabs/TabsContent.ts +3 -2
- package/mobile/src/components/Tabs/renderGroupTab.tsx +11 -10
- package/mobile/src/components/Tabs/renderTab.tsx +5 -13
- package/mobile/src/components/Tabs/tabItemClasses.ts +28 -10
- package/mobile/src/hooks/useLink.ts +1 -1
- package/package.json +1 -1
- package/src/components/Blocks.mobile.ts +2 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.mobile.tsx +148 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.tsx +63 -0
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +1 -3
- package/src/components/CarouselRecommendationCard/cardStyle.ts +2 -0
- package/src/components/CarouselTariffsCard/getPaddingStyle.mobile.tsx +2 -2
- package/src/components/CarouselTariffsCard/getPaddingStyle.tsx +1 -1
- package/src/components/Footer/Footer.mobile.tsx +1 -1
- package/src/components/Footer/SocialMedia.mobile.tsx +1 -1
- package/src/components/Tabs/CenteredTabs.tsx +12 -0
- package/src/components/Tabs/LinkTab.tsx +5 -5
- package/src/components/Tabs/ScrollableTabs.tsx +5 -13
- package/src/components/Tabs/Tabs.fixture.tsx +27 -0
- package/src/components/Tabs/Tabs.tsx +21 -19
- package/src/components/Tabs/TabsContent.ts +3 -2
- package/src/components/Tabs/renderGroupTab.tsx +11 -10
- package/src/components/Tabs/renderTab.tsx +5 -13
- package/src/components/Tabs/tabItemClasses.ts +28 -10
- package/src/hooks/useLink.ts +1 -1
package/bundle/bundle.umd.js
CHANGED
|
@@ -556,7 +556,7 @@
|
|
|
556
556
|
const { close } = useDialog();
|
|
557
557
|
return (props) => ({
|
|
558
558
|
...props,
|
|
559
|
-
href: isRemote ? props.href : adjustHref(router)(props.href, basePath),
|
|
559
|
+
href: isRemote && !basePath ? props.href : adjustHref(router)(props.href, basePath),
|
|
560
560
|
'aria-label': props.text,
|
|
561
561
|
onClick: handlerDecorator(handleHref(props), props),
|
|
562
562
|
});
|
|
@@ -1814,7 +1814,7 @@
|
|
|
1814
1814
|
visibleItemCount: COLUMNS_FOR_SCROLL,
|
|
1815
1815
|
});
|
|
1816
1816
|
return (jsxs(BlockWrapper, { className: style('box-border overflow-hidden relative w-100', className), ...rest, children: [jsxs("div", { className: "bg-white", children: [tabsNav.length > 1
|
|
1817
|
-
? renderTabs({ activeIndex, tabsNav, slideIndexShift, onClick: handleSlideIndexShift })
|
|
1817
|
+
? renderTabs$1({ activeIndex, tabsNav, slideIndexShift, onClick: handleSlideIndexShift })
|
|
1818
1818
|
: null, renderArrows({
|
|
1819
1819
|
...controls,
|
|
1820
1820
|
btnClass: ['left-3', 'right-3'],
|
|
@@ -1837,7 +1837,7 @@
|
|
|
1837
1837
|
iconVersion: iconVersion ?? activeIconStyle,
|
|
1838
1838
|
}, width: "24", height: "24" }), jsxs("div", { className: "border-0", children: [jsx("div", { className: btnTitleClassName, children: tab?.title }), jsx("div", { className: btnDescClassName, children: tab.description })] })] }, String(i)));
|
|
1839
1839
|
}
|
|
1840
|
-
function renderTabs({ activeIndex, tabsNav, slideIndexShift, onClick }) {
|
|
1840
|
+
function renderTabs$1({ activeIndex, tabsNav, slideIndexShift, onClick }) {
|
|
1841
1841
|
const CARD_SHIFT = 388;
|
|
1842
1842
|
return (jsxs("div", { children: [jsx("div", { style: { transform: `translateX(-${activeIndex * CARD_SHIFT}px)` }, className: "flex flex-col justify-end items-center h-[126px] pt-9 box-border duration-1000", children: jsx("div", { className: "w-full flex flex-nowrap items-end gap-2", children: tabsNav.map((tab, i) => renderNavButton$3({
|
|
1843
1843
|
tab,
|
|
@@ -2351,6 +2351,7 @@
|
|
|
2351
2351
|
const SocialMedia = JSX(({ className = '', media, children, buttonSize }) => (jsxs("div", { className: "font-sans", children: [jsx("div", { className: `flex gap-1 ${className}`, children: media?.map((_, index) => (jsx(MediaButton, { buttonSize: buttonSize, ..._ }, String(index)))) }), jsx(Text, { size: "text-s-light", color: "text-secondary-text", children: children })] })));
|
|
2352
2352
|
|
|
2353
2353
|
const BORDER_STYLE = 'border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider';
|
|
2354
|
+
|
|
2354
2355
|
const CarouselRecommendationCard = JSX(({ className = '', description, href, icon, items = [], socialMedia = [], target, title, align = 'text-left', version = 'primary', ...rest }) => {
|
|
2355
2356
|
return (jsx(BlockWrapper, { className: style('relative p-7 min-w-[524px] min-h-[218px] h-full box-border group-data-gray:bg-main-divider/50', BORDER_STYLE, className), version: version, ...rest, children: jsxs(LinkWrapper, { href: href, target: target, children: [jsx(Headline, { className: "mb-4", title: title, description: description, headlineVersion: "S", isPadding: false, align: align }), jsxs("div", { className: "w-1/2 h-full flex flex-col flex-1 justify-end", children: [items.length ? (jsx(List, { className: "flex flex-col gap-2", itemClassName: "text-l-light", items: items })) : null, socialMedia.length ? jsx(SocialMedia, { className: "pt-10", media: socialMedia }) : null] }), renderIconBlock$2(icon)] }) }));
|
|
2356
2357
|
});
|
|
@@ -2385,7 +2386,7 @@
|
|
|
2385
2386
|
return (jsx("div", { ref: containerRef, className: `transition-max-h duration-300 overflow-hidden ${containerRef.current || !isUnfolded ? 'max-h-0' : ''} ${className}`, children: children }));
|
|
2386
2387
|
});
|
|
2387
2388
|
|
|
2388
|
-
const getPaddingStyle = (isHighlighting) => isHighlighting ? 'p-8 mt-8 pt-20' : 'p-8 mt-20';
|
|
2389
|
+
const getPaddingStyle = (isHighlighting = false) => isHighlighting ? 'p-8 mt-8 pt-20' : 'p-8 mt-20';
|
|
2389
2390
|
|
|
2390
2391
|
const descriptionSize = 'text-h6';
|
|
2391
2392
|
|
|
@@ -4424,7 +4425,11 @@
|
|
|
4424
4425
|
active: `inline-flex px-4 grow whitespace-nowrap ${LINK_CLASSES} ${SCROLLABLE_ACTIVE_LINK_CLASSES}`,
|
|
4425
4426
|
default: `inline-flex px-4 grow whitespace-nowrap ${LINK_CLASSES} ${INACTIVE_LINK_CLASSES}`,
|
|
4426
4427
|
},
|
|
4427
|
-
|
|
4428
|
+
centered: {
|
|
4429
|
+
active: `px-4 rounded-md ${LINK_CLASSES} ${WIDESCREEN_ACTIVE_LINK_CLASSES} whitespace-nowrap`,
|
|
4430
|
+
default: `px-4 rounded-md ${LINK_CLASSES} group/btn bg-transparent whitespace-nowrap`,
|
|
4431
|
+
},
|
|
4432
|
+
wideScreen: {
|
|
4428
4433
|
active: `${LINK_CLASSES} ${WIDESCREEN_ACTIVE_LINK_CLASSES} whitespace-nowrap`,
|
|
4429
4434
|
default: `${LINK_CLASSES} ${INACTIVE_LINK_CLASSES} whitespace-nowrap`,
|
|
4430
4435
|
},
|
|
@@ -4434,7 +4439,11 @@
|
|
|
4434
4439
|
active: `h-full border-0 border-b-2`,
|
|
4435
4440
|
default: ``,
|
|
4436
4441
|
},
|
|
4437
|
-
|
|
4442
|
+
centered: {
|
|
4443
|
+
active: '',
|
|
4444
|
+
default: '',
|
|
4445
|
+
},
|
|
4446
|
+
wideScreen: {
|
|
4438
4447
|
active: '',
|
|
4439
4448
|
default: '',
|
|
4440
4449
|
},
|
|
@@ -4446,7 +4455,11 @@
|
|
|
4446
4455
|
active: `inline-flex px-4 grow whitespace-nowrap ${LINK_CLASSES} ${SCROLLABLE_ACTIVE_LINK_CLASSES}`,
|
|
4447
4456
|
default: `inline-flex px-4 grow whitespace-nowrap ${LINK_CLASSES} ${INACTIVE_LINK_CLASSES}`,
|
|
4448
4457
|
},
|
|
4449
|
-
|
|
4458
|
+
centered: {
|
|
4459
|
+
active: `px-4 rounded-md ${LINK_CLASSES} ${WIDESCREEN_ACTIVE_LINK_CLASSES} whitespace-nowrap`,
|
|
4460
|
+
default: `px-4 rounded-md ${LINK_CLASSES} group/btn bg-transparent whitespace-nowrap`,
|
|
4461
|
+
},
|
|
4462
|
+
wideScreen: {
|
|
4450
4463
|
active: `${LINK_CLASSES} ${WIDESCREEN_ACTIVE_LINK_CLASSES}`,
|
|
4451
4464
|
default: `${LINK_CLASSES} ${INACTIVE_LINK_CLASSES}`,
|
|
4452
4465
|
},
|
|
@@ -4456,25 +4469,29 @@
|
|
|
4456
4469
|
active: `${TEXT_CLASSES} flex items-center h-full border-0 border-b-2 ${WHITE_ACTIVE_TEXT_CLASSES}`,
|
|
4457
4470
|
default: `${TEXT_CLASSES} ${INACTIVE_TEXT_CLASSES}`,
|
|
4458
4471
|
},
|
|
4459
|
-
|
|
4472
|
+
centered: {
|
|
4473
|
+
active: `${TEXT_CLASSES} ${ACTIVE_TEXT_CLASSES}`,
|
|
4474
|
+
default: `${TEXT_CLASSES} ${INACTIVE_TEXT_CLASSES}`,
|
|
4475
|
+
},
|
|
4476
|
+
wideScreen: {
|
|
4460
4477
|
active: `${TEXT_CLASSES} ${ACTIVE_TEXT_CLASSES}`,
|
|
4461
4478
|
default: `${TEXT_CLASSES} ${INACTIVE_TEXT_CLASSES}`,
|
|
4462
4479
|
},
|
|
4463
4480
|
},
|
|
4464
4481
|
};
|
|
4465
|
-
const getGroupTabClassName = (type, active,
|
|
4466
|
-
const styleType = isScrollable ? 'scrollable' : 'default';
|
|
4482
|
+
const getGroupTabClassName = (type, active, tabsMode) => {
|
|
4467
4483
|
const styleActive = active ? 'active' : 'default';
|
|
4468
|
-
|
|
4484
|
+
const mode = tabsMode || 'wideScreen';
|
|
4485
|
+
return GROUP_TAB_CLASSES[type][mode][styleActive];
|
|
4469
4486
|
};
|
|
4470
|
-
const getLinkTabClassName = (type, active,
|
|
4471
|
-
const styleType = isScrollable ? 'scrollable' : 'default';
|
|
4487
|
+
const getLinkTabClassName = (type, active, tabsMode) => {
|
|
4472
4488
|
const styleActive = active ? 'active' : 'default';
|
|
4473
|
-
|
|
4489
|
+
const mode = tabsMode || 'wideScreen';
|
|
4490
|
+
return LINK_TAB_CLASSES[type][mode][styleActive];
|
|
4474
4491
|
};
|
|
4475
4492
|
|
|
4476
4493
|
const LinkTab = JSX((props) => {
|
|
4477
|
-
const { tab, currentTab, onClick,
|
|
4494
|
+
const { tab, currentTab, onClick, tabsMode } = props;
|
|
4478
4495
|
const active = currentTab?.type === 'link' && currentTab.href === tab.href;
|
|
4479
4496
|
const link = useLink();
|
|
4480
4497
|
const adjustedProps = link(tab);
|
|
@@ -4482,22 +4499,22 @@
|
|
|
4482
4499
|
adjustedProps.onClick(ev);
|
|
4483
4500
|
onClick(tab);
|
|
4484
4501
|
};
|
|
4485
|
-
return (jsx("a", { role: "tab", className: getLinkTabClassName('link', active,
|
|
4502
|
+
return (jsx("a", { role: "tab", className: getLinkTabClassName('link', active, tabsMode), target: tab.target, href: adjustedProps.href, onClick: handleClick, children: jsx("span", { className: getLinkTabClassName('text', active, tabsMode), children: tab.text }) }));
|
|
4486
4503
|
});
|
|
4487
4504
|
|
|
4488
4505
|
const BADGE_CLASSES = 'min-w-[22px] h-[22px] rounded-full text-xs ml-2 flex justify-center items-center';
|
|
4489
4506
|
const ACTIVE_BADGE_CLASSES = 'bg-white/30 text-white';
|
|
4490
4507
|
const INACTIVE_BADGE_CLASSES = 'bg-main-divider text-secondary-text group-hover/btn:text-primary-main';
|
|
4491
|
-
const renderGroupTab = ({ page, currentTab, showCounter, onClick,
|
|
4508
|
+
const renderGroupTab = ({ page, currentTab, showCounter, onClick, tabsMode }) => (tab, i) => {
|
|
4492
4509
|
const active = currentTab === tab;
|
|
4493
4510
|
const count = tab.ref && page?.blocks
|
|
4494
4511
|
? page.blocks.filter((block) => block?.labels?.includes(tab.ref)).length
|
|
4495
4512
|
: 0;
|
|
4496
|
-
return (jsx("div", { className: getGroupTabClassName('div', active,
|
|
4513
|
+
return (jsx("div", { className: getGroupTabClassName('div', active, tabsMode), role: "tab", "aria-selected": active, onClick: () => onClick(tab), children: jsxs("div", { className: `flex flex-1 items-center justify-center ${getGroupTabClassName('text', active, tabsMode)}`, children: [renderTitle$1(tab.title, active, tabsMode), renderCount(showCounter, count, active)] }) }, `group-${String(i)}`));
|
|
4497
4514
|
};
|
|
4498
|
-
const renderTitle$1 = (title, active,
|
|
4515
|
+
const renderTitle$1 = (title, active, tabsMode) => {
|
|
4499
4516
|
const activeClassName = active ? WHITE_ACTIVE_TEXT_CLASSES : INACTIVE_TEXT_CLASSES;
|
|
4500
|
-
const titleClassName =
|
|
4517
|
+
const titleClassName = tabsMode === 'scrollable'
|
|
4501
4518
|
? `${TEXT_CLASSES} ${activeClassName}`
|
|
4502
4519
|
: `${TEXT_CLASSES} ${active ? ACTIVE_TEXT_CLASSES : INACTIVE_TEXT_CLASSES}`;
|
|
4503
4520
|
return title ? jsx("h3", { className: titleClassName, children: title }) : null;
|
|
@@ -4506,16 +4523,16 @@
|
|
|
4506
4523
|
return showCounter && count ? (jsx("div", { className: `${BADGE_CLASSES} ${active ? ACTIVE_BADGE_CLASSES : INACTIVE_BADGE_CLASSES}`, children: count })) : null;
|
|
4507
4524
|
};
|
|
4508
4525
|
|
|
4509
|
-
const renderTab = ({ page,
|
|
4526
|
+
const renderTab = ({ page, showCounter, ...rest }) => (tab, i) => {
|
|
4510
4527
|
const type = tab.type;
|
|
4511
4528
|
if (!(type === 'group' || type === 'link')) {
|
|
4512
4529
|
return null;
|
|
4513
4530
|
}
|
|
4514
4531
|
switch (type) {
|
|
4515
4532
|
case 'group':
|
|
4516
|
-
return renderGroupTab({ page,
|
|
4533
|
+
return renderGroupTab({ page, showCounter, ...rest })(tab, i);
|
|
4517
4534
|
case 'link': {
|
|
4518
|
-
return
|
|
4535
|
+
return jsx(LinkTab, { tab: tab, ...rest }, String(i));
|
|
4519
4536
|
}
|
|
4520
4537
|
default:
|
|
4521
4538
|
assertUnreachable(type);
|
|
@@ -4523,24 +4540,20 @@
|
|
|
4523
4540
|
return null;
|
|
4524
4541
|
};
|
|
4525
4542
|
|
|
4543
|
+
const CenteredTabs = JSX(({ tabs, ...rest }) => (jsx("div", { className: "flex p-1 m-auto bg-main-gray rounded-md", children: tabs?.map(renderTab({ ...rest })) })));
|
|
4544
|
+
|
|
4526
4545
|
const scrollButtonStyle = 'absolute z-40 top-0';
|
|
4527
4546
|
const ScrollableTabs = JSX((props) => {
|
|
4528
|
-
const { tabs,
|
|
4547
|
+
const { tabs, ...rest } = props;
|
|
4529
4548
|
const [containerRef, scroll] = useSwipeListScroll({
|
|
4530
4549
|
itemCount: tabs?.length || 0,
|
|
4531
4550
|
isCyclic: false,
|
|
4532
4551
|
});
|
|
4533
|
-
return (jsxs("div", { className: "relative max-w-full m-auto", children: [jsx("div", { className: `font-sans max-w-full w-full overflow-hidden relative bg-white`, children: jsx(SwipeListContainer, { containerRef: containerRef, snapAlign: "snap-start", onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: tabs?.map(renderTab({
|
|
4534
|
-
onClick,
|
|
4535
|
-
currentTab,
|
|
4536
|
-
showCounter,
|
|
4537
|
-
page,
|
|
4538
|
-
isScrollable: true,
|
|
4539
|
-
})) }) }), scroll.canScrollLeft ? (jsx(ScrollLeftButton, { className: `${scrollButtonStyle} left-6`, onClick: scroll.scrollLeft })) : null, scroll.canScrollRight ? (jsx(ScrollRightButton, { className: `${scrollButtonStyle} rotate-180 right-6`, onClick: scroll.scrollRight })) : null] }));
|
|
4552
|
+
return (jsxs("div", { className: "relative max-w-full m-auto", children: [jsx("div", { className: `font-sans max-w-full w-full overflow-hidden relative bg-white`, children: jsx(SwipeListContainer, { containerRef: containerRef, snapAlign: "snap-start", onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: tabs?.map(renderTab({ ...rest })) }) }), scroll.canScrollLeft ? (jsx(ScrollLeftButton, { className: `${scrollButtonStyle} left-6`, onClick: scroll.scrollLeft })) : null, scroll.canScrollRight ? (jsx(ScrollRightButton, { className: `${scrollButtonStyle} rotate-180 right-6`, onClick: scroll.scrollRight })) : null] }));
|
|
4540
4553
|
});
|
|
4541
4554
|
|
|
4542
4555
|
const Tabs = JSX((props) => {
|
|
4543
|
-
const { className = '', tabs,
|
|
4556
|
+
const { className = '', tabs, isSticky, ...rest } = props;
|
|
4544
4557
|
const [currentTab, setCurrentTab] = useState(tabs ? tabs[0] : undefined);
|
|
4545
4558
|
useEffect(() => {
|
|
4546
4559
|
if (!tabs || !tabs[0]) {
|
|
@@ -4557,13 +4570,19 @@
|
|
|
4557
4570
|
fireTabEvent(selectedTab);
|
|
4558
4571
|
setCurrentTab(selectedTab);
|
|
4559
4572
|
}, []);
|
|
4560
|
-
return (jsx(BlockWrapper, { className: `relative box-border flex gap-x-1 w-full ${isSticky ? 'sticky top-1 z-20' : ''} ${className}`, role: "tablist", ...rest, children:
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4573
|
+
return (jsx(BlockWrapper, { className: `relative box-border flex gap-x-1 w-full ${isSticky ? 'sticky top-1 z-20' : ''} ${className}`, role: "tablist", ...rest, children: renderTabs({ tabs, onClick: handleClick, currentTab, ...rest }) }));
|
|
4574
|
+
});
|
|
4575
|
+
const renderTabs = ({ tabsMode, tabs, ...rest }) => {
|
|
4576
|
+
switch (tabsMode) {
|
|
4577
|
+
case 'wideScreen':
|
|
4578
|
+
return tabs?.map(renderTab({ tabsMode, ...rest }));
|
|
4579
|
+
case 'centered':
|
|
4580
|
+
return jsx(CenteredTabs, { tabs: tabs, tabsMode: tabsMode, ...rest });
|
|
4581
|
+
case 'scrollable':
|
|
4582
|
+
return jsx(ScrollableTabs, { tabs: tabs, tabsMode: tabsMode, ...rest });
|
|
4583
|
+
}
|
|
4584
|
+
return null;
|
|
4585
|
+
};
|
|
4567
4586
|
const fireTabEvent = (tab) => {
|
|
4568
4587
|
if (tab.type === 'group') {
|
|
4569
4588
|
defaultEventBus.fire('tab', { type: tab.type, label: tab.ref });
|
|
@@ -5006,7 +5025,7 @@
|
|
|
5006
5025
|
return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto" }) }));
|
|
5007
5026
|
}
|
|
5008
5027
|
|
|
5009
|
-
const packageVersion = "0.10.
|
|
5028
|
+
const packageVersion = "0.10.8";
|
|
5010
5029
|
|
|
5011
5030
|
exports.Blocks = Blocks;
|
|
5012
5031
|
exports.ContentPage = ContentPage;
|