@nuskin/foundation-ui-components 1.29.1 → 1.30.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.
Files changed (163) hide show
  1. package/package.json +1 -7
  2. package/src/common/accordion/NsAccordion.tsx +2 -2
  3. package/src/common/accordion/NsAccordionHeader.tsx +2 -9
  4. package/src/common/accordion/NsAccordionItem.tsx +4 -3
  5. package/src/common/accordion/NsCollapse.tsx +1 -1
  6. package/src/common/accordion/NsToggleSection.tsx +10 -3
  7. package/src/common/accordion/stories/NsAccordionItem.stories.tsx +5 -3
  8. package/src/common/accordion/stories/NsCollapse.stories.tsx +5 -3
  9. package/src/common/alert/NsAlert.stories.tsx +6 -4
  10. package/src/common/alert/NsAlert.tsx +27 -13
  11. package/src/common/auth-dropdown/NsAuthDropdown.tsx +7 -7
  12. package/src/common/autocomplete/NsAutocomplete.spec.tsx +3 -3
  13. package/src/common/autocomplete/NsAutocomplete.tsx +2 -1
  14. package/src/common/autocomplete/helper/SeeMoreButton.tsx +2 -2
  15. package/src/common/autocomplete/helper/renderGroupName.tsx +4 -3
  16. package/src/common/autocomplete/stories/NsAutocomplete.stories.tsx +9 -9
  17. package/src/common/banner/NsBanner.spec.tsx +5 -5
  18. package/src/common/banner/NsBanner.stories.tsx +8 -5
  19. package/src/common/banner/NsBanner.tsx +10 -20
  20. package/src/common/banner/types.d.ts +2 -2
  21. package/src/common/brand-components/NsBrandComponent.tsx +6 -3
  22. package/src/common/brand-components/icons/NSLogoHorizontal.tsx +7 -2
  23. package/src/common/brand-components/icons/NSLogoMark.tsx +3 -1
  24. package/src/common/brand-components/icons/NSLogoPoweredBy.tsx +4 -2
  25. package/src/common/brand-components/icons/NSLogoStacked.tsx +4 -2
  26. package/src/common/brand-components/icons/NSWordMark.tsx +4 -2
  27. package/src/common/breadcrumb/NsBreadcrumb.tsx +20 -5
  28. package/src/common/button/NsButton.stories.tsx +14 -8
  29. package/src/common/button/NsButton.tsx +7 -4
  30. package/src/common/card/CardButton.tsx +4 -3
  31. package/src/common/card/NsAwardCard.tsx +9 -8
  32. package/src/common/card/NsBgCard.tsx +1 -0
  33. package/src/common/card/NsBrandCard.tsx +8 -5
  34. package/src/common/card/NsBrandWrapper.tsx +3 -2
  35. package/src/common/card/NsCheckoutCard.tsx +4 -2
  36. package/src/common/card/NsHeroCardLevel1.tsx +9 -9
  37. package/src/common/card/NsHeroCardLevel2.tsx +9 -9
  38. package/src/common/card/NsIconText.tsx +3 -2
  39. package/src/common/card/NsLargeCard.tsx +9 -9
  40. package/src/common/card/NsMediumCard.tsx +10 -9
  41. package/src/common/card/NsPost.tsx +7 -8
  42. package/src/common/card/NsSmallFullCard.tsx +9 -9
  43. package/src/common/card/NsXLargeCard.tsx +9 -9
  44. package/src/common/card/fixtures/ImageData1.ts +38 -0
  45. package/src/common/card/fixtures/ImageData2.ts +38 -0
  46. package/src/common/card/specs/NsAwardCard.spec.tsx +2 -2
  47. package/src/common/card/specs/NsHeroCardLevel1.spec.tsx +2 -3
  48. package/src/common/card/specs/NsHeroCardLevel2.spec.tsx +2 -2
  49. package/src/common/card/specs/NsLargeCard.spec.tsx +2 -3
  50. package/src/common/card/specs/NsMediumCard.spec.tsx +3 -3
  51. package/src/common/card/specs/NsPost.spec.tsx +3 -3
  52. package/src/common/card/specs/NsSmallFullCard.spec.tsx +3 -3
  53. package/src/common/card/specs/NsXLargeCard.spec.tsx +3 -3
  54. package/src/common/card/stories/NsAwardCard.stories.tsx +2 -4
  55. package/src/common/card/stories/NsHeroCardLevel1.stories.tsx +2 -4
  56. package/src/common/card/stories/NsHeroCardLevel2.stories.tsx +2 -4
  57. package/src/common/card/stories/NsLargeCard.stories.tsx +2 -4
  58. package/src/common/card/stories/NsMediumCard.stories.tsx +2 -4
  59. package/src/common/card/stories/NsPost.stories.tsx +2 -4
  60. package/src/common/card/stories/NsSmallFullCard.stories.tsx +2 -4
  61. package/src/common/card/stories/NsXLargeCard.stories.tsx +4 -5
  62. package/src/common/carousal/CarousalControl.tsx +5 -2
  63. package/src/common/carousal/IconWrapper.tsx +4 -3
  64. package/src/common/carousal/NsCarousal.tsx +8 -6
  65. package/src/common/carousal/NsScrollingCarousal.tsx +2 -2
  66. package/src/common/carousal/RenderBrand.tsx +3 -1
  67. package/src/common/carousal/specs/NsScrollingCarousal.spec.tsx +4 -2
  68. package/src/common/carousal/stories/{NSCarousal.stories.tsx → NsCarousal1.stories.tsx} +5 -2
  69. package/src/common/carousal/stories/NsScrollingCarousal.stories.tsx +4 -2
  70. package/src/common/cart-icon/NsCartIcon.tsx +9 -1
  71. package/src/common/checkbox/NsCheckbox.stories.tsx +5 -4
  72. package/src/common/checkbox/NsCheckbox.tsx +6 -6
  73. package/src/common/column-control/NsColumnControl.tsx +5 -3
  74. package/src/common/column-control/NsFlexColumns.tsx +10 -3
  75. package/src/common/column-control/NsGridColumns.tsx +10 -3
  76. package/src/common/column-control/stories/NsColumnControl.stories.tsx +8 -5
  77. package/src/common/column-control/stories/NsFlexColumns.stories.tsx +9 -6
  78. package/src/common/column-control/stories/NsGridColumns.stories.tsx +19 -7
  79. package/src/common/column-control/styled/common.ts +1 -1
  80. package/src/common/dropdown/NsDropdown.tsx +6 -6
  81. package/src/common/dropdown/NsDropdownOption.tsx +4 -3
  82. package/src/common/dropdown/stories/NsDropdown.stories.tsx +5 -3
  83. package/src/common/email-simple/NsEmailSimple.tsx +4 -3
  84. package/src/common/flag/NsFlag.tsx +3 -2
  85. package/src/common/hooks/useAccordionMap.tsx +1 -1
  86. package/src/common/icon/NsIcon.tsx +2 -5
  87. package/src/common/icon/icons/AlertErrorIcon.tsx +3 -1
  88. package/src/common/icon/icons/ArrowDown.tsx +7 -2
  89. package/src/common/icon/icons/ArrowLeft.tsx +7 -2
  90. package/src/common/icon/icons/ArrowRight.tsx +7 -2
  91. package/src/common/icon/icons/ArrowUp.tsx +4 -2
  92. package/src/common/icon/icons/Cart.tsx +7 -2
  93. package/src/common/icon/icons/CartBadge.tsx +7 -2
  94. package/src/common/icon/icons/Check.tsx +7 -2
  95. package/src/common/icon/icons/CheckShield.tsx +4 -2
  96. package/src/common/icon/icons/CheckVerified.tsx +7 -2
  97. package/src/common/icon/icons/ChevronRight.tsx +9 -4
  98. package/src/common/icon/icons/CloseIcon.tsx +7 -2
  99. package/src/common/icon/icons/ErrorIcon.tsx +3 -1
  100. package/src/common/icon/icons/HamburgerIcon.tsx +4 -1
  101. package/src/common/icon/icons/InfoFilled.tsx +7 -2
  102. package/src/common/icon/icons/InfoOutlined.tsx +7 -2
  103. package/src/common/icon/icons/RoundedClose.tsx +7 -2
  104. package/src/common/icon/icons/SearchIcon.tsx +3 -1
  105. package/src/common/icon/icons/SlashIcon.tsx +7 -2
  106. package/src/common/icon/icons/SuccessIcon.tsx +3 -1
  107. package/src/common/icon/icons/TrashIcon.tsx +3 -1
  108. package/src/common/icon/icons/UserIcon.tsx +4 -1
  109. package/src/common/icon/icons/UserOutline.tsx +3 -1
  110. package/src/common/icon/icons/WarningIcon.tsx +3 -1
  111. package/src/common/icon/icons/home.tsx +4 -2
  112. package/src/common/image/BynderMedia.spec.tsx +42 -0
  113. package/src/common/image/BynderMedia.tsx +48 -0
  114. package/src/common/image/NsImage.tsx +3 -3
  115. package/src/common/image/NsNextImage.tsx +5 -2
  116. package/src/common/image/bynder-util.spec.ts +187 -0
  117. package/src/common/image/bynder-util.ts +98 -0
  118. package/src/common/image/index.ts +1 -1
  119. package/src/common/image/types.ts +78 -0
  120. package/src/common/input/InputWrapper.tsx +2 -1
  121. package/src/common/input/NsInputField.tsx +11 -3
  122. package/src/common/label/NsLabel.tsx +9 -4
  123. package/src/common/link/NsLink.stories.tsx +9 -5
  124. package/src/common/link/NsLink.tsx +9 -3
  125. package/src/common/modal/NsModal.tsx +2 -2
  126. package/src/common/modal/helper-component/NsModalContentBox.tsx +8 -3
  127. package/src/common/modal/helper-component/NsModalDefault.tsx +9 -2
  128. package/src/common/modal/helper-component/NsModalStatus.tsx +3 -1
  129. package/src/common/modal/helper-component/NsModalStatusIcon.tsx +2 -2
  130. package/src/common/modal/helper-component/NsModalTitle.tsx +6 -3
  131. package/src/common/modal/stories/NsModal.stories.tsx +9 -7
  132. package/src/common/nav-product-card/NsNavProductCard.spec.tsx +3 -5
  133. package/src/common/nav-product-card/NsNavProductCard.stories.tsx +4 -4
  134. package/src/common/nav-product-card/NsNavProductCard.tsx +6 -6
  135. package/src/common/nav-product-card/types.d.ts +2 -1
  136. package/src/common/nav-tab/NavDrawer.tsx +10 -3
  137. package/src/common/nav-tab/NavTitles.tsx +2 -2
  138. package/src/common/nav-tab/NsNavTab.tsx +10 -4
  139. package/src/common/progress/NsProgress.stories.tsx +6 -3
  140. package/src/common/progress/NsProgress.tsx +3 -3
  141. package/src/common/radiogroup/NsRadioGroup.tsx +4 -2
  142. package/src/common/search-bar/NsSearchBar.tsx +3 -2
  143. package/src/common/select/DefaultRenderOption.tsx +3 -1
  144. package/src/common/select/NsSelect.tsx +19 -6
  145. package/src/common/select/NsSelectOption.tsx +2 -2
  146. package/src/common/select/stories/NsSelect.stories.tsx +5 -4
  147. package/src/common/spinner/NsSpinner.stories.tsx +5 -2
  148. package/src/common/spinner/NsSpinner.tsx +3 -2
  149. package/src/common/spinner/icons/Spinner.tsx +3 -1
  150. package/src/common/table/NsExpandableRow.tsx +35 -41
  151. package/src/common/table/NsTable.stories.tsx +17 -23
  152. package/src/common/table/NsTable.tsx +27 -10
  153. package/src/common/table/NsTableHeader.tsx +18 -5
  154. package/src/common/table/NsTablePagination.tsx +7 -11
  155. package/src/common/text-strip/NsTextStrip.tsx +6 -3
  156. package/src/common/toast/Fade.tsx +5 -8
  157. package/src/common/toast/ToastProvider.tsx +18 -17
  158. package/src/common/toast/specs/Toast.spec.tsx +56 -64
  159. package/src/common/toast/stories/Toast.stories.tsx +12 -11
  160. package/src/common/typography/GlobalFontInter.tsx +7 -2
  161. package/src/common/typography/NsTypography.tsx +11 -4
  162. package/src/common/videos/NsVideo.tsx +5 -2
  163. package/src/common/image/types.d.ts +0 -30
