@sikka/hawa 0.0.6 → 0.0.9

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.
Files changed (57) hide show
  1. package/es/index.es.js +1 -1
  2. package/lib/index.js +1 -1
  3. package/package.json +2 -1
  4. package/src/blocks/Account/UserProfile.js +57 -7
  5. package/src/blocks/AuthForms/NewPasswordForm.js +59 -42
  6. package/src/blocks/AuthForms/ResetPasswordForm.js +46 -33
  7. package/src/blocks/AuthForms/SignInForm.js +60 -32
  8. package/src/blocks/AuthForms/SignUpForm.js +74 -45
  9. package/src/blocks/Payment/ChargeWalletForm.js +38 -17
  10. package/src/blocks/Payment/CreditCardForm.js +50 -21
  11. package/src/blocks/Payment/PayWithWallet.js +4 -25
  12. package/src/blocks/Payment/SelectPayment.js +18 -39
  13. package/src/layout/Box.js +9 -9
  14. package/src/stories/BlocksStories/AuthForm.stories.js +9 -9
  15. package/src/stories/BlocksStories/PaymentForm.stories.js +10 -6
  16. package/src/stories/BlocksStories/UserForm.stories.js +41 -0
  17. package/src/stories/Introduction.stories.mdx +229 -0
  18. package/src/stories/LayoutStories/Box.stories.js +4 -4
  19. package/src/stories/UIStories/ActionButton.stories.js +15 -22
  20. package/src/stories/UIStories/AdaptiveButton.stories.js +43 -42
  21. package/src/stories/UIStories/Alert.stories.js +4 -17
  22. package/src/stories/UIStories/LogoButtons.stories.js +90 -0
  23. package/src/stories/UIStories/RadioSelector.stories.js +20 -35
  24. package/src/stories/UIStories/SettingsRow.stories.js +64 -0
  25. package/src/themes/HawaProvider.js +64 -20
  26. package/src/ui/ActionButton.js +12 -11
  27. package/src/ui/AdaptiveButton.js +43 -159
  28. package/src/ui/HawaAlert.js +6 -6
  29. package/src/ui/HawaButton.js +6 -6
  30. package/src/ui/HawaInputLabel.js +4 -4
  31. package/src/ui/HawaLogoButton.js +102 -12
  32. package/src/ui/HawaRadio.js +50 -28
  33. package/src/ui/HawaSettingsRow.js +71 -0
  34. package/src/ui/HawaTextField.js +29 -35
  35. package/src/ui/HawaTypography.js +5 -6
  36. package/src/ui/index.js +2 -15
  37. package/storybook-static/iframe.html +1 -1
  38. package/storybook-static/main.5731dbe3.iframe.bundle.js +1 -0
  39. package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js +76 -0
  40. package/storybook-static/{vendors~main.30a2c5d7.iframe.bundle.js.LICENSE.txt → vendors~main.aa1d952a.iframe.bundle.js.LICENSE.txt} +0 -15
  41. package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js.map +1 -0
  42. package/src/stories/BlocksStories/UserAccount.stories.js +0 -46
  43. package/src/stories/GlobalVariables.stories.js +0 -44
  44. package/src/stories/Introduction.stories.js +0 -233
  45. package/src/ui/ApplePayButton.js +0 -93
  46. package/src/ui/GithubButton.js +0 -90
  47. package/src/ui/GoogleButton.js +0 -82
  48. package/src/ui/GooglePayButton.js +0 -93
  49. package/src/ui/MadaButton.js +0 -93
  50. package/src/ui/PayPalButton.js +0 -93
  51. package/src/ui/STCPayButton.js +0 -93
  52. package/src/ui/TwitterButton.js +0 -83
  53. package/src/ui/VisaMasterButton.js +0 -93
  54. package/src/ui/WalletButton.js +0 -24
  55. package/storybook-static/main.e55ce615.iframe.bundle.js +0 -1
  56. package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js +0 -76
  57. package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js.map +0 -1
@@ -2,36 +2,29 @@ import React from "react";
2
2
  import {
3
3
  HawaTextField,
4
4
  ActionButton,
5
- GoogleButton,
6
- TwitterButton,
7
- GithubButton,
8
- HawaAlert
5
+ HawaAlert,
6
+ HawaTypography,
7
+ HawaLogoButton
9
8
  } from "../../ui";
10
9
  import { Box } from "../../layout";
