@nuskin/foundation-ui-components 1.0.0-cft-35.12 → 1.0.0-develop.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.
Files changed (101) hide show
  1. package/package.json +21 -16
  2. package/src/common/alert/NsAlert.spec.tsx +134 -0
  3. package/src/common/alert/NsAlert.stories.tsx +42 -0
  4. package/src/common/alert/NsAlert.styled.ts +124 -0
  5. package/src/common/alert/NsAlert.tsx +155 -0
  6. package/src/common/alert/index.ts +2 -0
  7. package/src/common/alert/types.d.ts +45 -0
  8. package/src/common/auth-dropdown/NsAuthDropdown.stories.tsx +9 -5
  9. package/src/common/auth-dropdown/NsAuthDropdown.tsx +1 -1
  10. package/src/common/autocomplete/NsAutocomplete.spec.tsx +96 -0
  11. package/src/common/autocomplete/NsAutocomplete.stories.tsx +51 -0
  12. package/src/common/autocomplete/NsAutocomplete.tsx +110 -0
  13. package/src/common/autocomplete/index.ts +1 -0
  14. package/src/common/autocomplete/mock/Mock.styled.tsx +23 -0
  15. package/src/common/autocomplete/mock/MockData.ts +46 -0
  16. package/src/common/autocomplete/mock/MockUI.tsx +24 -0
  17. package/src/common/autocomplete/types.ts +39 -0
  18. package/src/common/banner/NsBanner.spec.tsx +2 -2
  19. package/src/common/banner/NsBanner.stories.tsx +2 -2
  20. package/src/common/banner/NsBanner.styled.tsx +1 -0
  21. package/src/common/banner/NsBanner.tsx +12 -3
  22. package/src/common/brand-components/NsBrand.stories.tsx +2 -2
  23. package/src/common/breadcrumb/NsBreadcrumb.spec.tsx +12 -4
  24. package/src/common/breadcrumb/NsBreadcrumb.stories.tsx +19 -8
  25. package/src/common/breadcrumb/NsBreadcrumb.styled.tsx +1 -1
  26. package/src/common/breadcrumb/NsBreadcrumb.tsx +2 -4
  27. package/src/common/button/NsButton.stories.tsx +2 -2
  28. package/src/common/card/NsFfgCard.tsx +18 -0
  29. package/src/common/card/index.ts +1 -0
  30. package/src/common/card/stories/NsBgCard.stories.tsx +2 -2
  31. package/src/common/card/stories/NsBrandProductCard.stories.tsx +2 -2
  32. package/src/common/card/stories/NsFfgCard.stories.tsx +40 -0
  33. package/src/common/card/styled/NsFfgStyled.tsx +44 -0
  34. package/src/common/card/tests/NsFfgCard.spec.tsx +23 -0
  35. package/src/common/card/types.d.ts +9 -0
  36. package/src/common/carousal/CarousalControl.tsx +3 -5
  37. package/src/common/carousal/IconWrapper.tsx +4 -4
  38. package/src/common/carousal/tests/NsCarousal.spec.tsx +4 -4
  39. package/src/common/cart-icon/NsCartIcon.spec.tsx +10 -4
  40. package/src/common/cart-icon/NsCartIcon.stories.tsx +2 -2
  41. package/src/common/checkbox/NsCheckbox.stories.tsx +12 -16
  42. package/src/common/column-control/NDivs.story.tsx +35 -0
  43. package/src/common/column-control/NsColumnControl.spec.tsx +24 -0
  44. package/src/common/column-control/NsColumnControl.stories.tsx +69 -0
  45. package/src/common/column-control/NsColumnControl.tsx +59 -0
  46. package/src/common/column-control/index.ts +2 -0
  47. package/src/common/column-control/types.d.ts +47 -0
  48. package/src/common/column-control/utils.ts +66 -0
  49. package/src/common/dropdown/NsDropdown.tsx +1 -1
  50. package/src/common/dropdown/stories/NsDropdown.stories.tsx +13 -9
  51. package/src/common/dropdown/stories/NsDropdownCountry.stories.tsx +13 -9
  52. package/src/common/flag/NsFlag.stories.tsx +2 -2
  53. package/src/common/icon/NsIcon.spec.tsx +9 -2
  54. package/src/common/icon/NsIcon.stories.tsx +4 -17
  55. package/src/common/icon/NsIcon.tsx +1 -1
  56. package/src/common/icon/{IconMap.ts → NsIconVariants.ts} +10 -0
  57. package/src/common/icon/icons/AlertErrorIcon.tsx +36 -0
  58. package/src/common/icon/icons/ArrowDown.tsx +1 -1
  59. package/src/common/{carousal/LeftChevron.tsx → icon/icons/ArrowLeft.tsx} +7 -5
  60. package/src/common/{carousal/RightChevron.tsx → icon/icons/ArrowRight.tsx} +3 -3
  61. package/src/common/icon/icons/ArrowUp.tsx +1 -1
  62. package/src/common/icon/icons/Cart.tsx +7 -1
  63. package/src/common/icon/icons/CartBadge.tsx +7 -1
  64. package/src/common/icon/icons/CheckShield.tsx +7 -1
  65. package/src/common/icon/icons/CheckVerified.tsx +7 -1
  66. package/src/common/icon/icons/CloseIcon.tsx +22 -0
  67. package/src/common/icon/icons/ErrorIcon.tsx +1 -1
  68. package/src/common/icon/icons/InfoFilled.tsx +1 -1
  69. package/src/common/icon/icons/InfoOutlined.tsx +7 -1
  70. package/src/common/icon/icons/SearchIcon.tsx +1 -1
  71. package/src/common/icon/icons/SlashIcon.tsx +4 -4
  72. package/src/common/icon/icons/SuccessIcon.tsx +1 -1
  73. package/src/common/icon/icons/TrashIcon.tsx +1 -2
  74. package/src/common/icon/icons/WarningIcon.tsx +36 -0
  75. package/src/common/icon/icons/home.tsx +4 -3
  76. package/src/common/icon/index.ts +1 -0
  77. package/src/common/icon/types.d.ts +2 -15
  78. package/src/common/image/NsImage.stories.tsx +2 -2
  79. package/src/common/image/NsImage.tsx +3 -2
  80. package/src/common/image/NsNextImage.stories.tsx +2 -2
  81. package/src/common/image/NsNextImage.tsx +3 -7
  82. package/src/common/image/types.d.ts +6 -4
  83. package/src/common/index.ts +15 -8
  84. package/src/common/input/InputWrapper.tsx +3 -2
  85. package/src/common/input/NsInputField.spec.tsx +17 -2
  86. package/src/common/link/NsLink.spec.tsx +15 -8
  87. package/src/common/link/NsLink.stories.tsx +10 -2
  88. package/src/common/link/NsLink.styled.tsx +1 -1
  89. package/src/common/link/NsLink.tsx +26 -4
  90. package/src/common/link/types.d.ts +4 -2
  91. package/src/common/nav-product-card/NsNavProductCard.stories.tsx +2 -2
  92. package/src/common/nav-product-card/NsNavProductCard.tsx +3 -2
  93. package/src/common/nav-tab/NsNavTab.stories.tsx +2 -2
  94. package/src/common/typography/NsTypography.stories.tsx +2 -2
  95. package/src/common/videos/NsVideo.spec.tsx +26 -0
  96. package/src/common/videos/NsVideo.stories.tsx +32 -0
  97. package/src/common/videos/NsVideo.tsx +25 -0
  98. package/src/common/videos/index.ts +2 -0
  99. package/src/common/videos/types.d.ts +9 -0
  100. package/CHANGELOG.md +0 -194
  101. /package/src/common/breadcrumb/{types.ts → types.d.ts} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { NsNextImage } from '.';
