@zealicsolutions/web-ui 0.2.90 → 0.2.92
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/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/src/atoms/RadioButtons/RadioButtons.d.ts +25 -5
- package/dist/cjs/src/atoms/RadioButtons/RadioButtons.stories.d.ts +9 -1
- package/dist/cjs/src/atoms/RadioButtons/RadioOption.d.ts +9 -0
- package/dist/cjs/src/atoms/RadioButtons/helpers.d.ts +9 -0
- package/dist/cjs/src/atoms/RadioButtons/styles.d.ts +9 -0
- package/dist/cjs/src/containers/MoleculeItem.d.ts +1 -1
- package/dist/cjs/src/containers/helpers.d.ts +1 -1
- package/dist/cjs/src/containers/types/moleculeTypes.d.ts +23 -17
- package/dist/cjs/src/contexts/MlrRichTextViewerContext/types.d.ts +2 -1
- package/dist/cjs/src/molecules/Button/Button.d.ts +2 -3
- package/dist/cjs/src/molecules/FieldLabels/helpers.d.ts +1 -1
- package/dist/cjs/src/molecules/RadioButtonField/RadioButtonField.d.ts +28 -10
- package/dist/cjs/src/molecules/RadioButtonField/RadioButtonField.stories.d.ts +36 -1
- package/dist/cjs/src/molecules/TextMolecule/TextMolecule.d.ts +2 -2
- package/dist/cjs/src/molecules/TextMolecule/TextMolecule.stories.d.ts +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/src/atoms/RadioButtons/RadioButtons.d.ts +25 -5
- package/dist/esm/src/atoms/RadioButtons/RadioButtons.stories.d.ts +9 -1
- package/dist/esm/src/atoms/RadioButtons/RadioOption.d.ts +9 -0
- package/dist/esm/src/atoms/RadioButtons/helpers.d.ts +9 -0
- package/dist/esm/src/atoms/RadioButtons/styles.d.ts +9 -0
- package/dist/esm/src/containers/MoleculeItem.d.ts +1 -1
- package/dist/esm/src/containers/helpers.d.ts +1 -1
- package/dist/esm/src/containers/types/moleculeTypes.d.ts +23 -17
- package/dist/esm/src/contexts/MlrRichTextViewerContext/types.d.ts +2 -1
- package/dist/esm/src/molecules/Button/Button.d.ts +2 -3
- package/dist/esm/src/molecules/FieldLabels/helpers.d.ts +1 -1
- package/dist/esm/src/molecules/RadioButtonField/RadioButtonField.d.ts +28 -10
- package/dist/esm/src/molecules/RadioButtonField/RadioButtonField.stories.d.ts +36 -1
- package/dist/esm/src/molecules/TextMolecule/TextMolecule.d.ts +2 -2
- package/dist/esm/src/molecules/TextMolecule/TextMolecule.stories.d.ts +1 -1
- package/dist/index.d.ts +81 -36
- package/package.json +1 -1
@@ -1,4 +1,15 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
+
import { SizesTypes, ThemeColors } from 'theme';
|
3
|
+
import { StylesType } from 'typescript';
|
4
|
+
export declare type RadioButtonInternalConfigProps = {
|
5
|
+
selectedRadioOptionBackgroundColor: ThemeColors | string;
|
6
|
+
selectedRadioOptionIndicatorColor: ThemeColors | string;
|
7
|
+
buttonPadding: number;
|
8
|
+
textPadding: number;
|
9
|
+
styles: StylesType;
|
10
|
+
wrapperStyles: StylesType;
|
11
|
+
buttonOptionSpacing?: SizesTypes;
|
12
|
+
};
|
2
13
|
export declare type RadioButtonType<T extends string = string> = {
|
3
14
|
id: T;
|
4
15
|
label?: string;
|
@@ -6,12 +17,21 @@ export declare type RadioButtonType<T extends string = string> = {
|
|
6
17
|
disabled?: boolean;
|
7
18
|
isRichText?: boolean;
|
8
19
|
};
|
9
|
-
export declare type RadioButtonsProps<T extends string> = {
|
10
|
-
isEditMode
|
20
|
+
export declare type RadioButtonsProps<T extends string> = Partial<{
|
21
|
+
isEditMode: boolean;
|
11
22
|
onChange: (value: T) => void;
|
12
23
|
value: T;
|
13
|
-
isRow
|
24
|
+
isRow: boolean;
|
14
25
|
items: RadioButtonType<T>[];
|
15
26
|
name: string;
|
16
|
-
|
17
|
-
|
27
|
+
internalConfig: RadioButtonInternalConfigProps;
|
28
|
+
}>;
|
29
|
+
export declare const RadioButtons: <T extends string>({ value, items, isRow, isEditMode, onChange, name, internalConfig, }: Partial<{
|
30
|
+
isEditMode: boolean;
|
31
|
+
onChange: (value: T) => void;
|
32
|
+
value: T;
|
33
|
+
isRow: boolean;
|
34
|
+
items: RadioButtonType<T>[];
|
35
|
+
name: string;
|
36
|
+
internalConfig: RadioButtonInternalConfigProps;
|
37
|
+
}>) => JSX.Element;
|
@@ -3,7 +3,15 @@ import type { ComponentStory } from '@storybook/react';
|
|
3
3
|
import { RadioButtons as RadioButtonsComponent } from './RadioButtons';
|
4
4
|
declare const _default: {
|
5
5
|
title: string;
|
6
|
-
component: <T extends string>({ value, items, isRow, isEditMode, onChange, name, }:
|
6
|
+
component: <T extends string>({ value, items, isRow, isEditMode, onChange, name, internalConfig, }: Partial<{
|
7
|
+
isEditMode: boolean;
|
8
|
+
onChange: (value: T) => void;
|
9
|
+
value: T;
|
10
|
+
isRow: boolean;
|
11
|
+
items: import("./RadioButtons").RadioButtonType<T>[];
|
12
|
+
name: string;
|
13
|
+
internalConfig: import("./RadioButtons").RadioButtonInternalConfigProps;
|
14
|
+
}>) => JSX.Element;
|
7
15
|
};
|
8
16
|
export default _default;
|
9
17
|
export declare const RadioButtons: ComponentStory<typeof RadioButtonsComponent>;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { RadioButtonInternalConfigProps, RadioButtonType } from 'atoms';
|
3
|
+
declare type RadioOptionProps = {
|
4
|
+
item: RadioButtonType;
|
5
|
+
isEditMode?: boolean;
|
6
|
+
internalConfig?: RadioButtonInternalConfigProps;
|
7
|
+
};
|
8
|
+
export declare const RadioOption: ({ item, internalConfig, isEditMode }: RadioOptionProps) => JSX.Element;
|
9
|
+
export {};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { RadioButtonInternalConfigProps, RadioButtonType } from 'atoms';
|
2
|
+
import { StylesType } from 'typescript';
|
3
|
+
declare type RadioOptionStylesConfig = {
|
4
|
+
textStyles: StylesType;
|
5
|
+
radioIconWrapperStyles: StylesType;
|
6
|
+
radioLabelWrapperStyles: StylesType;
|
7
|
+
};
|
8
|
+
export declare const getRadioOptionStyles: (item: RadioButtonType, internalConfig?: RadioButtonInternalConfigProps) => RadioOptionStylesConfig;
|
9
|
+
export {};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { FormControlLabel, Radio } from '@mui/material';
|
2
|
+
import { OverrideStyles } from 'typescript';
|
3
|
+
export declare const RadioLabelWrapper: import("styled-components").StyledComponent<typeof FormControlLabel, import("styled-components").DefaultTheme, {
|
4
|
+
error: boolean;
|
5
|
+
} & OverrideStyles, never>;
|
6
|
+
export declare const RadioIconWrapper: import("styled-components").StyledComponent<typeof Radio, import("styled-components").DefaultTheme, {
|
7
|
+
disabled: boolean;
|
8
|
+
error: boolean;
|
9
|
+
} & OverrideStyles, never>;
|
@@ -3,6 +3,6 @@ import { Molecule } from 'containers';
|
|
3
3
|
import { TabGroupProps } from 'molecules';
|
4
4
|
export declare const getFullLink: (url: string) => string;
|
5
5
|
export declare const navigateToPage: (url: string) => void;
|
6
|
-
export declare const MoleculeItem: ({ type, config, attributes, tabsProps, form, }: Molecule & {
|
6
|
+
export declare const MoleculeItem: ({ type, config, attributes, tabsProps, form, id: moleculeId, }: Molecule & {
|
7
7
|
tabsProps?: Pick<TabGroupProps<string, string>, "tabs" | "activeTabKey" | "onTabChange"> | undefined;
|
8
8
|
}) => JSX.Element;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { ContainerScrollBehaviourType } from 'containers/types/types';
|
2
|
-
export declare const getScrollBehaviour: (scrollBehaviour?: ContainerScrollBehaviourType) => "overflow-y: scroll" | "overflow-x: scroll" | "overflow: visible" | "overflow:
|
2
|
+
export declare const getScrollBehaviour: (scrollBehaviour?: ContainerScrollBehaviourType) => "overflow-y: scroll" | "overflow-x: scroll" | "overflow: visible" | "overflow: unset";
|
@@ -1,9 +1,8 @@
|
|
1
|
-
import { SelectOption } from 'atoms';
|
2
|
-
import { ButtonProps, ImageProps, InputFieldProps, SelectFieldProps, TabGroupProps } from 'molecules';
|
1
|
+
import { RadioButtonType, SelectOption } from 'atoms';
|
2
|
+
import { ButtonProps, ImageProps, InputFieldProps, RadioButtonFieldProps, SelectFieldProps, TabGroupProps, TextMoleculeProps } from 'molecules';
|
3
3
|
import { UseFormReturn } from 'react-hook-form';
|
4
4
|
import { CSSProperties } from 'styled-components';
|
5
|
-
import {
|
6
|
-
import type { Nullable, StrictUnion, StylesType } from 'typescript';
|
5
|
+
import type { Nullable, StrictUnion } from 'typescript';
|
7
6
|
export declare type ImageAttributes = {
|
8
7
|
attributeType: 'image';
|
9
8
|
imageSource: string;
|
@@ -36,9 +35,9 @@ export interface BooleanAttributes {
|
|
36
35
|
}
|
37
36
|
export interface IterableAttributes {
|
38
37
|
attributeType: 'iterable';
|
39
|
-
options: SelectOption[];
|
38
|
+
options: SelectOption | RadioButtonType[];
|
40
39
|
}
|
41
|
-
export declare type MoleculeTypes = 'image' | 'text' | 'button' | 'video' | 'header_tab_group' | 'input_field' | 'select_field';
|
40
|
+
export declare type MoleculeTypes = 'image' | 'text' | 'button' | 'video' | 'header_tab_group' | 'input_field' | 'select_field' | 'radio_button_field';
|
42
41
|
export interface BaseMolecule {
|
43
42
|
id: string;
|
44
43
|
instance: 'molecule';
|
@@ -62,15 +61,7 @@ export interface TextMoleculeType extends BaseMolecule {
|
|
62
61
|
seoStyle: SelectAttributes;
|
63
62
|
};
|
64
63
|
config: {
|
65
|
-
props:
|
66
|
-
fontVariant: FontSizesTypes;
|
67
|
-
textSize: number;
|
68
|
-
textColor: ThemeColors | string;
|
69
|
-
letterSpacing: number;
|
70
|
-
lineHeight: number;
|
71
|
-
isRichText: boolean;
|
72
|
-
styles: StylesType;
|
73
|
-
}>;
|
64
|
+
props: TextMoleculeProps;
|
74
65
|
};
|
75
66
|
}
|
76
67
|
export interface ButtonMolecule extends BaseMolecule {
|
@@ -80,7 +71,9 @@ export interface ButtonMolecule extends BaseMolecule {
|
|
80
71
|
buttonLink: LinkAttributes;
|
81
72
|
};
|
82
73
|
config: {
|
83
|
-
props: Partial<Omit<ButtonProps, 'disabled' | 'children' | 'link' | 'text' | 'onClick' | 'elementId'
|
74
|
+
props: Partial<Omit<ButtonProps, 'disabled' | 'children' | 'link' | 'text' | 'onClick' | 'elementId'>> & {
|
75
|
+
type?: 'button' | 'submit' | 'reset';
|
76
|
+
};
|
84
77
|
};
|
85
78
|
}
|
86
79
|
export interface VideoMolecule extends BaseMolecule {
|
@@ -139,6 +132,19 @@ export interface SelectFieldMolecule extends BaseMolecule {
|
|
139
132
|
} & SelectFieldProps>;
|
140
133
|
};
|
141
134
|
}
|
142
|
-
export
|
135
|
+
export interface RadioButtonFieldMolecule extends BaseMolecule {
|
136
|
+
type: 'radio_button_field';
|
137
|
+
attributes: {
|
138
|
+
label: TextAttributes;
|
139
|
+
required: BooleanAttributes;
|
140
|
+
options: IterableAttributes;
|
141
|
+
};
|
142
|
+
config: {
|
143
|
+
props: Partial<{
|
144
|
+
state: 'default' | 'error';
|
145
|
+
} & RadioButtonFieldProps<string>>;
|
146
|
+
};
|
147
|
+
}
|
148
|
+
export declare type Molecule = StrictUnion<ImageMolecule | TextMoleculeType | ButtonMolecule | VideoMolecule | TabGroupMolecule | TextInputMolecule | SelectFieldMolecule | RadioButtonFieldMolecule> & {
|
143
149
|
form?: UseFormReturn<any>;
|
144
150
|
};
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
2
|
-
import { CSSProperties } from 'styled-components';
|
3
2
|
import { FontSizesTypes, SizesTypes, ThemeColors } from 'theme';
|
4
3
|
import type { Callback } from 'typescript';
|
5
4
|
import { StylesType } from 'typescript';
|
@@ -35,7 +34,7 @@ export declare type ButtonProps = BaseButtonProps & {
|
|
35
34
|
elementId?: string;
|
36
35
|
loading?: boolean;
|
37
36
|
isRichText?: boolean;
|
38
|
-
containerStyle?:
|
39
|
-
buttonStyle?:
|
37
|
+
containerStyle?: StylesType;
|
38
|
+
buttonStyle?: StylesType;
|
40
39
|
};
|
41
40
|
export declare const Button: ({ text: textProp, onClick, loading, disabled, variant, isRichText, fullWidth, elementId, link, containerStyle, children, buttonStyle, size, textColor, inactiveTextColor, state, ...props }: ButtonProps) => JSX.Element | null;
|
@@ -3,15 +3,33 @@ import { RadioButtonsProps } from 'atoms';
|
|
3
3
|
import { Control, ControllerProps } from 'react-hook-form/dist/types';
|
4
4
|
import { CSSProperties } from 'styled-components';
|
5
5
|
import { FieldLabelsProps } from '../FieldLabels/FieldLabels';
|
6
|
-
export declare type RadioButtonFieldProps<T extends string> = {
|
6
|
+
export declare type RadioButtonFieldProps<T extends string> = Partial<{
|
7
7
|
name: string;
|
8
|
-
control
|
9
|
-
rules
|
10
|
-
required
|
11
|
-
optional
|
12
|
-
defaultValue
|
13
|
-
styles
|
8
|
+
control: Control<any>;
|
9
|
+
rules: ControllerProps['rules'];
|
10
|
+
required: boolean;
|
11
|
+
optional: boolean;
|
12
|
+
defaultValue: string;
|
13
|
+
styles: CSSProperties;
|
14
14
|
radioButtonsProps: RadioButtonsProps<T>;
|
15
|
-
labelsProps
|
16
|
-
}
|
17
|
-
export declare const RadioButtonField: <T extends string>({ control, name, radioButtonsProps, styles, labelsProps, defaultValue, optional, required, rules, }:
|
15
|
+
labelsProps: FieldLabelsProps;
|
16
|
+
}>;
|
17
|
+
export declare const RadioButtonField: <T extends string>({ control, name, radioButtonsProps, styles, labelsProps, defaultValue, optional, required, rules, }: Partial<{
|
18
|
+
name: string;
|
19
|
+
control: Control<any>;
|
20
|
+
rules: ControllerProps['rules'];
|
21
|
+
required: boolean;
|
22
|
+
optional: boolean;
|
23
|
+
defaultValue: string;
|
24
|
+
styles: CSSProperties;
|
25
|
+
radioButtonsProps: Partial<{
|
26
|
+
isEditMode: boolean;
|
27
|
+
onChange: (value: T) => void;
|
28
|
+
value: T;
|
29
|
+
isRow: boolean;
|
30
|
+
items: import("atoms").RadioButtonType<T>[];
|
31
|
+
name: string;
|
32
|
+
internalConfig: import("atoms").RadioButtonInternalConfigProps;
|
33
|
+
}>;
|
34
|
+
labelsProps: FieldLabelsProps;
|
35
|
+
}>) => JSX.Element;
|
@@ -3,7 +3,42 @@ import type { ComponentStory } from '@storybook/react';
|
|
3
3
|
import { RadioButtonField as RadioButtonFieldComponent } from './RadioButtonField';
|
4
4
|
declare const _default: {
|
5
5
|
title: string;
|
6
|
-
component: <T extends string>({ control, name, radioButtonsProps, styles, labelsProps, defaultValue, optional, required, rules, }:
|
6
|
+
component: <T extends string>({ control, name, radioButtonsProps, styles, labelsProps, defaultValue, optional, required, rules, }: Partial<{
|
7
|
+
name: string;
|
8
|
+
control: import("react-hook-form").Control<any, any>;
|
9
|
+
rules: Omit<Partial<{
|
10
|
+
required: string | import("react-hook-form").ValidationRule<boolean>;
|
11
|
+
min: import("react-hook-form").ValidationRule<string | number>;
|
12
|
+
max: import("react-hook-form").ValidationRule<string | number>;
|
13
|
+
maxLength: import("react-hook-form").ValidationRule<number>;
|
14
|
+
minLength: import("react-hook-form").ValidationRule<number>;
|
15
|
+
pattern: import("react-hook-form").ValidationRule<RegExp>;
|
16
|
+
validate: import("react-hook-form").Validate<any> | Record<string, import("react-hook-form").Validate<any>>;
|
17
|
+
valueAsNumber: boolean;
|
18
|
+
valueAsDate: boolean;
|
19
|
+
value: any;
|
20
|
+
setValueAs: (value: any) => any;
|
21
|
+
shouldUnregister?: boolean | undefined;
|
22
|
+
onChange?: ((event: any) => void) | undefined;
|
23
|
+
onBlur?: ((event: any) => void) | undefined;
|
24
|
+
disabled: boolean;
|
25
|
+
deps: string | string[];
|
26
|
+
}>, "disabled" | "valueAsNumber" | "valueAsDate" | "setValueAs"> | undefined;
|
27
|
+
required: boolean;
|
28
|
+
optional: boolean;
|
29
|
+
defaultValue: string;
|
30
|
+
styles: import("styled-components").CSSProperties;
|
31
|
+
radioButtonsProps: Partial<{
|
32
|
+
isEditMode: boolean;
|
33
|
+
onChange: (value: T) => void;
|
34
|
+
value: T;
|
35
|
+
isRow: boolean;
|
36
|
+
items: import("../..").RadioButtonType<T>[];
|
37
|
+
name: string;
|
38
|
+
internalConfig: import("../..").RadioButtonInternalConfigProps;
|
39
|
+
}>;
|
40
|
+
labelsProps: import("..").FieldLabelsProps;
|
41
|
+
}>) => JSX.Element;
|
7
42
|
};
|
8
43
|
export default _default;
|
9
44
|
export declare const RadioButtonField: ComponentStory<typeof RadioButtonFieldComponent>;
|
@@ -14,5 +14,5 @@ export declare type TextMoleculeProps = Partial<{
|
|
14
14
|
isRichText: boolean;
|
15
15
|
styles: StylesType;
|
16
16
|
textAlign: 'center' | 'right' | 'left';
|
17
|
-
}> & Pick<TextProps, 'seoTag'>;
|
18
|
-
export declare const TextMolecule: ({ isRichText, variant, text, seoTag, fontVariant, textColor, textSize, fontWeight, lineHeight, letterSpacing, styles, textAlign, }: TextMoleculeProps) => JSX.Element;
|
17
|
+
}> & Pick<TextProps, 'seoTag' | 'numberOfLines'>;
|
18
|
+
export declare const TextMolecule: ({ isRichText, variant, text, seoTag, fontVariant, textColor, textSize, fontWeight, lineHeight, letterSpacing, styles, textAlign, ...restOfTextProps }: TextMoleculeProps) => JSX.Element;
|
@@ -3,7 +3,7 @@ import type { StoryFn } from '@storybook/react';
|
|
3
3
|
import { TextMoleculeProps } from './TextMolecule';
|
4
4
|
declare const _default: {
|
5
5
|
title: string;
|
6
|
-
component: ({ isRichText, variant, text, seoTag, fontVariant, textColor, textSize, fontWeight, lineHeight, letterSpacing, styles, textAlign, }: TextMoleculeProps) => JSX.Element;
|
6
|
+
component: ({ isRichText, variant, text, seoTag, fontVariant, textColor, textSize, fontWeight, lineHeight, letterSpacing, styles, textAlign, ...restOfTextProps }: TextMoleculeProps) => JSX.Element;
|
7
7
|
};
|
8
8
|
export default _default;
|
9
9
|
export declare const TextMolecule: StoryFn<TextMoleculeProps>;
|