@sikka/hawa 0.0.4 → 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 (123) hide show
  1. package/es/index.es.js +1 -1
  2. package/lib/index.js +1 -1
  3. package/package.json +9 -8
  4. package/src/blocks/Account/UserProfile.js +61 -11
  5. package/src/blocks/Account/UserSettings.js +11 -11
  6. package/src/blocks/AuthForms/NewPasswordForm.js +85 -11
  7. package/src/blocks/AuthForms/ResetPasswordForm.js +47 -8
  8. package/src/blocks/AuthForms/SignInForm.js +91 -13
  9. package/src/blocks/AuthForms/SignUpForm.js +119 -12
  10. package/src/blocks/Payment/ChargeWalletForm.js +53 -0
  11. package/src/blocks/Payment/CreditCardForm.js +60 -0
  12. package/src/blocks/Payment/Form/CForm.js +10 -8
  13. package/src/blocks/Payment/Gateway/Wallet.js +5 -5
  14. package/src/blocks/Payment/PayWithWallet.js +14 -0
  15. package/src/blocks/Payment/PaymentMethod.js +2 -2
  16. package/src/blocks/Payment/SelectPayment.js +76 -0
  17. package/src/blocks/Payment/index.js +18 -0
  18. package/src/index.js +3 -1
  19. package/src/layout/Box.js +31 -18
  20. package/src/stories/BlocksStories/AuthForm.stories.js +103 -0
  21. package/src/stories/BlocksStories/PaymentForm.stories.js +86 -0
  22. package/src/stories/BlocksStories/UserForm.stories.js +41 -0
  23. package/src/stories/GlobalVariables.stories.js +33 -90
  24. package/src/stories/HawaProvider.stories.js +0 -1
  25. package/src/stories/Introduction.stories.js +132 -110
  26. package/src/stories/LayoutStories/Box.stories.js +56 -0
  27. package/src/stories/UIStories/ActionButton.stories.js +53 -0
  28. package/src/stories/{AdaptiveButton.stories.js → UIStories/AdaptiveButton.stories.js} +3 -3
  29. package/src/stories/UIStories/Alert.stories.js +42 -0
  30. package/src/stories/{CheckBox.stories.js → UIStories/CheckBox.stories.js} +3 -4
  31. package/src/stories/UIStories/InputLabel.stories.js +13 -0
  32. package/src/stories/UIStories/RadioSelector.stories.js +53 -0
  33. package/src/stories/UIStories/SettingsRow.stories.js +64 -0
  34. package/src/stories/{TextField.stories.js → UIStories/TextField.stories.js} +4 -5
  35. package/src/themes/HawaProvider.js +151 -18
  36. package/src/ui/ActionButton.js +38 -10
  37. package/src/ui/AdaptiveButton.js +29 -29
  38. package/src/ui/ApplePayButton.js +26 -0
  39. package/src/ui/AutoCompleteField.js +0 -1
  40. package/src/ui/DragDropImages.js +2 -2
  41. package/src/ui/GithubButton.js +24 -0
  42. package/src/ui/GoogleButton.js +23 -0
  43. package/src/ui/GooglePayButton.js +26 -0
  44. package/src/ui/HawaAlert.js +37 -0
  45. package/src/ui/HawaButton.js +48 -0
  46. package/src/ui/{Checkbox.js → HawaCheckbox.js} +3 -3
  47. package/src/ui/HawaInputLabel.js +32 -0
  48. package/src/ui/HawaLogoButton.js +43 -0
  49. package/src/ui/HawaRadio.js +73 -0
  50. package/src/ui/HawaSettingsRow.js +71 -0
  51. package/src/ui/{TextArea.js → HawaTextArea.js} +2 -2
  52. package/src/ui/HawaTextField.js +110 -0
  53. package/src/ui/HawaTypography.js +29 -0
  54. package/src/ui/MadaButton.js +26 -0
  55. package/src/ui/PayPalButton.js +26 -0
  56. package/src/ui/RadioBox.js +2 -2
  57. package/src/ui/STCPayButton.js +26 -0
  58. package/src/ui/SelectedField.js +4 -4
  59. package/src/ui/StyledTooltip.js +1 -1
  60. package/src/ui/TabPanel.js +1 -1
  61. package/src/ui/TwitterButton.js +27 -0
  62. package/src/ui/VisaMasterButton.js +26 -0
  63. package/src/ui/WalletButton.js +24 -0
  64. package/src/ui/index.js +23 -11
  65. package/storybook-static/0.0d994c92.iframe.bundle.js +3 -0
  66. package/storybook-static/{1.4e43f671.iframe.bundle.js.LICENSE.txt → 0.0d994c92.iframe.bundle.js.LICENSE.txt} +0 -0
  67. package/storybook-static/0.0d994c92.iframe.bundle.js.map +1 -0
  68. package/storybook-static/0.f47eb24a4893a96ec307.manager.bundle.js +1 -0
  69. package/storybook-static/1.aabc3f3a.iframe.bundle.js +1 -0
  70. package/storybook-static/{3.c1dc7159.iframe.bundle.js → 2.430bf1e3.iframe.bundle.js} +1 -1
  71. package/storybook-static/4.0fcda1281dc1961dbe94.manager.bundle.js +2 -0
  72. package/storybook-static/{4.8c311a6b48cad9f29317.manager.bundle.js.LICENSE.txt → 4.0fcda1281dc1961dbe94.manager.bundle.js.LICENSE.txt} +0 -0
  73. package/storybook-static/{5.88fe62ee92ff5ca67829.manager.bundle.js → 5.63ab4f94d50a3acf080d.manager.bundle.js} +1 -1
  74. package/storybook-static/{7.69d2e532.iframe.bundle.js → 6.704d1e8d.iframe.bundle.js} +1 -1
  75. package/storybook-static/{6.96d184f368dea006cb52.manager.bundle.js → 6.a6d45262f7e98f3f18d3.manager.bundle.js} +2 -2
  76. package/storybook-static/{6.96d184f368dea006cb52.manager.bundle.js.LICENSE.txt → 6.a6d45262f7e98f3f18d3.manager.bundle.js.LICENSE.txt} +0 -0
  77. package/storybook-static/{7.5ec31f3702b08ab0b71c.manager.bundle.js → 7.097710753af9a1c41b80.manager.bundle.js} +1 -1
  78. package/storybook-static/{8.68cd1217.iframe.bundle.js → 7.9ce807e3.iframe.bundle.js} +3 -3
  79. package/storybook-static/{8.68cd1217.iframe.bundle.js.LICENSE.txt → 7.9ce807e3.iframe.bundle.js.LICENSE.txt} +0 -0
  80. package/storybook-static/7.9ce807e3.iframe.bundle.js.map +1 -0
  81. package/storybook-static/{8.5ce13be7612bd3a6b864.manager.bundle.js → 8.76c3cbf398692028e834.manager.bundle.js} +1 -1
  82. package/storybook-static/{9.488e3969.iframe.bundle.js → 8.c4cb6081.iframe.bundle.js} +1 -1
  83. package/storybook-static/iframe.html +1 -1
  84. package/storybook-static/index.html +1 -1
  85. package/storybook-static/main.ac6e4b72b033097dad76.manager.bundle.js +1 -0
  86. package/storybook-static/main.b7ffaed0.iframe.bundle.js +1 -0
  87. package/storybook-static/{runtime~main.cc29f4c2175f187a3707.manager.bundle.js → runtime~main.c8dac23bc753439736f0.manager.bundle.js} +1 -1
  88. package/storybook-static/runtime~main.cfefe972.iframe.bundle.js +1 -0
  89. package/storybook-static/vendors~main.8ebae370.iframe.bundle.js +76 -0
  90. package/storybook-static/{vendors~main.d144d840.iframe.bundle.js.LICENSE.txt → vendors~main.8ebae370.iframe.bundle.js.LICENSE.txt} +3 -30
  91. package/storybook-static/vendors~main.8ebae370.iframe.bundle.js.map +1 -0
  92. package/storybook-static/vendors~main.a697e07137d366f95f76.manager.bundle.js +2 -0
  93. package/storybook-static/{vendors~main.f228d62e92b69563cefb.manager.bundle.js.LICENSE.txt → vendors~main.a697e07137d366f95f76.manager.bundle.js.LICENSE.txt} +0 -0
  94. package/src/blocks/AuthForms/viaFacebook.js +0 -0
  95. package/src/blocks/AuthForms/viaGithub.js +0 -0
  96. package/src/blocks/AuthForms/viaGoogle.js +0 -0
  97. package/src/blocks/AuthForms/viaTwitter.js +0 -0
  98. package/src/blocks/index.js +0 -13
  99. package/src/stories/ActionButton.stories.js +0 -49
  100. package/src/stories/Alert.stories.js +0 -41
  101. package/src/stories/AuthForm.stories.js +0 -79
  102. package/src/stories/Box.stories.js +0 -64
  103. package/src/stories/InputLabel.stories.js +0 -92
  104. package/src/stories/RadioSelector.stories.js +0 -69
  105. package/src/stories/UserAccount.stories.js +0 -46
  106. package/src/ui/RadioSelector.js +0 -51
  107. package/src/ui/StyledAlert.js +0 -30
  108. package/src/ui/StyledInputLabel.js +0 -19
  109. package/src/ui/TextField.js +0 -62
  110. package/storybook-static/0.d3bc3395610cf5d3ee94.manager.bundle.js +0 -1
  111. package/storybook-static/0.dd3d47f5.iframe.bundle.js +0 -1
  112. package/storybook-static/1.4e43f671.iframe.bundle.js +0 -3
  113. package/storybook-static/1.4e43f671.iframe.bundle.js.map +0 -1
  114. package/storybook-static/2.9a757207.iframe.bundle.js +0 -1
  115. package/storybook-static/4.8c311a6b48cad9f29317.manager.bundle.js +0 -2
  116. package/storybook-static/8.68cd1217.iframe.bundle.js.map +0 -1
  117. package/storybook-static/main.65cb2769.iframe.bundle.js +0 -1
  118. package/storybook-static/main.7e391cf7bf72b0d18ea5.manager.bundle.js +0 -1
  119. package/storybook-static/runtime~main.6e2e1544.iframe.bundle.js +0 -1
  120. package/storybook-static/vendors~main.d144d840.iframe.bundle.js +0 -3
  121. package/storybook-static/vendors~main.d144d840.iframe.bundle.js.map +0 -1
  122. package/storybook-static/vendors~main.f228d62e92b69563cefb.manager.bundle.js +0 -2
  123. package/yarn-error.log +0 -10910
