@nuskin/foundation-ui-components 1.6.0 → 1.7.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 (54) hide show
  1. package/package.json +1 -1
  2. package/src/common/autocomplete/NsAutocomplete.styled.tsx +5 -1
  3. package/src/common/autocomplete/NsAutocomplete.tsx +19 -71
  4. package/src/common/autocomplete/helper/ClearButton.tsx +22 -0
  5. package/src/common/autocomplete/helper/SeeMoreButton.tsx +47 -0
  6. package/src/common/autocomplete/helper/renderGroupName.tsx +17 -0
  7. package/src/common/autocomplete/stories/ACWithoutClose.tsx +49 -0
  8. package/src/common/autocomplete/stories/NsAutocomplete.stories.tsx +76 -0
  9. package/src/common/autocomplete/stories/RenderAutoComplete.tsx +60 -0
  10. package/src/common/autocomplete/types.d.ts +1 -1
  11. package/src/common/card/NsBrandCard.tsx +94 -0
  12. package/src/common/card/NsCheckoutCard.tsx +92 -0
  13. package/src/common/card/NsHeroCardLevel1.tsx +106 -0
  14. package/src/common/card/NsHeroCardLevel2.tsx +126 -0
  15. package/src/common/card/NsIconText.tsx +153 -0
  16. package/src/common/card/NsLargeCard.tsx +120 -0
  17. package/src/common/card/NsMediumCard.tsx +64 -0
  18. package/src/common/card/NsPost.tsx +60 -0
  19. package/src/common/card/NsSmallFullCard.tsx +90 -0
  20. package/src/common/card/NsXLargeCard.tsx +80 -0
  21. package/src/common/card/cardSizes.ts +12 -0
  22. package/src/common/card/index.ts +10 -2
  23. package/src/common/card/specs/BrandLogo.spec.tsx +1 -1
  24. package/src/common/card/specs/NsBgCard.spec.tsx +2 -2
  25. package/src/common/card/specs/NsBrandCard.spec.tsx +97 -0
  26. package/src/common/card/specs/NsCheckoutCard.spec.tsx +50 -0
  27. package/src/common/card/specs/NsHeroCardLevel1.spec.tsx +48 -0
  28. package/src/common/card/specs/NsHeroCardLevel2.spec.tsx +51 -0
  29. package/src/common/card/specs/NsIconText.spec.tsx +28 -0
  30. package/src/common/card/specs/NsLargeCard.spec.tsx +41 -0
  31. package/src/common/card/specs/NsMediumCard.spec.tsx +35 -0
  32. package/src/common/card/specs/NsPost.spec.tsx +31 -0
  33. package/src/common/card/specs/NsSmallFullCard.spec.tsx +36 -0
  34. package/src/common/card/specs/NsXLargeCard.spec.tsx +35 -0
  35. package/src/common/card/stories/{NsBrandProductCard.stories.tsx → NsBrandCard.stories.tsx} +9 -4
  36. package/src/common/card/stories/NsCheckoutCard.stories.tsx +24 -0
  37. package/src/common/card/stories/NsHeroCardLevel1.stories.tsx +45 -0
  38. package/src/common/card/stories/NsHeroCardLevel2.stories.tsx +50 -0
  39. package/src/common/card/stories/NsIconText.stories.tsx +36 -0
  40. package/src/common/card/stories/NsLargeCard.stories.tsx +32 -0
  41. package/src/common/card/stories/NsMediumCard.stories.tsx +29 -0
  42. package/src/common/card/stories/NsPost.stories.tsx +39 -0
  43. package/src/common/card/stories/NsSmallFullCard.stories.tsx +29 -0
  44. package/src/common/card/stories/NsXLargeCard.stories.tsx +29 -0
  45. package/src/common/carousal/RenderBrand.tsx +3 -2
  46. package/src/common/input/InputWrapper.tsx +1 -1
  47. package/src/common/autocomplete/NsAutocomplete.stories.tsx +0 -108
  48. package/src/common/card/NsBrandProductCard.tsx +0 -47
  49. package/src/common/card/NsFfgCard.tsx +0 -24
  50. package/src/common/card/specs/NsBrandProductCard.spec.tsx +0 -32
  51. package/src/common/card/specs/NsFfgCard.spec.tsx +0 -33
  52. package/src/common/card/stories/NsBgCard.stories.tsx +0 -20
  53. package/src/common/card/stories/NsFfgCard.stories.tsx +0 -73
  54. package/src/common/card/styled/NsFfgStyled.tsx +0 -46
