@uniformdev/csk-components 6.0.123-alpha.1 → 6.1.63-alpha.1
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/README.md +74 -81
- package/dist/ThemeSwitcher-EUDUX3QI.mjs +1 -0
- package/dist/accordion-item-7IKL6Z6Q.mjs +1 -0
- package/dist/accordion-item-MORC2F2Q.mjs +1 -0
- package/dist/banner-WOYK426U.mjs +1 -0
- package/dist/carousel-ALNEGOPM.mjs +1 -0
- package/dist/carousel-HKYR3ZBB.mjs +1 -0
- package/dist/chunk-27WJUZYR.mjs +1 -0
- package/dist/chunk-3JU2XCD2.mjs +1 -0
- package/dist/chunk-47YB4P2Q.mjs +1 -0
- package/dist/chunk-6CKVLOIH.mjs +1 -0
- package/dist/{chunk-PMMAALCQ.mjs → chunk-AOFJCDRO.mjs} +1 -1
- package/dist/{chunk-2BMAPB63.mjs → chunk-AWTML4I7.mjs} +1 -1
- package/dist/chunk-CZ4X5ZBK.mjs +1 -0
- package/dist/chunk-D673IM2U.mjs +1 -0
- package/dist/chunk-I6SUO5WR.mjs +1 -0
- package/dist/chunk-JT77BVIX.mjs +1 -0
- package/dist/chunk-LPAOEOU4.mjs +1 -0
- package/dist/chunk-MKOFM4XK.mjs +1 -0
- package/dist/chunk-NKINOJY6.mjs +1 -0
- package/dist/chunk-OKUDTS22.mjs +1 -0
- package/dist/chunk-OL6JBPZ4.mjs +1 -0
- package/dist/chunk-OY6ZJNCE.mjs +1 -0
- package/dist/chunk-PLKWUEFW.mjs +1 -0
- package/dist/chunk-QPQGRQKI.mjs +1 -0
- package/dist/chunk-VWWXSA5H.mjs +1 -0
- package/dist/chunk-XKCRANRQ.mjs +1 -0
- package/dist/chunk-XYU3TGOU.mjs +1 -0
- package/dist/chunk-Y337A266.mjs +7 -0
- package/dist/chunk-YQYDZJ65.mjs +1 -0
- package/dist/chunk-ZAHWFLY4.mjs +1 -0
- package/dist/{chunk-V4EBWEG4.mjs → chunk-ZWDCDE5W.mjs} +1 -1
- package/dist/components/canvas/emptyPlaceholders.d.mts +5 -4
- package/dist/components/canvas/emptyPlaceholders.mjs +1 -1
- package/dist/components/canvas/index.d.mts +4 -648
- package/dist/components/canvas/index.mjs +1 -1
- package/dist/components/canvas/serverClient.d.mts +694 -0
- package/dist/components/canvas/serverClient.mjs +1 -0
- package/dist/components/canvas/serverOnly.d.mts +41 -0
- package/dist/components/canvas/serverOnly.mjs +1 -0
- package/dist/components/ui/index.d.mts +24 -33
- package/dist/components/ui/index.mjs +1 -1
- package/dist/content/components/canvas/Accordion/accordion.tsx +8 -7
- package/dist/content/components/canvas/Accordion/index.tsx +2 -2
- package/dist/content/components/canvas/AccordionItem/accordion-item.tsx +9 -7
- package/dist/content/components/canvas/AccordionItem/index.tsx +4 -6
- package/dist/content/components/canvas/Badge/badge.tsx +12 -5
- package/dist/content/components/canvas/Badge/index.tsx +2 -3
- package/dist/content/components/canvas/Badge/style-utils.ts +6 -6
- package/dist/content/components/canvas/Banner/banner.tsx +24 -36
- package/dist/content/components/canvas/Banner/index.tsx +7 -11
- package/dist/content/components/canvas/Breadcrumbs/breadcrumbs.tsx +21 -22
- package/dist/content/components/canvas/Breadcrumbs/index.tsx +4 -7
- package/dist/content/components/canvas/Button/button.tsx +19 -11
- package/dist/content/components/canvas/Button/index.tsx +3 -5
- package/dist/content/components/canvas/Card/card.tsx +9 -9
- package/dist/content/components/canvas/Card/index.tsx +3 -3
- package/dist/content/components/canvas/Carousel/carousel.tsx +9 -7
- package/dist/content/components/canvas/Carousel/index.tsx +4 -4
- package/dist/content/components/canvas/Container/container.tsx +7 -6
- package/dist/content/components/canvas/Container/index.tsx +3 -3
- package/dist/content/components/canvas/CookieConsent/cookie-consent.tsx +126 -0
- package/dist/content/components/canvas/CookieConsent/empty-placeholder.tsx +12 -0
- package/dist/content/components/canvas/CookieConsent/index.tsx +26 -0
- package/dist/content/components/canvas/Countdown/countdown.tsx +9 -7
- package/dist/content/components/canvas/Countdown/index.tsx +2 -3
- package/dist/content/components/canvas/DemoHero/atoms.tsx +29 -32
- package/dist/content/components/canvas/DemoHero/columns-variant.tsx +4 -4
- package/dist/content/components/canvas/DemoHero/default-variant.tsx +4 -4
- package/dist/content/components/canvas/DemoHero/demo-hero.tsx +41 -18
- package/dist/content/components/canvas/DemoHero/fixed-hero.tsx +13 -6
- package/dist/content/components/canvas/DemoHero/flexible-hero.tsx +8 -2
- package/dist/content/components/canvas/DemoHero/index.tsx +3 -4
- package/dist/content/components/canvas/Divider/divider.tsx +5 -2
- package/dist/content/components/canvas/Divider/index.tsx +2 -2
- package/dist/content/components/canvas/Flex/flex.tsx +9 -6
- package/dist/content/components/canvas/Flex/index.tsx +6 -6
- package/dist/content/components/canvas/FlexItem/flex-item.tsx +7 -4
- package/dist/content/components/canvas/FlexItem/index.tsx +4 -5
- package/dist/content/components/canvas/Footer/footer.tsx +9 -8
- package/dist/content/components/canvas/Footer/index.tsx +2 -3
- package/dist/content/components/canvas/Grid/grid.tsx +9 -7
- package/dist/content/components/canvas/Grid/index.tsx +5 -5
- package/dist/content/components/canvas/GridItem/grid-item.tsx +10 -8
- package/dist/content/components/canvas/GridItem/index.tsx +5 -5
- package/dist/content/components/canvas/Header/header.tsx +10 -7
- package/dist/content/components/canvas/Header/index.tsx +2 -3
- package/dist/content/components/canvas/IconLabel/icon-label.tsx +16 -8
- package/dist/content/components/canvas/IconLabel/index.tsx +4 -5
- package/dist/content/components/canvas/Image/image.tsx +13 -7
- package/dist/content/components/canvas/Image/index.tsx +2 -3
- package/dist/content/components/canvas/ImageGallery/empty-placeholder.tsx +1 -1
- package/dist/content/components/canvas/ImageGallery/gallery-inner.tsx +6 -6
- package/dist/content/components/canvas/ImageGallery/image-gallery.tsx +20 -33
- package/dist/content/components/canvas/ImageGallery/index.tsx +11 -12
- package/dist/content/components/canvas/Link/index.tsx +2 -3
- package/dist/content/components/canvas/Link/link.tsx +7 -4
- package/dist/content/components/canvas/Modal/index.tsx +2 -2
- package/dist/content/components/canvas/Modal/modal.tsx +9 -10
- package/dist/content/components/canvas/NavigationFlyout/desktop.tsx +9 -13
- package/dist/content/components/canvas/NavigationFlyout/index.tsx +21 -3
- package/dist/content/components/canvas/NavigationFlyout/mobile.tsx +10 -13
- package/dist/content/components/canvas/NavigationFlyout/{navigation-flyout.tsx → navigation-flyout-client.tsx} +26 -20
- package/dist/content/components/canvas/NavigationGroup/desktop.tsx +7 -10
- package/dist/content/components/canvas/NavigationGroup/index.tsx +20 -3
- package/dist/content/components/canvas/NavigationGroup/mobile.tsx +9 -8
- package/dist/content/components/canvas/NavigationGroup/{navigation-group.tsx → navigation-group-client.tsx} +21 -18
- package/dist/content/components/canvas/NavigationLink/index.tsx +2 -4
- package/dist/content/components/canvas/NavigationLink/navigation-link.tsx +12 -9
- package/dist/content/components/canvas/Page/index.tsx +7 -7
- package/dist/content/components/canvas/Page/page.tsx +9 -18
- package/dist/content/components/canvas/Review/default-variant.tsx +2 -2
- package/dist/content/components/canvas/Review/empty-placeholder.tsx +6 -3
- package/dist/content/components/canvas/Review/index.tsx +6 -6
- package/dist/content/components/canvas/Review/multi-column-variant.tsx +2 -2
- package/dist/content/components/canvas/Review/review.tsx +11 -11
- package/dist/content/components/canvas/RichText/index.tsx +7 -6
- package/dist/content/components/canvas/RichText/rich-text.tsx +23 -6
- package/dist/content/components/canvas/Section/columns-variant.tsx +4 -4
- package/dist/content/components/canvas/Section/default-variant.tsx +6 -6
- package/dist/content/components/canvas/Section/empty-placeholder.tsx +5 -2
- package/dist/content/components/canvas/Section/index.tsx +2 -2
- package/dist/content/components/canvas/Section/section.tsx +11 -12
- package/dist/content/components/canvas/SimpleFooter/index.tsx +16 -0
- package/dist/content/components/canvas/SimpleFooter/simple-footer.tsx +85 -0
- package/dist/content/components/canvas/SimpleHeader/index.tsx +22 -0
- package/dist/content/components/canvas/SimpleHeader/simple-header.tsx +63 -0
- package/dist/content/components/canvas/Spacer/index.tsx +2 -2
- package/dist/content/components/canvas/Spacer/spacer.tsx +5 -2
- package/dist/content/components/canvas/Tab/index.tsx +2 -3
- package/dist/content/components/canvas/Tab/tab.tsx +6 -5
- package/dist/content/components/canvas/Table/index.tsx +2 -2
- package/dist/content/components/canvas/Table/table.tsx +8 -7
- package/dist/content/components/canvas/TableCustomCell/index.tsx +2 -2
- package/dist/content/components/canvas/TableCustomCell/table-custom-cell.tsx +7 -4
- package/dist/content/components/canvas/TableDataCell/index.tsx +2 -2
- package/dist/content/components/canvas/TableDataCell/table-data-cell.tsx +7 -4
- package/dist/content/components/canvas/TableHeaderCell/index.tsx +2 -2
- package/dist/content/components/canvas/TableHeaderCell/table-header-cell.tsx +7 -4
- package/dist/content/components/canvas/TableRow/index.tsx +5 -3
- package/dist/content/components/canvas/TableRow/table-row.tsx +6 -3
- package/dist/content/components/canvas/Tabs/index.tsx +7 -7
- package/dist/content/components/canvas/Tabs/style-utils.ts +12 -11
- package/dist/content/components/canvas/Tabs/tabs.tsx +44 -42
- package/dist/content/components/canvas/Testimonial/default-variant.tsx +7 -7
- package/dist/content/components/canvas/Testimonial/index.tsx +2 -2
- package/dist/content/components/canvas/Testimonial/testimonial.tsx +11 -13
- package/dist/content/components/canvas/Testimonial/with-large-avatar-variant.tsx +7 -7
- package/dist/content/components/canvas/Testimonial/with-overlapping-image-variant.tsx +7 -7
- package/dist/content/components/canvas/Text/index.tsx +2 -3
- package/dist/content/components/canvas/Text/text.tsx +21 -15
- package/dist/content/components/canvas/ThemeSwitcher/index.tsx +2 -2
- package/dist/content/components/canvas/ThemeSwitcher/theme-switcher.tsx +6 -3
- package/dist/content/components/canvas/Video/index.tsx +2 -3
- package/dist/content/components/canvas/Video/placeholder.tsx +1 -1
- package/dist/content/components/canvas/Video/video.tsx +8 -5
- package/dist/content/components/ui/Banner/banner.tsx +47 -0
- package/dist/content/components/ui/Banner/index.tsx +29 -0
- package/dist/content/components/{canvas → ui}/Banner/style-utils.ts +1 -2
- package/dist/content/components/ui/Carousel/index.ts +2 -2
- package/dist/content/components/ui/ComponentEmptyPlaceholder/component-empty-placeholder.tsx +13 -0
- package/dist/content/components/ui/ComponentEmptyPlaceholder/index.ts +6 -0
- package/dist/content/components/ui/Flex/flex.tsx +2 -0
- package/dist/content/components/ui/Flex/index.ts +2 -0
- package/dist/content/components/ui/FlexItem/index.ts +1 -1
- package/dist/content/components/ui/Footer/index.ts +4 -3
- package/dist/content/components/ui/Grid/grid.tsx +2 -0
- package/dist/content/components/ui/Grid/index.ts +3 -0
- package/dist/content/components/ui/GridItem/grid-item.tsx +10 -1
- package/dist/content/components/ui/GridItem/index.ts +3 -0
- package/dist/content/components/ui/IconLabel/icon-label.tsx +2 -0
- package/dist/content/components/ui/IconLabel/index.ts +1 -0
- package/dist/content/components/ui/InlineSVG/index.ts +3 -1
- package/dist/content/components/ui/InlineSVG/inline-svg.tsx +14 -3
- package/dist/content/components/ui/InlineSVG/utils.ts +66 -11
- package/dist/content/components/ui/Rating/index.tsx +1 -1
- package/dist/content/components/ui/Rating/rating.tsx +1 -1
- package/dist/content/types/cskTypes.ts +32 -9
- package/dist/content/utils/assets.ts +3 -18
- package/dist/content/utils/createComponentResolver.ts +7 -6
- package/dist/content/utils/createEmptyPlaceholderResolver.tsx +4 -8
- package/dist/content/utils/getSlotComponents.ts +15 -0
- package/dist/content/utils/routing.ts +60 -15
- package/dist/content/utils/useCookiesConsent.ts +17 -0
- package/dist/content/utils/withFlattenParameters.tsx +17 -0
- package/dist/content/utils/withSlotsDataValue.tsx +34 -0
- package/dist/cookie-consent-5QJUCW2K.mjs +1 -0
- package/dist/countdown-FRQZMVKW.mjs +1 -0
- package/dist/image-gallery-HWCMTJL3.mjs +1 -0
- package/dist/{index-D5cLtaIv.d.mts → index-CSSWgmI5.d.mts} +54 -28
- package/dist/index-CrBZatTs.d.mts +18 -0
- package/dist/index.mjs +3 -3
- package/dist/mobile-KBYNJEBM.mjs +1 -0
- package/dist/modal-4TVVGHWS.mjs +1 -0
- package/dist/modal-E5RMA4EO.mjs +1 -0
- package/dist/navigation-flyout-client-WUN4A34X.mjs +1 -0
- package/dist/navigation-group-client-Y72BOPIH.mjs +1 -0
- package/dist/parameters-B8w5Q6Pp.d.mts +29 -0
- package/dist/tabs-VMFTATOP.mjs +1 -0
- package/dist/theme-switcher-QTX46Z7E.mjs +1 -0
- package/dist/theme-switcher-RGY4D3KL.mjs +1 -0
- package/dist/types/cskTypes.d.mts +27 -9
- package/dist/utils/assets.d.mts +8 -17
- package/dist/utils/assets.mjs +1 -1
- package/dist/utils/createComponentResolver.d.mts +3 -9
- package/dist/utils/createComponentResolver.mjs +1 -1
- package/dist/utils/createEmptyPlaceholderResolver.d.mts +4 -2
- package/dist/utils/createEmptyPlaceholderResolver.mjs +1 -1
- package/dist/utils/getSlotComponents.d.mts +11 -0
- package/dist/utils/getSlotComponents.mjs +1 -0
- package/dist/utils/routing.d.mts +20 -7
- package/dist/utils/routing.mjs +1 -1
- package/dist/utils/sitemap.mjs +1 -1
- package/dist/utils/styling.d.mts +3 -0
- package/dist/utils/styling.mjs +1 -1
- package/dist/utils/withFlattenParameters.d.mts +10 -0
- package/dist/utils/withFlattenParameters.mjs +1 -0
- package/dist/utils/withSlotsDataValue.d.mts +12 -0
- package/dist/utils/withSlotsDataValue.mjs +1 -0
- package/dist/video-VG6ZQCKN.mjs +1 -0
- package/package.json +43 -14
- package/dist/ThemeSwitcher-6Q7LCO4Q.mjs +0 -1
- package/dist/accordion-item-QAVKQEB2.mjs +0 -1
- package/dist/accordion-item-Y4PSNOH4.mjs +0 -1
- package/dist/banner-EYII7V7X.mjs +0 -1
- package/dist/carousel-RZ2DV6QX.mjs +0 -1
- package/dist/carousel-YELQRJVB.mjs +0 -1
- package/dist/chunk-2UV7TQNF.mjs +0 -1
- package/dist/chunk-2YTACEBA.mjs +0 -1
- package/dist/chunk-56OQGKRM.mjs +0 -1
- package/dist/chunk-ABORGLS6.mjs +0 -2
- package/dist/chunk-B2O55EVA.mjs +0 -1
- package/dist/chunk-EOV2LPGC.mjs +0 -1
- package/dist/chunk-EUVKAE6M.mjs +0 -1
- package/dist/chunk-FIN5US3Q.mjs +0 -1
- package/dist/chunk-LZOK42EM.mjs +0 -1
- package/dist/chunk-MSXDLSXH.mjs +0 -1
- package/dist/chunk-RX4IAAQQ.mjs +0 -1
- package/dist/chunk-RYEXR67P.mjs +0 -1
- package/dist/chunk-TCQTXNKT.mjs +0 -1
- package/dist/chunk-TFA6HYP4.mjs +0 -7
- package/dist/chunk-VW2XC3SE.mjs +0 -1
- package/dist/chunk-YEKQJ4YC.mjs +0 -1
- package/dist/content/components/canvas/Banner/types.ts +0 -21
- package/dist/countdown-LYDXJLEE.mjs +0 -1
- package/dist/image-gallery-AMU6FS7N.mjs +0 -1
- package/dist/mobile-JGZBHQC2.mjs +0 -1
- package/dist/modal-43IHAVWB.mjs +0 -1
- package/dist/modal-5FNTFSTN.mjs +0 -1
- package/dist/navigation-flyout-EPIOXRWJ.mjs +0 -1
- package/dist/navigation-group-OCZ35QI2.mjs +0 -1
- package/dist/tabs-J23TEEQ7.mjs +0 -1
- package/dist/theme-switcher-76F2V343.mjs +0 -1
- package/dist/theme-switcher-WO5JIV2W.mjs +0 -1
- package/dist/video-RC2QHJS2.mjs +0 -1
- /package/dist/content/components/{canvas → ui}/Banner/close-button.tsx +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { FC, useEffect, useState } from 'react';
|
|
2
|
-
import { UniformSlot } from '@uniformdev/
|
|
2
|
+
import { UniformSlot } from '@uniformdev/next-app-router/component';
|
|
3
3
|
import { ArrowIcon } from '@/components/ui/_icons';
|
|
4
4
|
import { cn } from '@/utils/styling';
|
|
5
|
-
import { NavigationGroupProps } from '.';
|
|
5
|
+
import { NavigationGroupParameters, NavigationGroupProps } from '.';
|
|
6
6
|
|
|
7
|
-
type NavigationGroupMobileContentProps = Pick<NavigationGroupProps, '
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
type NavigationGroupMobileContentProps = Pick<NavigationGroupProps, 'context' | 'slots'> &
|
|
8
|
+
Pick<NavigationGroupParameters, 'backgroundColor'> & {
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
};
|
|
11
12
|
|
|
12
13
|
const useHeaderHeight = () => {
|
|
13
14
|
const [headerHeight, setHeaderHeight] = useState(0);
|
|
@@ -15,6 +16,7 @@ const useHeaderHeight = () => {
|
|
|
15
16
|
useEffect(() => {
|
|
16
17
|
const header = document.getElementById('mobile-header');
|
|
17
18
|
if (header) {
|
|
19
|
+
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
18
20
|
setHeaderHeight(header.offsetHeight);
|
|
19
21
|
}
|
|
20
22
|
}, []);
|
|
@@ -25,7 +27,6 @@ const useHeaderHeight = () => {
|
|
|
25
27
|
export const NavigationGroupMobileContent: FC<NavigationGroupMobileContentProps> = ({
|
|
26
28
|
isOpen,
|
|
27
29
|
backgroundColor,
|
|
28
|
-
context,
|
|
29
30
|
slots,
|
|
30
31
|
onClose,
|
|
31
32
|
}) => {
|
|
@@ -45,7 +46,7 @@ export const NavigationGroupMobileContent: FC<NavigationGroupMobileContentProps>
|
|
|
45
46
|
</button>
|
|
46
47
|
|
|
47
48
|
<div className="flex flex-col items-center gap-y-4 p-4">
|
|
48
|
-
<UniformSlot
|
|
49
|
+
<UniformSlot slot={slots.links} />
|
|
49
50
|
</div>
|
|
50
51
|
</div>
|
|
51
52
|
);
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { FC, useCallback, useState } from 'react';
|
|
4
|
-
import { UniformText } from '@uniformdev/
|
|
3
|
+
import { FC, ReactNode, useCallback, useState } from 'react';
|
|
4
|
+
import { ComponentParameter, UniformText } from '@uniformdev/next-app-router/component';
|
|
5
5
|
import BaseIconLabel from '@/components/ui/IconLabel';
|
|
6
6
|
import BaseImage from '@/components/ui/Image';
|
|
7
|
-
import
|
|
8
|
-
import { resolveAsset } from '@/utils/assets';
|
|
7
|
+
import { ReplaceFieldsWithAssets } from '@/types/cskTypes';
|
|
9
8
|
import { cn, resolveViewPort } from '@/utils/styling';
|
|
10
|
-
import {
|
|
9
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
10
|
+
import { NavigationGroupParameters, NavigationGroupProps } from '.';
|
|
11
11
|
import { NavigationGroupDesktopContent } from './desktop';
|
|
12
12
|
import { NavigationGroupMobileContent } from './mobile';
|
|
13
13
|
import { getButtonClasses, getCaretClasses } from './style-utils';
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
type NavigationGroupClientProps = NavigationGroupProps &
|
|
16
|
+
Omit<ReplaceFieldsWithAssets<NavigationGroupParameters, 'caretIcon'>, 'icon'> & {
|
|
17
|
+
icon: ReactNode | null;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const NavigationGroupClient: FC<NavigationGroupClientProps> = ({
|
|
16
21
|
icon,
|
|
17
22
|
caretIcon,
|
|
18
23
|
backgroundColor,
|
|
@@ -31,39 +36,35 @@ export const NavigationGroup: FC<NavigationGroupProps> = ({
|
|
|
31
36
|
slots,
|
|
32
37
|
hoverEffect = '',
|
|
33
38
|
className,
|
|
39
|
+
parameters,
|
|
34
40
|
}) => {
|
|
35
41
|
const [isOpen, setIsOpen] = useState(false);
|
|
36
42
|
|
|
37
43
|
const openFlyout = useCallback(() => setIsOpen(true), []);
|
|
38
44
|
const closeFlyout = useCallback(() => setIsOpen(false), []);
|
|
39
45
|
|
|
40
|
-
const [resolvedImage] = resolveAsset(icon);
|
|
41
|
-
const { url, title = '' } = resolvedImage || {};
|
|
42
|
-
|
|
43
|
-
const renderUrl = () => {
|
|
44
|
-
if (!url) return null;
|
|
45
|
-
|
|
46
|
-
return url.endsWith('.svg') ? <InlineSVG src={url} alt={title} fill /> : <BaseImage src={url} alt={title} fill />;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
46
|
const actionClassName = cn('transition-all duration-150', {
|
|
50
47
|
[resolveViewPort(hoverEffect, 'group-hover:{value}')]: !!hoverEffect,
|
|
51
48
|
});
|
|
52
49
|
|
|
53
|
-
const [resolvedCaretIcon] =
|
|
50
|
+
const [resolvedCaretIcon] = caretIcon || [];
|
|
54
51
|
const { url: caretUrl, title: caretTitle = '' } = resolvedCaretIcon || {};
|
|
55
52
|
|
|
56
53
|
return (
|
|
57
54
|
<div className="relative" onMouseLeave={closeFlyout}>
|
|
58
55
|
<button onMouseEnter={openFlyout} onClick={openFlyout} className={getButtonClasses({ color })}>
|
|
59
56
|
<BaseIconLabel
|
|
60
|
-
icon={
|
|
57
|
+
icon={icon}
|
|
61
58
|
className={cn('group', className)}
|
|
62
59
|
iconClassName={actionClassName}
|
|
63
60
|
textClassName={actionClassName}
|
|
64
61
|
{...{ size, tag, color, weight, font, transform, decoration, letterSpacing, alignment }}
|
|
65
62
|
>
|
|
66
|
-
<UniformText
|
|
63
|
+
<UniformText
|
|
64
|
+
placeholder="Text goes here"
|
|
65
|
+
parameter={parameters.text as ComponentParameter<string>}
|
|
66
|
+
component={component}
|
|
67
|
+
/>
|
|
67
68
|
</BaseIconLabel>
|
|
68
69
|
{caretUrl && (
|
|
69
70
|
<div
|
|
@@ -86,3 +87,5 @@ export const NavigationGroup: FC<NavigationGroupProps> = ({
|
|
|
86
87
|
</div>
|
|
87
88
|
);
|
|
88
89
|
};
|
|
90
|
+
|
|
91
|
+
export default withFlattenParameters(NavigationGroupClient);
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { AssetParamValue } from '@uniformdev/assets';
|
|
2
2
|
import { LinkParamValue } from '@uniformdev/canvas';
|
|
3
|
-
import { ComponentProps } from '@uniformdev/canvas-next-rsc/component';
|
|
4
3
|
import { TextParameters } from '@/components/canvas/Text/parameters';
|
|
5
|
-
import { ViewPort } from '@/types/cskTypes';
|
|
6
|
-
import { NavigationLink } from './navigation-link';
|
|
4
|
+
import { ComponentProps, ViewPort } from '@/types/cskTypes';
|
|
7
5
|
|
|
8
6
|
export type NavigationLinkParameters = TextParameters & {
|
|
9
7
|
icon?: AssetParamValue;
|
|
@@ -15,4 +13,4 @@ export type NavigationLinkParameters = TextParameters & {
|
|
|
15
13
|
|
|
16
14
|
export type NavigationLinkProps = ComponentProps<NavigationLinkParameters>;
|
|
17
15
|
|
|
18
|
-
export default
|
|
16
|
+
export { default } from './navigation-link';
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { UniformText } from '@uniformdev/
|
|
2
|
+
import { ComponentParameter, UniformText } from '@uniformdev/next-app-router/component';
|
|
3
3
|
import BaseIconLabel from '@/components/ui/IconLabel';
|
|
4
4
|
import BaseImage from '@/components/ui/Image';
|
|
5
5
|
import InlineSVG from '@/components/ui/InlineSVG';
|
|
6
|
-
import {
|
|
7
|
-
import { formatUniformLink, isExternalLink
|
|
6
|
+
import { ReplaceFieldsWithAssets } from '@/types/cskTypes';
|
|
7
|
+
import { formatUniformLink, isExternalLink } from '@/utils/routing';
|
|
8
8
|
import { cn, resolveViewPort } from '@/utils/styling';
|
|
9
|
-
import {
|
|
9
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
10
|
+
import { NavigationLinkProps, NavigationLinkParameters } from '.';
|
|
10
11
|
import { Wrapper } from './wrapper';
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
const NavigationLink: FC<NavigationLinkProps & ReplaceFieldsWithAssets<NavigationLinkParameters, 'icon'>> = ({
|
|
13
14
|
icon,
|
|
14
15
|
link,
|
|
15
16
|
activeState,
|
|
@@ -26,11 +27,12 @@ export const NavigationLink: FC<NavigationLinkProps> = ({
|
|
|
26
27
|
context,
|
|
27
28
|
hoverEffect = '',
|
|
28
29
|
className,
|
|
30
|
+
parameters,
|
|
29
31
|
}) => {
|
|
30
32
|
const href = formatUniformLink(link);
|
|
31
|
-
const isActive = activeState &&
|
|
33
|
+
const isActive = !activeState && context.pageState.routePath === href;
|
|
32
34
|
|
|
33
|
-
const [resolvedImage] =
|
|
35
|
+
const [resolvedImage] = icon || [];
|
|
34
36
|
const { url, title = '' } = resolvedImage || {};
|
|
35
37
|
|
|
36
38
|
const renderUrl = () => {
|
|
@@ -55,12 +57,13 @@ export const NavigationLink: FC<NavigationLinkProps> = ({
|
|
|
55
57
|
>
|
|
56
58
|
<UniformText
|
|
57
59
|
placeholder="Text goes here"
|
|
58
|
-
|
|
60
|
+
parameter={parameters.text as ComponentParameter<string>}
|
|
59
61
|
className="whitespace-nowrap"
|
|
60
62
|
component={component}
|
|
61
|
-
context={context}
|
|
62
63
|
/>
|
|
63
64
|
</BaseIconLabel>
|
|
64
65
|
</Wrapper>
|
|
65
66
|
);
|
|
66
67
|
};
|
|
68
|
+
|
|
69
|
+
export default withFlattenParameters(NavigationLink);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { UniformSlotProps } from '@uniformdev/next-app-router/component';
|
|
2
|
+
import { ComponentProps } from '@/types/cskTypes';
|
|
3
3
|
export type PageAdditionalProps = {
|
|
4
|
-
headerCustomRenderer?:
|
|
5
|
-
contentCustomRenderer?:
|
|
6
|
-
footerCustomRenderer?:
|
|
4
|
+
headerCustomRenderer?: UniformSlotProps['children'];
|
|
5
|
+
contentCustomRenderer?: UniformSlotProps['children'];
|
|
6
|
+
footerCustomRenderer?: UniformSlotProps['children'];
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export type PageParameters = {
|
|
@@ -17,7 +17,7 @@ export enum CommonPageSlots {
|
|
|
17
17
|
PageFooter = 'pageFooter',
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export type PageProps = ComponentProps<PageParameters & PageAdditionalProps
|
|
20
|
+
export type PageProps = ComponentProps<PageParameters, CommonPageSlots> & PageAdditionalProps;
|
|
21
21
|
|
|
22
|
-
export {
|
|
22
|
+
export { default } from './page';
|
|
23
23
|
export { PageEmptyPlaceholder } from './empty-placeholder';
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { UniformSlot } from '@uniformdev/
|
|
2
|
+
import { UniformSlot } from '@uniformdev/next-app-router/component';
|
|
3
3
|
import BasePage from '@/components/ui/Page';
|
|
4
|
-
import {
|
|
4
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
5
|
+
import { PageProps, PageParameters } from '.';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
const Page: FC<PageProps & PageParameters> = ({
|
|
7
8
|
slots,
|
|
8
|
-
component,
|
|
9
|
-
context,
|
|
10
9
|
backgroundColor,
|
|
11
10
|
headerCustomRenderer,
|
|
12
11
|
contentCustomRenderer,
|
|
@@ -14,19 +13,11 @@ export const Page: FC<PageProps> = ({
|
|
|
14
13
|
}) => (
|
|
15
14
|
<BasePage
|
|
16
15
|
backgroundColor={backgroundColor}
|
|
17
|
-
header={
|
|
18
|
-
|
|
19
|
-
{headerCustomRenderer}
|
|
20
|
-
</UniformSlot>
|
|
21
|
-
}
|
|
22
|
-
footer={
|
|
23
|
-
<UniformSlot context={context} slot={slots.pageFooter} data={component}>
|
|
24
|
-
{footerCustomRenderer}
|
|
25
|
-
</UniformSlot>
|
|
26
|
-
}
|
|
16
|
+
header={<UniformSlot slot={slots.pageHeader}>{headerCustomRenderer}</UniformSlot>}
|
|
17
|
+
footer={<UniformSlot slot={slots.pageFooter}>{footerCustomRenderer}</UniformSlot>}
|
|
27
18
|
>
|
|
28
|
-
<UniformSlot
|
|
29
|
-
{contentCustomRenderer}
|
|
30
|
-
</UniformSlot>
|
|
19
|
+
<UniformSlot slot={slots.pageContent}>{contentCustomRenderer}</UniformSlot>
|
|
31
20
|
</BasePage>
|
|
32
21
|
);
|
|
22
|
+
|
|
23
|
+
export default withFlattenParameters(Page);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
2
|
import Container from '@/components/ui/Container';
|
|
3
3
|
import Rating from '@/components/ui/Rating';
|
|
4
|
-
import { ReviewProps } from '.';
|
|
4
|
+
import { ReviewParameters, ReviewProps } from '.';
|
|
5
5
|
|
|
6
6
|
type DefaultVariantProps = ReviewProps & {
|
|
7
7
|
ReviewImage: ReactNode;
|
|
@@ -9,7 +9,7 @@ type DefaultVariantProps = ReviewProps & {
|
|
|
9
9
|
ReviewContent: ReactNode;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
export const DefaultVariant: FC<DefaultVariantProps> = ({
|
|
12
|
+
export const DefaultVariant: FC<DefaultVariantProps & ReviewParameters> = ({
|
|
13
13
|
stars,
|
|
14
14
|
starsColor,
|
|
15
15
|
activeStarsColor,
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { ResolveEmptyPlaceholderOptions } from '@/types/cskTypes';
|
|
2
2
|
import { DEFAULT_EMPTY_PLACEHOLDER } from '@/utils/createEmptyPlaceholderResolver';
|
|
3
|
-
import { ReviewSlots
|
|
3
|
+
import { ReviewSlots } from '.';
|
|
4
|
+
|
|
5
|
+
export const ReviewEmptyPlaceholder = ({ slotName }: ResolveEmptyPlaceholderOptions) => {
|
|
6
|
+
// To show correct empty placeholder for current variant
|
|
7
|
+
// const isMultiColumn = parentComponent?.variant === ReviewVariants.MultiColumn;
|
|
8
|
+
const isMultiColumn = true;
|
|
4
9
|
|
|
5
|
-
export const ReviewEmptyPlaceholder = ({ parentComponent, slotName }: ResolveEmptyPlaceholderOptions) => {
|
|
6
|
-
const isMultiColumn = parentComponent?.variant === ReviewVariants.MultiColumn;
|
|
7
10
|
switch (slotName) {
|
|
8
11
|
case ReviewSlots.ReviewImage:
|
|
9
12
|
return {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ComponentProps } from '@uniformdev/canvas-next-rsc/component';
|
|
2
1
|
import { ContainerParameters } from '@/components/canvas/Container/parameters';
|
|
2
|
+
import { ComponentProps } from '@/types/cskTypes';
|
|
3
3
|
|
|
4
4
|
export type ReviewParameters = ContainerParameters & {
|
|
5
|
-
stars
|
|
6
|
-
starsColor
|
|
7
|
-
activeStarsColor
|
|
8
|
-
showRatingLabel
|
|
5
|
+
stars?: number;
|
|
6
|
+
starsColor?: string;
|
|
7
|
+
activeStarsColor?: string;
|
|
8
|
+
showRatingLabel?: boolean;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export enum ReviewVariants {
|
|
@@ -20,5 +20,5 @@ export enum ReviewSlots {
|
|
|
20
20
|
|
|
21
21
|
export type ReviewProps = ComponentProps<ReviewParameters, ReviewSlots>;
|
|
22
22
|
|
|
23
|
-
export {
|
|
23
|
+
export { default } from './review';
|
|
24
24
|
export { ReviewEmptyPlaceholder } from './empty-placeholder';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
2
|
import Container from '@/components/ui/Container';
|
|
3
3
|
import Rating from '@/components/ui/Rating';
|
|
4
|
-
import { ReviewProps } from '.';
|
|
4
|
+
import { ReviewParameters, ReviewProps } from '.';
|
|
5
5
|
|
|
6
6
|
type MultiColumnVariantProps = ReviewProps & {
|
|
7
7
|
ReviewImage: ReactNode;
|
|
@@ -9,7 +9,7 @@ type MultiColumnVariantProps = ReviewProps & {
|
|
|
9
9
|
ReviewContent: ReactNode;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
export const MultiColumnVariant: FC<MultiColumnVariantProps> = ({
|
|
12
|
+
export const MultiColumnVariant: FC<MultiColumnVariantProps & ReviewParameters> = ({
|
|
13
13
|
stars,
|
|
14
14
|
starsColor,
|
|
15
15
|
activeStarsColor,
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { UniformSlot } from '@uniformdev/
|
|
3
|
-
import {
|
|
2
|
+
import { UniformSlot } from '@uniformdev/next-app-router/component';
|
|
3
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
4
|
+
import { ReviewParameters, ReviewProps, ReviewVariants } from '.';
|
|
4
5
|
import { DefaultVariant } from './default-variant';
|
|
5
6
|
import { MultiColumnVariant } from './multi-column-variant';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
const { component, context, slots } = props;
|
|
9
|
-
const variant = component.variant as ReviewVariants | undefined;
|
|
10
|
-
|
|
8
|
+
const Review: FC<ReviewProps & ReviewParameters> = ({ slots, variant, ...props }) => {
|
|
11
9
|
const variantProps = {
|
|
12
10
|
...props,
|
|
13
|
-
ReviewImage: <UniformSlot
|
|
14
|
-
ReviewPersonInfo: <UniformSlot
|
|
15
|
-
ReviewContent: <UniformSlot
|
|
11
|
+
ReviewImage: <UniformSlot slot={slots.reviewImage} />,
|
|
12
|
+
ReviewPersonInfo: <UniformSlot slot={slots.reviewPersonInfo} />,
|
|
13
|
+
ReviewContent: <UniformSlot slot={slots.reviewContent} />,
|
|
16
14
|
};
|
|
17
15
|
|
|
18
16
|
switch (variant) {
|
|
19
17
|
case ReviewVariants.MultiColumn:
|
|
20
|
-
return <MultiColumnVariant {...variantProps} />;
|
|
18
|
+
return <MultiColumnVariant variant={variant} slots={slots} {...variantProps} />;
|
|
21
19
|
default:
|
|
22
|
-
return <DefaultVariant {...variantProps} />;
|
|
20
|
+
return <DefaultVariant variant={variant} slots={slots} {...variantProps} />;
|
|
23
21
|
}
|
|
24
22
|
};
|
|
23
|
+
|
|
24
|
+
export default withFlattenParameters(Review);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ComponentProps } from '@uniformdev/canvas-next-rsc/component';
|
|
2
1
|
import { RichTextNode } from '@uniformdev/richtext';
|
|
3
|
-
import {
|
|
2
|
+
import { ComponentProps } from '@/types/cskTypes';
|
|
3
|
+
|
|
4
|
+
type Size = 'sm' | 'base' | 'lg' | 'xl' | '2xl';
|
|
4
5
|
|
|
5
6
|
export type RichTextAdditionalProps = {
|
|
6
7
|
className?: string;
|
|
@@ -8,11 +9,11 @@ export type RichTextAdditionalProps = {
|
|
|
8
9
|
|
|
9
10
|
export type RichTextParameters = {
|
|
10
11
|
text?: RichTextNode;
|
|
12
|
+
size?: Size;
|
|
11
13
|
color?: string;
|
|
12
14
|
font?: string;
|
|
13
|
-
lineCountRestrictions
|
|
15
|
+
lineCountRestrictions?: string;
|
|
14
16
|
};
|
|
15
17
|
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
export default RichText;
|
|
18
|
+
export { default } from './rich-text';
|
|
19
|
+
export type RichTextProps = ComponentProps<RichTextParameters> & RichTextAdditionalProps;
|
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { UniformRichText } from '@uniformdev/
|
|
2
|
+
import { ComponentParameter, UniformRichText } from '@uniformdev/next-app-router/component';
|
|
3
3
|
import BaseText from '@/components/ui/Text';
|
|
4
|
-
import { cn } from '@/utils/styling';
|
|
5
|
-
import {
|
|
4
|
+
import { cn, resolveViewPort } from '@/utils/styling';
|
|
5
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
6
|
+
import { RichTextProps, RichTextParameters, RichTextAdditionalProps } from '.';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
const RichText: FC<RichTextProps & RichTextParameters & RichTextAdditionalProps> = ({
|
|
9
|
+
color,
|
|
10
|
+
lineCountRestrictions,
|
|
11
|
+
font,
|
|
12
|
+
size,
|
|
13
|
+
component,
|
|
14
|
+
className,
|
|
15
|
+
parameters,
|
|
16
|
+
}) => (
|
|
8
17
|
<BaseText lineCountRestrictions={lineCountRestrictions} color={color} font={font}>
|
|
9
18
|
<UniformRichText
|
|
10
|
-
className={cn(
|
|
11
|
-
|
|
19
|
+
className={cn(
|
|
20
|
+
'prose max-w-full marker:text-current [&_*:not(pre)]:text-current',
|
|
21
|
+
{
|
|
22
|
+
[resolveViewPort(size, 'prose-{value}')]: size,
|
|
23
|
+
},
|
|
24
|
+
className
|
|
25
|
+
)}
|
|
26
|
+
parameter={parameters.text as ComponentParameter<string>}
|
|
12
27
|
component={component}
|
|
13
28
|
placeholder="Rich text content goes here..."
|
|
14
29
|
/>
|
|
15
30
|
</BaseText>
|
|
16
31
|
);
|
|
32
|
+
|
|
33
|
+
export default withFlattenParameters(RichText);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
import Container from '@/components/ui/Container';
|
|
3
3
|
import { cn } from '@/utils/styling';
|
|
4
4
|
import { SectionParameters, SectionVariants } from '.';
|
|
@@ -10,9 +10,9 @@ type ColumnsVariantProps = {
|
|
|
10
10
|
fluidContent: SectionParameters['fluidContent'];
|
|
11
11
|
height: SectionParameters['height'];
|
|
12
12
|
variant: SectionVariants;
|
|
13
|
-
sectionMedia:
|
|
14
|
-
sectionContent:
|
|
15
|
-
sectionCTA:
|
|
13
|
+
sectionMedia: ReactNode;
|
|
14
|
+
sectionContent: ReactNode;
|
|
15
|
+
sectionCTA: ReactNode;
|
|
16
16
|
textAlignmentClass: string;
|
|
17
17
|
buttonAlignmentClass: string;
|
|
18
18
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
import Container from '@/components/ui/Container';
|
|
3
3
|
import { cn } from '@/utils/styling';
|
|
4
4
|
import { SectionParameters } from '.';
|
|
@@ -9,9 +9,9 @@ type DefaultVariantProps = {
|
|
|
9
9
|
border?: SectionParameters['border'];
|
|
10
10
|
fluidContent?: SectionParameters['fluidContent'];
|
|
11
11
|
height?: SectionParameters['height'];
|
|
12
|
-
sectionMedia:
|
|
13
|
-
sectionContent:
|
|
14
|
-
sectionCTA:
|
|
12
|
+
sectionMedia: ReactNode;
|
|
13
|
+
sectionContent: ReactNode;
|
|
14
|
+
sectionCTA: ReactNode;
|
|
15
15
|
textAlignmentClass: string;
|
|
16
16
|
buttonAlignmentClass: string;
|
|
17
17
|
};
|
|
@@ -31,8 +31,8 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
|
|
|
31
31
|
<Container className="relative overflow-hidden" {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
32
32
|
<div className="absolute left-0 top-0 size-full overflow-hidden">{sectionMedia}</div>
|
|
33
33
|
<Container className="relative flex flex-col gap-8">
|
|
34
|
-
<div className={cn('flex flex-col gap-4', textAlignmentClass)}>{sectionContent}</div>
|
|
35
|
-
<div className={cn('flex flex-wrap gap-2', buttonAlignmentClass)}>{sectionCTA}</div>
|
|
34
|
+
{sectionContent && <div className={cn('flex flex-col gap-4', textAlignmentClass)}>{sectionContent}</div>}
|
|
35
|
+
{sectionCTA && <div className={cn('flex flex-wrap gap-2', buttonAlignmentClass)}>{sectionCTA}</div>}
|
|
36
36
|
</Container>
|
|
37
37
|
</Container>
|
|
38
38
|
);
|
|
@@ -2,8 +2,11 @@ import { ResolveEmptyPlaceholderOptions } from '@/types/cskTypes';
|
|
|
2
2
|
import { DEFAULT_EMPTY_PLACEHOLDER } from '@/utils/createEmptyPlaceholderResolver';
|
|
3
3
|
import { SectionSlots } from '.';
|
|
4
4
|
|
|
5
|
-
export const SectionEmptyPlaceholder = ({
|
|
6
|
-
|
|
5
|
+
export const SectionEmptyPlaceholder = ({ slotName }: ResolveEmptyPlaceholderOptions) => {
|
|
6
|
+
// To show correct empty placeholder for current variant
|
|
7
|
+
//const isDefault = !parentComponent?.variant;
|
|
8
|
+
const isDefault = true;
|
|
9
|
+
|
|
7
10
|
switch (slotName) {
|
|
8
11
|
case SectionSlots.SectionMedia:
|
|
9
12
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentProps } from '@uniformdev/canvas-next-rsc/component';
|
|
2
1
|
import { ContainerParameters } from '@/components/canvas/Container/parameters';
|
|
2
|
+
import { ComponentProps } from '@/types/cskTypes';
|
|
3
3
|
|
|
4
4
|
export enum ContentAlignment {
|
|
5
5
|
Left = 'left',
|
|
@@ -24,5 +24,5 @@ export enum SectionSlots {
|
|
|
24
24
|
|
|
25
25
|
export type SectionProps = ComponentProps<SectionParameters, SectionSlots>;
|
|
26
26
|
|
|
27
|
-
export {
|
|
27
|
+
export { default } from './section';
|
|
28
28
|
export { SectionEmptyPlaceholder } from './empty-placeholder';
|
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { UniformSlot } from '@uniformdev/
|
|
3
|
-
import {
|
|
2
|
+
import { UniformSlot } from '@uniformdev/next-app-router/component';
|
|
3
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
4
|
+
import { SectionParameters, SectionProps, SectionVariants } from '.';
|
|
4
5
|
import { ColumnsVariant } from './columns-variant';
|
|
5
6
|
import { DefaultVariant } from './default-variant';
|
|
6
7
|
import { getButtonAlignmentClass, getTextAlignmentClass } from './style-utils';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
const Section: FC<SectionProps & SectionParameters> = ({
|
|
9
10
|
contentAlignment,
|
|
10
11
|
slots,
|
|
11
|
-
component,
|
|
12
|
-
context,
|
|
13
12
|
backgroundColor,
|
|
14
13
|
spacing,
|
|
15
14
|
border,
|
|
16
15
|
fluidContent,
|
|
17
16
|
height,
|
|
17
|
+
variant,
|
|
18
18
|
}) => {
|
|
19
|
-
const variant = component.variant as SectionVariants;
|
|
20
|
-
|
|
21
19
|
const variantProps = {
|
|
22
|
-
variant,
|
|
23
20
|
backgroundColor,
|
|
24
21
|
spacing,
|
|
25
22
|
border,
|
|
@@ -27,16 +24,18 @@ export const Section: FC<SectionProps> = ({
|
|
|
27
24
|
height,
|
|
28
25
|
textAlignmentClass: getTextAlignmentClass({ contentAlignment }),
|
|
29
26
|
buttonAlignmentClass: getButtonAlignmentClass({ contentAlignment }),
|
|
30
|
-
sectionMedia: <UniformSlot
|
|
31
|
-
sectionContent: <UniformSlot
|
|
32
|
-
sectionCTA: <UniformSlot
|
|
27
|
+
sectionMedia: <UniformSlot slot={slots.sectionMedia} />,
|
|
28
|
+
sectionContent: slots.sectionContent ? <UniformSlot slot={slots.sectionContent} /> : undefined,
|
|
29
|
+
sectionCTA: slots.sectionCTA ? <UniformSlot slot={slots.sectionCTA} /> : undefined,
|
|
33
30
|
};
|
|
34
31
|
|
|
35
32
|
switch (variant) {
|
|
36
33
|
case SectionVariants.Columns:
|
|
37
34
|
case SectionVariants.ColumnsReverse:
|
|
38
|
-
return <ColumnsVariant {...variantProps} />;
|
|
35
|
+
return <ColumnsVariant variant={variant} {...variantProps} />;
|
|
39
36
|
default:
|
|
40
37
|
return <DefaultVariant {...variantProps} />;
|
|
41
38
|
}
|
|
42
39
|
};
|
|
40
|
+
|
|
41
|
+
export default withFlattenParameters(Section);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AssetParamValue, LinkParamValue, RichTextParamValue } from '@uniformdev/canvas';
|
|
2
|
+
import { ComponentProps } from '@/types/cskTypes';
|
|
3
|
+
|
|
4
|
+
export type SimpleFooterParameters = {
|
|
5
|
+
logo?: AssetParamValue;
|
|
6
|
+
copyright?: RichTextParamValue;
|
|
7
|
+
footerLinkSectionTitle?: string;
|
|
8
|
+
links?: {
|
|
9
|
+
title: string;
|
|
10
|
+
link: LinkParamValue;
|
|
11
|
+
}[];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type SimpleFooterProps = ComponentProps<SimpleFooterParameters>;
|
|
15
|
+
|
|
16
|
+
export { default } from './simple-footer';
|