dfh-ui-library 1.1.2 → 1.1.4

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.
Files changed (39) hide show
  1. package/README.md +6 -0
  2. package/dist/cjs/index.css +1 -1
  3. package/dist/cjs/index.css.map +1 -1
  4. package/dist/cjs/index.js +2 -2
  5. package/dist/cjs/index.js.map +1 -1
  6. package/dist/cjs/types/components/Button/Button.handler.d.ts +1 -1
  7. package/dist/cjs/types/components/Button/Button.test.d.ts +1 -0
  8. package/dist/cjs/types/components/FormElements/Input/Input.d.ts +7 -0
  9. package/dist/cjs/types/components/FormElements/Input/Input.test.d.ts +1 -0
  10. package/dist/cjs/types/components/FormElements/Input/index.d.ts +1 -0
  11. package/dist/cjs/types/components/Media/Icon/Icon.d.ts +11 -0
  12. package/dist/cjs/types/components/Media/Icon/Icon.handler.d.ts +4 -0
  13. package/dist/cjs/types/components/Media/Icons/Icons.d.ts +4 -0
  14. package/dist/cjs/types/components/Typhography/Typhography.handler.d.ts +1 -1
  15. package/dist/cjs/types/components/index.d.ts +1 -0
  16. package/dist/cjs/types/shared/configs/componentsClasses.d.ts +83 -0
  17. package/dist/cjs/types/shared/models/components/base.model.d.ts +89 -1
  18. package/dist/cjs/types/shared/models/components/common.model.d.ts +3 -2
  19. package/dist/cjs/types/shared/utilities/images.d.ts +3 -0
  20. package/dist/esm/index.css +1 -1
  21. package/dist/esm/index.css.map +1 -1
  22. package/dist/esm/index.js +3 -3
  23. package/dist/esm/index.js.map +1 -1
  24. package/dist/esm/types/components/Button/Button.handler.d.ts +1 -1
  25. package/dist/esm/types/components/Button/Button.test.d.ts +1 -0
  26. package/dist/esm/types/components/FormElements/Input/Input.d.ts +7 -0
  27. package/dist/esm/types/components/FormElements/Input/Input.test.d.ts +1 -0
  28. package/dist/esm/types/components/FormElements/Input/index.d.ts +1 -0
  29. package/dist/esm/types/components/Media/Icon/Icon.d.ts +11 -0
  30. package/dist/esm/types/components/Media/Icon/Icon.handler.d.ts +4 -0
  31. package/dist/esm/types/components/Media/Icons/Icons.d.ts +4 -0
  32. package/dist/esm/types/components/Typhography/Typhography.handler.d.ts +1 -1
  33. package/dist/esm/types/components/index.d.ts +1 -0
  34. package/dist/esm/types/shared/configs/componentsClasses.d.ts +83 -0
  35. package/dist/esm/types/shared/models/components/base.model.d.ts +89 -1
  36. package/dist/esm/types/shared/models/components/common.model.d.ts +3 -2
  37. package/dist/esm/types/shared/utilities/images.d.ts +3 -0
  38. package/dist/index.d.ts +76 -4
  39. 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-primary-500" | "text-16s h-[52px] text-primary-500 border border-solid border-primary-500 bg-white" | "text-14s h-9 text-white border-solid border-primary-500 bg-primary-500" | "text-14s h-9 text-primary-500 border border-solid border-primary-500 bg-white" | "text-14s h-7 text-white border-solid border-primary-500 bg-primary-500" | "text-14s h-7 text-primary-500 border border-solid border-primary-500 bg-white" | "text-16s h-11 text-primary-500 border border-solid border-primary-500 bg-white" | "text-16s h-11 text-white border-solid border-primary-500 bg-primary-500" | undefined;
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,7 @@
1
+ import { FC } from "react";
2
+ import { HookFormsInputProps } from "../../../shared/models/components/base.model";
3
+ /**
4
+ * Primary UI component for user interaction
5
+ */
6
+ declare const Input: FC<HookFormsInputProps>;
7
+ export default Input;
@@ -0,0 +1 @@
1
+ import "@testing-library/jest-dom";
@@ -0,0 +1 @@
1
+ export { default } from "./Input";
@@ -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;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ export declare const HomeIcon: () => React.JSX.Element;
3
+ export declare const EmailIcon: () => React.JSX.Element;
4
+ export declare const RightArrowIcon: () => React.JSX.Element;
@@ -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;
@@ -1,3 +1,4 @@
1
1
  import "../index.css";
2
2
  export { default as Button } from "./Button";
3
3
  export { default as Typhography } from "./Typhography";