@@ -1,20 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import { NsBgCard } from '../';
3
- import { withCenterDecorator } from '@/stories/decorators/withCenterDecorator';
4
-
5
- type ComponentType = typeof NsBgCard;
6
- type Story = StoryObj<ComponentType>;
7
- type MetaStory = Meta<ComponentType>;
8
-
9
- export default {
10
- component: NsBgCard,
11
- title: 'Components/Containers/Card/NsBgCard',
12
- argTypes: {},
13
- args: {
14
- title: 'ageLOC LumiSpa',
15
- backgroundImageUrl: 'https://media.nuskin.com/m/3604b5202b0b64c6/webimage-brand-lumispa-optweb.png',
16
- },
17
- decorators: [withCenterDecorator],
18
- } as MetaStory;
19
-
20
- export const BgCard: Story = {};
@@ -1,73 +0,0 @@
1
- import type { StoryObj, Meta } from '@storybook/react';
2
- import { within, userEvent } from '@storybook/testing-library';
3
- import { expect } from '@storybook/jest';
4
- import { withCenterDecorator } from '@/stories/decorators/withCenterDecorator';
5
- import { NsFfgCard } from '../';
6
-
7
- type ComponentType = typeof NsFfgCard;
8
- type Story = StoryObj<ComponentType>;
9
- type MetaStory = Meta<ComponentType>;
10
-
11
- export default {
12
- component: NsFfgCard,
13
- title: 'Components/Containers/Card/NsFfgCard',
14
- argTypes: {
15
- onClick: {
16
- action: 'clicked',
17
- },
18
- },
19
- decorators: [withCenterDecorator],
20
- } as MetaStory;
21
-
22
- const text = `Every child deserves a chance to shine. Through our Nu Skin Force for Good Foundation,
23
- we’re empowering children around the world with hope for a brighter future.`;
24
- const host = 'https://images.contentstack.io/v3/assets';
25
-
26
- export const Default: Story = {
27
- args: {
28
- cardLink: {
29
- href: 'https://www.forceforgood.org/',
30
- title: 'LEARN MORE',
31
- },
32
- text,
33
- topImageUrl: `${host}/blt594f30e2dc643eae/blt34cdb300dc9b93ff/645ccaa7520ba1a1af13a08a/nsffg-foundation.webp`,
34
- topImageAlt: 'Force for Good Foundation',
35
- additionalProps: {
36
- testid: 'ffg-card',
37
- },
38
- onClick: () => {
39
- console.log('onClick called');
40
- },
41
- },
42
- play: async ({ canvasElement }: any) => {
43
- const canvas = within(canvasElement);
44
- userEvent.hover(canvas.getByTestId('ffg-card'));
45
- userEvent.hover(canvas.getByRole('link'));
46
- expect(canvas.getByText(text)).toBeInTheDocument();
47
- },
48
- };
49
- const d = { count: -1 };
50
- export const OnClick: Story = {
51
- args: {
52
- cardLink: {
53
- href: 'https://www.forceforgood.org/',
54
- title: 'LEARN MORE',
55
- },
56
- text,
57
- topImageUrl: `${host}/blt594f30e2dc643eae/blt34cdb300dc9b93ff/645ccaa7520ba1a1af13a08a/nsffg-foundation.webp`,
58
- topImageAlt: 'Force for Good Foundation',
59
- additionalProps: {
60
- testid: 'ffg-card',
61
- },
62
- onClick: () => {
63
- d.count = 1;
64
- console.log('on click called');
65
- },
66
- },
67
- play: async ({ canvasElement }: any) => {
68
- d.count = 0;
69
- const canvas = within(canvasElement);
70
- userEvent.click(canvas.getByTestId('ffg-card'));
71
- expect(d.count).toEqual(1);
72
- },
73
- };
@@ -1,46 +0,0 @@
1
- import { Box } from '@mui/material';
2
- import { styled } from '@nuskin/foundation-theme';
3
-
4
- const Component = () => {
5
- return {
6
- backgroundClip: 'border-box',
7
- backgroundColor: '#fff',
8
- border: '1px solid #eff2f7',
9
- borderRadius: '1rem',
10
- boxShadow: '0 0.75rem 1.5rem rgba(18, 38, 63, .03)',
11
- cursor: 'pointer',
12
- display: 'flex',
13
- flexDirection: 'column' as 'column', // https://github.com/cssinjs/jss/issues/1344
14
- marginBottom: '16px',
15
- transition: 'all .2s ease',
16
- textAlign: 'center' as 'center',
17
- wordWrap: 'break-word' as 'break-word',
18
- ':hover': {
19
- transform: 'translateY(-10px)',
20
- boxShadow: '0 1rem 3rem rgba(31, 45, 61, .125) !important',
21
- '.action-link': {
22
- color: '#2CD5C4',
23
- textDecoration: 'none',
24
- },
25
- },
26
- '.body-text': {
27
- padding: '0 1.5rem 4rem',
28
- fontSize: '16px',
29
- color: '#8492a6',
30
- },
31
- '.top-image': {
32
- padding: '3rem 1.5rem',
33
- img: {
34
- maxWidth: '100%',
35
- },
36
- },
37
- '.action-link': {
38
- color: '#3c4858',
39
- fontSize: '1.25rem',
40
- padding: '0 1.5rem 3rem',
41
- fontWeight: 600,
42
- marginBottom: '0.67rem',
43
- },
44
- };
45
- };
46
- export const NsFfgStyled = styled(Box)(Component);