@uniformdev/csk-components 6.1.57 → 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-7GVG4HLE.mjs +1 -0
- package/dist/chunk-AOFJCDRO.mjs +1 -0
- package/dist/chunk-AWTML4I7.mjs +1 -0
- 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-WAW7PQYM.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 -664
- package/dist/components/canvas/index.mjs +1 -2
- 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 +81 -54
- package/dist/components/ui/index.mjs +1 -1
- package/dist/content/components/canvas/Accordion/accordion.tsx +12 -17
- package/dist/content/components/canvas/Accordion/index.tsx +2 -2
- package/dist/content/components/canvas/AccordionItem/accordion-item.tsx +28 -39
- 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 +4 -7
- package/dist/content/components/canvas/Card/card.tsx +10 -12
- package/dist/content/components/canvas/Card/index.tsx +3 -3
- package/dist/content/components/canvas/Carousel/carousel.tsx +10 -10
- package/dist/content/components/canvas/Carousel/index.tsx +4 -4
- package/dist/content/components/canvas/Container/container.tsx +7 -10
- package/dist/content/components/canvas/Container/index.tsx +3 -3
- package/dist/content/components/canvas/Container/parameters.ts +0 -4
- 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 +59 -35
- package/dist/content/components/canvas/DemoHero/columns-variant.tsx +5 -11
- package/dist/content/components/canvas/DemoHero/default-variant.tsx +5 -12
- package/dist/content/components/canvas/DemoHero/demo-hero.tsx +43 -22
- package/dist/content/components/canvas/DemoHero/fixed-hero.tsx +63 -65
- package/dist/content/components/canvas/DemoHero/flexible-hero.tsx +8 -2
- package/dist/content/components/canvas/DemoHero/index.tsx +6 -18
- package/dist/content/components/canvas/DemoHero/utils.ts +14 -0
- 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 +11 -10
- 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 -9
- 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 +25 -8
- 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 +21 -36
- 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 +16 -74
- 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 +3 -5
- 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 +3 -5
- 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 +5 -11
- package/dist/content/components/canvas/Section/default-variant.tsx +7 -16
- 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 -16
- 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 +9 -13
- 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 +45 -48
- package/dist/content/components/canvas/Testimonial/default-variant.tsx +9 -11
- package/dist/content/components/canvas/Testimonial/index.tsx +2 -2
- package/dist/content/components/canvas/Testimonial/testimonial.tsx +11 -17
- package/dist/content/components/canvas/Testimonial/with-large-avatar-variant.tsx +9 -11
- package/dist/content/components/canvas/Testimonial/with-overlapping-image-variant.tsx +9 -11
- 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 -5
- package/dist/content/components/canvas/Video/placeholder.tsx +1 -1
- package/dist/content/components/canvas/Video/video.tsx +9 -7
- package/dist/content/components/ui/Accordion/accordion.tsx +23 -0
- package/dist/content/components/ui/Accordion/index.tsx +9 -0
- package/dist/content/components/ui/AccordionItem/accordion-item.tsx +41 -0
- package/dist/content/components/ui/AccordionItem/index.tsx +16 -0
- 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/Button/index.ts +2 -5
- package/dist/content/components/ui/Carousel/carousel.tsx +2 -2
- package/dist/content/components/ui/Carousel/index.ts +3 -3
- 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/Container/container.tsx +2 -7
- package/dist/content/components/ui/Container/index.ts +0 -6
- package/dist/content/components/ui/Flex/flex.tsx +21 -27
- package/dist/content/components/ui/Flex/index.ts +3 -5
- package/dist/content/components/ui/FlexItem/index.ts +1 -1
- package/dist/content/components/ui/Footer/index.ts +5 -4
- package/dist/content/components/ui/Grid/grid.tsx +21 -25
- package/dist/content/components/ui/Grid/index.ts +6 -15
- package/dist/content/components/ui/GridItem/grid-item.tsx +10 -1
- package/dist/content/components/ui/GridItem/index.ts +6 -9
- package/dist/content/components/ui/Header/index.ts +1 -1
- 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 +15 -0
- package/dist/content/components/ui/InlineSVG/inline-svg.tsx +70 -0
- package/dist/content/components/ui/InlineSVG/utils.ts +132 -0
- package/dist/content/components/ui/Modal/index.tsx +22 -0
- package/dist/content/components/ui/Modal/modal.tsx +89 -0
- package/dist/content/components/{canvas → ui}/Modal/style-utils.ts +4 -4
- package/dist/content/components/ui/Rating/index.tsx +1 -1
- package/dist/content/components/ui/Rating/rating.tsx +1 -1
- package/dist/content/components/ui/Text/index.ts +3 -6
- 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-CSSWgmI5.d.mts +90 -0
- 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.d.mts +21 -0
- package/dist/utils/sitemap.mjs +1 -0
- 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 +47 -14
- package/dist/ThemeSwitcher-6Q7LCO4Q.mjs +0 -1
- package/dist/accordion-item-G5CNMERW.mjs +0 -1
- package/dist/banner-2B4K5R4N.mjs +0 -1
- package/dist/carousel-BBEW5P4Y.mjs +0 -1
- package/dist/carousel-ERCHOWUS.mjs +0 -1
- package/dist/chunk-2SEOCBRK.mjs +0 -1
- package/dist/chunk-2UV7TQNF.mjs +0 -1
- package/dist/chunk-2YTACEBA.mjs +0 -1
- package/dist/chunk-3PDY7RJC.mjs +0 -7
- package/dist/chunk-4LWAGTFW.mjs +0 -1
- package/dist/chunk-56OQGKRM.mjs +0 -1
- package/dist/chunk-5VM2Y55L.mjs +0 -1
- package/dist/chunk-AKRWCDDG.mjs +0 -1
- package/dist/chunk-FPOIJMYT.mjs +0 -1
- package/dist/chunk-LA36HQWS.mjs +0 -1
- package/dist/chunk-M3BGP5VE.mjs +0 -1
- package/dist/chunk-MSXDLSXH.mjs +0 -1
- package/dist/chunk-QHIWJPL6.mjs +0 -1
- package/dist/chunk-RX4IAAQQ.mjs +0 -1
- package/dist/chunk-TIRCISSU.mjs +0 -1
- package/dist/chunk-TM7Q5NMH.mjs +0 -1
- package/dist/chunk-YEKQJ4YC.mjs +0 -1
- package/dist/chunk-YUCUJWBO.mjs +0 -1
- package/dist/chunk-Z7JSWSPD.mjs +0 -1
- package/dist/content/components/canvas/Banner/types.ts +0 -21
- package/dist/content/components/canvas/Image/placeholder.tsx +0 -20
- package/dist/content/components/ui/Container/utils.ts +0 -18
- package/dist/countdown-LYDXJLEE.mjs +0 -1
- package/dist/image-gallery-F6JLG7XW.mjs +0 -1
- package/dist/index-B9eeSbLG.d.mts +0 -71
- package/dist/mobile-UAUHHXPH.mjs +0 -1
- package/dist/modal-HKMQGV4B.mjs +0 -1
- package/dist/navigation-flyout-MXIJA6PC.mjs +0 -1
- package/dist/navigation-group-DEN3D2BO.mjs +0 -1
- package/dist/tabs-AQFKYC6M.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}/AccordionItem/icon-arrow-down.tsx +0 -0
- /package/dist/content/components/{canvas → ui}/AccordionItem/icon-arrow-up.tsx +0 -0
- /package/dist/content/components/{canvas → ui}/Banner/close-button.tsx +0 -0
- /package/dist/content/components/{canvas → ui}/Modal/close-icon.tsx +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentProps } from '
|
|
1
|
+
import { ComponentProps } from '@/types/cskTypes';
|
|
2
2
|
|
|
3
3
|
export type DividerParameters = {
|
|
4
4
|
color?: string;
|
|
@@ -9,4 +9,4 @@ export type DividerParameters = {
|
|
|
9
9
|
|
|
10
10
|
export type DividerProps = ComponentProps<DividerParameters>;
|
|
11
11
|
|
|
12
|
-
export {
|
|
12
|
+
export { default } from './divider';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { UniformSlot } from '@uniformdev/
|
|
2
|
+
import { UniformSlot } from '@uniformdev/next-app-router/component';
|
|
3
3
|
import BaseFlex from '@/components/ui/Flex';
|
|
4
|
-
import {
|
|
4
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
5
|
+
import { FlexProps, FlexParameters } from '.';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
const Flex: FC<FlexProps & FlexParameters> = ({
|
|
7
8
|
direction,
|
|
8
9
|
justifyContent,
|
|
9
10
|
gap,
|
|
@@ -12,13 +13,11 @@ export const Flex: FC<FlexProps> = ({
|
|
|
12
13
|
spacing,
|
|
13
14
|
border,
|
|
14
15
|
fluidContent,
|
|
15
|
-
fullHeight,
|
|
16
16
|
slots,
|
|
17
|
-
component,
|
|
18
|
-
context,
|
|
19
17
|
className,
|
|
20
|
-
|
|
18
|
+
height,
|
|
21
19
|
wrapperClassName,
|
|
20
|
+
wrap,
|
|
22
21
|
}) => (
|
|
23
22
|
<BaseFlex
|
|
24
23
|
{...{
|
|
@@ -30,12 +29,14 @@ export const Flex: FC<FlexProps> = ({
|
|
|
30
29
|
spacing,
|
|
31
30
|
border,
|
|
32
31
|
fluidContent,
|
|
33
|
-
|
|
34
|
-
fitHeight,
|
|
32
|
+
height,
|
|
35
33
|
wrapperClassName,
|
|
36
34
|
className,
|
|
35
|
+
wrap,
|
|
37
36
|
}}
|
|
38
37
|
>
|
|
39
|
-
<UniformSlot
|
|
38
|
+
<UniformSlot slot={slots.flexItem} />
|
|
40
39
|
</BaseFlex>
|
|
41
40
|
);
|
|
41
|
+
|
|
42
|
+
export default withFlattenParameters(Flex);
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { ComponentProps } from '@uniformdev/canvas-next-rsc/component';
|
|
2
1
|
import { ContainerParameters } from '@/components/canvas/Container/parameters';
|
|
3
|
-
import { ViewPort } from '@/types/cskTypes';
|
|
4
|
-
import { Flex } from './flex';
|
|
2
|
+
import { ViewPort, ComponentProps } from '@/types/cskTypes';
|
|
5
3
|
|
|
6
4
|
type Direction = 'row' | 'row-reverse' | 'col' | 'col-reverse';
|
|
7
5
|
type Justify = 'start' | 'end' | 'center' | 'between';
|
|
8
6
|
type AvailableGap = '2' | '8' | '16';
|
|
9
7
|
type Align = 'start' | 'end' | 'center' | 'stretch';
|
|
8
|
+
type Wrap = 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
10
9
|
|
|
11
10
|
export type FlexAdditionalProps = {
|
|
12
11
|
className?: string;
|
|
@@ -18,12 +17,13 @@ export type FlexParameters = ContainerParameters & {
|
|
|
18
17
|
justifyContent?: Justify | ViewPort<Justify>;
|
|
19
18
|
gap?: AvailableGap | ViewPort<AvailableGap>;
|
|
20
19
|
alignItems?: Align | ViewPort<Align>;
|
|
20
|
+
wrap?: Wrap | ViewPort<Wrap>;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
enum FlexSlots {
|
|
23
|
+
export enum FlexSlots {
|
|
24
24
|
FlexItem = 'flexItem',
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export type FlexProps = ComponentProps<FlexParameters & FlexAdditionalProps
|
|
27
|
+
export type FlexProps = ComponentProps<FlexParameters, FlexSlots> & FlexAdditionalProps;
|
|
28
28
|
|
|
29
|
-
export default
|
|
29
|
+
export { default } from './flex';
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { UniformSlot } from '@uniformdev/
|
|
2
|
+
import { UniformSlot } from '@uniformdev/next-app-router/component';
|
|
3
3
|
import BaseFlexItem from '@/components/ui/FlexItem';
|
|
4
|
-
import {
|
|
4
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
5
|
+
import { FlexItemProps, FlexItemParameters } from '.';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
const FlexItem: FC<FlexItemProps & FlexItemParameters> = ({ alignSelf, shrink, slots }) => (
|
|
7
8
|
<BaseFlexItem {...{ alignSelf, shrink }}>
|
|
8
|
-
<UniformSlot
|
|
9
|
+
<UniformSlot slot={slots.inner} />
|
|
9
10
|
</BaseFlexItem>
|
|
10
11
|
);
|
|
12
|
+
|
|
13
|
+
export default withFlattenParameters(FlexItem);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ComponentProps } from '
|
|
2
|
-
import { ViewPort } from '@/types/cskTypes';
|
|
1
|
+
import { ComponentProps, ViewPort } from '@/types/cskTypes';
|
|
3
2
|
|
|
4
3
|
type AvailableAlignSelf = 'auto' | 'start' | 'end' | 'center' | 'stretch';
|
|
5
4
|
type AvailableShrink = '0' | '1';
|
|
@@ -7,13 +6,13 @@ type AvailableShrink = '0' | '1';
|
|
|
7
6
|
export type FlexItemParameters = {
|
|
8
7
|
displayName?: string;
|
|
9
8
|
alignSelf?: AvailableAlignSelf | ViewPort<AvailableAlignSelf>;
|
|
10
|
-
shrink
|
|
9
|
+
shrink?: AvailableShrink;
|
|
11
10
|
};
|
|
12
11
|
|
|
13
|
-
enum FlexItemSlots {
|
|
12
|
+
export enum FlexItemSlots {
|
|
14
13
|
Inner = 'inner',
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
export type FlexItemProps = ComponentProps<FlexItemParameters, FlexItemSlots>;
|
|
18
17
|
|
|
19
|
-
export {
|
|
18
|
+
export { default } from './flex-item';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { UniformSlot } from '@uniformdev/
|
|
2
|
+
import { UniformSlot } from '@uniformdev/next-app-router/component';
|
|
3
3
|
import BaseFooter from '@/components/ui/Footer';
|
|
4
|
-
import {
|
|
4
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
5
|
+
import { FooterParameters, FooterProps } from '.';
|
|
5
6
|
|
|
6
|
-
export const Footer: FC<FooterProps> = ({
|
|
7
|
-
context,
|
|
8
|
-
component,
|
|
7
|
+
export const Footer: FC<FooterProps & FooterParameters> = ({
|
|
9
8
|
slots,
|
|
10
9
|
backgroundColor,
|
|
11
10
|
spacing,
|
|
@@ -13,9 +12,11 @@ export const Footer: FC<FooterProps> = ({
|
|
|
13
12
|
fluidContent,
|
|
14
13
|
}) => (
|
|
15
14
|
<BaseFooter
|
|
16
|
-
logo={<UniformSlot
|
|
17
|
-
copyright={<UniformSlot
|
|
18
|
-
content={<UniformSlot
|
|
15
|
+
logo={<UniformSlot slot={slots.footerLogo} />}
|
|
16
|
+
copyright={<UniformSlot slot={slots.footerCopyright} />}
|
|
17
|
+
content={<UniformSlot slot={slots.footerContent} />}
|
|
19
18
|
{...{ backgroundColor, spacing, border, fluidContent }}
|
|
20
19
|
/>
|
|
21
20
|
);
|
|
21
|
+
|
|
22
|
+
export default withFlattenParameters(Footer);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ComponentProps } from '@uniformdev/canvas-next-rsc/component';
|
|
2
1
|
import { FooterProps as BaseFooterProps } from '@/components/ui/Footer';
|
|
3
|
-
import {
|
|
2
|
+
import { ComponentProps } from '@/types/cskTypes';
|
|
4
3
|
|
|
5
4
|
export type FooterParameters = BaseFooterProps;
|
|
6
5
|
|
|
@@ -12,5 +11,5 @@ export enum FooterSlots {
|
|
|
12
11
|
|
|
13
12
|
export type FooterProps = ComponentProps<FooterParameters, FooterSlots>;
|
|
14
13
|
|
|
15
|
-
export default
|
|
14
|
+
export { default } from './footer';
|
|
16
15
|
export { FooterEmptyPlaceholder } from './empty-placeholder';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { UniformSlot } from '@uniformdev/
|
|
2
|
+
import { UniformSlot } from '@uniformdev/next-app-router/component';
|
|
3
3
|
import BaseGrid from '@/components/ui/Grid';
|
|
4
|
-
import {
|
|
4
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
5
|
+
import { GridParameters, GridProps } from '.';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
const Grid: FC<GridProps & GridParameters> = ({
|
|
7
8
|
columnsCount,
|
|
8
9
|
gapX,
|
|
9
10
|
gapY,
|
|
@@ -11,18 +12,17 @@ export const Grid: FC<GridProps> = ({
|
|
|
11
12
|
spacing,
|
|
12
13
|
border,
|
|
13
14
|
fluidContent,
|
|
14
|
-
fullHeight,
|
|
15
|
-
fitHeight,
|
|
16
15
|
height,
|
|
17
16
|
slots,
|
|
18
|
-
component,
|
|
19
|
-
context,
|
|
20
17
|
className,
|
|
18
|
+
alignItems,
|
|
21
19
|
}) => (
|
|
22
20
|
<BaseGrid
|
|
23
21
|
className={className}
|
|
24
|
-
{...{ columnsCount, gapX, gapY, backgroundColor, spacing, border, fluidContent,
|
|
22
|
+
{...{ columnsCount, gapX, gapY, backgroundColor, spacing, border, fluidContent, height, alignItems }}
|
|
25
23
|
>
|
|
26
|
-
<UniformSlot
|
|
24
|
+
<UniformSlot slot={slots.gridInner} />
|
|
27
25
|
</BaseGrid>
|
|
28
26
|
);
|
|
27
|
+
|
|
28
|
+
export default withFlattenParameters(Grid);
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { ComponentProps } from '@uniformdev/canvas-next-rsc/component';
|
|
2
1
|
import { ContainerParameters } from '@/components/canvas/Container/parameters';
|
|
3
|
-
import { ViewPort } from '@/types/cskTypes';
|
|
4
|
-
import { Grid } from './grid';
|
|
2
|
+
import { ComponentProps, ViewPort } from '@/types/cskTypes';
|
|
5
3
|
|
|
6
4
|
type AvailableGridColumnsCount = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12';
|
|
7
5
|
type AvailableGridGap = '2' | '8' | '16';
|
|
6
|
+
type Align = 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
8
7
|
|
|
9
8
|
export type GridAdditionalProps = {
|
|
10
9
|
className?: string;
|
|
@@ -14,12 +13,13 @@ export type GridParameters = ContainerParameters & {
|
|
|
14
13
|
columnsCount?: AvailableGridColumnsCount | ViewPort<AvailableGridColumnsCount>;
|
|
15
14
|
gapY?: AvailableGridGap | ViewPort<AvailableGridGap>;
|
|
16
15
|
gapX?: AvailableGridGap | ViewPort<AvailableGridGap>;
|
|
16
|
+
alignItems?: Align | ViewPort<Align>;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export enum GridSlots {
|
|
20
20
|
GridInner = 'gridInner',
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export type GridProps = ComponentProps<GridParameters & GridAdditionalProps
|
|
23
|
+
export type GridProps = ComponentProps<GridParameters, GridSlots> & GridAdditionalProps;
|
|
24
24
|
|
|
25
|
-
export default
|
|
25
|
+
export { default } from './grid';
|
|
@@ -1,19 +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 BaseGridItem from '@/components/ui/GridItem';
|
|
4
|
-
import {
|
|
4
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
5
|
+
import { GridItemParameters, GridItemProps } from '.';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
const GridItem: FC<GridItemProps & GridItemParameters> = ({
|
|
7
8
|
columnStart,
|
|
8
9
|
columnSpan,
|
|
9
10
|
rowStart,
|
|
10
|
-
className,
|
|
11
11
|
rowSpan,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
alignSelf,
|
|
13
|
+
className,
|
|
14
14
|
slots,
|
|
15
15
|
}) => (
|
|
16
|
-
<BaseGridItem {...{ columnStart, columnSpan, rowStart, rowSpan, className }}>
|
|
17
|
-
<UniformSlot
|
|
16
|
+
<BaseGridItem {...{ columnStart, columnSpan, rowStart, rowSpan, alignSelf, className }}>
|
|
17
|
+
<UniformSlot slot={slots.inner} />
|
|
18
18
|
</BaseGridItem>
|
|
19
19
|
);
|
|
20
|
+
|
|
21
|
+
export default withFlattenParameters(GridItem);
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { ComponentProps } from '
|
|
2
|
-
import { ViewPort } from '@/types/cskTypes';
|
|
3
|
-
import { GridItem } from './grid-item';
|
|
1
|
+
import { ComponentProps, ViewPort } from '@/types/cskTypes';
|
|
4
2
|
|
|
5
3
|
type AvailableGridItemColumnsCount = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12';
|
|
6
4
|
type AvailableGridItemSpan =
|
|
@@ -20,6 +18,7 @@ type AvailableGridItemSpan =
|
|
|
20
18
|
| 'span-full';
|
|
21
19
|
|
|
22
20
|
export type AvailableGridItemRowStart = '1' | '2' | '3' | '4' | '5' | '6';
|
|
21
|
+
type Align = 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
23
22
|
|
|
24
23
|
export type GridItemAdditionalProps = {
|
|
25
24
|
className?: string;
|
|
@@ -31,12 +30,13 @@ export type GridItemParameters = {
|
|
|
31
30
|
columnSpan?: AvailableGridItemSpan | ViewPort<AvailableGridItemSpan>;
|
|
32
31
|
rowStart?: AvailableGridItemRowStart | ViewPort<AvailableGridItemRowStart>;
|
|
33
32
|
rowSpan?: AvailableGridItemSpan | ViewPort<AvailableGridItemSpan>;
|
|
33
|
+
alignSelf?: Align | ViewPort<Align>;
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
export enum GridItemSlots {
|
|
37
37
|
Inner = 'inner',
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
export type GridItemProps = ComponentProps<GridItemParameters & GridItemAdditionalProps
|
|
40
|
+
export type GridItemProps = ComponentProps<GridItemParameters, GridItemSlots> & GridItemAdditionalProps;
|
|
41
41
|
|
|
42
|
-
export default
|
|
42
|
+
export { default } from './grid-item';
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { UniformSlot } from '@uniformdev/
|
|
2
|
+
import { UniformSlot } from '@uniformdev/next-app-router/component';
|
|
3
3
|
import BaseHeader from '@/components/ui/Header';
|
|
4
|
-
import {
|
|
4
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
5
|
+
import { HeaderParameters, HeaderProps, HeaderVariants } from '.';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
const Header: FC<HeaderProps & HeaderParameters> = ({ backgroundColor, color, spacing, border, slots, variant }) => (
|
|
7
8
|
<BaseHeader
|
|
8
|
-
sticky={
|
|
9
|
-
leftSection={<UniformSlot
|
|
10
|
-
rightSection={<UniformSlot
|
|
9
|
+
sticky={variant === HeaderVariants.Sticky}
|
|
10
|
+
leftSection={<UniformSlot slot={slots.headerLeftContent} />}
|
|
11
|
+
rightSection={<UniformSlot slot={slots.headerRightContent} />}
|
|
11
12
|
{...{ backgroundColor, color, spacing, border }}
|
|
12
13
|
>
|
|
13
|
-
<UniformSlot
|
|
14
|
+
<UniformSlot slot={slots.headerCenterContent} />
|
|
14
15
|
</BaseHeader>
|
|
15
16
|
);
|
|
17
|
+
|
|
18
|
+
export default withFlattenParameters(Header);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ComponentProps } from '@uniformdev/canvas-next-rsc/component';
|
|
2
1
|
import { HeaderProps as BaseHeaderProps } from '@/components/ui/Header';
|
|
3
|
-
import {
|
|
2
|
+
import { ComponentProps } from '@/types/cskTypes';
|
|
4
3
|
|
|
5
4
|
export type HeaderParameters = Omit<BaseHeaderProps, 'sticky'>;
|
|
6
5
|
|
|
@@ -16,5 +15,5 @@ export enum HeaderVariants {
|
|
|
16
15
|
|
|
17
16
|
export type HeaderProps = ComponentProps<HeaderParameters, HeaderSlots>;
|
|
18
17
|
|
|
19
|
-
export default
|
|
18
|
+
export { default } from './header';
|
|
20
19
|
export { HeaderEmptyPlaceholder } from './empty-placeholder';
|
|
@@ -1,11 +1,12 @@
|
|
|
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
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { ReplaceFieldsWithAssets } from '@/types/cskTypes';
|
|
6
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
7
|
+
import { IconLabelParameters, IconLabelProps } from '.';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
const IconLabel: FC<IconLabelProps & ReplaceFieldsWithAssets<IconLabelParameters, 'icon'>> = ({
|
|
9
10
|
icon,
|
|
10
11
|
size,
|
|
11
12
|
tag,
|
|
@@ -16,18 +17,25 @@ export const IconLabel: FC<IconLabelProps> = ({
|
|
|
16
17
|
decoration,
|
|
17
18
|
letterSpacing,
|
|
18
19
|
alignment,
|
|
20
|
+
parameters,
|
|
19
21
|
component,
|
|
20
|
-
|
|
22
|
+
iconPosition,
|
|
21
23
|
}) => {
|
|
22
|
-
const [resolvedImage] =
|
|
24
|
+
const [resolvedImage] = icon || [];
|
|
23
25
|
const { url, title = '' } = resolvedImage || {};
|
|
24
26
|
|
|
25
27
|
return (
|
|
26
28
|
<BaseIconLabel
|
|
27
29
|
icon={url ? <BaseImage src={url} alt={title} fill /> : undefined}
|
|
28
|
-
{...{ size, tag, color, weight, font, transform, decoration, letterSpacing, alignment }}
|
|
30
|
+
{...{ size, tag, color, weight, font, transform, decoration, letterSpacing, alignment, iconPosition }}
|
|
29
31
|
>
|
|
30
|
-
<UniformText
|
|
32
|
+
<UniformText
|
|
33
|
+
placeholder="Text goes here"
|
|
34
|
+
parameter={parameters.text as ComponentParameter<string>}
|
|
35
|
+
component={component}
|
|
36
|
+
/>
|
|
31
37
|
</BaseIconLabel>
|
|
32
38
|
);
|
|
33
39
|
};
|
|
40
|
+
|
|
41
|
+
export default withFlattenParameters(IconLabel);
|
|
@@ -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';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { imageFrom } from '@uniformdev/assets';
|
|
3
3
|
import BaseImage from '@/components/ui/Image';
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import MediaPlaceholder from '@/components/ui/MediaPlaceholder';
|
|
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,21 @@ 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
|
-
|
|
26
|
+
const isEditorPreviewMode = context.isContextualEditing;
|
|
27
|
+
const isPlaceholder = component?._id?.includes('placeholder_');
|
|
28
|
+
|
|
29
|
+
if (!isEditorPreviewMode || isPlaceholder) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<div style={{ width: width ? `${width}px` : 'auto', height: height ? `${height}px` : 'auto' }}>
|
|
35
|
+
<MediaPlaceholder type="image" placeholder="Please add an asset to display an image" />
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
26
38
|
}
|
|
27
39
|
|
|
28
40
|
const { focalPoint, title = '' } = resolvedImage;
|
|
@@ -33,7 +45,7 @@ export const Image: FC<ImageProps> = async ({
|
|
|
33
45
|
if (!fill && (!imageWidth || !imageHeight)) {
|
|
34
46
|
console.warn(
|
|
35
47
|
'No dimensions provided for the Next.js Image component. Falling back to a standard <img> tag for rendering.'
|
|
36
|
-
);
|
|
48
|
+
); // eslint-disable-next-line @next/next/no-img-element
|
|
37
49
|
return <img src={resolvedImage.url} alt={title} />;
|
|
38
50
|
}
|
|
39
51
|
|
|
@@ -60,7 +72,10 @@ export const Image: FC<ImageProps> = async ({
|
|
|
60
72
|
unoptimized={unoptimized}
|
|
61
73
|
priority={priority}
|
|
62
74
|
sizes="100%"
|
|
63
|
-
style={{
|
|
75
|
+
style={{
|
|
76
|
+
objectFit,
|
|
77
|
+
objectPosition: focalPoint && !width && !height ? `${focalPoint.x * 100}% ${focalPoint.y * 100}%` : undefined,
|
|
78
|
+
}}
|
|
64
79
|
overlayColor={overlayColor}
|
|
65
80
|
overlayOpacity={overlayOpacity}
|
|
66
81
|
border={border}
|
|
@@ -68,3 +83,5 @@ export const Image: FC<ImageProps> = async ({
|
|
|
68
83
|
/>
|
|
69
84
|
);
|
|
70
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,58 +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
|
-
fullHeight,
|
|
20
|
-
fitHeight,
|
|
21
17
|
height,
|
|
18
|
+
aspectRatio,
|
|
22
19
|
config,
|
|
23
|
-
|
|
24
|
-
component,
|
|
20
|
+
items,
|
|
25
21
|
}) => {
|
|
26
|
-
const slotsToRender =
|
|
27
|
-
|
|
28
|
-
:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
fill
|
|
38
|
-
/>
|
|
39
|
-
)) || [],
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const showEmptySlot =
|
|
43
|
-
!items?.length &&
|
|
44
|
-
!(component?.slots?.imageGalleryItems as { _id?: string }[])?.filter(({ _id }) => !_id?.startsWith('placeholder'))
|
|
45
|
-
?.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
|
+
};
|
|
46
33
|
|
|
47
34
|
return (
|
|
48
|
-
<Container {...{ backgroundColor, spacing, border, fluidContent,
|
|
35
|
+
<Container {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
49
36
|
<div className="flex flex-col gap-1">
|
|
50
|
-
{
|
|
51
|
-
<UniformSlot context={context} slot={slots.imageGalleryItems} data={component} />
|
|
52
|
-
) : (
|
|
53
|
-
<GalleryInner slot={slotsToRender} aspectRatio={aspectRatio} config={config} />
|
|
54
|
-
)}
|
|
37
|
+
<GalleryInner slot={slotsToRender} aspectRatio={aspectRatio} config={config} />
|
|
55
38
|
</div>
|
|
56
39
|
</Container>
|
|
57
40
|
);
|
|
58
41
|
};
|
|
42
|
+
|
|
43
|
+
export default withFlattenParameters(ImageGallery);
|