@zealicsolutions/web-ui 0.2.97 → 0.2.99
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 +5 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/src/atoms/Checkbox/Checkbox.d.ts +15 -9
- package/dist/cjs/src/atoms/Checkbox/Checkbox.stories.d.ts +1 -1
- package/dist/cjs/src/atoms/Checkbox/helpers.d.ts +2 -0
- package/dist/cjs/src/atoms/Checkbox/types.d.ts +18 -0
- package/dist/cjs/src/atoms/TextWrapper/TextWrapper.d.ts +4 -1
- package/dist/cjs/src/containers/types/moleculeTypes.d.ts +18 -5
- package/dist/cjs/src/molecules/CheckboxField/CheckboxField.d.ts +27 -8
- package/dist/cjs/src/molecules/CheckboxField/CheckboxField.stories.d.ts +37 -0
- package/dist/cjs/src/molecules/CheckboxField/CheckboxGroup.d.ts +7 -0
- package/dist/cjs/src/molecules/CheckboxField/styles.d.ts +6 -0
- package/dist/cjs/src/molecules/InputField/InputField.d.ts +1 -1
- package/dist/cjs/src/molecules/InputField/InputField.stories.d.ts +1 -18
- package/dist/cjs/src/molecules/RadioButtonField/RadioButtonField.stories.d.ts +1 -18
- package/dist/cjs/src/molecules/SelectField/SelectField.d.ts +2 -2
- package/dist/cjs/src/molecules/SelectField/SelectField.stories.d.ts +1 -18
- package/dist/cjs/src/molecules/index.d.ts +1 -0
- package/dist/esm/index.js +6 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/src/atoms/Checkbox/Checkbox.d.ts +15 -9
- package/dist/esm/src/atoms/Checkbox/Checkbox.stories.d.ts +1 -1
- package/dist/esm/src/atoms/Checkbox/helpers.d.ts +2 -0
- package/dist/esm/src/atoms/Checkbox/types.d.ts +18 -0
- package/dist/esm/src/atoms/TextWrapper/TextWrapper.d.ts +4 -1
- package/dist/esm/src/containers/types/moleculeTypes.d.ts +18 -5
- package/dist/esm/src/molecules/CheckboxField/CheckboxField.d.ts +27 -8
- package/dist/esm/src/molecules/CheckboxField/CheckboxField.stories.d.ts +37 -0
- package/dist/esm/src/molecules/CheckboxField/CheckboxGroup.d.ts +7 -0
- package/dist/esm/src/molecules/CheckboxField/styles.d.ts +6 -0
- package/dist/esm/src/molecules/InputField/InputField.d.ts +1 -1
- package/dist/esm/src/molecules/InputField/InputField.stories.d.ts +1 -18
- package/dist/esm/src/molecules/RadioButtonField/RadioButtonField.stories.d.ts +1 -18
- package/dist/esm/src/molecules/SelectField/SelectField.d.ts +2 -2
- package/dist/esm/src/molecules/SelectField/SelectField.stories.d.ts +1 -18
- package/dist/esm/src/molecules/index.d.ts +1 -0
- package/dist/index.d.ts +75 -21
- package/package.json +1 -1
@@ -1,9 +1,15 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { CheckboxInternalConfigProps } from './types';
|
3
|
+
export declare type CheckboxProps = {
|
4
|
+
id: string;
|
5
|
+
onClick: (id: string) => void;
|
6
|
+
label: string;
|
7
|
+
} & Partial<{
|
8
|
+
isError: boolean;
|
9
|
+
disabled: boolean;
|
10
|
+
isEditMode: boolean;
|
11
|
+
isSelected: boolean;
|
12
|
+
isRichText: boolean;
|
13
|
+
internalConfig: CheckboxInternalConfigProps;
|
14
|
+
}>;
|
15
|
+
export declare const Checkbox: ({ id, onClick, label, isError, disabled, isEditMode, isSelected, isRichText, internalConfig, }: CheckboxProps) => JSX.Element;
|
@@ -3,7 +3,7 @@ import type { ComponentStory } from '@storybook/react';
|
|
3
3
|
import { Checkbox as CheckboxComponent } from './Checkbox';
|
4
4
|
declare const _default: {
|
5
5
|
title: string;
|
6
|
-
component: ({
|
6
|
+
component: ({ id, onClick, label, isError, disabled, isEditMode, isSelected, isRichText, internalConfig, }: import("./Checkbox").CheckboxProps) => JSX.Element;
|
7
7
|
};
|
8
8
|
export default _default;
|
9
9
|
export declare const Checkbox: ComponentStory<typeof CheckboxComponent>;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { SizesTypes, ThemeColors } from 'theme';
|
2
|
+
import type { StylesType } from 'typescript';
|
3
|
+
export declare type CheckboxInternalConfigProps = Partial<{
|
4
|
+
selectedCheckboxBackgroundColor: ThemeColors | string;
|
5
|
+
selectedCheckboxIconColor: ThemeColors | string;
|
6
|
+
buttonPadding: number;
|
7
|
+
textPadding: number;
|
8
|
+
styles: StylesType;
|
9
|
+
wrapperStyles: StylesType;
|
10
|
+
buttonOptionSpacing?: SizesTypes;
|
11
|
+
}>;
|
12
|
+
export declare type CheckboxStylesConfig = {
|
13
|
+
checkboxIconWrapperColor: StylesType;
|
14
|
+
checkboxIconColor: ThemeColors | string;
|
15
|
+
checkboxWrapperStyles: StylesType;
|
16
|
+
checkboxTextStyles: StylesType;
|
17
|
+
};
|
18
|
+
export declare type CheckBoxStates = 'selected' | 'disabled' | 'error' | 'default';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
2
2
|
import { FontSizesTypes, ThemeColors } from 'theme/types';
|
3
|
-
import { StylesType } from 'typescript';
|
3
|
+
import type { StylesType } from 'typescript';
|
4
4
|
export declare type TextTypes = 'primary' | 'secondary' | 'error' | 'success';
|
5
5
|
export declare type TextAlign = 'center' | 'right' | 'left';
|
6
6
|
export declare type SeoTags = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div';
|
@@ -17,3 +17,6 @@ export declare type TextProps = {
|
|
17
17
|
};
|
18
18
|
export declare type TextWrapperProps = PropsWithChildren<TextProps>;
|
19
19
|
export declare const TextWrapper: ({ children, seoTag, ...textProps }: TextWrapperProps) => JSX.Element;
|
20
|
+
export declare const ErrorText: ({ text }: {
|
21
|
+
text: string;
|
22
|
+
}) => JSX.Element;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
import { ButtonProps, ImageProps, InputFieldProps, RadioButtonFieldProps, SelectFieldProps, TabGroupProps, TextMoleculeProps } from 'molecules';
|
1
|
+
import { SelectOption } from 'atoms';
|
2
|
+
import { ButtonProps, CheckboxFieldProps, ImageProps, InputFieldProps, RadioButtonFieldProps, SelectFieldProps, TabGroupProps, TextMoleculeProps } from 'molecules';
|
3
3
|
import { UseFormReturn } from 'react-hook-form';
|
4
4
|
import { CSSProperties } from 'styled-components';
|
5
5
|
import type { Nullable, StrictUnion } from 'typescript';
|
@@ -35,9 +35,9 @@ export interface BooleanAttributes {
|
|
35
35
|
}
|
36
36
|
export interface IterableAttributes {
|
37
37
|
attributeType: 'iterable';
|
38
|
-
options: SelectOption
|
38
|
+
options: SelectOption[];
|
39
39
|
}
|
40
|
-
export declare type MoleculeTypes = 'image' | 'text' | 'button' | 'video' | 'header_tab_group' | 'input_field' | 'select_field' | 'radio_button_field';
|
40
|
+
export declare type MoleculeTypes = 'image' | 'text' | 'button' | 'video' | 'header_tab_group' | 'input_field' | 'select_field' | 'radio_button_field' | 'checkbox_field';
|
41
41
|
export interface BaseMolecule {
|
42
42
|
id: string;
|
43
43
|
instance: 'molecule';
|
@@ -143,6 +143,19 @@ export interface RadioButtonFieldMolecule extends BaseMolecule {
|
|
143
143
|
} & RadioButtonFieldProps<string>>;
|
144
144
|
};
|
145
145
|
}
|
146
|
-
export
|
146
|
+
export interface CheckboxFieldMolecule extends BaseMolecule {
|
147
|
+
type: 'checkbox_field';
|
148
|
+
attributes: {
|
149
|
+
label: TextAttributes;
|
150
|
+
required: BooleanAttributes;
|
151
|
+
options: IterableAttributes;
|
152
|
+
};
|
153
|
+
config: {
|
154
|
+
props: Partial<{
|
155
|
+
state: 'default' | 'error';
|
156
|
+
} & CheckboxFieldProps>;
|
157
|
+
};
|
158
|
+
}
|
159
|
+
export declare type Molecule = StrictUnion<ImageMolecule | TextMoleculeType | ButtonMolecule | VideoMolecule | TabGroupMolecule | TextInputMolecule | SelectFieldMolecule | RadioButtonFieldMolecule | CheckboxFieldMolecule> & {
|
147
160
|
form?: UseFormReturn<any>;
|
148
161
|
};
|
@@ -1,10 +1,29 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { Control } from 'react-hook-form/dist/types';
|
3
|
-
import {
|
4
|
-
|
2
|
+
import { Control, ControllerProps } from 'react-hook-form/dist/types';
|
3
|
+
import { SelectOption } from 'atoms';
|
4
|
+
import type { StylesType } from 'typescript';
|
5
|
+
import { CheckboxInternalConfigProps } from 'atoms/Checkbox/types';
|
6
|
+
import { FieldLabelsProps } from '../FieldLabels/FieldLabels';
|
7
|
+
export declare type CheckboxesProps = Partial<{
|
8
|
+
checkboxGroupWrapperStyles: StylesType;
|
9
|
+
checkboxFieldWrapperStyles: StylesType;
|
10
|
+
onChange: (id: string) => void;
|
11
|
+
disabled: boolean;
|
12
|
+
options?: SelectOption[];
|
13
|
+
selectedIds?: string[];
|
14
|
+
isError?: boolean;
|
15
|
+
isEditMode?: boolean;
|
16
|
+
isRichText: boolean;
|
17
|
+
internalConfig: CheckboxInternalConfigProps;
|
18
|
+
}>;
|
19
|
+
export declare type CheckboxFieldProps = Partial<{
|
20
|
+
checkboxesProps: CheckboxesProps;
|
21
|
+
labelsProps: FieldLabelsProps;
|
5
22
|
name: string;
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
23
|
+
rules: ControllerProps['rules'];
|
24
|
+
control: Control<any>;
|
25
|
+
required: boolean;
|
26
|
+
optional: boolean;
|
27
|
+
wrapperStyles: StylesType;
|
28
|
+
}>;
|
29
|
+
export declare const CheckboxField: ({ checkboxesProps, name, rules, control, optional, required, labelsProps, wrapperStyles, }: CheckboxFieldProps) => JSX.Element;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import type { StoryFn } from '@storybook/react';
|
3
|
+
import { CheckboxField as CheckboxFieldComponent } from 'molecules';
|
4
|
+
declare const _default: {
|
5
|
+
title: string;
|
6
|
+
component: ({ checkboxesProps, name, rules, control, optional, required, labelsProps, wrapperStyles, }: Partial<{
|
7
|
+
checkboxesProps: Partial<{
|
8
|
+
checkboxGroupWrapperStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<object, import("styled-components").DefaultTheme>>;
|
9
|
+
checkboxFieldWrapperStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<object, import("styled-components").DefaultTheme>>;
|
10
|
+
onChange: (id: string) => void;
|
11
|
+
disabled: boolean;
|
12
|
+
options?: import("../..").SelectOption[] | undefined;
|
13
|
+
selectedIds?: string[] | undefined;
|
14
|
+
isError?: boolean | undefined;
|
15
|
+
isEditMode?: boolean | undefined;
|
16
|
+
isRichText: boolean;
|
17
|
+
internalConfig: Partial<{
|
18
|
+
selectedCheckboxBackgroundColor: string;
|
19
|
+
selectedCheckboxIconColor: string;
|
20
|
+
buttonPadding: number;
|
21
|
+
textPadding: number;
|
22
|
+
styles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<object, import("styled-components").DefaultTheme>>;
|
23
|
+
wrapperStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<object, import("styled-components").DefaultTheme>>;
|
24
|
+
buttonOptionSpacing?: import("theme").SizesTypes | undefined;
|
25
|
+
}>;
|
26
|
+
}>;
|
27
|
+
labelsProps: import("molecules").FieldLabelsProps;
|
28
|
+
name: string;
|
29
|
+
rules: Omit<import("react-hook-form").RegisterOptions<import("react-hook-form").FieldValues, string>, "disabled" | "valueAsNumber" | "valueAsDate" | "setValueAs"> | undefined;
|
30
|
+
control: import("react-hook-form").Control<any, any>;
|
31
|
+
required: boolean;
|
32
|
+
optional: boolean;
|
33
|
+
wrapperStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<object, import("styled-components").DefaultTheme>>;
|
34
|
+
}>) => JSX.Element;
|
35
|
+
};
|
36
|
+
export default _default;
|
37
|
+
export declare const CheckboxField: StoryFn<typeof CheckboxFieldComponent>;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { CheckboxesProps } from './CheckboxField';
|
3
|
+
export declare type CheckboxGroupProps = Partial<{
|
4
|
+
onChange: (checkedIds: string[]) => void;
|
5
|
+
checkboxesProps: CheckboxesProps;
|
6
|
+
}>;
|
7
|
+
export declare const CheckboxGroup: ({ onChange, checkboxesProps }: CheckboxGroupProps) => JSX.Element;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { OverrideStyles } from 'typescript';
|
2
|
+
import { SizesTypes } from 'theme';
|
3
|
+
export declare const CheckboxFieldWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, OverrideStyles, never>;
|
4
|
+
export declare const CheckboxGroupWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
5
|
+
$spacing?: SizesTypes | undefined;
|
6
|
+
} & OverrideStyles, never>;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { Control, ControllerProps } from 'react-hook-form/dist/types';
|
3
3
|
import { InputProps } from 'atoms';
|
4
|
-
import { StylesType } from 'typescript';
|
4
|
+
import type { StylesType } from 'typescript';
|
5
5
|
import { FieldLabelsProps } from '../FieldLabels/FieldLabels';
|
6
6
|
export declare type InputFieldProps = Partial<{
|
7
7
|
name: string;
|
@@ -6,24 +6,7 @@ declare const _default: {
|
|
6
6
|
component: ({ control, name, inputProps, styles, labelsProps, defaultValue, optional, required, rules, }: Partial<{
|
7
7
|
name: string;
|
8
8
|
control: import("react-hook-form").Control<any, any>;
|
9
|
-
rules: Omit<
|
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;
|
9
|
+
rules: Omit<import("react-hook-form").RegisterOptions<import("react-hook-form").FieldValues, string>, "disabled" | "valueAsNumber" | "valueAsDate" | "setValueAs"> | undefined;
|
27
10
|
required: boolean;
|
28
11
|
optional: boolean;
|
29
12
|
defaultValue: string;
|
@@ -6,24 +6,7 @@ declare const _default: {
|
|
6
6
|
component: <T extends string>({ control, name, radioButtonsProps, styles, labelsProps, defaultValue, optional, required, rules, }: Partial<{
|
7
7
|
name: string;
|
8
8
|
control: import("react-hook-form").Control<any, any>;
|
9
|
-
rules: Omit<
|
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;
|
9
|
+
rules: Omit<import("react-hook-form").RegisterOptions<import("react-hook-form").FieldValues, string>, "disabled" | "valueAsNumber" | "valueAsDate" | "setValueAs"> | undefined;
|
27
10
|
required: boolean;
|
28
11
|
optional: boolean;
|
29
12
|
defaultValue: string;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
+
import { SelectProps } from 'atoms';
|
2
3
|
import { Control, ControllerProps } from 'react-hook-form/dist/types';
|
3
|
-
import {
|
4
|
+
import type { StylesType } from 'typescript';
|
4
5
|
import { FieldLabelsProps } from '../FieldLabels/FieldLabels';
|
5
|
-
import { StylesType } from 'typescript';
|
6
6
|
export declare type SelectFieldProps = Partial<{
|
7
7
|
selectProps: SelectProps;
|
8
8
|
labelsProps: FieldLabelsProps;
|
@@ -7,24 +7,7 @@ declare const _default: {
|
|
7
7
|
selectProps: import("../..").SelectProps;
|
8
8
|
labelsProps: import("..").FieldLabelsProps;
|
9
9
|
name: string;
|
10
|
-
rules: Omit<
|
11
|
-
required: string | import("react-hook-form").ValidationRule<boolean>;
|
12
|
-
min: import("react-hook-form").ValidationRule<string | number>;
|
13
|
-
max: import("react-hook-form").ValidationRule<string | number>;
|
14
|
-
maxLength: import("react-hook-form").ValidationRule<number>;
|
15
|
-
minLength: import("react-hook-form").ValidationRule<number>;
|
16
|
-
pattern: import("react-hook-form").ValidationRule<RegExp>;
|
17
|
-
validate: import("react-hook-form").Validate<any> | Record<string, import("react-hook-form").Validate<any>>;
|
18
|
-
valueAsNumber: boolean;
|
19
|
-
valueAsDate: boolean;
|
20
|
-
value: any;
|
21
|
-
setValueAs: (value: any) => any;
|
22
|
-
shouldUnregister?: boolean | undefined;
|
23
|
-
onChange?: ((event: any) => void) | undefined;
|
24
|
-
onBlur?: ((event: any) => void) | undefined;
|
25
|
-
disabled: boolean;
|
26
|
-
deps: string | string[];
|
27
|
-
}>, "disabled" | "valueAsNumber" | "valueAsDate" | "setValueAs"> | undefined;
|
10
|
+
rules: Omit<import("react-hook-form").RegisterOptions<import("react-hook-form").FieldValues, string>, "disabled" | "valueAsNumber" | "valueAsDate" | "setValueAs"> | undefined;
|
28
11
|
control: import("react-hook-form").Control<any, any>;
|
29
12
|
required: boolean;
|
30
13
|
optional: boolean;
|
@@ -2,6 +2,7 @@ export * from './FieldLabels/FieldLabels';
|
|
2
2
|
export * from './InputField/InputField';
|
3
3
|
export * from './FieldMapper/FieldMapper';
|
4
4
|
export * from './CheckboxField/CheckboxField';
|
5
|
+
export * from './CheckboxField/CheckboxGroup';
|
5
6
|
export * from './SelectField/SelectField';
|
6
7
|
export * from './CustomValidation/CustomValidation';
|
7
8
|
export * from './SelectableInfoCard/SelectableCardGroup';
|