@sikka/hawa 0.0.10 → 0.0.13

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 (95) hide show
  1. package/es/index.es.js +1 -1
  2. package/lib/index.js +1 -1
  3. package/package.json +5 -4
  4. package/src/blocks/Account/UserProfileForm.js +79 -0
  5. package/src/blocks/Account/UserSettingsForm.js +13 -0
  6. package/src/blocks/Account/index.js +2 -2
  7. package/src/blocks/AuthForms/NewPasswordForm.js +58 -86
  8. package/src/blocks/AuthForms/ResetPasswordForm.js +44 -43
  9. package/src/blocks/AuthForms/SignInForm.js +99 -103
  10. package/src/blocks/AuthForms/SignUpForm.js +106 -104
  11. package/src/blocks/Payment/ChargeWalletForm.js +40 -37
  12. package/src/blocks/Payment/CreditCardForm.js +50 -45
  13. package/src/blocks/Payment/PayWithWallet.js +17 -7
  14. package/src/blocks/Payment/PaymentMethod.js +0 -1
  15. package/src/blocks/Payment/SelectPayment.js +54 -56
  16. package/src/blocks/Pricing/SignInForm.js +126 -0
  17. package/src/elements/ActionButton.js +38 -0
  18. package/src/elements/AdaptiveButton.js +32 -0
  19. package/src/{ui → elements}/AutoCompleteField.js +0 -0
  20. package/src/{ui → elements}/DragDropImages.js +0 -0
  21. package/src/{ui → elements}/Hawa.js +0 -0
  22. package/src/elements/HawaAlert.js +35 -0
  23. package/src/elements/HawaButton.js +47 -0
  24. package/src/elements/HawaCard.js +77 -0
  25. package/src/{ui → elements}/HawaCheckbox.js +0 -0
  26. package/src/elements/HawaInputLabel.js +31 -0
  27. package/src/{ui → elements}/HawaLogoButton.js +7 -45
  28. package/src/elements/HawaRadio.js +32 -0
  29. package/src/elements/HawaSettingsRow.js +27 -0
  30. package/src/elements/HawaSwitch.js +6 -0
  31. package/src/{ui → elements}/HawaTextArea.js +1 -1
  32. package/src/elements/HawaTextField.js +160 -0
  33. package/src/elements/HawaTypography.js +26 -0
  34. package/src/{ui → elements}/RadioBox.js +0 -0
  35. package/src/{ui → elements}/Row.js +1 -1
  36. package/src/{ui → elements}/SelectedField.js +0 -0
  37. package/src/{ui → elements}/StyledTooltip.js +1 -1
  38. package/src/{ui → elements}/TabPanel.js +1 -1
  39. package/src/{ui → elements}/index.js +1 -1
  40. package/src/index.js +0 -2
  41. package/src/layout/Box.js +36 -33
  42. package/src/stories/BlocksStories/Account/UserProfile.stories.js +21 -0
  43. package/src/stories/BlocksStories/Account/UserSettings.stories.js +55 -0
  44. package/src/stories/BlocksStories/Auth/NewPassword.stories.js +60 -0
  45. package/src/stories/BlocksStories/Auth/ResetPassword.stories.js +59 -0
  46. package/src/stories/BlocksStories/Auth/SignIn.stories.js +89 -0
  47. package/src/stories/BlocksStories/Auth/SignUp.stories.js +90 -0
  48. package/src/stories/BlocksStories/Payment/ChargeWallet.stories.js +30 -0
  49. package/src/stories/BlocksStories/Payment/PayWithCreditCard.stories.js +37 -0
  50. package/src/stories/BlocksStories/Payment/PayWithWallet.stories.js +17 -0
  51. package/src/stories/BlocksStories/Payment/PaymentSelection.stories.js +60 -0
  52. package/src/stories/ElementsStories/AdaptiveButton.stories.js +51 -0
  53. package/src/stories/{UIStories → ElementsStories}/Alert.stories.js +3 -4
  54. package/src/stories/{UIStories → ElementsStories}/InputLabel.stories.js +1 -1
  55. package/src/stories/ElementsStories/ItemCard.stories.js +18 -0
  56. package/src/stories/ElementsStories/LogoButtons.stories.js +73 -0
  57. package/src/stories/ElementsStories/PricingCard.stories.js +27 -0
  58. package/src/stories/ElementsStories/RadioSelector.stories.js +36 -0
  59. package/src/stories/ElementsStories/SettingsRow.stories.js +63 -0
  60. package/src/stories/{UIStories → ElementsStories}/TextField.stories.js +1 -1
  61. package/src/stories/LayoutStories/Box.stories.js +11 -31
  62. package/storybook-static/8.1bf48ea7.iframe.bundle.js +1 -0
  63. package/storybook-static/iframe.html +1 -1
  64. package/storybook-static/index.html +1 -1
  65. package/storybook-static/main.00b064cb.iframe.bundle.js +1 -0
  66. package/storybook-static/{runtime~main.cfefe972.iframe.bundle.js → runtime~main.f1ebae9b.iframe.bundle.js} +1 -1
  67. package/storybook-static/vendors~main.5eab66d3.iframe.bundle.js +76 -0
  68. package/storybook-static/{vendors~main.aa1d952a.iframe.bundle.js.LICENSE.txt → vendors~main.5eab66d3.iframe.bundle.js.LICENSE.txt} +0 -0
  69. package/storybook-static/vendors~main.5eab66d3.iframe.bundle.js.map +1 -0
  70. package/src/blocks/Account/UserProfile.js +0 -65
  71. package/src/blocks/Account/UserSettings.js +0 -15
  72. package/src/stories/BlocksStories/AuthForm.stories.js +0 -105
  73. package/src/stories/BlocksStories/PaymentForm.stories.js +0 -86
  74. package/src/stories/BlocksStories/UserForm.stories.js +0 -41
  75. package/src/stories/HawaProvider.stories.js +0 -22
  76. package/src/stories/UIStories/ActionButton.stories.js +0 -46
  77. package/src/stories/UIStories/AdaptiveButton.stories.js +0 -81
  78. package/src/stories/UIStories/CheckBox.stories.js +0 -34
  79. package/src/stories/UIStories/LogoButtons.stories.js +0 -90
  80. package/src/stories/UIStories/RadioSelector.stories.js +0 -53
  81. package/src/stories/UIStories/SettingsRow.stories.js +0 -64
  82. package/src/themes/HawaProvider.js +0 -183
  83. package/src/ui/ActionButton.js +0 -41
  84. package/src/ui/AdaptiveButton.js +0 -136
  85. package/src/ui/HawaAlert.js +0 -37
  86. package/src/ui/HawaButton.js +0 -48
  87. package/src/ui/HawaInputLabel.js +0 -32
  88. package/src/ui/HawaRadio.js +0 -73
  89. package/src/ui/HawaSettingsRow.js +0 -71
  90. package/src/ui/HawaTextField.js +0 -107
  91. package/src/ui/HawaTypography.js +0 -28
  92. package/storybook-static/8.c4cb6081.iframe.bundle.js +0 -1
  93. package/storybook-static/main.5731dbe3.iframe.bundle.js +0 -1
  94. package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js +0 -76
  95. package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js.map +0 -1
