@useloops/design-system 1.4.95 → 1.4.97

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.ts CHANGED
@@ -244,7 +244,7 @@ interface CheckboxProps {
244
244
  disabled?: boolean;
245
245
  id?: string;
246
246
  required?: boolean;
247
- value?: any;
247
+ value?: boolean;
248
248
  }
249
249
  declare const Checkbox: FunctionComponent<CheckboxProps>;
250
250
 
@@ -334,6 +334,11 @@ interface GridOverlayProps {
334
334
  }
335
335
  declare const GridOverlay: FunctionComponent<GridOverlayProps>;
336
336
 
337
+ interface HtmlProps {
338
+ children: ReactElement;
339
+ }
340
+ declare const Html: FunctionComponent<HtmlProps>;
341
+
337
342
  interface IconProps {
338
343
  name: 'arrow-forward' | 'expand-more' | 'close' | 'play' | 'positive' | 'negative' | 'neutral' | 'info' | 'check-circle' | 'error-outline' | 'lightbulb' | 'warning-amber' | 'access-time' | 'linkedin' | 'medium' | 'menu' | 'unfold-more' | 'navigation-arrow' | 'lock' | 'loopsOfficial' | 'google' | 'linkedin-color' | 'check' | 'dash' | 'gift' | string;
339
344
  size?: number;
@@ -505,11 +510,50 @@ interface RadioGroupProps {
505
510
  other?: RadioGroupOther;
506
511
  onChange: (value: string) => void;
507
512
  internalChange?: () => void;
508
- name?: string | undefined;
513
+ name: string;
509
514
  value: string;
510
515
  }
511
516
  declare const RadioGroup: FunctionComponent<RadioGroupProps>;
512
517
 
518
+ type SelectOption = {
519
+ label: string;
520
+ value: string;
521
+ };
522
+
523
+ type SelectOnChange = (event: SelectChangeEvent<any>, child: React.ReactNode) => void;
524
+ type AutocompleteOnChange = (value: string[]) => void;
525
+ type SelectProps = {
526
+ selections: SelectOption[];
527
+ autoComplete?: boolean;
528
+ autoFocus?: boolean;
529
+ disabled?: boolean;
530
+ disablePortal?: boolean;
531
+ error?: boolean;
532
+ fullWidth?: boolean;
533
+ id?: string;
534
+ inputRef?: SelectProps$1['inputRef'];
535
+ internalChange?: () => void;
536
+ MenuProps?: SelectProps$1['MenuProps'];
537
+ name: string;
538
+ onBlur?: SelectProps$1['onBlur'];
539
+ onChange?: SelectOnChange | AutocompleteOnChange;
540
+ placeholder?: string | undefined;
541
+ readOnly?: boolean;
542
+ ref?: SelectProps$1['ref'];
543
+ required?: boolean;
544
+ selectOptionProps?: MenuItemProps;
545
+ sizing?: 'xs' | 'md' | 'lg';
546
+ sx?: SelectProps$1['sx'];
547
+ value?: SelectProps$1['value'];
548
+ renderListItem?: (label: string) => ReactElement;
549
+ };
550
+ declare const Select: FunctionComponent<SelectProps>;
551
+
552
+ interface Option {
553
+ label: string;
554
+ value: string;
555
+ }
556
+
513
557
  interface Props$1 {
514
558
  id: UniqueIdentifier;
515
559
  top?: JSX.Element;
@@ -534,13 +578,17 @@ declare namespace SortableList {
534
578
  var DragHandle: typeof DragHandle;
535
579
  }
536
580
 
537
- interface RankProps extends Omit<SortableListProps<any>, 'renderItem'> {
581
+ interface RankProps extends Omit<SortableListProps<any>, 'renderItem' | 'items'> {
538
582
  labelTop: string;
539
583
  labelBottom: string;
540
584
  fullWidth?: boolean;
541
- options: any[];
585
+ options: (Option & {
586
+ id: string;
587
+ })[];
542
588
  internalChange?: () => void;
543
- value?: any[];
589
+ value?: (Option & {
590
+ id: string;
591
+ })[];
544
592
  }
545
593
  declare const Rank: FunctionComponent<RankProps>;
546
594
 
@@ -553,40 +601,6 @@ type RichTextFieldProps = Omit<InputFieldBaseProps$1, 'value'> & {
553
601
  };
554
602
  declare const RichTextField: FunctionComponent<RichTextFieldProps>;
555
603
 
556
- type SelectOption = {
557
- label: string;
558
- value: string;
559
- };
560
-
561
- type SelectOnChange = (event: SelectChangeEvent<any>, child: React.ReactNode) => void;
562
- type AutocompleteOnChange = (value: string[]) => void;
563
- type SelectProps = {
564
- selections: SelectOption[];
565
- autoComplete?: boolean;
566
- autoFocus?: boolean;
567
- disabled?: boolean;
568
- disablePortal?: boolean;
569
- error?: boolean;
570
- fullWidth?: boolean;
571
- id?: string;
572
- inputRef?: SelectProps$1['inputRef'];
573
- internalChange?: () => void;
574
- MenuProps?: SelectProps$1['MenuProps'];
575
- name?: string | undefined;
576
- onBlur?: SelectProps$1['onBlur'];
577
- onChange?: SelectOnChange | AutocompleteOnChange;
578
- placeholder?: string | undefined;
579
- readOnly?: boolean;
580
- ref?: SelectProps$1['ref'];
581
- required?: boolean;
582
- selectOptionProps?: MenuItemProps;
583
- sizing?: 'xs' | 'md' | 'lg';
584
- sx?: SelectProps$1['sx'];
585
- value?: SelectProps$1['value'];
586
- renderListItem?: (label: string) => ReactElement;
587
- };
588
- declare const Select: FunctionComponent<SelectProps>;
589
-
590
604
  interface SliderProps {
591
605
  labelLeft: string;
592
606
  labelRight: string;
@@ -596,7 +610,6 @@ interface SliderProps {
596
610
  labelRightProps?: InputLabelHelpProps;
597
611
  labelLeftProps?: InputLabelHelpProps;
598
612
  internalChange?: () => void;
599
- defaultValue?: number;
600
613
  disabled?: boolean;
601
614
  onChange?: (event: Event, value: number | number[], activeThumb: number) => void;
602
615
  step?: number;
@@ -605,12 +618,11 @@ interface SliderProps {
605
618
  declare const Slider: FunctionComponent<SliderProps>;
606
619
 
607
620
  interface StarRatingProps {
608
- defaultValue?: number;
609
621
  disabled?: boolean;
610
622
  readOnly?: boolean;
611
623
  onChange?: (event: React.ChangeEvent<{}>, value: number | null) => void;
612
624
  precision?: number;
613
- name?: string;
625
+ name: string;
614
626
  IconContainerComponent?: any;
615
627
  value?: number | null;
616
628
  internalChange?: () => void;
@@ -709,27 +721,65 @@ interface FormGeneratorConfig {
709
721
  sxStack?: SxProps<Theme>;
710
722
  };
711
723
  }
712
- type TextFieldType = BaseField & TextFieldProps;
713
- type NumberFieldType = BaseField & NumberFieldProps$1;
714
- type SelectType = BaseField & SelectProps;
715
- type CheckboxType = BaseField & CheckboxProps;
716
- type CheckboxGroupType = BaseField & CheckboxGroupProps;
717
- type SliderType = BaseField & SliderProps;
718
- type DifferentialType = BaseField & DifferentialProps;
719
- type LikertType = BaseField & LikertProps;
720
- type RadioGroupType = BaseField & RadioGroupProps;
721
- type DragAndDropRankingType = BaseField & RankProps;
722
- type RichTextFieldType = BaseField & RichTextFieldProps$1;
724
+ type TextFieldType = {
725
+ fieldType: 'textfield';
726
+ } & BaseField & Omit<TextFieldProps, 'value' | 'onChange' | 'name'>;
727
+ type NumberFieldType = {
728
+ fieldType: 'numberfield';
729
+ } & BaseField & Omit<NumberFieldProps$1, 'value' | 'onChange' | 'name'>;
730
+ type SelectType = {
731
+ fieldType: 'select';
732
+ defaultValue?: SelectProps['value'];
733
+ } & BaseField & Omit<SelectProps, 'value' | 'onChange' | 'name'>;
734
+ type CheckboxType = {
735
+ fieldType: 'checkbox';
736
+ defaultValue?: CheckboxProps['value'];
737
+ } & BaseField & Omit<CheckboxProps, 'value' | 'onChange' | 'name'>;
738
+ type CheckboxGroupType = {
739
+ fieldType: 'checkboxGroup';
740
+ defaultValue?: string[];
741
+ } & BaseField & Omit<CheckboxGroupProps, 'value' | 'onChange' | 'name'>;
742
+ type SliderType = {
743
+ fieldType: 'slider';
744
+ defaultValue?: SliderProps['value'];
745
+ } & BaseField & Omit<SliderProps, 'value' | 'onChange' | 'name'>;
746
+ type DifferentialType = {
747
+ fieldType: 'differential';
748
+ defaultValue?: DifferentialProps['value'];
749
+ } & BaseField & Omit<DifferentialProps, 'value' | 'onChange' | 'name'>;
750
+ type LikertType = {
751
+ fieldType: 'likert';
752
+ defaultValue?: LikertProps['value'];
753
+ } & BaseField & Omit<LikertProps, 'value' | 'onChange' | 'name'>;
754
+ type RadioGroupType = {
755
+ fieldType: 'radioGroup';
756
+ defaultValue?: RadioGroupProps['value'];
757
+ } & BaseField & Omit<RadioGroupProps, 'value' | 'onChange' | 'name'>;
758
+ type DragAndDropRankingType = {
759
+ fieldType: 'ranking';
760
+ defaultValue?: RankProps['value'];
761
+ } & BaseField & Omit<RankProps, 'value' | 'onChange' | 'name'>;
762
+ type RichTextFieldType = {
763
+ fieldType: 'richTextfield';
764
+ defaultValue?: RichTextFieldProps$1['value'];
765
+ } & BaseField & Omit<RichTextFieldProps$1, 'value' | 'onChange' | 'name'>;
766
+ type StarRatingType = {
767
+ fieldType: 'starRating';
768
+ defaultValue?: StarRatingProps['value'];
769
+ } & BaseField & Omit<StarRatingProps, 'value' | 'onChange' | 'name'>;
770
+ type HTMLType = {
771
+ fieldType: 'html';
772
+ content: HtmlProps['children'];
773
+ defaultValue?: never;
774
+ } & BaseField;
723
775
  type DynamicFieldType = 'textfield' | 'numberfield' | 'textarea' | 'select' | 'checkbox' | 'checkboxGroup' | 'slider' | 'differential' | 'likert' | 'starRating' | 'radioGroup' | 'ranking' | 'richTextfield';
724
776
  type FieldType = DynamicFieldType | 'html';
725
- type FieldTypes = CheckboxType | CheckboxGroupType | SelectType | TextFieldType | SliderType | DifferentialType | RichTextFieldType | LikertType | RadioGroupType | DragAndDropRankingType | NumberFieldType;
777
+ type FieldTypes = CheckboxType | CheckboxGroupType | SelectType | TextFieldType | SliderType | DifferentialType | RichTextFieldType | LikertType | RadioGroupType | DragAndDropRankingType | NumberFieldType | StarRatingType | HTMLType;
726
778
  interface BaseField {
727
779
  name: string;
728
780
  ref?: any;
729
781
  multiline?: boolean;
730
- fieldType: FieldType;
731
782
  content?: ReactElement;
732
- defaultValue?: string | number | string[] | boolean | undefined;
733
783
  label?: string;
734
784
  labelProps?: InputLabelProps;
735
785
  helperText?: string;
@@ -1184,4 +1234,4 @@ declare module '@mui/system' {
1184
1234
  }
1185
1235
  }
1186
1236
 
1187
- export { AnnualController, type AnnualControllerProps, AuthContainerSurface, type AuthContainerSurfaceProps, AuthFormHeader, type AuthFormHeaderProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Button, type ButtonProps, CheckboxGroup as CheckBoxGroup, Checkbox, type CheckboxGroupProps, type CheckboxProps, ColorBackgroundContainer, type ColorBackgroundContainerProps, DEFAULT_MAX_INPUT_LENGTH, Differential, type DifferentialProps, DropdownMenu, type FieldType, type FieldTypes, FormControlLabel, FormGenerator, type FormGeneratorConfig, type FormGeneratorHandler, GridOverlay, type GridOverlayProps, Icon, IconButton, IconButtonGroup, InputLabel, InputLabelHelp, type InputLabelHelpProps, type InputLabelProps, Likert, type LikertProps, Link, type LinkProps, Loader, type LoaderProps, Logo, NumberField, type NumberFieldProps, Pill, type PillProps, PlanFeatureTable, type PlanFeatureTableProps, PlanTierCard, type PlanTierCardProps, PlanTierCardScale, type PlanTierCardScaleProps, Portal, type PortalProps, PoweredByWatermarkLogo, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Rank, type RankProps, RichTextField, type RichTextFieldProps, Select, type SelectProps, Slider, type SliderProps, SortableList, type SortableListProps, StarRating, type StarRatingProps, Surface, type SurfaceProps, Switch, type SwitchProps, Textarea as TextArea, TextBarDivider, type TextBarDividerProps, TextField, type TextFieldProps, type TextareaProps, ThemeProvider, TickGroup, type TickGroupProps, Toast, type ToastProps, Tooltip, type TooltipProps, Typography, type TypographyProps, backgroundCreator, chooseArticle, defaultInputValidation, emailValidation, passwordValidation, useDropdownMenu };
1237
+ export { AnnualController, type AnnualControllerProps, AuthContainerSurface, type AuthContainerSurfaceProps, AuthFormHeader, type AuthFormHeaderProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Button, type ButtonProps, CheckboxGroup as CheckBoxGroup, Checkbox, type CheckboxGroupProps, type CheckboxProps, ColorBackgroundContainer, type ColorBackgroundContainerProps, DEFAULT_MAX_INPUT_LENGTH, Differential, type DifferentialProps, DropdownMenu, type FieldType, type FieldTypes, FormControlLabel, FormGenerator, type FormGeneratorConfig, type FormGeneratorHandler, GridOverlay, type GridOverlayProps, Html, type HtmlProps, Icon, IconButton, IconButtonGroup, InputLabel, InputLabelHelp, type InputLabelHelpProps, type InputLabelProps, Likert, type LikertProps, Link, type LinkProps, Loader, type LoaderProps, Logo, NumberField, type NumberFieldProps, Pill, type PillProps, PlanFeatureTable, type PlanFeatureTableProps, PlanTierCard, type PlanTierCardProps, PlanTierCardScale, type PlanTierCardScaleProps, Portal, type PortalProps, PoweredByWatermarkLogo, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Rank, type RankProps, RichTextField, type RichTextFieldProps, Select, type SelectProps, Slider, type SliderProps, SortableList, type SortableListProps, StarRating, type StarRatingProps, Surface, type SurfaceProps, Switch, type SwitchProps, Textarea as TextArea, TextBarDivider, type TextBarDividerProps, TextField, type TextFieldProps, type TextareaProps, ThemeProvider, TickGroup, type TickGroupProps, Toast, type ToastProps, Tooltip, type TooltipProps, Typography, type TypographyProps, backgroundCreator, chooseArticle, defaultInputValidation, emailValidation, passwordValidation, useDropdownMenu };