@uniformdev/csk-components 6.0.121-alpha.1 → 6.1.57
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/dist/accordion-item-G5CNMERW.mjs +1 -0
- package/dist/{banner-EYII7V7X.mjs → banner-2B4K5R4N.mjs} +1 -1
- package/dist/carousel-BBEW5P4Y.mjs +1 -0
- package/dist/carousel-ERCHOWUS.mjs +1 -0
- package/dist/chunk-2SEOCBRK.mjs +1 -0
- package/dist/{chunk-TFA6HYP4.mjs → chunk-3PDY7RJC.mjs} +2 -2
- package/dist/chunk-4LWAGTFW.mjs +1 -0
- package/dist/chunk-5VM2Y55L.mjs +1 -0
- package/dist/chunk-AKRWCDDG.mjs +1 -0
- package/dist/{chunk-VW2XC3SE.mjs → chunk-FPOIJMYT.mjs} +1 -1
- package/dist/{chunk-B2O55EVA.mjs → chunk-LA36HQWS.mjs} +1 -1
- package/dist/chunk-M3BGP5VE.mjs +1 -0
- package/dist/chunk-QHIWJPL6.mjs +1 -0
- package/dist/chunk-TIRCISSU.mjs +1 -0
- package/dist/chunk-TM7Q5NMH.mjs +1 -0
- package/dist/chunk-YUCUJWBO.mjs +1 -0
- package/dist/chunk-Z7JSWSPD.mjs +1 -0
- package/dist/components/canvas/emptyPlaceholders.mjs +1 -1
- package/dist/components/canvas/index.d.mts +21 -5
- package/dist/components/canvas/index.mjs +2 -2
- package/dist/components/ui/index.d.mts +25 -61
- package/dist/components/ui/index.mjs +1 -1
- package/dist/content/components/canvas/Accordion/accordion.tsx +12 -6
- package/dist/content/components/canvas/AccordionItem/accordion-item.tsx +36 -23
- package/dist/content/components/canvas/Button/index.tsx +2 -1
- package/dist/content/components/canvas/Card/card.tsx +3 -1
- package/dist/content/components/canvas/Carousel/carousel.tsx +3 -1
- package/dist/content/components/canvas/Container/container.tsx +4 -0
- package/dist/content/components/canvas/Container/parameters.ts +4 -0
- package/dist/content/components/canvas/DemoHero/atoms.tsx +4 -31
- package/dist/content/components/canvas/DemoHero/columns-variant.tsx +7 -1
- package/dist/content/components/canvas/DemoHero/default-variant.tsx +8 -1
- package/dist/content/components/canvas/DemoHero/demo-hero.tsx +4 -2
- package/dist/content/components/canvas/DemoHero/fixed-hero.tsx +65 -56
- package/dist/content/components/canvas/DemoHero/index.tsx +14 -3
- package/dist/content/components/canvas/DemoHero/utils.ts +0 -14
- package/dist/content/components/canvas/Flex/flex.tsx +4 -2
- package/dist/content/components/canvas/Grid/grid.tsx +3 -1
- package/dist/content/components/canvas/Image/image.tsx +2 -13
- package/dist/content/components/canvas/Image/placeholder.tsx +20 -0
- package/dist/content/components/canvas/ImageGallery/image-gallery.tsx +3 -1
- package/dist/content/components/canvas/Modal/modal.tsx +69 -12
- package/dist/content/components/{ui → canvas}/Modal/style-utils.ts +4 -4
- package/dist/content/components/canvas/Review/default-variant.tsx +3 -1
- package/dist/content/components/canvas/Review/multi-column-variant.tsx +3 -1
- package/dist/content/components/canvas/Section/columns-variant.tsx +7 -1
- package/dist/content/components/canvas/Section/default-variant.tsx +10 -1
- package/dist/content/components/canvas/Section/section.tsx +4 -0
- package/dist/content/components/canvas/Table/table.tsx +6 -1
- package/dist/content/components/canvas/Tabs/tabs.tsx +6 -1
- package/dist/content/components/canvas/Testimonial/default-variant.tsx +4 -2
- package/dist/content/components/canvas/Testimonial/testimonial.tsx +4 -0
- package/dist/content/components/canvas/Testimonial/with-large-avatar-variant.tsx +4 -2
- package/dist/content/components/canvas/Testimonial/with-overlapping-image-variant.tsx +4 -2
- package/dist/content/components/canvas/Video/index.tsx +2 -0
- package/dist/content/components/canvas/Video/video.tsx +2 -1
- package/dist/content/components/ui/Button/index.ts +5 -2
- package/dist/content/components/ui/Carousel/carousel.tsx +2 -2
- package/dist/content/components/ui/Carousel/index.ts +1 -1
- package/dist/content/components/ui/Container/container.tsx +7 -2
- package/dist/content/components/ui/Container/index.ts +6 -0
- package/dist/content/components/ui/Container/utils.ts +18 -0
- package/dist/content/components/ui/Flex/flex.tsx +27 -19
- package/dist/content/components/ui/Flex/index.ts +5 -1
- package/dist/content/components/ui/Footer/index.ts +1 -1
- package/dist/content/components/ui/Grid/grid.tsx +25 -19
- package/dist/content/components/ui/Grid/index.ts +16 -4
- package/dist/content/components/ui/GridItem/index.ts +10 -4
- package/dist/content/components/ui/Header/index.ts +1 -1
- package/dist/content/components/ui/Text/index.ts +6 -3
- package/dist/image-gallery-F6JLG7XW.mjs +1 -0
- package/dist/{index-D5cLtaIv.d.mts → index-B9eeSbLG.d.mts} +14 -7
- package/dist/index.mjs +1 -1
- package/dist/{mobile-JGZBHQC2.mjs → mobile-UAUHHXPH.mjs} +1 -1
- package/dist/modal-HKMQGV4B.mjs +1 -0
- package/dist/navigation-flyout-MXIJA6PC.mjs +1 -0
- package/dist/navigation-group-DEN3D2BO.mjs +1 -0
- package/dist/tabs-AQFKYC6M.mjs +1 -0
- package/package.json +10 -10
- package/dist/accordion-item-QAVKQEB2.mjs +0 -1
- package/dist/accordion-item-Y4PSNOH4.mjs +0 -1
- package/dist/carousel-RZ2DV6QX.mjs +0 -1
- package/dist/carousel-YELQRJVB.mjs +0 -1
- package/dist/chunk-2BMAPB63.mjs +0 -1
- package/dist/chunk-7GVG4HLE.mjs +0 -1
- package/dist/chunk-EOV2LPGC.mjs +0 -1
- package/dist/chunk-EUVKAE6M.mjs +0 -1
- package/dist/chunk-FIN5US3Q.mjs +0 -1
- package/dist/chunk-PMMAALCQ.mjs +0 -1
- package/dist/chunk-RYEXR67P.mjs +0 -1
- package/dist/chunk-TCQTXNKT.mjs +0 -1
- package/dist/chunk-WAW7PQYM.mjs +0 -1
- package/dist/chunk-YA5BXPZL.mjs +0 -1
- package/dist/content/components/ui/Accordion/accordion.tsx +0 -23
- package/dist/content/components/ui/Accordion/index.tsx +0 -9
- package/dist/content/components/ui/AccordionItem/accordion-item.tsx +0 -41
- package/dist/content/components/ui/AccordionItem/index.tsx +0 -16
- package/dist/content/components/ui/InlineSVG/index.ts +0 -13
- package/dist/content/components/ui/InlineSVG/inline-svg.tsx +0 -59
- package/dist/content/components/ui/InlineSVG/utils.ts +0 -77
- package/dist/content/components/ui/Modal/index.tsx +0 -22
- package/dist/content/components/ui/Modal/modal.tsx +0 -89
- package/dist/image-gallery-AMU6FS7N.mjs +0 -1
- package/dist/modal-43IHAVWB.mjs +0 -1
- package/dist/modal-5FNTFSTN.mjs +0 -1
- package/dist/navigation-flyout-NAU6O2WG.mjs +0 -1
- package/dist/navigation-group-QA65N6AI.mjs +0 -1
- package/dist/tabs-J23TEEQ7.mjs +0 -1
- /package/dist/content/components/{ui → canvas}/AccordionItem/icon-arrow-down.tsx +0 -0
- /package/dist/content/components/{ui → canvas}/AccordionItem/icon-arrow-up.tsx +0 -0
- /package/dist/content/components/{ui → canvas}/Modal/close-icon.tsx +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { FC, SVGProps, ReactElement, HTMLAttributes, ReactNode, PropsWithChildren } from 'react';
|
|
3
|
-
import { T as TextProps, B as ButtonProps, C as ContainerProps, F as FooterProps, H as HeaderProps } from '../../index-
|
|
4
|
-
export { a as ButtonVariant } from '../../index-
|
|
3
|
+
import { T as TextProps, B as ButtonProps, C as ContainerProps, F as FooterProps, H as HeaderProps } from '../../index-B9eeSbLG.mjs';
|
|
4
|
+
export { a as ButtonVariant } from '../../index-B9eeSbLG.mjs';
|
|
5
|
+
import { DefaultTheme } from 'tailwindcss/types/generated/default-theme';
|
|
5
6
|
import { ViewPort } from '../../types/cskTypes.mjs';
|
|
6
7
|
import { ImageProps as ImageProps$1 } from 'next/image';
|
|
7
8
|
import { ReactPlayerProps } from 'react-player';
|
|
@@ -23,7 +24,7 @@ declare const ImageIcon: FC<SVGProps<SVGSVGElement>>;
|
|
|
23
24
|
|
|
24
25
|
declare const VideoIcon: FC<SVGProps<SVGSVGElement>>;
|
|
25
26
|
|
|
26
|
-
type CarouselProps = Pick<ContainerProps, 'title' | 'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | '
|
|
27
|
+
type CarouselProps = Pick<ContainerProps, 'title' | 'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'fullHeight'> & {
|
|
27
28
|
countOfItems?: number;
|
|
28
29
|
children: (options: {
|
|
29
30
|
className?: string;
|
|
@@ -33,17 +34,18 @@ type CarouselProps = Pick<ContainerProps, 'title' | 'backgroundColor' | 'spacing
|
|
|
33
34
|
gapX?: string;
|
|
34
35
|
variant?: string;
|
|
35
36
|
};
|
|
36
|
-
declare const _default$
|
|
37
|
+
declare const _default$2: react.ComponentType<CarouselProps>;
|
|
37
38
|
|
|
38
39
|
declare const Flex: FC<FlexProps>;
|
|
39
40
|
|
|
40
41
|
type Direction = 'row' | 'row-reverse' | 'col' | 'col-reverse';
|
|
41
42
|
type Justify = 'normal' | 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly' | 'stretch';
|
|
43
|
+
type FlexGap = keyof DefaultTheme['spacing'];
|
|
42
44
|
type Align = 'start' | 'end' | 'center' | 'baseline' | 'stretch';
|
|
43
|
-
type FlexProps = Pick<ContainerProps, 'className' | 'wrapperClassName' | 'title' | 'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'height' | 'children'> & {
|
|
45
|
+
type FlexProps = Pick<ContainerProps, 'className' | 'wrapperClassName' | 'title' | 'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'fullHeight' | 'fitHeight' | 'height' | 'children'> & {
|
|
44
46
|
direction?: Direction | ViewPort<Direction>;
|
|
45
47
|
justifyContent?: Justify | ViewPort<Justify>;
|
|
46
|
-
gap?:
|
|
48
|
+
gap?: FlexGap | ViewPort<FlexGap>;
|
|
47
49
|
alignItems?: Align | ViewPort<Align>;
|
|
48
50
|
};
|
|
49
51
|
|
|
@@ -58,20 +60,26 @@ type FlexItemProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
58
60
|
|
|
59
61
|
declare const Grid: FC<GridProps>;
|
|
60
62
|
|
|
61
|
-
type
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
type AvailableColumnsCount = keyof DefaultTheme['gridTemplateColumns'];
|
|
64
|
+
type AvailableGap = keyof DefaultTheme['spacing'];
|
|
65
|
+
type GridProps = Pick<ContainerProps, 'title' | 'backgroundColor' | 'spacing' | 'border' | 'fluidContent' | 'fullHeight' | 'fitHeight' | 'children' | 'height'> & {
|
|
66
|
+
columnsCount?: AvailableColumnsCount | ViewPort<AvailableColumnsCount>;
|
|
67
|
+
gapY?: AvailableGap | ViewPort<AvailableGap>;
|
|
68
|
+
gapX?: AvailableGap | ViewPort<AvailableGap>;
|
|
65
69
|
className?: string;
|
|
66
70
|
};
|
|
67
71
|
|
|
68
72
|
declare const GridItem: FC<GridItemProps>;
|
|
69
73
|
|
|
74
|
+
type AvailableColumnStart = keyof DefaultTheme['gridColumnStart'];
|
|
75
|
+
type AvailableColumnSpan = keyof DefaultTheme['gridColumn'];
|
|
76
|
+
type AvailableGridRowStart = keyof DefaultTheme['gridRowStart'];
|
|
77
|
+
type AvailableGridRowSpan = keyof DefaultTheme['gridRow'];
|
|
70
78
|
type GridItemProps = HTMLAttributes<HTMLDivElement> & {
|
|
71
|
-
columnStart?:
|
|
72
|
-
columnSpan?:
|
|
73
|
-
rowStart?:
|
|
74
|
-
rowSpan?:
|
|
79
|
+
columnStart?: AvailableColumnStart | ViewPort<AvailableColumnStart>;
|
|
80
|
+
columnSpan?: AvailableColumnSpan | ViewPort<AvailableColumnSpan>;
|
|
81
|
+
rowStart?: AvailableGridRowStart | ViewPort<AvailableGridRowStart>;
|
|
82
|
+
rowSpan?: AvailableGridRowSpan | ViewPort<AvailableGridRowSpan>;
|
|
75
83
|
className?: string;
|
|
76
84
|
};
|
|
77
85
|
|
|
@@ -143,7 +151,7 @@ type ThemeSwitcherProps = {
|
|
|
143
151
|
iconColor?: string;
|
|
144
152
|
onChange?: (theme: string) => void;
|
|
145
153
|
};
|
|
146
|
-
declare const _default$
|
|
154
|
+
declare const _default$1: react.ComponentType<ThemeSwitcherProps>;
|
|
147
155
|
|
|
148
156
|
type VideoProps = ReactPlayerProps & {
|
|
149
157
|
autoPlay?: boolean;
|
|
@@ -153,50 +161,6 @@ type VideoProps = ReactPlayerProps & {
|
|
|
153
161
|
overlayOpacity?: NonNullable<ImageProps$1['style']>['opacity'];
|
|
154
162
|
border?: string | ViewPort<string>;
|
|
155
163
|
};
|
|
156
|
-
declare const _default
|
|
164
|
+
declare const _default: react.ComponentType<VideoProps>;
|
|
157
165
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
type InlineSVGProps = {
|
|
161
|
-
src: string;
|
|
162
|
-
className?: string;
|
|
163
|
-
fill?: boolean;
|
|
164
|
-
width?: number;
|
|
165
|
-
height?: number;
|
|
166
|
-
sanitize?: boolean;
|
|
167
|
-
fallback?: React.ReactNode;
|
|
168
|
-
useCurrentColor?: boolean;
|
|
169
|
-
alt?: string;
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
declare const Accordion: FC<AccordionProps>;
|
|
173
|
-
|
|
174
|
-
type AccordionProps = ContainerProps & {
|
|
175
|
-
accordionContent?: ReactNode;
|
|
176
|
-
accordionItems: ReactNode;
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
type AccordionItemParameters = Pick<ContainerProps, 'backgroundColor' | 'spacing' | 'border'> & {
|
|
180
|
-
text: ReactElement;
|
|
181
|
-
accordionItemContent: ReactNode;
|
|
182
|
-
};
|
|
183
|
-
type AccordionItemAdditionalProps = {
|
|
184
|
-
className?: string;
|
|
185
|
-
};
|
|
186
|
-
type AccordionItemProps = AccordionItemParameters & AccordionItemAdditionalProps;
|
|
187
|
-
declare const _default$1: react.ComponentType<AccordionItemProps>;
|
|
188
|
-
|
|
189
|
-
type ModalProps = {
|
|
190
|
-
maxWidth?: 'small' | 'medium' | 'large';
|
|
191
|
-
className?: string;
|
|
192
|
-
backgroundColor?: string;
|
|
193
|
-
closeIconColor?: string;
|
|
194
|
-
disableCloseModalOnClickOutside?: boolean;
|
|
195
|
-
trigger: ReactNode;
|
|
196
|
-
content: ReactNode;
|
|
197
|
-
actions?: ReactNode;
|
|
198
|
-
onChangeModalState?: (state: boolean) => void;
|
|
199
|
-
};
|
|
200
|
-
declare const _default: react.ComponentType<ModalProps>;
|
|
201
|
-
|
|
202
|
-
export { Accordion, _default$1 as AccordionItem, type AccordionItemProps, type AccordionProps, Arrow as ArrowIcon, Button, ButtonProps, _default$4 as Carousel, type CarouselProps, Container, ContainerProps, Flex, FlexItem, type FlexItemProps, type FlexProps, Footer, FooterProps, Grid, GridItem, type GridItemProps, type GridProps, Header, HeaderProps, IconLabel, type IconLabelProps, Image, ImageIcon, type ImageProps, InlineSVG, type InlineSVGProps, Link, type LinkProps, MediaPlaceholder, type MediaPlaceholderType, _default as Modal, type ModalProps, Page, type PageProps, Rating, type RatingProps, Text, TextProps, _default$3 as ThemeSwitcher, type ThemeSwitcherProps, _default$2 as Video, VideoIcon, type VideoProps };
|
|
166
|
+
export { Arrow as ArrowIcon, Button, ButtonProps, _default$2 as Carousel, type CarouselProps, Container, ContainerProps, Flex, FlexItem, type FlexItemProps, type FlexProps, Footer, FooterProps, Grid, GridItem, type GridItemProps, type GridProps, Header, HeaderProps, IconLabel, type IconLabelProps, Image, ImageIcon, type ImageProps, Link, type LinkProps, MediaPlaceholder, type MediaPlaceholderType, Page, type PageProps, Rating, type RatingProps, Text, TextProps, _default$1 as ThemeSwitcher, type ThemeSwitcherProps, _default as Video, VideoIcon, type VideoProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as h}from"../../chunk-V4EBWEG4.mjs";import{a as c,b as g,c as F}from"../../chunk-M3BGP5VE.mjs";import{a as i}from"../../chunk-AKRWCDDG.mjs";import{a as o}from"../../chunk-5VM2Y55L.mjs";import{a as t,b as r,c as a,d as m,e as x,f as y,g as n,h as I}from"../../chunk-4LWAGTFW.mjs";import{a as f,b as s,c as d}from"../../chunk-6TUDWIYU.mjs";import{a as l}from"../../chunk-QHIWJPL6.mjs";import{a as u,b as P}from"../../chunk-Z7JSWSPD.mjs";import{a as p}from"../../chunk-BK7UG4U4.mjs";import{b as e}from"../../chunk-YUCUJWBO.mjs";import"../../chunk-RX4IAAQQ.mjs";import"../../chunk-S7CSCIW4.mjs";import"../../chunk-YEKQJ4YC.mjs";export{f as ArrowIcon,r as Button,a as ButtonVariant,o as Carousel,e as Container,c as Flex,g as FlexItem,x as Footer,u as Grid,P as GridItem,y as Header,i as IconLabel,p as Image,s as ImageIcon,t as Link,m as MediaPlaceholder,n as Page,I as Rating,l as Text,h as ThemeSwitcher,F as Video,d as VideoIcon};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { UniformSlot } from '@uniformdev/canvas-next-rsc/component';
|
|
3
|
-
import
|
|
3
|
+
import Container from '@/components/ui/Container';
|
|
4
4
|
import { AccordionProps } from '.';
|
|
5
5
|
|
|
6
6
|
export const Accordion: FC<AccordionProps> = ({
|
|
@@ -11,11 +11,17 @@ export const Accordion: FC<AccordionProps> = ({
|
|
|
11
11
|
spacing,
|
|
12
12
|
border,
|
|
13
13
|
fluidContent,
|
|
14
|
+
fullHeight,
|
|
15
|
+
fitHeight,
|
|
14
16
|
height,
|
|
15
17
|
}) => (
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
<Container
|
|
19
|
+
className="flex flex-col gap-8"
|
|
20
|
+
{...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
|
|
21
|
+
>
|
|
22
|
+
<div className="flex flex-col gap-4 text-start">
|
|
23
|
+
<UniformSlot data={component} context={context} slot={slots.accordionContent} />
|
|
24
|
+
</div>
|
|
25
|
+
<UniformSlot data={component} context={context} slot={slots.accordionItems} />
|
|
26
|
+
</Container>
|
|
21
27
|
);
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { FC } from 'react';
|
|
3
|
+
import { FC, useCallback, useState } from 'react';
|
|
4
4
|
import { UniformSlot, UniformText } from '@uniformdev/canvas-next-rsc/component';
|
|
5
|
-
import
|
|
5
|
+
import Container from '@/components/ui/Container';
|
|
6
6
|
import BaseText from '@/components/ui/Text';
|
|
7
|
+
import { cn } from '@/utils/styling';
|
|
7
8
|
import { AccordionItemProps } from '.';
|
|
9
|
+
import { IconArrowDown } from './icon-arrow-down';
|
|
10
|
+
import { IconArrowUp } from './icon-arrow-up';
|
|
8
11
|
|
|
9
12
|
export const AccordionItem: FC<AccordionItemProps> = ({
|
|
10
13
|
tag,
|
|
@@ -22,24 +25,34 @@ export const AccordionItem: FC<AccordionItemProps> = ({
|
|
|
22
25
|
backgroundColor,
|
|
23
26
|
spacing,
|
|
24
27
|
className,
|
|
25
|
-
}) =>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
28
|
+
}) => {
|
|
29
|
+
const [isOpened, setOpened] = useState(false);
|
|
30
|
+
const toggleOpenAccordion = useCallback(() => setOpened(isOpened => !isOpened), []);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Container {...{ fluidContent: true }}>
|
|
34
|
+
<Container {...{ backgroundColor, spacing, fluidContent: true, className }}>
|
|
35
|
+
<button onClick={toggleOpenAccordion} className="flex w-full flex-row items-center justify-between text-start">
|
|
36
|
+
<BaseText {...{ alignment, color, size, font, weight, transform, decoration, letterSpacing }}>
|
|
37
|
+
<UniformText
|
|
38
|
+
placeholder="Text goes here"
|
|
39
|
+
parameterId="text"
|
|
40
|
+
as={tag || undefined}
|
|
41
|
+
component={component}
|
|
42
|
+
context={context}
|
|
43
|
+
/>
|
|
44
|
+
</BaseText>
|
|
45
|
+
<div
|
|
46
|
+
className={cn({
|
|
47
|
+
[`text-${backgroundColor} invert`]: !!backgroundColor,
|
|
48
|
+
'text-black dark:text-white': !backgroundColor,
|
|
49
|
+
})}
|
|
50
|
+
>
|
|
51
|
+
{isOpened ? <IconArrowDown /> : <IconArrowUp />}
|
|
52
|
+
</div>
|
|
53
|
+
</button>
|
|
54
|
+
</Container>
|
|
55
|
+
{isOpened && <UniformSlot data={component} context={context} slot={slots.accordionItemContent} />}
|
|
56
|
+
</Container>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DefaultTheme } from 'tailwindcss/types/generated/default-theme';
|
|
1
2
|
import { AssetParamValue } from '@uniformdev/assets';
|
|
2
3
|
import { LinkParamValue } from '@uniformdev/canvas';
|
|
3
4
|
import { ComponentProps } from '@uniformdev/canvas-next-rsc/component';
|
|
@@ -9,7 +10,7 @@ export type ButtonParameters = {
|
|
|
9
10
|
text?: string;
|
|
10
11
|
link?: LinkParamValue;
|
|
11
12
|
textColor?: string;
|
|
12
|
-
textWeight?:
|
|
13
|
+
textWeight?: keyof DefaultTheme['fontWeight'];
|
|
13
14
|
textFont?: 'uppercase' | 'lowercase' | 'capitalize' | 'normal-case';
|
|
14
15
|
textTransform?: string;
|
|
15
16
|
buttonColor?: string;
|
|
@@ -12,6 +12,8 @@ export const Card: FC<CardProps> = ({
|
|
|
12
12
|
spacing,
|
|
13
13
|
border,
|
|
14
14
|
fluidContent,
|
|
15
|
+
fullHeight,
|
|
16
|
+
fitHeight,
|
|
15
17
|
height,
|
|
16
18
|
className,
|
|
17
19
|
contentClassName,
|
|
@@ -21,7 +23,7 @@ export const Card: FC<CardProps> = ({
|
|
|
21
23
|
return (
|
|
22
24
|
<Container
|
|
23
25
|
className={cn('relative overflow-hidden', className)}
|
|
24
|
-
{...{ backgroundColor, spacing, border, fluidContent, height }}
|
|
26
|
+
{...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
|
|
25
27
|
>
|
|
26
28
|
<div
|
|
27
29
|
className={cn({
|
|
@@ -13,12 +13,14 @@ export const Carousel: FC<CarouselProps> = ({
|
|
|
13
13
|
spacing,
|
|
14
14
|
border,
|
|
15
15
|
fluidContent,
|
|
16
|
+
fullHeight,
|
|
17
|
+
fitHeight,
|
|
16
18
|
height,
|
|
17
19
|
itemsPerPage,
|
|
18
20
|
gapX,
|
|
19
21
|
}) => (
|
|
20
22
|
<BaseCarousel
|
|
21
|
-
{...{ backgroundColor, spacing, border, fluidContent, height, itemsPerPage, gapX }}
|
|
23
|
+
{...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height, itemsPerPage, gapX }}
|
|
22
24
|
countOfItems={slots.carouselItems?.items.length ?? 0}
|
|
23
25
|
variant={component.variant}
|
|
24
26
|
>
|
|
@@ -13,6 +13,8 @@ export const Container: FC<ContainerProps> = ({
|
|
|
13
13
|
spacing,
|
|
14
14
|
border,
|
|
15
15
|
fluidContent,
|
|
16
|
+
fullHeight,
|
|
17
|
+
fitHeight,
|
|
16
18
|
height,
|
|
17
19
|
className,
|
|
18
20
|
}) => (
|
|
@@ -24,6 +26,8 @@ export const Container: FC<ContainerProps> = ({
|
|
|
24
26
|
spacing,
|
|
25
27
|
border,
|
|
26
28
|
fluidContent,
|
|
29
|
+
fullHeight,
|
|
30
|
+
fitHeight,
|
|
27
31
|
height,
|
|
28
32
|
className,
|
|
29
33
|
}}
|
|
@@ -9,5 +9,9 @@ export type ContainerParameters = {
|
|
|
9
9
|
spacing?: SpaceType | ViewPort<SpaceType>;
|
|
10
10
|
border?: string | ViewPort<string>;
|
|
11
11
|
fluidContent?: boolean;
|
|
12
|
+
/** @deprecated Use height prop instead */
|
|
13
|
+
fullHeight?: boolean;
|
|
14
|
+
/** @deprecated Use height prop instead */
|
|
15
|
+
fitHeight?: boolean;
|
|
12
16
|
height?: HeightType | ViewPort<HeightType>;
|
|
13
17
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { imageFrom } from '@uniformdev/assets';
|
|
3
2
|
import { ComponentInstance } from '@uniformdev/canvas';
|
|
4
3
|
import { CompositionContext, UniformText } from '@uniformdev/canvas-next-rsc/component';
|
|
5
4
|
import { TextParameters } from '@/components/canvas/Text/parameters';
|
|
@@ -96,7 +95,6 @@ export const BaseHeroImage: FC<BaseImageParameters & Omit<ComponentProps, 'param
|
|
|
96
95
|
border,
|
|
97
96
|
priority,
|
|
98
97
|
unoptimized,
|
|
99
|
-
fill,
|
|
100
98
|
}) => {
|
|
101
99
|
const [resolvedImage] = resolveAsset(image);
|
|
102
100
|
|
|
@@ -115,38 +113,14 @@ export const BaseHeroImage: FC<BaseImageParameters & Omit<ComponentProps, 'param
|
|
|
115
113
|
);
|
|
116
114
|
}
|
|
117
115
|
|
|
118
|
-
const {
|
|
119
|
-
|
|
120
|
-
const imageWidth = width || resolvedImage.width;
|
|
121
|
-
const imageHeight = height || resolvedImage.height;
|
|
122
|
-
|
|
123
|
-
if (!fill && (!imageWidth || !imageHeight)) {
|
|
124
|
-
console.warn(
|
|
125
|
-
'No dimensions provided for the Next.js Image component. Falling back to a standard <img> tag for rendering.'
|
|
126
|
-
);
|
|
127
|
-
return <img src={resolvedImage.url} alt={title} />;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
const imageUrl = imageFrom(resolvedImage?.url)
|
|
131
|
-
.transform({
|
|
132
|
-
width: width,
|
|
133
|
-
height: height,
|
|
134
|
-
fit: objectFit,
|
|
135
|
-
focal: focalPoint,
|
|
136
|
-
})
|
|
137
|
-
.url();
|
|
138
|
-
|
|
139
|
-
const variantBasedProps = fill
|
|
140
|
-
? { fill: true }
|
|
141
|
-
: {
|
|
142
|
-
width: imageWidth,
|
|
143
|
-
height: imageHeight,
|
|
144
|
-
};
|
|
116
|
+
const { url, title = '' } = resolvedImage;
|
|
145
117
|
|
|
146
118
|
return (
|
|
147
119
|
<BaseImage
|
|
148
|
-
|
|
120
|
+
containerStyle={{ ...(width ? { width: `${width}px` } : {}), ...(height ? { height: `${height}px` } : {}) }}
|
|
121
|
+
src={url}
|
|
149
122
|
alt={title}
|
|
123
|
+
fill
|
|
150
124
|
unoptimized={unoptimized}
|
|
151
125
|
priority={priority}
|
|
152
126
|
sizes="100%"
|
|
@@ -155,7 +129,6 @@ export const BaseHeroImage: FC<BaseImageParameters & Omit<ComponentProps, 'param
|
|
|
155
129
|
contrastBaseColor={contrastBaseColor}
|
|
156
130
|
overlayOpacity={overlayOpacity}
|
|
157
131
|
border={border}
|
|
158
|
-
{...variantBasedProps}
|
|
159
132
|
/>
|
|
160
133
|
);
|
|
161
134
|
};
|
|
@@ -8,6 +8,10 @@ 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'];
|
|
11
15
|
height: FlexibleHeroParameters['height'];
|
|
12
16
|
variant?: DemoHeroVariants;
|
|
13
17
|
demoHeroMedia: React.ReactNode;
|
|
@@ -22,6 +26,8 @@ export const ColumnsVariant: FC<ColumnsVariantProps> = ({
|
|
|
22
26
|
spacing,
|
|
23
27
|
border,
|
|
24
28
|
fluidContent,
|
|
29
|
+
fullHeight,
|
|
30
|
+
fitHeight,
|
|
25
31
|
height,
|
|
26
32
|
variant,
|
|
27
33
|
demoHeroMedia,
|
|
@@ -30,7 +36,7 @@ export const ColumnsVariant: FC<ColumnsVariantProps> = ({
|
|
|
30
36
|
textAlignmentClass,
|
|
31
37
|
buttonAlignmentClass,
|
|
32
38
|
}) => (
|
|
33
|
-
<Container {...{ backgroundColor, spacing, border, fluidContent, height }}>
|
|
39
|
+
<Container {...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}>
|
|
34
40
|
<div className={cn('grid grid-cols-1 items-center gap-4 px-4 lg:grid-cols-2 xl:px-0')}>
|
|
35
41
|
<div className={cn('aspect-square', { 'order-last': variant === DemoHeroVariants.ColumnsReverse })}>
|
|
36
42
|
<div className="flex size-full items-center justify-center overflow-hidden">{demoHeroMedia}</div>
|
|
@@ -8,6 +8,8 @@ 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'];
|
|
11
13
|
height: FlexibleHeroParameters['height'];
|
|
12
14
|
demoHeroMedia: React.ReactNode;
|
|
13
15
|
demoHeroContent: React.ReactNode;
|
|
@@ -21,6 +23,8 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
|
|
|
21
23
|
spacing,
|
|
22
24
|
border,
|
|
23
25
|
fluidContent,
|
|
26
|
+
fullHeight,
|
|
27
|
+
fitHeight,
|
|
24
28
|
height,
|
|
25
29
|
demoHeroMedia,
|
|
26
30
|
demoHeroContent,
|
|
@@ -28,7 +32,10 @@ export const DefaultVariant: FC<DefaultVariantProps> = ({
|
|
|
28
32
|
textAlignmentClass,
|
|
29
33
|
buttonAlignmentClass,
|
|
30
34
|
}) => (
|
|
31
|
-
<Container
|
|
35
|
+
<Container
|
|
36
|
+
className="relative overflow-hidden"
|
|
37
|
+
{...{ backgroundColor, spacing, border, fluidContent, fullHeight, fitHeight, height }}
|
|
38
|
+
>
|
|
32
39
|
<div className="absolute left-0 top-0 size-full overflow-hidden">{demoHeroMedia}</div>
|
|
33
40
|
<Container className="relative flex flex-col gap-8">
|
|
34
41
|
<div className={cn('flex flex-col gap-4', textAlignmentClass)}>{demoHeroContent}</div>
|
|
@@ -71,13 +71,14 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
|
|
|
71
71
|
imageBorder,
|
|
72
72
|
imagePriority,
|
|
73
73
|
imageUnoptimized,
|
|
74
|
-
imageFill,
|
|
75
74
|
// Presentation Parameters
|
|
76
75
|
contentAlignment,
|
|
77
76
|
backgroundColor,
|
|
78
77
|
spacing,
|
|
79
78
|
border,
|
|
80
79
|
fluidContent,
|
|
80
|
+
fullHeight,
|
|
81
|
+
fitHeight,
|
|
81
82
|
height,
|
|
82
83
|
isFlexibleHero = false,
|
|
83
84
|
component,
|
|
@@ -194,6 +195,8 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
|
|
|
194
195
|
spacing,
|
|
195
196
|
border,
|
|
196
197
|
fluidContent,
|
|
198
|
+
fullHeight,
|
|
199
|
+
fitHeight,
|
|
197
200
|
height,
|
|
198
201
|
textAlignmentClass: getTextAlignmentClass({ contentAlignment }),
|
|
199
202
|
buttonAlignmentClass: getButtonAlignmentClass({ contentAlignment }),
|
|
@@ -212,7 +215,6 @@ export const DemoHero: FC<(FixedHeroProps | FlexibleHeroProps) & { isFlexibleHer
|
|
|
212
215
|
imageBorder,
|
|
213
216
|
imagePriority,
|
|
214
217
|
imageUnoptimized,
|
|
215
|
-
imageFill,
|
|
216
218
|
},
|
|
217
219
|
'image'
|
|
218
220
|
)}
|
|
@@ -1,60 +1,69 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { FixedHeroProps } from '.';
|
|
3
3
|
import { DemoHero } from './demo-hero';
|
|
4
|
-
import { getImageParametersFocalPoint } from './utils';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
5
|
+
const getImageOverlayOpacity = (overlayAutoTint?: string, enableOverlayAutoTint?: boolean) => {
|
|
6
|
+
if (overlayAutoTint) return overlayAutoTint;
|
|
7
|
+
// Cover deprecated case
|
|
8
|
+
if (enableOverlayAutoTint) return '0.3';
|
|
9
|
+
return undefined;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const FixedHero: FC<FixedHeroProps> = ({ textColor, overlayAutoTint, enableOverlayAutoTint, ...props }) => {
|
|
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
|
+
};
|