@@ -0,0 +1,89 @@
1
+ import React from "react";
2
+ import { SignInForm } from "../../../blocks/AuthForms";
3
+
4
+ export default {
5
+ title: "Blocks/Auth/Sign In",
6
+ component: [SignInForm],
7
+ argTypes: {
8
+ viaGoogle: {
9
+ default: true,
10
+ control: "boolean",
11
+ description: "Display the sign in via Google button",
12
+ table: { defaultValue: { summary: true } }
13
+ },
14
+ viaTwitter: {
15
+ default: true,
16
+ control: "boolean",
17
+ description: "Display the sign in via Twitter button",
18
+ table: { defaultValue: { summary: true } }
19
+ },
20
+ viaGithub: {
21
+ default: true,
22
+ control: "boolean",
23
+ description: "Display the sign in via Github button",
24
+ table: { defaultValue: { summary: true } }
25
+ },
26
+ showError: {
27
+ default: false,
28
+ control: "boolean",
29
+ description: "Display the error when auth fails",
30
+ table: { defaultValue: { summary: true } }
31
+ },
32
+ errorTitle: {
33
+ default: " ",
34
+ control: "text",
35
+ description: "The error text for the auth failure",
36
+ table: { defaultValue: { summary: "" } }
37
+ },
38
+ errorText: {
39
+ default: "Something went wrong",
40
+ control: "text",
41
+ description: "The error text for the auth failure",
42
+ table: { defaultValue: { summary: "Something went wrong" } }
43
+ }
44
+ }
45
+ };
46
+
47
+ const SignInTemplate = (args) => {
48
+ return (
49
+ <SignInForm
50
+ {...args}
51
+ error={args.showError}
52
+ texts={{
53
+ emailLabel: "Email",
54
+ emailPlaceholder: "Enter your email",
55
+ emailRequiredText: "Email is required",
56
+ emailInvalidText: "Invalid email address",
57
+ passwordLabel: "Password",
58
+ passwordPlaceholder: "Enter password",
59
+ passwordRequiredText: "Password is required",
60
+ forgotPasswordText: "Forgot password?",
61
+ newUserText: "New user?",
62
+ signUpText: "Sign up",
63
+ signInText: "Sign in",
64
+ googleButtonLabel: "Sign in with Google",
65
+ githubButtonLabel: "Sign in with Github",
66
+ twitterButtonLabel: "Sign in with Twitter"
67
+ }}
68
+ handleSignIn={(e) => console.log("singing in via email", e)}
69
+ handleForgotPassword={() => console.log("user forgot password")}
70
+ handleGoogleSignIn={() => console.log("signing in via google")}
71
+ handleGithubSignIn={() => console.log("signing in via github")}
72
+ handleTwitterSignIn={() => console.log("signing in via Twitter")}
73
+ handleRouteToSignUp={() => console.log("switching to sign up")}
74
+ viaGoogle={args.viaGoogle}
75
+ viaGithub={args.viaGithub}
76
+ viaTwitter={args.viaTwitter}
77
+ />
78
+ );
79
+ };
80
+
81
+ export const SignIn = SignInTemplate.bind({});
82
+ SignIn.args = {
83
+ viaGoogle: true,
84
+ viaGithub: true,
85
+ viaTwitter: true,
86
+ showError: false,
87
+ errorTitle: "Error",
88
+ errorText: "Something went wrong"
89
+ };
@@ -0,0 +1,90 @@
1
+ import React from "react";
2
+ import { SignUpForm } from "../../../blocks/AuthForms";
3
+
4
+ export default {
5
+ title: "Blocks/Auth/Sign Up",
6
+ component: [SignUpForm],
7
+ argTypes: {
8
+ viaGoogle: {
9
+ default: true,
10
+ control: "boolean",
11
+ description: "Display the sign in via Google button",
12
+ table: { defaultValue: { summary: true } }
13
+ },
14
+ viaTwitter: {
15
+ default: true,
16
+ control: "boolean",
17
+ description: "Display the sign in via Twitter button",
18
+ table: { defaultValue: { summary: true } }
19
+ },
20
+ viaGithub: {
21
+ default: true,
22
+ control: "boolean",
23
+ description: "Display the sign in via Github button",
24
+ table: { defaultValue: { summary: true } }
25
+ },
26
+ showError: {
27
+ default: false,
28
+ control: "boolean",
29
+ description: "Display the error when auth fails",
30
+ table: { defaultValue: { summary: true } }
31
+ },
32
+ errorTitle: {
33
+ default: " ",
34
+ control: "text",
35
+ description: "The error text for the auth failure",
36
+ table: { defaultValue: { summary: "" } }
37
+ },
38
+ errorText: {
39
+ default: "Something went wrong",
40
+ control: "text",
41
+ description: "The error text for the auth failure",
42
+ table: { defaultValue: { summary: "Something went wrong" } }
43
+ }
44
+ }
45
+ };
46
+
47
+ const SignUpTemplate = (args) => {
48
+ return (
49
+ <SignUpForm
50
+ {...args}
51
+ texts={{
52
+ fullNameLabel: "Full Name",
53
+ fullNamePlaceholder: "Fulan AlFulani",
54
+ emailLabel: "Email",
55
+ emailPlaceholder: "Enter your email",
56
+ emailRequiredText: "Email is required",
57
+ emailInvalidText: "Invalid email address",
58
+ passwordLabel: "Password",
59
+ passwordPlaceholder: "Minimum 8 characters",
60
+ passwordRequiredText: "Password is required",
61
+ passwordTooShortText: "Password too short",
62
+ forgotPasswordText: "Forgot password?",
63
+ newUserText: "New user?",
64
+ signUpText: "Sign up",
65
+ signInText: "Sign in",
66
+ googleButtonLabel: "Sign in with Google",
67
+ githubButtonLabel: "Sign in with Github",
68
+ twitterButtonLabel: "Sign in with Twitter"
69
+ }}
70
+ error={args.showError}
71
+ viaGoogle={args.viaGoogle}
72
+ viaGithub={args.viaGithub}
73
+ viaTwitter={args.viaTwitter}
74
+ handleSignUp={() => console.log("singing up via email")}
75
+ handleGoogleSignUp={() => console.log("signing up via google")}
76
+ handleGithubSignUp={() => console.log("signing up via github")}
77
+ handleTwitterSignUp={() => console.log("signing up via Twitter")}
78
+ handleRouteToSignIn={() => console.log("switching to sign in")}
79
+ />
80
+ );
81
+ };
82
+ export const SignUp = SignUpTemplate.bind({});
83
+ SignUp.args = {
84
+ viaGoogle: true,
85
+ viaGithub: true,
86
+ viaTwitter: true,
87
+ showError: false,
88
+ errorTitle: "Error",
89
+ errorText: "Something went wrong"
90
+ };
@@ -0,0 +1,30 @@
1
+ import React from "react";
2
+ import { ChargeWalletForm } from "../../../blocks/Payment";
3
+
4
+ export default {
5
+ title: "Blocks/Payment/Charge Wallet",
6
+ component: [ChargeWalletForm],
7
+ argTypes: {
8
+ viaWallet: { control: "boolean" },
9
+ viaApplePay: { control: "boolean" },
10
+ viaGooglePay: { control: "boolean" },
11
+ viaSTCPay: { control: "boolean" },
12
+ viaCreditCard: { control: "boolean" },
13
+ viaPayPal: { control: "boolean" }
14
+ },
15
+ args: {
16
+ viaWallet: true,
17
+ viaMada: true,
18
+ viaApplePay: true,
19
+ viaGooglePay: true,
20
+ viaSTCPay: true,
21
+ viaCreditCard: true,
22
+ viaPayPal: true
23
+ }
24
+ };
25
+
26
+ export const ChargeWallet = (args) => {
27
+ return <ChargeWalletForm {...args} />;
28
+ };
29
+
30
+ ChargeWallet.args = { currency: "SAR" };
@@ -0,0 +1,37 @@
1
+ import React from "react";
2
+ import { CreditCardForm } from "../../../blocks/Payment";
3
+
4
+ export default {
5
+ title: "Blocks/Payment/Pay Via Credit Card",
6
+ component: [CreditCardForm],
7
+ argTypes: {
8
+ theme: {
9
+ options: ["primary", "secondary", "default"],
10
+ control: { type: "select" }
11
+ },
12
+ viaWallet: { control: "boolean" },
13
+ viaApplePay: { control: "boolean" },
14
+ viaGooglePay: { control: "boolean" },
15
+ viaSTCPay: { control: "boolean" },
16
+ viaCreditCard: { control: "boolean" },
17
+ viaPayPal: { control: "boolean" }
18
+ },
19
+ args: {
20
+ theme: "primary",
21
+ viaWallet: true,
22
+ viaMada: true,
23
+ viaApplePay: true,
24
+ viaGooglePay: true,
25
+ viaSTCPay: true,
26
+ viaCreditCard: true,
27
+ viaPayPal: true
28
+ }
29
+ };
30
+
31
+ export const PayViaCreditCard = (args) => {
32
+ return <CreditCardForm theme={args.theme} />;
33
+ };
34
+
35
+ PayViaCreditCard.args = {
36
+ theme: "secondary"
37
+ };
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { PayWithWallet } from "../../../blocks/Payment";
3
+
4
+ export default {
5
+ title: "Blocks/Payment/Pay Via Wallet",
6
+ component: [PayWithWallet],
7
+ argTypes: {
8
+ walletBalance: { control: "number" }
9
+ },
10
+ args: {
11
+ walletBalance: 20
12
+ }
13
+ };
14
+
15
+ export const PayViaWallet = (args) => {
16
+ return <PayWithWallet {...args} />;
17
+ };
@@ -0,0 +1,60 @@
1
+ import React from "react";
2
+ import { SelectPayment } from "../../../blocks/Payment";
3
+
4
+ export default {
5
+ title: "Blocks/Payment/Payment Selection",
6
+ component: [SelectPayment],
7
+ argTypes: {
8
+ theme: {
9
+ options: ["primary", "secondary", "default"],
10
+ control: { type: "select" }
11
+ },
12
+ viaWallet: { control: "boolean" },
13
+ viaApplePay: { control: "boolean" },
14
+ viaGooglePay: { control: "boolean" },
15
+ viaSTCPay: { control: "boolean" },
16
+ viaCreditCard: { control: "boolean" },
17
+ viaPayPal: { control: "boolean" }
18
+ },
19
+ args: {
20
+ theme: "primary",
21
+ viaWallet: true,
22
+ viaMada: true,
23
+ viaApplePay: true,
24
+ viaGooglePay: true,
25
+ viaSTCPay: true,
26
+ viaCreditCard: true,
27
+ viaPayPal: true
28
+ }
29
+ };
30
+
31
+ const PaymentSelectionTemplate = (args) => {
32
+ return (
33
+ <SelectPayment
34
+ {...args}
35
+ walletLabel="Wallet Balance"
36
+ handleWallet={() => console.log("paying via wallet")}
37
+ visaMasterLabel="Credit Card"
38
+ handleCreditCard={() => console.log("paying via Credit Card")}
39
+ madaLabel="Mada"
40
+ handleMada={() => console.log("paying via Mada")}
41
+ paypalLabel="PayPal"
42
+ handlePayPal={() => console.log("paying via PayPal")}
43
+ applePayLabel="Apple Pay"
44
+ handleApplePay={() => console.log("paying via Apple Pay")}
45
+ googlePayLabel="Google Pay"
46
+ handleGooglePay={() => console.log("paying via Google Pay")}
47
+ stcPayLabel="STC Pay"
48
+ handleSTCPay={() => console.log("paying via STC Pay")}
49
+ />
50
+ );
51
+ };
52
+ export const PaymentSelection = PaymentSelectionTemplate.bind({});
53
+ PaymentSelection.args = {
54
+ viaGoogle: true,
55
+ viaGithub: true,
56
+ viaTwitter: true,
57
+ showError: false,
58
+ errorTitle: "Error",
59
+ errorText: "Something went wrong"
60
+ };
@@ -0,0 +1,51 @@
1
+ import { Class } from "@mui/icons-material";
2
+ import React from "react";
3
+ import { AdaptiveButton } from "../../elements";
4
+
5
+ export default {
6
+ title: "Elements/Buttons/AdaptiveButton",
7
+ component: AdaptiveButton,
8
+ argTypes: {
9
+ buttonText: {
10
+ control: "text",
11
+ description: "The button text",
12
+ table: {
13
+ defaultValue: { summary: "Click" }
14
+ }
15
+ },
16
+ showText: {
17
+ control: "boolean",
18
+ // default: true,
19
+ description: "Boolean to show or hide the text",
20
+ table: {
21
+ defaultValue: { summary: true },
22
+ type: {
23
+ summary: "Use Case",
24
+ detail:
25
+ "Set this property to true in large screen and false on mobile"
26
+ }
27
+ }
28
+ }
29
+ },
30
+ args: {
31
+ buttonText: "Click"
32
+ }
33
+ };
34
+
35
+ const Template = (args) => {
36
+ return <AdaptiveButton {...args} />;
37
+ };
38
+
39
+ export const FullButton = Template.bind({});
40
+ FullButton.args = {
41
+ showText: true,
42
+ // buttonText: "Full Button",
43
+ icon: <Class />
44
+ };
45
+
46
+ export const IconOnly = Template.bind({});
47
+ IconOnly.args = {
48
+ showText: false,
49
+ icon: <Class />,
50
+ buttonText: "test"
51
+ };
@@ -1,11 +1,10 @@
1
1
  import React from "react";
