@nuskin/react-mysite-elements 1.0.0-mysiteshopHeader.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/LICENSE.md +15 -0
- package/README.md +113 -0
- package/dist/common/Nav-Category-Navigation/NsCategoryNavigation.d.ts +12 -0
- package/dist/common/Nav-Category-Navigation/NsCategoryNavigation.spec.d.ts +1 -0
- package/dist/common/Nav-Category-Navigation/NsCategoryNavigation.stories.d.ts +8 -0
- package/dist/common/Nav-Category-Navigation/NsCategoryNavigation.styled.d.ts +4 -0
- package/dist/common/Nav-Category-Navigation/index.d.ts +1 -0
- package/dist/common/card/NsProductCard.d.ts +15 -0
- package/dist/common/card/fixtures/ImageData1.d.ts +3 -0
- package/dist/common/card/fixtures/ImageData10.d.ts +3 -0
- package/dist/common/card/fixtures/ImageData11.d.ts +3 -0
- package/dist/common/card/fixtures/ImageData2.d.ts +3 -0
- package/dist/common/card/fixtures/ImageData3.d.ts +3 -0
- package/dist/common/card/fixtures/ImageData4.d.ts +3 -0
- package/dist/common/card/fixtures/ImageData5.d.ts +3 -0
- package/dist/common/card/fixtures/ImageData6.d.ts +3 -0
- package/dist/common/card/fixtures/ImageData7.d.ts +3 -0
- package/dist/common/card/fixtures/ImageData8.d.ts +3 -0
- package/dist/common/card/fixtures/ImageData9.d.ts +3 -0
- package/dist/common/card/fixtures/index.d.ts +10 -0
- package/dist/common/card/index.d.ts +2 -0
- package/dist/common/card/specs/NsProductCard.spec.d.ts +1 -0
- package/dist/common/card/stories/NsProductCard.stories.d.ts +8 -0
- package/dist/common/card/styles/NsProductCard.Styled.d.ts +72 -0
- package/dist/common/card/styles/NsProductCarousel.styled.d.ts +51 -0
- package/dist/common/carousel/CarouselControl.d.ts +9 -0
- package/dist/common/carousel/IconWrapper.d.ts +7 -0
- package/dist/common/carousel/NsProductCarousel.d.ts +42 -0
- package/dist/common/carousel/ProductCardEntries.d.ts +3 -0
- package/dist/common/carousel/ProductTabCarousel.d.ts +36 -0
- package/dist/common/carousel/ProductTabCarousel.styled.d.ts +30 -0
- package/dist/common/carousel/index.d.ts +6 -0
- package/dist/common/carousel/settingSlick.d.ts +16 -0
- package/dist/common/carousel/specs/CarouselControl.spec.d.ts +1 -0
- package/dist/common/carousel/specs/IconWrapper.spec.d.ts +1 -0
- package/dist/common/carousel/specs/NsProductCarousel.spec.d.ts +1 -0
- package/dist/common/carousel/specs/ProductTabCarousel.spec.d.ts +1 -0
- package/dist/common/carousel/specs/settingSlick.spec.d.ts +1 -0
- package/dist/common/carousel/stories/NsProductCardCarousel.stories.d.ts +8 -0
- package/dist/common/carousel/stories/ProductTabCarousel.stories.d.ts +4 -0
- package/dist/common/headers/MysiteHero.d.ts +22 -0
- package/dist/common/headers/MysiteHero.styled.d.ts +13 -0
- package/dist/common/headers/index.d.ts +1 -0
- package/dist/common/headers/specs/MysiteHero.spec.d.ts +1 -0
- package/dist/common/headers/stories/MySiteShopHeader.stories.d.ts +8 -0
- package/dist/common/icon/icons/PlaceholderImage.d.ts +8 -0
- package/dist/common/icon/icons/SocialMediaIcons.d.ts +7 -0
- package/dist/common/index.d.ts +4 -0
- package/dist/common/types/image.d.ts +11 -0
- package/dist/index.css +2 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +129 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023, Nuskin
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# React Component Library Template
|
|
2
|
+
|
|
3
|
+
### This template is for creating react component libraries
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### What this template does for you
|
|
8
|
+
|
|
9
|
+
- Provides a `.gitlab-ci.yml` to manage the CI/CD pipeline
|
|
10
|
+
- Runs your _Unit Tests_ with every push to the remote repository
|
|
11
|
+
- Analyzes your code with:
|
|
12
|
+
- linting rules
|
|
13
|
+
- run a _SAST_ check
|
|
14
|
+
- Pushes your code coverage analysis to SonarQube
|
|
15
|
+
- Ensures your code passes the SonarQube Quality Gate
|
|
16
|
+
- Utilizes _Semantic Release_, which means the pipeline will handle versioning
|
|
17
|
+
- Publishes your module to _npmjs_
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
### Follow these steps to create a new project using this template:
|
|
22
|
+
|
|
23
|
+
#### 1. Clone this project to your local machine and remove the git control file
|
|
24
|
+
|
|
25
|
+
Note: We use 'my-project' as the name of your new project
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
git clone git@code.tls.nuskin.io:ns-am/templates/react-component-library-template.git <my-project>
|
|
29
|
+
cd <my-project>
|
|
30
|
+
rm -rf .git
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
#### 2. Create your new project in Gitlab
|
|
34
|
+
|
|
35
|
+
1. In the appropriate sub-group select **"New project"**
|
|
36
|
+
2. Name your project
|
|
37
|
+
3. Select a project description (optional)
|
|
38
|
+
4. Select **"Create project"**
|
|
39
|
+
|
|
40
|
+
#### 3. Connect your local project to the gitlab remote project
|
|
41
|
+
|
|
42
|
+
You can copy and paste the section in the gitlab command line instructions of your new
|
|
43
|
+
project into the command line of your local project. It will look like the following
|
|
44
|
+
but will have your project specific details.
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
cd <your project folder if you are not already there>
|
|
48
|
+
git init
|
|
49
|
+
git remote add origin <your gitlab project url>
|
|
50
|
+
git add .
|
|
51
|
+
git commit -m "Chore: Initial commit"
|
|
52
|
+
git push -u origin master
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### 4. Add rules to your new project repository
|
|
56
|
+
|
|
57
|
+
- Under _Settings_ Select _Repository_
|
|
58
|
+
- Select _Push Rules_ ([See Sample](./push-rules.png))
|
|
59
|
+
1. Check _Do not allow users to remove git tags with `git push`_
|
|
60
|
+
- Click on **Expand** in the _Protected Branches_ section ([See Sample](./protected-branches.png))
|
|
61
|
+
- **master** should already be set as your default branch. For **master** do the following:
|
|
62
|
+
1. Set _Allowed to merge_ to **Developers + Maintainers**
|
|
63
|
+
2. Set _Allowed to push_ to **Maintainers**
|
|
64
|
+
3. Set _Code owner approval_ to **Off**
|
|
65
|
+
|
|
66
|
+
#### 5. Update your new project with your project specific settings and information
|
|
67
|
+
|
|
68
|
+
1. Replace the `README.md` with a proper readme that will be displayed on _npmjs_ ([See Sample](./README-sample.md))
|
|
69
|
+
2. Update these settings in your `package.json`
|
|
70
|
+
|
|
71
|
+
- Note: All module names should be created in the _@nuskin_ namespace.
|
|
72
|
+
|
|
73
|
+
```JavaScript
|
|
74
|
+
{
|
|
75
|
+
"name": "@nuskin/react-component-library-template",
|
|
76
|
+
"description": "The description that will amaze and astound your audience when they read it",
|
|
77
|
+
"repository": {
|
|
78
|
+
"type": "git",
|
|
79
|
+
"url": "git@code.tls.nuskin.io:ns-am/templates/react-component-library-template.git"
|
|
80
|
+
},
|
|
81
|
+
"homepage": "https://code.tls.nuskin.io/ns-am/templates/react-component-library-template/blob/master/README.md"
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
#### 6. Determine if your module should be public or private
|
|
86
|
+
|
|
87
|
+
If your module should be public and published to _npmjs.com_, nothing needs to be done. This is the default
|
|
88
|
+
behavior. If you need to publish to the private npm repository _nexus3.nuskin.net_, inside `gitlab-ci.yml`
|
|
89
|
+
update **PRIVATE_NPM** to `true`
|
|
90
|
+
|
|
91
|
+
```yaml
|
|
92
|
+
variables:
|
|
93
|
+
PRIVATE_NPM: 'true'
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
#### 7. Turning on your CI/CD pipeline
|
|
97
|
+
|
|
98
|
+
Once you are ready for your project to start running the CI/CD pipeline, you should rename the `gitlab-ci.yml`
|
|
99
|
+
to `.gitlab-ci.yml`.
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
git mv gitlab-ci.yml .gitlab-ci.yml
|
|
103
|
+
git commit -am "Chore: renaming gitlab-ci.yml to .gitlab-ci.yml so my pipeline runs"
|
|
104
|
+
git push
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## TODO: Write documentation about Semantic Release (don't forget prereleases)
|
|
108
|
+
|
|
109
|
+
#### How to use Semantic Release in your pipeline
|
|
110
|
+
|
|
111
|
+
Link to another page or write up instructions on how Semantic Release works with the pipeline
|
|
112
|
+
|
|
113
|
+
[eslint commit-analyzer](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-eslint) rules.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface NsCategoryNavigationProps {
|
|
3
|
+
itemArray: {
|
|
4
|
+
label: string;
|
|
5
|
+
content: React.ReactNode;
|
|
6
|
+
categoryId: string;
|
|
7
|
+
}[];
|
|
8
|
+
value?: number;
|
|
9
|
+
onChange?: (event: React.SyntheticEvent, newValue: number) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const NsCategoryNavigation: React.FC<Readonly<NsCategoryNavigationProps>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { NsCategoryNavigation } from './NsCategoryNavigation';
|
|
3
|
+
type ComponentType = typeof NsCategoryNavigation;
|
|
4
|
+
type Story = StoryObj<ComponentType>;
|
|
5
|
+
type MetaStory = Meta<ComponentType>;
|
|
6
|
+
declare const _default: MetaStory;
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NsCategoryNavigation } from './NsCategoryNavigation';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
|
+
import { NsCardButton } from '@nuskin/foundation-ui-components';
|
|
3
|
+
import { ProductImageType } from '../types/image';
|
|
4
|
+
type NsProductCardProps = {
|
|
5
|
+
readonly productTitle: string;
|
|
6
|
+
readonly imageDetails?: ProductImageType;
|
|
7
|
+
readonly className?: string;
|
|
8
|
+
readonly button?: NsCardButton;
|
|
9
|
+
readonly onCardClick?: () => void;
|
|
10
|
+
readonly productStatusBadge?: React.ReactNode;
|
|
11
|
+
readonly mySitePriceComponent?: React.ReactNode;
|
|
12
|
+
readonly testId?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const NsProductCard: ({ productTitle, imageDetails, className, button, onCardClick, productStatusBadge, mySitePriceComponent, testId, }: NsProductCardProps) => ReactElement;
|
|
15
|
+
export default NsProductCard;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { ImageData1 } from '../fixtures/ImageData1';
|
|
2
|
+
export { ImageData3 } from '../fixtures/ImageData3';
|
|
3
|
+
export { ImageData4 } from '../fixtures/ImageData4';
|
|
4
|
+
export { ImageData5 } from '../fixtures/ImageData5';
|
|
5
|
+
export { ImageData6 } from '../fixtures/ImageData6';
|
|
6
|
+
export { ImageData7 } from '../fixtures/ImageData7';
|
|
7
|
+
export { ImageData8 } from '../fixtures/ImageData8';
|
|
8
|
+
export { ImageData9 } from '../fixtures/ImageData9';
|
|
9
|
+
export { ImageData10 } from '../fixtures/ImageData10';
|
|
10
|
+
export { ImageData11 } from '../fixtures/ImageData11';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
|
2
|
+
import NsProductCard from '../NsProductCard';
|
|
3
|
+
type ComponentType = typeof NsProductCard;
|
|
4
|
+
type Story = StoryObj<ComponentType>;
|
|
5
|
+
type MetaStory = Meta<ComponentType>;
|
|
6
|
+
declare const _default: MetaStory;
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BoxProps } from '@mui/material/Box';
|
|
3
|
+
export declare const CardContainer: React.ComponentType<BoxProps>;
|
|
4
|
+
export declare const StyledCartIcon: import("@emotion/styled").StyledComponent<import("@nuskin/foundation-ui-components").NsCartIconProps & {
|
|
5
|
+
theme?: import("@emotion/react").Theme;
|
|
6
|
+
}, {}, {}>;
|
|
7
|
+
export declare const StyledImage: import("@emotion/styled").StyledComponent<{
|
|
8
|
+
theme?: import("@emotion/react").Theme;
|
|
9
|
+
as?: React.ElementType;
|
|
10
|
+
}, React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
11
|
+
export declare const StyledNsButton: import("@emotion/styled").StyledComponent<Pick<import("@mui/material").ButtonProps, "className" | "color" | "aria-label" | "onFocus" | "onBlur" | "onChange" | "onClick" | "disabled" | "endIcon" | "fullWidth" | "href" | "size" | "startIcon" | "variant" | "type"> & {
|
|
12
|
+
iconOnly?: boolean;
|
|
13
|
+
darkModeEnabled?: boolean;
|
|
14
|
+
startIconName?: import("@nuskin/foundation-ui-components").NsIconProps["name"];
|
|
15
|
+
endIconName?: import("@nuskin/foundation-ui-components").NsIconProps["name"];
|
|
16
|
+
} & {
|
|
17
|
+
children?: React.ReactNode | undefined;
|
|
18
|
+
} & {
|
|
19
|
+
theme?: import("@emotion/react").Theme;
|
|
20
|
+
}, {}, {}>;
|
|
21
|
+
export declare const ContentText: import("@emotion/styled").StyledComponent<{
|
|
22
|
+
variant: import("@nuskin/foundation-ui-components").Variants;
|
|
23
|
+
decoration?: "underline" | "none";
|
|
24
|
+
weight?: "bold" | "normal" | "light";
|
|
25
|
+
color?: import("@nuskin/foundation-theme").FoundationTheme.PaletteColors;
|
|
26
|
+
component?: "div" | "span" | "p";
|
|
27
|
+
as?: import("@nuskin/foundation-ui-components").HtmlTagVariant;
|
|
28
|
+
className?: string;
|
|
29
|
+
colorOverride?: string;
|
|
30
|
+
renderHTMLNode?: boolean;
|
|
31
|
+
noSpacing?: boolean;
|
|
32
|
+
} & {
|
|
33
|
+
additionalProps?: {
|
|
34
|
+
ariaLabel?: string;
|
|
35
|
+
testid?: string;
|
|
36
|
+
className?: string;
|
|
37
|
+
"data-testid"?: string;
|
|
38
|
+
} & Partial<import("@nuskin/foundation-ui-components").CslpTag>;
|
|
39
|
+
cslp?: Record<string, import("@nuskin/foundation-ui-components").CslpTag>;
|
|
40
|
+
} & import("@nuskin/foundation-ui-components").DarkModeEnabledOption & {
|
|
41
|
+
children?: React.ReactNode | undefined;
|
|
42
|
+
} & {
|
|
43
|
+
theme?: import("@emotion/react").Theme;
|
|
44
|
+
}, {}, {}>;
|
|
45
|
+
export declare const PriceText: import("@emotion/styled").StyledComponent<{
|
|
46
|
+
variant: import("@nuskin/foundation-ui-components").Variants;
|
|
47
|
+
decoration?: "underline" | "none";
|
|
48
|
+
weight?: "bold" | "normal" | "light";
|
|
49
|
+
color?: import("@nuskin/foundation-theme").FoundationTheme.PaletteColors;
|
|
50
|
+
component?: "div" | "span" | "p";
|
|
51
|
+
as?: import("@nuskin/foundation-ui-components").HtmlTagVariant;
|
|
52
|
+
className?: string;
|
|
53
|
+
colorOverride?: string;
|
|
54
|
+
renderHTMLNode?: boolean;
|
|
55
|
+
noSpacing?: boolean;
|
|
56
|
+
} & {
|
|
57
|
+
additionalProps?: {
|
|
58
|
+
ariaLabel?: string;
|
|
59
|
+
testid?: string;
|
|
60
|
+
className?: string;
|
|
61
|
+
"data-testid"?: string;
|
|
62
|
+
} & Partial<import("@nuskin/foundation-ui-components").CslpTag>;
|
|
63
|
+
cslp?: Record<string, import("@nuskin/foundation-ui-components").CslpTag>;
|
|
64
|
+
} & import("@nuskin/foundation-ui-components").DarkModeEnabledOption & {
|
|
65
|
+
children?: React.ReactNode | undefined;
|
|
66
|
+
} & {
|
|
67
|
+
theme?: import("@emotion/react").Theme;
|
|
68
|
+
}, {}, {}>;
|
|
69
|
+
export declare const PriceComponent: import("@emotion/styled").StyledComponent<{
|
|
70
|
+
theme?: import("@emotion/react").Theme;
|
|
71
|
+
as?: React.ElementType;
|
|
72
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BoxProps } from '@mui/material/Box';
|
|
3
|
+
export declare const SlickContainer: React.ComponentType<BoxProps>;
|
|
4
|
+
export declare const ScrollableContainer: import("@emotion/styled").StyledComponent<{
|
|
5
|
+
theme?: import("@emotion/react").Theme;
|
|
6
|
+
as?: React.ElementType;
|
|
7
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
8
|
+
export declare const CardList: import("@emotion/styled").StyledComponent<{
|
|
9
|
+
theme?: import("@emotion/react").Theme;
|
|
10
|
+
as?: React.ElementType;
|
|
11
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
12
|
+
export declare const ControlsContainer: React.ComponentType<BoxProps>;
|
|
13
|
+
export declare const ViewAllWrapper: React.ComponentType<BoxProps>;
|
|
14
|
+
export declare const ProductCountWrapper: React.ComponentType<BoxProps>;
|
|
15
|
+
export declare const ArrowsWrapper: React.ComponentType<BoxProps>;
|
|
16
|
+
export declare const Scrollablewrapper: import("@emotion/styled").StyledComponent<{
|
|
17
|
+
theme?: import("@emotion/react").Theme;
|
|
18
|
+
as?: React.ElementType;
|
|
19
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
20
|
+
export declare const CustomTypography: import("@emotion/styled").StyledComponent<{
|
|
21
|
+
variant: import("@nuskin/foundation-ui-components").Variants;
|
|
22
|
+
decoration?: "underline" | "none";
|
|
23
|
+
weight?: "bold" | "normal" | "light";
|
|
24
|
+
color?: import("@nuskin/foundation-theme").FoundationTheme.PaletteColors;
|
|
25
|
+
component?: "div" | "span" | "p";
|
|
26
|
+
as?: import("@nuskin/foundation-ui-components").HtmlTagVariant;
|
|
27
|
+
className?: string;
|
|
28
|
+
colorOverride?: string;
|
|
29
|
+
renderHTMLNode?: boolean;
|
|
30
|
+
noSpacing?: boolean;
|
|
31
|
+
} & {
|
|
32
|
+
additionalProps?: {
|
|
33
|
+
ariaLabel?: string;
|
|
34
|
+
testid?: string;
|
|
35
|
+
className?: string;
|
|
36
|
+
"data-testid"?: string;
|
|
37
|
+
} & Partial<import("@nuskin/foundation-ui-components").CslpTag>;
|
|
38
|
+
cslp?: Record<string, import("@nuskin/foundation-ui-components").CslpTag>;
|
|
39
|
+
} & import("@nuskin/foundation-ui-components").DarkModeEnabledOption & {
|
|
40
|
+
children?: React.ReactNode | undefined;
|
|
41
|
+
} & {
|
|
42
|
+
theme?: import("@emotion/react").Theme;
|
|
43
|
+
}, {}, {}>;
|
|
44
|
+
export declare const ViewAllLink: import("@emotion/styled").StyledComponent<{
|
|
45
|
+
theme?: import("@emotion/react").Theme;
|
|
46
|
+
as?: React.ElementType;
|
|
47
|
+
}, React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, {}>;
|
|
48
|
+
export declare const EmptyProductCategories: import("@emotion/styled").StyledComponent<{
|
|
49
|
+
theme?: import("@emotion/react").Theme;
|
|
50
|
+
as?: React.ElementType;
|
|
51
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
interface CarouselControlProps {
|
|
3
|
+
next(): void;
|
|
4
|
+
prev(): void;
|
|
5
|
+
readonly viewAllLabel?: string;
|
|
6
|
+
readonly viewAllUrl?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const CarouselControl: ({ next, prev, viewAllUrl, viewAllLabel }: CarouselControlProps) => ReactElement;
|
|
9
|
+
export default CarouselControl;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
type IconWrapperProps = PropsWithChildren<{
|
|
3
|
+
onClick(): void;
|
|
4
|
+
readonly className?: string;
|
|
5
|
+
}>;
|
|
6
|
+
declare const IconWrapper: ({ children, onClick, className }: IconWrapperProps) => ReactElement;
|
|
7
|
+
export default IconWrapper;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import 'slick-carousel/slick/slick.css';
|
|
3
|
+
import { NsCardButton } from '@nuskin/foundation-ui-components';
|
|
4
|
+
import { ProductImageType } from '../types/image';
|
|
5
|
+
export type ProductCardEntry = {
|
|
6
|
+
readonly productTitle: string;
|
|
7
|
+
readonly imageDetails?: ProductImageType;
|
|
8
|
+
readonly button?: NsCardButton;
|
|
9
|
+
readonly onCardClick?: () => void;
|
|
10
|
+
readonly productStatusBadge?: React.ReactNode;
|
|
11
|
+
readonly mySitePriceComponent?: React.ReactNode;
|
|
12
|
+
};
|
|
13
|
+
interface SlickSettings {
|
|
14
|
+
dots?: boolean;
|
|
15
|
+
infinite?: boolean;
|
|
16
|
+
speed?: number;
|
|
17
|
+
slidesToShow?: number;
|
|
18
|
+
slidesToScroll?: number;
|
|
19
|
+
swipe?: boolean;
|
|
20
|
+
draggable?: boolean;
|
|
21
|
+
arrows?: boolean;
|
|
22
|
+
responsive?: Array<{
|
|
23
|
+
breakpoint: number;
|
|
24
|
+
settings: {
|
|
25
|
+
slidesToShow?: number;
|
|
26
|
+
slidesToScroll?: number;
|
|
27
|
+
arrows?: boolean;
|
|
28
|
+
};
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
interface ProductCardCarouselProps<T = ProductCardEntry> {
|
|
32
|
+
readonly entries: T[];
|
|
33
|
+
readonly settings?: SlickSettings;
|
|
34
|
+
readonly showControlButtons?: boolean;
|
|
35
|
+
readonly renderEntry?: (entry: T, index: number) => ReactNode;
|
|
36
|
+
readonly allEntryLabel?: string;
|
|
37
|
+
readonly allEntryLink?: string;
|
|
38
|
+
readonly categoryName?: string;
|
|
39
|
+
readonly emptyProductMessage?: string;
|
|
40
|
+
}
|
|
41
|
+
export default function ProductCardCarousel({ entries, renderEntry, settings, showControlButtons, allEntryLabel, allEntryLink, categoryName, emptyProductMessage, }: ProductCardCarouselProps): ReactElement;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ProductCardEntry } from './NsProductCarousel';
|
|
3
|
+
interface Category {
|
|
4
|
+
label: string;
|
|
5
|
+
categoryId: string;
|
|
6
|
+
}
|
|
7
|
+
interface SlickSettings {
|
|
8
|
+
dots?: boolean;
|
|
9
|
+
infinite?: boolean;
|
|
10
|
+
speed?: number;
|
|
11
|
+
slidesToShow?: number;
|
|
12
|
+
slidesToScroll?: number;
|
|
13
|
+
swipe?: boolean;
|
|
14
|
+
draggable?: boolean;
|
|
15
|
+
arrows?: boolean;
|
|
16
|
+
responsive?: Array<{
|
|
17
|
+
breakpoint: number;
|
|
18
|
+
settings: {
|
|
19
|
+
slidesToShow?: number;
|
|
20
|
+
slidesToScroll?: number;
|
|
21
|
+
arrows?: boolean;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
interface ProductTabCarouselProps {
|
|
26
|
+
readonly allEntryLabel?: string;
|
|
27
|
+
readonly allEntryLink?: string;
|
|
28
|
+
readonly renderEntry?: (entry: ProductCardEntry) => React.ReactNode;
|
|
29
|
+
readonly settings?: SlickSettings;
|
|
30
|
+
readonly showControlButtons?: boolean;
|
|
31
|
+
readonly fetchCategories: () => Promise<Category[]>;
|
|
32
|
+
readonly fetchProducts: (categoryId: string) => Promise<ProductCardEntry[]>;
|
|
33
|
+
readonly emptyProductTabs?: string;
|
|
34
|
+
}
|
|
35
|
+
declare const ProductTabCarousel: React.FC<ProductTabCarouselProps>;
|
|
36
|
+
export default ProductTabCarousel;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const ProductTabCarouselContainer: import("@emotion/styled").StyledComponent<{
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
|
+
as?: React.ElementType;
|
|
4
|
+
} & {
|
|
5
|
+
isMobile?: boolean;
|
|
6
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
7
|
+
export declare const TabsContainer: import("@emotion/styled").StyledComponent<{
|
|
8
|
+
theme?: import("@emotion/react").Theme;
|
|
9
|
+
as?: React.ElementType;
|
|
10
|
+
} & {
|
|
11
|
+
isMobile?: boolean;
|
|
12
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
13
|
+
export declare const ContentContainer: import("@emotion/styled").StyledComponent<{
|
|
14
|
+
theme?: import("@emotion/react").Theme;
|
|
15
|
+
as?: React.ElementType;
|
|
16
|
+
} & {
|
|
17
|
+
isMobile?: boolean;
|
|
18
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
19
|
+
export declare const LoadingContainer: import("@emotion/styled").StyledComponent<{
|
|
20
|
+
theme?: import("@emotion/react").Theme;
|
|
21
|
+
as?: React.ElementType;
|
|
22
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
23
|
+
export declare const NoTabsContainer: import("@emotion/styled").StyledComponent<{
|
|
24
|
+
theme?: import("@emotion/react").Theme;
|
|
25
|
+
as?: React.ElementType;
|
|
26
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
27
|
+
export declare const SpinnerContainer: import("@emotion/styled").StyledComponent<{
|
|
28
|
+
theme?: import("@emotion/react").Theme;
|
|
29
|
+
as?: React.ElementType;
|
|
30
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as NsCarousal } from '@nuskin/foundation-ui-components';
|
|
2
|
+
export { default as ProductCarousel } from './NsProductCarousel';
|
|
3
|
+
export { default as NsScrollingCarousal } from '@nuskin/foundation-ui-components';
|
|
4
|
+
export { default as NsDefaultCarousalSettings } from '@nuskin/foundation-ui-components';
|
|
5
|
+
export { default as ProductTabCarousel } from './ProductTabCarousel';
|
|
6
|
+
export type { NsCarouselProps, NsScrollingCarouselProps } from './types';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const settingsCarousel: {
|
|
2
|
+
dots: boolean;
|
|
3
|
+
infinite: boolean;
|
|
4
|
+
speed: number;
|
|
5
|
+
slidesToShow: number;
|
|
6
|
+
slidesToScroll: number;
|
|
7
|
+
swipeToSlide: boolean;
|
|
8
|
+
responsive: {
|
|
9
|
+
breakpoint: number;
|
|
10
|
+
settings: {
|
|
11
|
+
slidesToShow: number;
|
|
12
|
+
slidesToScroll: number;
|
|
13
|
+
};
|
|
14
|
+
}[];
|
|
15
|
+
};
|
|
16
|
+
export default settingsCarousel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
|
2
|
+
import ProductCardCarousel from '../NsProductCarousel';
|
|
3
|
+
type ComponentType = typeof ProductCardCarousel;
|
|
4
|
+
type Story = StoryObj<ComponentType>;
|
|
5
|
+
type MetaStory = Meta<ComponentType>;
|
|
6
|
+
declare const _default: MetaStory;
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
type MysiteHeroProps = {
|
|
3
|
+
readonly imageDetails?: {
|
|
4
|
+
imageSrc: string;
|
|
5
|
+
imageAlt: string;
|
|
6
|
+
bgColor: string;
|
|
7
|
+
};
|
|
8
|
+
readonly shopTitle: string;
|
|
9
|
+
readonly shopDescription: string;
|
|
10
|
+
readonly socialTitleText: string;
|
|
11
|
+
readonly email: string;
|
|
12
|
+
readonly className?: string;
|
|
13
|
+
readonly backgroundColor?: string;
|
|
14
|
+
readonly headlineFont?: string;
|
|
15
|
+
readonly paragraphFont?: string;
|
|
16
|
+
readonly socialIcons?: {
|
|
17
|
+
type: string;
|
|
18
|
+
url: string;
|
|
19
|
+
}[];
|
|
20
|
+
};
|
|
21
|
+
export default function MysiteHero({ className, shopTitle, shopDescription, socialTitleText, imageDetails, email, backgroundColor, headlineFont, paragraphFont, socialIcons, }: MysiteHeroProps): ReactElement;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BoxProps } from '@mui/material';
|
|
2
|
+
interface StyledBoxProps extends BoxProps {
|
|
3
|
+
backgroundColor?: string;
|
|
4
|
+
headlineFont?: string;
|
|
5
|
+
paragraphFont?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const MysiteHeroContainer: import("@emotion/styled").StyledComponent<StyledBoxProps & {
|
|
8
|
+
theme?: import("@emotion/react").Theme;
|
|
9
|
+
}, {}, {}>;
|
|
10
|
+
export declare const MysiteHeroContainerMobile: import("@emotion/styled").StyledComponent<StyledBoxProps & {
|
|
11
|
+
theme?: import("@emotion/react").Theme;
|
|
12
|
+
}, {}, {}>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MysiteHero } from './MysiteHero';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
|
2
|
+
import MySiteShopHeader from '../MysiteHero';
|
|
3
|
+
type ComponentType = typeof MySiteShopHeader;
|
|
4
|
+
type Story = StoryObj<ComponentType>;
|
|
5
|
+
type MetaStory = Meta<ComponentType>;
|
|
6
|
+
declare const _default: MetaStory;
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const Default: Story;
|