@@ -0,0 +1,76 @@
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
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";
15
+
16
+ export const SelectPayment = (props) => {
17
+ return (
18
+ <Box maxWidth={400} noColor noMargin noPadding>
19
+ <Box noMargin>
20
+ <HawaTypography align="center">Choose Payment Method</HawaTypography>
21
+ {props.viaWallet && (
22
+ <WalletButton
23
+ buttonText={props.walletLabel}
24
+ onClick={props.handleWallet}
25
+ />
26
+ )}
27
+ {props.viaCreditCard && (
28
+ <VisaMasterButton
29
+ buttonText={props.visaMasterLabel}
30
+ handleClick={props.handleCreditCard}
31
+ />
32
+ )}
33
+ {props.viaMada && (
34
+ <MadaButton
35
+ buttonText={props.madaLabel}
36
+ handleClick={props.handleMada}
37
+ />
38
+ )}
39
+ {props.viaSTCPay && (
40
+ <STCPayButton
41
+ buttonText={props.stcPayLabel}
42
+ handleClick={props.handleSTCPay}
43
+ />
44
+ )}
45
+ {props.viaPayPal && (
46
+ <PayPalButton
47
+ buttonText={props.paypalLabel}
48
+ handleClick={props.handlePayPal}
49
+ />
50
+ )}
51
+ {props.viaGooglePay && (
52
+ <GooglePayButton
53
+ buttonText={props.googlePayLabel}
54
+ handleClick={props.handleGooglePay}
55
+ />
56
+ )}
57
+ {props.viaApplePay && (
58
+ <ApplePayButton
59
+ buttonText={props.applePayLabel}
60
+ handleClick={props.handleApplePay}
61
+ />
62
+ )}
63
+ </Box>
64
+ </Box>
65
+ );
66
+ };
67
+
68
+ HawaTextField.propTypes = {
69
+ theme: PropTypes.oneOf(["secondary", "primary"]),
70
+ viaApplePay: PropTypes.bool,
71
+ viaGooglePay: PropTypes.bool,
72
+ viaSTCPay: PropTypes.bool,
73
+ viaCreditCard: PropTypes.bool,
74
+ viaPayPal: PropTypes.bool,
75
+ handleApplePay: PropTypes.func
76
+ };
@@ -0,0 +1,18 @@
1
+ // "use strict";
2
+
3
+ // var _GooglePay = require("./Gateway/GooglePay");
4
+ // var _Payfort = require("./Gateway/Payfort");
5
+ // var _Paypal = require("./Gateway/Paypal");
6
+ // var _Wallet = require("./Gateway/Wallet");
7
+ // var _PaymentMethod = require("./PaymentMethod");
8
+
9
+ // exports.GooglePay = _GooglePay.default;
10
+ // exports.Payfort = _Payfort.default;
11
+ // exports.Paypal = _Paypal.default;
12
+ // exports.Wallet = _Wallet.default;
13
+ // exports.PaymentMethod = _PaymentMethod.default;
14
+
15
+ export * from "./SelectPayment";
16
+ export * from "./CreditCardForm";
17
+ export * from "./ChargeWalletForm";
18
+ export * from "./PayWithWallet";
package/src/index.js CHANGED
@@ -1,2 +1,4 @@
1
- export * from "./blocks";
1
+ export * from "./blocks/Account";
2
+ export * from "./blocks/AuthForms";
3
+ export * from "./blocks/Payment";
2
4
  //export * from "./components/Hawa";
