@useloops/design-system 1.4.148 → 1.4.150
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/esm/index.js +2 -2
- package/dist/index.d.ts +63 -70
- package/dist/index.js +2 -2
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import react, { ReactElement, FunctionComponent, ChangeEvent, PropsWithChildren, ReactNode, FC, Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import * as _mui_material from '@mui/material';
|
|
3
|
-
import { AvatarGroupProps as AvatarGroupProps$1, SxProps, ButtonProps as ButtonProps$1, CheckboxProps as CheckboxProps$1, ContainerProps, MenuProps, MenuItemProps, FormControlLabelProps as FormControlLabelProps$1, Theme, Breakpoint, IconButtonProps as IconButtonProps$1, TooltipProps as TooltipProps$1, ButtonGroupProps,
|
|
3
|
+
import { AvatarGroupProps as AvatarGroupProps$1, SxProps, ButtonProps as ButtonProps$1, CheckboxProps as CheckboxProps$1, ContainerProps, MenuProps, MenuItemProps, FormControlLabelProps as FormControlLabelProps$1, Theme, Breakpoint, IconButtonProps as IconButtonProps$1, TooltipProps as TooltipProps$1, ButtonGroupProps, TextFieldProps as TextFieldProps$1, LinkProps as LinkProps$1, SelectProps as SelectProps$1, SelectChangeEvent, PaperProps, SwitchProps as SwitchProps$1, TypographyProps as TypographyProps$1, PaletteMode, Direction } from '@mui/material';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
-
import { Theme as Theme$1 } from '@mui/material/styles';
|
|
6
|
-
import { NumericFormatProps } from 'react-number-format';
|
|
7
5
|
import * as _emotion_styled from '@emotion/styled';
|
|
8
6
|
import * as _mui_system from '@mui/system';
|
|
7
|
+
import { Theme as Theme$1 } from '@mui/material/styles';
|
|
8
|
+
import { MuiMarkdownProps } from 'mui-markdown';
|
|
9
|
+
import { NumericFormatProps } from 'react-number-format';
|
|
9
10
|
import { UniqueIdentifier } from '@dnd-kit/core';
|
|
10
11
|
import { SubmitHandler } from 'react-hook-form';
|
|
12
|
+
import { TextFieldProps as TextFieldProps$2, NumberFieldProps as NumberFieldProps$1, TextareaProps as TextareaProps$1, SelectProps as SelectProps$2, CheckboxProps as CheckboxProps$2, CheckboxGroupProps as CheckboxGroupProps$1, SwitchProps as SwitchProps$2, SliderProps as SliderProps$1, DifferentialProps as DifferentialProps$1, LikertProps as LikertProps$1, RadioGroupProps as RadioGroupProps$1, RankProps as RankProps$1, RichTextFieldProps as RichTextFieldProps$1, StarRatingProps as StarRatingProps$1, HtmlProps as HtmlProps$1, CustomFieldProps as CustomFieldProps$1, InputLabelProps as InputLabelProps$1, InputLabelHelpProps as InputLabelHelpProps$1 } from 'WebCore';
|
|
11
13
|
|
|
12
14
|
interface ColorRange {
|
|
13
15
|
0: string;
|
|
@@ -325,6 +327,7 @@ interface FormControlLabelProps {
|
|
|
325
327
|
checked?: boolean;
|
|
326
328
|
disabled?: boolean;
|
|
327
329
|
label?: string | ReactElement;
|
|
330
|
+
labelPlacement?: FormControlLabelProps$1['labelPlacement'];
|
|
328
331
|
sx?: SxProps<Theme>;
|
|
329
332
|
onChange?: FormControlLabelProps$1['onChange'];
|
|
330
333
|
value?: unknown;
|
|
@@ -402,6 +405,11 @@ interface IconButtonGroupProps extends PropsWithChildren {
|
|
|
402
405
|
}
|
|
403
406
|
declare const IconButtonGroup: FunctionComponent<IconButtonGroupProps>;
|
|
404
407
|
|
|
408
|
+
type InputFieldBaseProps = TextFieldProps$1;
|
|
409
|
+
declare const InputFieldBase: _emotion_styled.StyledComponent<{
|
|
410
|
+
variant?: _mui_material.TextFieldVariants | undefined;
|
|
411
|
+
} & Omit<_mui_material.FilledTextFieldProps | _mui_material.OutlinedTextFieldProps | _mui_material.StandardTextFieldProps, "variant"> & (_mui_system.MUIStyledCommonProps<_mui_material.Theme> & InputFieldBaseProps), {}, {}>;
|
|
412
|
+
|
|
405
413
|
type InputVariation = 'default' | 'help';
|
|
406
414
|
|
|
407
415
|
interface InputLabelProps {
|
|
@@ -465,6 +473,8 @@ declare const Loader: FunctionComponent<LoaderProps>;
|
|
|
465
473
|
|
|
466
474
|
declare const Logo: FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
467
475
|
|
|
476
|
+
declare const Markdown: (props: MuiMarkdownProps) => react_jsx_runtime.JSX.Element;
|
|
477
|
+
|
|
468
478
|
interface NavButtonProps {
|
|
469
479
|
active?: boolean;
|
|
470
480
|
href?: string;
|
|
@@ -484,11 +494,6 @@ interface NudgeProps extends PropsWithChildren {
|
|
|
484
494
|
}
|
|
485
495
|
declare const Nudge: FunctionComponent<NudgeProps>;
|
|
486
496
|
|
|
487
|
-
type InputFieldBaseProps = TextFieldProps$1;
|
|
488
|
-
declare const InputFieldBase: _emotion_styled.StyledComponent<{
|
|
489
|
-
variant?: _mui_material.TextFieldVariants | undefined;
|
|
490
|
-
} & Omit<_mui_material.FilledTextFieldProps | _mui_material.OutlinedTextFieldProps | _mui_material.StandardTextFieldProps, "variant"> & (_mui_system.MUIStyledCommonProps<_mui_material.Theme> & InputFieldBaseProps), {}, {}>;
|
|
491
|
-
|
|
492
497
|
type NumberFieldProps = InputFieldBaseProps & {
|
|
493
498
|
hideActionButtons?: boolean;
|
|
494
499
|
max?: number;
|
|
@@ -638,7 +643,8 @@ interface RankProps extends Omit<SortableListProps<any>, 'renderItem' | 'items'>
|
|
|
638
643
|
}
|
|
639
644
|
declare const Rank: FunctionComponent<RankProps>;
|
|
640
645
|
|
|
641
|
-
type RichTextFieldProps = Omit<InputFieldBaseProps, 'value'> & {
|
|
646
|
+
type RichTextFieldProps = Omit<InputFieldBaseProps, 'value' | 'onChange'> & {
|
|
647
|
+
onChange?: (content: string) => void;
|
|
642
648
|
internalChange?: () => void;
|
|
643
649
|
minHeight?: number;
|
|
644
650
|
minWidth?: number;
|
|
@@ -687,9 +693,18 @@ interface SurfaceProps extends PropsWithChildren {
|
|
|
687
693
|
}
|
|
688
694
|
declare const Surface: FC<SurfaceProps>;
|
|
689
695
|
|
|
690
|
-
interface
|
|
696
|
+
interface StyledSwitchProps extends SwitchProps$1 {
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
interface SwitchProps extends StyledSwitchProps {
|
|
700
|
+
value?: boolean;
|
|
701
|
+
label?: string | ReactElement;
|
|
702
|
+
labelPlacement?: Exclude<FormControlLabelProps['labelPlacement'], 'top' | 'bottom'>;
|
|
703
|
+
fullWidth?: boolean;
|
|
704
|
+
onChange?: (event: React.SyntheticEvent<Element, Event>, checked: boolean) => void;
|
|
705
|
+
internalChange?: () => void;
|
|
691
706
|
}
|
|
692
|
-
declare const Switch:
|
|
707
|
+
declare const Switch: FunctionComponent<SwitchProps>;
|
|
693
708
|
|
|
694
709
|
type TextareaProps = InputFieldBaseProps & {
|
|
695
710
|
startAdornment?: ReactElement;
|
|
@@ -752,6 +767,9 @@ interface BackgroundOptions {
|
|
|
752
767
|
}
|
|
753
768
|
declare const backgroundCreator: (theme: Theme, options: BackgroundOptions) => string;
|
|
754
769
|
|
|
770
|
+
/**
|
|
771
|
+
* Form Generator Core Types
|
|
772
|
+
*/
|
|
755
773
|
interface FormGeneratorHandler {
|
|
756
774
|
set: () => void;
|
|
757
775
|
reset: () => void;
|
|
@@ -762,12 +780,12 @@ interface FormGeneratorHandler {
|
|
|
762
780
|
triggerFormValidation: () => Promise<unknown>;
|
|
763
781
|
}
|
|
764
782
|
type FormGeneratorProps = FunctionComponent<{
|
|
783
|
+
ref?: any;
|
|
765
784
|
formConfig: FormGeneratorConfig;
|
|
766
785
|
onFormSubmit?: SubmitHandler<any>;
|
|
767
786
|
onFormChange?: (formData: any) => void;
|
|
768
787
|
submitButton?: ReactElement;
|
|
769
788
|
secondaryButton?: ReactElement;
|
|
770
|
-
ref?: any;
|
|
771
789
|
}>;
|
|
772
790
|
interface FormGeneratorConfig {
|
|
773
791
|
fields: FieldTypes[];
|
|
@@ -781,78 +799,47 @@ interface FormGeneratorConfig {
|
|
|
781
799
|
sxStack?: SxProps<Theme>;
|
|
782
800
|
};
|
|
783
801
|
}
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
type
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
type TextareaType =
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
type
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
type
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
type
|
|
802
|
-
fieldType: 'checkboxGroup';
|
|
803
|
-
defaultValue?: string[];
|
|
804
|
-
} & BaseField & Omit<CheckboxGroupProps, 'value' | 'onChange' | 'name'>;
|
|
805
|
-
type SliderType = {
|
|
806
|
-
fieldType: 'slider';
|
|
807
|
-
defaultValue?: SliderProps['value'];
|
|
808
|
-
} & BaseField & Omit<SliderProps, 'value' | 'onChange' | 'name'>;
|
|
809
|
-
type DifferentialType = {
|
|
810
|
-
fieldType: 'differential';
|
|
811
|
-
defaultValue?: DifferentialProps['value'];
|
|
812
|
-
} & BaseField & Omit<DifferentialProps, 'value' | 'onChange' | 'name'>;
|
|
813
|
-
type LikertType = {
|
|
814
|
-
fieldType: 'likert';
|
|
815
|
-
defaultValue?: LikertProps['value'];
|
|
816
|
-
} & BaseField & Omit<LikertProps, 'value' | 'onChange' | 'name'>;
|
|
817
|
-
type RadioGroupType = {
|
|
818
|
-
fieldType: 'radioGroup';
|
|
819
|
-
defaultValue?: RadioGroupProps['value'];
|
|
820
|
-
} & BaseField & Omit<RadioGroupProps, 'value' | 'onChange' | 'name'>;
|
|
821
|
-
type DragAndDropRankingType = {
|
|
822
|
-
fieldType: 'ranking';
|
|
823
|
-
defaultValue?: RankProps['value'];
|
|
824
|
-
} & BaseField & Omit<RankProps, 'value' | 'onChange' | 'name'>;
|
|
825
|
-
type RichTextFieldType = {
|
|
826
|
-
fieldType: 'richTextfield';
|
|
827
|
-
defaultValue?: RichTextFieldProps['value'];
|
|
828
|
-
} & BaseField & Omit<RichTextFieldProps, 'value' | 'onChange' | 'name'>;
|
|
829
|
-
type StarRatingType = {
|
|
830
|
-
fieldType: 'starRating';
|
|
831
|
-
defaultValue?: StarRatingProps['value'];
|
|
832
|
-
} & BaseField & Omit<StarRatingProps, 'value' | 'onChange' | 'name'>;
|
|
802
|
+
/**
|
|
803
|
+
* Field Types
|
|
804
|
+
*/
|
|
805
|
+
type FieldTypes = CheckboxType | CheckboxGroupType | SwitchType | TextareaType | SelectType | TextFieldType | SliderType | DifferentialType | RichTextFieldType | LikertType | RadioGroupType | DragAndDropRankingType | NumberFieldType | StarRatingType | HTMLType | CustomFieldType;
|
|
806
|
+
type TextFieldType = CreateFieldType<'textfield', TextFieldProps$2, string>;
|
|
807
|
+
type NumberFieldType = CreateFieldType<'numberfield', NumberFieldProps$1, number>;
|
|
808
|
+
type TextareaType = CreateFieldType<'textarea', TextareaProps$1, string>;
|
|
809
|
+
type SelectType = CreateFieldType<'select', SelectProps$2, SelectProps$2['value']>;
|
|
810
|
+
type CheckboxType = CreateFieldType<'checkbox', CheckboxProps$2, NonNullable<CheckboxProps$2['value']>>;
|
|
811
|
+
type CheckboxGroupType = CreateFieldType<'checkboxGroup', CheckboxGroupProps$1, string[]>;
|
|
812
|
+
type SwitchType = CreateFieldType<'switch', SwitchProps$2, NonNullable<SwitchProps$2['checked']>>;
|
|
813
|
+
type SliderType = CreateFieldType<'slider', SliderProps$1, NonNullable<SliderProps$1['value']>>;
|
|
814
|
+
type DifferentialType = CreateFieldType<'differential', DifferentialProps$1, NonNullable<DifferentialProps$1['value']>>;
|
|
815
|
+
type LikertType = CreateFieldType<'likert', LikertProps$1, LikertProps$1['value']>;
|
|
816
|
+
type RadioGroupType = CreateFieldType<'radioGroup', RadioGroupProps$1, RadioGroupProps$1['value']>;
|
|
817
|
+
type DragAndDropRankingType = CreateFieldType<'ranking', RankProps$1, NonNullable<RankProps$1['value']>>;
|
|
818
|
+
type RichTextFieldType = CreateFieldType<'richTextfield', RichTextFieldProps$1, RichTextFieldProps$1['value']>;
|
|
819
|
+
type StarRatingType = CreateFieldType<'starRating', StarRatingProps$1, NonNullable<StarRatingProps$1['value']>>;
|
|
833
820
|
type HTMLType = {
|
|
834
821
|
fieldType: 'html';
|
|
835
|
-
content: HtmlProps['children'];
|
|
822
|
+
content: HtmlProps$1['children'];
|
|
836
823
|
defaultValue?: never;
|
|
837
824
|
} & BaseField;
|
|
838
825
|
type CustomFieldType = {
|
|
839
826
|
fieldType: 'customfield';
|
|
840
|
-
defaultValue?: CustomFieldProps['value'];
|
|
841
|
-
} & BaseField & CustomFieldProps;
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
827
|
+
defaultValue?: CustomFieldProps$1['value'];
|
|
828
|
+
} & BaseField & CustomFieldProps$1;
|
|
829
|
+
/**
|
|
830
|
+
* Field Type Utilities
|
|
831
|
+
*/
|
|
845
832
|
interface BaseField {
|
|
846
833
|
name: string;
|
|
847
834
|
ref?: any;
|
|
848
835
|
multiline?: boolean;
|
|
849
836
|
content?: ReactElement;
|
|
850
837
|
label?: string;
|
|
851
|
-
labelProps?: InputLabelProps;
|
|
838
|
+
labelProps?: InputLabelProps$1;
|
|
852
839
|
helperText?: string;
|
|
853
840
|
hidden?: boolean;
|
|
854
841
|
type?: string;
|
|
855
|
-
helpTextProps?: InputLabelHelpProps;
|
|
842
|
+
helpTextProps?: InputLabelHelpProps$1;
|
|
856
843
|
validation?: any;
|
|
857
844
|
valueTransformer?: (valueToTransform: string) => string;
|
|
858
845
|
disabled?: boolean;
|
|
@@ -863,6 +850,12 @@ interface BaseField {
|
|
|
863
850
|
sxInputStack?: SxProps<Theme>;
|
|
864
851
|
};
|
|
865
852
|
}
|
|
853
|
+
type CreateFieldType<TFieldType extends string, TProps, TDefaultValue extends any = void> = {
|
|
854
|
+
fieldType: TFieldType;
|
|
855
|
+
} & BaseField & Omit<TProps, 'value' | 'defaultValue' | 'onChange' | 'name'> & (TDefaultValue extends void ? unknown : {
|
|
856
|
+
defaultValue?: TDefaultValue;
|
|
857
|
+
});
|
|
858
|
+
type FieldType = FieldTypes['fieldType'];
|
|
866
859
|
|
|
867
860
|
declare const FormGenerator: FormGeneratorProps;
|
|
868
861
|
|
|
@@ -1301,4 +1294,4 @@ declare module '@mui/system' {
|
|
|
1301
1294
|
}
|
|
1302
1295
|
}
|
|
1303
1296
|
|
|
1304
|
-
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, CustomField, type CustomFieldProps, 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, InputFieldBase, type InputFieldBaseProps, InputLabel, InputLabelHelp, type InputLabelHelpProps, type InputLabelProps, Likert, type LikertProps, Link, type LinkProps, Loader, type LoaderProps, Logo, NavButton, type NavButtonProps, Nudge, type NudgeProps, 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, UserMenu, type UserMenuProps, backgroundCreator, chooseArticle, defaultInputValidation, emailValidation, passwordValidation, useDropdownMenu };
|
|
1297
|
+
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, CustomField, type CustomFieldProps, 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, InputFieldBase, type InputFieldBaseProps, InputLabel, InputLabelHelp, type InputLabelHelpProps, type InputLabelProps, Likert, type LikertProps, Link, type LinkProps, Loader, type LoaderProps, Logo, Markdown, NavButton, type NavButtonProps, Nudge, type NudgeProps, 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, UserMenu, type UserMenuProps, backgroundCreator, chooseArticle, defaultInputValidation, emailValidation, passwordValidation, useDropdownMenu };
|