2
2
 
3
- import { defaultTheme, HawaProvider } from "../../themes/HawaProvider";
4
- import { HawaAlert } from "../../ui";
3
+ import { HawaAlert } from "../../elements";
5
4
 
6
5
  const Template = (args) => {
7
6
  return (
8
- <HawaProvider themeName={args.theme}>
7
+ <>
9
8
  <HawaAlert
10
9
  title="What?"
11
10
  text="This is a success alert"
@@ -14,7 +13,7 @@ const Template = (args) => {
14
13
  <HawaAlert text="This is an info alert" severity="info" />
15
14
  <HawaAlert text="This is a warning alert" severity="warning" />
16
15
  <HawaAlert text="This is an error alert" severity="error" />
17
- </HawaProvider>
16
+ </>
18
17
  );
19
18
  };
20
19
  //types:
@@ -1,5 +1,5 @@
1
1
  import { storiesOf } from "@storybook/react";
2
- import { HawaInputLabel } from "../../ui";
2
+ import { HawaInputLabel } from "../../elements";
3
3
 
4
4
  export default {
5
5
  title: "Components/InputLabel",
@@ -0,0 +1,18 @@
1
+ import { Container } from "@mui/material";
2
+ import React from "react";
3
+ import { HawaCard } from "../../elements";
4
+
5
+ export default {
6
+ title: "Elements/Cards/Items",
7
+ component: [HawaCard],
8
+ argTypes: {
9
+ buttonLabel: {
10
+ control: "text",
11
+ description: "The text next to the logo"
12
+ }
13
+ }
14
+ };
15
+
16
+ export const Items = (args) => {
17
+ return <HawaCard />;
18
+ };
@@ -0,0 +1,73 @@
1
+ import { Container } from "@mui/material";
2
+ import React from "react";
3
+ import { ActionButton, HawaLogoButton } from "../../elements";
4
+
5
+ export default {
6
+ title: "Elements/Buttons/LogoButtons",
7
+ component: HawaLogoButton,
8
+ argTypes: {
9
+ buttonLabel: {
10
+ control: "text",
11
+ description: "The text next to the logo"
12
+ },
13
+ logo: {
14
+ control: "select",
15
+ options: [
16
+ "google",
17
+ "twitter",
18
+ "github",
19
+ "paypal",
20
+ "applepay",
21
+ "googlepay",
22
+ "stcpay",
23
+ "mada",
24
+ "visa/master"
25
+ ],
26
+ description: "a brand name that will display the logo accordingly",
27
+ table: {
28
+ type: {
29
+ summary: "Examples",
30
+ detail: "google, twitter, github, paypal, applepay, googlepay"
31
+ }
32
+ }
33
+ }
34
+ }
35
+ };
36
+
37
+ const Template = (args) => {
38
+ return (
39
+ <Container maxWidth="xs" variant="plain">
40
+ <HawaLogoButton logo={args.logo} buttonText={args.buttonLabel} />
41
+ </Container>
42
+ );
43
+ };
44
+
45
+ export const Google = Template.bind({});
46
+ Google.args = { buttonLabel: "Sign in via Google", logo: "google" };
47
+
48
+ export const Twitter = Template.bind({});
49
+ Twitter.args = { buttonLabel: "Sign in via Twitter", logo: "twitter" };
50
+
51
+ export const Github = Template.bind({});
52
+ Github.args = { buttonLabel: "Sign in via Github", logo: "github" };
53
+
54
+ export const WalletPay = Template.bind({});
55
+ WalletPay.args = { buttonLabel: "Pay with Wallet", logo: "wallet" };
56
+
57
+ export const GooglePay = Template.bind({});
58
+ GooglePay.args = { buttonLabel: "Google Pay", logo: "googlepay" };
59
+
60
+ export const ApplePay = Template.bind({});
61
+ ApplePay.args = { buttonLabel: "Apple Pay", logo: "applepay" };
62
+
63
+ export const STCPay = Template.bind({});
64
+ STCPay.args = { buttonLabel: "STC Pay", logo: "stcpay" };
65
+
66
+ export const VisaMasterPay = Template.bind({});
67
+ VisaMasterPay.args = { buttonLabel: "Visa / Mastercard", logo: "visa/master" };
68
+
69
+ export const PayPal = Template.bind({});
70
+ PayPal.args = { buttonLabel: "PayPal", logo: "paypal" };
71
+
72
+ export const Mada = Template.bind({});
73
+ Mada.args = { buttonLabel: "Mada", logo: "mada" };
@@ -0,0 +1,27 @@
1
+ import { Container } from "@mui/material";
2
+ import React from "react";
3
+ import { HawaCard } from "../../elements";
4
+
5
+ export default {
6
+ title: "Elements/Cards/Pricing",
7
+ component: [HawaCard],
8
+ argTypes: {
9
+ buttonLabel: {
10
+ control: "text",
11
+ description: "The text next to the logo"
12
+ }
13
+ }
14
+ };
15
+
16
+ export const Pricing = (args) => {
17
+ return (
18
+ <HawaCard
19
+ title="Pro"
20
+ subtitle="For small business"
21
+ price="300"
22
+ currency="SAR"
23
+ cycleText="Every 6 months"
24
+ features={["Unlimited Menus", "Unlimited Items", "Custom Handle"]}
25
+ />
26
+ );
27
+ };
@@ -0,0 +1,36 @@
1
+ import React from "react";
2
+ import { HawaRadio } from "../../elements";
3
+
4
+ export default {
5
+ title: "Elements/Selections/Panel Tabs",
6
+ component: [HawaRadio],
7
+ argTypes: {
8
+ options: {
9
+ control: "array",
10
+ description: "An array of objects containing the option label and value",
11
+ table: {
12
+ type: {
13
+ summary: "Object Example",
14
+ detail: "{label: 'Option 1', value: 'option1'}"
15
+ }
16
+ }
17
+ }
18
+ },
19
+ args: {
20
+ options: 3
21
+ }
22
+ };
23
+
24
+ export const PanelTabs = (args) => {
25
+ let allOptions = Array.from({ length: args.options }, (v, i) => {
26
+ return { label: `Option ${i}`, value: `option${i}` };
27
+ });
28
+ return (
29
+ <HawaRadio
30
+ {...args}
31
+ handleChange={(e) => console.log("changing to ", e)}
32
+ defaultValue="option1"
33
+ options={allOptions}
34
+ />
35
+ );
36
+ };
@@ -0,0 +1,63 @@
1
+ import React from "react";
2
+ import { HawaSettingsRow } from "../../elements";
3
+
4
+ export default {
5
+ title: "Elements/Settings/Row",
6
+ component: [HawaSettingsRow],
7
+ parameters: {
8
+ backgrounds: {
9
+ default: 'twitter',
10
+ values: [
11
+ {
12
+ name: 'light',
13
+ value: '#00aced',
14
+ },
15
+ {
16
+ name: 'dark',
17
+ value: '#3b5998',
18
+ },
19
+ ],
20
+ },
21
+ // backgrounds: [{ name: "dark background", value: "#000", default: true }]
22
+ },
23
+ argTypes: {
24
+ settingsType: {
25
+ options: ["checkbox", "text", "radio"],
26
+ control: { type: "select" }
27
+ }
28
+ }
29
+ };
30
+
31
+ export const CheckboxSettings = (args) => <HawaSettingsRow {...args} />;
32
+ CheckboxSettings.args = {
33
+ settingsType: "checkbox",
34
+ settingsLabel: "Text Settings"
35
+ };
36
+ export const TextSettings = (args) => (
37
+ <HawaSettingsRow placeholder="Text here" {...args} />
38
+ );
39
+
40
+ TextSettings.args = {
41
+ settingsType: "text",
42
+ settingsLabel: "Text Settings"
43
+ };
44
+ export const RadioSettings = (args) => {
45
+ let allOptions = Array.from({ length: args.options }, (v, i) => {
46
+ return { label: `Option ${i}`, value: `option${i}` };
47
+ });
48
+ return (
49
+ <HawaSettingsRow
50
+ settingsType={args.settingsType}
51
+ settingsLabel={args.settingsLabel}
52
+ handleChange={(e) => console.log("changing to ", e)}
53
+ defaultValue="option1"
54
+ options={allOptions}
55
+ />
56
+ );
57
+ };
58
+
59
+ RadioSettings.args = {
60
+ options: 3,
61
+ settingsType: "radio",
62
+ settingsLabel: "Radio Settings"
63
+ };
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { HawaTextField } from "../../ui";
2
+ import { HawaTextField } from "../../elements";
3
3
 
4
4
  const Template = (args) => {
5
5
  return <HawaTextField {...args} />;