package/src/layout/Box.js CHANGED
@@ -2,24 +2,37 @@ 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);
6
- return (
7
- <div
8
- style={{
9
- display: 'flex',
10
- flexDirection: 'column',
11
- // justifyContent: 'center',
12
- // alignItems: 'center',
5
+ const { hawaTheme, themeName } = useContext(ThemeProvider);
6
+ let boxStyle = {};
13
7
 
14
- backgroundColor: theme.layoutColor,
15
- color: theme.textColor,
16
- padding: theme.paddings,
17
- margin: theme.margins,
18
- borderRadius: theme.borderRadius,
19
- maxWidth: props.maxWidth
20
- }}
21
- >
22
- {props.children}
23
- </div>
8
+ let currentTheme = Object.keys(hawaTheme.layout).find(
9
+ (tName) => tName.toLowerCase() === themeName?.toLowerCase()
24
10
  );
11
+ if (currentTheme) {
12
+ boxStyle = {
13
+ display: "flex",
14
+ flexDirection: props.horizontal ? "row" : "column",
15
+ ...hawaTheme.layout[currentTheme],
16
+ backgroundColor: props.noColor
17
+ ? "none"
18
+ : hawaTheme.layout[currentTheme].backgroundColor,
19
+ padding: props.noPadding ? 0 : hawaTheme.layout[currentTheme].padding,
20
+ margin: props.noMargin ? 0 : hawaTheme.layout[currentTheme].margin,
21
+ maxWidth: props.maxWidth
22
+ };
23
+ } else {
24
+ boxStyle = {
25
+ display: "flex",
26
+ flexDirection: props.horizontal ? "row" : "column",
27
+ color: "white",
28
+ marginTop: props.last ? 10 * 2 : 0,
29
+ backgroundColor: props.noColor ? "none" : "lightGrey",
30
+ padding: props.noPadding ? 0 : 10,
31
+ margin: props.noMargin ? 0 : 10,
32
+ maxWidth: props.maxWidth,
33
+ borderRadius: 0
34
+ };
35
+ }
36
+
37
+ return <div style={boxStyle}>{props.children}</div>;
25
38
  };
