@nuskin/foundation-ui-components 3.0.0 → 4.0.0-cx130-2401.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.
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as react from 'react';
2
- import react__default, { ReactElement, HTMLProps, PropsWithChildren, ReactNode, SyntheticEvent, HTMLAttributes } from 'react';
2
+ import react__default, { ReactElement, HTMLProps, PropsWithChildren, ReactNode, MouseEventHandler, HTMLAttributes, SyntheticEvent } from 'react';
3
3
  import { FoundationTheme } from '@nuskin/foundation-theme';
4
4
  import * as _mui_material from '@mui/material';
5
- import { SvgIconProps as SvgIconProps$1, AutocompleteChangeReason, AutocompleteChangeDetails, ComponentsProps, ButtonProps, TextFieldProps, InputLabelProps, RadioGroupProps } from '@mui/material';
5
+ import { SvgIconProps as SvgIconProps$1, ComponentsProps, AutocompleteChangeReason, AutocompleteChangeDetails, ButtonProps, TextFieldProps, InputLabelProps, RadioGroupProps } from '@mui/material';
6
6
  import { SvgIconProps } from '@mui/material/SvgIcon';
7
7
  import * as _emotion_styled from '@emotion/styled';
8
8
  import * as _emotion_react from '@emotion/react';
@@ -10,6 +10,7 @@ import * as _mui_material_OverridableComponent from '@mui/material/OverridableCo
10
10
  import * as _mui_material_Card from '@mui/material/Card';
11
11
  import * as _mui_material_CardMedia from '@mui/material/CardMedia';
12
12
  import * as react_jsx_runtime from 'react/jsx-runtime';
13
+ import { Settings } from 'react-slick';
13
14
  import { CheckboxProps } from '@material-ui/core/Checkbox';
14
15
  import { React as React$1 } from 'React';
15
16
  import * as notistack from 'notistack';