4
+ export { default as Input } from "./FormElements/Input";
@@ -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,5 @@
1
- import { AdditionalClassesProp, ChildrenProp, IconTypeProp, AlignmentType, OnClickEventProps, TyphoTypes, TyphoComponents } from "./common.model";
1
+ import { InputHTMLAttributes } from "react";
2
+ import { AdditionalClassesProp, ChildrenProp, IconTypeProp, AlignmentType, OnClickEventProps, TyphoTypes, TyphoComponents, IconHoverColorTypes } from "./common.model";
2
3
  export interface ButtonProps extends ChildrenProp, AdditionalClassesProp, IconTypeProp, OnClickEventProps {
3
4
  /**
4
5
  * Set the button type
@@ -44,3 +45,90 @@ export interface TyphographyProps extends ChildrenProp, AdditionalClassesProp {
44
45
  color?: string;
45
46
  onClick?: () => void;
46
47
  }
48
+ export interface IconProps extends AdditionalClassesProp, IconTypeProp {
49
+ /**
50
+ * Optional | Set Icon Text
51
+ */
52
+ iconText?: string;
53
+ /**
54
+ * Optional | Set Icon hover color
55
+ */
56
+ iconHoverColor?: IconHoverColorTypes;
57
+ /**
58
+ * Optional | Set Icon container classes
59
+ */
60
+ iconContainerClasses?: string | undefined;
61
+ /**
62
+ * Optional | Set Icon Text classes
63
+ */
64
+ iconTextClasses?: string | undefined;
65
+ onClick?: any;
66
+ }
67
+ type InputType = "text" | "email" | "password" | "name" | "date";
68
+ export interface HookFormsInputProps extends InputHTMLAttributes<HTMLInputElement> {
69
+ /**
70
+ * Set Input type
71
+ */
72
+ type?: InputType;
73
+ /**
74
+ * Set new variant of the input
75
+ */
76
+ inputVariant?: "default" | "large";
77
+ /**
78
+ * Set Input name
79
+ */
80
+ id?: string;
81
+ /**
82
+ * Set Input name
83
+ */
84
+ labelName?: string;
85
+ /**
86
+ * Set the Label Type
87
+ */
88
+ labelType?: "default" | "black" | "smallSelect" | "blackSmall";
89
+ /**
90
+ * Set Input label name
91
+ */
92
+ label?: string | undefined;
93
+ /**
94
+ * Ser Error message
95
+ */
96
+ error?: string;
97
+ /**
98
+ * Ser Error message
99
+ */
100
+ isBorderedError?: boolean;
101
+ /**
102
+ * Set Wrapper classes, new classes will overide the existing default classes
103
+ */
104
+ wrapperClass?: string | undefined;
105
+ /**
106
+ * Optional for additional classes
107
+ */
108
+ additionalClasses?: string | undefined;
109
+ /**
110
+ * Enable read only
111
+ */
112
+ readonly?: boolean;
113
+ /**
114
+ * LabelClasses
115
+ */
116
+ labelClasses?: string | undefined;
117
+ onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
118
+ placeholder?: string;
119
+ /**
120
+ * Set label only
121
+ */
122
+ onlyLabel?: boolean | undefined;
123
+ /**
124
+ * inner span Classes
125
+ */
126
+ labelSpanClasses?: string;
127
+ /**
128
+ * add additional InputValidation Classes
129
+ */
130
+ additionalErrorClasses?: string;
131
+ isAdditionalErrorInput?: boolean;
132
+ fullError?: boolean;
133
+ }
134
+ export {};
@@ -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";
@@ -0,0 +1,3 @@
1
+ export declare const Images: {};
2
+ export declare const Flags: {};
3
+ export declare const LargeIcons: {};
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
- import React$1 from 'react';
2
+ import React$1, { InputHTMLAttributes, FC } 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 {
@@ -77,6 +77,73 @@ interface TyphographyProps extends ChildrenProp, AdditionalClassesProp {
77
77
  color?: string;
78
78
  onClick?: () => void;
79
79
  }
80
+ type InputType = "text" | "email" | "password" | "name" | "date";
81
+ interface HookFormsInputProps extends InputHTMLAttributes<HTMLInputElement> {
82
+ /**
83
+ * Set Input type
84
+ */
85
+ type?: InputType;
86
+ /**
87
+ * Set new variant of the input
88
+ */
89
+ inputVariant?: "default" | "large";
90
+ /**
91
+ * Set Input name
92
+ */
93
+ id?: string;
94
+ /**
95
+ * Set Input name
96
+ */
97
+ labelName?: string;
98
+ /**
99
+ * Set the Label Type
100
+ */
101
+ labelType?: "default" | "black" | "smallSelect" | "blackSmall";
102
+ /**
103
+ * Set Input label name
104
+ */
105
+ label?: string | undefined;
106
+ /**
107
+ * Ser Error message
108
+ */
109
+ error?: string;
110
+ /**
111
+ * Ser Error message
112
+ */
113
+ isBorderedError?: boolean;
114
+ /**
115
+ * Set Wrapper classes, new classes will overide the existing default classes
116
+ */
117
+ wrapperClass?: string | undefined;
118
+ /**
119
+ * Optional for additional classes
120
+ */
121
+ additionalClasses?: string | undefined;
122
+ /**
123
+ * Enable read only
124
+ */
125
+ readonly?: boolean;
126
+ /**
127
+ * LabelClasses
128
+ */
129
+ labelClasses?: string | undefined;
130
+ onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
131
+ placeholder?: string;
132
+ /**
133
+ * Set label only
134
+ */
135
+ onlyLabel?: boolean | undefined;
136
+ /**
137
+ * inner span Classes
138
+ */
139
+ labelSpanClasses?: string;
140
+ /**
141
+ * add additional InputValidation Classes
142
+ */
143
+ additionalErrorClasses?: string;
144
+ isAdditionalErrorInput?: boolean;
145
+ fullError?: boolean;
146
+ }
80
147
 
81
148
  declare const Button: ({ type, isDisabled, buttonLabel, iconType, iconColor, iconAlignment, isIconEnabled, variants, additionalClasses, iconClass, onClick, }: ButtonProps) => React$1.JSX.Element;
82
149
 
@@ -85,4 +152,9 @@ declare const Button: ({ type, isDisabled, buttonLabel, iconType, iconColor, ico
85
152
  */
86
153
  declare const Typhography: ({ type, component, color, additionalClasses, children, onClick, ...rest }: TyphographyProps) => React$1.JSX.Element;
87
154
 
88
- export { Button, Typhography };
155
+ /**
156
+ * Primary UI component for user interaction
157
+ */
158
+ declare const Input: FC<HookFormsInputProps>;
159
+
160
+ export { Button, Input, Typhography };
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "dfh-ui-library",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
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",