@@ -0,0 +1,103 @@
1
+ import React from "react";
2
+ import {
3
+ NewPasswordForm,
4
+ ResetPasswordForm,
5
+ SignInForm,
6
+ SignUpForm
7
+ } from "../../blocks/AuthForms";
8
+ import { defaultTheme, HawaProvider } from "../../themes/HawaProvider";
9
+
10
+ export default {
11
+ title: "Blocks/AuthBlocks",
12
+ component: [SignInForm, SignUpForm, NewPasswordForm, NewPasswordForm],
13
+ argTypes: {
14
+ theme: {
15
+ options: ["primary", "secondary", "default"],
16
+ control: { type: "select" }
17
+ }
18
+ }
19
+ };
20
+
21
+ const SignInTemplate = (args) => {
22
+ return (
23
+ <HawaProvider themeName={args.theme}>
24
+ <SignInForm
25
+ {...args}
26
+ error={args.showError}
27
+ handleSignIn={(e) => console.log("singing in via email", e)}
28
+ viaGoogle={args.viaGoogle}
29
+ googleButtonLabel={"Sign in with Google"}
30
+ handleGoogleSignIn={() => console.log("signing in via google")}
31
+ viaGithub={args.viaGithub}
32
+ githubButtonLabel={"Sign in with Github"}
33
+ handleGithubSignIn={() => console.log("signing in via github")}
34
+ viaTwitter={args.viaTwitter}
35
+ twitterButtonLabel={"Sign in with Twitter"}
36
+ handleTwitterSignIn={() => console.log("signing in via Twitter")}
37
+ />
38
+ </HawaProvider>
39
+ );
40
+ };
41
+
42
+ export const SignIn = SignInTemplate.bind({});
43
+ SignIn.args = {
44
+ viaGoogle: true,
45
+ viaGithub: true,
46
+ viaTwitter: true,
47
+ showError: false,
48
+ theme: "primary"
49
+ };
50
+
51
+ const SignUpTemplate = (args) => {
52
+ return (
53
+ <HawaProvider themeName={args.theme}>
54
+ <SignUpForm
55
+ {...args}
56
+ error={args.showError}
57
+ handleSignUp={() => console.log("singing up via email")}
58
+ viaGoogle={args.viaGoogle}
59
+ googleButtonLabel={"Sign up with Google"}
60
+ handleGoogleSignUp={() => console.log("signing up via google")}
61
+ viaGithub={args.viaGithub}
62
+ githubButtonLabel={"Sign up with Github"}
63
+ handleGithubSignUp={() => console.log("signing up via github")}
64
+ viaTwitter={args.viaTwitter}
65
+ twitterButtonLabel={"Sign up with Twitter"}
66
+ handleTwitterSignUp={() => console.log("signing up via Twitter")}
67
+ />
68
+ </HawaProvider>
69
+ );
70
+ };
71
+ export const SignUp = SignUpTemplate.bind({});
72
+ SignUp.args = {
73
+ viaGoogle: true,
74
+ viaGithub: true,
75
+ viaTwitter: true,
76
+ showError: false,
77
+ theme: "primary"
78
+ };
79
+
80
+ const ResetPasswordTemplate = (args) => {
81
+ return (
82
+ <HawaProvider themeName={args.theme}>
83
+ <ResetPasswordForm error={args.showError} theme={args.theme} {...args} />
84
+ </HawaProvider>
85
+ );
86
+ };
87
+ export const ResetPassword = ResetPasswordTemplate.bind({});
88
+ ResetPassword.args = {
89
+ theme: "primary",
90
+ showError: false
91
+ };
92
+ const NewPasswordTemplate = (args) => {
93
+ return (
94
+ <HawaProvider themeName={args.theme}>
95
+ <NewPasswordForm error={args.showError} theme={args.theme} {...args} />
96
+ </HawaProvider>
97
+ );
98
+ };
99
+ export const NewPassword = NewPasswordTemplate.bind({});
100
+ NewPassword.args = {
101
+ theme: "primary",
102
+ showError: false
103
+ };
@@ -0,0 +1,86 @@
1
+ import React from "react";
2
+ import {
3
+ SelectPayment,
4
+ CreditCardForm,
5
+ ChargeWalletForm,
6
+ PayWithWallet
7
+ } from "../../blocks/Payment";
8
+ import { defaultTheme, HawaProvider } from "../../themes/HawaProvider";
9
+
10
+ export default {
11
+ title: "Blocks/PaymentBlocks",
12
+ component: [SelectPayment, CreditCardForm],
13
+ argTypes: {
14
+ theme: {
15
+ options: ["primary", "secondary", "default"],
16
+ control: { type: "select" }
17
+ },
18
+ viaWallet: { control: "boolean" },
19
+ viaApplePay: { control: "boolean" },
20
+ viaGooglePay: { control: "boolean" },
21
+ viaSTCPay: { control: "boolean" },
22
+ viaCreditCard: { control: "boolean" },
23
+ viaPayPal: { control: "boolean" }
24
+ },
25
+ args: {
26
+ theme: "primary",
27
+ viaWallet: true,
28
+ viaMada: true,
29
+ viaApplePay: true,
30
+ viaGooglePay: true,
31
+ viaSTCPay: true,
32
+ viaCreditCard: true,
33
+ viaPayPal: true
34
+ }
35
+ };
36
+
37
+ export const PaymentSelection = (args) => {
38
+ return (
39
+ <HawaProvider themeName={args.theme}>
40
+ <SelectPayment
41
+ {...args}
42
+ walletLabel="Wallet Balance"
43
+ handleWallet={() => console.log("paying via wallet")}
44
+ visaMasterLabel="Credit Card"
45
+ handleCreditCard={() => console.log("paying via Credit Card")}
46
+ madaLabel="Mada"
47
+ handleMada={() => console.log("paying via Mada")}
48
+ paypalLabel="PayPal"
49
+ handlePayPal={() => console.log("paying via PayPal")}
50
+ applePayLabel="Apple Pay"
51
+ handleApplePay={() => console.log("paying via Apple Pay")}
52
+ googlePayLabel="Google Pay"
53
+ handleGooglePay={() => console.log("paying via Google Pay")}
54
+ stcPayLabel="STC Pay"
55
+ handleSTCPay={() => console.log("paying via STC Pay")}
56
+ />
57
+ </HawaProvider>
58
+ );
59
+ };
60
+
61
+ export const PayViaWallet = (args) => {
62
+ return (
63
+ <HawaProvider theme={{ ...defaultTheme }}>
64
+ <PayWithWallet theme={args.theme} />
65
+ </HawaProvider>
66
+ );
67
+ };
68
+ export const PayViaCreditCard = (args) => {
69
+ return (
70
+ <HawaProvider theme={{ ...defaultTheme }}>
71
+ <CreditCardForm />
72
+ </HawaProvider>
73
+ );
74
+ };
75
+
76
+ export const ChargeWallet = (args) => {
77
+ return (
78
+ <HawaProvider themeName={args.theme}>
79
+ <ChargeWalletForm currency="SAR" />
80
+ </HawaProvider>
81
+ );
82
+ };
83
+
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
+ };
@@ -1,101 +1,44 @@
1
- import React, { useState } from "react";
2
- import { storiesOf } from "@storybook/react";
3
-
4
- import "../styles.css";
5
-
6
- const stories = storiesOf("Test", module);
7
-
8
- stories.add("Global Variables", () => {
9
- return <div>test</div>;
10
- });
1
+ import React from "react";
2
+ import PropTypes from "prop-types";
11
3
 
