@akad/design-system 0.1.0-beta.8 → 0.2.0-beta.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/css/aon-theme.css +1 -1
- package/css/bees-theme.css +1 -1
- package/css/bmc-theme.css +1 -1
- package/css/default-theme.css +1 -1
- package/css/linker-theme.css +1 -1
- package/css/oggi-theme.css +1 -1
- package/css/streetgo-theme.css +1 -1
- package/package.json +10 -10
- package/react/components/atoms/Checkbox/Checkbox.config.d.ts +14 -0
- package/react/components/atoms/Checkbox/Checkbox.d.ts +2 -13
- package/react/components/atoms/Checkbox/index.d.ts +2 -1
- package/react/components/atoms/Select/Select.stories.d.ts +8 -0
- package/react/components/atoms/TextArea/TextArea.d.ts +5 -2
- package/react/components/bosons/GridLayout/GridElement.d.ts +1 -4
- package/react/components/bosons/GridLayout/GridElement.test.d.ts +1 -0
- package/react/components/bosons/GridLayout/GridLayout.config.d.ts +11 -0
- package/react/components/bosons/GridLayout/GridLayout.d.ts +8 -18
- package/react/components/bosons/Wrapper/Wrapper.d.ts +0 -8
- package/react/components/molecules/Accordion/Accordion.d.ts +1 -1
- package/react/components/molecules/Accordion/AccordionItem.d.ts +1 -2
- package/react/components/molecules/ActiveTags/ActiveTags.d.ts +2 -2
- package/react/components/molecules/EditableSelect/EditableSelect.config.d.ts +5 -0
- package/react/components/molecules/EditableSelect/EditableSelect.d.ts +2 -1
- package/react/components/molecules/Notification/Notification.config.d.ts +16 -0
- package/react/components/molecules/Notification/Notification.d.ts +1 -28
- package/react/components/molecules/Notification/Notification.stories.d.ts +5 -5
- package/react/components/molecules/Notification/index.d.ts +2 -1
- package/react/components/molecules/PasswordConfirmation/PasswordConfirmartion.test.d.ts +1 -0
- package/react/components/molecules/PasswordConfirmation/PasswordConfirmation.d.ts +1 -1
- package/react/components/molecules/Tabs/Tab.test.d.ts +1 -0
- package/react/components/molecules/Tabs/Tabs.test.d.ts +1 -0
- package/react/components/molecules/ThemeProvider/ThemeProvider.test.d.ts +1 -0
- package/react/components/organisms/NotificationList/NotificationList.d.ts +2 -2
- package/react/components/organisms/NotificationList/NotificationList.test.d.ts +1 -0
- package/react/components/templates/TwoColumns/TwoColumns.test.d.ts +1 -0
- package/react/decorators/storybook.test.d.ts +1 -0
- package/react/main.d.ts +0 -2
- package/react/react-lib.js +2990 -8441
- package/react/react-lib.umd.cjs +5 -12
- package/react/helpers/messageParser.d.ts +0 -11
- package/react/helpers/utils.d.ts +0 -80
- package/react/helpers/validator.d.ts +0 -5
- package/react/hooks/index.d.ts +0 -6
- package/react/hooks/useForm.d.ts +0 -36
- package/react/hooks/useMediaQuery.d.ts +0 -1
- package/react/hooks/useNotification.d.ts +0 -8
- package/react/hooks/useStepper.d.ts +0 -31
- /package/react/{helpers/utils.test.d.ts → components/bosons/GridLayout/GridLayout.test.d.ts} +0 -0
- /package/react/{helpers/validator.test.d.ts → components/molecules/Notification/Notification.test.d.ts} +0 -0
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ValidateFunction } from 'ajv';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @description Verify if error from validator has a custom errorMessage. When it's a
|
|
5
|
-
* default error message, cals translatError
|
|
6
|
-
* @param validator Validator Function from ajv
|
|
7
|
-
* @param schemaId - OPTIONAL - schema $id used for validation. It's null/undefined when validating full JSON schema
|
|
8
|
-
* @returns
|
|
9
|
-
*/
|
|
10
|
-
export declare const parseError: (validator: ValidateFunction, schemaId?: string) => {} | undefined;
|
|
11
|
-
export default parseError;
|
package/react/helpers/utils.d.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { FormSchema } from '../types/hooks/types';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @description Create object key structure for a string path
|
|
5
|
-
* I.e path: user.name, value: 'Gabriel' -> { user: { name: 'Gabriel' } }
|
|
6
|
-
* @param target Object to be assigned
|
|
7
|
-
* @param path Value path inside object. I.e user.address.cep
|
|
8
|
-
* @param value Value to be inserted inside object
|
|
9
|
-
*/
|
|
10
|
-
export declare const customAssign: <T extends Record<string, unknown>>(target: T, path: Array<string>, value: string | number | boolean | undefined | Array<object> | object) => void;
|
|
11
|
-
/**
|
|
12
|
-
* @description Verify if a string is an object with a valid JSON structure. It was created to
|
|
13
|
-
* parse values from option HTML tag.
|
|
14
|
-
* @param value String to be verified if it's a valid object or not
|
|
15
|
-
* @returns { isObject, parsedObj}
|
|
16
|
-
*/
|
|
17
|
-
export declare const isValidObject: (value: string) => {
|
|
18
|
-
isObj: boolean;
|
|
19
|
-
parsedObj: JSON | undefined;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* @description Parse option value to correct format. Option HTML tag only return string,
|
|
23
|
-
* so it's necessary to verify if the value is boolean, number or object.
|
|
24
|
-
* @param value Value from option input
|
|
25
|
-
* @returns {string|boolean|object} value
|
|
26
|
-
*/
|
|
27
|
-
export declare const parseOptionValue: (value: string) => string | boolean | object | number;
|
|
28
|
-
/**
|
|
29
|
-
* @description Retrieves the schema properties with the specified schemaId from the formSchema.
|
|
30
|
-
* @param schemaId - The ID of the schema properties to retrieve.
|
|
31
|
-
* @param formSchema - The form schema containing the definitions.
|
|
32
|
-
* @returns The schema property with the specified schemaId, or null if not found.
|
|
33
|
-
*/
|
|
34
|
-
export declare const getSchemaProperties: (schemaId: string, formSchema: JSONSchemaType<{
|
|
35
|
-
$id: string;
|
|
36
|
-
type: "object";
|
|
37
|
-
schemas?: {
|
|
38
|
-
mainSchema: {
|
|
39
|
-
$id: string;
|
|
40
|
-
type: "object";
|
|
41
|
-
required: string[];
|
|
42
|
-
properties: {
|
|
43
|
-
effectiveDate: {
|
|
44
|
-
$ref: string;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
definitions?: Record<string, FormSchema> | undefined;
|
|
49
|
-
} | undefined;
|
|
50
|
-
definitions?: Record<string, FormSchema> | undefined;
|
|
51
|
-
}>) => FormSchema | null;
|
|
52
|
-
/**
|
|
53
|
-
* @description Returns email or password type if it's defined in the schema. If not, returns text as default.
|
|
54
|
-
* @param definition - Definition from JSON schema
|
|
55
|
-
* @returns return input type, i.e password or email. If it's not defined, returns text as default.
|
|
56
|
-
*/
|
|
57
|
-
export declare const getInputTypeByFormat: (definition: object) => string;
|
|
58
|
-
/**
|
|
59
|
-
* Performs a deep equality comparison between two values.
|
|
60
|
-
*
|
|
61
|
-
* @template T - The type of the values being compared.
|
|
62
|
-
* @param {T} value - The first value to compare.
|
|
63
|
-
* @param {T} other - The second value to compare.
|
|
64
|
-
* @param {WeakSet} [visited=new WeakSet()] - A WeakSet to keep track of visited objects to handle circular references.
|
|
65
|
-
* @returns {boolean} Returns `true` if the values are deeply equal, `false` otherwise.
|
|
66
|
-
*
|
|
67
|
-
* @description
|
|
68
|
-
* The `isEqual` function performs a deep equality comparison between two values of any type.
|
|
69
|
-
* It handles primitive types, `null`, arrays, and objects.
|
|
70
|
-
*
|
|
71
|
-
* - If both values are primitives, it uses `Object.is()` for comparison.
|
|
72
|
-
* - If both values are `null`, it returns `true`.
|
|
73
|
-
* - If the values have different types, it returns `false`.
|
|
74
|
-
* - If the values are the same reference, it returns `true`.
|
|
75
|
-
* - If the values are arrays, it compares their lengths and recursively compares each element.
|
|
76
|
-
* - If the values are objects, it compares the number of keys and recursively compares each key-value pair.
|
|
77
|
-
* - It handles circular references by keeping track of visited objects using a `WeakSet`.
|
|
78
|
-
*
|
|
79
|
-
*/
|
|
80
|
-
export declare function isEqual<T>(value: T, other: T, visited?: WeakSet<object>): boolean;
|
package/react/hooks/index.d.ts
DELETED
package/react/hooks/useForm.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { FormSchema, EventData, FormValidated, FormDataParsed } from '../types/hooks/types';
|
|
2
|
-
import { default as React } from 'react';
|
|
3
|
-
import { default as Ajv, JSONSchemaType } from 'ajv';
|
|
4
|
-
|
|
5
|
-
export declare const useForm: ({ formSchema, initialValue, }: {
|
|
6
|
-
formSchema: JSONSchemaType<FormSchema>;
|
|
7
|
-
initialValue: FormDataParsed;
|
|
8
|
-
}) => {
|
|
9
|
-
getFormSchema: JSONSchemaType<FormSchema>;
|
|
10
|
-
getFormEvent: EventData;
|
|
11
|
-
setFormData: React.Dispatch<React.SetStateAction<EventData>>;
|
|
12
|
-
getFormData: FormDataParsed;
|
|
13
|
-
getInputValidateStatus: (inputName: keyof FormDataParsed) => string;
|
|
14
|
-
getInputValidateMessage: (inputName: keyof FormDataParsed) => string | undefined;
|
|
15
|
-
getInputSchema: (inputName: string) => FormSchema | null;
|
|
16
|
-
isFormDirty: boolean;
|
|
17
|
-
handleFocused: (inputName: string) => void;
|
|
18
|
-
handleFormInput: ($event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
19
|
-
handleFormFlagFields: (flagkey: string, value: string) => void;
|
|
20
|
-
handleCustomValue: (key: keyof FormDataParsed, value: object | Array<object> | string) => void;
|
|
21
|
-
clearFormDataKey: (schemaId: string) => void;
|
|
22
|
-
getFormValidated: FormValidated;
|
|
23
|
-
getFormFlagFields: {};
|
|
24
|
-
validateForm: ({ touched }: {
|
|
25
|
-
touched?: boolean;
|
|
26
|
-
}) => FormValidated;
|
|
27
|
-
validateFormSchema: (schemaId: string, schemaData: FormDataParsed, options?: {
|
|
28
|
-
touched?: boolean;
|
|
29
|
-
}) => FormValidated;
|
|
30
|
-
parseFormToObject: () => {
|
|
31
|
-
toJson: () => string;
|
|
32
|
-
};
|
|
33
|
-
clearFormData: () => void;
|
|
34
|
-
register: (inputName: string) => {};
|
|
35
|
-
ajv: Ajv | undefined;
|
|
36
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useMediaQuery(query: string): boolean;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DsNotificationProps } from '../components/molecules/Notification';
|
|
2
|
-
|
|
3
|
-
export declare const useNotification: () => {
|
|
4
|
-
notifications: [] | DsNotificationProps[];
|
|
5
|
-
setNotifications: import('react').Dispatch<import('react').SetStateAction<[] | DsNotificationProps[]>>;
|
|
6
|
-
addNotification: (notification: DsNotificationProps) => void;
|
|
7
|
-
removeNotification: (notificationId: string) => void;
|
|
8
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { DsStepProps } from '../types/types';
|
|
2
|
-
import { default as React } from 'react';
|
|
3
|
-
|
|
4
|
-
export declare const useStepper: (initialState?: DsStepProps[], selectedState?: number) => {
|
|
5
|
-
getSteps: DsStepProps[];
|
|
6
|
-
getStep: (stepParam: number | string | DsStepProps) => {
|
|
7
|
-
index: number;
|
|
8
|
-
disabled?: boolean | undefined;
|
|
9
|
-
icon: string;
|
|
10
|
-
label: string;
|
|
11
|
-
name: string;
|
|
12
|
-
};
|
|
13
|
-
getStepSelected: {
|
|
14
|
-
index: number;
|
|
15
|
-
disabled?: boolean | undefined;
|
|
16
|
-
icon: string;
|
|
17
|
-
label: string;
|
|
18
|
-
name: string;
|
|
19
|
-
};
|
|
20
|
-
getStepIndexByName: (stepNameParam: string) => number;
|
|
21
|
-
setSteps: (arraySteps: React.SetStateAction<DsStepProps[]>) => void;
|
|
22
|
-
setStepSelected: (stepParam: number | string | DsStepProps) => void;
|
|
23
|
-
goToNextStep: () => void;
|
|
24
|
-
goToPrevStep: () => void;
|
|
25
|
-
canGoToNextStep: boolean;
|
|
26
|
-
canGoToPrevStep: boolean;
|
|
27
|
-
isStep: (stepParam: number | string | DsStepProps) => boolean;
|
|
28
|
-
isLastStep: boolean;
|
|
29
|
-
disableSteps: (stepNameParam: string | Array<string>) => DsStepProps[];
|
|
30
|
-
disableStepsAfter: (stepNameParam: string) => void;
|
|
31
|
-
}[];
|
/package/react/{helpers/utils.test.d.ts → components/bosons/GridLayout/GridLayout.test.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|