@nuskin/foundation-ui-components 1.8.0 → 1.8.1-738-v2.2

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.8.0",
3
+ "version": "1.8.1-738-v2.2",
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": {
@@ -1,5 +1,6 @@
1
- import React, { FC, useMemo } from 'react';
2
- import { NsAccordionItem, useAccordionMap, NsAccordionProps, AccordionItem } from '..';
1
+ import React, { useMemo } from 'react';
2
+
3
+ import { AccordionItem, NsAccordionItem, NsAccordionProps, useAccordionMap } from '..';
3
4
  import { StyledAccordionWrapper } from './ToggleSection.styled';
4
5
 
5
6
  /**
@@ -13,7 +14,7 @@ import { StyledAccordionWrapper } from './ToggleSection.styled';
13
14
  * is false then only first item of default open is made open
14
15
  */
15
16
  const createKey = (item: AccordionItem, index: number) => item?.id + index;
16
- const NsAccordion: FC<NsAccordionProps> = ({
17
+ const NsAccordion = ({
17
18
  allowMultipleExpanded,
18
19
  invert,
19
20
  level,
@@ -24,7 +25,7 @@ const NsAccordion: FC<NsAccordionProps> = ({
24
25
  openedIconName,
25
26
  additionalProps,
26
27
  isChild = false,
27
- }) => {
28
+ }: NsAccordionProps) => {
28
29
  const defaultOpenIds = useMemo(() => {
29
30
  return items
30
31
  ?.map?.((content, index) => (content?.isDefaultOpen ? createKey(content, index) : null))
@@ -6,6 +6,7 @@ import { renderGroupBy, renderGroupName, renderOptionLabel } from './helper/rend
6
6
  import { SeeMoreButton } from './helper/SeeMoreButton';
7
7
  import { StyledTextField } from './NsAutocomplete.styled';
8
8
  import { ComponentBoxProps, NsAutocompleteProps, OptionsProps } from './types.d';
9
+
9
10
  const noop = () => {};
10
11
  const NsAutocomplete = ({
11
12
  id = 'custom_autocomplete_dropdown',
@@ -93,9 +94,9 @@ const NsAutocomplete = ({
93
94
  noOptionsText={noOptionsText}
94
95
  groupBy={renderGroupBy}
95
96
  getOptionLabel={renderOptionLabel}
96
- renderOption={renderOption}
97
+ renderOption={renderOption as any}
97
98
  renderInput={renderInput}
98
- ListboxComponent={renderListBoxComponent}
99
+ ListboxComponent={renderListBoxComponent as any}
99
100
  renderGroup={renderGroupName}
100
101
  onChange={onChange}
101
102
  onInputChange={onInputChange}
@@ -69,7 +69,7 @@ const NsInputField = (props: NsInputFieldProps) => {
69
69
  disabled={disabled}
70
70
  error={fieldState === 'error' && !disabled}
71
71
  >
72
- {label}
72
+ {label as any}
73
73
  </NsLabel>
74
74
  ) : null}
75
75
  <InputWrapper fieldState={fieldState} data-testid={additionalProps?.testid ?? 'ns-input-field'}>