@@ -259,7 +260,7 @@ type CommonAccordionType = {
259
260
  type NsAccordionHeaderProps = AdditionalProps & {
260
261
  title: string | ReactNode;
261
262
  // eslint-disable-next-line no-unused-vars
262
- onClick: (...args: any[]) => void;
263
+ onClick: MouseEventHandler<HTMLElement>;
263
264
  /** a flag for the header, based on which header can change properties */
264
265
  isOpen: boolean;
265
266
  /** NsIcon's icon name to be shown in opened state */
@@ -290,7 +291,7 @@ type NsToggleSectionProps = AdditionalProps & {
290
291
  type NsAccordionItemProps = AdditionalProps & {
291
292
  isOpen: boolean;
292
293
  // eslint-disable-next-line no-unused-vars
293
- toggleOpen(index: number, isOpen: boolean): void;
294
+ toggleOpen: MouseEventHandler<HTMLElement>;
294
295
  title: string | ReactNode;
295
296
  headerTypographyVariant?: Variants;
296
297
  /** NsIcon's icon name to be shown in opened state */
@@ -334,7 +335,7 @@ type NsAutocompleteProps = {
334
335
  id?: string;
335
336
  options: OptionsProps[];
336
337
  loading?: boolean;
337
- OptionsUI: react__default.ComponentType<any>;
338
+ OptionsUI?: react__default.ComponentType<ComponentBoxProps & ListUiProps>;
338
339
  noOptionsText?: string;
339
340
  /*
340
341
  Callback fired when the input value changes.
@@ -681,34 +682,34 @@ type NsAwardCardProps = {
681
682
  };
682
683
  declare function NsAwardCard({ title, awardName, mediaOutlet, backgroundImageDetail, className, fontColor, }: NsAwardCardProps): ReactElement;
683
684
 
684
- type NsCarouselProps<T = any> = {
685
+ type NsCarouselProps<T = unknown> = {
685
686
  entries: T[];
686
687
  // eslint-disable-next-line no-unused-vars
687
688
  renderEntry(entry: T, index: number): ReactNode;
688
689
  allEntryLink?: string;
689
690
  allEntryLabel?: string;
690
- settings: any;
691
+ settings: Settings;
691
692
  showControlButtons?: boolean;
692
693
  ariaLabel?: string;
693
694
  ariaLabelledBy?: string;
694
695
  };
695
696
 
696
- type NsScrollingCarouselProps<T = any> = {
697
- slides: T;
697
+ type NsScrollingCarouselProps<T = unknown> = {
698
+ slides: T[];
698
699
  // eslint-disable-next-line no-unused-vars
699
700
  renderSlide(slide: T, index: number): ReactNode;
700
701
  /* time it takes while scrolling */
701
702
  scrollSeconds: number;
702
703
  /* time for which slide stays still before scrolling */
703
704
  stillSeconds: number;
704
- settings: any;
705
+ settings: Settings;
705
706
  /* value in number, specifying how much the dots should be from bottom of slides container */
706
707
  dotsBottomPixel?: number;
707
708
  } & AdditionalProps;
708
709
 
709
- declare function NsCarousel<T = any>({ entries, renderEntry, allEntryLink, settings, allEntryLabel, showControlButtons, ariaLabel, ariaLabelledBy, }: NsCarouselProps<T>): ReactElement;
710
+ declare function NsCarousel<T = unknown>({ entries, renderEntry, allEntryLink, settings, allEntryLabel, showControlButtons, ariaLabel, ariaLabelledBy, }: NsCarouselProps<T>): ReactElement;
710
711
 
711
- declare const NsScrollingCarousel: ({ slides, scrollSeconds, stillSeconds, renderSlide, settings, dotsBottomPixel, additionalProps, }: NsScrollingCarouselProps) => ReactElement;
712
+ declare const NsScrollingCarousel: <T>({ slides, scrollSeconds, stillSeconds, renderSlide, settings, dotsBottomPixel, additionalProps, }: NsScrollingCarouselProps<T>) => ReactElement;
712
713
 
713
714
  declare const defaultCarouselSettings: {
714
715
  dots: boolean;
@@ -863,7 +864,7 @@ declare const NsGridColumns: ({ columnClass, children, gap, isFullWidth, additio
863
864
 
864
865
  interface DropdownProps extends AdditionalProps {
865
866
  selectedLabel: ReactNode;
866
- onSelect: (arg: ReactNode) => void; // eslint-disable-line
867
+ onSelect: (value: string) => void;
867
868
  children: ReactNode[];
868
869
  disabled?: boolean;
869
870
  type?: 'outlined' | 'unfilled';
@@ -969,7 +970,7 @@ type NsInputFieldProps = Omit<
969
970
  declare const NsInputField: (props: NsInputFieldProps) => ReactElement;
970
971
 
971
972
  type NsLabelProps = PropsWithChildren &
972
- Omit<InputLabelProps, 'sx' | 'classes' | 'color' | 'margin' | 'variant' | 'classes'> & {
973
+ Omit<InputLabelProps, 'sx' | 'classes' | 'color' | 'margin' | 'variant' | 'size'> & {
973
974
  /** purpose of showOptional props is to show additional text 'optional' in the label,
974
975
  * if required = false and this flag is true */
975
976
  showOptional?: boolean;
@@ -1129,7 +1130,7 @@ interface SelectProps {
1129
1130
  rules?: Array;
1130
1131
  hasArrows?: boolean;
1131
1132
  options: LabelValueType[];
1132
- RenderOption?(x: any): any; // eslint-disable-line
1133
+ RenderOption?(props: RenderSelectOptionArgType): ReactNode; // eslint-disable-line
1133
1134
  }
1134
1135
 
1135
1136
  interface SelectOptionProps {
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as react from 'react';
2
- import react__default, { ReactElement, HTMLProps, PropsWithChildren, ReactNode, SyntheticEvent, HTMLAttributes } from 'react';
2
+ import react__default, { ReactElement, HTMLProps, PropsWithChildren, ReactNode, MouseEventHandler, HTMLAttributes, SyntheticEvent } from 'react';
3
3
  import { FoundationTheme } from '@nuskin/foundation-theme';
4
4
  import * as _mui_material from '@mui/material';
5
- import { SvgIconProps as SvgIconProps$1, AutocompleteChangeReason, AutocompleteChangeDetails, ComponentsProps, ButtonProps, TextFieldProps, InputLabelProps, RadioGroupProps } from '@mui/material';
5
+ import { SvgIconProps as SvgIconProps$1, ComponentsProps, AutocompleteChangeReason, AutocompleteChangeDetails, ButtonProps, TextFieldProps, InputLabelProps, RadioGroupProps } from '@mui/material';
6
6
  import { SvgIconProps } from '@mui/material/SvgIcon';
7
7
  import * as _emotion_styled from '@emotion/styled';
8
8
  import * as _emotion_react from '@emotion/react';
@@ -10,6 +10,7 @@ import * as _mui_material_OverridableComponent from '@mui/material/OverridableCo
10
10
  import * as _mui_material_Card from '@mui/material/Card';
11
11
  import * as _mui_material_CardMedia from '@mui/material/CardMedia';
12
12
  import * as react_jsx_runtime from 'react/jsx-runtime';
13
+ import { Settings } from 'react-slick';
13
14
  import { CheckboxProps } from '@material-ui/core/Checkbox';
14
15
  import { React as React$1 } from 'React';
15
16
  import * as notistack from 'notistack';
@@ -259,7 +260,7 @@ type CommonAccordionType = {
259
260
  type NsAccordionHeaderProps = AdditionalProps & {
260
261
  title: string | ReactNode;
261
262
  // eslint-disable-next-line no-unused-vars
262
- onClick: (...args: any[]) => void;
263
+ onClick: MouseEventHandler<HTMLElement>;
263
264
  /** a flag for the header, based on which header can change properties */
264
265
  isOpen: boolean;
265
266
  /** NsIcon's icon name to be shown in opened state */
@@ -290,7 +291,7 @@ type NsToggleSectionProps = AdditionalProps & {
290
291
  type NsAccordionItemProps = AdditionalProps & {
291
292
  isOpen: boolean;
292
293
  // eslint-disable-next-line no-unused-vars
293
- toggleOpen(index: number, isOpen: boolean): void;
294
+ toggleOpen: MouseEventHandler<HTMLElement>;
294
295
  title: string | ReactNode;
295
296
  headerTypographyVariant?: Variants;
296
297
  /** NsIcon's icon name to be shown in opened state */
@@ -334,7 +335,7 @@ type NsAutocompleteProps = {
334
335
  id?: string;
335
336
  options: OptionsProps[];
336
337
  loading?: boolean;
337
- OptionsUI: react__default.ComponentType<any>;
338
+ OptionsUI?: react__default.ComponentType<ComponentBoxProps & ListUiProps>;
338
339
  noOptionsText?: string;
339
340
  /*
340
341
  Callback fired when the input value changes.
@@ -681,34 +682,34 @@ type NsAwardCardProps = {
681
682
  };
682
683
  declare function NsAwardCard({ title, awardName, mediaOutlet, backgroundImageDetail, className, fontColor, }: NsAwardCardProps): ReactElement;
683
684
 
684
- type NsCarouselProps<T = any> = {
685
+ type NsCarouselProps<T = unknown> = {
685
686
  entries: T[];
686
687
  // eslint-disable-next-line no-unused-vars
687
688
  renderEntry(entry: T, index: number): ReactNode;
688
689
  allEntryLink?: string;
689
690
  allEntryLabel?: string;
690
- settings: any;
691
+ settings: Settings;
691
692
  showControlButtons?: boolean;
692
693
  ariaLabel?: string;
693
694
  ariaLabelledBy?: string;
694
695
  };
695
696
 
696
- type NsScrollingCarouselProps<T = any> = {
697
- slides: T;
697
+ type NsScrollingCarouselProps<T = unknown> = {
698
+ slides: T[];
698
699
  // eslint-disable-next-line no-unused-vars
699
700
  renderSlide(slide: T, index: number): ReactNode;
700
701
  /* time it takes while scrolling */
701
702
  scrollSeconds: number;
702
703
  /* time for which slide stays still before scrolling */
703
704
  stillSeconds: number;
704
- settings: any;
705
+ settings: Settings;
705
706
  /* value in number, specifying how much the dots should be from bottom of slides container */
706
707
  dotsBottomPixel?: number;
707
708
  } & AdditionalProps;
708
709
 
709
- declare function NsCarousel<T = any>({ entries, renderEntry, allEntryLink, settings, allEntryLabel, showControlButtons, ariaLabel, ariaLabelledBy, }: NsCarouselProps<T>): ReactElement;
710
+ declare function NsCarousel<T = unknown>({ entries, renderEntry, allEntryLink, settings, allEntryLabel, showControlButtons, ariaLabel, ariaLabelledBy, }: NsCarouselProps<T>): ReactElement;
710
711
 
711
- declare const NsScrollingCarousel: ({ slides, scrollSeconds, stillSeconds, renderSlide, settings, dotsBottomPixel, additionalProps, }: NsScrollingCarouselProps) => ReactElement;
712
+ declare const NsScrollingCarousel: <T>({ slides, scrollSeconds, stillSeconds, renderSlide, settings, dotsBottomPixel, additionalProps, }: NsScrollingCarouselProps<T>) => ReactElement;
712
713
 
713
714
  declare const defaultCarouselSettings: {
714
715
  dots: boolean;
@@ -863,7 +864,7 @@ declare const NsGridColumns: ({ columnClass, children, gap, isFullWidth, additio
863
864
 
864
865
  interface DropdownProps extends AdditionalProps {
865
866
  selectedLabel: ReactNode;
866
- onSelect: (arg: ReactNode) => void; // eslint-disable-line
867
+ onSelect: (value: string) => void;
867
868
  children: ReactNode[];
868
869
  disabled?: boolean;
869
870
  type?: 'outlined' | 'unfilled';
@@ -969,7 +970,7 @@ type NsInputFieldProps = Omit<
969
970
  declare const NsInputField: (props: NsInputFieldProps) => ReactElement;
970
971
 
971
972
  type NsLabelProps = PropsWithChildren &
972
- Omit<InputLabelProps, 'sx' | 'classes' | 'color' | 'margin' | 'variant' | 'classes'> & {
973
+ Omit<InputLabelProps, 'sx' | 'classes' | 'color' | 'margin' | 'variant' | 'size'> & {
973
974
  /** purpose of showOptional props is to show additional text 'optional' in the label,
974
975
  * if required = false and this flag is true */
975
976
  showOptional?: boolean;
@@ -1129,7 +1130,7 @@ interface SelectProps {
1129
1130
  rules?: Array;
1130
1131
  hasArrows?: boolean;
1131
1132
  options: LabelValueType[];
1132
- RenderOption?(x: any): any; // eslint-disable-line
1133
+ RenderOption?(props: RenderSelectOptionArgType): ReactNode; // eslint-disable-line
1133
1134
  }
1134
1135
 
1135
1136
  interface SelectOptionProps {