@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,61 +1,54 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { imageFrom } from '@uniformdev/assets';
|
|
3
|
+
|
|
4
|
+
import { ComponentContext, ComponentParameter, UniformText } from '@uniformdev/next-app-router/component';
|
|
4
5
|
import { TextParameters } from '@/components/canvas/Text/parameters';
|
|
5
6
|
import BaseButton, { ButtonVariant } from '@/components/ui/Button';
|
|
6
7
|
import BaseImage from '@/components/ui/Image';
|
|
7
8
|
import MediaPlaceholder from '@/components/ui/MediaPlaceholder';
|
|
8
9
|
import BaseText from '@/components/ui/Text';
|
|
9
|
-
import {
|
|
10
|
+
import { ReplaceFieldsWithAssets } from '@/types/cskTypes';
|
|
10
11
|
import { formatUniformLink } from '@/utils/routing';
|
|
11
12
|
import { BaseButtonParameters, BaseImageParameters } from '.';
|
|
12
13
|
|
|
13
14
|
type ComponentProps = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
isEditorPreviewMode?: boolean;
|
|
16
|
+
component: Pick<ComponentContext, '_id'>;
|
|
17
|
+
parameter?: ComponentParameter<string | undefined>;
|
|
18
|
+
variant?: string;
|
|
17
19
|
};
|
|
18
20
|
|
|
19
|
-
export const BaseHeroText: FC<TextParameters & ComponentProps
|
|
21
|
+
export const BaseHeroText: FC<TextParameters & Omit<ComponentProps, 'variant'>> = ({
|
|
20
22
|
component,
|
|
21
|
-
|
|
22
|
-
parameterId,
|
|
23
|
+
parameter,
|
|
23
24
|
text,
|
|
25
|
+
isEditorPreviewMode,
|
|
24
26
|
...props
|
|
25
27
|
}) => {
|
|
26
|
-
const isEditorPreviewMode = context.previewMode === 'editor' && context.isContextualEditing;
|
|
27
|
-
|
|
28
28
|
if (!text && !isEditorPreviewMode) return null;
|
|
29
29
|
|
|
30
30
|
return (
|
|
31
31
|
<BaseText {...props}>
|
|
32
32
|
<UniformText
|
|
33
33
|
placeholder="Text goes here"
|
|
34
|
-
|
|
34
|
+
parameter={parameter as ComponentParameter<string>}
|
|
35
35
|
as={props.tag || undefined}
|
|
36
36
|
component={component}
|
|
37
|
-
context={context}
|
|
38
37
|
/>
|
|
39
38
|
</BaseText>
|
|
40
39
|
);
|
|
41
40
|
};
|
|
42
41
|
|
|
43
|
-
export const BaseHeroButton: FC<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
parameterId,
|
|
47
|
-
text,
|
|
48
|
-
...props
|
|
49
|
-
}) => {
|
|
42
|
+
export const BaseHeroButton: FC<
|
|
43
|
+
ReplaceFieldsWithAssets<BaseButtonParameters, 'icon'> & { variant?: ButtonVariant } & Omit<ComponentProps, 'variant'>
|
|
44
|
+
> = ({ component, parameter, isEditorPreviewMode, text, ...props }) => {
|
|
50
45
|
const { link, icon } = props;
|
|
51
46
|
const href = formatUniformLink(link);
|
|
52
47
|
|
|
53
|
-
const isEditorPreviewMode = context.previewMode === 'editor' && context.isContextualEditing;
|
|
54
|
-
|
|
55
48
|
if (!text && !href && !isEditorPreviewMode) return null;
|
|
56
49
|
|
|
57
50
|
const Icon = () => {
|
|
58
|
-
const [resolvedImage] =
|
|
51
|
+
const [resolvedImage] = icon || [];
|
|
59
52
|
const { url, title = '' } = resolvedImage || {};
|
|
60
53
|
return url ? (
|
|
61
54
|
<BaseImage
|
|
@@ -71,20 +64,22 @@ export const BaseHeroButton: FC<BaseButtonParameters & { variant?: ButtonVariant
|
|
|
71
64
|
) : undefined;
|
|
72
65
|
};
|
|
73
66
|
return (
|
|
67
|
+
// eslint-disable-next-line react-hooks/static-components
|
|
74
68
|
<BaseButton {...props} href={href} icon={<Icon />}>
|
|
75
69
|
<UniformText
|
|
76
70
|
placeholder="Button text goes here"
|
|
77
|
-
|
|
71
|
+
parameter={parameter as ComponentParameter<string>}
|
|
78
72
|
component={component}
|
|
79
|
-
context={context}
|
|
80
73
|
/>
|
|
81
74
|
</BaseButton>
|
|
82
75
|
);
|
|
83
76
|
};
|
|
84
77
|
|
|
85
|
-
export const BaseHeroImage: FC<
|
|
78
|
+
export const BaseHeroImage: FC<
|
|
79
|
+
ReplaceFieldsWithAssets<BaseImageParameters, 'image'> & Omit<ComponentProps, 'parameter'>
|
|
80
|
+
> = ({
|
|
86
81
|
component,
|
|
87
|
-
|
|
82
|
+
isEditorPreviewMode,
|
|
88
83
|
image,
|
|
89
84
|
objectFit,
|
|
90
85
|
width,
|
|
@@ -95,14 +90,15 @@ export const BaseHeroImage: FC<BaseImageParameters & Omit<ComponentProps, 'param
|
|
|
95
90
|
border,
|
|
96
91
|
priority,
|
|
97
92
|
unoptimized,
|
|
93
|
+
fill,
|
|
94
|
+
variant,
|
|
98
95
|
}) => {
|
|
99
|
-
const [resolvedImage] =
|
|
96
|
+
const [resolvedImage] = image || [];
|
|
100
97
|
|
|
101
98
|
if (!resolvedImage) {
|
|
102
|
-
const isEditorPreviewMode = context.previewMode === 'editor' && context.isContextualEditing;
|
|
103
99
|
const isPlaceholder = component?._id?.includes('placeholder_');
|
|
104
100
|
|
|
105
|
-
if (!isEditorPreviewMode || isPlaceholder || !
|
|
101
|
+
if (!isEditorPreviewMode || isPlaceholder || !variant) {
|
|
106
102
|
return null;
|
|
107
103
|
}
|
|
108
104
|
|
|
@@ -113,22 +109,50 @@ export const BaseHeroImage: FC<BaseImageParameters & Omit<ComponentProps, 'param
|
|
|
113
109
|
);
|
|
114
110
|
}
|
|
115
111
|
|
|
116
|
-
const {
|
|
112
|
+
const { focalPoint, title = '' } = resolvedImage;
|
|
113
|
+
|
|
114
|
+
const imageWidth = width || resolvedImage.width;
|
|
115
|
+
const imageHeight = height || resolvedImage.height;
|
|
116
|
+
|
|
117
|
+
if (!fill && (!imageWidth || !imageHeight)) {
|
|
118
|
+
console.warn(
|
|
119
|
+
'No dimensions provided for the Next.js Image component. Falling back to a standard <img> tag for rendering.'
|
|
120
|
+
); // eslint-disable-next-line @next/next/no-img-element
|
|
121
|
+
return <img src={resolvedImage.url} alt={title} />;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const imageUrl = imageFrom(resolvedImage?.url)
|
|
125
|
+
.transform({
|
|
126
|
+
width: width,
|
|
127
|
+
height: height,
|
|
128
|
+
fit: objectFit,
|
|
129
|
+
focal: focalPoint,
|
|
130
|
+
})
|
|
131
|
+
.url();
|
|
132
|
+
|
|
133
|
+
const variantBasedProps = fill
|
|
134
|
+
? { fill: true }
|
|
135
|
+
: {
|
|
136
|
+
width: imageWidth,
|
|
137
|
+
height: imageHeight,
|
|
138
|
+
};
|
|
117
139
|
|
|
118
140
|
return (
|
|
119
141
|
<BaseImage
|
|
120
|
-
|
|
121
|
-
src={url}
|
|
142
|
+
src={imageUrl}
|
|
122
143
|
alt={title}
|
|
123
|
-
fill
|
|
124
144
|
unoptimized={unoptimized}
|
|
125
145
|
priority={priority}
|
|
126
146
|
sizes="100%"
|
|
127
|
-
style={{
|
|
147
|
+
style={{
|
|
148
|
+
objectFit,
|
|
149
|
+
objectPosition: focalPoint && !width && !height ? `${focalPoint.x * 100}% ${focalPoint.y * 100}%` : undefined,
|
|
150
|
+
}}
|
|
128
151
|
overlayColor={overlayColor}
|
|
129
152
|
contrastBaseColor={contrastBaseColor}
|
|
130
153
|
overlayOpacity={overlayOpacity}
|
|
131
154
|
border={border}
|
|
155
|
+
{...variantBasedProps}
|
|
132
156
|
/>
|
|
133
157
|
);
|
|
134
158
|
};
|
|
@@ -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 { DemoHeroVariants, FlexibleHeroParameters } from '.';
|
|
@@ -8,15 +8,11 @@ type ColumnsVariantProps = {
|
|
|
8
8
|
spacing: FlexibleHeroParameters['spacing'];
|
|
9
9
|
border: FlexibleHeroParameters['border'];
|
|
10
10
|
fluidContent: FlexibleHeroParameters['fluidContent'];
|
|
11
|
-
/** @deprecated Use height prop instead */
|
|
12
|
-
fullHeight: FlexibleHeroParameters['fullHeight'];
|
|
13
|
-
/** @deprecated Use height prop instead */
|
|
14
|
-
fitHeight: FlexibleHeroParameters['fitHeight'];
|
|
15
11
|
height: FlexibleHeroParameters['height'];
|
|
16
12
|
variant?: DemoHeroVariants;
|
|
17
|
-
demoHeroMedia:
|
|
18
|
-
demoHeroContent:
|
|
19
|
-
demoHeroCTA:
|
|
13
|
+
demoHeroMedia: ReactNode;
|
|
14
|
+
demoHeroContent: ReactNode;
|
|
15
|
+
demoHeroCTA: ReactNode;
|
|
20
16
|
textAlignmentClass: string;
|
|
21
17
|
buttonAlignmentClass: string;
|
|
22
18
|
};
|
|
@@ -26,8 +22,6 @@ export const ColumnsVariant: FC<ColumnsVariantProps> = ({
|
|
|
26
22
|
spacing,
|
|
27
23
|
border,
|
|
28
24
|
fluidContent,
|
|
29
|
-
fullHeight,
|
|
30
|
-
fitHeight,
|
|
31
25
|
height,
|
|
32
26
|
variant,
|
|
33
27
|
demoHeroMedia,
|
|
@@ -36,7 +30,7 @@ export const ColumnsVariant: FC<ColumnsVariantProps> = ({
|
|
|
36
30
|
textAlignmentClass,
|
|
37
31
|
buttonAlignmentClass,
|
|
38
32
|
}) => (
|
|
39
|
-
<Container {...{ backgroundColor, spacing, border, fluidContent,
|
|
33
|
+
<Container {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
40
34
|
<div className={cn('grid grid-cols-1 items-center gap-4 px-4 lg:grid-cols-2 xl:px-0')}>
|
|
41
35
|
<div className={cn('aspect-square', { 'order-last': variant === DemoHeroVariants.ColumnsReverse })}>
|
|
42
36
|
<div className="flex size-full items-center justify-center overflow-hidden">{demoHeroMedia}</div>
|
|
@@ -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 { FlexibleHeroParameters } from '.';
|
|
@@ -8,12 +8,10 @@ type DefaultVariantProps = {
|
|
|
8
8
|
spacing: FlexibleHeroParameters['spacing'];
|
|
9
9
|
border: FlexibleHeroParameters['border'];
|
|
10
10
|
fluidContent: FlexibleHeroParameters['fluidContent'];
|
|
11
|
-
fullHeight: FlexibleHeroParameters['fullHeight'];
|
|
12
|
-
fitHeight: FlexibleHeroParameters['fitHeight'];
|
|
13
11
|
height: FlexibleHeroParameters['height'];
|
|
14
|
-
demoHeroMedia:
|
|
15
|
-
demoHeroContent:
|
|
16
|
-
demoHeroCTA:
|
|
12
|
+
demoHeroMedia: ReactNode;
|
|
13
|
+
demoHeroContent: ReactNode;
|
|
14
|
+
demoHeroCTA: ReactNode;
|
|
17
15
|
textAlignmentClass: string;
|
|
18
16
|
buttonAlignmentClass: string;
|
|
19
17
|
};
|
|
@@ -23,8 +21,6 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
|
|
|
23
21
|
spacing,
|
|
24
22
|
border,
|
|
25
23
|
fluidContent,
|
|
26
|
-
fullHeight,
|
|
27
|
-
fitHeight,
|
|
28
24
|
height,
|
|
29
25
|
demoHeroMedia,
|
|
30
26
|
demoHeroContent,
|
|
@@ -32,10 +28,7 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
|
|
|
32
28
|
textAlignmentClass,
|
|
33
29
|
buttonAlignmentClass,
|
|
34
30
|
}) => (
|
|
35
|
-
<Container
|
|
36
|
-
className="relative overflow-hidden"
|
|
37
|
-
{...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
|
|
38
|
-
>
|
|
31
|
+
<Container className="relative overflow-hidden" {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
39
32
|
<div className="absolute left-0 top-0 size-full overflow-hidden">{demoHeroMedia}</div>
|
|
40
33
|
<Container className="relative flex flex-col gap-8">
|
|
41
34
|
<div className={cn('flex flex-col gap-4', textAlignmentClass)}>{demoHeroContent}</div>
|
|
@@ -1,13 +1,34 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { UniformSlot } from '@uniformdev/
|
|
3
|
-
import {
|
|
2
|
+
import { UniformSlot } from '@uniformdev/next-app-router/component';
|
|
3
|
+
import { SlotDefinition } from '@uniformdev/next-app-router-shared';
|
|
4
|
+
import { ReplaceFieldsWithAssets } from '@/types/cskTypes';
|
|
5
|
+
import {
|
|
6
|
+
DemoHeroVariants,
|
|
7
|
+
FixedHeroParameters,
|
|
8
|
+
FixedHeroProps,
|
|
9
|
+
FlexibleHeroParameters,
|
|
10
|
+
FlexibleHeroProps,
|
|
11
|
+
FlexibleHeroSlots,
|
|
12
|
+
} from '.';
|
|
4
13
|
import { BaseHeroButton, BaseHeroImage, BaseHeroText } from './atoms';
|
|
5
14
|
import { ColumnsVariant } from './columns-variant';
|
|
6
15
|
import { DefaultVariant } from './default-variant';
|
|
7
16
|
import { getButtonAlignmentClass, getTextAlignmentClass } from './style-utils';
|
|
8
17
|
import { cleanUpPrefix } from './utils';
|
|
9
18
|
|
|
10
|
-
|
|
19
|
+
type FixedHeroComponentProps = {
|
|
20
|
+
isFlexibleHero?: false;
|
|
21
|
+
slots: Record<never, SlotDefinition>;
|
|
22
|
+
} & FixedHeroProps &
|
|
23
|
+
ReplaceFieldsWithAssets<FixedHeroParameters, 'image' | 'primaryButtonIcon'>;
|
|
24
|
+
|
|
25
|
+
type FlexibleHeroComponentProps = {
|
|
26
|
+
isFlexibleHero: true;
|
|
27
|
+
slots: Record<FlexibleHeroSlots, SlotDefinition>;
|
|
28
|
+
} & FlexibleHeroProps &
|
|
29
|
+
ReplaceFieldsWithAssets<FlexibleHeroParameters, 'image' | 'primaryButtonIcon'>;
|
|
30
|
+
|
|
31
|
+
export const DemoHero: FC<FixedHeroComponentProps | FlexibleHeroComponentProps> = ({
|
|
11
32
|
// Eyebrow Text Parameters
|
|
12
33
|
eyebrowTitleText,
|
|
13
34
|
eyebrowTitleTag,
|
|
@@ -71,24 +92,25 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
|
|
|
71
92
|
imageBorder,
|
|
72
93
|
imagePriority,
|
|
73
94
|
imageUnoptimized,
|
|
95
|
+
imageFill,
|
|
74
96
|
// Presentation Parameters
|
|
75
97
|
contentAlignment,
|
|
76
98
|
backgroundColor,
|
|
77
99
|
spacing,
|
|
78
100
|
border,
|
|
79
101
|
fluidContent,
|
|
80
|
-
fullHeight,
|
|
81
|
-
fitHeight,
|
|
82
102
|
height,
|
|
83
|
-
isFlexibleHero
|
|
103
|
+
isFlexibleHero,
|
|
84
104
|
component,
|
|
85
105
|
context,
|
|
86
106
|
slots,
|
|
107
|
+
variant,
|
|
108
|
+
parameters,
|
|
87
109
|
}) => {
|
|
88
|
-
const
|
|
110
|
+
const isEditorPreviewMode = context.isContextualEditing;
|
|
89
111
|
|
|
90
112
|
const demoHeroContent = isFlexibleHero ? (
|
|
91
|
-
<UniformSlot
|
|
113
|
+
<UniformSlot slot={slots.flexibleHeroContent} />
|
|
92
114
|
) : (
|
|
93
115
|
<>
|
|
94
116
|
<BaseHeroText
|
|
@@ -108,9 +130,9 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
|
|
|
108
130
|
},
|
|
109
131
|
'eyebrowTitle'
|
|
110
132
|
)}
|
|
133
|
+
isEditorPreviewMode={isEditorPreviewMode}
|
|
111
134
|
component={component}
|
|
112
|
-
|
|
113
|
-
parameterId="eyebrowTitleText"
|
|
135
|
+
parameter={parameters.eyebrowTitleText}
|
|
114
136
|
/>
|
|
115
137
|
<BaseHeroText
|
|
116
138
|
{...cleanUpPrefix(
|
|
@@ -129,9 +151,9 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
|
|
|
129
151
|
},
|
|
130
152
|
'title'
|
|
131
153
|
)}
|
|
154
|
+
isEditorPreviewMode={isEditorPreviewMode}
|
|
132
155
|
component={component}
|
|
133
|
-
|
|
134
|
-
parameterId="titleText"
|
|
156
|
+
parameter={parameters.titleText}
|
|
135
157
|
/>
|
|
136
158
|
<BaseHeroText
|
|
137
159
|
{...cleanUpPrefix(
|
|
@@ -150,15 +172,15 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
|
|
|
150
172
|
},
|
|
151
173
|
'description'
|
|
152
174
|
)}
|
|
175
|
+
isEditorPreviewMode={isEditorPreviewMode}
|
|
153
176
|
component={component}
|
|
154
|
-
|
|
155
|
-
parameterId="descriptionText"
|
|
177
|
+
parameter={parameters.descriptionText}
|
|
156
178
|
/>
|
|
157
179
|
</>
|
|
158
180
|
);
|
|
159
181
|
|
|
160
182
|
const demoHeroCTA = isFlexibleHero ? (
|
|
161
|
-
<UniformSlot
|
|
183
|
+
<UniformSlot slot={slots.flexibleHeroCta} />
|
|
162
184
|
) : (
|
|
163
185
|
<>
|
|
164
186
|
<BaseHeroButton
|
|
@@ -182,21 +204,18 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
|
|
|
182
204
|
},
|
|
183
205
|
'primaryButton'
|
|
184
206
|
)}
|
|
207
|
+
isEditorPreviewMode={isEditorPreviewMode}
|
|
185
208
|
component={component}
|
|
186
|
-
|
|
187
|
-
parameterId="primaryButtonText"
|
|
209
|
+
parameter={parameters.primaryButtonText}
|
|
188
210
|
/>
|
|
189
211
|
</>
|
|
190
212
|
);
|
|
191
213
|
|
|
192
214
|
const variantProps = {
|
|
193
|
-
variant,
|
|
194
215
|
backgroundColor,
|
|
195
216
|
spacing,
|
|
196
217
|
border,
|
|
197
218
|
fluidContent,
|
|
198
|
-
fullHeight,
|
|
199
|
-
fitHeight,
|
|
200
219
|
height,
|
|
201
220
|
textAlignmentClass: getTextAlignmentClass({ contentAlignment }),
|
|
202
221
|
buttonAlignmentClass: getButtonAlignmentClass({ contentAlignment }),
|
|
@@ -215,11 +234,13 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
|
|
|
215
234
|
imageBorder,
|
|
216
235
|
imagePriority,
|
|
217
236
|
imageUnoptimized,
|
|
237
|
+
imageFill,
|
|
218
238
|
},
|
|
219
239
|
'image'
|
|
220
240
|
)}
|
|
221
241
|
component={component}
|
|
222
|
-
|
|
242
|
+
isEditorPreviewMode={isEditorPreviewMode}
|
|
243
|
+
variant={variant}
|
|
223
244
|
/>
|
|
224
245
|
</>
|
|
225
246
|
),
|
|
@@ -230,7 +251,7 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
|
|
|
230
251
|
switch (variant) {
|
|
231
252
|
case DemoHeroVariants.Columns:
|
|
232
253
|
case DemoHeroVariants.ColumnsReverse:
|
|
233
|
-
return <ColumnsVariant {...variantProps} />;
|
|
254
|
+
return <ColumnsVariant variant={variant} {...variantProps} />;
|
|
234
255
|
default:
|
|
235
256
|
return <DefaultVariant {...variantProps} />;
|
|
236
257
|
}
|
|
@@ -1,69 +1,67 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ReplaceFieldsWithAssets } from '@/types/cskTypes';
|
|
3
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
4
|
+
import { FixedHeroParameters, FixedHeroProps } from '.';
|
|
3
5
|
import { DemoHero } from './demo-hero';
|
|
6
|
+
import { getImageParametersFocalPoint } from './utils';
|
|
4
7
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const FixedHero: FC<FixedHeroProps & ReplaceFieldsWithAssets<FixedHeroParameters, 'image' | 'primaryButtonIcon'>> = ({
|
|
9
|
+
textColor,
|
|
10
|
+
overlayAutoTint,
|
|
11
|
+
...props
|
|
12
|
+
}) => (
|
|
13
|
+
<DemoHero
|
|
14
|
+
{...props}
|
|
15
|
+
// Eyebrow Text Parameters
|
|
16
|
+
eyebrowTitleTag="span"
|
|
17
|
+
eyebrowTitleSize={{
|
|
18
|
+
mobile: 'xs',
|
|
19
|
+
tablet: 'lg',
|
|
20
|
+
desktop: 'xl',
|
|
21
|
+
}}
|
|
22
|
+
eyebrowTitleWeight="bold"
|
|
23
|
+
eyebrowTitleTransform="uppercase"
|
|
24
|
+
eyebrowTitleColor={textColor || props.eyebrowTitleColor}
|
|
25
|
+
// Title Text Parameters
|
|
26
|
+
titleSize={{
|
|
27
|
+
mobile: '3xl',
|
|
28
|
+
tablet: '4xl',
|
|
29
|
+
desktop: '4xl',
|
|
30
|
+
}}
|
|
31
|
+
titleWeight="bold"
|
|
32
|
+
titleColor={textColor || props.titleColor}
|
|
33
|
+
// Description Text Parameters
|
|
34
|
+
descriptionTag="p"
|
|
35
|
+
descriptionSize={{
|
|
36
|
+
mobile: 'sm',
|
|
37
|
+
tablet: 'lg',
|
|
38
|
+
desktop: 'xl',
|
|
39
|
+
}}
|
|
40
|
+
descriptionWeight="normal"
|
|
41
|
+
descriptionColor={textColor || props.descriptionColor}
|
|
42
|
+
// Primary Button Parameters
|
|
43
|
+
primaryButtonSize="button-medium"
|
|
44
|
+
primaryButtonTextSize="sm"
|
|
45
|
+
primaryButtonTextWeight="normal"
|
|
46
|
+
primaryButtonButtonColor="button-primary"
|
|
47
|
+
primaryButtonTextTransform="uppercase"
|
|
48
|
+
primaryButtonHoverButtonColor="button-primary-hover"
|
|
49
|
+
// Image Parameters
|
|
50
|
+
imagePriority
|
|
51
|
+
imageObjectFit="cover"
|
|
52
|
+
imageUnoptimized
|
|
53
|
+
imageContrastBaseColor={!props.variant && overlayAutoTint ? textColor : undefined}
|
|
54
|
+
imageOverlayOpacity={overlayAutoTint}
|
|
55
|
+
{...getImageParametersFocalPoint(!!props.variant)}
|
|
56
|
+
// Presentation Parameters
|
|
57
|
+
spacing={{
|
|
58
|
+
paddingTop: 'container-xlarge',
|
|
59
|
+
paddingLeft: 'container-small',
|
|
60
|
+
paddingRight: 'container-small',
|
|
61
|
+
paddingBottom: 'container-xlarge',
|
|
62
|
+
}}
|
|
63
|
+
fluidContent={!props.variant}
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
11
66
|
|
|
12
|
-
export
|
|
13
|
-
const imageOverlayOpacity = getImageOverlayOpacity(overlayAutoTint, enableOverlayAutoTint);
|
|
14
|
-
return (
|
|
15
|
-
<DemoHero
|
|
16
|
-
{...props}
|
|
17
|
-
// Eyebrow Text Parameters
|
|
18
|
-
eyebrowTitleTag="span"
|
|
19
|
-
eyebrowTitleSize={{
|
|
20
|
-
mobile: 'xs',
|
|
21
|
-
tablet: 'lg',
|
|
22
|
-
desktop: 'xl',
|
|
23
|
-
}}
|
|
24
|
-
eyebrowTitleWeight="bold"
|
|
25
|
-
eyebrowTitleTransform="uppercase"
|
|
26
|
-
eyebrowTitleColor={textColor || props.eyebrowTitleColor}
|
|
27
|
-
// Title Text Parameters
|
|
28
|
-
titleSize={{
|
|
29
|
-
mobile: '3xl',
|
|
30
|
-
tablet: '4xl',
|
|
31
|
-
desktop: '4xl',
|
|
32
|
-
}}
|
|
33
|
-
titleWeight="bold"
|
|
34
|
-
titleColor={textColor || props.titleColor}
|
|
35
|
-
// Description Text Parameters
|
|
36
|
-
descriptionTag="p"
|
|
37
|
-
descriptionSize={{
|
|
38
|
-
mobile: 'sm',
|
|
39
|
-
tablet: 'lg',
|
|
40
|
-
desktop: 'xl',
|
|
41
|
-
}}
|
|
42
|
-
descriptionWeight="normal"
|
|
43
|
-
descriptionColor={textColor || props.descriptionColor}
|
|
44
|
-
// Primary Button Parameters
|
|
45
|
-
primaryButtonSize="button-medium"
|
|
46
|
-
primaryButtonTextSize="sm"
|
|
47
|
-
primaryButtonTextColor="text-light"
|
|
48
|
-
primaryButtonTextWeight="normal"
|
|
49
|
-
primaryButtonButtonColor="button-primary"
|
|
50
|
-
primaryButtonTextTransform="uppercase"
|
|
51
|
-
primaryButtonHoverButtonColor="button-primary-hover"
|
|
52
|
-
// Image Parameters
|
|
53
|
-
imagePriority
|
|
54
|
-
imageObjectFit="cover"
|
|
55
|
-
imageUnoptimized
|
|
56
|
-
imageContrastBaseColor={!props.component.variant && imageOverlayOpacity ? textColor : undefined}
|
|
57
|
-
imageOverlayOpacity={imageOverlayOpacity}
|
|
58
|
-
// Presentation Parameters
|
|
59
|
-
spacing={{
|
|
60
|
-
paddingTop: 'container-xlarge',
|
|
61
|
-
paddingLeft: 'container-small',
|
|
62
|
-
paddingRight: 'container-small',
|
|
63
|
-
paddingBottom: 'container-xlarge',
|
|
64
|
-
}}
|
|
65
|
-
fluidContent={!props.component.variant}
|
|
66
|
-
isFlexibleHero={false}
|
|
67
|
-
/>
|
|
68
|
-
);
|
|
69
|
-
};
|
|
67
|
+
export default withFlattenParameters(FixedHero);
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ReplaceFieldsWithAssets } from '@/types/cskTypes';
|
|
3
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
4
|
+
import { FlexibleHeroParameters, FlexibleHeroProps } from '.';
|
|
3
5
|
import { DemoHero } from './demo-hero';
|
|
4
6
|
|
|
5
|
-
export const FlexibleHero: FC<
|
|
7
|
+
export const FlexibleHero: FC<
|
|
8
|
+
FlexibleHeroProps & ReplaceFieldsWithAssets<FlexibleHeroParameters, 'image' | 'primaryButtonIcon'>
|
|
9
|
+
> = props => <DemoHero {...props} isFlexibleHero={true} />;
|
|
10
|
+
|
|
11
|
+
export default withFlattenParameters(FlexibleHero);
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { DefaultTheme } from 'tailwindcss/types/generated/default-theme';
|
|
2
1
|
import { AssetParamValue } from '@uniformdev/assets';
|
|
3
2
|
import { LinkParamValue } from '@uniformdev/canvas';
|
|
4
|
-
import { ComponentProps } from '@uniformdev/canvas-next-rsc/component';
|
|
5
3
|
import { ContainerParameters } from '@/components/canvas/Container/parameters';
|
|
6
4
|
import { TextParameters } from '@/components/canvas/Text/parameters';
|
|
7
5
|
import { ButtonVariant, ButtonProps as BaseButtonProps } from '@/components/ui/Button';
|
|
8
|
-
import { ViewPort } from '@/types/cskTypes';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
6
|
+
import { ViewPort, ComponentProps } from '@/types/cskTypes';
|
|
7
|
+
import FixedHero from './fixed-hero';
|
|
8
|
+
import FlexibleHero from './flexible-hero';
|
|
11
9
|
import { PrefixedKeys } from './utils';
|
|
12
10
|
|
|
13
11
|
export enum ContentAlignment {
|
|
@@ -20,7 +18,7 @@ export type BaseButtonParameters = {
|
|
|
20
18
|
text?: string;
|
|
21
19
|
link?: LinkParamValue;
|
|
22
20
|
textColor?: string;
|
|
23
|
-
textWeight?:
|
|
21
|
+
textWeight?: string;
|
|
24
22
|
textFont?: 'uppercase' | 'lowercase' | 'capitalize' | 'normal-case';
|
|
25
23
|
textTransform?: string;
|
|
26
24
|
buttonColor?: string;
|
|
@@ -45,6 +43,7 @@ export type BaseImageParameters = {
|
|
|
45
43
|
border?: string | ViewPort<string>;
|
|
46
44
|
priority?: boolean;
|
|
47
45
|
unoptimized?: boolean;
|
|
46
|
+
fill?: boolean;
|
|
48
47
|
};
|
|
49
48
|
|
|
50
49
|
export type EyebrowTitleTextParameters = PrefixedKeys<TextParameters, 'eyebrowTitle'>;
|
|
@@ -60,10 +59,7 @@ export type SecondaryButtonParameters = PrefixedKeys<BaseButtonParameters, 'seco
|
|
|
60
59
|
export type ImageParameters = PrefixedKeys<Omit<BaseImageParameters, 'image'>, 'image'> &
|
|
61
60
|
Pick<BaseImageParameters, 'image'>;
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
* @deprecated Use FixedHeroParameters or FlexibleHeroParameters directly instead.
|
|
65
|
-
*/
|
|
66
|
-
export type DemoHeroParameters = ContainerParameters & {
|
|
62
|
+
type DemoHeroParameters = ContainerParameters & {
|
|
67
63
|
contentAlignment?: ContentAlignment;
|
|
68
64
|
} & EyebrowTitleTextParameters &
|
|
69
65
|
TitleTextParameters &
|
|
@@ -74,10 +70,6 @@ export type DemoHeroParameters = ContainerParameters & {
|
|
|
74
70
|
|
|
75
71
|
export type FixedHeroParameters = {
|
|
76
72
|
textColor?: string;
|
|
77
|
-
/**
|
|
78
|
-
* @deprecated Use overlayAutoTint instead.
|
|
79
|
-
*/
|
|
80
|
-
enableOverlayAutoTint?: boolean;
|
|
81
73
|
overlayAutoTint?: string;
|
|
82
74
|
} & DemoHeroParameters;
|
|
83
75
|
|
|
@@ -93,10 +85,6 @@ export enum FlexibleHeroSlots {
|
|
|
93
85
|
FlexibleHeroCta = 'flexibleHeroCta',
|
|
94
86
|
}
|
|
95
87
|
|
|
96
|
-
/**
|
|
97
|
-
* @deprecated Use FixedHeroProps or FlexibleHeroProps directly instead.
|
|
98
|
-
*/
|
|
99
|
-
export type DemoHeroProps = FixedHeroProps | FlexibleHeroProps;
|
|
100
88
|
export type FixedHeroProps = ComponentProps<FixedHeroParameters>;
|
|
101
89
|
export type FlexibleHeroProps = ComponentProps<FlexibleHeroParameters, FlexibleHeroSlots>;
|
|
102
90
|
|
|
@@ -29,3 +29,17 @@ export const cleanUpPrefix = <T extends Record<string, unknown>, Prefix extends
|
|
|
29
29
|
{} as RemovePrefix<T, Prefix>
|
|
30
30
|
);
|
|
31
31
|
};
|
|
32
|
+
|
|
33
|
+
const HALF_DISPLAY_WIDTH = 608;
|
|
34
|
+
export const getImageParametersFocalPoint = (isVariant: boolean) => {
|
|
35
|
+
const columnImageDimensions = isVariant ? HALF_DISPLAY_WIDTH : undefined;
|
|
36
|
+
return {
|
|
37
|
+
imageFill: !isVariant,
|
|
38
|
+
...(columnImageDimensions
|
|
39
|
+
? {
|
|
40
|
+
imageWidth: columnImageDimensions,
|
|
41
|
+
imageHeight: columnImageDimensions,
|
|
42
|
+
}
|
|
43
|
+
: {}),
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { cn } from '@/utils/styling';
|
|
3
|
-
import {
|
|
3
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
4
|
+
import { DividerParameters, DividerProps } from '.';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
const Divider: FC<DividerProps & DividerParameters> = ({ color, thickness, width, alignment }) => (
|
|
6
7
|
<div className={cn('flex w-full', `justify-${alignment || 'center'}`)}>
|
|
7
8
|
<div className={cn({ [`bg-${color}`]: !!color })} style={{ width, height: thickness }} />
|
|
8
9
|
</div>
|
|
9
10
|
);
|
|
11
|
+
|
|
12
|
+
export default withFlattenParameters(Divider);
|