12
4
  export const GlobalVariables = (args) => {
13
5
  // const methods = useForm();
14
- return <div>test</div>;
6
+ return <div>TESTING COMPONENT</div>;
7
+ };
8
+ export const AnotherComponent = (args) => {
9
+ // const methods = useForm();
10
+ return <div>TESTING COMPONENT</div>;
11
+ };
12
+ AnotherComponent.propTypes = {
13
+ textLabel: PropTypes.string
15
14
  };
16
15
  export default {
17
- title: "GlobalVariables",
18
- component: [
19
- StyledCheckBox,
20
- StyledTextFieldT,
21
- StyledTextAreaT,
22
- StyledRadioSeletorT
23
- ],
16
+ title: "TestTitle",
17
+ component: [GlobalVariables, AnotherComponent],
24
18
  argTypes: {
25
19
  resize: {
20
+ description: "overwritten description",
21
+ table: {
22
+ type: {
23
+ summary: "something short"
24
+ },
25
+ defaultValue: { summary: "Hello" }
26
+ },
26
27
  options: ["vertical", "horizontal", "both"],
27
- control: { type: "radio" }
28
+ control: { type: "select" }
29
+ },
30
+ label: {
31
+ description: "overwritten description",
32
+ table: {
33
+ type: {
34
+ summary: "something short",
35
+ detail: "something really really long"
36
+ },
37
+ defaultValue: { summary: "Hello" }
38
+ },
39
+ control: {
40
+ type: null
41
+ }
28
42
  }
29
43
  }
30
44
  };
