@sikka/hawa 0.0.6 → 0.0.7

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 (50) hide show
  1. package/es/index.es.js +1 -1
  2. package/lib/index.js +1 -1
  3. package/package.json +1 -1
  4. package/src/blocks/Account/UserProfile.js +57 -7
  5. package/src/blocks/AuthForms/NewPasswordForm.js +20 -19
  6. package/src/blocks/AuthForms/ResetPasswordForm.js +12 -15
  7. package/src/blocks/AuthForms/SignInForm.js +20 -25
  8. package/src/blocks/AuthForms/SignUpForm.js +44 -37
  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 +3 -21
  13. package/src/layout/Box.js +9 -9
  14. package/src/stories/BlocksStories/AuthForm.stories.js +4 -6
  15. package/src/stories/BlocksStories/PaymentForm.stories.js +10 -6
  16. package/src/stories/BlocksStories/UserForm.stories.js +41 -0
  17. package/src/stories/LayoutStories/Box.stories.js +4 -4
  18. package/src/stories/UIStories/ActionButton.stories.js +2 -2
  19. package/src/stories/UIStories/Alert.stories.js +4 -17
  20. package/src/stories/UIStories/RadioSelector.stories.js +20 -35
  21. package/src/stories/UIStories/SettingsRow.stories.js +64 -0
  22. package/src/themes/HawaProvider.js +57 -18
  23. package/src/ui/ActionButton.js +11 -8
  24. package/src/ui/ApplePayButton.js +4 -71
  25. package/src/ui/GithubButton.js +4 -70
  26. package/src/ui/GoogleButton.js +4 -63
  27. package/src/ui/GooglePayButton.js +5 -72
  28. package/src/ui/HawaAlert.js +5 -5
  29. package/src/ui/HawaButton.js +6 -6
  30. package/src/ui/HawaInputLabel.js +4 -4
  31. package/src/ui/HawaLogoButton.js +6 -11
  32. package/src/ui/HawaRadio.js +50 -28
  33. package/src/ui/HawaSettingsRow.js +71 -0
  34. package/src/ui/HawaTextField.js +31 -34
  35. package/src/ui/HawaTypography.js +4 -4
  36. package/src/ui/MadaButton.js +5 -72
  37. package/src/ui/PayPalButton.js +4 -71
  38. package/src/ui/STCPayButton.js +5 -72
  39. package/src/ui/TwitterButton.js +3 -59
  40. package/src/ui/VisaMasterButton.js +4 -71
  41. package/src/ui/index.js +1 -1
  42. package/storybook-static/iframe.html +1 -1
  43. package/storybook-static/main.b7ffaed0.iframe.bundle.js +1 -0
  44. package/storybook-static/vendors~main.8ebae370.iframe.bundle.js +76 -0
  45. package/storybook-static/{vendors~main.30a2c5d7.iframe.bundle.js.LICENSE.txt → vendors~main.8ebae370.iframe.bundle.js.LICENSE.txt} +0 -0
  46. package/storybook-static/vendors~main.8ebae370.iframe.bundle.js.map +1 -0
  47. package/src/stories/BlocksStories/UserAccount.stories.js +0 -46
  48. package/storybook-static/main.e55ce615.iframe.bundle.js +0 -1
  49. package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js +0 -76
  50. package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js.map +0 -1
