@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,12 +1,11 @@
|
|
|
1
1
|
import { AssetParamValue } from '@uniformdev/assets';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { IconLabel } from './icon-label';
|
|
2
|
+
import { IconLabelProps as BaseIconLabelParameters } from '@/components/ui/IconLabel';
|
|
3
|
+
import { ComponentProps } from '@/types/cskTypes';
|
|
5
4
|
|
|
6
|
-
export type IconLabelParameters =
|
|
5
|
+
export type IconLabelParameters = Omit<BaseIconLabelParameters, 'children'> & {
|
|
7
6
|
icon?: AssetParamValue;
|
|
8
7
|
};
|
|
9
8
|
|
|
10
9
|
export type IconLabelProps = ComponentProps<IconLabelParameters>;
|
|
11
10
|
|
|
12
|
-
export default
|
|
11
|
+
export { default } from './icon-label';
|
|
@@ -2,10 +2,11 @@ import { FC } from 'react';
|
|
|
2
2
|
import { imageFrom } from '@uniformdev/assets';
|
|
3
3
|
import BaseImage from '@/components/ui/Image';
|
|
4
4
|
import MediaPlaceholder from '@/components/ui/MediaPlaceholder';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { ReplaceFieldsWithAssets } from '@/types/cskTypes';
|
|
6
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
7
|
+
import { ImageParameters, ImageProps } from '.';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
const Image: FC<ImageProps & ReplaceFieldsWithAssets<ImageParameters, 'image'>> = async ({
|
|
9
10
|
image,
|
|
10
11
|
objectFit,
|
|
11
12
|
width,
|
|
@@ -19,10 +20,10 @@ export const Image: FC<ImageProps> = async ({
|
|
|
19
20
|
context,
|
|
20
21
|
component,
|
|
21
22
|
}) => {
|
|
22
|
-
const [resolvedImage] =
|
|
23
|
+
const [resolvedImage] = image || [];
|
|
23
24
|
|
|
24
25
|
if (!resolvedImage) {
|
|
25
|
-
const isEditorPreviewMode = context.
|
|
26
|
+
const isEditorPreviewMode = context.isContextualEditing;
|
|
26
27
|
const isPlaceholder = component?._id?.includes('placeholder_');
|
|
27
28
|
|
|
28
29
|
if (!isEditorPreviewMode || isPlaceholder) {
|
|
@@ -44,7 +45,7 @@ export const Image: FC<ImageProps> = async ({
|
|
|
44
45
|
if (!fill && (!imageWidth || !imageHeight)) {
|
|
45
46
|
console.warn(
|
|
46
47
|
'No dimensions provided for the Next.js Image component. Falling back to a standard <img> tag for rendering.'
|
|
47
|
-
);
|
|
48
|
+
); // eslint-disable-next-line @next/next/no-img-element
|
|
48
49
|
return <img src={resolvedImage.url} alt={title} />;
|
|
49
50
|
}
|
|
50
51
|
|
|
@@ -71,7 +72,10 @@ export const Image: FC<ImageProps> = async ({
|
|
|
71
72
|
unoptimized={unoptimized}
|
|
72
73
|
priority={priority}
|
|
73
74
|
sizes="100%"
|
|
74
|
-
style={{
|
|
75
|
+
style={{
|
|
76
|
+
objectFit,
|
|
77
|
+
objectPosition: focalPoint && !width && !height ? `${focalPoint.x * 100}% ${focalPoint.y * 100}%` : undefined,
|
|
78
|
+
}}
|
|
75
79
|
overlayColor={overlayColor}
|
|
76
80
|
overlayOpacity={overlayOpacity}
|
|
77
81
|
border={border}
|
|
@@ -79,3 +83,5 @@ export const Image: FC<ImageProps> = async ({
|
|
|
79
83
|
/>
|
|
80
84
|
);
|
|
81
85
|
};
|
|
86
|
+
|
|
87
|
+
export default withFlattenParameters(Image);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AssetParamValue } from '@uniformdev/assets';
|
|
2
|
-
import { ComponentProps } from '
|
|
3
|
-
import { ViewPort } from '@/types/cskTypes';
|
|
2
|
+
import { ComponentProps, ViewPort } from '@/types/cskTypes';
|
|
4
3
|
|
|
5
4
|
export type ImageParameters = {
|
|
6
5
|
image?: AssetParamValue;
|
|
@@ -17,4 +16,4 @@ export type ImageParameters = {
|
|
|
17
16
|
|
|
18
17
|
export type ImageProps = ComponentProps<ImageParameters>;
|
|
19
18
|
|
|
20
|
-
export {
|
|
19
|
+
export { default } from './image';
|
|
@@ -5,7 +5,7 @@ import { ImageGallerySlots } from '.';
|
|
|
5
5
|
export const ImageGalleryEmptyPlaceholder = (props: ResolveEmptyPlaceholderOptions) => {
|
|
6
6
|
switch (props.slotName) {
|
|
7
7
|
case ImageGallerySlots.Items:
|
|
8
|
-
return { component: () => <div className="
|
|
8
|
+
return { component: () => <div className="mx-auto size-48" /> };
|
|
9
9
|
default:
|
|
10
10
|
return DEFAULT_EMPTY_PLACEHOLDER;
|
|
11
11
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import { FC, ReactNode } from 'react';
|
|
4
4
|
import Masonry from 'react-responsive-masonry';
|
|
5
|
-
import { UniformSlotProps } from '@uniformdev/
|
|
5
|
+
import { UniformSlotProps } from '@uniformdev/next-app-router/component';
|
|
6
6
|
import { cn } from '@/utils/styling';
|
|
7
|
-
import { ImageGalleryProps } from '.';
|
|
7
|
+
import { ImageGalleryParameters, ImageGalleryProps } from '.';
|
|
8
8
|
|
|
9
9
|
const DEFAULT_GALLERY_CONFIG = {
|
|
10
10
|
firstLineCount: 2,
|
|
@@ -14,7 +14,7 @@ const DEFAULT_GALLERY_CONFIG = {
|
|
|
14
14
|
|
|
15
15
|
type GalleryInnerProps = {
|
|
16
16
|
slot: UniformSlotProps['slot'];
|
|
17
|
-
aspectRatio?:
|
|
17
|
+
aspectRatio?: ImageGalleryParameters['aspectRatio'];
|
|
18
18
|
config?: ImageGalleryProps['config'];
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -31,11 +31,11 @@ export const GalleryInner: FC<GalleryInnerProps> = ({ slot, aspectRatio, config
|
|
|
31
31
|
items.reduce<ReactNode[][]>(
|
|
32
32
|
(acc, item, index) => {
|
|
33
33
|
if (index < firstLineCount) {
|
|
34
|
-
acc[0]?.push(item);
|
|
34
|
+
acc[0]?.push(item?.component);
|
|
35
35
|
} else if (index < firstLineCount + secondLineCount) {
|
|
36
|
-
acc[1]?.push(item);
|
|
36
|
+
acc[1]?.push(item?.component);
|
|
37
37
|
} else {
|
|
38
|
-
acc[2]?.push(item);
|
|
38
|
+
acc[2]?.push(item?.component);
|
|
39
39
|
}
|
|
40
40
|
return acc;
|
|
41
41
|
},
|
|
@@ -1,56 +1,43 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { FC } from 'react';
|
|
4
|
-
import { UniformSlot } from '@uniformdev/canvas-next-rsc/component';
|
|
5
4
|
import Container from '@/components/ui/Container';
|
|
6
5
|
import BaseImage from '@/components/ui/Image';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { ReplaceFieldsWithAssets } from '@/types/cskTypes';
|
|
7
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
8
|
+
import { ImageGalleryParameters, ImageGalleryProps } from '.';
|
|
9
9
|
import { GalleryInner } from './gallery-inner';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const ImageGallery: FC<ImageGalleryProps & ReplaceFieldsWithAssets<ImageGalleryParameters, 'items'>> = ({
|
|
12
12
|
slots,
|
|
13
|
-
aspectRatio,
|
|
14
|
-
items,
|
|
15
13
|
backgroundColor,
|
|
16
14
|
spacing,
|
|
17
15
|
border,
|
|
18
16
|
fluidContent,
|
|
19
17
|
height,
|
|
18
|
+
aspectRatio,
|
|
20
19
|
config,
|
|
21
|
-
|
|
22
|
-
component,
|
|
20
|
+
items,
|
|
23
21
|
}) => {
|
|
24
|
-
const slotsToRender =
|
|
25
|
-
|
|
26
|
-
:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
fill
|
|
36
|
-
/>
|
|
37
|
-
)) || [],
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const showEmptySlot =
|
|
41
|
-
!items?.length &&
|
|
42
|
-
!(component?.slots?.imageGalleryItems as { _id?: string }[])?.filter(({ _id }) => !_id?.startsWith('placeholder'))
|
|
43
|
-
?.length;
|
|
22
|
+
const slotsToRender = {
|
|
23
|
+
...slots.imageGalleryItems,
|
|
24
|
+
items: !items?.length
|
|
25
|
+
? slots.imageGalleryItems?.items || []
|
|
26
|
+
: items.map((item, index) => ({
|
|
27
|
+
_id: `image-${index}-${item?.id}`,
|
|
28
|
+
component: <BaseImage src={item.url} alt={item.title || ''} style={{ objectFit: 'cover' }} fill />,
|
|
29
|
+
variantId: undefined,
|
|
30
|
+
$pzCrit: undefined,
|
|
31
|
+
})),
|
|
32
|
+
};
|
|
44
33
|
|
|
45
34
|
return (
|
|
46
35
|
<Container {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
47
36
|
<div className="flex flex-col gap-1">
|
|
48
|
-
{
|
|
49
|
-
<UniformSlot context={context} slot={slots.imageGalleryItems} data={component} />
|
|
50
|
-
) : (
|
|
51
|
-
<GalleryInner slot={slotsToRender} aspectRatio={aspectRatio} config={config} />
|
|
52
|
-
)}
|
|
37
|
+
<GalleryInner slot={slotsToRender} aspectRatio={aspectRatio} config={config} />
|
|
53
38
|
</div>
|
|
54
39
|
</Container>
|
|
55
40
|
);
|
|
56
41
|
};
|
|
42
|
+
|
|
43
|
+
export default withFlattenParameters(ImageGallery);
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import dynamic from 'next/dynamic';
|
|
2
2
|
import { AssetParamValue } from '@uniformdev/assets';
|
|
3
|
-
import { ComponentProps } from '@uniformdev/canvas-next-rsc/component';
|
|
4
3
|
import { ContainerParameters } from '@/components/canvas/Container/parameters';
|
|
4
|
+
import { ComponentProps } from '@/types/cskTypes';
|
|
5
5
|
|
|
6
6
|
export type ImageGalleryParameters = ContainerParameters & {
|
|
7
7
|
aspectRatio?: 'square' | 'video';
|
|
8
8
|
items?: AssetParamValue;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
export type ImageGalleryAdditionalProps = {
|
|
12
|
+
config?: {
|
|
13
|
+
firstLineCount: number;
|
|
14
|
+
secondLineCount: number;
|
|
15
|
+
otherLinesCount: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
11
19
|
export enum ImageGallerySlots {
|
|
12
20
|
Items = 'imageGalleryItems',
|
|
13
21
|
}
|
|
14
22
|
|
|
15
|
-
export type ImageGalleryProps = ComponentProps<
|
|
16
|
-
ImageGalleryParameters & {
|
|
17
|
-
config?: {
|
|
18
|
-
firstLineCount: number;
|
|
19
|
-
secondLineCount: number;
|
|
20
|
-
otherLinesCount: number;
|
|
21
|
-
};
|
|
22
|
-
},
|
|
23
|
-
ImageGallerySlots
|
|
24
|
-
>;
|
|
23
|
+
export type ImageGalleryProps = ComponentProps<ImageGalleryParameters, ImageGallerySlots> & ImageGalleryAdditionalProps;
|
|
25
24
|
|
|
26
|
-
export default dynamic(() => import('./image-gallery').then(mod => mod.
|
|
25
|
+
export default dynamic(() => import('./image-gallery').then(mod => mod.default));
|
|
27
26
|
export { ImageGalleryEmptyPlaceholder } from './empty-placeholder';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LinkParamValue } from '@uniformdev/canvas';
|
|
2
|
-
import { ComponentProps } from '
|
|
3
|
-
import { Link } from './link';
|
|
2
|
+
import { ComponentProps } from '@/types/cskTypes';
|
|
4
3
|
|
|
5
4
|
export type LinkParameters = {
|
|
6
5
|
displayName?: string;
|
|
@@ -14,4 +13,4 @@ export enum LinkSlots {
|
|
|
14
13
|
|
|
15
14
|
export type LinkProps = ComponentProps<LinkParameters, LinkSlots>;
|
|
16
15
|
|
|
17
|
-
export default
|
|
16
|
+
export { default } from './link';
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { UniformSlot } from '@uniformdev/
|
|
2
|
+
import { UniformSlot } from '@uniformdev/next-app-router/component';
|
|
3
3
|
import BaseLink from '@/components/ui/Link';
|
|
4
4
|
import { formatUniformLink } from '@/utils/routing';
|
|
5
|
-
import {
|
|
5
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
6
|
+
import { LinkProps, LinkParameters } from '.';
|
|
6
7
|
|
|
7
|
-
export const Link: FC<LinkProps> = ({
|
|
8
|
+
export const Link: FC<LinkProps & LinkParameters> = ({ slots, link, openInNewTab }) => (
|
|
8
9
|
<BaseLink link={formatUniformLink(link)} openInNewTab={openInNewTab}>
|
|
9
|
-
<UniformSlot
|
|
10
|
+
<UniformSlot slot={slots.linkContent} />
|
|
10
11
|
</BaseLink>
|
|
11
12
|
);
|
|
13
|
+
|
|
14
|
+
export default withFlattenParameters(Link);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import dynamic from 'next/dynamic';
|
|
2
|
-
import { ComponentProps } from '
|
|
2
|
+
import { ComponentProps } from '@/types/cskTypes';
|
|
3
3
|
|
|
4
4
|
export const MaxWidthMap = {
|
|
5
5
|
small: 'max-w-xl',
|
|
@@ -22,5 +22,5 @@ export enum ModalSlots {
|
|
|
22
22
|
|
|
23
23
|
export type ModalProps = ComponentProps<ModalParameters, ModalSlots>;
|
|
24
24
|
|
|
25
|
-
export default dynamic(() => import('./modal').then(mod => mod.
|
|
25
|
+
export default dynamic(() => import('./modal').then(mod => mod.default));
|
|
26
26
|
export { ModalEmptyPlaceholder } from './empty-placeholder';
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { FC } from 'react';
|
|
4
|
-
import { UniformSlot } from '@uniformdev/
|
|
4
|
+
import { UniformSlot } from '@uniformdev/next-app-router/component';
|
|
5
5
|
import BaseModal from '@/components/ui/Modal';
|
|
6
|
-
import {
|
|
6
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
7
|
+
import { ModalParameters, ModalProps } from '.';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
const Modal: FC<ModalProps & ModalParameters> = ({
|
|
9
10
|
slots,
|
|
10
|
-
component,
|
|
11
|
-
context,
|
|
12
11
|
maxWidth,
|
|
13
12
|
backgroundColor,
|
|
14
13
|
closeIconColor,
|
|
@@ -16,10 +15,10 @@ export const Modal: FC<ModalProps> = ({
|
|
|
16
15
|
}) => (
|
|
17
16
|
<BaseModal
|
|
18
17
|
{...{ maxWidth, backgroundColor, closeIconColor, disableCloseModalOnClickOutside }}
|
|
19
|
-
trigger={<UniformSlot
|
|
20
|
-
content={<UniformSlot
|
|
21
|
-
actions={
|
|
22
|
-
slots?.modalActions?.items?.length && <UniformSlot data={component} context={context} slot={slots.modalActions} />
|
|
23
|
-
}
|
|
18
|
+
trigger={<UniformSlot slot={slots.trigger} />}
|
|
19
|
+
content={<UniformSlot slot={slots.modalContent} />}
|
|
20
|
+
actions={slots?.modalActions?.items?.length && <UniformSlot slot={slots.modalActions} />}
|
|
24
21
|
/>
|
|
25
22
|
);
|
|
23
|
+
|
|
24
|
+
export default withFlattenParameters(Modal);
|
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { UniformSlot } from '@uniformdev/
|
|
2
|
+
import { UniformSlot } from '@uniformdev/next-app-router/component';
|
|
3
3
|
import Grid from '@/components/ui/Grid';
|
|
4
4
|
import GridItem from '@/components/ui/GridItem';
|
|
5
5
|
import { cn, resolveViewPort } from '@/utils/styling';
|
|
6
|
-
import { NavigationFlyoutProps } from '.';
|
|
6
|
+
import { NavigationFlyoutProps, NavigationFlyoutParameters } from '.';
|
|
7
7
|
|
|
8
|
-
type NavigationFlyoutPropsDesktopContentProps = Pick<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
hasRightContent: boolean;
|
|
14
|
-
};
|
|
8
|
+
type NavigationFlyoutPropsDesktopContentProps = Pick<NavigationFlyoutProps, 'context' | 'slots' | 'component'> &
|
|
9
|
+
Pick<NavigationFlyoutParameters, 'backgroundColor' | 'border'> & {
|
|
10
|
+
isOpen: boolean;
|
|
11
|
+
hasRightContent: boolean;
|
|
12
|
+
};
|
|
15
13
|
|
|
16
14
|
export const NavigationFlyoutPropsDesktopContent: FC<NavigationFlyoutPropsDesktopContentProps> = ({
|
|
17
15
|
isOpen,
|
|
18
16
|
backgroundColor,
|
|
19
|
-
context,
|
|
20
17
|
slots,
|
|
21
18
|
border,
|
|
22
|
-
component,
|
|
23
19
|
hasRightContent,
|
|
24
20
|
}) => (
|
|
25
21
|
<div
|
|
@@ -39,11 +35,11 @@ export const NavigationFlyoutPropsDesktopContent: FC<NavigationFlyoutPropsDeskto
|
|
|
39
35
|
<Grid columnsCount="2" gapX="4">
|
|
40
36
|
<GridItem>
|
|
41
37
|
<div className="flex flex-col gap-y-4">
|
|
42
|
-
<UniformSlot
|
|
38
|
+
<UniformSlot slot={slots.navigationFlyoutLeftContent} />
|
|
43
39
|
</div>
|
|
44
40
|
</GridItem>
|
|
45
41
|
<GridItem>
|
|
46
|
-
<UniformSlot
|
|
42
|
+
<UniformSlot slot={slots.navigationFlyoutRightContent} />
|
|
47
43
|
</GridItem>
|
|
48
44
|
</Grid>
|
|
49
45
|
</div>
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import dynamic from 'next/dynamic';
|
|
2
2
|
import { AssetParamValue } from '@uniformdev/assets';
|
|
3
3
|
import { LinkParamValue } from '@uniformdev/canvas';
|
|
4
|
-
import { ComponentProps } from '@uniformdev/canvas-next-rsc/component';
|
|
5
4
|
import { TextParameters } from '@/components/canvas/Text/parameters';
|
|
6
|
-
import
|
|
5
|
+
import BaseImage from '@/components/ui/Image';
|
|
6
|
+
import InlineSVG from '@/components/ui/InlineSVG';
|
|
7
|
+
import { ComponentProps, ViewPort } from '@/types/cskTypes';
|
|
8
|
+
import { resolveAsset } from '@/utils/assets';
|
|
9
|
+
|
|
10
|
+
const NavigationFlyoutClient = dynamic(() => import('./navigation-flyout-client').then(mod => mod.default));
|
|
7
11
|
|
|
8
12
|
export type NavigationFlyoutParameters = TextParameters & {
|
|
9
13
|
icon?: AssetParamValue;
|
|
@@ -22,5 +26,19 @@ export enum NavigationFlyoutSlots {
|
|
|
22
26
|
|
|
23
27
|
export type NavigationFlyoutProps = ComponentProps<NavigationFlyoutParameters, NavigationFlyoutSlots>;
|
|
24
28
|
|
|
25
|
-
|
|
29
|
+
const NavigationFlyout = (props: NavigationFlyoutProps) => {
|
|
30
|
+
const [resolvedImage] = resolveAsset(props.parameters.icon?.value);
|
|
31
|
+
const { url, title = '' } = resolvedImage || {};
|
|
32
|
+
|
|
33
|
+
const renderUrl = () => {
|
|
34
|
+
if (!url) return null;
|
|
35
|
+
|
|
36
|
+
return url.endsWith('.svg') ? <InlineSVG src={url} alt={title} fill /> : <BaseImage src={url} alt={title} fill />;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return <NavigationFlyoutClient icon={renderUrl()} {...props} />;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default NavigationFlyout;
|
|
43
|
+
|
|
26
44
|
export { NavigationFlyoutEmptyPlaceholder } from './empty-placeholder';
|
|
@@ -1,16 +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 { NavigationFlyoutProps } from '.';
|
|
5
|
+
import { NavigationFlyoutProps, NavigationFlyoutParameters } from '.';
|
|
6
6
|
|
|
7
|
-
type NavigationFlyoutPropsMobileContentProps = Pick<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
onClose: () => void;
|
|
13
|
-
};
|
|
7
|
+
type NavigationFlyoutPropsMobileContentProps = Pick<NavigationFlyoutProps, 'context' | 'slots' | 'component'> &
|
|
8
|
+
Pick<NavigationFlyoutParameters, 'backgroundColor'> & {
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
};
|
|
14
12
|
|
|
15
13
|
const useHeaderHeight = () => {
|
|
16
14
|
const [headerHeight, setHeaderHeight] = useState(0);
|
|
@@ -18,6 +16,7 @@ const useHeaderHeight = () => {
|
|
|
18
16
|
useEffect(() => {
|
|
19
17
|
const header = document.getElementById('mobile-header');
|
|
20
18
|
if (header) {
|
|
19
|
+
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
21
20
|
setHeaderHeight(header.offsetHeight);
|
|
22
21
|
}
|
|
23
22
|
}, []);
|
|
@@ -28,10 +27,8 @@ const useHeaderHeight = () => {
|
|
|
28
27
|
export const NavigationFlyoutPropsMobileContent: FC<NavigationFlyoutPropsMobileContentProps> = ({
|
|
29
28
|
isOpen,
|
|
30
29
|
backgroundColor,
|
|
31
|
-
context,
|
|
32
30
|
slots,
|
|
33
31
|
onClose,
|
|
34
|
-
component,
|
|
35
32
|
}) => {
|
|
36
33
|
const headerHeight = useHeaderHeight();
|
|
37
34
|
|
|
@@ -49,8 +46,8 @@ export const NavigationFlyoutPropsMobileContent: FC<NavigationFlyoutPropsMobileC
|
|
|
49
46
|
</button>
|
|
50
47
|
|
|
51
48
|
<div className="flex flex-col items-center justify-center gap-y-8 p-4">
|
|
52
|
-
<UniformSlot
|
|
53
|
-
<UniformSlot
|
|
49
|
+
<UniformSlot slot={slots.navigationFlyoutLeftContent} />
|
|
50
|
+
<UniformSlot slot={slots.navigationFlyoutRightContent} />
|
|
54
51
|
</div>
|
|
55
52
|
</div>
|
|
56
53
|
);
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { FC, useCallback, useMemo, useState } from 'react';
|
|
4
|
-
import { UniformText } from '@uniformdev/
|
|
3
|
+
import { FC, ReactNode, useCallback, useMemo, 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 { NavigationFlyoutParameters, NavigationFlyoutProps } from '.';
|
|
11
11
|
import { NavigationFlyoutPropsDesktopContent } from './desktop';
|
|
12
12
|
import { NavigationFlyoutPropsMobileContent } from './mobile';
|
|
13
13
|
import { getButtonClasses, getCaretClasses } from './style-utils';
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
type NavigationFlyoutClientProps = NavigationFlyoutProps &
|
|
16
|
+
Omit<ReplaceFieldsWithAssets<NavigationFlyoutParameters, 'caretIcon'>, 'icon'> & {
|
|
17
|
+
icon: ReactNode | null;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const NavigationFlyoutClient: FC<NavigationFlyoutClientProps> = ({
|
|
16
21
|
icon,
|
|
17
22
|
caretIcon,
|
|
18
23
|
backgroundColor,
|
|
@@ -31,6 +36,7 @@ export const NavigationFlyout: FC<NavigationFlyoutProps> = ({
|
|
|
31
36
|
slots,
|
|
32
37
|
hoverEffect = '',
|
|
33
38
|
className,
|
|
39
|
+
parameters,
|
|
34
40
|
}) => {
|
|
35
41
|
const [isOpen, setIsOpen] = useState(false);
|
|
36
42
|
|
|
@@ -38,37 +44,35 @@ export const NavigationFlyout: FC<NavigationFlyoutProps> = ({
|
|
|
38
44
|
const closeFlyout = useCallback(() => setIsOpen(false), []);
|
|
39
45
|
|
|
40
46
|
const hasRightContent = useMemo(
|
|
41
|
-
() =>
|
|
42
|
-
|
|
47
|
+
() =>
|
|
48
|
+
Boolean(
|
|
49
|
+
slots?.navigationFlyoutRightContent?.items?.filter(item => !item?._id.startsWith('placeholder_'))?.length
|
|
50
|
+
),
|
|
51
|
+
[slots]
|
|
43
52
|
);
|
|
44
53
|
|
|
45
|
-
const [resolvedImage] = resolveAsset(icon);
|
|
46
|
-
const { url, title = '' } = resolvedImage || {};
|
|
47
|
-
|
|
48
|
-
const renderUrl = () => {
|
|
49
|
-
if (!url) return null;
|
|
50
|
-
|
|
51
|
-
return url.endsWith('.svg') ? <InlineSVG src={url} alt={title} fill /> : <BaseImage src={url} alt={title} fill />;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
54
|
const actionClassName = cn('transition-all duration-150', {
|
|
55
55
|
[resolveViewPort(hoverEffect, 'group-hover:{value}')]: !!hoverEffect,
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
const [resolvedCaretIcon] =
|
|
58
|
+
const [resolvedCaretIcon] = caretIcon || [];
|
|
59
59
|
const { url: caretUrl, title: caretTitle = '' } = resolvedCaretIcon || {};
|
|
60
60
|
|
|
61
61
|
return (
|
|
62
62
|
<div className="relative" onMouseLeave={closeFlyout}>
|
|
63
63
|
<button onMouseEnter={openFlyout} className={getButtonClasses({ color })}>
|
|
64
64
|
<BaseIconLabel
|
|
65
|
-
icon={
|
|
65
|
+
icon={icon}
|
|
66
66
|
className={cn('group', className)}
|
|
67
67
|
iconClassName={actionClassName}
|
|
68
68
|
textClassName={actionClassName}
|
|
69
69
|
{...{ size, tag, color, weight, font, transform, decoration, letterSpacing, alignment }}
|
|
70
70
|
>
|
|
71
|
-
<UniformText
|
|
71
|
+
<UniformText
|
|
72
|
+
placeholder="Text goes here"
|
|
73
|
+
parameter={parameters.text as ComponentParameter<string>}
|
|
74
|
+
component={component}
|
|
75
|
+
/>
|
|
72
76
|
</BaseIconLabel>
|
|
73
77
|
{caretUrl && (
|
|
74
78
|
<div
|
|
@@ -99,3 +103,5 @@ export const NavigationFlyout: FC<NavigationFlyoutProps> = ({
|
|
|
99
103
|
</div>
|
|
100
104
|
);
|
|
101
105
|
};
|
|
106
|
+
|
|
107
|
+
export default withFlattenParameters(NavigationFlyoutClient);
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { UniformSlot } from '@uniformdev/
|
|
2
|
+
import { UniformSlot } from '@uniformdev/next-app-router/component';
|
|
3
3
|
import { cn, resolveViewPort } from '@/utils/styling';
|
|
4
|
-
import { NavigationGroupProps } from '.';
|
|
4
|
+
import { NavigationGroupParameters, NavigationGroupProps } from '.';
|
|
5
5
|
|
|
6
|
-
type NavigationGroupDesktopContentProps = Pick<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
isOpen: boolean;
|
|
11
|
-
};
|
|
6
|
+
type NavigationGroupDesktopContentProps = Pick<NavigationGroupProps, 'context' | 'slots'> &
|
|
7
|
+
Pick<NavigationGroupParameters, 'backgroundColor' | 'border'> & {
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
};
|
|
12
10
|
|
|
13
11
|
export const NavigationGroupDesktopContent: FC<NavigationGroupDesktopContentProps> = ({
|
|
14
12
|
isOpen,
|
|
15
13
|
backgroundColor,
|
|
16
|
-
context,
|
|
17
14
|
slots,
|
|
18
15
|
border,
|
|
19
16
|
}) => (
|
|
@@ -30,7 +27,7 @@ export const NavigationGroupDesktopContent: FC<NavigationGroupDesktopContentProp
|
|
|
30
27
|
})}
|
|
31
28
|
>
|
|
32
29
|
<div className="flex flex-col gap-y-4 p-4">
|
|
33
|
-
<UniformSlot
|
|
30
|
+
<UniformSlot slot={slots.links} />
|
|
34
31
|
</div>
|
|
35
32
|
</div>
|
|
36
33
|
</div>
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import dynamic from 'next/dynamic';
|
|
2
2
|
import { AssetParamValue } from '@uniformdev/assets';
|
|
3
3
|
import { LinkParamValue } from '@uniformdev/canvas';
|
|
4
|
-
import { ComponentProps } from '@uniformdev/canvas-next-rsc/component';
|
|
5
4
|
import { TextParameters } from '@/components/canvas/Text/parameters';
|
|
6
|
-
import
|
|
5
|
+
import BaseImage from '@/components/ui/Image';
|
|
6
|
+
import InlineSVG from '@/components/ui/InlineSVG';
|
|
7
|
+
import { ComponentProps, ViewPort } from '@/types/cskTypes';
|
|
8
|
+
import { resolveAsset } from '@/utils/assets';
|
|
9
|
+
|
|
10
|
+
const NavigationGroupClient = dynamic(() => import('./navigation-group-client').then(mod => mod.default));
|
|
7
11
|
|
|
8
12
|
export type NavigationGroupParameters = TextParameters & {
|
|
9
13
|
icon?: AssetParamValue;
|
|
@@ -21,5 +25,18 @@ export enum NavigationGroupSlots {
|
|
|
21
25
|
|
|
22
26
|
export type NavigationGroupProps = ComponentProps<NavigationGroupParameters, NavigationGroupSlots>;
|
|
23
27
|
|
|
24
|
-
|
|
28
|
+
const NavigationGroup = (props: NavigationGroupProps) => {
|
|
29
|
+
const [resolvedImage] = resolveAsset(props.parameters.icon?.value);
|
|
30
|
+
const { url, title = '' } = resolvedImage || {};
|
|
31
|
+
|
|
32
|
+
const renderUrl = () => {
|
|
33
|
+
if (!url) return null;
|
|
34
|
+
|
|
35
|
+
return url.endsWith('.svg') ? <InlineSVG src={url} alt={title} fill /> : <BaseImage src={url} alt={title} fill />;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return <NavigationGroupClient icon={renderUrl()} {...props} />;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default NavigationGroup;
|
|
25
42
|
export { NavigationGroupEmptyPlaceholder } from './empty-placeholder';
|