@sikka/hawa 0.0.281 → 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 +51 -41
- package/.github/workflows/hawa-publish-push.yml +19 -21
- package/dist/styles.css +9 -3
- package/es/index.es.js +2 -2
- package/es/stories/ManualStories/Overview.stories.d.ts +20 -0
- package/lib/index.js +2 -2
- package/lib/stories/ManualStories/Overview.stories.d.ts +20 -0
- 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 +9 -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
|
+
controls: {
|
|
5
|
+
hideNoControlsWarning: boolean;
|
|
6
|
+
exclude: any[];
|
|
7
|
+
};
|
|
8
|
+
parameters: {
|
|
9
|
+
customIcon: () => React.JSX.Element;
|
|
10
|
+
toolbar: {
|
|
11
|
+
visibility: string;
|
|
12
|
+
};
|
|
13
|
+
layout: string;
|
|
14
|
+
options: {
|
|
15
|
+
showPanel: boolean;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
title: string;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
21
|
+
export declare const Overview: () => 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.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
|
@@ -1213,9 +1213,6 @@ video {
|
|
|
1213
1213
|
.w-9 {
|
|
1214
1214
|
width: 2.25rem;
|
|
1215
1215
|
}
|
|
1216
|
-
.w-96 {
|
|
1217
|
-
width: 24rem;
|
|
1218
|
-
}
|
|
1219
1216
|
.w-\[12px\] {
|
|
1220
1217
|
width: 12px;
|
|
1221
1218
|
}
|
|
@@ -2005,6 +2002,9 @@ video {
|
|
|
2005
2002
|
.p-2\.5 {
|
|
2006
2003
|
padding: 0.625rem;
|
|
2007
2004
|
}
|
|
2005
|
+
.p-20 {
|
|
2006
|
+
padding: 5rem;
|
|
2007
|
+
}
|
|
2008
2008
|
.p-3 {
|
|
2009
2009
|
padding: 0.75rem;
|
|
2010
2010
|
}
|
|
@@ -2138,6 +2138,9 @@ video {
|
|
|
2138
2138
|
.pt-1 {
|
|
2139
2139
|
padding-top: 0.25rem;
|
|
2140
2140
|
}
|
|
2141
|
+
.pt-10 {
|
|
2142
|
+
padding-top: 2.5rem;
|
|
2143
|
+
}
|
|
2141
2144
|
.pt-2 {
|
|
2142
2145
|
padding-top: 0.5rem;
|
|
2143
2146
|
}
|
|
@@ -3037,6 +3040,9 @@ body {
|
|
|
3037
3040
|
--tw-border-opacity: 1;
|
|
3038
3041
|
border-color: rgb(17 24 39 / var(--tw-border-opacity));
|
|
3039
3042
|
}
|
|
3043
|
+
:is(.dark .dark\:bg-background) {
|
|
3044
|
+
background-color: hsl(var(--background));
|
|
3045
|
+
}
|
|
3040
3046
|
:is(.dark .dark\:bg-blue-200) {
|
|
3041
3047
|
--tw-bg-opacity: 1;
|
|
3042
3048
|
background-color: rgb(191 219 254 / var(--tw-bg-opacity));
|
|
@@ -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
|
+
}
|