@sikka/hawa 0.0.114 → 0.0.117
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 +73 -14
- package/es/blocks/AuthForms/SignInForm.d.ts +36 -36
- package/es/elements/HawaAlert.d.ts +1 -0
- package/es/elements/HawaChip.d.ts +1 -1
- package/es/elements/HawaPinInput.d.ts +8 -0
- package/es/elements/HawaStats.d.ts +9 -0
- package/es/elements/index.d.ts +2 -0
- package/es/index.es.js +1 -1
- package/es/layout/HawaAppLayout.d.ts +9 -0
- package/es/layout/{HawaLayout.d.ts → HawaSiteLayout.d.ts} +1 -1
- package/es/layout/index.d.ts +2 -1
- package/lib/blocks/AuthForms/SignInForm.d.ts +36 -36
- package/lib/elements/HawaAlert.d.ts +1 -0
- package/lib/elements/HawaChip.d.ts +1 -1
- package/lib/elements/HawaPinInput.d.ts +8 -0
- package/lib/elements/HawaStats.d.ts +9 -0
- package/lib/elements/index.d.ts +2 -0
- package/lib/index.js +1 -1
- package/lib/layout/HawaAppLayout.d.ts +9 -0
- package/lib/layout/{HawaLayout.d.ts → HawaSiteLayout.d.ts} +1 -1
- package/lib/layout/index.d.ts +2 -1
- package/package.json +1 -2
- package/src/blocks/AuthForms/SignInForm.tsx +36 -36
- package/src/elements/HawaAlert.tsx +59 -2
- package/src/elements/HawaChip.tsx +1 -1
- package/src/elements/HawaPinInput.tsx +55 -0
- package/src/elements/HawaStats.tsx +25 -0
- package/src/elements/HawaTextField.tsx +4 -4
- package/src/elements/index.ts +2 -0
- package/src/layout/HawaAppLayout.tsx +69 -0
- package/src/layout/HawaSiteLayout.tsx +302 -0
- package/src/layout/index.ts +6 -6
- package/src/styles.css +73 -14
- package/storybook-static/51.786e9bbba427ee454dc0.manager.bundle.js +2 -0
- package/storybook-static/{51.8ca217c6882b6d3971a8.manager.bundle.js.LICENSE.txt → 51.786e9bbba427ee454dc0.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/51.acbbdb95.iframe.bundle.js +2 -0
- package/storybook-static/{51.aeae4f67.iframe.bundle.js.LICENSE.txt → 51.acbbdb95.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/733.b57425fc.iframe.bundle.js +2 -0
- package/storybook-static/{669.31ae8ecc.iframe.bundle.js.LICENSE.txt → 733.b57425fc.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/767.2f9c96fa3338c8d16078.manager.bundle.js +2 -0
- package/storybook-static/{767.294896b3de4a98c7bd38.manager.bundle.js.LICENSE.txt → 767.2f9c96fa3338c8d16078.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +2 -2
- package/storybook-static/main.4c317f06.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -1
- package/storybook-static/{runtime~main.118c8621e276a271ad89.manager.bundle.js → runtime~main.25eae181fe0f96887a15.manager.bundle.js} +1 -1
- package/storybook-static/{runtime~main.4a2964ac.iframe.bundle.js → runtime~main.4d0bf318.iframe.bundle.js} +1 -1
- package/src/layout/HawaLayout.tsx +0 -212
- package/storybook-static/51.8ca217c6882b6d3971a8.manager.bundle.js +0 -2
- package/storybook-static/51.aeae4f67.iframe.bundle.js +0 -2
- package/storybook-static/669.31ae8ecc.iframe.bundle.js +0 -2
- package/storybook-static/767.294896b3de4a98c7bd38.manager.bundle.js +0 -2
- package/storybook-static/main.5ddcc678.iframe.bundle.js +0 -1
package/lib/layout/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sikka/hawa",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.117",
|
|
4
4
|
"description": "UI Kit",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.es.js",
|
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
"babel-loader": "^8.2.2",
|
|
39
39
|
"clsx": "^1.2.1",
|
|
40
40
|
"crypto-js": "^4.1.1",
|
|
41
|
-
"emotion-theming": "^11.0.0",
|
|
42
41
|
"framer-motion": "^4.1.7",
|
|
43
42
|
"html-webpack-plugin": "^5.5.0",
|
|
44
43
|
"next-scripts": "^0.3.4",
|
|
@@ -10,43 +10,43 @@ import { Controller, useForm } from "react-hook-form"
|
|
|
10
10
|
import { HawaContainer } from "../../layout"
|
|
11
11
|
|
|
12
12
|
type SignInFormTypes = {
|
|
13
|
-
showError
|
|
14
|
-
errorTitle
|
|
15
|
-
errorText
|
|
16
|
-
signInType
|
|
17
|
-
texts
|
|
18
|
-
emailLabel
|
|
19
|
-
emailPlaceholder
|
|
20
|
-
emailRequiredText
|
|
21
|
-
emailInvalidText
|
|
22
|
-
usernameLabel
|
|
23
|
-
usernamePlaceholder
|
|
24
|
-
usernameRequired
|
|
25
|
-
usernameRequiredText
|
|
26
|
-
phoneRequiredText
|
|
27
|
-
passwordLabel
|
|
28
|
-
passwordPlaceholder
|
|
29
|
-
passwordRequiredText
|
|
30
|
-
forgotPasswordText
|
|
31
|
-
newUserText
|
|
32
|
-
signUpText
|
|
33
|
-
signInText
|
|
34
|
-
googleButtonLabel
|
|
35
|
-
githubButtonLabel
|
|
36
|
-
twitterButtonLabel
|
|
13
|
+
showError?: any
|
|
14
|
+
errorTitle?: string
|
|
15
|
+
errorText?: string
|
|
16
|
+
signInType?: "email" | "username" | "phone"
|
|
17
|
+
texts?: {
|
|
18
|
+
emailLabel?: string
|
|
19
|
+
emailPlaceholder?: string
|
|
20
|
+
emailRequiredText?: string
|
|
21
|
+
emailInvalidText?: string
|
|
22
|
+
usernameLabel?: string
|
|
23
|
+
usernamePlaceholder?: string
|
|
24
|
+
usernameRequired?: string
|
|
25
|
+
usernameRequiredText?: string
|
|
26
|
+
phoneRequiredText?: string
|
|
27
|
+
passwordLabel?: string
|
|
28
|
+
passwordPlaceholder?: string
|
|
29
|
+
passwordRequiredText?: string
|
|
30
|
+
forgotPasswordText?: string
|
|
31
|
+
newUserText?: string
|
|
32
|
+
signUpText?: string
|
|
33
|
+
signInText?: string
|
|
34
|
+
googleButtonLabel?: string
|
|
35
|
+
githubButtonLabel?: string
|
|
36
|
+
twitterButtonLabel?: string
|
|
37
37
|
}
|
|
38
|
-
withoutResetPassword
|
|
39
|
-
withoutSignUp
|
|
40
|
-
isLoading
|
|
41
|
-
viaGoogle
|
|
42
|
-
viaGithub
|
|
43
|
-
viaTwitter
|
|
44
|
-
handleSignIn
|
|
45
|
-
handleRouteToSignUp
|
|
46
|
-
handleForgotPassword
|
|
47
|
-
handleGoogleSignIn
|
|
48
|
-
handleGithubSignIn
|
|
49
|
-
handleTwitterSignIn
|
|
38
|
+
withoutResetPassword?: boolean
|
|
39
|
+
withoutSignUp?: boolean
|
|
40
|
+
isLoading?: any
|
|
41
|
+
viaGoogle?: boolean
|
|
42
|
+
viaGithub?: boolean
|
|
43
|
+
viaTwitter?: boolean
|
|
44
|
+
handleSignIn?: (e: any) => void
|
|
45
|
+
handleRouteToSignUp?: () => void
|
|
46
|
+
handleForgotPassword?: () => void
|
|
47
|
+
handleGoogleSignIn?: () => void
|
|
48
|
+
handleGithubSignIn?: () => void
|
|
49
|
+
handleTwitterSignIn?: () => void
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export const SignInForm: React.FunctionComponent<SignInFormTypes> = (props) => {
|
|
@@ -12,6 +12,13 @@ let severities = {
|
|
|
12
12
|
type AlertTypes = {
|
|
13
13
|
severity: keyof typeof severities
|
|
14
14
|
title?: any
|
|
15
|
+
variant?:
|
|
16
|
+
| "normal"
|
|
17
|
+
| "solid"
|
|
18
|
+
| "top-accent"
|
|
19
|
+
| "left-accent"
|
|
20
|
+
| "right-accent"
|
|
21
|
+
| "bottom-accent"
|
|
15
22
|
text: any
|
|
16
23
|
hideIcon?: any
|
|
17
24
|
actions?: [
|
|
@@ -22,12 +29,62 @@ type AlertTypes = {
|
|
|
22
29
|
}
|
|
23
30
|
]
|
|
24
31
|
}
|
|
25
|
-
export const HawaAlert: React.FunctionComponent<AlertTypes> = (
|
|
32
|
+
export const HawaAlert: React.FunctionComponent<AlertTypes> = ({
|
|
33
|
+
variant = "normal",
|
|
34
|
+
...props
|
|
35
|
+
}) => {
|
|
36
|
+
let styleVariant = {
|
|
37
|
+
normal: {
|
|
38
|
+
info: "text-blue-700 bg-blue-100 dark:bg-blue-200 dark:text-blue-800",
|
|
39
|
+
warning:
|
|
40
|
+
"text-yellow-700 bg-yellow-100 dark:bg-yellow-200 dark:text-yellow-800",
|
|
41
|
+
error: "text-red-700 bg-red-100 dark:bg-red-200 dark:text-red-800",
|
|
42
|
+
success:
|
|
43
|
+
"text-green-700 bg-green-100 dark:bg-green-200 dark:text-green-800",
|
|
44
|
+
},
|
|
45
|
+
"top-accent": {
|
|
46
|
+
info: "border-t-4 border-blue-300 text-blue-700 bg-blue-100 dark:bg-blue-200 dark:text-blue-800",
|
|
47
|
+
warning:
|
|
48
|
+
"border-t-4 border-yellow-300 text-yellow-700 bg-yellow-100 dark:bg-yellow-200 dark:text-yellow-800",
|
|
49
|
+
error:
|
|
50
|
+
"border-t-4 border-red-300 text-red-700 bg-red-100 dark:bg-red-200 dark:text-red-800",
|
|
51
|
+
success:
|
|
52
|
+
"border-t-4 border-green-300 text-green-700 bg-green-100 dark:bg-green-200 dark:text-green-800",
|
|
53
|
+
},
|
|
54
|
+
"left-accent": {
|
|
55
|
+
info: "border-l-4 border-blue-300 text-blue-700 bg-blue-100 dark:bg-blue-200 dark:text-blue-800",
|
|
56
|
+
warning:
|
|
57
|
+
"border-l-4 border-yellow-300 text-yellow-700 bg-yellow-100 dark:bg-yellow-200 dark:text-yellow-800",
|
|
58
|
+
error:
|
|
59
|
+
"border-l-4 border-red-300 text-red-700 bg-red-100 dark:bg-red-200 dark:text-red-800",
|
|
60
|
+
success:
|
|
61
|
+
"border-l-4 border-green-300 text-green-700 bg-green-100 dark:bg-green-200 dark:text-green-800",
|
|
62
|
+
},
|
|
63
|
+
"right-accent": {
|
|
64
|
+
info: "border-r-4 border-blue-300 text-blue-700 bg-blue-100 dark:bg-blue-200 dark:text-blue-800",
|
|
65
|
+
warning:
|
|
66
|
+
"border-r-4 border-yellow-300 text-yellow-700 bg-yellow-100 dark:bg-yellow-200 dark:text-yellow-800",
|
|
67
|
+
error:
|
|
68
|
+
"border-r-4 border-red-300 text-red-700 bg-red-100 dark:bg-red-200 dark:text-red-800",
|
|
69
|
+
success:
|
|
70
|
+
"border-r-4 border-green-300 text-green-700 bg-green-100 dark:bg-green-200 dark:text-green-800",
|
|
71
|
+
},
|
|
72
|
+
"bottom-accent": {
|
|
73
|
+
info: "border-b-4 border-blue-300 text-blue-700 bg-blue-100 dark:bg-blue-200 dark:text-blue-800",
|
|
74
|
+
warning:
|
|
75
|
+
"border-b-4 border-yellow-300 text-yellow-700 bg-yellow-100 dark:bg-yellow-200 dark:text-yellow-800",
|
|
76
|
+
error:
|
|
77
|
+
"border-b-4 border-red-300 text-red-700 bg-red-100 dark:bg-red-200 dark:text-red-800",
|
|
78
|
+
success:
|
|
79
|
+
"border-b-4 border-green-300 text-green-700 bg-green-100 dark:bg-green-200 dark:text-green-800",
|
|
80
|
+
},
|
|
81
|
+
}
|
|
26
82
|
return (
|
|
27
83
|
<div
|
|
28
84
|
className={clsx(
|
|
29
85
|
"mb-4 flex flex-col rounded-lg p-4 text-sm",
|
|
30
|
-
severities[props.severity]
|
|
86
|
+
// severities[props.severity],
|
|
87
|
+
styleVariant[variant][props.severity]
|
|
31
88
|
)}
|
|
32
89
|
role="alert"
|
|
33
90
|
>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import clsx from "clsx"
|
|
2
|
+
import React from "react"
|
|
3
|
+
|
|
4
|
+
type PinInputTypes = {
|
|
5
|
+
label: string
|
|
6
|
+
icon?: JSX.Element
|
|
7
|
+
digits?: number
|
|
8
|
+
}
|
|
9
|
+
export const HawaPinInput: React.FunctionComponent<PinInputTypes> = ({
|
|
10
|
+
label,
|
|
11
|
+
icon,
|
|
12
|
+
}) => {
|
|
13
|
+
const validate = (evt) => {
|
|
14
|
+
var theEvent = evt || window.event
|
|
15
|
+
|
|
16
|
+
// Handle paste
|
|
17
|
+
if (theEvent.type === "paste") {
|
|
18
|
+
key = evt.clipboardData.getData("text/plain")
|
|
19
|
+
} else {
|
|
20
|
+
// Handle key press
|
|
21
|
+
var key = theEvent.keyCode || theEvent.which
|
|
22
|
+
key = String.fromCharCode(key)
|
|
23
|
+
}
|
|
24
|
+
var regex = /[0-9]|\./
|
|
25
|
+
if (!regex.test(key)) {
|
|
26
|
+
theEvent.returnValue = false
|
|
27
|
+
if (theEvent.preventDefault) theEvent.preventDefault()
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return (
|
|
31
|
+
<div className="flex flex-row gap-2">
|
|
32
|
+
<SinglePinInput
|
|
33
|
+
onInput={
|
|
34
|
+
(v) =>
|
|
35
|
+
v.target.value.replace(/[^0-9.]/g, "").replace(/(\..*?)\..*/g, "$1")
|
|
36
|
+
// .replace(/[^0-9.]/g, "")
|
|
37
|
+
// .replace(/(..*?)..*/g, "$1")
|
|
38
|
+
// .replace(/^0[^.]/, "0")
|
|
39
|
+
}
|
|
40
|
+
/>
|
|
41
|
+
<SinglePinInput />
|
|
42
|
+
<SinglePinInput />
|
|
43
|
+
<SinglePinInput />
|
|
44
|
+
</div>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const SinglePinInput = (props) => (
|
|
49
|
+
<input
|
|
50
|
+
type="text"
|
|
51
|
+
maxLength={1}
|
|
52
|
+
className="h-10 w-10 bg-gray-200 text-center"
|
|
53
|
+
{...props}
|
|
54
|
+
/>
|
|
55
|
+
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import clsx from "clsx"
|
|
3
|
+
|
|
4
|
+
type StatTypes = {
|
|
5
|
+
label?: string
|
|
6
|
+
number?: string
|
|
7
|
+
helperText?: string
|
|
8
|
+
variant?: "plain" | "contained" | "outlined"
|
|
9
|
+
}
|
|
10
|
+
export const HawaStats: React.FunctionComponent<StatTypes> = (props) => {
|
|
11
|
+
let defaultStyle = "flex flex-col gap-1 rounded-lg p-4 text-sm"
|
|
12
|
+
let statStyles = {
|
|
13
|
+
plain: "",
|
|
14
|
+
contained: "bg-primary-200 w-fit",
|
|
15
|
+
// outlined: "border-2 border-primary-200 w-fit",
|
|
16
|
+
outlined: "ring-2 w-fit",
|
|
17
|
+
}
|
|
18
|
+
return (
|
|
19
|
+
<div className={clsx(defaultStyle, statStyles[props.variant])}>
|
|
20
|
+
<div>{props.label}</div>
|
|
21
|
+
<div className="text-2xl font-bold">{props.number}</div>
|
|
22
|
+
<div className="text-xs">{props.helperText}</div>
|
|
23
|
+
</div>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import clsx from "clsx"
|
|
3
|
+
|
|
3
4
|
import { FaSearch } from "react-icons/fa"
|
|
4
5
|
type TextFieldTypes = {
|
|
5
6
|
margin?: "none" | "normal" | "large"
|
|
@@ -55,10 +56,9 @@ export const HawaTextField: React.FunctionComponent<TextFieldTypes> = ({
|
|
|
55
56
|
/>
|
|
56
57
|
) : props.type === "search" ? (
|
|
57
58
|
<div className="relative">
|
|
58
|
-
<
|
|
59
|
-
color="gray"
|
|
60
|
-
|
|
61
|
-
/>
|
|
59
|
+
<div className="absolute top-1/2 left-3 -translate-y-1/2">
|
|
60
|
+
<FaSearch color="gray" />
|
|
61
|
+
</div>
|
|
62
62
|
<input
|
|
63
63
|
{...props}
|
|
64
64
|
className="mb-0 block w-full rounded-lg border border-gray-300 bg-gray-50 p-2.5 pl-10 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"
|
package/src/elements/index.ts
CHANGED
|
@@ -24,9 +24,11 @@ export * from "./HawaDrawer"
|
|
|
24
24
|
export * from "./HawaCopyrights"
|
|
25
25
|
export * from "./HawaTimeline"
|
|
26
26
|
export * from "./Breadcrumb"
|
|
27
|
+
export * from "./HawaStats"
|
|
27
28
|
// Inputs
|
|
28
29
|
export * from "./HawaTextField"
|
|
29
30
|
export * from "./HawaCardInput"
|
|
31
|
+
export * from "./HawaPinInput"
|
|
30
32
|
// Cards
|
|
31
33
|
export * from "./HawaItemCard"
|
|
32
34
|
export * from "./HawaPricingCard"
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import clsx from "clsx"
|
|
2
|
+
import React, { useState } from "react"
|
|
3
|
+
|
|
4
|
+
type HawaAppLayoutTypes = {
|
|
5
|
+
logoLink: string
|
|
6
|
+
username: string
|
|
7
|
+
userEmail: string
|
|
8
|
+
drawerItems: any
|
|
9
|
+
}
|
|
10
|
+
export const HawaAppLayout: React.FunctionComponent<HawaAppLayoutTypes> = (
|
|
11
|
+
props: any
|
|
12
|
+
) => {
|
|
13
|
+
const [openSideMenu, setOpenSideMenu] = useState(false)
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<div className="fixed top-0 left-0 m-0 w-full p-0">
|
|
17
|
+
<div
|
|
18
|
+
onMouseEnter={() => setOpenSideMenu(true)}
|
|
19
|
+
onMouseLeave={() => setOpenSideMenu(false)}
|
|
20
|
+
className="absolute top-0 z-10 flex h-screen w-12 flex-col gap-0 bg-blue-300 transition-all hover:w-40"
|
|
21
|
+
>
|
|
22
|
+
<div className="m-1 bg-red-300 p-2">logo</div>
|
|
23
|
+
{props.drawerItems.map((dItem) => (
|
|
24
|
+
<div className="pl-3 m-1 flex cursor-pointer flex-row items-center overflow-x-clip rounded-lg bg-orange-400 p-2 transition-all hover:bg-green-300">
|
|
25
|
+
<div className="flex items-center justify-center">{dItem.icon}</div>
|
|
26
|
+
<div
|
|
27
|
+
className={clsx(
|
|
28
|
+
"mx-2 text-sm transition-all",
|
|
29
|
+
openSideMenu ? "opacity-100" : "opacity-0"
|
|
30
|
+
)}
|
|
31
|
+
>
|
|
32
|
+
{dItem.text}
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
))}
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
{/*
|
|
39
|
+
<div className="relative flex flex-row bg-yellow-300">
|
|
40
|
+
<div className="relative left-10 h-screen w-full bg-orange-300">
|
|
41
|
+
<div className="m-0 flex flex-row justify-between bg-red-300 p-2">
|
|
42
|
+
<div></div>
|
|
43
|
+
<div>page title</div>
|
|
44
|
+
<div className="relative mr-2 h-10 w-10 overflow-hidden rounded-full bg-gray-100 dark:bg-gray-600">
|
|
45
|
+
<AvatarIcon />
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<div>{props.children}</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div> */}
|
|
52
|
+
</div>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const AvatarIcon = () => (
|
|
57
|
+
<svg
|
|
58
|
+
className="absolute -left-1 h-12 w-12 text-gray-400"
|
|
59
|
+
fill="currentColor"
|
|
60
|
+
viewBox="0 0 20 20"
|
|
61
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
62
|
+
>
|
|
63
|
+
<path
|
|
64
|
+
fill-rule="evenodd"
|
|
65
|
+
d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z"
|
|
66
|
+
clip-rule="evenodd"
|
|
67
|
+
></path>
|
|
68
|
+
</svg>
|
|
69
|
+
)
|