@sikka/hawa 0.0.283 → 0.0.285
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/.github/workflows/hawa-actions.yml +1 -1
- package/.github/workflows/hawa-publish-push.yml +19 -21
- package/build-storybook.log +381 -0
- package/dist/styles.css +0 -3
- package/es/elements/HawaButton.d.ts +1 -0
- package/es/index.es.js +3 -3
- package/es/stories/ManualStories/BlocksIntroduction.stories.d.ts +20 -0
- package/es/stories/ManualStories/Customization.stories.d.ts +20 -0
- package/es/stories/ManualStories/ElementsIntroduction.stories.d.ts +20 -0
- package/es/stories/ManualStories/Installation.stories.d.ts +20 -0
- package/es/stories/ManualStories/LayoutIntroduction.stories.d.ts +20 -0
- package/es/stories/ManualStories/Overview.stories.d.ts +9 -8
- package/es/stories/ManualStories/Usage.stories.d.ts +20 -0
- package/lib/elements/HawaButton.d.ts +1 -0
- package/lib/index.js +3 -3
- package/lib/stories/ManualStories/BlocksIntroduction.stories.d.ts +20 -0
- package/lib/stories/ManualStories/Customization.stories.d.ts +20 -0
- package/lib/stories/ManualStories/ElementsIntroduction.stories.d.ts +20 -0
- package/lib/stories/ManualStories/Installation.stories.d.ts +20 -0
- package/lib/stories/ManualStories/LayoutIntroduction.stories.d.ts +20 -0
- package/lib/stories/ManualStories/Overview.stories.d.ts +9 -8
- package/lib/stories/ManualStories/Usage.stories.d.ts +20 -0
- package/package.json +3 -1
- package/src/blocks/Account/UserProfileForm.tsx +2 -42
- package/src/elements/HawaButton.tsx +3 -1
- package/src/elements/HawaPhoneInput.tsx +11 -9
- package/src/elements/HawaSelect.tsx +7 -5
- package/src/elements/HawaSnackbar.tsx +2 -1
- package/src/elements/HawaTextField.tsx +1 -1
- package/src/styles.css +0 -3
- package/src/translations/ar.json +22 -0
- package/src/translations/en.json +22 -0
- package/src/translations/i18n.js +15 -0
|
@@ -1 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import "../stories-styles.css";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
parameters: {
|
|
5
|
+
chromatic: {
|
|
6
|
+
disableSnapshot: boolean;
|
|
7
|
+
};
|
|
8
|
+
controls: {
|
|
9
|
+
expand: boolean;
|
|
10
|
+
disable: boolean;
|
|
11
|
+
hideNoControlsWarning: boolean;
|
|
12
|
+
exclude: any[];
|
|
13
|
+
};
|
|
14
|
+
options: {
|
|
15
|
+
showPanel: boolean;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
title: string;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
21
|
+
export declare const Introduction: () => React.JSX.Element;
|
|
@@ -1 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import "../stories-styles.css";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
parameters: {
|
|
5
|
+
chromatic: {
|
|
6
|
+
disableSnapshot: boolean;
|
|
7
|
+
};
|
|
8
|
+
controls: {
|
|
9
|
+
expand: boolean;
|
|
10
|
+
disable: boolean;
|
|
11
|
+
hideNoControlsWarning: boolean;
|
|
12
|
+
exclude: any[];
|
|
13
|
+
};
|
|
14
|
+
options: {
|
|
15
|
+
showPanel: boolean;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
title: string;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
21
|
+
export declare const Customization: () => React.JSX.Element;
|
|
@@ -1 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import "../stories-styles.css";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
parameters: {
|
|
5
|
+
chromatic: {
|
|
6
|
+
disableSnapshot: boolean;
|
|
7
|
+
};
|
|
8
|
+
controls: {
|
|
9
|
+
expand: boolean;
|
|
10
|
+
disable: boolean;
|
|
11
|
+
hideNoControlsWarning: boolean;
|
|
12
|
+
exclude: any[];
|
|
13
|
+
};
|
|
14
|
+
options: {
|
|
15
|
+
showPanel: boolean;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
title: string;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
21
|
+
export declare const Introduction: () => React.JSX.Element;
|
|
@@ -1 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import "../stories-styles.css";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
parameters: {
|
|
5
|
+
chromatic: {
|
|
6
|
+
disableSnapshot: boolean;
|
|
7
|
+
};
|
|
8
|
+
controls: {
|
|
9
|
+
expand: boolean;
|
|
10
|
+
disable: boolean;
|
|
11
|
+
hideNoControlsWarning: boolean;
|
|
12
|
+
exclude: any[];
|
|
13
|
+
};
|
|
14
|
+
options: {
|
|
15
|
+
showPanel: boolean;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
title: string;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
21
|
+
export declare const Installation: () => React.JSX.Element;
|
|
@@ -1 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import "../stories-styles.css";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
parameters: {
|
|
5
|
+
chromatic: {
|
|
6
|
+
disableSnapshot: boolean;
|
|
7
|
+
};
|
|
8
|
+
controls: {
|
|
9
|
+
expand: boolean;
|
|
10
|
+
disable: boolean;
|
|
11
|
+
hideNoControlsWarning: boolean;
|
|
12
|
+
exclude: any[];
|
|
13
|
+
};
|
|
14
|
+
options: {
|
|
15
|
+
showPanel: boolean;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
title: string;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
21
|
+
export declare const Introduction: () => React.JSX.Element;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "../stories-styles.css";
|
|
3
3
|
declare const _default: {
|
|
4
|
-
controls: {
|
|
5
|
-
hideNoControlsWarning: boolean;
|
|
6
|
-
exclude: any[];
|
|
7
|
-
};
|
|
8
4
|
parameters: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
visibility: string;
|
|
5
|
+
chromatic: {
|
|
6
|
+
disableSnapshot: boolean;
|
|
12
7
|
};
|
|
13
|
-
|
|
8
|
+
controls: {
|
|
9
|
+
expand: boolean;
|
|
10
|
+
disable: boolean;
|
|
11
|
+
hideNoControlsWarning: boolean;
|
|
12
|
+
exclude: any[];
|
|
13
|
+
};
|
|
14
|
+
customIcon: () => React.JSX.Element;
|
|
14
15
|
options: {
|
|
15
16
|
showPanel: boolean;
|
|
16
17
|
};
|
|
@@ -1 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import "../stories-styles.css";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
parameters: {
|
|
5
|
+
chromatic: {
|
|
6
|
+
disableSnapshot: boolean;
|
|
7
|
+
};
|
|
8
|
+
controls: {
|
|
9
|
+
expand: boolean;
|
|
10
|
+
disable: boolean;
|
|
11
|
+
hideNoControlsWarning: boolean;
|
|
12
|
+
exclude: any[];
|
|
13
|
+
};
|
|
14
|
+
options: {
|
|
15
|
+
showPanel: boolean;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
title: string;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
21
|
+
export declare const Usage: () => React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sikka/hawa",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.285",
|
|
4
4
|
"description": "SaaS Oriented UI Kit",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.es.js",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"@storybook/addon-links": "^6.5.8",
|
|
47
47
|
"@storybook/addon-postcss": "^2.0.0",
|
|
48
48
|
"@storybook/addons": "^6.5.8",
|
|
49
|
+
"@storybook/api": "^7.3.2",
|
|
49
50
|
"@storybook/builder-webpack5": "^6.5.13",
|
|
50
51
|
"@storybook/manager-webpack5": "^6.5.13",
|
|
51
52
|
"@storybook/react": "^6.5.8",
|
|
@@ -55,6 +56,7 @@
|
|
|
55
56
|
"@types/react": "^18.0.25",
|
|
56
57
|
"@types/react-dom": "^18.0.9",
|
|
57
58
|
"babel-loader": "^8.2.2",
|
|
59
|
+
"chromatic": "^6.22.0",
|
|
58
60
|
"framer-motion": "^4.1.7",
|
|
59
61
|
"html-webpack-plugin": "^5.5.0",
|
|
60
62
|
"postcss": "^8.4.18",
|
|
@@ -83,6 +83,7 @@ export const UserProfileForm: FC<UserProfileFormTypes> = (props) => {
|
|
|
83
83
|
required: props.texts.passwordRequiredText,
|
|
84
84
|
}}
|
|
85
85
|
/>
|
|
86
|
+
|
|
86
87
|
<Controller
|
|
87
88
|
control={control}
|
|
88
89
|
name="confirmPassword"
|
|
@@ -101,49 +102,8 @@ export const UserProfileForm: FC<UserProfileFormTypes> = (props) => {
|
|
|
101
102
|
required: props.texts.confirmPasswordRequiredText,
|
|
102
103
|
}}
|
|
103
104
|
/>
|
|
104
|
-
{inputs.length > 0 &&
|
|
105
|
-
inputs.map((singleInput: any) => {
|
|
106
|
-
if (singleInput.type === "textArea") {
|
|
107
|
-
return (
|
|
108
|
-
<Controller
|
|
109
|
-
control={control}
|
|
110
|
-
name={singleInput.name}
|
|
111
|
-
render={({ field }) => (
|
|
112
|
-
<HawaTextField
|
|
113
|
-
width="full"
|
|
114
|
-
type="text"
|
|
115
|
-
defaultValue={singleInput.defaultValue ?? null}
|
|
116
|
-
label={singleInput.label ?? null}
|
|
117
|
-
placeholder={singleInput.placeHolder ?? null}
|
|
118
|
-
/>
|
|
119
|
-
)}
|
|
120
|
-
rules={singleInput.rules ?? null}
|
|
121
|
-
/>
|
|
122
|
-
)
|
|
123
|
-
}
|
|
124
|
-
return (
|
|
125
|
-
<Controller
|
|
126
|
-
control={control}
|
|
127
|
-
name={singleInput.name}
|
|
128
|
-
render={({ field }) => (
|
|
129
|
-
<HawaTextField
|
|
130
|
-
width="full"
|
|
131
|
-
type={singleInput.type}
|
|
132
|
-
defaultValue={singleInput.defaultValue ?? null}
|
|
133
|
-
label={singleInput.label ?? null}
|
|
134
|
-
placeholder={singleInput.placeHolder ?? null}
|
|
135
|
-
/>
|
|
136
|
-
)}
|
|
137
|
-
rules={singleInput.rules ?? null}
|
|
138
|
-
/>
|
|
139
|
-
)
|
|
140
|
-
})}
|
|
141
105
|
|
|
142
|
-
<HawaButton
|
|
143
|
-
color="primary"
|
|
144
|
-
width="full"
|
|
145
|
-
// type="submit"
|
|
146
|
-
>
|
|
106
|
+
<HawaButton color="primary" width="full">
|
|
147
107
|
{props.texts.updateProfile}
|
|
148
108
|
</HawaButton>
|
|
149
109
|
</form>
|
|
@@ -27,6 +27,7 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
27
27
|
isLoading?: boolean
|
|
28
28
|
badge?: any
|
|
29
29
|
edgeCorner?: any
|
|
30
|
+
disabled?: boolean
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
const disabledSyles = "cursor-default pointer-events-none"
|
|
@@ -71,7 +72,8 @@ const colorStyles = {
|
|
|
71
72
|
dark: "text-neutral-900 bg-gray-200 hover:bg-gray-300",
|
|
72
73
|
},
|
|
73
74
|
outlined: {
|
|
74
|
-
default:
|
|
75
|
+
default:
|
|
76
|
+
"text-gray-600 border-gray-600 hover:bg-gray-200 dark:hover:bg-gray-800 dark:text-white",
|
|
75
77
|
primary: "text-black hover:bg-gray-50 dark:text-white",
|
|
76
78
|
secondary:
|
|
77
79
|
" dark:text-white text-secondary-800 border-secondary-800 hover:bg-buttonSecondary-700 hover:text-white",
|
|
@@ -73,18 +73,18 @@ export const HawaPhoneInput: FC<HawaPhoneInputTypes> = (props) => {
|
|
|
73
73
|
return (
|
|
74
74
|
<div className="mb-3 flex flex-col">
|
|
75
75
|
{props.label && (
|
|
76
|
-
<label className="mb-2 block text-sm font-medium
|
|
77
|
-
{props.label}
|
|
78
|
-
</label>
|
|
76
|
+
<label className="mb-2 block text-sm font-medium">{props.label}</label>
|
|
79
77
|
)}
|
|
80
78
|
<div dir="ltr" className="flex flex-row ">
|
|
81
79
|
<Select
|
|
82
80
|
classNames={{
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
// container: () => "cursor-pointer z-10 border rounded-l bg-background",
|
|
82
|
+
control: () =>
|
|
83
|
+
"w-[64px] text-right pr-2 cursor-pointer z-10 border rounded-l bg-background",
|
|
84
|
+
placeholder: (state) => "text-muted-foreground text-right ",
|
|
85
85
|
input: (state) =>
|
|
86
|
-
"bg-transparent text-white
|
|
87
|
-
valueContainer: () => "
|
|
86
|
+
"bg-transparent cursor-pointer dark:text-white p-2 rounded-l text-[0.875rem] ",
|
|
87
|
+
valueContainer: () => "rounded-l h-auto text-[0.875rem]",
|
|
88
88
|
// container: () => "bg-orange-400 border-none",
|
|
89
89
|
// control: () => "bg-blue-500",
|
|
90
90
|
// menu: () => "bg-red-900",
|
|
@@ -155,8 +155,10 @@ export const HawaPhoneInput: FC<HawaPhoneInputTypes> = (props) => {
|
|
|
155
155
|
placeholder="531045453"
|
|
156
156
|
// text-gray-900 dark:text-gray-300
|
|
157
157
|
// dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500
|
|
158
|
-
className="block w-full
|
|
159
|
-
|
|
158
|
+
className="block w-full rounded-r border bg-background p-2 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500"
|
|
159
|
+
|
|
160
|
+
// className="block w-full appearance-none rounded rounded-l-none border border-l-0
|
|
161
|
+
// bg-background p-2 text-[0.875rem] text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:text-white "
|
|
160
162
|
/>
|
|
161
163
|
{props.helperText && (
|
|
162
164
|
<p className="mb-1 mt-1 text-xs text-red-600 dark:text-red-500">
|
|
@@ -116,7 +116,7 @@ type SelectTypes = {
|
|
|
116
116
|
}
|
|
117
117
|
export const HawaSelect: FC<SelectTypes> = (props) => {
|
|
118
118
|
return (
|
|
119
|
-
<div className=" w-
|
|
119
|
+
<div className=" w-full">
|
|
120
120
|
{props.label && (
|
|
121
121
|
<div className="mb-2 block text-sm font-medium text-gray-900 dark:text-gray-300">
|
|
122
122
|
{props.label}
|
|
@@ -125,12 +125,14 @@ export const HawaSelect: FC<SelectTypes> = (props) => {
|
|
|
125
125
|
{!props.isCreatable && (
|
|
126
126
|
<Select
|
|
127
127
|
classNames={{
|
|
128
|
-
// control: () => "
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
// control: () => "bg-blue-500 w-full",
|
|
129
|
+
// container: () => "bg-red-500 w-full",
|
|
130
|
+
placeholder: () => "px-2 text-muted-foreground",
|
|
131
|
+
input: () => "text-white px-2",
|
|
131
132
|
valueContainer: () => "text-white dark:text-muted-foreground",
|
|
132
133
|
singleValue: () => "text-black dark:text-white px-2",
|
|
133
|
-
indicatorsContainer: () =>
|
|
134
|
+
indicatorsContainer: () =>
|
|
135
|
+
" px-2 cursor-pointer text-muted-foreground",
|
|
134
136
|
}}
|
|
135
137
|
unstyled
|
|
136
138
|
isDisabled={props.disabled}
|
|
@@ -108,7 +108,7 @@ export const HawaSnackbar: FC<THawaSnackBar> = ({
|
|
|
108
108
|
</div>
|
|
109
109
|
<button
|
|
110
110
|
type="button"
|
|
111
|
-
className="right-0 inline-flex h-8 w-8 rounded p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-900 focus:ring-2 focus:ring-gray-300 dark:bg-gray-800 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-white"
|
|
111
|
+
className="right-0 inline-flex h-8 w-8 rounded p-1.5 text-gray-400 transition-all hover:bg-gray-100 hover:text-gray-900 focus:ring-2 focus:ring-gray-300 dark:bg-gray-800 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-white"
|
|
112
112
|
data-dismiss-target="#toast-default"
|
|
113
113
|
aria-label="Close"
|
|
114
114
|
onClick={() => {
|
|
@@ -118,6 +118,7 @@ export const HawaSnackbar: FC<THawaSnackBar> = ({
|
|
|
118
118
|
>
|
|
119
119
|
<span className="sr-only">Close</span>
|
|
120
120
|
<svg
|
|
121
|
+
aria-label="Close Button"
|
|
121
122
|
aria-hidden="true"
|
|
122
123
|
className="h-5 w-5"
|
|
123
124
|
fill="currentColor"
|
|
@@ -64,7 +64,7 @@ export const HawaTextField: FC<TextFieldTypes> = ({
|
|
|
64
64
|
{props.label && (
|
|
65
65
|
<label
|
|
66
66
|
// htmlFor="first_name"
|
|
67
|
-
className="mb-2 block text-sm font-medium
|
|
67
|
+
className="mb-2 block text-sm font-medium "
|
|
68
68
|
>
|
|
69
69
|
{props.label}
|
|
70
70
|
</label>
|
package/src/styles.css
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"plain": "سادة",
|
|
3
|
+
"plain-subtitle": "هذا إشعار يظهر لما نبغى نعطي المستخدم خبر عن حدوث شيء معين",
|
|
4
|
+
"emailLabel": "البريد الإلكتروني",
|
|
5
|
+
"emailPlaceholder": "ادخل البريد الإلكتروني",
|
|
6
|
+
"emailRequiredText": "البريد الإلكتروني مطلوب",
|
|
7
|
+
"emailInvalidText": "البريد الإلكتروني غير صحيح",
|
|
8
|
+
"usernameLabel": "اسم المستخدم",
|
|
9
|
+
"usernamePlaceholder": "ادخل المستخدم",
|
|
10
|
+
"usernameRequired": " اسم المستخدم مطلوب",
|
|
11
|
+
"phoneRequiredText": "رقم الجوال مطلوب",
|
|
12
|
+
"passwordLabel": "كلمة المرور",
|
|
13
|
+
"passwordPlaceholder": "أدخل كلمة المرور",
|
|
14
|
+
"passwordRequiredText": "كبمة المرور مطلوبة",
|
|
15
|
+
"forgotPasswordText": "نسيت كلمة المرور؟",
|
|
16
|
+
"newUserText": "مستخدم جديد؟",
|
|
17
|
+
"signUpText": "تسجيل جديد",
|
|
18
|
+
"signInText": "تسجيل الدخول",
|
|
19
|
+
"googleButtonLabel": "Sign in with Google",
|
|
20
|
+
"githubButtonLabel": "Sign in with Github",
|
|
21
|
+
"twitterButtonLabel": "Sign in with Twitter"
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"plain": "Plain",
|
|
3
|
+
"plain-subtitle": "This is an snackbar-style notification in plain style",
|
|
4
|
+
"emailLabel": "Email",
|
|
5
|
+
"emailPlaceholder": "Enter your email",
|
|
6
|
+
"emailRequiredText": "Email is required",
|
|
7
|
+
"emailInvalidText": "Invalid email address",
|
|
8
|
+
"usernameLabel": "Username",
|
|
9
|
+
"usernamePlaceholder": "Enter your username",
|
|
10
|
+
"usernameRequired": " Username is required",
|
|
11
|
+
"phoneRequiredText": "Phone is required",
|
|
12
|
+
"passwordLabel": "Password",
|
|
13
|
+
"passwordPlaceholder": "Enter password",
|
|
14
|
+
"passwordRequiredText": "Password is required",
|
|
15
|
+
"forgotPasswordText": "Forgot password?",
|
|
16
|
+
"newUserText": "New user?",
|
|
17
|
+
"signUpText": "Sign up",
|
|
18
|
+
"signInText": "Sign in",
|
|
19
|
+
"googleButtonLabel": "Sign in with Google",
|
|
20
|
+
"githubButtonLabel": "Sign in with Github",
|
|
21
|
+
"twitterButtonLabel": "Sign in with Twitter"
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const translations = {
|
|
2
|
+
en: require("./en.json"),
|
|
3
|
+
ar: require("./ar.json")
|
|
4
|
+
// ... you can add more languages here.
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
let currentLocale = "en"; // default language
|
|
8
|
+
|
|
9
|
+
export function setLocale(locale) {
|
|
10
|
+
currentLocale = locale;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function t(key) {
|
|
14
|
+
return translations[currentLocale][key] || key;
|
|
15
|
+
}
|