@nuskin/foundation-ui-components 1.16.0-cx130-990.2 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/foundation-ui-components",
3
- "version": "1.16.0-cx130-990.2",
3
+ "version": "1.17.0",
4
4
  "description": "It is a foundation library written in react, that provides common components to all UI pages",
5
5
  "main": "src/common/index.ts",
6
6
  "repository": {
@@ -102,6 +102,5 @@
102
102
  "files": [
103
103
  "src/common"
104
104
  ],
105
- "readme": "./README.md",
106
- "packageManager": "yarn@3.6.3"
105
+ "readme": "./README.md"
107
106
  }
@@ -1,6 +1,6 @@
1
1
  import Box from '@mui/material/Box';
2
2
  import { styled } from '@nuskin/foundation-theme';
3
- import { NsImage } from '../';
3
+ import { NsImage, NsTypography } from '../';
4
4
 
5
5
  type NsAwardCardProps = {
6
6
  title: string;
@@ -29,25 +29,13 @@ const CardContainer = styled(Box)(() => {
29
29
  flexDirection: 'column',
30
30
  textAlign: 'center',
31
31
  alignItems: 'center',
32
+ marginTop: '25px',
32
33
  },
33
- '.title': {
34
- fontSize: '16px',
35
- fontWeight: 'bold',
36
- marginTop: '30px',
37
- },
38
- '.awardName': {
39
- fontSize: '16px',
40
- fontWeight: '400',
41
- marginTop: '20px',
42
- },
43
- '.mediaOutlet': {
44
- fontSize: '11px',
45
- fontWeight: '400',
34
+ '.content-text': {
46
35
  marginTop: '20px',
47
36
  },
48
37
  '.action-link': {
49
38
  marginTop: '10px',
50
- fontSize: '14px',
51
39
  alignSelf: 'start',
52
40
  },
53
41
  };
@@ -65,9 +53,15 @@ export default function NsAwardCard({
65
53
  <CardContainer className={className} role="award-card" component="div" data-testid="award-card">
66
54
  <NsImage alt={backgroundImageAlt} src={backgroundImageUrl} className="image" />
67
55
  <div className="content">
68
- <article className="title">{title}</article>
69
- <article className="awardName">{awardName}</article>
70
- <article className="mediaOutlet">{mediaOutlet}</article>
56
+ <NsTypography weight='normal' className="title" variant="h5">
57
+ {title}
58
+ </NsTypography>
59
+ <NsTypography className="content-text" variant="body-l">
60
+ {awardName}
61
+ </NsTypography>
62
+ <NsTypography className="content-text" variant="body-l">
63
+ {mediaOutlet}
64
+ </NsTypography>
71
65
  </div>
72
66
  </CardContainer>
73
67
  );
@@ -38,7 +38,6 @@ const CardContainer = styled((props: any) => <Box {...props} />)(({ size }) => {
38
38
  flexDirection: 'column',
39
39
  '.brand-title': {
40
40
  marginTop: '15px',
41
- fontSize: '20px',
42
41
  display: 'inline-block',
43
42
  wordBreak: 'break-word',
44
43
  },
@@ -75,7 +74,7 @@ export default function NsBrandCard({
75
74
  </NsBrandWrapper>
76
75
  </NsBgCard>
77
76
  {title ? (
78
- <NsTypography variant="h3" className="brand-title">
77
+ <NsTypography weight='normal' variant="h5" className="brand-title">
79
78
  {title}
80
79
  </NsTypography>
81
80
  ) : null}
@@ -1,5 +1,5 @@
1
1
  import Box from '@mui/material/Box';
2
- import { NsImage } from '../';
2
+ import { NsImage, NsTypography } from '../';
3
3
  import { styled } from '@nuskin/foundation-theme';
4
4
 
5
5
  type NsPostProps = {
@@ -22,16 +22,14 @@ const CardContainer = styled(Box)(() => {
22
22
  width: '210px',
23
23
  backgroundColor: '#fff',
24
24
  '.content': {
25
- padding: '10px',
25
+ paddingTop: '10px',
26
26
  display: 'flex',
27
27
  flexDirection: 'column',
28
28
  minHeight: '80px',
29
29
  justifyContent: 'space-between',
30
30
  },
31
31
  '.body-title': {
32
- fontSize: '18px',
33
32
  marginBottom: '5px',
34
- fontWeight: 600,
35
33
  display: '-webkit-box',
36
34
  '-webkit-box-orient': 'vertical',
37
35
  '-webkit-line-clamp': '3',
@@ -39,7 +37,6 @@ const CardContainer = styled(Box)(() => {
39
37
  textOverflow: 'ellipsis',
40
38
  },
41
39
  '.body-text': {
42
- fontSize: '12px',
43
40
  color: '#8C8C8C',
44
41
  marginBottom: '5px',
45
42
  },
@@ -53,8 +50,8 @@ const NsPost = ({ text, body, backgroundImageUrl, backgroundImageAlt, className
53
50
  <NsImage height="auto" width="100%" alt={backgroundImageAlt} src={backgroundImageUrl} />
54
51
  </div>
55
52
  <div className="content">
56
- <article className="body-title">{text}</article>
57
- <article className="body-text">{body}</article>
53
+ <NsTypography weight='normal' className="body-title" variant='h5'>{text}</NsTypography>
54
+ <NsTypography className="body-text" variant='body-l'>{body}</NsTypography>
58
55
  </div>
59
56
  </CardContainer>
60
57
  );
@@ -14,8 +14,6 @@ This component is visible over the carousal and it has prev and next buttons and
14
14
  const Wrapper = styled.div`
15
15
  display: flex;
16
16
  justify-content: flex-end;
17
- padding: 0 30px;
18
- margin: 30px 20px;
19
17
  `;
20
18
  const InnerWrapper = styled.div`
21
19
  display: flex;
@@ -28,7 +26,7 @@ const CarousalControl = ({ next, prev, viewAllUrl, viewAllLabel }: CarousalContr
28
26
  <InnerWrapper>
29
27
  {viewAllUrl ? (
30
28
  <NsLink href={viewAllUrl} underlineOnHover={false}>
31
- <NsTypography decoration="underline" variant={'h5'}>
29
+ <NsTypography decoration="underline" variant="body-l">
32
30
  {viewAllLabel}
33
31
  </NsTypography>
34
32
  </NsLink>
@@ -18,7 +18,7 @@ const Wrapper = styled(
18
18
  border: `2px solid ${strokeColor}`,
19
19
  borderRadius: '3px',
20
20
  cursor: 'pointer',
21
- padding: '6px 10px',
21
+ padding: '9px',
22
22
  boxSizing: 'content-box',
23
23
  };
24
24
  });
@@ -11,7 +11,7 @@ import 'slick-carousel/slick/slick.css';
11
11
 
12
12
  const SlickContainer = styled(Box)(() => {
13
13
  return {
14
- padding: '20px 0 50px',
14
+ padding: '30px 0 60px',
15
15
  '.slick-slide': {
16
16
  display: 'flex',
17
17
  justifyContent: 'center',
@@ -55,7 +55,6 @@ export default function NsCarousal({
55
55
  ) : null}
56
56
  <Slider {...{ ...defaultCarousalSettings, ...settings }} ref={sliderRef as any}>
57
57
  {entries.map((entry, index) => {
58
-
59
58
  return renderEntry(entry, index);
60
59
  })}
61
60
  </Slider>
@@ -4,12 +4,15 @@ import NsDropdown from './NsDropdown';
4
4
  import NsDropdownOption from './NsDropdownOption';
5
5
 
6
6
  function createDropdownOptions(options: { value: string; label: string }[]) {
7
- return options.map((option) => <NsDropdownOption key={option.value} value={option.value} label={option.label} />);
7
+ return options.map((option) => (
8
+ <NsDropdownOption key={option.value} value={option.value}>
9
+ {option.label}
10
+ </NsDropdownOption>
11
+ ));
8
12
  }
9
13
 
10
14
  describe('NsDropdown', () => {
11
15
  const onSelect = jest.fn();
12
- const selectedValue = '';
13
16
  const selectedLabel = '';
14
17
 
15
18
  const options = [
@@ -18,14 +21,9 @@ describe('NsDropdown', () => {
18
21
  { value: 'Option 3', label: 'Option 3' },
19
22
  ];
20
23
 
21
- it('renders the placeholder text when no value is selected', () => {
24
+ it('1. Should render the placeholder text when no value is selected', () => {
22
25
  render(
23
- <NsDropdown
24
- placeholder="Select an option"
25
- selectedValue={selectedValue}
26
- selectedLabel={selectedLabel}
27
- onSelect={onSelect}
28
- >
26
+ <NsDropdown placeholder="Select an option" selectedLabel={selectedLabel} onSelect={onSelect}>
29
27
  {createDropdownOptions(options)}
30
28
  </NsDropdown>
31
29
  );
@@ -33,20 +31,23 @@ describe('NsDropdown', () => {
33
31
  expect(screen.getByText('Select an option')).toBeInTheDocument();
34
32
  });
35
33
 
36
- it('renders the selected value label', () => {
37
- const selectedLabel = 'Option 1';
34
+ it('2. Should render the selected value label', () => {
38
35
  render(
39
- <NsDropdown selectedValue="Option 1" selectedLabel={selectedLabel} onSelect={onSelect}>
36
+ <NsDropdown selectedLabel={selectedLabel} onSelect={onSelect}>
40
37
  {createDropdownOptions(options)}
41
38
  </NsDropdown>
42
39
  );
40
+ const dropdownHead = screen.getByTestId('dropdown-head');
41
+ fireEvent.click(dropdownHead);
42
+ const dropdownOptionContainer = screen.getByTestId('dropdown-option-container-0');
43
43
 
44
- expect(screen.getByText(selectedLabel)).toBeInTheDocument();
44
+ fireEvent.click(dropdownOptionContainer);
45
+ expect(onSelect).toHaveBeenCalledWith('Option 1');
45
46
  });
46
47
 
47
- it('dropdown opens and closes on click', () => {
48
+ it('3. Should open and close Dropdown on click', () => {
48
49
  render(
49
- <NsDropdown selectedValue={selectedValue} selectedLabel={selectedLabel} onSelect={onSelect}>
50
+ <NsDropdown selectedLabel={selectedLabel} onSelect={onSelect}>
50
51
  {createDropdownOptions(options)}
51
52
  </NsDropdown>
52
53
  );
@@ -64,14 +65,9 @@ describe('NsDropdown', () => {
64
65
  expect(screen.queryByTestId('option-Option 3')).not.toBeInTheDocument();
65
66
  });
66
67
 
67
- it('dropdown closes on mouse leave when closeOnMouseLeave is set to true', async () => {
68
+ it('4. Should close dropdown on mouse leave when closeOnMouseLeave is set to true', async () => {
68
69
  render(
69
- <NsDropdown
70
- closeOnMouseLeave
71
- selectedValue={selectedValue}
72
- selectedLabel={selectedLabel}
73
- onSelect={onSelect}
74
- >
70
+ <NsDropdown closeOnMouseLeave selectedLabel={selectedLabel} onSelect={onSelect}>
75
71
  {createDropdownOptions(options)}
76
72
  </NsDropdown>
77
73
  );
@@ -88,14 +84,9 @@ describe('NsDropdown', () => {
88
84
  expect(screen.queryByTestId('option-Option 3')).not.toBeInTheDocument();
89
85
  });
90
86
  });
91
- it('dropdown does not close on mouse leave when closeOnMouseLeave is set to false', () => {
87
+ it('5. Should not close dropdown on mouse leave when closeOnMouseLeave is set to false', () => {
92
88
  render(
93
- <NsDropdown
94
- selectedValue={selectedValue}
95
- selectedLabel={selectedLabel}
96
- onSelect={onSelect}
97
- closeOnMouseLeave={false}
98
- >
89
+ <NsDropdown selectedLabel={selectedLabel} onSelect={onSelect} closeOnMouseLeave={false}>
99
90
  {createDropdownOptions(options)}
100
91
  </NsDropdown>
101
92
  );
@@ -110,9 +101,9 @@ describe('NsDropdown', () => {
110
101
  expect(screen.getByTestId('option-Option 2')).toBeInTheDocument();
111
102
  expect(screen.getByTestId('option-Option 3')).toBeInTheDocument();
112
103
  });
113
- it('dropdown does not open when disabled', () => {
104
+ it('6. Should not open dropdown when disabled is set to true', () => {
114
105
  render(
115
- <NsDropdown selectedValue={selectedValue} selectedLabel={selectedLabel} onSelect={onSelect} disabled>
106
+ <NsDropdown selectedLabel={selectedLabel} onSelect={onSelect} disabled>
116
107
  {createDropdownOptions(options)}
117
108
  </NsDropdown>
118
109
  );
@@ -122,4 +113,14 @@ describe('NsDropdown', () => {
122
113
 
123
114
  expect(screen.queryByTestId('dropdown-list')).not.toBeInTheDocument();
124
115
  });
116
+ it('7. Should apply no border style when type is not outlined', () => {
117
+ render(
118
+ <NsDropdown selectedLabel={selectedLabel} onSelect={onSelect} type="unfilled">
119
+ {createDropdownOptions(options)}
120
+ </NsDropdown>
121
+ );
122
+
123
+ const dropdownHead = screen.getByTestId('dropdown-head');
124
+ expect(dropdownHead).toHaveStyle('border: none');
125
+ });
125
126
  });
@@ -6,6 +6,7 @@ export const DropdownContainer = styled.div<{ disabled: boolean }>`
6
6
  position: relative;
7
7
  display: inline-block;
8
8
  opacity: ${({ disabled }) => (disabled ? '0.5' : '1')};
9
+ cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
9
10
  `;
10
11
 
11
12
  /** this function also used for SelectHead */
@@ -22,7 +23,7 @@ export const DropdownHead = styled.div<{ type: string; disabled: boolean }>`
22
23
  display: flex;
23
24
  justify-content: space-between;
24
25
  align-items: center;
25
- border: ${getDropdownHeadBorder}
26
+ border: ${getDropdownHeadBorder};
26
27
  color: ${paletteColor('primary')};
27
28
  `;
28
29
 
@@ -37,39 +38,29 @@ export const DropdownList = styled.div<{ borderColor: FoundationTheme.PaletteCol
37
38
  position: absolute;
38
39
  z-index: 100;
39
40
  border: 1px solid ${({ borderColor, theme }) => paletteColor(borderColor)({ theme })};
40
- padding: 0;
41
- margin: 0;
41
+ margin-top: 10px;
42
42
  width: 100%;
43
43
  color: ${paletteColor('primary', 'main')};
44
44
  background-color: ${paletteColor('primary', 'contrastText')};
45
45
  `;
46
46
 
47
- const getDividerColor = (theme: FoundationTheme.Theme) => {
48
- return color('neutral', isDarkMode({ theme }) ? '20' : '30')({ theme });
49
- };
50
47
  const getListBgColor = (theme: FoundationTheme.Theme) => {
51
48
  return color('accentColorB', isDarkMode({ theme }) ? '50' : '10')({ theme });
52
49
  };
53
- export const ListItemContainer = styled.div<{ showListDivider: boolean }>`
54
- cursor: pointer;
55
- padding: 5px 0;
56
- border-bottom: 1px solid ${({ showListDivider, theme }) => (showListDivider ? getDividerColor(theme) : 'none')};
57
-
58
- &:hover {
59
- background-color: ${({ theme }) => getListBgColor(theme)};
60
- }
61
50
 
51
+ export const DropdownOptionContainer = styled.div`
52
+ cursor: pointer;
62
53
  &:last-child {
63
54
  border-bottom: none;
64
55
  }
65
56
  `;
66
57
 
67
- const getBorder = ({ isSelected, theme }: { isSelected: boolean } & Themed) => {
68
- const borderColor = paletteColor('primary')({ theme });
69
- return isSelected ? `2px solid ${borderColor}` : 'none';
70
- };
71
-
72
- export const ListItem = styled.span<{ isSelected: boolean }>`
73
- padding: 5px 10px;
74
- border-left: ${getBorder};
58
+ export const ListItem = styled.div`
59
+ &:hover {
60
+ background-color: ${({ theme }) => getListBgColor(theme)};
61
+ }
62
+ &:active {
63
+ background-color: #7de3e8;
64
+ }
65
+ padding: 10px;
75
66
  `;
@@ -1,24 +1,28 @@
1
1
  import React, { useCallback, useRef, useState } from 'react';
2
2
 
3
- import { DropdownContainer, DropdownButton, DropdownList, DropdownHead } from './NsDropdown.styled';
3
+ import {
4
+ DropdownContainer,
5
+ DropdownButton,
6
+ DropdownList,
7
+ DropdownHead,
8
+ DropdownOptionContainer,
9
+ } from './NsDropdown.styled';
4
10
  import { NsIcon } from '../icon';
5
11
  import { DropdownProps } from './types.d';
6
12
  import { useOnClickOutside } from '../hooks/useOnClickOutside';
7
13
 
8
14
  const NsDropdown: React.FC<DropdownProps> = ({
9
- selectedValue,
10
15
  selectedLabel,
11
16
  onSelect,
12
17
  children,
13
18
  disabled = false,
14
19
  type = 'outlined',
15
- placeholder = 'Select',
16
20
  dropdownBorderColor = 'accentColorB',
17
21
  closeOnMouseLeave = false,
18
- showListDivider = true,
22
+ className,
23
+ placeholder,
19
24
  }) => {
20
25
  const [isOpen, setIsOpen] = useState(false);
21
- const [value, setValue] = useState(selectedValue || '');
22
26
  const dropdownRef = useRef<HTMLDivElement | null>(null);
23
27
 
24
28
  const handleToggle = useCallback(() => {
@@ -41,31 +45,45 @@ const NsDropdown: React.FC<DropdownProps> = ({
41
45
  const handleSelect = (input: string) => {
42
46
  onSelect(input);
43
47
  setIsOpen(false);
44
- setValue(input);
45
48
  };
46
49
 
47
50
  return (
48
- <DropdownContainer disabled={disabled} ref={dropdownRef}>
49
- <DropdownHead data-testid="dropdown-head" disabled={disabled} type={type} onClick={handleToggle}>
51
+ <DropdownContainer disabled={disabled} ref={dropdownRef} className={className}>
52
+ <DropdownHead
53
+ data-testid="dropdown-head"
54
+ id="dropdown-head"
55
+ disabled={disabled}
56
+ type={type}
57
+ onClick={handleToggle}
58
+ >
50
59
  <DropdownButton>{selectedLabel || placeholder}</DropdownButton>
51
- <NsIcon testId="chevron-icon" name="arrowDown" color="primary" />
60
+ <NsIcon
61
+ testId="chevron-icon"
62
+ id="chevron-icon"
63
+ name="arrowDown"
64
+ color="primary"
65
+ cursor={disabled ? 'not-allowed' : 'pointer'}
66
+ />
52
67
  </DropdownHead>
53
68
  {isOpen ? (
54
69
  <DropdownList
55
70
  data-testid="dropdown-list"
71
+ id="dropdown-list"
56
72
  onMouseLeave={handleOnMouseLeave}
57
73
  borderColor={dropdownBorderColor}
58
74
  >
59
- {React.Children.map(children, (child) => {
60
- if (React.isValidElement(child)) {
61
- return React.cloneElement(child, {
62
- // @ts-ignore
63
- onSelect: handleSelect,
64
- selectedValue: value,
65
- showListDivider,
66
- });
67
- }
68
- return null;
75
+ {children.map((child, key) => {
76
+ const value = React.isValidElement(child) ? child.props.value : child;
77
+ return (
78
+ <DropdownOptionContainer
79
+ data-testid={`dropdown-option-container-${key}`}
80
+ className="dropdown-option-container"
81
+ key={key}
82
+ onClick={() => handleSelect(value)}
83
+ >
84
+ {child}
85
+ </DropdownOptionContainer>
86
+ );
69
87
  })}
70
88
  </DropdownList>
71
89
  ) : null}
@@ -1,24 +1,12 @@
1
1
  import React from 'react';
2
- import { ListItem, ListItemContainer } from './NsDropdown.styled';
3
2
  import { DropdownOptionProps } from './types.d';
3
+ import { ListItem } from './NsDropdown.styled';
4
4
 
5
- export const NsDropdownOption: React.FC<DropdownOptionProps> = ({
6
- value,
7
- label,
8
- onSelect,
9
- selectedValue,
10
- showListDivider = true,
11
- }) => {
12
- const handleClick = () => {
13
- if (onSelect && typeof onSelect === 'function') {
14
- onSelect(value);
15
- }
16
- };
17
-
5
+ export const NsDropdownOption: React.FC<DropdownOptionProps> = ({ value, children }) => {
18
6
  return (
19
- <ListItemContainer data-testid={`option-${value}`} showListDivider={showListDivider} onClick={handleClick}>
20
- <ListItem isSelected={value === selectedValue}>{label}</ListItem>
21
- </ListItemContainer>
7
+ <ListItem data-testid={`option-${value}`} id="dropdown-item">
8
+ {children}
9
+ </ListItem>
22
10
  );
23
11
  };
24
12
  export default NsDropdownOption;
@@ -20,7 +20,6 @@ export default {
20
20
  },
21
21
  placeholder: { control: 'text' },
22
22
  closeOnMouseLeave: { control: 'boolean' },
23
- showListDivider: { control: 'boolean' },
24
23
  },
25
24
  parameters: {
26
25
  options: [
@@ -34,19 +33,16 @@ export default {
34
33
  disabled: false,
35
34
  dropdownBorderColor: 'primary',
36
35
  closeOnMouseLeave: false,
37
- showListDivider: true,
38
- selectedValue: '',
39
36
  selectedLabel: '',
37
+ placeholder: 'options',
40
38
  },
41
39
  } as MetaStory;
42
40
 
43
41
  const RenderStory = (args: any, context: any) => {
44
42
  const [selectedLabel, setSelectedLabel] = useState(args.selectedLabel);
45
- const [selectedValue, setSelectedValue] = useState(args.selectedValue);
46
43
 
47
44
  const options = context.parameters.options;
48
45
  const handleSelect = (value: string) => {
49
- setSelectedValue(value);
50
46
  options.find((option: any) => {
51
47
  if (option.value === value) {
52
48
  setSelectedLabel(option.label);
@@ -55,9 +51,11 @@ const RenderStory = (args: any, context: any) => {
55
51
  };
56
52
 
57
53
  return (
58
- <NsDropdown {...args} selectedValue={selectedValue} selectedLabel={selectedLabel} onSelect={handleSelect}>
54
+ <NsDropdown {...args} selectedLabel={selectedLabel} onSelect={handleSelect}>
59
55
  {options.map((option: any) => (
60
- <NsDropdownOption key={option.value} value={option.value} label={option.label} />
56
+ <NsDropdownOption key={option.value} value={option.value}>
57
+ {option.label}
58
+ </NsDropdownOption>
61
59
  ))}
62
60
  </NsDropdown>
63
61
  );
@@ -20,7 +20,6 @@ export default {
20
20
  },
21
21
  placeholder: { control: 'text' },
22
22
  closeOnMouseLeave: { control: 'boolean' },
23
- showListDivider: { control: 'boolean' },
24
23
  },
25
24
  parameters: {
26
25
  options: [
@@ -30,23 +29,19 @@ export default {
30
29
  ],
31
30
  },
32
31
  args: {
33
- selectedValue: 'english',
34
32
  selectedLabel: 'United States (US) | English',
35
33
  type: 'unfilled',
36
34
  disabled: false,
37
35
  dropdownBorderColor: 'accentColorB',
38
36
  closeOnMouseLeave: true,
39
- showListDivider: true,
40
37
  },
41
38
  } as MetaStory;
42
39
 
43
40
  const RenderStory = (args: any, context: any) => {
44
41
  const [selectedLabel, setSelectedLabel] = useState(args.selectedLabel);
45
- const [selectedValue, setSelectedValue] = useState(args.selectedValue);
46
42
 
47
43
  const options = context.parameters.options;
48
44
  const handleSelect = (value: string) => {
49
- setSelectedValue(value);
50
45
  options.find((option: any) => {
51
46
  if (option.value === value) {
52
47
  setSelectedLabel(`${option.country} | ${option.label}`);
@@ -55,9 +50,11 @@ const RenderStory = (args: any, context: any) => {
55
50
  };
56
51
 
57
52
  return (
58
- <NsDropdown {...args} selectedValue={selectedValue} selectedLabel={selectedLabel} onSelect={handleSelect}>
53
+ <NsDropdown {...args} selectedLabel={selectedLabel} onSelect={handleSelect}>
59
54
  {options.map((option: any) => (
60
- <NsDropdownOption key={option.value} value={option.value} label={option.label} />
55
+ <NsDropdownOption key={option.value} value={option.value}>
56
+ {option.label}
57
+ </NsDropdownOption>
61
58
  ))}
62
59
  </NsDropdown>
63
60
  );
@@ -4,22 +4,20 @@ import { FoundationTheme } from '@nuskin/foundation-theme';
4
4
  import { AdditionalProps } from '../common.types';
5
5
 
6
6
  export interface DropdownProps extends AdditionalProps {
7
- selectedValue: string;
8
- selectedLabel: string;
9
- onSelect: (arg: string) => void; // eslint-disable-line
10
- children: ReactNode;
7
+ selectedLabel: ReactNode;
8
+ onSelect: (arg: ReactNode) => void; // eslint-disable-line
9
+ children: ReactNode[];
11
10
  disabled?: boolean;
12
11
  type?: 'outlined' | 'unfilled';
13
12
  placeholder?: string;
14
13
  dropdownBorderColor?: FoundationTheme.PaletteColors;
15
14
  closeOnMouseLeave?: boolean;
16
15
  showListDivider?: boolean;
16
+ className?: string;
17
+ placeholder?: string;
17
18
  }
18
19
 
19
20
  export interface DropdownOptionProps {
20
21
  value: string;
21
- label: string;
22
- selectedValue?: string;
23
- onSelect?: (arg: string) => void; // eslint-disable-line
24
- showListDivider?: boolean;
22
+ children: ReactNode;
25
23
  }
@@ -33,7 +33,7 @@ const NsTextStrip = (props: NsTextStripProps) => {
33
33
 
34
34
  return (
35
35
  <StyledHeader className={`${className} items-${alignment}`}>
36
- <NsTypography variant="title-l">
36
+ <NsTypography variant="title-m" className="tracking-normal">
37
37
  {text}
38
38
  </NsTypography>
39
39
  <NsTypography variant="body-xs">
@@ -170,7 +170,7 @@ const getVariantStyle = (
170
170
 
171
171
  export const StyledTypography = styled('div')<NsTypographyProps>(
172
172
  ({ theme, weight, variant, noSpacing, decoration, color, colorOverride }) => {
173
- const fontStyles: TypographyConfig = getVariantStyle(theme.fonts.typographyVariants, variant) || {};
173
+ const fontStyles: TypographyConfig = getVariantStyle(theme?.fonts?.typographyVariants, variant) || {};
174
174
  if (noSpacing) {
175
175
  fontStyles.paragraphSpacing = 0;
176
176
  }