dfh-ui-library 1.1.2 → 1.1.3
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/README.md +6 -0
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.css.map +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Button/Button.handler.d.ts +1 -1
- package/dist/cjs/types/components/Button/Button.test.d.ts +1 -0
- package/dist/cjs/types/components/FormElements/Input/Input.d.ts +7 -0
- package/dist/cjs/types/components/FormElements/Input/Input.test.d.ts +1 -0
- package/dist/cjs/types/components/FormElements/Input/index.d.ts +69 -0
- package/dist/cjs/types/components/Media/Icon/Icon.d.ts +11 -0
- package/dist/cjs/types/components/Media/Icon/Icon.handler.d.ts +4 -0
- package/dist/cjs/types/components/Media/Icons/Icons.d.ts +4 -0
- package/dist/cjs/types/components/Typhography/Typhography.handler.d.ts +1 -1
- package/dist/cjs/types/shared/configs/componentsClasses.d.ts +83 -0
- package/dist/cjs/types/shared/models/components/base.model.d.ts +20 -1
- package/dist/cjs/types/shared/models/components/common.model.d.ts +3 -2
- package/dist/cjs/types/shared/utilities/images.d.ts +3 -0
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.css.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Button/Button.handler.d.ts +1 -1
- package/dist/esm/types/components/Button/Button.test.d.ts +1 -0
- package/dist/esm/types/components/FormElements/Input/Input.d.ts +7 -0
- package/dist/esm/types/components/FormElements/Input/Input.test.d.ts +1 -0
- package/dist/esm/types/components/FormElements/Input/index.d.ts +69 -0
- package/dist/esm/types/components/Media/Icon/Icon.d.ts +11 -0
- package/dist/esm/types/components/Media/Icon/Icon.handler.d.ts +4 -0
- package/dist/esm/types/components/Media/Icons/Icons.d.ts +4 -0
- package/dist/esm/types/components/Typhography/Typhography.handler.d.ts +1 -1
- package/dist/esm/types/shared/configs/componentsClasses.d.ts +83 -0
- package/dist/esm/types/shared/models/components/base.model.d.ts +20 -1
- package/dist/esm/types/shared/models/components/common.model.d.ts +3 -2
- package/dist/esm/types/shared/utilities/images.d.ts +3 -0
- package/dist/index.d.ts +2 -2
- package/package.json +18 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const handleButtonClasses: (variants?: string | undefined) => "text-16s h-[52px] text-white border-solid border-primary-500 bg-
|
|
1
|
+
export declare const handleButtonClasses: (variants?: string | undefined) => "text-16s h-[52px] text-white border-solid border-primary-500 bg-[#333333]" | "text-16s h-[52px] text-base font-semibold leading-5 border border-solid border-[#CDCED6] bg-white" | "text-14s h-9 text-white border-solid border-primary-500 bg-[#333333]" | "text-14s h-9 text-base font-semibold leading-5 border border-solid border-[#CDCED6] bg-white" | "text-14s h-7 text-white border-solid border-primary-500 bg-[#333333]" | "text-14s h-7 text-base font-semibold leading-5 border border-solid border-[#CDCED6] bg-white" | "text-16s h-11 text-base font-semibold leading-5 border border-solid border-[#CDCED6] bg-white" | "text-16s h-11 text-white border-solid border-primary-500 bg-[#333333]" | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from "react";
|
|
2
|
+
type InputType = "text" | "email" | "password" | "name" | "date";
|
|
3
|
+
export interface HookFormsInputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Set Input type
|
|
6
|
+
*/
|
|
7
|
+
type?: InputType;
|
|
8
|
+
/**
|
|
9
|
+
* Set new variant of the input
|
|
10
|
+
*/
|
|
11
|
+
inputVariant?: "default" | "large";
|
|
12
|
+
/**
|
|
13
|
+
* Set Input name
|
|
14
|
+
*/
|
|
15
|
+
id?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Set Input name
|
|
18
|
+
*/
|
|
19
|
+
labelName?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Set the Label Type
|
|
22
|
+
*/
|
|
23
|
+
labelType?: "default" | "black" | "smallSelect" | "blackSmall";
|
|
24
|
+
/**
|
|
25
|
+
* Set Input label name
|
|
26
|
+
*/
|
|
27
|
+
label?: string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Ser Error message
|
|
30
|
+
*/
|
|
31
|
+
error?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Ser Error message
|
|
34
|
+
*/
|
|
35
|
+
isBorderedError?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Set Wrapper classes, new classes will overide the existing default classes
|
|
38
|
+
*/
|
|
39
|
+
wrapperClass?: string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Optional for additional classes
|
|
42
|
+
*/
|
|
43
|
+
additionalClasses?: string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Enable read only
|
|
46
|
+
*/
|
|
47
|
+
readonly?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* LabelClasses
|
|
50
|
+
*/
|
|
51
|
+
labelClasses?: string | undefined;
|
|
52
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
53
|
+
placeholder?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Set label only
|
|
56
|
+
*/
|
|
57
|
+
onlyLabel?: boolean | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* inner span Classes
|
|
60
|
+
*/
|
|
61
|
+
labelSpanClasses?: string;
|
|
62
|
+
/**
|
|
63
|
+
* add additional InputValidation Classes
|
|
64
|
+
*/
|
|
65
|
+
additionalErrorClasses?: string;
|
|
66
|
+
isAdditionalErrorInput?: boolean;
|
|
67
|
+
fullError?: boolean;
|
|
68
|
+
}
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IconProps } from "../../../shared/models/components/base.model";
|
|
3
|
+
/**
|
|
4
|
+
* Primary UI component for user interaction
|
|
5
|
+
*
|
|
6
|
+
* Used SVG for Icons, All icons are exported in the following file path
|
|
7
|
+
*
|
|
8
|
+
* File Path : "src/components/core/Media/Icons/Icons.tsx"
|
|
9
|
+
*/
|
|
10
|
+
declare const Icon: React.FC<IconProps>;
|
|
11
|
+
export default Icon;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const handleIconColor: (_iconColor: string) => string;
|
|
3
|
+
export declare const handleIconHoverColor: (_iconHoverColor: string | undefined) => string;
|
|
4
|
+
export declare const handleIconTYpes: (_iconType: string | undefined) => React.JSX.Element | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const handleFontTypes: (_type: string | undefined) => "text-12s font-medium" | "text-12s font-semibold" | "text-12s font-extrabold" | "text-14s font-medium" | "text-14s font-semibold" | "text-14s font-extrabold" | "text-28s font-medium" | "text-28s font-semibold" | "text-28s font-extrabold" | "text-10s font-medium" | "text-10s font-semibold" | "text-10s font-extrabold" | undefined;
|
|
1
|
+
export declare const handleFontTypes: (_type: string | undefined) => "text-12s font-medium" | "text-12s font-semibold" | "text-12s font-extrabold" | "text-14s font-medium" | "text-2xl font-semibold leading-6 text-[#333333]" | "text-xl font-semibold leading-6 text-[#333333]" | "text-14s font-semibold" | "text-14s font-extrabold" | "text-28s font-medium" | "text-28s font-semibold" | "text-28s font-extrabold" | "text-10s font-medium" | "text-10s font-semibold" | "text-10s font-extrabold" | "text-base font-normal leading-[1.875rem] text-[#333333] opacity-50" | "text-base text-xl leading-[1.875rem] text-[#333333]" | undefined;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export declare const Classes: {
|
|
2
|
+
wrapper: {
|
|
3
|
+
default: string;
|
|
4
|
+
};
|
|
5
|
+
typho: {
|
|
6
|
+
white: string;
|
|
7
|
+
black: string;
|
|
8
|
+
blue: string;
|
|
9
|
+
gray: string;
|
|
10
|
+
gray720: string;
|
|
11
|
+
black650: string;
|
|
12
|
+
inherit: string;
|
|
13
|
+
};
|
|
14
|
+
heading: {
|
|
15
|
+
white: string;
|
|
16
|
+
gray: string;
|
|
17
|
+
dark: string;
|
|
18
|
+
h1: string;
|
|
19
|
+
h2: string;
|
|
20
|
+
h3: string;
|
|
21
|
+
h4: string;
|
|
22
|
+
h5: string;
|
|
23
|
+
h6: string;
|
|
24
|
+
};
|
|
25
|
+
message: {
|
|
26
|
+
common: string;
|
|
27
|
+
error: string;
|
|
28
|
+
success: string;
|
|
29
|
+
warning: string;
|
|
30
|
+
neutral: string;
|
|
31
|
+
highlight: string;
|
|
32
|
+
};
|
|
33
|
+
card: {
|
|
34
|
+
common: string;
|
|
35
|
+
lightGray: string;
|
|
36
|
+
lightGrayHalf: string;
|
|
37
|
+
gray: string;
|
|
38
|
+
white: string;
|
|
39
|
+
black: string;
|
|
40
|
+
whiteBorder: string;
|
|
41
|
+
};
|
|
42
|
+
button: {
|
|
43
|
+
default: string;
|
|
44
|
+
common: string;
|
|
45
|
+
disabled: string;
|
|
46
|
+
blackLarge: string;
|
|
47
|
+
blackMedium: string;
|
|
48
|
+
blackMediumH36: string;
|
|
49
|
+
blackSmall: string;
|
|
50
|
+
blackExtraSmall: string;
|
|
51
|
+
sentButton: string;
|
|
52
|
+
smallButtonGray: string;
|
|
53
|
+
};
|
|
54
|
+
label: {
|
|
55
|
+
default: string;
|
|
56
|
+
black: string;
|
|
57
|
+
blackSmall: string;
|
|
58
|
+
smallSelect: string;
|
|
59
|
+
};
|
|
60
|
+
input: {
|
|
61
|
+
default: string;
|
|
62
|
+
readonly: string;
|
|
63
|
+
wrapper: string;
|
|
64
|
+
error: string;
|
|
65
|
+
large: string;
|
|
66
|
+
};
|
|
67
|
+
inputValidation: {
|
|
68
|
+
error: string;
|
|
69
|
+
};
|
|
70
|
+
select: {
|
|
71
|
+
default: string;
|
|
72
|
+
small: string;
|
|
73
|
+
wrapper: string;
|
|
74
|
+
error: string;
|
|
75
|
+
};
|
|
76
|
+
image: {
|
|
77
|
+
default: string;
|
|
78
|
+
};
|
|
79
|
+
icon: {
|
|
80
|
+
white: string;
|
|
81
|
+
black: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdditionalClassesProp, ChildrenProp, IconTypeProp, AlignmentType, OnClickEventProps, TyphoTypes, TyphoComponents } from "./common.model";
|
|
1
|
+
import { AdditionalClassesProp, ChildrenProp, IconTypeProp, AlignmentType, OnClickEventProps, TyphoTypes, TyphoComponents, IconHoverColorTypes } from "./common.model";
|
|
2
2
|
export interface ButtonProps extends ChildrenProp, AdditionalClassesProp, IconTypeProp, OnClickEventProps {
|
|
3
3
|
/**
|
|
4
4
|
* Set the button type
|
|
@@ -44,3 +44,22 @@ export interface TyphographyProps extends ChildrenProp, AdditionalClassesProp {
|
|
|
44
44
|
color?: string;
|
|
45
45
|
onClick?: () => void;
|
|
46
46
|
}
|
|
47
|
+
export interface IconProps extends AdditionalClassesProp, IconTypeProp {
|
|
48
|
+
/**
|
|
49
|
+
* Optional | Set Icon Text
|
|
50
|
+
*/
|
|
51
|
+
iconText?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Optional | Set Icon hover color
|
|
54
|
+
*/
|
|
55
|
+
iconHoverColor?: IconHoverColorTypes;
|
|
56
|
+
/**
|
|
57
|
+
* Optional | Set Icon container classes
|
|
58
|
+
*/
|
|
59
|
+
iconContainerClasses?: string | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Optional | Set Icon Text classes
|
|
62
|
+
*/
|
|
63
|
+
iconTextClasses?: string | undefined;
|
|
64
|
+
onClick?: any;
|
|
65
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export type AlignmentType = "center" | "left" | "right";
|
|
3
3
|
export type IconColorTypes = "white" | "black-900" | "gray-220" | "gray-720" | "inherit" | "gray-300" | string;
|
|
4
4
|
export type IconHoverColorTypes = "white" | "black-900" | "gray-220" | "inherit";
|
|
5
|
-
export type IconType = "Home" | "Info" | "RightArrow" | "DropDown" | "DropDownArrow" | "WhiteArrow" | "TrashIcon" | "AddNewitemIcon" | "OkIcon" | "EditIcon" | "Delete" | "AddIcon" | "RemoveTrashIcon" | "RoundTickIcon" | "ValidationWarningIcon" | "WarningIcon" | "NeturalIcon" | "SuccessIcon" | string;
|
|
5
|
+
export type IconType = "Home" | "Info" | "Email" | "RightArrow" | "DropDown" | "DropDownArrow" | "WhiteArrow" | "TrashIcon" | "AddNewitemIcon" | "OkIcon" | "EditIcon" | "Delete" | "AddIcon" | "RemoveTrashIcon" | "RoundTickIcon" | "ValidationWarningIcon" | "WarningIcon" | "NeturalIcon" | "SuccessIcon" | string;
|
|
6
6
|
export interface ChildrenProp {
|
|
7
7
|
/**
|
|
8
8
|
* Se the child node and element;
|
|
@@ -34,5 +34,6 @@ export interface DataTestIdProp {
|
|
|
34
34
|
export interface OnClickEventProps {
|
|
35
35
|
onClick?: () => void;
|
|
36
36
|
}
|
|
37
|
-
export type TyphoTypes = "h1" | "h1Bold" | "h1ExtraBold" | "h2" | "h2Bold" | "h2ExtraBold" | "h10" | "h10Bold" | "h10ExtraBold" | "h6" | "h6Bold" | "h6ExtraBold";
|
|
37
|
+
export type TyphoTypes = "h1" | "h1Bold" | "h1ExtraBold" | "h2" | "h2Bold" | "h2ExtraBold" | "h10" | "h10Bold" | "h10ExtraBold" | "h6" | "h6Bold" | "h6ExtraBold" | "header1" | "header2" | "label1" | "label2";
|
|
38
38
|
export type TyphoComponents = "p" | "span" | "em" | "div" | undefined;
|
|
39
|
+
export type MessageTypes = "warning" | "success" | "error" | "disabled" | "highlight" | "nutral";
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import React$1 from 'react';
|
|
|
3
3
|
|
|
4
4
|
type AlignmentType = "center" | "left" | "right";
|
|
5
5
|
type IconColorTypes = "white" | "black-900" | "gray-220" | "gray-720" | "inherit" | "gray-300" | string;
|
|
6
|
-
type IconType = "Home" | "Info" | "RightArrow" | "DropDown" | "DropDownArrow" | "WhiteArrow" | "TrashIcon" | "AddNewitemIcon" | "OkIcon" | "EditIcon" | "Delete" | "AddIcon" | "RemoveTrashIcon" | "RoundTickIcon" | "ValidationWarningIcon" | "WarningIcon" | "NeturalIcon" | "SuccessIcon" | string;
|
|
6
|
+
type IconType = "Home" | "Info" | "Email" | "RightArrow" | "DropDown" | "DropDownArrow" | "WhiteArrow" | "TrashIcon" | "AddNewitemIcon" | "OkIcon" | "EditIcon" | "Delete" | "AddIcon" | "RemoveTrashIcon" | "RoundTickIcon" | "ValidationWarningIcon" | "WarningIcon" | "NeturalIcon" | "SuccessIcon" | string;
|
|
7
7
|
interface ChildrenProp {
|
|
8
8
|
/**
|
|
9
9
|
* Se the child node and element;
|
|
@@ -29,7 +29,7 @@ interface AdditionalClassesProp {
|
|
|
29
29
|
interface OnClickEventProps {
|
|
30
30
|
onClick?: () => void;
|
|
31
31
|
}
|
|
32
|
-
type TyphoTypes = "h1" | "h1Bold" | "h1ExtraBold" | "h2" | "h2Bold" | "h2ExtraBold" | "h10" | "h10Bold" | "h10ExtraBold" | "h6" | "h6Bold" | "h6ExtraBold";
|
|
32
|
+
type TyphoTypes = "h1" | "h1Bold" | "h1ExtraBold" | "h2" | "h2Bold" | "h2ExtraBold" | "h10" | "h10Bold" | "h10ExtraBold" | "h6" | "h6Bold" | "h6ExtraBold" | "header1" | "header2" | "label1" | "label2";
|
|
33
33
|
type TyphoComponents = "p" | "span" | "em" | "div" | undefined;
|
|
34
34
|
|
|
35
35
|
interface ButtonProps extends ChildrenProp, AdditionalClassesProp, IconTypeProp, OnClickEventProps {
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dfh-ui-library",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"rollup": "rollup -c --bundleConfigAsCjs",
|
|
7
7
|
"storybook": "storybook dev -p 6006",
|
|
8
|
-
"build-storybook": "storybook build"
|
|
8
|
+
"build-storybook": "storybook build",
|
|
9
|
+
"test": "jest"
|
|
9
10
|
},
|
|
10
11
|
"author": "DFH dev",
|
|
11
12
|
"license": "ISC",
|
|
@@ -44,19 +45,29 @@
|
|
|
44
45
|
"@storybook/react": "^7.5.3",
|
|
45
46
|
"@storybook/react-webpack5": "^7.5.3",
|
|
46
47
|
"@storybook/testing-library": "^0.2.2",
|
|
48
|
+
"@testing-library/jest-dom": "^6.1.4",
|
|
49
|
+
"@testing-library/react": "^14.1.2",
|
|
50
|
+
"@testing-library/user-event": "^14.5.1",
|
|
51
|
+
"@types/jest": "^29.5.9",
|
|
52
|
+
"@typescript-eslint/eslint-plugin": "^6.12.0",
|
|
53
|
+
"@typescript-eslint/parser": "^6.12.0",
|
|
47
54
|
"autoprefixer": "^10.4.16",
|
|
48
55
|
"cssnano": "^6.0.1",
|
|
56
|
+
"eslint": "^8.54.0",
|
|
57
|
+
"eslint-plugin-react": "^7.33.2",
|
|
58
|
+
"jest": "^29.7.0",
|
|
59
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
60
|
+
"postcss": "^8.4.31",
|
|
61
|
+
"postcss-cssnext": "^3.1.1",
|
|
62
|
+
"postcss-import": "^15.1.0",
|
|
63
|
+
"postcss-loader": "^7.3.3",
|
|
49
64
|
"rollup": "^4.5.0",
|
|
50
65
|
"rollup-plugin-css-only": "^4.5.2",
|
|
51
66
|
"rollup-plugin-dts": "^6.1.0",
|
|
52
67
|
"rollup-plugin-postcss": "^4.0.2",
|
|
53
68
|
"storybook": "^7.5.3",
|
|
54
69
|
"sugarss": "^4.0.1",
|
|
55
|
-
"vite": "^5.0.0"
|
|
56
|
-
"postcss": "^8.4.31",
|
|
57
|
-
"postcss-cssnext": "^3.1.1",
|
|
58
|
-
"postcss-import": "^15.1.0",
|
|
59
|
-
"postcss-loader": "^7.3.3"
|
|
70
|
+
"vite": "^5.0.0"
|
|
60
71
|
},
|
|
61
72
|
"main": "dist/cjs/index.js",
|
|
62
73
|
"module": "dist/esm/index.js",
|