31
-
32
- /****************************/
33
- // STYLED CHECKBOX TEMPLATE
34
- // const StyledCheckBoxTemplate = (args) => {
35
- // const methods = useForm();
36
- // return (
37
- // <FormProvider {...methods}>
38
- // <StyledCheckbox {...args} />
39
- // </FormProvider>
40
- // );
41
- // };
42
- // export const StyledCheckBox = StyledCheckBoxTemplate.bind({});
43
- // StyledCheckBox.args = {
44
- // name: "checkbox",
45
- // label: "CheckBox",
46
- // color: "blue",
47
- // rules: { required: true },
48
- // defaultValue: true
49
- // };
50
- /****************************/
51
-
52
- /****************************/
53
- // STYLED TextField TEMPLATE
54
- // const StyledTextFieldTemplate = (args) => {
55
- // const methods = useForm();
56
- // return (
57
- // <FormProvider {...methods}>
58
- // <StyledTextField {...args} />
59
- // </FormProvider>
60
- // );
61
- // };
62
-
63
- // export const StyledTextFieldT = StyledTextFieldTemplate.bind({});
64
- // StyledTextFieldT.args = {
65
- // name: "styledtextfield",
66
- // inputLabel: "Label",
67
- // bdRadius: 12,
68
- // bgColor: "lightgray",
69
- // helperText: "This is HelperText",
70
- // type: "text",
71
- // placeholder: "exemple ..."
72
- // };
73
-
74
- /****************************/
75
- // Radio Selector Template
76
- // const styledRadioSelectorTempalte = (args) => {
77
- // const methods = useForm();
78
-
79
- // return (
80
- // <FormProvider {...methods}>
81
- // <StyledRadioSelector {...args} />
82
- // </FormProvider>
83
- // );
84
- // };
85
-
86
- // export const StyledRadioSeletorT = styledRadioSelectorTempalte.bind({});
87
- // StyledRadioSeletorT.args = {
88
- // name: "Radio Selector",
89
- // shouldUnregister: true,
90
- // options: [
91
- // { text: "Option 1", label: "option1" },
92
- // { text: "Option 2", label: "option2" },
93
- // { text: "Option 3", label: "option3" }
94
- // ],
95
- // selectedColor: "blue",
96
- // bdRadius: 12,
97
- // defaultValue: "option2",
98
- // bgSelectedColor: "red",
99
- // textSelectedColor: "black"
100
- // };
101
- /****************************/
@@ -1,5 +1,4 @@
1
1
  import React from "react";
2
- import CastIcon from "@material-ui/icons/Cast";
3
2
  import { HawaProvider } from "../themes/HawaProvider";
4
3
 
5
4
  const Template = (args) => {