@sikka/hawa 0.0.283 → 0.0.284
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/dist/styles.css +0 -3
- package/es/index.es.js +2 -2
- package/lib/index.js +2 -2
- package/package.json +2 -1
- package/src/elements/HawaPhoneInput.tsx +7 -5
- package/src/elements/HawaSelect.tsx +7 -5
- package/src/elements/HawaSnackbar.tsx +2 -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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sikka/hawa",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.284",
|
|
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",
|
|
@@ -80,11 +80,13 @@ export const HawaPhoneInput: FC<HawaPhoneInputTypes> = (props) => {
|
|
|
80
80
|
<div dir="ltr" className="flex flex-row ">
|
|
81
81
|
<Select
|
|
82
82
|
classNames={{
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
// container: () => "cursor-pointer z-10 border rounded-l bg-background",
|
|
84
|
+
control: () =>
|
|
85
|
+
"w-[64px] text-right pr-2 cursor-pointer z-10 border rounded-l bg-background",
|
|
86
|
+
placeholder: (state) => "text-muted-foreground text-right ",
|
|
85
87
|
input: (state) =>
|
|
86
|
-
"bg-transparent text-white
|
|
87
|
-
valueContainer: () => "
|
|
88
|
+
"bg-transparent cursor-pointer dark:text-white p-2 rounded-l text-[0.875rem] ",
|
|
89
|
+
valueContainer: () => "rounded-l h-auto text-[0.875rem]",
|
|
88
90
|
// container: () => "bg-orange-400 border-none",
|
|
89
91
|
// control: () => "bg-blue-500",
|
|
90
92
|
// menu: () => "bg-red-900",
|
|
@@ -155,7 +157,7 @@ export const HawaPhoneInput: FC<HawaPhoneInputTypes> = (props) => {
|
|
|
155
157
|
placeholder="531045453"
|
|
156
158
|
// text-gray-900 dark:text-gray-300
|
|
157
159
|
// 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
|
|
160
|
+
className="block w-full appearance-none rounded rounded-l-none border border-l-0
|
|
159
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 && (
|
|
@@ -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"
|
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
|
+
}
|