11
10
  import { FormProvider, useForm } from "react-hook-form";
12
- import { TextField } from "@mui/material";
11
+
12
+ import InputAdornment from "@mui/material/InputAdornment";
13
+ import EmailIcon from "@mui/icons-material/MailOutline";
14
+ import PasswordIcon from "@mui/icons-material/HttpsOutlined";
13
15
 
14
16
  export const SignInForm = (props) => {
15
17
  const methods = useForm();
16
18
  const {
17
19
  formState: { errors },
18
- handleSubmit,
19
- getValues,
20
- register,
21
- watch,
22
- reset,
23
- setValue
20
+ handleSubmit
24
21
  } = methods;
25
22
 
26
23
  return (
27
- <Box themeType={props.theme} maxWidth={400} noColor noMargin noPadding>
28
- <Box themeType={props.theme} noMargin>
24
+ <Box maxWidth={400} noColor noMargin noPadding>
25
+ <Box noMargin>
29
26
  {props.error && (
30
- <HawaAlert
31
- themeType={props.theme}
32
- text="This is a sign in alert"
33
- severity="error"
34
- />
27
+ <HawaAlert text="This is a sign in alert" severity="error" />
35
28
  )}
36
29
  <FormProvider {...methods}>
37
30
  <form onSubmit={handleSubmit(props.handleSignIn)}>
@@ -39,8 +32,12 @@ export const SignInForm = (props) => {
39
32
  type="text"
40
33
  name="email"
41
34
  inputLabel="Email"
42
- placeholder="Email"
43
- themeType={props.theme}
35
+ placeholder="Enter your email"
36
+ startAdornment={
37
+ <InputAdornment position="start">
38
+ <EmailIcon />
39
+ </InputAdornment>
40
+ }
44
41
  rules={{
45
42
  required: "Email is required",
46
43
  pattern: {
@@ -54,45 +51,76 @@ export const SignInForm = (props) => {
54
51
 
55
52
  <HawaTextField
56
53
  name="password"
57
- placeholder="Password"
58
- themeType={props.theme}
54
+ placeholder="Enter password"
59
55
  type="password"
60
56
  inputLabel="Password"
57
+ startAdornment={
58
+ <InputAdornment position="start">
59
+ <PasswordIcon />
60
+ </InputAdornment>
61
+ }
61
62
  rules={{
62
63
  required: "Password is rquired"
63
64
  }}
64
65
  helperText={errors.password?.message}
65
66
  />
67
+ <HawaTypography
68
+ style={{
69
+ cursor: "pointer",
70
+ marginTop: 5,
71
+ width: "max-content",
72
+ padding: 5
73
+ }}
74
+ onClick={() => console.log("res")}
75
+ >
76
+ Forgot password?
77
+ </HawaTypography>
66
78
  <ActionButton
67
79
  type="submit"
68
80
  fullWidth
69
81
  last={"true"}
70
82
  text={"Sign In"}
71
- themeType={props.theme}
72
83
  />
73
84
  </form>
74
85
  </FormProvider>
75
86
  </Box>
87
+ <HawaTypography
88
+ style={{
89
+ marginTop: 5,
90
+ // width: "max-content",
91
+ textAlign: "center",
92
+ padding: 5
93
+ }}
94
+ >
95
+ New user?{" "}
96
+ <span
97
+ onClick={() => console.log("res")}
98
+ style={{
99
+ cursor: "pointer",
100
+ color: "blue",
101
+ textAlign: "center"
102
+ }}
103
+ >
104
+ Sign up
105
+ </span>
106
+ </HawaTypography>
76
107
  {props.viaGoogle && (
77
- <GoogleButton
78
- themeType={props.theme}
79
- outlined
108
+ <HawaLogoButton
109
+ logo="google"
80
110
  buttonText={props.googleButtonLabel}
81
111
  handleClick={props.handleGoogleSignIn}
82
112
  />
83
113
  )}
84
114
  {props.viaGithub && (
85
- <GithubButton
86
- outlined
87
- themeType={props.theme}
115
+ <HawaLogoButton
116
+ logo="github"
88
117
  buttonText={props.githubButtonLabel}
89
118
  handleClick={props.handleGithubSignIn}
90
119
  />
91
120
  )}
92
121
  {props.viaTwitter && (
93
- <TwitterButton
94
- outlined
95
- themeType={props.theme}
122
+ <HawaLogoButton
123
+ logo="twitter"
96
124
  buttonText={props.twitterButtonLabel}
97
125
  handleClick={props.handleTwitterSignIn}
98
126
  />
@@ -3,14 +3,18 @@ import { Box } from "../../layout";
3
3
  import {
4
4
  HawaTextField,
5
5
  ActionButton,
6
- GoogleButton,
7
- GithubButton,
8
- TwitterButton,
9
- HawaAlert
6
+ HawaAlert,
7
+ HawaTypography,
8
+ HawaLogoButton
10
9
  } from "../../ui";
11
10
  import PropTypes from "prop-types";
12
11
  import { FormProvider, useForm } from "react-hook-form";
13
12
 
13
+ import PersonIcon from "@mui/icons-material/PermIdentityOutlined";
14
+ import InputAdornment from "@mui/material/InputAdornment";
15
+ import EmailIcon from "@mui/icons-material/MailOutline";
16
+ import PasswordIcon from "@mui/icons-material/HttpsOutlined";
17
+
14
18
  export const SignUpForm = (props) => {
15
19
  const methods = useForm();
16
20
  const {
@@ -24,25 +28,41 @@ export const SignUpForm = (props) => {
24
28
  } = methods;
25
29
 
26
30
  return (
27
- <Box themeType={props.theme} maxWidth={400} noColor noMargin noPadding>
28
- <Box themeType={props.theme} noMargin>
31
+ <Box maxWidth={400} noColor noMargin noPadding>
32
+ <Box noMargin>
29
33
  {props.error && (
30
- <HawaAlert
31
- themeType={props.theme}
32
- text="This is a sign in alert"
33
- severity="error"
34
- />
34
+ <HawaAlert text="This is a sign in alert" severity="error" />
35
35
  )}
36
36
  <FormProvider {...methods}>
37
37
  <form onSubmit={handleSubmit(props.handleSignUp)}>
38
38
  <HawaTextField
39
- themeType={props.theme}
39
+ name="fullName"
40
+ placeholder="Fulan AlFulani"
41
+ type="text"
42
+ inputLabel="Full Name"
43
+ startAdornment={
44
+ <InputAdornment position="start">
45
+ <PersonIcon />
46
+ </InputAdornment>
47
+ }
48
+ rules={{
49
+ required: "Full name rquired"
50
+ }}
51
+ helperText={errors.fullName?.message}
52
+ />
53
+
54
+ <HawaTextField
40
55
  type="text"
41
56
  inputLabel="Email"
42
- placeholder="Email"
57
+ placeholder="Enter your email"
43
58
  name="email"
59
+ startAdornment={
60
+ <InputAdornment position="start">
61
+ <EmailIcon />
62
+ </InputAdornment>
63
+ }
44
64
  rules={{
45
- required: "Email is required",
65
+ required: "Email required",
46
66
  pattern: {
47
67
  value:
48
68
  /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
@@ -53,56 +73,65 @@ export const SignUpForm = (props) => {
53
73
  />
54
74
  <HawaTextField
55
75
  name="password"
56
- placeholder="Password"
57
- themeType={props.theme}
76
+ placeholder="Minimum 8 characters"
58
77
  type="password"
59
78
  inputLabel="Password"
79
+ startAdornment={
80
+ <InputAdornment position="start">
81
+ <PasswordIcon />
82
+ </InputAdornment>
83
+ }
60
84
  rules={{
61
- required: "Password is rquired"
85
+ required: "Password rquired",
86
+ minLength: {
87
+ value: 8,
88
+ message: "Password too short"
89
+ }
62
90
  }}
63
91
  helperText={errors.password?.message}
64
92
  />
65
- <HawaTextField
66
- name="confirmPassword"
67
- placeholder="Password"
68
- themeType={props.theme}
69
- type="password"
70
- inputLabel="Confirm Password"
71
- rules={{
72
- required: "Password is rquired"
73
- }}
74
- helperText={errors.confirmPassword?.message}
75
- />
76
- <ActionButton
77
- fullWidth
78
- type="submit"
79
- text="Sign Up"
80
- last
81
- themeType={props.theme}
82
- />
93
+
94
+ <ActionButton fullWidth type="submit" text="Sign Up" last />
83
95
  </form>
84
96
  </FormProvider>
85
97
  </Box>
98
+ <HawaTypography
99
+ style={{
100
+ marginTop: 5,
101
+ // width: "max-content",
102
+ textAlign: "center",
103
+ padding: 5
104
+ }}
105
+ >
106
+ Existing user?{" "}
107
+ <span
108
+ onClick={() => console.log("res")}
109
+ style={{
110
+ cursor: "pointer",
111
+ color: "blue",
112
+ textAlign: "center"
113
+ }}
114
+ >
115
+ Sign in
116
+ </span>
117
+ </HawaTypography>
86
118
  {props.viaGoogle && (
87
- <GoogleButton
88
- outlined
89
- themeType={props.theme}
119
+ <HawaLogoButton
120
+ logo="google"
90
121
  buttonText={props.googleButtonLabel}
91
122
  handleClick={props.handleGoogleSignIn}
92
123
  />
93
124
  )}
94
125
  {props.viaGithub && (
95
- <GithubButton
96
- outlined
97
- themeType={props.theme}
126
+ <HawaLogoButton
127
+ logo="github"
98
128
  buttonText={props.githubButtonLabel}
99
- handleClick={props.handleGithubSignUp}
129
+ handleClick={props.handleGithubSignIn}
100
130
  />
101
131
  )}
102
132
  {props.viaTwitter && (
103
- <TwitterButton
104
- outlined
105
- themeType={props.theme}
133
+ <HawaLogoButton
134
+ logo="twitter"
106
135
  buttonText={props.twitterButtonLabel}
107
136
  handleClick={props.handleTwitterSignIn}
108
137
  />
@@ -1,31 +1,52 @@
1
1
  import React, { useState } from "react";
2
2
  import { HawaTextField, ActionButton, HawaTypography } from "../../ui";
3
3
  import { Box } from "../../layout";
4
+ import { FormProvider, useForm } from "react-hook-form";
4
5
 
5
6
  export const ChargeWalletForm = (props) => {
6
7
  const [walletAmount, setWalletAmount] = useState(0);
8
+ const methods = useForm();
9
+ const {
10
+ formState: { errors },
11
+ handleSubmit
12
+ } = methods;
13
+
7
14
  return (
8
- <Box themeType={props.theme} maxWidth={400} noColor noMargin noPadding>
9
- <Box themeType={props.theme} noMargin>
10
- <HawaTypography variant="h2" align="center" themeType={props.theme}>
11
- {walletAmount.toLocaleString("en")}{" "}
15
+ <Box maxWidth={400} noColor noMargin noPadding>
16
+ <Box noMargin>
17
+ <HawaTypography variant="h2" align="center">
18
+ {Number(walletAmount).toLocaleString("en")}{" "}
12
19
  <span style={{ fontSize: 20, letterSpacing: 1 }}>
13
20
  {props.currency}
14
21
  </span>
15
22
  </HawaTypography>
16
- <HawaTypography themeType={props.theme}></HawaTypography>
17
- <HawaTextField
18
- themeType={props.theme}
19
- type="number"
20
- inputLabel="Amount" //move this to props
21
- onChange={(e) => setWalletAmount(e.target.value)}
22
- />
23
- <ActionButton
24
- last
25
- text={"Charge Wallet"} //move this to props
26
- themeType={props.theme}
27
- onClick={props.handleSignIn}
28
- />
23
+ <FormProvider {...methods}>
24
+ <form
25
+ onChange={(e) => {
26
+ e.preventDefault();
27
+ setWalletAmount(methods.getValues().amount);
28
+ }}
29
+ style={{ marginTop: 10 }}
30
+ onSubmit={handleSubmit(props.handleChargeWallet)}
31
+ >
32
+ <HawaTextField
33
+ name="amount"
34
+ placeholder="Enter amount"
35
+ type="number"
36
+ value={walletAmount}
37
+ rules={{
38
+ required: "Password is rquired"
39
+ }}
40
+ helperText={errors.amount?.message}
41
+ />
42
+ <ActionButton
43
+ last
44
+ fullWidth
45
+ text={"Charge Wallet"} //move this to props
46
+ onClick={props.handleSignIn}
47
+ />
48
+ </form>
49
+ </FormProvider>
29
50
  </Box>
30
51
  </Box>
31
52
  );
@@ -1,30 +1,59 @@
1
1
  import React from "react";
2
- import {
3
- HawaTextField,
4
- ActionButton,
5
- GoogleButton,
6
- TwitterButton,
7
- GithubButton
8
- } from "../../ui";
2
+ import { HawaTextField, ActionButton } from "../../ui";
9
3
  import { Box } from "../../layout";
4
+ import { FormProvider, useForm } from "react-hook-form";
10
5
 
11
6
  export const CreditCardForm = (props) => {
7
+ const methods = useForm();
8
+ const {
9
+ formState: { errors },
10
+ handleSubmit
11
+ } = methods;
12
+
12
13
  return (
13
- <Box themeType={props.theme} maxWidth={400} noColor noMargin noPadding>
14
- <Box themeType={props.theme} noMargin>
15
- <HawaTextField themeType={props.theme} type="text" inputLabel="Email" />
14
+ <Box maxWidth={400} noColor noMargin noPadding>
15
+ <Box noMargin>
16
+ <FormProvider {...methods}>
17
+ <form onSubmit={handleSubmit(props.handle)}>
18
+ <HawaTextField
19
+ name="password"
20
+ placeholder="Enter password"
21
+ type="password"
22
+ inputLabel="Password"
23
+ // startAdornment={
24
+ // <InputAdornment position="start">
25
+ // <PasswordIcon />
26
+ // </InputAdornment>
27
+ // }
28
+ rules={{
29
+ required: "Password is rquired"
30
+ }}
31
+ helperText={errors.password?.message}
32
+ />
16
33
 
17
- <HawaTextField
18
- themeType={props.theme}
19
- type="text"
20
- inputLabel="Password"
21
- />
22
- <ActionButton
23
- last
24
- text={"Sign In"}
25
- themeType={props.theme}
26
- onClick={props.handleSignIn}
27
- />
34
+ <HawaTextField
35
+ name="password"
36
+ placeholder="Enter password"
37
+ type="password"
38
+ inputLabel="Password"
39
+ // startAdornment={
40
+ // <InputAdornment position="start">
41
+ // <PasswordIcon />
42
+ // </InputAdornment>
43
+ // }
44
+ rules={{
45
+ required: "Password is rquired"
46
+ }}
47
+ helperText={errors.password?.message}
48
+ />
49
+ <ActionButton
50
+ last
51
+ fullWidth
52
+ text={"Sign In"}
53
+ onClick={props.handleSignIn}
54
+ />
55
+ </form>
56
+ </FormProvider>
28
57
  </Box>
29
58
  </Box>
30
59
  );
@@ -1,34 +1,13 @@
1
1
  import React from "react";
2
- import {
3
- HawaTextField,
4
- ActionButton,
5
- GoogleButton,
6
- TwitterButton,
7
- GithubButton,
8
- VisaMasterButton,
9
- MadaButton,
10
- STCPayButton,
11
- PayPalButton,
12
- GooglePayButton,
13
- ApplePayButton,
14
- WalletButton
15
- } from "../../ui";
2
+ import { ActionButton } from "../../ui";
16
3
  import { Box } from "../../layout";
17
- import PropTypes from "prop-types";
18
4
 
19
5
  export const PayWithWallet = (props) => {
20
6
  return (
21
- <Box themeType={props.theme} maxWidth={400} noColor noMargin noPadding>
22
- <Box themeType={props.theme} noMargin>
7
+ <Box maxWidth={400} noColor noMargin noPadding>
8
+ <Box noMargin>
23
9
  <div>Wallet Balance</div>
24
- {props.viaWallet && (
25
- <WalletButton
26
- themeType={props.theme}
27
- outlined
28
- buttonText={props.walletLabel}
29
- handleClick={props.handleWallet}
30
- />
31
- )}
10
+ <ActionButton text="Pay now" />
32
11
  </Box>
33
12
  </Box>
34
13
  );
@@ -1,79 +1,58 @@
1
1
  import React from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import { Box } from "../../layout";
4
- import {
5
- HawaTextField,
6
- VisaMasterButton,
7
- MadaButton,
8
- STCPayButton,
9
- PayPalButton,
10
- GooglePayButton,
11
- ApplePayButton,
12
- WalletButton,
13
- HawaTypography
14
- } from "../../ui";
4
+ import { HawaTextField, HawaTypography, HawaLogoButton } from "../../ui";
15
5
 
16
6
  export const SelectPayment = (props) => {
17
7
  return (
18
- <Box themeType={props.theme} maxWidth={400} noColor noMargin noPadding>
19
- <Box themeType={props.theme} noMargin>
20
- <HawaTypography themeType={props.theme} align="center">
21
- Choose Payment
22
- </HawaTypography>
8
+ <Box maxWidth={400} noColor noMargin noPadding>
9
+ <Box noMargin>
10
+ <HawaTypography align="center">Choose Payment Method</HawaTypography>
23
11
  {props.viaWallet && (
24
- <WalletButton
25
- outlined
26
- themeType={props.theme}
12
+ <HawaLogoButton
13
+ logo="wallet"
27
14
  buttonText={props.walletLabel}
28
15
  onClick={props.handleWallet}
29
16
  />
30
17
  )}
31
18
  {props.viaCreditCard && (
32
- <VisaMasterButton
33
- outlined
34
- themeType={props.theme}
19
+ <HawaLogoButton
20
+ logo="visa/master"
35
21
  buttonText={props.visaMasterLabel}
36
22
  handleClick={props.handleCreditCard}
37
23
  />
38
24
  )}
39
25
  {props.viaMada && (
40
- <MadaButton
41
- outlined
42
- themeType={props.theme}
26
+ <HawaLogoButton
27
+ logo="mada"
43
28
  buttonText={props.madaLabel}
44
29
  handleClick={props.handleMada}
45
30
  />
46
31
  )}
47
-
48
32
  {props.viaSTCPay && (
49
- <STCPayButton
50
- outlined
51
- themeType={props.theme}
33
+ <HawaLogoButton
34
+ logo="stcpay"
52
35
  buttonText={props.stcPayLabel}
53
36
  handleClick={props.handleSTCPay}
54
37
  />
55
38
  )}
56
39
  {props.viaPayPal && (
57
- <PayPalButton
58
- outlined
59
- themeType={props.theme}
40
+ <HawaLogoButton
41
+ logo="paypal"
60
42
  buttonText={props.paypalLabel}
61
43
  handleClick={props.handlePayPal}
62
44
  />
63
45
  )}
64
46
  {props.viaGooglePay && (
65
- <GooglePayButton
66
- outlined
67
- themeType={props.theme}
47
+ <HawaLogoButton
48
+ logo="googlepay"
68
49
  buttonText={props.googlePayLabel}
69
50
  handleClick={props.handleGooglePay}
70
51
  />
71
52
  )}
72
-
73
53
  {props.viaApplePay && (
74
- <ApplePayButton
75
- outlined
76
- themeType={props.theme}
54
+ <HawaLogoButton
55
+ logo="applepay"
77
56
  buttonText={props.applePayLabel}
78
57
  handleClick={props.handleApplePay}
79
58
  />
package/src/layout/Box.js CHANGED
@@ -2,28 +2,28 @@ import React, { useContext } from "react";
2
2
  import { ThemeProvider } from "../themes/HawaProvider";
3
3
 
4
4
  export const Box = (props) => {
5
- const theme = useContext(ThemeProvider);
5
+ const { hawaTheme, themeName } = useContext(ThemeProvider);
6
6
  let boxStyle = {};
7
7
 
8
- let currentTheme = Object.keys(theme.actionButton).find(
9
- (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
8
+ let currentTheme = Object.keys(hawaTheme.layout).find(
9
+ (tName) => tName.toLowerCase() === themeName?.toLowerCase()
10
10
  );
11
11
  if (currentTheme) {
12
12
  boxStyle = {
13
13
  display: "flex",
14
- flexDirection: "column",
15
- ...theme.layout[currentTheme],
14
+ flexDirection: props.horizontal ? "row" : "column",
15
+ ...hawaTheme?.layout[currentTheme],
16
16
  backgroundColor: props.noColor
17
17
  ? "none"
18
- : theme.layout[currentTheme].backgroundColor,
19
- padding: props.noPadding ? 0 : theme.layout[currentTheme].padding,
20
- margin: props.noMargin ? 0 : theme.layout[currentTheme].margin,
18
+ : hawaTheme.layout[currentTheme].backgroundColor,
19
+ padding: props.noPadding ? 0 : hawaTheme?.layout[currentTheme].padding,
20
+ margin: props.noMargin ? 0 : hawaTheme?.layout[currentTheme].margin,
21
21
  maxWidth: props.maxWidth
22
22
  };
23
23
  } else {
24
24
  boxStyle = {
25
25
  display: "flex",
26
- flexDirection: "column",
26
+ flexDirection: props.horizontal ? "row" : "column",
27
27
  color: "white",
28
28
  marginTop: props.last ? 10 * 2 : 0,
29
29
  backgroundColor: props.noColor ? "none" : "lightGrey",