2
- import { CenterStoryDecorator } from '../../stories/CenterStoryDecorator';
2
+ import { withCenterDecorator } from '../../stories/decorators/withCenterDecorator';
3
3
  import type { StoryObj, Meta } from '@storybook/react';
4
4
 
5
5
  type ComponentType = typeof NsNextImage;
@@ -9,7 +9,7 @@ type MetaStory = Meta<ComponentType>;
9
9
  export default {
10
10
  title: 'Components/NsNextImage',
11
11
  component: NsNextImage,
12
- decorators: [CenterStoryDecorator],
12
+ decorators: [withCenterDecorator],
13
13
  } as MetaStory;
14
14
 
15
15
  export const BrandImage: Story = {
@@ -1,12 +1,8 @@
1
1
  import { NsNextImageProps } from './types';
2
- import { NsImage } from './';
2
+ import Image from 'next/image';
3
+
3
4
  const NsNextImage = ({ src, width, height, alt, fill, priority, ...props }: NsNextImageProps) => {
4
- try {
5
- const Image = require('next/image');
6
- return <Image src={src} width={width} height={height} alt={alt} fill={fill} priority={priority} {...props} />;
7
- } catch {
8
- return <NsImage src={src as any} width={width as any} height={height as any} alt={alt} {...props} />;
9
- }
5
+ return <Image src={src} width={width} height={height} alt={alt} fill={fill} priority={priority} {...props} />;
10
6
  };
11
7
 
12
8
  export default NsNextImage;
@@ -15,13 +15,15 @@ export type NsNextImageProps = Pick<
15
15
  | 'blurDataURL'
16
16
  | 'fill'
17
17
  | 'unoptimized'
18
- > & {};
18
+ > & { id?: string; className?: string };
19
19
 
20
20
  export type NsImageProps = {
21
- src: string;
22
21
  alt: string;
23
- width: number;
24
- height: number;
22
+ className?: string;
25
23
  fill?: boolean;
24
+ height?: number | string;
25
+ id?: string;
26
+ src: string;
26
27
  variant?: 'product' | 'award' | 'icon' | 'fill';
28
+ width?: number | string;
27
29
  };
@@ -1,21 +1,28 @@
1
- export * from './button';
2
- export * from './brand-components';
3
- export * from './checkbox';
4
- export * from './flag';
5
- export * from './link';
6
- export * from './nav-tab';
7
- export * from './nav-product-card';
1
+ export * from './auth-dropdown';
8
2
  export * from './banner';
9
3
  export * from './breadcrumb';
10
- export * from './typography';
4
+ export * from './brand-components';
5
+ export * from './button';
11
6
  export * from './card';
12
7
  export * from './carousal';
13
8
  export * from './cart-icon';
9
+ export * from './column-control';
10
+ export * from './checkbox';
11
+ export * from './dropdown';
12
+ export * from './flag';
14
13
  export * from './icon';
15
14
  export * from './input';
16
15
  export * from './image';
16
+ export * from './link';
17
17
  export * from './label';
18
+ export * from './autocomplete';
18
19
 
19
20
  /* Dropdown Components */
20
21
  export * from './dropdown';
21
22
  export * from './auth-dropdown';
23
+ export * from './alert';
24
+ export * from './nav-tab';
25
+ export * from './nav-product-card';
26
+ export * from './typography';
27
+
28
+ export * from './common.types';
@@ -8,7 +8,7 @@ const options = {
8
8
  shouldForwardProp: (propKey: string) => propKey !== 'fieldState',
9
9
  };
10
10
 
11
- const getInputBorderColor = (fieldState: fieldStateType, isLight = true, palette: any): string => {
11
+ const getInputBorderColor = (palette: any, fieldState: fieldStateType, isLight = true): string => {
12
12
  if (fieldState === 'success') {
13
13
  return isLight ? colors.success[40] : colors.success[40];
14
14
  } else if (fieldState === 'error') {
@@ -17,6 +17,7 @@ const getInputBorderColor = (fieldState: fieldStateType, isLight = true, palette
17
17
  return palette.primary.main;
18
18
  }
19
19
  };
20
+
20
21
  type InputWrapperType = {
21
22
  fieldState: fieldStateType;
22
23
  };
@@ -55,7 +56,7 @@ const InputWrapper = styled(
55
56
  },
56
57
  },
57
58
  fieldset: {
58
- border: `1px solid ${getInputBorderColor(fieldState, isLight, palette as any)}`,
59
+ border: `1px solid ${getInputBorderColor(palette as any, fieldState, isLight)}`,
59
60
  },
60
61
  input: {
61
62
  color: palette.primary.main,
@@ -1,10 +1,25 @@
1
- import { render } from '@testing-library/react';
1
+ import { render, screen } from '@testing-library/react';
2
2
  import NsInputField from './NsInputField';
3
+ import { nuskinTheme } from '@nuskin/foundation-theme';
4
+ const { colors } = nuskinTheme;
3
5
 
6
+ const { getByTestId } = screen;
4
7
  describe('NsInputField', () => {
5
8
  it('should render component', () => {
6
- const { getByTestId } = render(<NsInputField fullWidth />);
9
+ render(<NsInputField fullWidth />);
7
10
  const Input = getByTestId('ns-input-field');
8
11
  expect(Input).toBeTruthy();
9
12
  });
13
+ it('should render component', () => {
14
+ render(<NsInputField fullWidth fieldState="error" />);
15
+ const Input = getByTestId('ns-input-field');
16
+ const fieldset = Input.querySelector('fieldset');
17
+ expect(fieldset).toHaveStyle(`border: 1px solid ${colors.red[20]}`);
18
+ });
19
+ it('should render component', () => {
20
+ render(<NsInputField fullWidth fieldState="success" />);
21
+ const Input = getByTestId('ns-input-field');
22
+ const fieldset = Input.querySelector('fieldset');
23
+ expect(fieldset).toHaveStyle(`border: 1px solid ${colors.success[40]}`);
24
+ });
10
25
  });
@@ -1,20 +1,27 @@
1
- /**
2
- * @author [Vijayaprathap Kumar] (vpkumar@nuskin.com)
3
- * NsLink.spec.tsx
4
- * @description In this example, we're using Jest to write a test case for our NsLink component.
5
- */
6
-
7
1
  import React from 'react';
2
+ import { styled } from '@nuskin/foundation-theme';
8
3
 
9
4
  import { render } from '../../../test-utils/index';
10
5
  import { NsLink } from './';
11
6
 
12
- // Test suite for NsLink
7
+ const CustomLink = styled.a`
8
+ color: red;
9
+ font-size: 30px;
10
+ `;
13
11
  describe('Link', () => {
14
- // Test cases go here
15
12
  test('renders default link', () => {
16
13
  const { getByText } = render(<NsLink href="https://example.com">Example</NsLink>);
17
14
  const linkElement = getByText('Example');
18
15
  expect(linkElement.tagName).toBe('A');
19
16
  });
17
+
18
+ test('passes href to custom component', () => {
19
+ const { getByText } = render(
20
+ <NsLink href="https://example.com" passHref prefetch>
21
+ <CustomLink>Example</CustomLink>
22
+ </NsLink>
23
+ );
24
+ const linkElement = getByText('Example');
25
+ expect(linkElement.tagName).toBe('A');
26
+ });
20
27
  });
@@ -6,7 +6,7 @@
6
6
 
7
7
  import React from 'react';
8
8
  import type { StoryObj, Meta } from '@storybook/react';
9
- import { CenterStoryDecorator } from '../../stories/CenterStoryDecorator';
9
+ import { withCenterDecorator } from '../../stories/decorators/withCenterDecorator';
10
10
 
11
11
  import { NsLink } from './';
12
12
  import { NsTypography } from '../typography';
@@ -18,7 +18,7 @@ type MetaStory = Meta<ComponentType>;
18
18
  export default {
19
19
  title: 'Components/NsLink',
20
20
  component: NsLink,
21
- decorators: [CenterStoryDecorator],
21
+ decorators: [withCenterDecorator],
22
22
  argTypes: {
23
23
  children: {
24
24
  control: 'text',
@@ -41,3 +41,11 @@ export const Links: Story = {
41
41
  </NsTypography>
42
42
  ),
43
43
  };
44
+
45
+ export const ReactComponentLink: Story = {
46
+ render: (args: any) => (
47
+ <NsLink {...args} href={args.href} passHref>
48
+ <NsTypography variant="sub-h-l">Test Link</NsTypography>
49
+ </NsLink>
50
+ ),
51
+ };
@@ -16,7 +16,7 @@ type StyledProps = {
16
16
 
17
17
  /**
18
18
  * Wrapper StyledMUILink / StyledNextLink for NsLink.tsx
19
- * @params ( theme: { palette }) / Provide the color's to contaier from @nuskin/foundation-theme
19
+ * @params ( theme: { palette }) / Provide the color's to container from @nuskin/foundation-theme
20
20
  * @params ( disabled: boolean) / Element will be disable only when disabled is true
21
21
  */
22
22
 
@@ -1,5 +1,4 @@
1
1
  /**
2
- * @author [Vijayaprathap Kumar] (vpkumar@nuskin.com)
3
2
  * @name NsLink.tsx
4
3
  * @description Exports one components - NsLink
5
4
  */
@@ -16,18 +15,41 @@ import { NsLinkProps } from './types';
16
15
  *
17
16
  */
18
17
  const NsLink = (props: PropsWithChildren<NsLinkProps>) => {
19
- const { href, underlineOnHover, target, isSsr = false, additionalProps, children } = props;
18
+ const {
19
+ className,
20
+ href,
21
+ underlineOnHover,
22
+ target,
23
+ isSsr = false,
24
+ additionalProps,
25
+ children,
26
+ passHref,
27
+ prefetch,
28
+ } = props;
20
29
 
21
30
  if (isSsr) {
22
31
  return (
23
- <StyledNextLink href={href} $underlineOnHover={underlineOnHover} {...additionalProps}>
32
+ <StyledNextLink
33
+ className={className}
34
+ href={href}
35
+ $underlineOnHover={underlineOnHover}
36
+ {...additionalProps}
37
+ passHref={passHref}
38
+ prefetch={prefetch}
39
+ >
24
40
  {children}
25
41
  </StyledNextLink>
26
42
  );
27
43
  }
28
44
 
29
45
  return (
30
- <StyledLink href={href} $underlineOnHover={underlineOnHover} target={target} {...additionalProps}>
46
+ <StyledLink
47
+ className={className}
48
+ href={href}
49
+ $underlineOnHover={underlineOnHover}
50
+ target={target}
51
+ {...additionalProps}
52
+ >
31
53
  {children}
32
54
  </StyledLink>
33
55
  );
@@ -1,16 +1,18 @@
1
1
  /**
2
2
  * @author [Vijayaprathap Kumar] (vpkumar@nuskin.com)
3
3
  * @name types.tsx
4
- * @description Exports types for components - NsLink
4
+ * @description Exports types for components - NsLink
5
5
  */
6
6
  import { AdditionalProps } from '../common.types';
7
7
 
8
- /** Props Types for NsLink Component */
9
8
  export type NsLinkProps = AdditionalProps & {
9
+ className?: string;
10
10
  href: string;
11
11
  // Used to enable the underline when hover the element
12
12
  underlineOnHover?: boolean;
13
13
  disabled?: boolean;
14
14
  target?: string;
15
15
  isSsr?: boolean;
16
+ passHref?: boolean;
17
+ prefetch?: boolean;
16
18
  };
@@ -1,5 +1,5 @@
1
1
  import type { StoryObj, Meta } from '@storybook/react';
2
- import { CenterStoryDecorator } from '../../stories/CenterStoryDecorator';
2
+ import { withCenterDecorator } from '../../stories/decorators/withCenterDecorator';
3
3
  import { NsNavProductCard } from './';
4
4
 
5
5
  type ComponentType = typeof NsNavProductCard;
@@ -9,7 +9,7 @@ type MetaStory = Meta<ComponentType>;
9
9
  export default {
10
10
  title: 'Components/NsNavProductCard',
11
11
  component: NsNavProductCard,
12
- decorators: [CenterStoryDecorator],
12
+ decorators: [withCenterDecorator],
13
13
  args: {
14
14
  productDescription: `ageLOC LumiSpa iO pairs an intelligent,one-of-a-kind
15
15
  device that uses patented technology with powerful products. The results? You get the skin of your dreams.`,
@@ -1,9 +1,10 @@
1
1
  /* eslint-disable @next/next/no-img-element */
2
2
  import React, { PropsWithChildren } from 'react';
3
- import { NsTypography } from '../';
3
+ import { NsImage, NsTypography } from '../';
4
4
  import { ProductCardContainer } from './NsNavProductCard.styled';
5
5
  import { NsNavProductCardProps } from './types';
6
6
 
7
+ /* TODO: can we update NsImage with NsNextImage, once storybook 7 is in place */
7
8
  export const NsNavProductCard = ({
8
9
  productImg,
9
10
  productDescription,
@@ -12,7 +13,7 @@ export const NsNavProductCard = ({
12
13
  }: PropsWithChildren<NsNavProductCardProps>) => {
13
14
  return (
14
15
  <ProductCardContainer className={className}>
15
- <img src={productImg} alt="product-img" />
16
+ <NsImage src={productImg} alt="product-img" />
16
17
  <div className="text-container">
17
18
  <NsTypography variant="h5" color="primary" className="mt-11 mb-3.5 underline-hover" weight="bold">
18
19
  {productName}
@@ -1,5 +1,5 @@
1
1
  import type { StoryObj, Meta } from '@storybook/react';
2
- import { CenterStoryDecorator } from '../../stories/CenterStoryDecorator';
2
+ import { withCenterDecorator } from '../../stories/decorators/withCenterDecorator';
3
3
  import { NsNavTab } from './';
4
4
 
5
5
  type ComponentType = typeof NsNavTab;
@@ -9,7 +9,7 @@ type MetaStory = Meta<ComponentType>;
9
9
  export default {
10
10
  title: 'Components/NsNavTab',
11
11
  component: NsNavTab,
12
- decorators: [CenterStoryDecorator],
12
+ decorators: [withCenterDecorator],
13
13
  argTypes: {
14
14
  tabs: { control: 'object' },
15
15
  },
@@ -1,5 +1,5 @@
1
1
  import type { StoryObj, Meta } from '@storybook/react';
2
- import { CenterStoryDecorator } from '../../stories/CenterStoryDecorator';
2
+ import { withCenterDecorator } from '../../stories/decorators/withCenterDecorator';
3
3
  import { NsTypography } from './';
4
4
 
5
5
  type ComponentType = typeof NsTypography;
@@ -9,7 +9,7 @@ type MetaStory = Meta<ComponentType>;
9
9
  export default {
10
10
  title: 'Components/NsTypography',
11
11
  component: NsTypography,
12
- decorators: [CenterStoryDecorator],
12
+ decorators: [withCenterDecorator],
13
13
  argTypes: {
14
14
  children: {
15
15
  control: 'text',
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { render } from '@testing-library/react';
3
+
4
+ import NsVideo from './NsVideo';
5
+
6
+ describe('IframeVideo', () => {
7
+ it('renders an Iframe with the correct props', () => {
8
+ const src = 'https://www.youtube.com/embed/12345';
9
+ const title = 'My Video';
10
+ const width = '560';
11
+ const height = '315';
12
+ const allowFullScreen = true;
13
+
14
+ const { getByTitle } = render(
15
+ <NsVideo src={src} title={title} width={width} height={height} allowFullScreen={allowFullScreen} />
16
+ );
17
+
18
+ const iframeElement = getByTitle(title);
19
+
20
+ expect(iframeElement).toBeInTheDocument();
21
+ expect(iframeElement).toHaveAttribute('src', src);
22
+ expect(iframeElement).toHaveAttribute('width', width);
23
+ expect(iframeElement).toHaveAttribute('height', height);
24
+ expect(iframeElement).toHaveAttribute('allowfullscreen');
25
+ });
26
+ });
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @author [Vijayaprathap Kumar] (vpkumar@nuskin.com)
3
+ * NsVideo.stories.tsx
4
+ * @description NsVideo component.
5
+ */
6
+
7
+ import type { Meta, StoryObj } from '@storybook/react';
8
+
9
+ import { NsVideo } from '.';
10
+ import { withCenterDecorator } from '../../stories/decorators/withCenterDecorator';
11
+
12
+ type ComponentType = typeof NsVideo;
13
+ type Story = StoryObj<ComponentType>;
14
+ type MetaStory = Meta<ComponentType>;
15
+
16
+ export default {
17
+ title: 'Components/NsVideo',
18
+ component: NsVideo,
19
+ decorators: [withCenterDecorator],
20
+ argTypes: {
21
+ allowFullScreen: { control: 'boolean' },
22
+ },
23
+ args: {
24
+ src: 'https://www.youtube.com/embed/UdpWdhi0pdI',
25
+ title: 'Nuskin Iframe',
26
+ width: '560',
27
+ height: '315',
28
+ allowFullScreen: true,
29
+ },
30
+ } as MetaStory;
31
+
32
+ export const Basic: Story = {};
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @author [Vijayaprathap Kumar] (vpkumar@nuskin.com)
3
+ * NsVideo.tsx
4
+ * @description NsVideo component with a Iframe video url props
5
+ */
6
+
7
+ import { PropsWithChildren } from 'react';
8
+
9
+ import { NsVideoProps } from './types';
10
+
11
+ const NsVideo = (props: PropsWithChildren<NsVideoProps>) => {
12
+ const { src, title, width, height, allowFullScreen } = props;
13
+ return (
14
+ <iframe
15
+ title={title}
16
+ src={src}
17
+ width={width}
18
+ height={height}
19
+ allowFullScreen={allowFullScreen}
20
+ style={{ border: '0' }}
21
+ />
22
+ );
23
+ };
24
+
25
+ export default NsVideo;
@@ -0,0 +1,2 @@
1
+ export { default as NsVideo } from './NsVideo';
2
+ export type { NsVideoProps } from './types';
@@ -0,0 +1,9 @@
1
+ import { AdditionalProps } from '@/common/common.types';
2
+
3
+ export type NsVideoProps = {
4
+ src: string;
5
+ title?: string;
6
+ width?: string;
7
+ height?: string;
8
+ allowFullScreen?: boolean;
9
+ } & AdditionalProps;