@@ -1,15 +1,14 @@
1
1
  import React from 'react';
2
2
  import { render, screen } from '@testing-library/react';
3
3
  import NsHeroCardLevel1 from '../NsHeroCardLevel1';
4
+ import { ImageData1 } from '../fixtures/ImageData1';
4
5
 
5
6
  describe('NsHeroCardLevel1 component', () => {
6
7
  const props = {
7
8
  cardTitle: 'A skin ready for winter',
8
9
  cardDescription:
9
10
  'We have brought these discoveries to life through our powerful skin care products and supplements.',
10
- backgroundImageUrl:
11
- 'https://media.nuskin.com/m/9734240cc191163/webimage-lash-brow-serum-carousel-image-launch.png',
12
- backgroundImageAlt: 'lash brow serum carousel',
11
+ backgroundImageDetail: ImageData1,
13
12
  button: {
14
13
  showButton: true,
15
14
  buttonText: 'SHOP NOW',
@@ -1,14 +1,14 @@
1
1
  import React from 'react';
2
2
  import { render, screen } from '@testing-library/react';
3
3
  import { NsHeroCardLevel2 } from '../';
4
+ import { ImageData1 } from '../fixtures/ImageData1';
4
5
 
5
6
  describe('NsHeroCardLevel2 component', () => {
6
7
  const props = {
7
8
  cardTitle: 'Current shop deals',
8
9
  cardDescription: 'Lumispa, sunscreen and more',
9
10
  brandName: 'Beauty focus™',
10
- backgroundImageUrl: 'https://media.nuskin.com/m/5f1c423bb57589f0/webimage-autumn-sale-carousel.png',
11
- backgroundImageAlt: 'lash brow serum carousel',
11
+ backgroundImageDetail: ImageData1,
12
12
  button: {
13
13
  showButton: true,
14
14
  buttonText: 'Discover more',
@@ -1,5 +1,6 @@
1
1
  import { render, screen } from '@testing-library/react';
2
2
  import { NsLargeCard } from '../';
3
+ import { ImageData1 } from '../fixtures/ImageData1';
3
4
 
4
5
  describe('NsLargeCard component', () => {
5
6
  const props = {
@@ -14,9 +15,7 @@ describe('NsLargeCard component', () => {
14
15
  buttonColor: 'secondary' as 'secondary',
15
16
  url: 'https://www.forceforgood.org/',
16
17
  },
17
- backgroundImageUrl:
18
- 'https://media.nuskin.com/m/95f9cf4143e3882/Small-About_Us-Personal-Care-Products-Image.jpg',
19
- backgroundImageAlt: 'Facial Moisturizers',
18
+ backgroundImageDetail: ImageData1,
20
19
  };
21
20
 
22
21
  it('1. renders with correct content and styles', () => {
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { render, screen } from '@testing-library/react';
3
3
  import NsMediumCard from '../NsMediumCard';
4
+ import { ImageData1 } from '../fixtures/ImageData1';
4
5
 
5
6
  describe('NsMediumCard component', () => {
6
7
  const props = {
@@ -15,8 +16,7 @@ describe('NsMediumCard component', () => {
15
16
  buttonColor: 'secondary' as 'secondary',
16
17
  url: '#',
17
18
  },
18
- backgroundImageUrl: 'https://media.nuskin.com/m/3353b9c05cb83860/Small-category-facial_moisturizers.jpg',
19
- backgroundImageAlt: 'Lumi Spa',
19
+ backgroundImageDetail: ImageData1,
20
20
  };
21
21
 
22
22
  it('1. renders with correct content and styles', () => {
@@ -33,7 +33,7 @@ describe('NsMediumCard component', () => {
33
33
  );
34
34
  expect(subtitleElement).toBeInTheDocument();
35
35
 
36
- const imageElement = screen.getByAltText('Lumi Spa');
36
+ const imageElement = screen.getByAltText(ImageData1.selected?.altText || '');
37
37
  expect(imageElement).toBeInTheDocument();
38
38
 
39
39
  const button = screen.queryByText('SEE WHAT WE’RE DOING');
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { render, screen } from '@testing-library/react';
3
3
  import NsPost from '../NsPost';
4
+ import { ImageData1 } from '../fixtures/ImageData1';
4
5
 
5
6
  describe('NsPost component', () => {
6
7
  const props = {
7
8
  text: '38 New Beauty Products Our Editors Are Loving',
8
9
  body: 'SPA & BEAUTY TODAY',
9
- backgroundImageUrl: 'https://media.nuskin.com/m/780f8d84bcb9d5ed/Small-Essence_News.jpg',
10
- backgroundImageAlt: 'small essence news',
10
+ backgroundImageDetail: ImageData1,
11
11
  };
12
12
 
13
13
  it('1. renders with correct content and styles', () => {
@@ -22,7 +22,7 @@ describe('NsPost component', () => {
22
22
  const bodyElement = screen.getByText('SPA & BEAUTY TODAY');
23
23
  expect(bodyElement).toBeInTheDocument();
24
24
 
25
- const imageElement = screen.getByAltText('small essence news');
25
+ const imageElement = screen.getByAltText(ImageData1?.selected?.altText || '');
26
26
  expect(imageElement).toBeInTheDocument();
27
27
  });
28
28
  });
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { render, screen } from '@testing-library/react';
3
3
  import NsSmallFullCard from '../NsSmallFullCard';
4
+ import { ImageData1 } from '../fixtures/ImageData1';
4
5
 
5
6
  describe('NsSmallFullCard component', () => {
6
7
  const props = {
7
8
  title: 'Title',
8
9
  subtitle: 'Subtitle',
9
- backgroundImageUrl: 'https://media.nuskin.com/m/4f5b0aee8fe3ff90/Small-category-makeup.jpg',
10
- backgroundImageAlt: 'Facial Moisturizers',
10
+ backgroundImageDetail: ImageData1,
11
11
  button: {
12
12
  showButton: true,
13
13
  buttonText: 'Placeholder',
@@ -29,7 +29,7 @@ describe('NsSmallFullCard component', () => {
29
29
  const subtitleElement = screen.getByText('Subtitle');
30
30
  expect(subtitleElement).toBeInTheDocument();
31
31
 
32
- const imageElement = screen.getByAltText('Facial Moisturizers');
32
+ const imageElement = screen.getByAltText(ImageData1.selected?.altText || '');
33
33
  expect(imageElement).toBeInTheDocument();
34
34
 
35
35
  const linkElement = screen.getByText('Placeholder');
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { render, screen } from '@testing-library/react';
3
3
  import NsXLargeCard from '../NsXLargeCard';
4
+ import { ImageData1 } from '../fixtures/ImageData1';
4
5
 
5
6
  describe('NsXLargeCard component', () => {
6
7
  const props = {
7
8
  title: 'Title',
8
9
  subtitle: 'Subtitle',
9
- backgroundImageUrl: 'https://media.nuskin.com/m/4f5b0aee8fe3ff90/Small-category-makeup.jpg',
10
- backgroundImageAlt: 'Facial Moisturizers',
10
+ backgroundImageDetail: ImageData1,
11
11
  button: {
12
12
  showButton: true,
13
13
  buttonText: 'Discover more',
@@ -29,7 +29,7 @@ describe('NsXLargeCard component', () => {
29
29
  const titleElement = screen.getByText('Title');
30
30
  expect(titleElement).toBeInTheDocument();
31
31
 
32
- const imageElement = screen.getByAltText('Facial Moisturizers');
32
+ const imageElement = screen.getByAltText(ImageData1.selected?.altText || '');
33
33
  expect(imageElement).toBeInTheDocument();
34
34
 
35
35
  const linkElement = screen.getByText('Discover more');
@@ -1,5 +1,6 @@
1
1
  import type { StoryObj, Meta } from '@storybook/react';
2
2
  import { NsAwardCard } from '../';
3
+ import { ImageData1 } from '../fixtures/ImageData1';
3
4
 
4
5
  type ComponentType = typeof NsAwardCard;
5
6
  type Story = StoryObj<ComponentType>;
@@ -10,14 +11,11 @@ export default {
10
11
  title: 'Components/Containers/Card/NsAwardCard',
11
12
  } as MetaStory;
12
13
 
13
- const host = 'https://media.nuskin.com';
14
-
15
14
  export const Default: Story = {
16
15
  args: {
17
16
  title: 'AgeLoc LumiSpa iO',
18
17
  awardName: '2023 Bronze Winner',
19
18
  mediaOutlet: 'Edison Awards',
20
- backgroundImageUrl: `${host}/m/2ec571a87dc9680c/Small-Edison-Bronze-Logo-Homepage.jpg`,
21
- backgroundImageAlt: 'Edison Bronze Logo',
19
+ backgroundImageDetail: ImageData1,
22
20
  },
23
21
  };
@@ -1,5 +1,6 @@
1
1
  import type { StoryObj, Meta } from '@storybook/react';
2
2
  import { NsHeroCardLevel1 } from '../';
3
+ import { ImageData1 } from '../fixtures/ImageData1';
3
4
 
4
5
  type ComponentType = typeof NsHeroCardLevel1;
5
6
  type Story = StoryObj<ComponentType>;
@@ -10,15 +11,12 @@ export default {
10
11
  title: 'Components/Containers/Card/NsHeroCardLevel1',
11
12
  } as MetaStory;
12
13
 
13
- const host = 'https://media.nuskin.com/';
14
-
15
14
  export const Default: Story = {
16
15
  args: {
17
16
  cardTitle: 'A skin ready for winter',
18
17
  cardDescription:
19
18
  'We have brought these discoveries to life through our powerful skin care products and supplements.',
20
- backgroundImageUrl: `${host}m/9734240cc191163/webimage-lash-brow-serum-carousel-image-launch.png`,
21
- backgroundImageAlt: 'lash brow serum carousel',
19
+ backgroundImageDetail: ImageData1,
22
20
  button: {
23
21
  showButton: true,
24
22
  fullWidth: true,
@@ -1,5 +1,6 @@
1
1
  import type { StoryObj, Meta } from '@storybook/react';
2
2
  import { NsHeroCardLevel2 } from '../';
3
+ import { ImageData1 } from '../fixtures/ImageData1';
3
4
 
4
5
  type ComponentType = typeof NsHeroCardLevel2;
5
6
  type Story = StoryObj<ComponentType>;
@@ -10,15 +11,12 @@ export default {
10
11
  title: 'Components/Containers/Card/NsHeroCardLevel2',
11
12
  } as MetaStory;
12
13
 
13
- const host = 'https://media.nuskin.com/';
14
-
15
14
  export const Default: Story = {
16
15
  args: {
17
16
  cardTitle: 'Current shop deals',
18
17
  cardDescription: 'Lumispa, sunscreen and more',
19
18
  brandName: 'Beauty focus™',
20
- backgroundImageUrl: `${host}m/5f1c423bb57589f0/webimage-autumn-sale-carousel.png`,
21
- backgroundImageAlt: 'lash brow serum carousel',
19
+ backgroundImageDetail: ImageData1,
22
20
  button: {
23
21
  showButton: true,
24
22
  endIcon: 'arrowRight',
@@ -1,6 +1,7 @@
1
1
  import type { StoryObj, Meta } from '@storybook/react';
2
2
  import { withCenterDecorator } from '@/stories/decorators/withCenterDecorator';
3
3
  import { NsLargeCard } from '../';
4
+ import { ImageData1 } from '../fixtures/ImageData1';
4
5
 
5
6
  type ComponentType = typeof NsLargeCard;
6
7
  type Story = StoryObj<ComponentType>;
@@ -12,16 +13,13 @@ export default {
12
13
  decorators: [withCenterDecorator],
13
14
  } as MetaStory;
14
15
 
15
- const host = 'https://media.nuskin.com';
16
-
17
16
  export const Default: Story = {
18
17
  args: {
19
18
  isHorizontal: false,
20
19
  title: 'Personal Care',
21
20
  subtitle: 'Subtitle',
22
21
  intro: 'Nu Skin® product lines combine nature and science for skincare benefits you can see and feel.',
23
- backgroundImageUrl: `${host}/m/95f9cf4143e3882/Small-About_Us-Personal-Care-Products-Image.jpg`,
24
- backgroundImageAlt: 'Facial Moisturizers',
22
+ backgroundImageDetail: ImageData1,
25
23
  button: {
26
24
  showButton: true,
27
25
  buttonText: 'REVEAL YOUR BEST SKIN',
@@ -2,6 +2,7 @@ import { withCenterDecorator } from '@/stories/decorators/withCenterDecorator';
2
2
  import type { Meta, StoryObj } from '@storybook/react';
3
3
 
4
4
  import { NsMediumCard } from '../';
5
+ import { ImageData1 } from '../fixtures/ImageData1';
5
6
 
6
7
  type ComponentType = typeof NsMediumCard;
7
8
  type Story = StoryObj<ComponentType>;
@@ -14,16 +15,13 @@ export default {
14
15
  decorators: [withCenterDecorator],
15
16
  } as MetaStory;
16
17
 
17
- const host = 'https://media.nuskin.com';
18
-
19
18
  export const Default: Story = {
20
19
  args: {
21
20
  title: 'Sustainability',
22
21
  titleFontWeight: 'bold',
23
22
  subtitle:
24
23
  'We’re committed to keeping our global communities clean, safe, and protected for the future. We’re proud to embrace sustainable practices today for a resource-rich tomorrow.',
25
- backgroundImageUrl: `${host}/m/3353b9c05cb83860/Small-category-facial_moisturizers.jpg`,
26
- backgroundImageAlt: 'Lumi Spa',
24
+ backgroundImageDetail: ImageData1,
27
25
  button: {
28
26
  showButton: true,
29
27
  buttonText: 'SEE WHAT WE’RE DOING',
@@ -1,5 +1,6 @@
1
1
  import type { StoryObj, Meta } from '@storybook/react';
2
2
  import { NsPost } from '../';
3
+ import { ImageData1 } from '../fixtures/ImageData1';
3
4
 
4
5
  type ComponentType = typeof NsPost;
5
6
  type Story = StoryObj<ComponentType>;
@@ -10,13 +11,10 @@ export default {
10
11
  title: 'Components/Containers/Card/NsPost',
11
12
  } as MetaStory;
12
13
 
13
- const host = 'https://media.nuskin.com/';
14
-
15
14
  export const Default: Story = {
16
15
  args: {
17
16
  text: '38 New Beauty Products Our Editors Are Loving',
18
17
  body: 'SPA & BEAUTY TODAY',
19
- backgroundImageUrl: `${host}m/780f8d84bcb9d5ed/Small-Essence_News.jpg`,
20
- backgroundImageAlt: 'small essence news',
18
+ backgroundImageDetail: ImageData1,
21
19
  },
22
20
  };
@@ -1,6 +1,7 @@
1
1
  import type { StoryObj, Meta } from '@storybook/react';
2
2
  import { withCenterDecorator } from '@/stories/decorators/withCenterDecorator';
3
3
  import { NsSmallFullCard } from '../';
4
+ import { ImageData1 } from '../fixtures/ImageData1';
4
5
 
5
6
  type ComponentType = typeof NsSmallFullCard;
6
7
  type Story = StoryObj<ComponentType>;
@@ -13,14 +14,11 @@ export default {
13
14
  decorators: [withCenterDecorator],
14
15
  } as MetaStory;
15
16
 
16
- const host = 'https://media.nuskin.com';
17
-
18
17
  export const Default: Story = {
19
18
  args: {
20
19
  title: 'Title',
21
20
  subtitle: 'Subtitle',
22
- backgroundImageUrl: `${host}/m/4f5b0aee8fe3ff90/Small-category-makeup.jpg`,
23
- backgroundImageAlt: 'Facial Moisturizers',
21
+ backgroundImageDetail: ImageData1,
24
22
  button: {
25
23
  showButton: true,
26
24
  buttonText: 'Placeholder',
@@ -1,6 +1,8 @@
1
- import type { StoryObj, Meta } from '@storybook/react';
2
1
  import { withCenterDecorator } from '@/stories/decorators/withCenterDecorator';
2
+ import type { Meta, StoryObj } from '@storybook/react';
3
+
3
4
  import { NsXLargeCard } from '../';
5
+ import { ImageData1 } from '../fixtures/ImageData1';
4
6
 
5
7
  type ComponentType = typeof NsXLargeCard;
6
8
  type Story = StoryObj<ComponentType>;
@@ -13,14 +15,11 @@ export default {
13
15
  decorators: [withCenterDecorator],
14
16
  } as MetaStory;
15
17
 
16
- const host = 'https://media.nuskin.com';
17
-
18
18
  export const Default: Story = {
19
19
  args: {
20
20
  title: 'Title',
21
21
  subtitle: 'Subtitle',
22
- backgroundImageUrl: `${host}/m/4f5b0aee8fe3ff90/Small-category-makeup.jpg`,
23
- backgroundImageAlt: 'Facial Moisturizers',
22
+ backgroundImageDetail: ImageData1,
24
23
  button: {
25
24
  showButton: true,
26
25
  buttonText: 'Discover more',
@@ -1,6 +1,9 @@
1
+ import { ReactElement } from 'react';
2
+
1
3
  import { styled } from '@nuskin/foundation-theme';
4
+
5
+ import { NsIcon, NsLink, NsTypography } from '../';
2
6
  import IconWrapper from './IconWrapper';
3
- import { NsTypography, NsLink, NsIcon } from '..';
4
7
 
5
8
  interface CarousalControlProps {
6
9
  next(): void;
@@ -20,7 +23,7 @@ const InnerWrapper = styled.div`
20
23
  gap: 20px;
21
24
  align-items: center;
22
25
  `;
23
- const CarousalControl = ({ next, prev, viewAllUrl, viewAllLabel }: CarousalControlProps) => {
26
+ const CarousalControl = ({ next, prev, viewAllUrl, viewAllLabel }: CarousalControlProps): ReactElement => {
24
27
  return (
25
28
  <Wrapper>
26
29
  <InnerWrapper>
@@ -1,6 +1,7 @@
1
- import { PropsWithChildren } from 'react';
2
- import { styled } from '@nuskin/foundation-theme';
1
+ import { PropsWithChildren, ReactElement } from 'react';
2
+
3
3
  import { Box } from '@mui/material';
4
+ import { styled } from '@nuskin/foundation-theme';
4
5
 
5
6
  type IconWrapperProps = PropsWithChildren<{
6
7
  onClick(): void;
@@ -22,7 +23,7 @@ const Wrapper = styled(
22
23
  boxSizing: 'content-box',
23
24
  };
24
25
  });
25
- const IconWrapper = ({ children, onClick, className }: IconWrapperProps) => {
26
+ const IconWrapper = ({ children, onClick, className }: IconWrapperProps): ReactElement => {
26
27
  return (
27
28
  <Wrapper component="span" className={className || ''} onClick={onClick}>
28
29
  {children}
@@ -1,14 +1,16 @@
1
+ import 'slick-carousel/slick/slick-theme.css';
2
+ import 'slick-carousel/slick/slick.css';
3
+
4
+ import { ReactElement, ReactNode, useCallback, useRef } from 'react';
5
+
6
+ import Slider from 'react-slick';
7
+
1
8
  import Box from '@mui/material/Box';
2
9
  import { styled } from '@nuskin/foundation-theme';
3
- import { ReactNode, useCallback, useRef } from 'react';
4
- import Slider from 'react-slick';
5
10
 
6
11
  import CarousalControl from './CarousalControl';
7
12
  import defaultCarousalSettings from './slickSetting';
8
13
 
9
- import 'slick-carousel/slick/slick-theme.css';
10
- import 'slick-carousel/slick/slick.css';
11
-
12
14
  const SlickContainer = styled(Box)(() => {
13
15
  return {
14
16
  padding: '30px 0 60px',
@@ -34,7 +36,7 @@ export default function NsCarousal({
34
36
  settings,
35
37
  allEntryLabel = 'View All',
36
38
  showControlButtons = true,
37
- }: CarousalProps) {
39
+ }: CarousalProps): ReactElement {
38
40
  const sliderRef = useRef();
39
41
  const prev = useCallback(() => {
40
42
  if (sliderRef.current) {
@@ -1,4 +1,4 @@
1
- import React, { useMemo } from 'react';
1
+ import React, { ReactElement, useMemo } from 'react';
2
2
 
3
3
  import Slider from 'react-slick';
4
4
 
@@ -28,7 +28,7 @@ const NsScrollingCarousal = ({
28
28
  settings,
29
29
  dotsBottomPixel,
30
30
  additionalProps,
31
- }: NsScrollingCarousalProps) => {
31
+ }: NsScrollingCarousalProps): ReactElement => {
32
32
  const defaultSettings = useMemo(() => {
33
33
  return {
34
34
  ...settings,
@@ -1,3 +1,5 @@
1
+ import { ReactElement } from 'react';
2
+
1
3
  import NsBrandCard from '../card/NsBrandCard';
2
4
 
3
5
  interface BrandType {
@@ -5,7 +7,7 @@ interface BrandType {
5
7
  backgroundImage: string;
6
8
  brandImage: string;
7
9
  }
8
- export const RenderBrand = (entry: BrandType, index: number) => {
10
+ export const RenderBrand = (entry: BrandType, index: number): ReactElement => {
9
11
  const { title, backgroundImage, brandImage } = entry;
10
12
  return (
11
13
  <NsBrandCard
@@ -1,5 +1,7 @@
1
- import { render, screen, fireEvent } from '@/test-utils/index';
1
+ import { ReactElement } from 'react';
2
+
2
3
  import { NsScrollingCarousal } from '@/common/';
4
+ import { fireEvent, render, screen } from '@/test-utils/index';
3
5
 
4
6
  const mockEntries = [
5
7
  { id: 1, title: 'First entry' },
@@ -9,7 +11,7 @@ const mockEntries = [
9
11
  { id: 5, title: 'Fifth entry' },
10
12
  ];
11
13
 
12
- const mockRenderEntry = (entry: any, index: number) => {
14
+ const mockRenderEntry = (entry: any, index: number): ReactElement => {
13
15
  return <div key={index}>{entry.title}</div>;
14
16
  };
15
17
  const mockSettings = {
@@ -1,5 +1,8 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
1
+ import { ReactElement } from 'react';
2
+
2
3
  import { NsCarousal } from '@/common/';
4
+ import type { Meta, StoryObj } from '@storybook/react';
5
+
3
6
  import { brandEntries } from '../../card/stories/data';
4
7
  import { RenderBrand } from '../RenderBrand';
5
8
  import settings from '../slickSetting';
@@ -13,7 +16,7 @@ export default {
13
16
  component: NsCarousal,
14
17
  argTypes: {},
15
18
  decorators: [
16
- (Story) => (
19
+ (Story): ReactElement => (
17
20
  <div style={{ width: 800 }}>
18
21
  <Story />
19
22
  </div>
@@ -1,3 +1,5 @@
1
+ import { ReactElement } from 'react';
2
+
1
3
  import { NsScrollingCarousal, NsTextStrip } from '@/common/';
2
4
  import { withCenterDecorator } from '@/stories/decorators/withCenterDecorator';
3
5
  import type { Meta, StoryObj } from '@storybook/react';
@@ -6,7 +8,7 @@ type ComponentType = typeof NsScrollingCarousal;
6
8
  type Story = StoryObj<ComponentType>;
7
9
  type MetaStory = Meta<ComponentType>;
8
10
 
9
- const renderSlide = (slide: any, i: number) => <NsTextStrip key={i} {...slide} />;
11
+ const renderSlide = (slide: any, i: number): ReactElement => <NsTextStrip key={i} {...slide} />;
10
12
 
11
13
  const slides = [
12
14
  {
@@ -68,7 +70,7 @@ export default {
68
70
  testid: 'scrolling-carousal',
69
71
  },
70
72
  },
71
- render: (args) => (
73
+ render: (args): ReactElement => (
72
74
  <div style={{ width: '90vw' }}>
73
75
  <NsScrollingCarousal {...args} />
74
76
  </div>
@@ -1,9 +1,17 @@
1
+ import { ReactElement } from 'react';
2
+
1
3
  import { IconButton } from '@mui/material';
4
+
2
5
  import { NsIcon } from '../icon';
3
6
  import { StyledBadge } from './NsCartIcon.styled';
4
7
  import { NsCartIconProps } from './types.d';
5
8
 
6
- const NsCartIcon = ({ itemCount = 0, size = 'large', color = 'primary', maxItemCount = 999 }: NsCartIconProps) => {
9
+ const NsCartIcon = ({
10
+ itemCount = 0,
11
+ size = 'large',
12
+ color = 'primary',
13
+ maxItemCount = 999,
14
+ }: NsCartIconProps): ReactElement => {
7
15
  return (
8
16
  <IconButton aria-label="cart">
9
17
  <StyledBadge badgeContent={itemCount} max={maxItemCount} bgcolor={color} showZero>
@@ -1,8 +1,9 @@
1
- import React, { useState } from 'react';
2
- import { within } from '@storybook/testing-library';
1
+ import React, { ReactElement, useState } from 'react';
2
+
3
3
  import { withCenterDecorator } from '@/stories/decorators/withCenterDecorator';
4
- import type { StoryObj, Meta } from '@storybook/react';
5
4
  import { expect } from '@storybook/jest';
5
+ import type { Meta, StoryObj } from '@storybook/react';
6
+ import { within } from '@storybook/testing-library';
6
7
 
7
8
  import { NsCheckbox } from './';
8
9
 
@@ -35,7 +36,7 @@ export default {
35
36
  },
36
37
  } as MetaStory;
37
38
 
38
- const RenderCheckbox = (args: any) => {
39
+ const RenderCheckbox = (args: any): ReactElement => {
39
40
  const [isChecked, setIsChecked] = useState(false);
40
41
  const handleChange = (event: { target: { checked: boolean } }) => {
41
42
  const isChecked = event.target.checked;
@@ -4,16 +4,16 @@
4
4
  * @description
5
5
  */
6
6
 
7
- import React, { PropsWithChildren, useCallback } from 'react';
8
- import FormControlLabel from '@mui/material/FormControlLabel';
9
- import { default as MUICheckbox } from '@mui/material/Checkbox';
7
+ import React, { PropsWithChildren, ReactElement, useCallback } from 'react';
10
8
 
11
- import { BpCheckedIcon, BpIcon, StyledLabel, StyledFlagLabel } from './NsCheckbox.styled';
12
- import { NsCheckboxProps } from './types.d';
9
+ import MUICheckbox from '@mui/material/Checkbox';
10
+ import FormControlLabel from '@mui/material/FormControlLabel';
13
11
 
14
12
  import { NsTypography } from '../';
13
+ import { BpCheckedIcon, BpIcon, StyledFlagLabel, StyledLabel } from './NsCheckbox.styled';
14
+ import { NsCheckboxProps } from './types.d';
15
15
 
16
- const NsCheckbox = (props: PropsWithChildren<NsCheckboxProps>) => {
16
+ const NsCheckbox = (props: PropsWithChildren<NsCheckboxProps>): ReactElement => {
17
17
  const {
18
18
  name,
19
19
  label,
@@ -1,9 +1,11 @@
1
- import { useMemo } from 'react';
1
+ import { ReactElement, useMemo } from 'react';
2
+
2
3
  import { Box } from '@mui/material';
3
4
  import { styled } from '@nuskin/foundation-theme';
5
+
6
+ import { shouldNotForwardPropsWithKeys } from '../util';
4
7
  import { NsColumnControlProps, sizeObjectType } from './types.d';
5
8
  import { getColumnSizes } from './utils';
6
- import { shouldNotForwardPropsWithKeys } from '../util';
7
9
 
8
10
  type StyledDivProps = {
9
11
  sizes: sizeObjectType;
@@ -42,7 +44,7 @@ const StyledDiv = styled(
42
44
  };
43
45
  });
44
46
 
45
- const NsColumnControl = ({ columnClass, children, gap, additionalProps }: NsColumnControlProps) => {
47
+ const NsColumnControl = ({ columnClass, children, gap, additionalProps }: NsColumnControlProps): ReactElement => {
46
48
  const sizes = useMemo(() => {
47
49
  return getColumnSizes(columnClass);
48
50
  }, [columnClass]);
@@ -1,9 +1,16 @@
1
- import { useMemo } from 'react';
2
- import { getColumnSizes } from './utils';
1
+ import { ReactElement, useMemo } from 'react';
2
+
3
3
  import { StyledFlex } from './styled/StyledFlex';
4
4
  import { NsFlexColumnsProps } from './types';
5
+ import { getColumnSizes } from './utils';
5
6
 
6
- const NsFlexColumns = ({ columnClass, children, gap, additionalProps, isFullWidth }: NsFlexColumnsProps) => {
7
+ const NsFlexColumns = ({
8
+ columnClass,
9
+ children,
10
+ gap,
11
+ additionalProps,
12
+ isFullWidth,
13
+ }: NsFlexColumnsProps): ReactElement => {
7
14
  const sizes = useMemo(() => {
8
15
  return getColumnSizes(columnClass ?? 'ns-col-lg-1-1');
9
16
  }, [columnClass]);
@@ -1,9 +1,16 @@
1
- import { useMemo } from 'react';
2
- import { getColumnSizes } from './utils';
1
+ import { ReactElement, useMemo } from 'react';
2
+
3
3
  import { StyledGrid } from './styled/StyledGrid';
4
4
  import { NsGridColumnsProps } from './types';
5
+ import { getColumnSizes } from './utils';
5
6
 
6
- const NsGridColumns = ({ columnClass, children, gap, isFullWidth, additionalProps }: NsGridColumnsProps) => {
7
+ const NsGridColumns = ({
8
+ columnClass,
9
+ children,
10
+ gap,
11
+ isFullWidth,
12
+ additionalProps,
13
+ }: NsGridColumnsProps): ReactElement => {
7
14
  const sizes = useMemo(() => {
8
15
  return getColumnSizes(columnClass ?? 'ns-col-lg-1-1');
9
16
  }, [columnClass]);