@sikka/hawa 0.0.186 → 0.0.187
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/dist/styles.css +11 -5
- package/es/blocks/AuthForms/ResetPasswordForm.d.ts +3 -0
- package/es/blocks/AuthForms/SignUpForm.d.ts +1 -0
- package/es/elements/HawaTabs.d.ts +1 -0
- package/es/elements/HawaTextField.d.ts +1 -0
- package/es/index.es.js +1 -1
- package/lib/blocks/AuthForms/ResetPasswordForm.d.ts +3 -0
- package/lib/blocks/AuthForms/SignUpForm.d.ts +1 -0
- package/lib/elements/HawaTabs.d.ts +1 -0
- package/lib/elements/HawaTextField.d.ts +1 -0
- package/lib/index.js +1 -1
- package/package.json +20 -4
- package/src/blocks/AuthForms/ResetPasswordForm.tsx +12 -0
- package/src/blocks/AuthForms/SignUpForm.tsx +40 -43
- package/src/elements/HawaCheckbox.tsx +3 -2
- package/src/elements/HawaSelect.tsx +1 -1
- package/src/elements/HawaTabs.tsx +11 -3
- package/src/elements/HawaTextField.tsx +14 -19
- package/src/styles.css +11 -5
- package/src/tailwind.css +1 -1
package/package.json
CHANGED
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sikka/hawa",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "UI Kit",
|
|
3
|
+
"version": "0.0.187",
|
|
4
|
+
"description": "SaaS Oriented UI Kit",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.es.js",
|
|
7
|
+
"author": "Sikka Software <contact@sikka.io> (http://sikka.io)",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"ui",
|
|
11
|
+
"kit",
|
|
12
|
+
"saas",
|
|
13
|
+
"kit",
|
|
14
|
+
"hawa"
|
|
15
|
+
],
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/sikka-software/hawa.git"
|
|
19
|
+
},
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/sikka-software/hawa/issues",
|
|
22
|
+
"email": "hawa@sikka.io"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://hawa.style",
|
|
7
25
|
"scripts": {
|
|
8
26
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
27
|
"start": "start-storybook -p 6006 -s public",
|
|
@@ -14,8 +32,6 @@
|
|
|
14
32
|
"build-lib": "rollup -c",
|
|
15
33
|
"build:styles": " node tools/build-styles"
|
|
16
34
|
},
|
|
17
|
-
"author": "Sikka Software",
|
|
18
|
-
"license": "MIT",
|
|
19
35
|
"devDependencies": {
|
|
20
36
|
"@babel/core": "^7.12.10",
|
|
21
37
|
"@babel/preset-react": "^7.12.10",
|
|
@@ -5,6 +5,7 @@ import { HawaContainer } from "../../layout"
|
|
|
5
5
|
|
|
6
6
|
type ResetPasswordType = {
|
|
7
7
|
handleResetPassword: () => void
|
|
8
|
+
handleRouteToSignUp: () => void
|
|
8
9
|
sent: any
|
|
9
10
|
texts: {
|
|
10
11
|
emailLabel: string
|
|
@@ -13,6 +14,8 @@ type ResetPasswordType = {
|
|
|
13
14
|
emailInvalidText: string
|
|
14
15
|
emailSentText: string
|
|
15
16
|
resetPassword: string
|
|
17
|
+
signUpText: string
|
|
18
|
+
dontHaveAccount: string
|
|
16
19
|
}
|
|
17
20
|
}
|
|
18
21
|
|
|
@@ -53,6 +56,15 @@ export const ResetPasswordForm: React.FunctionComponent<ResetPasswordType> = (
|
|
|
53
56
|
},
|
|
54
57
|
}}
|
|
55
58
|
/>
|
|
59
|
+
<div className=" pb-2 text-left text-sm dark:text-gray-300">
|
|
60
|
+
{props.texts.dontHaveAccount ?? "Don't have an account? "}
|
|
61
|
+
<span
|
|
62
|
+
onClick={props.handleRouteToSignUp}
|
|
63
|
+
className="cursor-pointer text-blue-600 dark:text-blue-400"
|
|
64
|
+
>
|
|
65
|
+
{props.texts.signUpText ?? "Sign Up"}
|
|
66
|
+
</span>
|
|
67
|
+
</div>
|
|
56
68
|
<HawaButton
|
|
57
69
|
color="primary"
|
|
58
70
|
width="full"
|
|
@@ -41,6 +41,7 @@ type SignUpFormTypes = {
|
|
|
41
41
|
googleButtonLabel: string
|
|
42
42
|
githubButtonLabel: string
|
|
43
43
|
twitterButtonLabel: string
|
|
44
|
+
refCode: string
|
|
44
45
|
}
|
|
45
46
|
showUserSource: any
|
|
46
47
|
viaGoogle: boolean
|
|
@@ -194,13 +195,13 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
|
|
|
194
195
|
{props.showRefCode && (
|
|
195
196
|
<Controller
|
|
196
197
|
control={control}
|
|
197
|
-
name="
|
|
198
|
+
name="refCode"
|
|
198
199
|
render={({ field }) => (
|
|
199
200
|
<HawaTextField
|
|
200
201
|
width="full"
|
|
201
202
|
type="text"
|
|
202
203
|
defaultValue={field.value ?? ""}
|
|
203
|
-
label={
|
|
204
|
+
label={props.texts.refCode}
|
|
204
205
|
placeholder={props.texts.passwordPlaceholder}
|
|
205
206
|
helperText={errors.password?.message}
|
|
206
207
|
value={field.value ?? ""}
|
|
@@ -235,49 +236,45 @@ export const SignUpForm: React.FunctionComponent<SignUpFormTypes> = (props) => {
|
|
|
235
236
|
</div>
|
|
236
237
|
)}
|
|
237
238
|
{props.showTermsOption && (
|
|
238
|
-
<
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
/>
|
|
265
|
-
</div>
|
|
239
|
+
<Controller
|
|
240
|
+
control={control}
|
|
241
|
+
name="terms_accepted"
|
|
242
|
+
render={({ field }) => (
|
|
243
|
+
<HawaCheckbox
|
|
244
|
+
id="terms_accepted"
|
|
245
|
+
helperText={errors.terms_accepted?.message}
|
|
246
|
+
onChange={(e) => {
|
|
247
|
+
console.log("changing ", e)
|
|
248
|
+
field.onChange(e)
|
|
249
|
+
}}
|
|
250
|
+
label={
|
|
251
|
+
<span>
|
|
252
|
+
{props.texts.iAcceptText}{" "}
|
|
253
|
+
<a
|
|
254
|
+
onClick={props.handleRouteToTOS}
|
|
255
|
+
className="cursor-pointer text-blue-800"
|
|
256
|
+
>
|
|
257
|
+
{props.texts.termsText}
|
|
258
|
+
</a>
|
|
259
|
+
</span>
|
|
260
|
+
}
|
|
261
|
+
/>
|
|
262
|
+
)}
|
|
263
|
+
rules={{ required: props.texts.termsRequiredText }}
|
|
264
|
+
/>
|
|
266
265
|
)}
|
|
267
266
|
{props.showNewsletterOption && (
|
|
268
|
-
<
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
/>
|
|
280
|
-
</div>
|
|
267
|
+
<Controller
|
|
268
|
+
control={control}
|
|
269
|
+
name="newsletter_accepted"
|
|
270
|
+
render={({ field }) => (
|
|
271
|
+
<HawaCheckbox
|
|
272
|
+
id="newsletter_accepted"
|
|
273
|
+
label={props.texts.subscribeToNewsletter}
|
|
274
|
+
onChange={field.onChange}
|
|
275
|
+
/>
|
|
276
|
+
)}
|
|
277
|
+
/>
|
|
281
278
|
)}
|
|
282
279
|
<HawaButton
|
|
283
280
|
isLoading={props.isLoading}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import clsx from "clsx"
|
|
1
2
|
import React, { useEffect, useState } from "react"
|
|
2
3
|
|
|
3
4
|
type TCheckBoxTypes = {
|
|
@@ -19,11 +20,11 @@ export const HawaCheckbox: React.FunctionComponent<TCheckBoxTypes> = (
|
|
|
19
20
|
}, [val])
|
|
20
21
|
return (
|
|
21
22
|
<div
|
|
22
|
-
className={
|
|
23
|
+
className={clsx(
|
|
23
24
|
props.centered
|
|
24
25
|
? "flex h-full items-center justify-center"
|
|
25
26
|
: "flex h-full items-start "
|
|
26
|
-
}
|
|
27
|
+
)}
|
|
27
28
|
>
|
|
28
29
|
<input
|
|
29
30
|
type="checkbox"
|
|
@@ -18,7 +18,7 @@ const Option: React.FunctionComponent<OptionTypes> = ({
|
|
|
18
18
|
}) => (
|
|
19
19
|
<div
|
|
20
20
|
ref={innerRef}
|
|
21
|
-
className="m-2 flex flex-row items-center justify-between rounded p-1 px-3 hover:bg-
|
|
21
|
+
className="m-2 flex flex-row items-center justify-between rounded p-1 px-3 hover:bg-buttonPrimary-500 hover:text-white"
|
|
22
22
|
{...innerProps}
|
|
23
23
|
>
|
|
24
24
|
{children}
|
|
@@ -9,10 +9,12 @@ type TabsTypes = {
|
|
|
9
9
|
orientation?: "horizontal" | "vertical"
|
|
10
10
|
direction?: "rtl" | "ltr"
|
|
11
11
|
marginBetween?: any
|
|
12
|
+
width?: "full" | "normal"
|
|
12
13
|
}
|
|
13
14
|
export const HawaTabs: React.FunctionComponent<TabsTypes> = ({
|
|
14
15
|
orientation = "horizontal",
|
|
15
16
|
direction = "ltr",
|
|
17
|
+
width = "normal",
|
|
16
18
|
marginBetween = 0,
|
|
17
19
|
...props
|
|
18
20
|
}) => {
|
|
@@ -27,7 +29,11 @@ export const HawaTabs: React.FunctionComponent<TabsTypes> = ({
|
|
|
27
29
|
vertical:
|
|
28
30
|
"inline-block py-2 px-4 rounded-none rounded-br-none rounded-tl-none hover:text-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 dark:hover:text-white",
|
|
29
31
|
horizontal:
|
|
30
|
-
"inline-block py-2 px-4 rounded rounded-br-none rounded-bl-none hover:text-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 dark:hover:text-white",
|
|
32
|
+
"bg-gray-100 inline-block py-2 px-4 rounded rounded-br-none rounded-bl-none hover:text-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 dark:hover:text-white",
|
|
33
|
+
}
|
|
34
|
+
let widthStyles = {
|
|
35
|
+
full: "w-full min-w-full",
|
|
36
|
+
normal: "w-fit",
|
|
31
37
|
}
|
|
32
38
|
console.log("selected i : ", selectedOption)
|
|
33
39
|
console.log("selected object : ", props.options[selectedOption])
|
|
@@ -49,7 +55,7 @@ export const HawaTabs: React.FunctionComponent<TabsTypes> = ({
|
|
|
49
55
|
vertical:
|
|
50
56
|
"sticky top-2 h-fit flex flex-col w-fit flex-wrap rounded border-b-buttonPrimary-500 bg-gray-100 text-center text-sm font-medium text-gray-500 dark:text-gray-400",
|
|
51
57
|
horizontal:
|
|
52
|
-
"flex w-fit flex-wrap rounded rounded-br-none rounded-bl-none border-b-buttonPrimary-500
|
|
58
|
+
"flex w-fit flex-wrap rounded rounded-br-none rounded-bl-none border-b-buttonPrimary-500 text-center text-sm font-medium text-gray-500 dark:text-gray-400",
|
|
53
59
|
}
|
|
54
60
|
return (
|
|
55
61
|
<div
|
|
@@ -57,6 +63,7 @@ export const HawaTabs: React.FunctionComponent<TabsTypes> = ({
|
|
|
57
63
|
className={clsx(
|
|
58
64
|
containerStyle[orientation],
|
|
59
65
|
props.options[selectedOption] ? "border-b-2" : "border-b-0"
|
|
66
|
+
// "bg-red-400"
|
|
60
67
|
)}
|
|
61
68
|
>
|
|
62
69
|
<ul
|
|
@@ -76,7 +83,8 @@ export const HawaTabs: React.FunctionComponent<TabsTypes> = ({
|
|
|
76
83
|
? direction === "rtl"
|
|
77
84
|
? "rounded-none rounded-r border-l-2"
|
|
78
85
|
: "rounded-none rounded-l border-r-2"
|
|
79
|
-
: "border-b-2"
|
|
86
|
+
: "border-b-2",
|
|
87
|
+
widthStyles[width]
|
|
80
88
|
)}
|
|
81
89
|
>
|
|
82
90
|
{/*
|
|
@@ -17,6 +17,7 @@ type TextFieldTypes = {
|
|
|
17
17
|
inputProps?: any
|
|
18
18
|
onChange?: any
|
|
19
19
|
ref?: any
|
|
20
|
+
icon?: any
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export const HawaTextField: React.FunctionComponent<TextFieldTypes> = ({
|
|
@@ -36,6 +37,10 @@ export const HawaTextField: React.FunctionComponent<TextFieldTypes> = ({
|
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
let defaultStyle = "flex h-fit max-h-fit flex-col justify-center"
|
|
40
|
+
let defaultInputStyle =
|
|
41
|
+
"block w-full rounded border border-gray-300 bg-gray-50 p-2 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500 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"
|
|
42
|
+
// "mb-0 block w-full rounded border border-gray-300 bg-gray-50 p-2 text-gray-900 focus:border-blue-500 focus:ring-blue-500 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",
|
|
43
|
+
|
|
39
44
|
return (
|
|
40
45
|
<div
|
|
41
46
|
// ref={props.ref}
|
|
@@ -53,7 +58,7 @@ export const HawaTextField: React.FunctionComponent<TextFieldTypes> = ({
|
|
|
53
58
|
<textarea
|
|
54
59
|
id="message"
|
|
55
60
|
rows={4}
|
|
56
|
-
className=
|
|
61
|
+
className={defaultInputStyle}
|
|
57
62
|
onChange={props.onChange}
|
|
58
63
|
type={props.type}
|
|
59
64
|
aria-label={props.label}
|
|
@@ -62,32 +67,22 @@ export const HawaTextField: React.FunctionComponent<TextFieldTypes> = ({
|
|
|
62
67
|
value={props.value}
|
|
63
68
|
{...props}
|
|
64
69
|
/>
|
|
65
|
-
) :
|
|
70
|
+
) : (
|
|
66
71
|
<div className="relative">
|
|
67
|
-
<div className="absolute top-1/2 left-3 -translate-y-1/2">
|
|
68
|
-
<FaSearch color="gray" />
|
|
69
|
-
</div>
|
|
70
72
|
<input
|
|
71
73
|
{...props}
|
|
72
|
-
className=
|
|
73
|
-
/>
|
|
74
|
-
</div>
|
|
75
|
-
) : (
|
|
76
|
-
<div>
|
|
77
|
-
<input
|
|
78
|
-
onChange={props.onChange}
|
|
79
|
-
type={props.type}
|
|
80
|
-
aria-label={props.label}
|
|
81
|
-
placeholder={props.placeholder}
|
|
82
|
-
defaultValue={props.defaultValue}
|
|
83
|
-
value={props.value}
|
|
84
|
-
className="mb-0 block w-full rounded border border-gray-300 bg-gray-50 p-2.5 text-gray-900 focus:border-blue-500 focus:ring-blue-500 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"
|
|
74
|
+
className={clsx(defaultInputStyle, props.icon ? "pr-10" : "")}
|
|
85
75
|
/>
|
|
76
|
+
{props.icon && (
|
|
77
|
+
<div className="absolute top-1/2 right-3 -translate-y-1/2">
|
|
78
|
+
{props.icon}
|
|
79
|
+
</div>
|
|
80
|
+
)}
|
|
86
81
|
</div>
|
|
87
82
|
)}
|
|
88
83
|
|
|
89
84
|
{props.helperText && (
|
|
90
|
-
<p className="mb-
|
|
85
|
+
<p className="mb-0 mt-1 text-xs text-red-600 dark:text-red-500">
|
|
91
86
|
{/* <span className="font-medium">Oh, snapp!</span> */}
|
|
92
87
|
{props.helperText}
|
|
93
88
|
</p>
|
package/src/styles.css
CHANGED
|
@@ -385,7 +385,7 @@ video {
|
|
|
385
385
|
--button-secondary-500: #ffc011;
|
|
386
386
|
--button-secondary-700: #b48d24;
|
|
387
387
|
|
|
388
|
-
--border-radius:
|
|
388
|
+
--border-radius: 0px;
|
|
389
389
|
}
|
|
390
390
|
input[type="number"]::-webkit-inner-spin-button,
|
|
391
391
|
input[type="number"]::-webkit-outer-spin-button {
|
|
@@ -608,8 +608,8 @@ video {
|
|
|
608
608
|
.top-2 {
|
|
609
609
|
top: 0.5rem;
|
|
610
610
|
}
|
|
611
|
-
.
|
|
612
|
-
|
|
611
|
+
.right-3 {
|
|
612
|
+
right: 0.75rem;
|
|
613
613
|
}
|
|
614
614
|
.-top-10 {
|
|
615
615
|
top: -2.5rem;
|
|
@@ -965,6 +965,9 @@ video {
|
|
|
965
965
|
.w-40 {
|
|
966
966
|
width: 10rem;
|
|
967
967
|
}
|
|
968
|
+
.min-w-full {
|
|
969
|
+
min-width: 100%;
|
|
970
|
+
}
|
|
968
971
|
.min-w-min {
|
|
969
972
|
min-width: -moz-min-content;
|
|
970
973
|
min-width: min-content;
|
|
@@ -1615,12 +1618,15 @@ video {
|
|
|
1615
1618
|
.pr-3 {
|
|
1616
1619
|
padding-right: 0.75rem;
|
|
1617
1620
|
}
|
|
1618
|
-
.
|
|
1619
|
-
padding-
|
|
1621
|
+
.pr-10 {
|
|
1622
|
+
padding-right: 2.5rem;
|
|
1620
1623
|
}
|
|
1621
1624
|
.pl-3 {
|
|
1622
1625
|
padding-left: 0.75rem;
|
|
1623
1626
|
}
|
|
1627
|
+
.pb-2 {
|
|
1628
|
+
padding-bottom: 0.5rem;
|
|
1629
|
+
}
|
|
1624
1630
|
.pt-0 {
|
|
1625
1631
|
padding-top: 0px;
|
|
1626
1632
|
}
|
package/src/tailwind.css
CHANGED