@@ -11,6 +11,11 @@ import {
11
11
  import PropTypes from "prop-types";
12
12
  import { FormProvider, useForm } from "react-hook-form";
13
13
 
14
+ import PersonIcon from "@mui/icons-material/PermIdentityOutlined";
15
+ import InputAdornment from "@mui/material/InputAdornment";
16
+ import EmailIcon from "@mui/icons-material/MailOutline";
17
+ import PasswordIcon from "@mui/icons-material/HttpsOutlined";
18
+
14
19
  export const SignUpForm = (props) => {
15
20
  const methods = useForm();
16
21
  const {
@@ -24,25 +29,41 @@ export const SignUpForm = (props) => {
24
29
  } = methods;
25
30
 
26
31
  return (
27
- <Box themeType={props.theme} maxWidth={400} noColor noMargin noPadding>
28
- <Box themeType={props.theme} noMargin>
32
+ <Box maxWidth={400} noColor noMargin noPadding>
33
+ <Box noMargin>
29
34
  {props.error && (
30
- <HawaAlert
31
- themeType={props.theme}
32
- text="This is a sign in alert"
33
- severity="error"
34
- />
35
+ <HawaAlert text="This is a sign in alert" severity="error" />
35
36
  )}
36
37
  <FormProvider {...methods}>
37
38
  <form onSubmit={handleSubmit(props.handleSignUp)}>
38
39
  <HawaTextField
39
- themeType={props.theme}
40
+ name="fullName"
41
+ placeholder="Fulan AlFulani"
42
+ type="text"
43
+ inputLabel="Full Name"
44
+ startAdornment={
45
+ <InputAdornment position="start">
46
+ <PersonIcon />
47
+ </InputAdornment>
48
+ }
49
+ rules={{
50
+ required: "Full name rquired"
51
+ }}
52
+ helperText={errors.fullName?.message}
53
+ />
54
+
55
+ <HawaTextField
40
56
  type="text"
41
57
  inputLabel="Email"
42
- placeholder="Email"
58
+ placeholder="Enter your email"
43
59
  name="email"
60
+ startAdornment={
61
+ <InputAdornment position="start">
62
+ <EmailIcon />
63
+ </InputAdornment>
64
+ }
44
65
  rules={{
45
- required: "Email is required",
66
+ required: "Email required",
46
67
  pattern: {
47
68
  value:
48
69
  /^(([^<>()[\]\\.,;:\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 +74,42 @@ export const SignUpForm = (props) => {
53
74
  />
54
75
  <HawaTextField
55
76
  name="password"
56
- placeholder="Password"
57
- themeType={props.theme}
77
+ placeholder="Minimum 8 characters"
58
78
  type="password"
59
79
  inputLabel="Password"
80
+ startAdornment={
81
+ <InputAdornment position="start">
82
+ <PasswordIcon />
83
+ </InputAdornment>
84
+ }
60
85
  rules={{
61
- required: "Password is rquired"
86
+ required: "Password rquired",
87
+ minLength: {
88
+ value: 8,
89
+ message: "Password too short"
90
+ }
62
91
  }}
63
92
  helperText={errors.password?.message}
64
93
  />
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
- />
94
+
95
+ <ActionButton fullWidth type="submit" text="Sign Up" last />
83
96
  </form>
84
97
  </FormProvider>
85
98
  </Box>
86
99
  {props.viaGoogle && (
87
100
  <GoogleButton
88
- outlined
89
- themeType={props.theme}
90
101
  buttonText={props.googleButtonLabel}
91
102
  handleClick={props.handleGoogleSignIn}
92
103
  />
93
104
  )}
94
105
  {props.viaGithub && (
95
106
  <GithubButton
96
- outlined
97
- themeType={props.theme}
98
107
  buttonText={props.githubButtonLabel}
99
108
  handleClick={props.handleGithubSignUp}
100
109
  />
101
110
  )}
102
111
  {props.viaTwitter && (
103
112
  <TwitterButton
104
- outlined
105
- themeType={props.theme}
106
113
  buttonText={props.twitterButtonLabel}
107
114
  handleClick={props.handleTwitterSignIn}
108
115
  />
@@ -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, WalletButton } 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
  );
@@ -15,65 +15,47 @@ import {
15
15
 
16
16
  export const SelectPayment = (props) => {
17
17
  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>
18
+ <Box maxWidth={400} noColor noMargin noPadding>
19
+ <Box noMargin>
20
+ <HawaTypography align="center">Choose Payment Method</HawaTypography>
23
21
  {props.viaWallet && (
24
22
  <WalletButton
25
- outlined
26
- themeType={props.theme}
27
23
  buttonText={props.walletLabel}
28
24
  onClick={props.handleWallet}
29
25
  />
30
26
  )}
31
27
  {props.viaCreditCard && (
32
28
  <VisaMasterButton
33
- outlined
34
- themeType={props.theme}
35
29
  buttonText={props.visaMasterLabel}
36
30
  handleClick={props.handleCreditCard}
37
31
  />
38
32
  )}
39
33
  {props.viaMada && (
40
34
  <MadaButton
41
- outlined
42
- themeType={props.theme}
43
35
  buttonText={props.madaLabel}
44
36
  handleClick={props.handleMada}
45
37
  />
46
38
  )}
47
-
48
39
  {props.viaSTCPay && (
49
40
  <STCPayButton
50
- outlined
51
- themeType={props.theme}
52
41
  buttonText={props.stcPayLabel}
53
42
  handleClick={props.handleSTCPay}
54
43
  />
55
44
  )}
56
45
  {props.viaPayPal && (
57
46
  <PayPalButton
58
- outlined
59
- themeType={props.theme}
60
47
  buttonText={props.paypalLabel}
61
48
  handleClick={props.handlePayPal}
62
49
  />
63
50
  )}
64
51
  {props.viaGooglePay && (
65
52
  <GooglePayButton
66
- outlined
67
- themeType={props.theme}
68
53
  buttonText={props.googlePayLabel}
69
54
  handleClick={props.handleGooglePay}
70
55
  />
71
56
  )}
72
-
73
57
  {props.viaApplePay && (
74
58
  <ApplePayButton
75
- outlined
76
- themeType={props.theme}
77
59
  buttonText={props.applePayLabel}
78
60
  handleClick={props.handleApplePay}
79
61
  />
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",
@@ -20,11 +20,10 @@ export default {
20
20
 
21
21
  const SignInTemplate = (args) => {
22
22
  return (
23
- <HawaProvider theme={{ ...defaultTheme }}>
23
+ <HawaProvider themeName={args.theme}>
24
24
  <SignInForm
25
25
  {...args}
26
26
  error={args.showError}
27
- theme={args.theme}
28
27
  handleSignIn={(e) => console.log("singing in via email", e)}
29
28
  viaGoogle={args.viaGoogle}
30
29
  googleButtonLabel={"Sign in with Google"}
@@ -51,10 +50,9 @@ SignIn.args = {
51
50
 
52
51
  const SignUpTemplate = (args) => {
53
52
  return (
54
- <HawaProvider theme={{ ...defaultTheme }}>
53
+ <HawaProvider themeName={args.theme}>
55
54
  <SignUpForm
56
55
  {...args}
57
- theme={args.theme}
58
56
  error={args.showError}
59
57
  handleSignUp={() => console.log("singing up via email")}
60
58
  viaGoogle={args.viaGoogle}
@@ -81,7 +79,7 @@ SignUp.args = {
81
79
 
82
80
  const ResetPasswordTemplate = (args) => {
83
81
  return (
84
- <HawaProvider theme={{ ...defaultTheme }}>
82
+ <HawaProvider themeName={args.theme}>
85
83
  <ResetPasswordForm error={args.showError} theme={args.theme} {...args} />
86
84
  </HawaProvider>
87
85
  );
@@ -93,7 +91,7 @@ ResetPassword.args = {
93
91
  };
94
92
  const NewPasswordTemplate = (args) => {
95
93
  return (
96
- <HawaProvider theme={{ ...defaultTheme }}>
94
+ <HawaProvider themeName={args.theme}>
97
95
  <NewPasswordForm error={args.showError} theme={args.theme} {...args} />
98
96
  </HawaProvider>
99
97
  );
@@ -25,6 +25,7 @@ export default {
25
25
  args: {
26
26
  theme: "primary",
27
27
  viaWallet: true,
28
+ viaMada: true,
28
29
  viaApplePay: true,
29
30
  viaGooglePay: true,
30
31
  viaSTCPay: true,
@@ -35,10 +36,9 @@ export default {
35
36
 
36
37
  export const PaymentSelection = (args) => {
37
38
  return (
38
- <HawaProvider theme={{ ...defaultTheme }}>
39
+ <HawaProvider themeName={args.theme}>
39
40
  <SelectPayment
40
41
  {...args}
41
- theme={args.theme}
42
42
  walletLabel="Wallet Balance"
43
43
  handleWallet={() => console.log("paying via wallet")}
44
44
  visaMasterLabel="Credit Card"
@@ -74,9 +74,13 @@ export const PayViaCreditCard = (args) => {
74
74
  };
75
75
 
76
76
  export const ChargeWallet = (args) => {
77
- return <ChargeWalletForm theme={args.theme} currency="SAR" />;
77
+ return (
78
+ <HawaProvider themeName={args.theme}>
79
+ <ChargeWalletForm currency="SAR" />
80
+ </HawaProvider>
81
+ );
78
82
  };
79
83
 
80
- // ChargeWallet.args = {
81
- // theme: "secondary"
82
- // };
84
+ ChargeWallet.args = {
85
+ theme: "secondary"
86
+ };
@@ -0,0 +1,41 @@
1
+ import React from "react";
2
+ import { UserProfile } from "../../blocks/Account";
3
+ import { defaultTheme, HawaProvider } from "../../themes/HawaProvider";
4
+
5
+ export default {
6
+ title: "Blocks/UserBlocks",
7
+ component: UserProfile,
8
+ argTypes: {
9
+ theme: {
10
+ options: ["primary", "secondary", "default"],
11
+ control: { type: "select" }
12
+ }
13
+ }
14
+ };
15
+
16
+ const theme = {
17
+ ...defaultTheme,
18
+ paddings: 20
19
+ };
20
+
21
+ export const UserAccount = (args) => {
22
+ return (
23
+ <HawaProvider theme={{ ...defaultTheme, ...theme }}>
24
+ <UserProfile {...args} />
25
+ </HawaProvider>
26
+ );
27
+ };
28
+
29
+ UserAccount.args = {
30
+ theme: "primary"
31
+ };
32
+ export const UserSettings = (args) => {
33
+ return (
34
+ <HawaProvider theme={{ ...defaultTheme, ...theme }}>
35
+ <UserProfile {...args} />
36
+ </HawaProvider>
37
+ );
38
+ };
39
+ UserSettings.args = {
40
+ theme: "primary"
41
+ };
@@ -7,14 +7,14 @@ const theme = {
7
7
 
8
8
  const Template = (args) => {
9
9
  return (
10
- <HawaProvider size={args.size} theme={{ ...defaultTheme, ...args.theme }}>
11
- <Box themeType="primary">Box 1</Box>
12
- <Box themeType="secondary">
10
+ <HawaProvider size={args.size} themeName={"secondary"}>
11
+ <Box>Box 1</Box>
12
+ <Box>
13
13
  <div style={{ backgroundColor: "white", padding: 10, color: "black" }}>
14
14
  testing box in box
15
15
  </div>
16
16
  </Box>
17
- <Box themeType="secondary">Box 3</Box>
17
+ <Box>Box 3</Box>
18
18
  </HawaProvider>
19
19
  );
20
20
  };
@@ -5,8 +5,8 @@ import { ActionButton } from "../../ui";
5
5
 
6
6
  const Template = (args) => {
7
7
  return (
8
- <HawaProvider theme={{ ...defaultTheme }}>
9
- <ActionButton themeType={args.theme} text={args.buttonLabel} />
8
+ <HawaProvider themeName={args.theme}>
9
+ <ActionButton text={args.buttonLabel} />
10
10
  </HawaProvider>
11
11
  );
12
12
  };
@@ -5,28 +5,15 @@ import { HawaAlert } from "../../ui";
5
5
 
6
6
  const Template = (args) => {
7
7
  return (
8
- <HawaProvider theme={{ ...defaultTheme }}>
8
+ <HawaProvider themeName={args.theme}>
9
9
  <HawaAlert
10
- themeType={args.theme}
11
10
  title="What?"
12
11
  text="This is a success alert"
13
12
  severity="success"
14
13
  />
15
- <HawaAlert
16
- themeType={args.theme}
17
- text="This is an info alert"
18
- severity="info"
19
- />
20
- <HawaAlert
21
- themeType={args.theme}
22
- text="This is a warning alert"
23
- severity="warning"
24
- />
25
- <HawaAlert
26
- themeType={args.theme}
27
- text="This is an error alert"
28
- severity="error"
29
- />
14
+ <HawaAlert text="This is an info alert" severity="info" />
15
+ <HawaAlert text="This is a warning alert" severity="warning" />
16
+ <HawaAlert text="This is an error alert" severity="error" />
30
17
  </HawaProvider>
31
18
  );
32
19
  };