@uniformdev/csk-components 6.1.57 → 6.1.64-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-CrBZatTs.d.mts +18 -0
- package/dist/index-vyIO0XN2.d.mts +90 -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 +21 -8
- 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 +4 -1
- 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 +48 -15
- 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,15 +1,15 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
import Container from '@/components/ui/Container';
|
|
3
|
-
import {
|
|
3
|
+
import { TestimonialParameters } from '.';
|
|
4
4
|
|
|
5
5
|
type WithLargeAvatarVariantProps = Pick<
|
|
6
|
-
|
|
7
|
-
'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | '
|
|
6
|
+
TestimonialParameters,
|
|
7
|
+
'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'height'
|
|
8
8
|
> & {
|
|
9
|
-
testimonialPrimaryImage:
|
|
10
|
-
testimonialContent:
|
|
11
|
-
testimonialAuthor:
|
|
12
|
-
testimonialSecondaryImage:
|
|
9
|
+
testimonialPrimaryImage: ReactNode;
|
|
10
|
+
testimonialContent: ReactNode;
|
|
11
|
+
testimonialAuthor: ReactNode;
|
|
12
|
+
testimonialSecondaryImage: ReactNode;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export const WithOverlappingImageVariant: FC<WithLargeAvatarVariantProps> = ({
|
|
@@ -21,11 +21,9 @@ export const WithOverlappingImageVariant: FC<WithLargeAvatarVariantProps> = ({
|
|
|
21
21
|
spacing,
|
|
22
22
|
border,
|
|
23
23
|
fluidContent,
|
|
24
|
-
fullHeight,
|
|
25
|
-
fitHeight,
|
|
26
24
|
height,
|
|
27
25
|
}) => (
|
|
28
|
-
<Container {...{ backgroundColor, spacing, border, fluidContent,
|
|
26
|
+
<Container {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
29
27
|
<Container className="pb-10 lg:pb-0">
|
|
30
28
|
<div className="mx-auto flex max-w-2xl flex-col items-center gap-10 lg:max-w-none lg:flex-row">
|
|
31
29
|
<div className="-mt-7 aspect-[2/1] w-full shrink-0 overflow-hidden rounded-xl lg:-my-7 lg:aspect-[1/1.4] lg:max-w-xs">
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { ComponentProps } from '
|
|
1
|
+
import { ComponentProps } from '@/types/cskTypes';
|
|
2
2
|
import { TextParameters } from './parameters';
|
|
3
|
-
import { Text } from './text';
|
|
4
3
|
|
|
5
4
|
export type TextProps = ComponentProps<TextParameters>;
|
|
6
5
|
|
|
7
6
|
export { type TextParameters } from './parameters';
|
|
8
|
-
export default
|
|
7
|
+
export { default } from './text';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { UniformText } from '@uniformdev/
|
|
2
|
+
import { UniformText, ComponentParameter } from '@uniformdev/next-app-router/component';
|
|
3
3
|
import BaseText from '@/components/ui/Text';
|
|
4
|
-
import {
|
|
4
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
5
|
+
import { TextParameters, TextProps } from '.';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
const Text: FC<TextProps & TextParameters> = ({
|
|
7
8
|
tag,
|
|
8
9
|
size,
|
|
9
10
|
color,
|
|
@@ -15,15 +16,20 @@ export const Text: FC<TextProps> = ({
|
|
|
15
16
|
lineCountRestrictions,
|
|
16
17
|
alignment,
|
|
17
18
|
component,
|
|
18
|
-
|
|
19
|
-
}) =>
|
|
20
|
-
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
parameters,
|
|
20
|
+
}) => {
|
|
21
|
+
return (
|
|
22
|
+
<BaseText
|
|
23
|
+
{...{ color, size, font, weight, transform, decoration, letterSpacing, alignment, lineCountRestrictions }}
|
|
24
|
+
>
|
|
25
|
+
<UniformText
|
|
26
|
+
placeholder="Text goes here"
|
|
27
|
+
parameter={parameters.text as ComponentParameter<string>}
|
|
28
|
+
as={tag || undefined}
|
|
29
|
+
component={component}
|
|
30
|
+
/>
|
|
31
|
+
</BaseText>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default withFlattenParameters(Text);
|
|
@@ -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 type ThemeSwitcherParameters = {
|
|
5
5
|
iconColor?: string;
|
|
@@ -7,4 +7,4 @@ export type ThemeSwitcherParameters = {
|
|
|
7
7
|
|
|
8
8
|
export type ThemeSwitcherProps = ComponentProps<ThemeSwitcherParameters>;
|
|
9
9
|
|
|
10
|
-
export default dynamic(() => import('./theme-switcher').then(mod => mod.
|
|
10
|
+
export default dynamic(() => import('./theme-switcher').then(mod => mod.default));
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import { FC } from 'react';
|
|
4
4
|
import dynamic from 'next/dynamic';
|
|
5
|
-
import { useUniformContext } from '@uniformdev/
|
|
6
|
-
import {
|
|
5
|
+
import { useUniformContext } from '@uniformdev/next-app-router/component';
|
|
6
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
7
|
+
import { ThemeSwitcherParameters, ThemeSwitcherProps } from '.';
|
|
7
8
|
|
|
8
9
|
const BaseThemeSwitcher = dynamic(() => import('@/components/ui/ThemeSwitcher').then(mod => mod.default), {
|
|
9
10
|
ssr: false,
|
|
10
11
|
});
|
|
11
12
|
|
|
12
|
-
export const ThemeSwitcher: FC<ThemeSwitcherProps> = ({ iconColor }) => {
|
|
13
|
+
export const ThemeSwitcher: FC<ThemeSwitcherProps & ThemeSwitcherParameters> = ({ iconColor }) => {
|
|
13
14
|
const { context } = useUniformContext();
|
|
14
15
|
|
|
15
16
|
const onChangeTheme = (theme: string) => {
|
|
@@ -22,3 +23,5 @@ export const ThemeSwitcher: FC<ThemeSwitcherProps> = ({ iconColor }) => {
|
|
|
22
23
|
|
|
23
24
|
return <BaseThemeSwitcher iconColor={iconColor} onChange={onChangeTheme} />;
|
|
24
25
|
};
|
|
26
|
+
|
|
27
|
+
export default withFlattenParameters(ThemeSwitcher);
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { AssetParamValue } from '@uniformdev/assets';
|
|
2
|
-
import {
|
|
3
|
-
import { ComponentProps } from '@uniformdev/canvas-next-rsc/component';
|
|
4
|
-
import { ViewPort } from '@/types/cskTypes';
|
|
2
|
+
import { ComponentProps, ViewPort } from '@/types/cskTypes';
|
|
5
3
|
|
|
6
4
|
export type VideoParameters = {
|
|
7
5
|
video?: AssetParamValue;
|
|
8
|
-
url?: LinkParamValue; // Deprecated. Please use video parameter instead of url
|
|
9
6
|
placeholderImage?: AssetParamValue;
|
|
10
7
|
autoPlay?: boolean;
|
|
11
8
|
lazyLoad?: boolean;
|
|
@@ -19,4 +16,4 @@ export type VideoParameters = {
|
|
|
19
16
|
|
|
20
17
|
export type VideoProps = ComponentProps<VideoParameters>;
|
|
21
18
|
|
|
22
|
-
export {
|
|
19
|
+
export { default } from './video';
|
|
@@ -5,7 +5,7 @@ import { VideoProps } from '.';
|
|
|
5
5
|
type VideoPlaceholderProps = Pick<VideoProps, 'component' | 'context'>;
|
|
6
6
|
|
|
7
7
|
export const VideoPlaceholder: FC<VideoPlaceholderProps> = ({ context, component }) => {
|
|
8
|
-
const isEditorPreviewMode = context.
|
|
8
|
+
const isEditorPreviewMode = context.isContextualEditing;
|
|
9
9
|
const isPlaceholder = component?._id?.includes('placeholder_');
|
|
10
10
|
|
|
11
11
|
if (!isEditorPreviewMode || isPlaceholder) {
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import { FC } from 'react';
|
|
4
4
|
import BaseVideo from '@/components/ui/Video';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { ReplaceFieldsWithAssets } from '@/types/cskTypes';
|
|
6
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
7
|
+
import { VideoParameters, VideoProps } from '.';
|
|
7
8
|
import { VideoPlaceholder } from './placeholder';
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
const Video: FC<VideoProps & ReplaceFieldsWithAssets<VideoParameters, 'video' | 'placeholderImage'>> = ({
|
|
10
11
|
video,
|
|
11
|
-
url, // Deprecated. Please use video parameter instead of url
|
|
12
12
|
placeholderImage,
|
|
13
13
|
autoPlay,
|
|
14
14
|
lazyLoad,
|
|
@@ -21,10 +21,10 @@ export const Video: FC<VideoProps> = ({
|
|
|
21
21
|
component,
|
|
22
22
|
context,
|
|
23
23
|
}) => {
|
|
24
|
-
const [resolvedVideo] =
|
|
25
|
-
const [resolvedImage] =
|
|
24
|
+
const [resolvedVideo] = video || [];
|
|
25
|
+
const [resolvedImage] = placeholderImage || [];
|
|
26
26
|
|
|
27
|
-
const resolvedVideoUrl = resolvedVideo?.url
|
|
27
|
+
const resolvedVideoUrl = resolvedVideo?.url;
|
|
28
28
|
|
|
29
29
|
if (!resolvedVideoUrl) {
|
|
30
30
|
return <VideoPlaceholder component={component} context={context} />;
|
|
@@ -38,3 +38,5 @@ export const Video: FC<VideoProps> = ({
|
|
|
38
38
|
/>
|
|
39
39
|
);
|
|
40
40
|
};
|
|
41
|
+
|
|
42
|
+
export default withFlattenParameters(Video);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import Container from '@/components/ui/Container';
|
|
3
|
+
import { cn } from '@/utils/styling';
|
|
4
|
+
import { AccordionProps } from '.';
|
|
5
|
+
|
|
6
|
+
export const Accordion: FC<AccordionProps> = ({
|
|
7
|
+
accordionContent,
|
|
8
|
+
accordionItems,
|
|
9
|
+
backgroundColor,
|
|
10
|
+
spacing,
|
|
11
|
+
border,
|
|
12
|
+
fluidContent,
|
|
13
|
+
height,
|
|
14
|
+
className,
|
|
15
|
+
}) => (
|
|
16
|
+
<Container
|
|
17
|
+
className={cn('flex flex-col gap-8', className)}
|
|
18
|
+
{...{ backgroundColor, spacing, border, fluidContent, height }}
|
|
19
|
+
>
|
|
20
|
+
{accordionContent && <div className="flex flex-col gap-4 text-start">{accordionContent}</div>}
|
|
21
|
+
{accordionItems}
|
|
22
|
+
</Container>
|
|
23
|
+
);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ContainerProps } from '@/components/ui/Container';
|
|
3
|
+
|
|
4
|
+
export type AccordionProps = ContainerProps & {
|
|
5
|
+
accordionContent?: ReactNode;
|
|
6
|
+
accordionItems: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { Accordion as default } from './accordion';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { FC, useCallback, useState } from 'react';
|
|
4
|
+
import Container from '@/components/ui/Container';
|
|
5
|
+
import { cn } from '@/utils/styling';
|
|
6
|
+
import { AccordionItemProps } from '.';
|
|
7
|
+
import { IconArrowDown } from './icon-arrow-down';
|
|
8
|
+
import { IconArrowUp } from './icon-arrow-up';
|
|
9
|
+
|
|
10
|
+
export const AccordionItem: FC<AccordionItemProps> = ({
|
|
11
|
+
text,
|
|
12
|
+
backgroundColor,
|
|
13
|
+
spacing,
|
|
14
|
+
className,
|
|
15
|
+
accordionItemContent,
|
|
16
|
+
}) => {
|
|
17
|
+
const [isOpened, setOpened] = useState(false);
|
|
18
|
+
const toggleOpenAccordion = useCallback(() => setOpened(isOpened => !isOpened), []);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Container {...{ fluidContent: true }}>
|
|
22
|
+
<Container {...{ backgroundColor, spacing, fluidContent: true, className }}>
|
|
23
|
+
<button
|
|
24
|
+
onClick={toggleOpenAccordion}
|
|
25
|
+
className="flex w-full cursor-pointer flex-row items-center justify-between text-start"
|
|
26
|
+
>
|
|
27
|
+
{text}
|
|
28
|
+
<div
|
|
29
|
+
className={cn({
|
|
30
|
+
[`text-${backgroundColor} invert`]: !!backgroundColor,
|
|
31
|
+
'text-black dark:text-white': !backgroundColor,
|
|
32
|
+
})}
|
|
33
|
+
>
|
|
34
|
+
{isOpened ? <IconArrowDown /> : <IconArrowUp />}
|
|
35
|
+
</div>
|
|
36
|
+
</button>
|
|
37
|
+
</Container>
|
|
38
|
+
{isOpened && accordionItemContent}
|
|
39
|
+
</Container>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import dynamic from 'next/dynamic';
|
|
3
|
+
import { ContainerProps } from '@/components/ui/Container';
|
|
4
|
+
|
|
5
|
+
export type AccordionItemParameters = Pick<ContainerProps, 'backgroundColor' | 'spacing' | 'border'> & {
|
|
6
|
+
text: ReactElement;
|
|
7
|
+
accordionItemContent: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type AccordionItemAdditionalProps = {
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type AccordionItemProps = AccordionItemParameters & AccordionItemAdditionalProps;
|
|
15
|
+
|
|
16
|
+
export default dynamic(() => import('./accordion-item').then(mod => mod.AccordionItem));
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { FC, useCallback, useState } from 'react';
|
|
4
|
+
import Container from '@/components/ui/Container';
|
|
5
|
+
import { cn } from '@/utils/styling';
|
|
6
|
+
import { ContentAlignment, BannerProps, BannerVariants } from '.';
|
|
7
|
+
import CloseButton from './close-button';
|
|
8
|
+
import { getContentClasses, getPositionClasses } from './style-utils';
|
|
9
|
+
|
|
10
|
+
const Banner: FC<BannerProps> = ({
|
|
11
|
+
backgroundColor,
|
|
12
|
+
spacing,
|
|
13
|
+
border,
|
|
14
|
+
fluidContent,
|
|
15
|
+
iconColor,
|
|
16
|
+
contentAlignment = ContentAlignment.Center,
|
|
17
|
+
floating = false,
|
|
18
|
+
children,
|
|
19
|
+
variant,
|
|
20
|
+
}) => {
|
|
21
|
+
const [isOpen, setIsOpen] = useState(true);
|
|
22
|
+
|
|
23
|
+
const handleClose = useCallback(() => {
|
|
24
|
+
setIsOpen(false);
|
|
25
|
+
}, []);
|
|
26
|
+
|
|
27
|
+
if (!isOpen) return null;
|
|
28
|
+
|
|
29
|
+
const positionClasses = getPositionClasses({ variant: variant as BannerVariants, floating });
|
|
30
|
+
const contentClasses = getContentClasses({ contentAlignment, iconColor, fluidContent, floating });
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Container className={positionClasses} fluidContent={fluidContent} border={border}>
|
|
34
|
+
<Container
|
|
35
|
+
className={cn('relative w-full', contentClasses)}
|
|
36
|
+
backgroundColor={backgroundColor}
|
|
37
|
+
spacing={spacing}
|
|
38
|
+
fluidContent={fluidContent}
|
|
39
|
+
>
|
|
40
|
+
{children}
|
|
41
|
+
{iconColor && <CloseButton onClose={handleClose} iconColor={iconColor} />}
|
|
42
|
+
</Container>
|
|
43
|
+
</Container>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default Banner;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import dynamic from 'next/dynamic';
|
|
2
|
+
import { ContainerProps } from '@/components/ui/Container';
|
|
3
|
+
|
|
4
|
+
export enum ContentAlignment {
|
|
5
|
+
Left = 'left',
|
|
6
|
+
Center = 'center',
|
|
7
|
+
Right = 'right',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export enum BannerVariants {
|
|
11
|
+
None = '',
|
|
12
|
+
Top = 'top',
|
|
13
|
+
Bottom = 'bottom',
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type BannerProps = ContainerProps & {
|
|
17
|
+
iconColor?: string;
|
|
18
|
+
contentAlignment?: ContentAlignment;
|
|
19
|
+
floating?: boolean;
|
|
20
|
+
variant?: BannerVariants;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type PositionClassesProps = {
|
|
24
|
+
variant?: BannerVariants;
|
|
25
|
+
} & Pick<BannerProps, 'floating'>;
|
|
26
|
+
|
|
27
|
+
export type ContentClassesProps = Pick<BannerProps, 'floating' | 'iconColor' | 'fluidContent' | 'contentAlignment'>;
|
|
28
|
+
|
|
29
|
+
export default dynamic(() => import('./banner').then(mod => mod.default));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { cn } from '@/utils/styling';
|
|
2
|
-
import { ContentAlignment } from '.';
|
|
3
|
-
import { BannerVariants, ContentClassesProps, PositionClassesProps } from './types';
|
|
2
|
+
import { BannerVariants, ContentClassesProps, PositionClassesProps, ContentAlignment } from '.';
|
|
4
3
|
|
|
5
4
|
export const getPositionClasses = ({ variant, floating }: PositionClassesProps) =>
|
|
6
5
|
cn({
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
-
import { DefaultTheme } from 'tailwindcss/types/generated/default-theme';
|
|
3
2
|
import { ViewPort } from '@/types/cskTypes';
|
|
4
3
|
|
|
5
4
|
export enum ButtonVariant {
|
|
6
5
|
Link = 'link',
|
|
7
6
|
}
|
|
8
7
|
|
|
9
|
-
type TextSize = keyof DefaultTheme['fontSize'];
|
|
10
|
-
|
|
11
8
|
export type ButtonProps = PropsWithChildren<{
|
|
12
9
|
variant?: ButtonVariant;
|
|
13
10
|
href?: string;
|
|
@@ -15,8 +12,8 @@ export type ButtonProps = PropsWithChildren<{
|
|
|
15
12
|
size?: string;
|
|
16
13
|
className?: string;
|
|
17
14
|
textColor?: string;
|
|
18
|
-
textSize?:
|
|
19
|
-
textWeight?:
|
|
15
|
+
textSize?: string | ViewPort<string>;
|
|
16
|
+
textWeight?: string;
|
|
20
17
|
textFont?: 'uppercase' | 'lowercase' | 'capitalize' | 'normal-case';
|
|
21
18
|
textTransform?: string;
|
|
22
19
|
buttonColor?: string;
|
|
@@ -11,7 +11,7 @@ export const Carousel: FC<CarouselProps> = ({
|
|
|
11
11
|
spacing,
|
|
12
12
|
border,
|
|
13
13
|
fluidContent,
|
|
14
|
-
|
|
14
|
+
height,
|
|
15
15
|
itemsPerPage = '1',
|
|
16
16
|
children,
|
|
17
17
|
gapX,
|
|
@@ -116,7 +116,7 @@ export const Carousel: FC<CarouselProps> = ({
|
|
|
116
116
|
});
|
|
117
117
|
|
|
118
118
|
return (
|
|
119
|
-
<BaseContainer {...{ backgroundColor, spacing, border, fluidContent,
|
|
119
|
+
<BaseContainer {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
120
120
|
<div
|
|
121
121
|
className={cn('relative', {
|
|
122
122
|
[resolveViewPort(gapX, '-mx-{value}')]: gapX,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
1
|
+
import { CSSProperties, ReactElement } from 'react';
|
|
2
2
|
import dynamic from 'next/dynamic';
|
|
3
3
|
import { ContainerProps as BaseContainerProps } from '@/components/ui/Container';
|
|
4
4
|
|
|
5
5
|
export type CarouselProps = Pick<
|
|
6
6
|
BaseContainerProps,
|
|
7
|
-
'title' | 'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | '
|
|
7
|
+
'title' | 'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'height'
|
|
8
8
|
> & {
|
|
9
9
|
countOfItems?: number;
|
|
10
|
-
children: (options: { className?: string; style?:
|
|
10
|
+
children: (options: { className?: string; style?: CSSProperties }) => ReactElement;
|
|
11
11
|
itemsPerPage?: string;
|
|
12
12
|
gapX?: string;
|
|
13
13
|
variant?: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { withFlattenParameters } from '@/utils/withFlattenParameters';
|
|
3
|
+
import { ComponentEmptyPlaceholderParameters, ComponentEmptyPlaceholderProps } from '.';
|
|
4
|
+
|
|
5
|
+
export const ComponentEmptyPlaceholder: FC<
|
|
6
|
+
ComponentEmptyPlaceholderProps & ComponentEmptyPlaceholderParameters
|
|
7
|
+
> = () => (
|
|
8
|
+
<div className="p-4 bg-white text-black rounded-md border border-black">
|
|
9
|
+
<p className="font-medium">Component not found</p>
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export default withFlattenParameters(ComponentEmptyPlaceholder);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentProps } from '@/types/cskTypes';
|
|
2
|
+
|
|
3
|
+
export type ComponentEmptyPlaceholderParameters = unknown;
|
|
4
|
+
export type ComponentEmptyPlaceholderProps = ComponentProps<ComponentEmptyPlaceholderParameters>;
|
|
5
|
+
|
|
6
|
+
export { ComponentEmptyPlaceholder as default } from './component-empty-placeholder';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { cn, formatSpaceParameterValue, resolveViewPort } from '@/utils/styling';
|
|
3
3
|
import { ContainerProps } from '.';
|
|
4
|
-
import { getHeightValue } from './utils';
|
|
5
4
|
|
|
6
5
|
export const Container: FC<ContainerProps> = ({
|
|
7
6
|
className,
|
|
@@ -12,8 +11,6 @@ export const Container: FC<ContainerProps> = ({
|
|
|
12
11
|
spacing,
|
|
13
12
|
border = '',
|
|
14
13
|
fluidContent = false,
|
|
15
|
-
fullHeight = false,
|
|
16
|
-
fitHeight = false,
|
|
17
14
|
height,
|
|
18
15
|
maxWidth,
|
|
19
16
|
...rest
|
|
@@ -23,8 +20,6 @@ export const Container: FC<ContainerProps> = ({
|
|
|
23
20
|
{ marginTop, marginBottom, marginRight, marginLeft, paddingTop, paddingBottom, paddingRight, paddingLeft },
|
|
24
21
|
] = formatSpaceParameterValue(spacing);
|
|
25
22
|
|
|
26
|
-
const heightValue = getHeightValue({ height, fullHeight, fitHeight });
|
|
27
|
-
|
|
28
23
|
return (
|
|
29
24
|
<div
|
|
30
25
|
className={cn(
|
|
@@ -34,7 +29,7 @@ export const Container: FC<ContainerProps> = ({
|
|
|
34
29
|
'mx-auto w-full': !fluidContent,
|
|
35
30
|
'max-w-7xl max-w-container-width': !maxWidth && !fluidContent,
|
|
36
31
|
[`max-w-${maxWidth}`]: !!maxWidth && !fluidContent,
|
|
37
|
-
[resolveViewPort(
|
|
32
|
+
[resolveViewPort(height, 'h-{value}')]: height,
|
|
38
33
|
},
|
|
39
34
|
wrapperClassName
|
|
40
35
|
)}
|
|
@@ -52,7 +47,7 @@ export const Container: FC<ContainerProps> = ({
|
|
|
52
47
|
[resolveViewPort(paddingRight, 'pr-{value}')]: paddingRight,
|
|
53
48
|
[resolveViewPort(paddingLeft, 'pl-{value}')]: paddingLeft,
|
|
54
49
|
[resolveViewPort(border, '{value}')]: border,
|
|
55
|
-
[resolveViewPort(
|
|
50
|
+
[resolveViewPort(height, 'h-{value}')]: height,
|
|
56
51
|
},
|
|
57
52
|
className
|
|
58
53
|
)}
|
|
@@ -6,15 +6,9 @@ export type ContainerProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
6
6
|
spacing?: SpaceType | ViewPort<SpaceType>;
|
|
7
7
|
border?: string | ViewPort<string>;
|
|
8
8
|
fluidContent?: boolean;
|
|
9
|
-
/** @deprecated Use height prop instead */
|
|
10
|
-
fullHeight?: boolean;
|
|
11
|
-
/** @deprecated Use height prop instead */
|
|
12
|
-
fitHeight?: boolean;
|
|
13
9
|
height?: string | ViewPort<string>;
|
|
14
10
|
wrapperClassName?: string;
|
|
15
11
|
maxWidth?: string;
|
|
16
12
|
};
|
|
17
13
|
|
|
18
|
-
export { getHeightValue } from './utils';
|
|
19
|
-
|
|
20
14
|
export { Container as default } from './container';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import BaseContainer
|
|
2
|
+
import BaseContainer from '@/components/ui/Container';
|
|
3
3
|
import { cn, resolveViewPort } from '@/utils/styling';
|
|
4
4
|
import { FlexProps } from '.';
|
|
5
5
|
|
|
@@ -14,32 +14,26 @@ export const Flex: FC<FlexProps> = ({
|
|
|
14
14
|
spacing,
|
|
15
15
|
border,
|
|
16
16
|
fluidContent,
|
|
17
|
-
fullHeight,
|
|
18
|
-
fitHeight,
|
|
19
17
|
height,
|
|
20
18
|
children,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
wrap,
|
|
20
|
+
}) => (
|
|
21
|
+
<BaseContainer {...{ backgroundColor, spacing, border, fluidContent, height, wrapperClassName }}>
|
|
22
|
+
<div
|
|
23
|
+
className={cn(
|
|
24
|
+
'flex',
|
|
25
|
+
{
|
|
26
|
+
[resolveViewPort(direction, 'flex-{value}')]: direction,
|
|
27
|
+
[resolveViewPort(justifyContent, 'justify-{value}')]: justifyContent,
|
|
28
|
+
[resolveViewPort(gap, 'gap-{value}')]: gap,
|
|
29
|
+
[resolveViewPort(alignItems, 'items-{value}')]: alignItems,
|
|
30
|
+
[resolveViewPort(height, 'h-{value}')]: height,
|
|
31
|
+
[resolveViewPort(wrap, 'flex-{value}')]: wrap,
|
|
32
|
+
},
|
|
33
|
+
className
|
|
34
|
+
)}
|
|
27
35
|
>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
[resolveViewPort(direction, 'flex-{value}')]: direction,
|
|
33
|
-
[resolveViewPort(justifyContent, 'justify-{value}')]: justifyContent,
|
|
34
|
-
[resolveViewPort(gap, 'gap-{value}')]: gap,
|
|
35
|
-
[resolveViewPort(alignItems, 'items-{value}')]: alignItems,
|
|
36
|
-
[resolveViewPort(heightValue, 'h-{value}')]: heightValue,
|
|
37
|
-
},
|
|
38
|
-
className
|
|
39
|
-
)}
|
|
40
|
-
>
|
|
41
|
-
{children}
|
|
42
|
-
</div>
|
|
43
|
-
</BaseContainer>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
36
|
+
{children}
|
|
37
|
+
</div>
|
|
38
|
+
</BaseContainer>
|
|
39
|
+
);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { DefaultTheme } from 'tailwindcss/types/generated/default-theme';
|
|
2
1
|
import { ContainerProps as BaseContainerProps } from '@/components/ui/Container';
|
|
3
2
|
import { ViewPort } from '@/types/cskTypes';
|
|
4
3
|
|
|
5
4
|
type Direction = 'row' | 'row-reverse' | 'col' | 'col-reverse';
|
|
6
5
|
type Justify = 'normal' | 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly' | 'stretch';
|
|
7
|
-
type FlexGap = keyof DefaultTheme['spacing'];
|
|
8
6
|
type Align = 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
7
|
+
type Wrap = 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
9
8
|
|
|
10
9
|
export type FlexProps = Pick<
|
|
11
10
|
BaseContainerProps,
|
|
@@ -16,15 +15,14 @@ export type FlexProps = Pick<
|
|
|
16
15
|
| 'spacing'
|
|
17
16
|
| 'border'
|
|
18
17
|
| 'fluidContent'
|
|
19
|
-
| 'fullHeight'
|
|
20
|
-
| 'fitHeight'
|
|
21
18
|
| 'height'
|
|
22
19
|
| 'children'
|
|
23
20
|
> & {
|
|
24
21
|
direction?: Direction | ViewPort<Direction>;
|
|
25
22
|
justifyContent?: Justify | ViewPort<Justify>;
|
|
26
|
-
gap?:
|
|
23
|
+
gap?: string | ViewPort<string>;
|
|
27
24
|
alignItems?: Align | ViewPort<Align>;
|
|
25
|
+
wrap?: Wrap | ViewPort<Wrap>;
|
|
28
26
|
};
|
|
29
27
|
|
|
30
28
|
export { Flex as default } from './flex';
|
|
@@ -6,7 +6,7 @@ type AvailableShrink = '0' | '1';
|
|
|
6
6
|
|
|
7
7
|
export type FlexItemProps = HTMLAttributes<HTMLDivElement> & {
|
|
8
8
|
alignSelf?: AvailableAlignSelf | ViewPort<AvailableAlignSelf>;
|
|
9
|
-
shrink
|
|
9
|
+
shrink?: AvailableShrink;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export { FlexItem as default } from './flex-item';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { ContainerProps as BaseContainerProps } from '@/components/ui/Container';
|
|
2
3
|
|
|
3
|
-
export type FooterProps = Omit<BaseContainerProps, '
|
|
4
|
-
logo?:
|
|
5
|
-
copyright?:
|
|
6
|
-
content?:
|
|
4
|
+
export type FooterProps = Omit<BaseContainerProps, 'height' | 'content'> & {
|
|
5
|
+
logo?: ReactNode;
|
|
6
|
+
copyright?: ReactNode;
|
|
7
|
+
content?: ReactNode;
|
|
7
8
|
};
|
|
8
9
|
|
|
9
10
|
export { Footer as default } from './footer';
|