@nuskin/marketing-components 1.39.2-window-references.2 → 1.40.0
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/button/Button.d.ts +4 -0
- package/dist/button/Button.stories.d.ts +28 -0
- package/dist/button/Button.styled.d.ts +47 -0
- package/dist/button/ButtonWrapper.d.ts +9 -0
- package/dist/button/helpers.d.ts +59 -0
- package/dist/button/index.d.ts +3 -0
- package/dist/button/specs/Button.spec.d.ts +1 -0
- package/dist/button/specs/ButtonWrapper.spec.d.ts +1 -0
- package/dist/button/types.d.ts +42 -0
- package/dist/bynder-media/BynderMedia.d.ts +3 -0
- package/dist/bynder-media/BynderMedia.styled.d.ts +36 -0
- package/dist/bynder-media/index.d.ts +3 -0
- package/dist/bynder-media/specs/bynder-utils.spec.d.ts +1 -0
- package/dist/bynder-media/specs/mockData.d.ts +139 -0
- package/dist/bynder-media/types.d.ts +61 -0
- package/dist/bynder-media/utils.d.ts +3 -0
- package/dist/carousel/Carousel.d.ts +6 -0
- package/dist/carousel/Carousel.stories.d.ts +14 -0
- package/dist/carousel/CarouselLayout.styled.d.ts +50 -0
- package/dist/carousel/hooks/useCarouselLayout.d.ts +31 -0
- package/dist/carousel/hooks/useCarouselResize.d.ts +6 -0
- package/dist/carousel/index.d.ts +2 -0
- package/dist/carousel/mocks/MockContentCard.d.ts +20 -0
- package/dist/carousel/mocks/MockHeroBanner.d.ts +18 -0
- package/dist/carousel/mocks/MockProductCard.d.ts +9 -0
- package/dist/carousel/mocks/index.d.ts +7 -0
- package/dist/carousel/mocks/mockAssets.d.ts +15 -0
- package/dist/carousel/shared.d.ts +27 -0
- package/dist/carousel/specs/Carousel.spec.d.ts +1 -0
- package/dist/carousel/specs/useCarouselResize.spec.d.ts +1 -0
- package/dist/carousel/specs/utils.spec.d.ts +1 -0
- package/dist/carousel/types.d.ts +56 -0
- package/dist/carousel/utils.d.ts +47 -0
- package/dist/column-control/ColumnControl.d.ts +4 -0
- package/dist/column-control/ColumnControl.stories.d.ts +13 -0
- package/dist/column-control/ColumnControl.styled.d.ts +49 -0
- package/dist/column-control/index.d.ts +2 -0
- package/dist/column-control/mocks/MockContentCard.d.ts +13 -0
- package/dist/column-control/mocks/MockProductCard.d.ts +9 -0
- package/dist/column-control/mocks/index.d.ts +5 -0
- package/dist/column-control/specs/ColumnControl.spec.d.ts +1 -0
- package/dist/column-control/specs/utils.spec.d.ts +1 -0
- package/dist/column-control/types.d.ts +48 -0
- package/dist/column-control/utils.d.ts +24 -0
- package/dist/content-card/ContentCard.d.ts +4 -0
- package/dist/content-card/ContentCard.stories.d.ts +12 -0
- package/dist/content-card/ContentCard.styled.d.ts +35 -0
- package/dist/content-card/constants.d.ts +3 -0
- package/dist/content-card/index.d.ts +2 -0
- package/dist/content-card/specs/ContentCard.spec.d.ts +1 -0
- package/dist/content-card/specs/helpers.spec.d.ts +1 -0
- package/dist/content-card/types.d.ts +31 -0
- package/dist/content-card/utils/helpers.d.ts +20 -0
- package/dist/hero-banner/HeroBanner.d.ts +4 -0
- package/dist/hero-banner/HeroBanner.stories.d.ts +17 -0
- package/dist/hero-banner/HeroBanner.styled.d.ts +35 -0
- package/dist/hero-banner/components/TypographyFields.d.ts +13 -0
- package/dist/hero-banner/constants.d.ts +5 -0
- package/dist/hero-banner/helpers.d.ts +12 -0
- package/dist/hero-banner/index.d.ts +2 -0
- package/dist/hero-banner/specs/HeroBanner.spec.d.ts +1 -0
- package/dist/hero-banner/specs/helpers.spec.d.ts +1 -0
- package/dist/hero-banner/types.d.ts +26 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/use-toggle-font-color/useMainContrast.d.ts +8 -0
- package/dist/hooks/use-toggle-font-color/useMainContrast.spec.d.ts +1 -0
- package/dist/hooks/use-toggle-font-color/useToggleFontColor.d.ts +8 -0
- package/dist/hooks/use-toggle-font-color/useToggleFontColor.spec.d.ts +1 -0
- package/dist/hooks/useRouteReplacer.d.ts +10 -0
- package/dist/hooks/useRouteReplacer.spec.d.ts +1 -0
- package/dist/image/CsImage.d.ts +4 -0
- package/dist/image/CsImage.stories.d.ts +7 -0
- package/dist/image/CsImage.styled.d.ts +8 -0
- package/dist/image/index.d.ts +1 -0
- package/dist/image/specs/CsImage.spec.d.ts +1 -0
- package/dist/image/types.d.ts +73 -0
- package/dist/index.d.ts +11 -446
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/marketing-banner/MarketingBanner.d.ts +7 -0
- package/dist/marketing-banner/MarketingBanner.stories.d.ts +206 -0
- package/dist/marketing-banner/MarketingBanner.styled.d.ts +62 -0
- package/dist/marketing-banner/components/BannerText.d.ts +7 -0
- package/dist/marketing-banner/components/BannerText.styled.d.ts +23 -0
- package/dist/marketing-banner/components/index.d.ts +1 -0
- package/dist/marketing-banner/components/specs/BannerText.spec.d.ts +5 -0
- package/dist/marketing-banner/constants.d.ts +22 -0
- package/dist/marketing-banner/hooks/index.d.ts +2 -0
- package/dist/marketing-banner/hooks/useCarousel.d.ts +14 -0
- package/dist/marketing-banner/hooks/useReducedMotion.d.ts +5 -0
- package/dist/marketing-banner/index.d.ts +3 -0
- package/dist/marketing-banner/specs/MarketingBanner.spec.d.ts +5 -0
- package/dist/marketing-banner/specs/mockData.d.ts +22 -0
- package/dist/marketing-banner/specs/useCarousel.spec.d.ts +5 -0
- package/dist/marketing-banner/specs/utils.spec.d.ts +1 -0
- package/dist/marketing-banner/styles/mixins.d.ts +53 -0
- package/dist/marketing-banner/styles/theme.d.ts +99 -0
- package/dist/marketing-banner/types.d.ts +57 -0
- package/dist/marketing-banner/utils/index.d.ts +1 -0
- package/dist/marketing-banner/utils/utils.d.ts +4 -0
- package/dist/rich-text/RichText.d.ts +27 -0
- package/dist/rich-text/RichText.stories.d.ts +8 -0
- package/dist/rich-text/index.d.ts +1 -0
- package/dist/rich-text/specs/RichText.spec.d.ts +1 -0
- package/dist/spacing-divider/SpacingDivider.d.ts +4 -0
- package/dist/spacing-divider/SpacingDivider.stories.d.ts +6 -0
- package/dist/spacing-divider/SpacingDivider.styled.d.ts +9 -0
- package/dist/spacing-divider/index.d.ts +2 -0
- package/dist/spacing-divider/specs/SpacingDivider.spec.d.ts +1 -0
- package/dist/spacing-divider/types.d.ts +26 -0
- package/dist/spacing-divider/utils/specs/utils.spec.d.ts +1 -0
- package/dist/spacing-divider/utils/utils.d.ts +13 -0
- package/dist/text/CsText.d.ts +15 -0
- package/dist/text/CsText.stories.d.ts +7 -0
- package/dist/text/index.d.ts +1 -0
- package/dist/text/specs/CsText.spec.d.ts +1 -0
- package/dist/typography/Typography.d.ts +18 -0
- package/dist/typography/Typography.stories.d.ts +6 -0
- package/dist/typography/Typography.styled.d.ts +80 -0
- package/dist/typography/index.d.ts +3 -0
- package/dist/typography/specs/Typography.spec.d.ts +1 -0
- package/dist/typography/types.d.ts +18 -0
- package/dist/utils/deviceConstants.d.ts +13 -0
- package/dist/utils/route-utils.d.ts +18 -0
- package/dist/utils/specs/route-utils.spec.d.ts +1 -0
- package/dist/utils/viewportLayoutUtils.d.ts +4 -0
- package/package.json +1 -1
- package/dist/index.d.mts +0 -446
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
declare function ButtonStory(args: Record<string, unknown>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const meta: Meta<typeof ButtonStory>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ButtonStory>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const AddToCart: Story;
|
|
8
|
+
export declare const BuyNow: Story;
|
|
9
|
+
export declare const ShopNow: Story;
|
|
10
|
+
export declare const LearnMore: Story;
|
|
11
|
+
export declare const ViewDetails: Story;
|
|
12
|
+
export declare const ExternalLink: Story;
|
|
13
|
+
export declare const AbsoluteHttpUrl: Story;
|
|
14
|
+
export declare const AbsoluteHttpsUrl: Story;
|
|
15
|
+
export declare const ProtocolRelativeUrl: Story;
|
|
16
|
+
export declare const SubmitButton: Story;
|
|
17
|
+
export declare const CancelButton: Story;
|
|
18
|
+
export declare const DisabledSubmit: Story;
|
|
19
|
+
export declare const SmallButton: Story;
|
|
20
|
+
export declare const MediumButton: Story;
|
|
21
|
+
export declare const LargeButton: Story;
|
|
22
|
+
export declare const PrimaryButton: Story;
|
|
23
|
+
export declare const SecondaryButton: Story;
|
|
24
|
+
export declare const LinkButton: Story;
|
|
25
|
+
export declare const IconLeft: Story;
|
|
26
|
+
export declare const IconRight: Story;
|
|
27
|
+
export declare const EditingMode: Story;
|
|
28
|
+
export declare const RoundedButton: Story;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ButtonAlignment, ButtonVariant } from './types';
|
|
3
|
+
export declare const ButtonContainer: import("@emotion/styled").StyledComponent<{
|
|
4
|
+
theme?: import("@emotion/react").Theme;
|
|
5
|
+
as?: React.ElementType;
|
|
6
|
+
} & {
|
|
7
|
+
alignment: ButtonAlignment;
|
|
8
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
9
|
+
interface StyledButtonProps {
|
|
10
|
+
$variant: ButtonVariant;
|
|
11
|
+
$buttonWidth: string;
|
|
12
|
+
$maxButtonWidth?: string;
|
|
13
|
+
$buttonType: 'square' | 'rounded';
|
|
14
|
+
$bg: string;
|
|
15
|
+
$hover: string;
|
|
16
|
+
$pressed: string;
|
|
17
|
+
$text: string;
|
|
18
|
+
$border: string;
|
|
19
|
+
$disabledBg: string;
|
|
20
|
+
$disabledText: string;
|
|
21
|
+
$focusRing: string;
|
|
22
|
+
$hoverText?: string;
|
|
23
|
+
$underlineColor?: string;
|
|
24
|
+
href?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const StyledButton: import("@emotion/styled").StyledComponent<Pick<import("@mui/material/Button").ButtonProps, "color" | "fullWidth" | "href" | "className" | "variant" | "aria-label" | "type" | "disabled" | "endIcon" | "size" | "startIcon" | "onFocus" | "onBlur" | "onChange" | "onClick"> & {
|
|
27
|
+
iconOnly?: boolean;
|
|
28
|
+
darkModeEnabled?: boolean;
|
|
29
|
+
startIconName?: import("@nuskin/foundation-ui-components").NsIconProps["name"];
|
|
30
|
+
endIconName?: import("@nuskin/foundation-ui-components").NsIconProps["name"];
|
|
31
|
+
} & {
|
|
32
|
+
children?: React.ReactNode | undefined;
|
|
33
|
+
} & {
|
|
34
|
+
theme?: import("@emotion/react").Theme;
|
|
35
|
+
} & StyledButtonProps, {}, {}>;
|
|
36
|
+
export declare const StyledLabelText: import("@emotion/styled").StyledComponent<{
|
|
37
|
+
theme?: import("@emotion/react").Theme;
|
|
38
|
+
as?: React.ElementType;
|
|
39
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
40
|
+
interface StyledIconWrapperProps {
|
|
41
|
+
position: 'left' | 'right';
|
|
42
|
+
}
|
|
43
|
+
export declare const StyledIconWrapper: import("@emotion/styled").StyledComponent<{
|
|
44
|
+
theme?: import("@emotion/react").Theme;
|
|
45
|
+
as?: React.ElementType;
|
|
46
|
+
} & StyledIconWrapperProps, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonProps, ButtonBlockProp } from './types';
|
|
3
|
+
export type ButtonWrapperProps = {
|
|
4
|
+
parent$?: Record<string, unknown>;
|
|
5
|
+
alignment?: ButtonProps['alignment'];
|
|
6
|
+
isEditing?: boolean;
|
|
7
|
+
} & Partial<ButtonBlockProp>;
|
|
8
|
+
declare const Buttons: React.FC<ButtonWrapperProps>;
|
|
9
|
+
export default Buttons;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { ButtonSize, LinkTarget } from './types';
|
|
2
|
+
export declare const ROUNDED_BORDER_RADIUS = "25px";
|
|
3
|
+
export declare const ICON_MARGIN = 2;
|
|
4
|
+
export declare const FLEX_SHRINK_ZERO = 0;
|
|
5
|
+
export declare const REL_NOOPENER_NOREFERRER = "noopener noreferrer";
|
|
6
|
+
export declare const CSS_WORD_BREAK = "break-word";
|
|
7
|
+
export declare const PROTOCOL_HTTP = "http:";
|
|
8
|
+
export declare const PROTOCOL_HTTPS = "https:";
|
|
9
|
+
export declare const DISABLED_STATE_STRING = "disabled";
|
|
10
|
+
export declare const DEFAULT_VARIANT = "primary";
|
|
11
|
+
export declare const DEFAULT_SIZE = "small";
|
|
12
|
+
export declare const DEFAULT_ALIGNMENT = "left";
|
|
13
|
+
export declare const DEFAULT_ICON_POSITION = "left";
|
|
14
|
+
export declare const DEFAULT_BUTTON_TYPE = "square";
|
|
15
|
+
export declare const DEFAULT_PLACEHOLDER_TEXT = "Enter Title";
|
|
16
|
+
export declare const DEFAULT_TARGET = "No";
|
|
17
|
+
export declare const BUTTON_TYPE_ROUNDED = "rounded";
|
|
18
|
+
export declare const BUTTON_TYPE_SQUARE = "square";
|
|
19
|
+
export declare const BORDER_COLOR_TRANSPARENT = "transparent";
|
|
20
|
+
export declare const BASE_URL: string;
|
|
21
|
+
export declare function isValidUrl(url?: string): string | undefined;
|
|
22
|
+
export declare function resolveTarget(target?: 'Yes' | 'No' | null): LinkTarget | undefined;
|
|
23
|
+
export declare function resolveDisabled(disabled?: boolean | string | null): boolean;
|
|
24
|
+
export declare function resolveIconName(iconName?: string): string | undefined;
|
|
25
|
+
export declare const variantDefaults: {
|
|
26
|
+
readonly primary: {
|
|
27
|
+
readonly bg: "#1f1f1f";
|
|
28
|
+
readonly hover: "#3a3530";
|
|
29
|
+
readonly pressed: "#000000";
|
|
30
|
+
readonly text: "#ffffff";
|
|
31
|
+
readonly disabledBg: "#e6e6e6";
|
|
32
|
+
readonly disabledText: "#9e9e9e";
|
|
33
|
+
readonly focusRing: "#4f84b4";
|
|
34
|
+
};
|
|
35
|
+
readonly secondary: {
|
|
36
|
+
readonly bg: "#ffffff";
|
|
37
|
+
readonly hover: "#f2f2f2";
|
|
38
|
+
readonly pressed: "#e6e6e6";
|
|
39
|
+
readonly text: "#000000";
|
|
40
|
+
readonly border: "#626262";
|
|
41
|
+
readonly disabledBg: "#f2f2f2";
|
|
42
|
+
readonly disabledText: "#b0b0b0";
|
|
43
|
+
readonly focusRing: "#4f84b4";
|
|
44
|
+
};
|
|
45
|
+
readonly link: {
|
|
46
|
+
readonly bg: "transparent";
|
|
47
|
+
readonly hover: "transparent";
|
|
48
|
+
readonly pressed: "transparent";
|
|
49
|
+
readonly text: "#000000";
|
|
50
|
+
readonly border: "transparent";
|
|
51
|
+
readonly disabledBg: "transparent";
|
|
52
|
+
readonly disabledText: "#9e9e9e";
|
|
53
|
+
readonly focusRing: "#000000";
|
|
54
|
+
readonly hoverText: "#626262";
|
|
55
|
+
readonly underlineColor: "#000000";
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export declare function getButtonWidth(size: string): string;
|
|
59
|
+
export declare function getIconSize(size: string): ButtonSize;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export type LinkTarget = '_self' | '_blank';
|
|
2
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'link';
|
|
3
|
+
export type ButtonSize = 'small' | 'medium' | 'large';
|
|
4
|
+
export type ButtonAlignment = 'left' | 'center' | 'right';
|
|
5
|
+
export type IconPosition = 'left' | 'right';
|
|
6
|
+
export interface Button$ {
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
$?: {
|
|
9
|
+
title?: Record<string, unknown>;
|
|
10
|
+
icon?: Record<string, unknown>;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export type ButtonType = 'square' | 'rounded';
|
|
14
|
+
export interface ButtonsEntry extends ButtonProps {
|
|
15
|
+
$?: Record<string, unknown>;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
export interface ButtonsBlock$ {
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
buttons__0?: Record<string, unknown>;
|
|
21
|
+
}
|
|
22
|
+
export type ButtonsBlock = {
|
|
23
|
+
buttons?: ButtonsEntry[];
|
|
24
|
+
$?: ButtonsBlock$;
|
|
25
|
+
};
|
|
26
|
+
export type ButtonBlockProp = ButtonProps | ButtonsBlock;
|
|
27
|
+
export interface ButtonProps {
|
|
28
|
+
title?: string;
|
|
29
|
+
url?: string;
|
|
30
|
+
placeholder_text?: string;
|
|
31
|
+
open_in_new_tab?: 'Yes' | 'No' | null;
|
|
32
|
+
variant?: ButtonVariant;
|
|
33
|
+
button_size?: ButtonSize;
|
|
34
|
+
alignment?: ButtonAlignment;
|
|
35
|
+
buttontype?: string;
|
|
36
|
+
icon?: string;
|
|
37
|
+
iconposition?: IconPosition;
|
|
38
|
+
button_state?: boolean | string;
|
|
39
|
+
$?: Button$;
|
|
40
|
+
parent$?: Record<string, unknown>;
|
|
41
|
+
isEditing?: boolean;
|
|
42
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const MediaContainer: import("@emotion/styled").StyledComponent<{
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
|
+
as?: React.ElementType;
|
|
4
|
+
} & {
|
|
5
|
+
bgColor?: string;
|
|
6
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
7
|
+
export declare const StyledImage: import("@emotion/styled").StyledComponent<{
|
|
8
|
+
theme?: import("@emotion/react").Theme;
|
|
9
|
+
as?: React.ElementType;
|
|
10
|
+
} & {
|
|
11
|
+
objectFit?: string;
|
|
12
|
+
focusPoint?: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
};
|
|
16
|
+
objectPosition?: string;
|
|
17
|
+
}, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
18
|
+
export declare const StyledVideo: import("@emotion/styled").StyledComponent<{
|
|
19
|
+
theme?: import("@emotion/react").Theme;
|
|
20
|
+
as?: React.ElementType;
|
|
21
|
+
} & {
|
|
22
|
+
objectFit?: string;
|
|
23
|
+
focusPoint?: {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
};
|
|
27
|
+
objectPosition?: string;
|
|
28
|
+
}, import("react").DetailedHTMLProps<import("react").VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, {}>;
|
|
29
|
+
export declare const PictureElement: import("@emotion/styled").StyledComponent<{
|
|
30
|
+
theme?: import("@emotion/react").Theme;
|
|
31
|
+
as?: React.ElementType;
|
|
32
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
33
|
+
export declare const SourceElement: import("@emotion/styled").StyledComponent<{
|
|
34
|
+
theme?: import("@emotion/react").Theme;
|
|
35
|
+
as?: React.ElementType;
|
|
36
|
+
}, import("react").DetailedHTMLProps<import("react").SourceHTMLAttributes<HTMLSourceElement>, HTMLSourceElement>, {}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock Data for Bynder Utils Tests
|
|
3
|
+
* Contains test data for Bynder media extraction functions
|
|
4
|
+
*/
|
|
5
|
+
export declare const mockSelectedImage: {
|
|
6
|
+
url: string;
|
|
7
|
+
type: "IMAGE";
|
|
8
|
+
fileSize: number;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
fit: "cover";
|
|
12
|
+
position: string;
|
|
13
|
+
bgColor: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const mockSelectedVideo: {
|
|
16
|
+
url: string;
|
|
17
|
+
type: "VIDEO";
|
|
18
|
+
fileSize: number;
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
fit: "cover";
|
|
22
|
+
position: string;
|
|
23
|
+
bgColor: string;
|
|
24
|
+
};
|
|
25
|
+
export declare const mockSelectedWithAltText: {
|
|
26
|
+
url: string;
|
|
27
|
+
type: string;
|
|
28
|
+
altText: string;
|
|
29
|
+
imageType: string;
|
|
30
|
+
fit: string;
|
|
31
|
+
position: string;
|
|
32
|
+
bgColor: string;
|
|
33
|
+
};
|
|
34
|
+
export declare const mockSelectedGif: {
|
|
35
|
+
url: string;
|
|
36
|
+
type: string;
|
|
37
|
+
altText: string;
|
|
38
|
+
imageType: string;
|
|
39
|
+
fit: string;
|
|
40
|
+
position: string;
|
|
41
|
+
bgColor: string;
|
|
42
|
+
};
|
|
43
|
+
export declare const mockSelectedGifUppercase: {
|
|
44
|
+
url: string;
|
|
45
|
+
type: string;
|
|
46
|
+
altText: string;
|
|
47
|
+
imageType: string;
|
|
48
|
+
fit: string;
|
|
49
|
+
position: string;
|
|
50
|
+
bgColor: string;
|
|
51
|
+
};
|
|
52
|
+
export declare const mockSelectedVideoWithAlt: {
|
|
53
|
+
url: string;
|
|
54
|
+
type: string;
|
|
55
|
+
altText: string;
|
|
56
|
+
imageType: string;
|
|
57
|
+
fit: string;
|
|
58
|
+
position: string;
|
|
59
|
+
bgColor: string;
|
|
60
|
+
};
|
|
61
|
+
export declare const mockSelectedWithDescriptiveAlt: {
|
|
62
|
+
url: string;
|
|
63
|
+
type: string;
|
|
64
|
+
altText: string;
|
|
65
|
+
imageType: string;
|
|
66
|
+
fit: string;
|
|
67
|
+
position: string;
|
|
68
|
+
bgColor: string;
|
|
69
|
+
};
|
|
70
|
+
export declare const mockSelectedWithoutAlt: {
|
|
71
|
+
url: string;
|
|
72
|
+
type: string;
|
|
73
|
+
imageType: string;
|
|
74
|
+
fit: string;
|
|
75
|
+
position: string;
|
|
76
|
+
bgColor: string;
|
|
77
|
+
};
|
|
78
|
+
export declare const mockSelectedCustomTransformation: {
|
|
79
|
+
url: string;
|
|
80
|
+
type: string;
|
|
81
|
+
altText: string;
|
|
82
|
+
imageType: string;
|
|
83
|
+
fit: string;
|
|
84
|
+
position: string;
|
|
85
|
+
bgColor: string;
|
|
86
|
+
};
|
|
87
|
+
export declare const mockSelectedCustomTransformationSimple: {
|
|
88
|
+
url: string;
|
|
89
|
+
type: string;
|
|
90
|
+
altText: string;
|
|
91
|
+
imageType: string;
|
|
92
|
+
fit: string;
|
|
93
|
+
position: string;
|
|
94
|
+
bgColor: string;
|
|
95
|
+
};
|
|
96
|
+
export declare const mockSelectedWithExistingQuality: {
|
|
97
|
+
url: string;
|
|
98
|
+
type: string;
|
|
99
|
+
altText: string;
|
|
100
|
+
imageType: string;
|
|
101
|
+
fit: string;
|
|
102
|
+
position: string;
|
|
103
|
+
bgColor: string;
|
|
104
|
+
};
|
|
105
|
+
export declare const mockSelectedWithMultipleParams: {
|
|
106
|
+
url: string;
|
|
107
|
+
type: string;
|
|
108
|
+
altText: string;
|
|
109
|
+
imageType: string;
|
|
110
|
+
fit: string;
|
|
111
|
+
position: string;
|
|
112
|
+
bgColor: string;
|
|
113
|
+
};
|
|
114
|
+
export declare const mockPreviewUrls: string[];
|
|
115
|
+
export declare const mockMediaJsonImage: string;
|
|
116
|
+
export declare const mockMediaJsonGif: string;
|
|
117
|
+
export declare const mockMediaJsonGifUppercase: string;
|
|
118
|
+
export declare const mockMediaJsonVideo: string;
|
|
119
|
+
export declare const mockMediaJsonWithDescriptiveAlt: string;
|
|
120
|
+
export declare const mockMediaJsonWithoutAlt: string;
|
|
121
|
+
export declare const mockMediaJsonCustomTransformation: string;
|
|
122
|
+
export declare const mockMediaJsonCustomTransformationSimple: string;
|
|
123
|
+
export declare const mockSelectedFitTransform: {
|
|
124
|
+
url: string;
|
|
125
|
+
type: string;
|
|
126
|
+
altText: string;
|
|
127
|
+
imageType: string;
|
|
128
|
+
fit: string;
|
|
129
|
+
position: string;
|
|
130
|
+
bgColor: string;
|
|
131
|
+
};
|
|
132
|
+
export declare const mockMediaJsonFitTransform: string;
|
|
133
|
+
export declare const mockMediaJsonDefaultTransform: string;
|
|
134
|
+
export declare const mockMediaJsonVideoNoTransform: string;
|
|
135
|
+
export declare const mockMediaJsonGifNoTransform: string;
|
|
136
|
+
export declare const mockMediaJsonWithExistingQuality: string;
|
|
137
|
+
export declare const mockMediaJsonWithMultipleParams: string;
|
|
138
|
+
export declare const mockMediaJsonRealCustomTransformation: string;
|
|
139
|
+
export declare const mockMediaJsonVideoIntegration: string;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export type BynderMediaType = 'image' | 'gif' | 'video';
|
|
2
|
+
export type CSEditTags = Record<string, any>;
|
|
3
|
+
export interface BynderMediaProps {
|
|
4
|
+
/** JSON string from Contentstack bynder_media field */
|
|
5
|
+
readonly bynder_media?: string;
|
|
6
|
+
/** Contentstack edit tags */
|
|
7
|
+
readonly $?: CSEditTags;
|
|
8
|
+
}
|
|
9
|
+
export type BynderMediaExtracted = {
|
|
10
|
+
url: string;
|
|
11
|
+
type: BynderMediaType;
|
|
12
|
+
alt: string;
|
|
13
|
+
isResponsive?: boolean;
|
|
14
|
+
desktopUrl?: string;
|
|
15
|
+
mobileUrl?: string;
|
|
16
|
+
imageFit?: 'cover' | 'contain' | 'scale-down' | 'none' | 'fill' | null;
|
|
17
|
+
focusPoint?: {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
};
|
|
21
|
+
objectPosition?: string;
|
|
22
|
+
bgColor?: string;
|
|
23
|
+
};
|
|
24
|
+
export type BynderImageDataType = {
|
|
25
|
+
/** selected is manually added, using additionalInfo from bynder */
|
|
26
|
+
selected?: {
|
|
27
|
+
url: string;
|
|
28
|
+
fileSize: number | null;
|
|
29
|
+
width: number | null;
|
|
30
|
+
height: number | null;
|
|
31
|
+
imageType?: string;
|
|
32
|
+
type: 'VIDEO' | 'IMAGE';
|
|
33
|
+
altText?: string;
|
|
34
|
+
fit: 'cover' | 'contain' | 'scale-down' | 'none';
|
|
35
|
+
position: string;
|
|
36
|
+
bgColor: string;
|
|
37
|
+
};
|
|
38
|
+
isPublic: boolean;
|
|
39
|
+
__typename?: 'Image';
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
description: string | null;
|
|
43
|
+
databaseId: string;
|
|
44
|
+
originalUrl?: string;
|
|
45
|
+
type: 'VIDEO' | 'IMAGE' | 'DOCUMENT';
|
|
46
|
+
url?: string;
|
|
47
|
+
previewUrls?: string[];
|
|
48
|
+
extensions?: string[];
|
|
49
|
+
textMetaproperties?: ({
|
|
50
|
+
name: string;
|
|
51
|
+
value: string;
|
|
52
|
+
} | null)[];
|
|
53
|
+
files: {
|
|
54
|
+
[key: string]: {
|
|
55
|
+
url: string;
|
|
56
|
+
width: number | null;
|
|
57
|
+
height: number | null;
|
|
58
|
+
fileSize: number | null;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BynderImageDataType, BynderMediaExtracted } from './types';
|
|
2
|
+
export declare function getMediaUrl(selected: BynderImageDataType['selected'], isPublic: boolean, previewUrls: BynderImageDataType['previewUrls']): string;
|
|
3
|
+
export declare function extractBynderMedia(mediaJson?: string): BynderMediaExtracted | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CarouselProps } from './types';
|
|
2
|
+
import 'slick-carousel/slick/slick.css';
|
|
3
|
+
import 'slick-carousel/slick/slick-theme.css';
|
|
4
|
+
/** Carousel layout: slider with arrows and dots. Uses shared hook and UI with carousel container. */
|
|
5
|
+
export declare function Carousel<T = unknown>(props: CarouselProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default Carousel;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { Carousel } from './Carousel';
|
|
3
|
+
declare const meta: Meta<typeof Carousel>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Carousel>;
|
|
6
|
+
export declare const SingleFull: Story;
|
|
7
|
+
export declare const TwoEqual: Story;
|
|
8
|
+
export declare const TwoSmallLarge: Story;
|
|
9
|
+
export declare const ThreeEqual: Story;
|
|
10
|
+
export declare const ThreeSmallMediumLarge: Story;
|
|
11
|
+
export declare const FourEqual: Story;
|
|
12
|
+
export declare const Autoplay: Story;
|
|
13
|
+
export declare const EmptyState: Story;
|
|
14
|
+
export declare const FewerSlidesThanPreset: Story;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare const CarouselContainer: import("@emotion/styled").StyledComponent<{
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
|
+
as?: React.ElementType;
|
|
4
|
+
} & {
|
|
5
|
+
gap: number;
|
|
6
|
+
height: string;
|
|
7
|
+
columnHeight: string;
|
|
8
|
+
maxColumnHeight?: number;
|
|
9
|
+
isVariableWidth: boolean;
|
|
10
|
+
fullWidth?: boolean;
|
|
11
|
+
dotsInside?: boolean;
|
|
12
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
13
|
+
export declare const SlideSection: import("@emotion/styled").StyledComponent<{
|
|
14
|
+
theme?: import("@emotion/react").Theme;
|
|
15
|
+
as?: React.ElementType;
|
|
16
|
+
} & {
|
|
17
|
+
useFlexLayout: boolean;
|
|
18
|
+
stackedVerticalGap: number;
|
|
19
|
+
stackedItemHeight: string;
|
|
20
|
+
stackedItemMaxHeight?: number;
|
|
21
|
+
slideWidth?: string;
|
|
22
|
+
flexBasis?: string;
|
|
23
|
+
isVariableWidth: boolean;
|
|
24
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
25
|
+
export declare const SlideInner: import("@emotion/styled").StyledComponent<{
|
|
26
|
+
theme?: import("@emotion/react").Theme;
|
|
27
|
+
as?: React.ElementType;
|
|
28
|
+
} & {
|
|
29
|
+
stackedItemHeight: string;
|
|
30
|
+
stackedItemMaxHeight?: number;
|
|
31
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
32
|
+
export declare const SlideContentInner: import("@emotion/styled").StyledComponent<{
|
|
33
|
+
theme?: import("@emotion/react").Theme;
|
|
34
|
+
as?: React.ElementType;
|
|
35
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
36
|
+
export declare const ArrowButton: import("@emotion/styled").StyledComponent<{
|
|
37
|
+
theme?: import("@emotion/react").Theme;
|
|
38
|
+
as?: React.ElementType;
|
|
39
|
+
} & {
|
|
40
|
+
direction: "prev" | "next";
|
|
41
|
+
fullWidth?: boolean;
|
|
42
|
+
}, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
43
|
+
export declare const InnerWrapper: import("@emotion/styled").StyledComponent<{
|
|
44
|
+
theme?: import("@emotion/react").Theme;
|
|
45
|
+
as?: React.ElementType;
|
|
46
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
47
|
+
export declare const EmptyPlaceholderWrapper: import("@emotion/styled").StyledComponent<{
|
|
48
|
+
theme?: import("@emotion/react").Theme;
|
|
49
|
+
as?: React.ElementType;
|
|
50
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CarouselProps } from '../types';
|
|
3
|
+
import type { SliderRefInstance } from '../shared';
|
|
4
|
+
/** Shared hook for carousel layout behavior. */
|
|
5
|
+
export declare function useCarouselLayout<T>(props: CarouselProps<T>): {
|
|
6
|
+
gapPx: number;
|
|
7
|
+
containerHeight: string;
|
|
8
|
+
stackedItemHeight: string;
|
|
9
|
+
stackedItemMaxHeight: number;
|
|
10
|
+
isVariableWidth: boolean;
|
|
11
|
+
containerClassName: string;
|
|
12
|
+
effectiveFullWidth: boolean;
|
|
13
|
+
parent$: Record<string, unknown> | undefined;
|
|
14
|
+
$: Record<string, unknown> | undefined;
|
|
15
|
+
emptyBlockParentClass: string | undefined;
|
|
16
|
+
emptyPlaceholderText: string;
|
|
17
|
+
sliderRef: React.MutableRefObject<SliderRefInstance | null>;
|
|
18
|
+
sliderSettings: any;
|
|
19
|
+
carouselKey: string;
|
|
20
|
+
renderSlides: (useFlexLayout?: boolean) => import("react/jsx-runtime").JSX.Element[];
|
|
21
|
+
slidesForRender: T[];
|
|
22
|
+
hasSlides: boolean;
|
|
23
|
+
isStackedViewport: boolean;
|
|
24
|
+
isTabletGridViewport: boolean;
|
|
25
|
+
preset: import("..").CarouselPreset;
|
|
26
|
+
showArrowsOnDesktop: boolean;
|
|
27
|
+
slidesToShow: number;
|
|
28
|
+
slidesLength: number;
|
|
29
|
+
goToPrevious: () => void | undefined;
|
|
30
|
+
goToNext: () => void | undefined;
|
|
31
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** Image height preset for story variants (px). */
|
|
3
|
+
declare const IMAGE_HEIGHTS: {
|
|
4
|
+
readonly short: 120;
|
|
5
|
+
readonly medium: 200;
|
|
6
|
+
readonly tall: 320;
|
|
7
|
+
};
|
|
8
|
+
/** Mock content card for ColumnControl/carousel stories. Optional image, content, and CTA. */
|
|
9
|
+
export interface MockContentCardProps {
|
|
10
|
+
imageSrc?: string;
|
|
11
|
+
imageAlt?: string;
|
|
12
|
+
/** Image area height: preset name or px number. Default 'medium'. */
|
|
13
|
+
imageHeight?: keyof typeof IMAGE_HEIGHTS | number;
|
|
14
|
+
title?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
ctaText?: string;
|
|
17
|
+
ctaHref?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const MockContentCard: React.FC<MockContentCardProps>;
|
|
20
|
+
export default MockContentCard;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** Mock hero with background (image or video), title, subtitle, and CTA. */
|
|
3
|
+
export interface MockHeroBannerProps {
|
|
4
|
+
/** Background image URL */
|
|
5
|
+
imageSrc?: string;
|
|
6
|
+
imageAlt?: string;
|
|
7
|
+
/** Background video URL */
|
|
8
|
+
videoSrc?: string;
|
|
9
|
+
posterSrc?: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
subtitle?: string;
|
|
12
|
+
/** CTA button/link text */
|
|
13
|
+
ctaText?: string;
|
|
14
|
+
/** CTA link href (optional; if omitted, CTA renders as span) */
|
|
15
|
+
ctaHref?: string;
|
|
16
|
+
}
|
|
17
|
+
declare const MockHeroBanner: React.FC<MockHeroBannerProps>;
|
|
18
|
+
export default MockHeroBanner;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** Mock product card for ColumnControl/carousel slide content only. */
|
|
3
|
+
export interface MockProductCardProps {
|
|
4
|
+
imageSrc: string;
|
|
5
|
+
imageAlt?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const MockProductCard: React.FC<MockProductCardProps>;
|
|
9
|
+
export default MockProductCard;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as MockProductCard } from './MockProductCard';
|
|
2
|
+
export type { MockProductCardProps } from './MockProductCard';
|
|
3
|
+
export { default as MockContentCard } from './MockContentCard';
|
|
4
|
+
export type { MockContentCardProps } from './MockContentCard';
|
|
5
|
+
export { default as MockHeroBanner } from './MockHeroBanner';
|
|
6
|
+
export type { MockHeroBannerProps } from './MockHeroBanner';
|
|
7
|
+
export { MOCK_ASSETS } from './mockAssets';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Nu Skin media URLs for ColumnControl mock slides. */
|
|
2
|
+
export declare const MOCK_ASSETS: {
|
|
3
|
+
readonly hero: {
|
|
4
|
+
readonly scienceApproach: "https://media.nuskin.com/transform/a3481f54-c1d6-440b-98c1-f6320a06f5f0/india-specific-science-approach-hero-banner?io=transform:fill,width:1440,height:500&format=webp&quality=95";
|
|
5
|
+
readonly joeChang: "https://media.nuskin.com/transform/d0a2299a-1476-4eb0-af54-b8fd66eaf880/nu-skin-science-main-page-joe-chang-banner?io=transform:fill,width:1440,height:520&focuspoint=0.32,0.54&format=webp&quality=95";
|
|
6
|
+
readonly homepage2: "https://media.nuskin.com/transform/fb7385be-c941-4436-8a30-63b177c4b02d/New-Homepage-Banners-2";
|
|
7
|
+
readonly videoPrysm: "https://media.nuskin.com/asset/9994f1f0-dc3d-4019-9dab-ebf690c11322/mp4/Prysm-Home-Page-Banner.mp4";
|
|
8
|
+
readonly videoPoster: "https://media.nuskin.com/m/65719e352613af80/original/Prysm-Home-Page-Banner.mp4";
|
|
9
|
+
};
|
|
10
|
+
readonly product: {
|
|
11
|
+
readonly boldInnovators: "https://media.nuskin.com/transform/04654929-3c89-4232-9cb2-2ea72d3602c9/india-science-bold-innovators-image?format=webp&quality=95";
|
|
12
|
+
readonly qualityProcess: "https://media.nuskin.com/transform/2bd009a8-288b-42de-be93-05c143e67822/nu-skin-science-6s-quality-process-image?io=transform:fill,width:1440,height:1400&format=webp&quality=95&io=transform:scale,width:600,height:600";
|
|
13
|
+
readonly rigorousResearch: "https://media.nuskin.com/transform/8754ed36-3705-4d85-a633-e8dbb7e326aa/nu-skin-science-rigorous-reasearch-image?io=transform:fill,width:720,height:460&format=webp&quality=95&io=transform:scale,width:600,height:600";
|
|
14
|
+
};
|
|
15
|
+
};
|