@sikka/hawa 0.0.2 → 0.0.3

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 (130) hide show
  1. package/.github/workflows/hawa-publish.yml +43 -0
  2. package/.prettierrc +28 -28
  3. package/README.md +149 -148
  4. package/package.json +49 -47
  5. package/rollup.config.js +30 -30
  6. package/src/blocks/Account/UserProfile.js +15 -0
  7. package/src/blocks/Account/UserSettings.js +15 -0
  8. package/src/blocks/Account/index.js +2 -0
  9. package/src/blocks/AuthForms/NewPasswordForm.js +17 -0
  10. package/src/blocks/AuthForms/ResetPasswordForm.js +14 -0
  11. package/src/blocks/AuthForms/SignInForm.js +19 -0
  12. package/src/{components/Hawa → blocks}/AuthForms/SignUpForm.js +20 -26
  13. package/src/{components/Hawa → blocks}/AuthForms/index.js +4 -4
  14. package/src/{components/Hawa → blocks}/AuthForms/viaFacebook.js +0 -0
  15. package/src/{components/Hawa → blocks}/AuthForms/viaGithub.js +0 -0
  16. package/src/{components/Hawa → blocks}/AuthForms/viaGoogle.js +0 -0
  17. package/src/{components/Hawa → blocks}/AuthForms/viaTwitter.js +0 -0
  18. package/src/index.js +1 -1
  19. package/src/layout/Box.js +25 -0
  20. package/src/layout/index.js +1 -0
  21. package/src/stories/ActionButton.stories.js +49 -0
  22. package/src/stories/AdaptiveButton.stories.js +80 -80
  23. package/src/stories/Alert.stories.js +41 -48
  24. package/src/stories/AuthForm.stories.js +79 -76
  25. package/src/stories/Box.stories.js +64 -45
  26. package/src/stories/CheckBox.stories.js +35 -34
  27. package/src/stories/GlobalVariables.stories.js +101 -108
  28. package/src/stories/HawaProvider.stories.js +23 -23
  29. package/src/stories/InputLabel.stories.js +92 -100
  30. package/src/stories/Introduction.stories.js +211 -0
  31. package/src/stories/RadioSelector.stories.js +69 -69
  32. package/src/stories/TextField.stories.js +50 -50
  33. package/src/stories/UserAccount.stories.js +46 -0
  34. package/src/styles.css +400 -400
  35. package/src/themes/HawaProvider.js +45 -0
  36. package/src/ui/ActionButton.js +15 -0
  37. package/src/{components/Hawa/AdaptiveButton → ui}/AdaptiveButton.js +252 -254
  38. package/src/{components/Hawa/AutoCompleteField/AutoCompleteField.jsx → ui/AutoCompleteField.js} +33 -33
  39. package/src/{components/Hawa/Checkbox/Checkbox.jsx → ui/Checkbox.js} +21 -20
  40. package/src/{components/Hawa/DragDropImages/DragDropImages.jsx → ui/DragDropImages.js} +180 -180
  41. package/src/{components/Hawa/Hawa.jsx → ui/Hawa.js} +3 -3
  42. package/src/{components/Hawa/RadioBox/RadioBox.jsx → ui/RadioBox.js} +29 -29
  43. package/src/{components/Hawa/RadioSelector/RadioSelector.jsx → ui/RadioSelector.js} +51 -51
  44. package/src/{components/Hawa/Row/Row.jsx → ui/Row.js} +21 -21
  45. package/src/{components/Hawa/SelectedField/SelectedField.jsx → ui/SelectedField.js} +46 -46
  46. package/src/ui/StyledAlert.js +30 -0
  47. package/src/ui/StyledInputLabel.js +19 -0
  48. package/src/{components/Hawa/StyledTooltip → ui}/StyledTooltip.js +46 -46
  49. package/src/{components/Hawa/TabPanel/TabPanel.jsx → ui/TabPanel.js} +37 -37
  50. package/src/{components/Hawa/TextArea/TextArea.jsx → ui/TextArea.js} +38 -38
  51. package/src/{components/Hawa/TextField → ui}/TextField.js +62 -54
  52. package/src/{components/Hawa → ui}/index.js +13 -10
  53. package/src/util.js +20 -20
  54. package/storybook-static/0.d3bc3395610cf5d3ee94.manager.bundle.js +1 -0
  55. package/storybook-static/0.dd3d47f5.iframe.bundle.js +1 -0
  56. package/storybook-static/1.4e43f671.iframe.bundle.js +3 -0
  57. package/storybook-static/{1.7c0dc86d.iframe.bundle.js.LICENSE.txt → 1.4e43f671.iframe.bundle.js.LICENSE.txt} +0 -0
  58. package/storybook-static/1.4e43f671.iframe.bundle.js.map +1 -0
  59. package/storybook-static/2.9a757207.iframe.bundle.js +1 -0
  60. package/storybook-static/{3.592ce28f.iframe.bundle.js → 3.c1dc7159.iframe.bundle.js} +0 -0
  61. package/storybook-static/4.8c311a6b48cad9f29317.manager.bundle.js +2 -0
  62. package/storybook-static/{5.f459d151315e6780c20f.manager.bundle.js.LICENSE.txt → 4.8c311a6b48cad9f29317.manager.bundle.js.LICENSE.txt} +0 -0
  63. package/storybook-static/5.88fe62ee92ff5ca67829.manager.bundle.js +1 -0
  64. package/storybook-static/6.96d184f368dea006cb52.manager.bundle.js +2 -0
  65. package/storybook-static/{11.f4e922583ae35da460f3.manager.bundle.js.LICENSE.txt → 6.96d184f368dea006cb52.manager.bundle.js.LICENSE.txt} +0 -0
  66. package/storybook-static/{7.3d04765dbf3f1dcd706c.manager.bundle.js → 7.5ec31f3702b08ab0b71c.manager.bundle.js} +1 -1
  67. package/storybook-static/7.69d2e532.iframe.bundle.js +1 -0
  68. package/storybook-static/8.5ce13be7612bd3a6b864.manager.bundle.js +1 -0
  69. package/storybook-static/{8.8e2132ec.iframe.bundle.js → 8.68cd1217.iframe.bundle.js} +2 -2
  70. package/storybook-static/{8.8e2132ec.iframe.bundle.js.LICENSE.txt → 8.68cd1217.iframe.bundle.js.LICENSE.txt} +0 -0
  71. package/storybook-static/8.68cd1217.iframe.bundle.js.map +1 -0
  72. package/storybook-static/{9.109ea555.iframe.bundle.js → 9.488e3969.iframe.bundle.js} +0 -0
  73. package/storybook-static/iframe.html +2 -2
  74. package/storybook-static/index.html +9 -1
  75. package/storybook-static/main.65cb2769.iframe.bundle.js +1 -0
  76. package/storybook-static/main.7e391cf7bf72b0d18ea5.manager.bundle.js +1 -0
  77. package/storybook-static/{runtime~main.ffc8677e.iframe.bundle.js → runtime~main.6e2e1544.iframe.bundle.js} +1 -1
  78. package/storybook-static/runtime~main.cc29f4c2175f187a3707.manager.bundle.js +1 -0
  79. package/storybook-static/vendors~main.d144d840.iframe.bundle.js +3 -0
  80. package/storybook-static/{vendors~main.4aa936b1.iframe.bundle.js.LICENSE.txt → vendors~main.d144d840.iframe.bundle.js.LICENSE.txt} +0 -0
  81. package/storybook-static/vendors~main.d144d840.iframe.bundle.js.map +1 -0
  82. package/storybook-static/vendors~main.f228d62e92b69563cefb.manager.bundle.js +2 -0
  83. package/storybook-static/{vendors~main.a935f15a2179a6eff5fd.manager.bundle.js.LICENSE.txt → vendors~main.f228d62e92b69563cefb.manager.bundle.js.LICENSE.txt} +6 -12
  84. package/yarn-error.log +10910 -0
  85. package/dist/index.es.js +0 -37
  86. package/dist/index.js +0 -37
  87. package/src/components/Hawa/AdaptiveButton/index.js +0 -1
  88. package/src/components/Hawa/AuthForms/NewPasswordForm.js +0 -23
  89. package/src/components/Hawa/AuthForms/ResetPasswordForm.js +0 -21
  90. package/src/components/Hawa/AuthForms/SignInForm.js +0 -25
  91. package/src/components/Hawa/AutoCompleteField/index.js +0 -1
  92. package/src/components/Hawa/Box/Box.js +0 -18
  93. package/src/components/Hawa/Box/index.js +0 -1
  94. package/src/components/Hawa/Checkbox/index.js +0 -1
  95. package/src/components/Hawa/DragDropImages/index.js +0 -1
  96. package/src/components/Hawa/HawaProvider/HawaProvider.js +0 -19
  97. package/src/components/Hawa/HawaProvider/index.js +0 -1
  98. package/src/components/Hawa/InputLabel/StyledInputLabel.js +0 -15
  99. package/src/components/Hawa/InputLabel/index.js +0 -1
  100. package/src/components/Hawa/RadioBox/index.js +0 -1
  101. package/src/components/Hawa/RadioSelector/index.js +0 -1
  102. package/src/components/Hawa/Row/index.js +0 -1
  103. package/src/components/Hawa/SelectedField/index.js +0 -1
  104. package/src/components/Hawa/StyledAlert/StyledAlert.js +0 -15
  105. package/src/components/Hawa/StyledAlert/index.js +0 -1
  106. package/src/components/Hawa/StyledTooltip/index.js +0 -1
  107. package/src/components/Hawa/TabPanel/index.js +0 -1
  108. package/src/components/Hawa/TextArea/index.js +0 -1
  109. package/src/components/Hawa/TextField/index.js +0 -1
  110. package/storybook-static/0.12392f0b.iframe.bundle.js +0 -1
  111. package/storybook-static/0.55b012452099ace2dca6.manager.bundle.js +0 -1
  112. package/storybook-static/1.0f38715c61c7c3cd11db.manager.bundle.js +0 -1
  113. package/storybook-static/1.7c0dc86d.iframe.bundle.js +0 -3
  114. package/storybook-static/1.7c0dc86d.iframe.bundle.js.map +0 -1
  115. package/storybook-static/10.9f2923a7561bc20fffdb.manager.bundle.js +0 -1
  116. package/storybook-static/11.f4e922583ae35da460f3.manager.bundle.js +0 -2
  117. package/storybook-static/12.1415460941f0bdcb8fa8.manager.bundle.js +0 -1
  118. package/storybook-static/2.ee357266.iframe.bundle.js +0 -1
  119. package/storybook-static/5.f459d151315e6780c20f.manager.bundle.js +0 -2
  120. package/storybook-static/6.3bd64d820f3745f262ff.manager.bundle.js +0 -1
  121. package/storybook-static/7.af56919f.iframe.bundle.js +0 -1
  122. package/storybook-static/8.8e2132ec.iframe.bundle.js.map +0 -1
  123. package/storybook-static/8.b541eadfcb9164835dfc.manager.bundle.js +0 -1
  124. package/storybook-static/9.411ac8e451bbb10926c7.manager.bundle.js +0 -1
  125. package/storybook-static/main.78b7d418.iframe.bundle.js +0 -1
  126. package/storybook-static/main.9bb085ebb152f5b19a2a.manager.bundle.js +0 -1
  127. package/storybook-static/runtime~main.9468098d21070636985f.manager.bundle.js +0 -1
  128. package/storybook-static/vendors~main.4aa936b1.iframe.bundle.js +0 -3
  129. package/storybook-static/vendors~main.4aa936b1.iframe.bundle.js.map +0 -1
  130. package/storybook-static/vendors~main.a935f15a2179a6eff5fd.manager.bundle.js +0 -2
@@ -1,26 +1,20 @@
1
- import React, { useContext } from "react";
2
- import { ThemeProvider } from "../HawaProvider";
3
- import { StyledInputLabel } from "../InputLabel";
4
- import { StyledTextField } from "../TextField";
5
-
6
- export const SignUpForm = (props) => {
7
- const theme = useContext(ThemeProvider);
8
- return (
9
- <div
10
- style={{
11
- backgroundColor: theme.paperColors,
12
- padding: theme.paddings,
13
- borderRadius: theme.borderRadius,
14
- margin: theme.margins
15
- }}
16
- >
17
- <StyledInputLabel label="Email" />
18
- <StyledTextField type="text" />
19
- <StyledInputLabel label="Password" />
20
- <StyledTextField type="text" />
21
- <StyledInputLabel label="Confirm Password" />
22
- <StyledTextField type="text" />
23
- {props.children}
24
- </div>
25
- );
26
- };
1
+ import React, { useContext } from "react";
2
+ import { Box } from "../../layout";
3
+ import { ThemeProvider } from "../../themes/HawaProvider";
4
+ import { StyledTextField, StyledInputLabel } from "../../ui";
5
+
6
+ export const SignUpForm = (props) => {
7
+ const theme = useContext(ThemeProvider);
8
+ return (
9
+ <Box maxWidth={400}>
10
+
11
+ <StyledInputLabel label="Email" />
12
+ <StyledTextField type="text" />
13
+ <StyledInputLabel label="Password" />
14
+ <StyledTextField type="text" />
15
+ <StyledInputLabel label="Confirm Password" />
16
+ <StyledTextField type="text" />
17
+ {props.children}
18
+ </Box>
19
+ );
20
+ };
@@ -1,4 +1,4 @@
1
- export * from "./NewPasswordForm.js";
2
- export * from "./ResetPasswordForm.js";
3
- export * from "./SignUpForm.js";
4
- export * from "./SignInForm.js";
1
+ export * from "./NewPasswordForm.js";
2
+ export * from "./ResetPasswordForm.js";
3
+ export * from "./SignUpForm.js";
4
+ export * from "./SignInForm.js";
package/src/index.js CHANGED
@@ -1 +1 @@
1
- export * from "./components/Hawa";
1
+ export * from "./components/Hawa";
@@ -0,0 +1,25 @@
1
+ import React, { useContext } from "react";
2
+ import { ThemeProvider } from "../themes/HawaProvider";
3
+
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',
13
+
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>
24
+ );
25
+ };
@@ -0,0 +1 @@
1
+ export * from "./Box";
@@ -0,0 +1,49 @@
1
+ import React from "react";
2
+
3
+ import { defaultTheme, HawaProvider } from "../themes/HawaProvider";
4
+ import { ActionButton } from "../ui";
5
+
6
+ const Template = (args) => {
7
+ const theme = {
8
+ borderRadius: 10,
9
+ primaryColor: "green",
10
+ secondaryColor: "red",
11
+ // margins: "10px",
12
+ paperColors: "#c6c6c6",
13
+ paddings: 10,
14
+ margins: 10
15
+ };
16
+ return (
17
+ <HawaProvider theme={{ ...defaultTheme, ...args.theme }}>
18
+ <ActionButton secondary={args.secondary} text='here' />
19
+ </HawaProvider>
20
+ );
21
+ };
22
+ //types:
23
+ //error (red)
24
+ //warning (red)
25
+ //notice (blue)
26
+
27
+ export default {
28
+ title: "UI/ActionButton",
29
+ component: ActionButton
30
+ };
31
+
32
+ export const Primary = Template.bind({});
33
+ Primary.args = {
34
+ showText: true,
35
+ buttonLabel: "test",
36
+ borderRadius: 5,
37
+ textColor: "#000000",
38
+ buttonColor: "#f9f9f9"
39
+ };
40
+
41
+ export const Secondary = Template.bind({});
42
+ Secondary.args = {
43
+ secondary: true,
44
+ showText: true,
45
+ buttonLabel: "test",
46
+ borderRadius: 5,
47
+ textColor: "#000000",
48
+ buttonColor: "#f9f9f9",
49
+ };
@@ -1,80 +1,80 @@
1
- import React from "react";
2
- import AdaptiveButton from "../components/Hawa/AdaptiveButton/AdaptiveButton";
3
- import CastIcon from "@material-ui/icons/Cast";
4
- import { HawaProvider } from "../components/Hawa/HawaProvider";
5
-
6
- const Template = (args) => {
7
- const theme = {
8
- borderRadius: 10,
9
- primaryColor: "#004fff",
10
- secondaryColor: "red",
11
- // margins: "10px",
12
- paddings: 10
13
- };
14
- return (
15
- <HawaProvider theme={theme}>
16
- <AdaptiveButton {...args} />
17
- </HawaProvider>
18
- );
19
- };
20
- export default {
21
- title: "Components/AdaptiveButton",
22
- component: AdaptiveButton,
23
- argsTypes: {
24
- buttonLabel: { control: "text" },
25
- borderRadius: { control: "number" },
26
- buttonColor: { control: "color" },
27
- padding: { control: "number" },
28
- hintTitle: { control: "text" },
29
- hintContent: { control: "text" }
30
- },
31
- args: {
32
- // type: "text",
33
- // buttonLabel: "Test"
34
- // borderRadius: 15,
35
- hintTitle: "test",
36
- hintContent: "more test",
37
- buttonColor: "#f9f9f9"
38
- }
39
- };
40
-
41
- export const Light = Template.bind({});
42
- Light.args = {
43
- showText: true,
44
- buttonLabel: "test",
45
- borderRadius: 5,
46
- icon: <CastIcon />,
47
- textColor: "#000000",
48
- buttonColor: "#f9f9f9"
49
- // placeholder: "Example ...",
50
- // defaultValue: "This is default value",
51
- // inputLabel: "Text Field",
52
- // padding: 10
53
- };
54
-
55
- export const Dark = Template.bind({});
56
- Dark.args = {
57
- showText: true,
58
- buttonLabel: "test",
59
- borderRadius: 5,
60
- buttonColor: "#878787",
61
- textColor: "#ffffff",
62
- icon: <CastIcon />
63
- // placeholder: "Exemple ...",
64
- // defaultValue: "This is default value",
65
- // inputLabel: "Text Field",
66
- // padding: 10
67
- };
68
- export const Danger = Template.bind({});
69
- Danger.args = {
70
- showText: true,
71
- buttonLabel: "test",
72
- borderRadius: 5,
73
- buttonColor: "#c0c0c0",
74
- danger: true,
75
- icon: <CastIcon />
76
- // placeholder: "Exemple ...",
77
- // defaultValue: "This is default value",
78
- // inputLabel: "Text Field",
79
- // padding: 10
80
- };
1
+ import React from "react";
2
+ import CastIcon from "@material-ui/icons/Cast";
3
+ import { HawaProvider } from "../themes/HawaProvider";
4
+ import { AdaptiveButton } from "../ui";
5
+
6
+ const Template = (args) => {
7
+ const theme = {
8
+ borderRadius: 10,
9
+ primaryColor: "#004fff",
10
+ secondaryColor: "red",
11
+ // margins: "10px",
12
+ paddings: 10
13
+ };
14
+ return (
15
+ <HawaProvider theme={theme}>
16
+ <AdaptiveButton {...args} />
17
+ </HawaProvider>
18
+ );
19
+ };
20
+ export default {
21
+ title: "UI/AdaptiveButton",
22
+ component: AdaptiveButton,
23
+ argsTypes: {
24
+ buttonLabel: { control: "text" },
25
+ borderRadius: { control: "number" },
26
+ buttonColor: { control: "color" },
27
+ padding: { control: "number" },
28
+ hintTitle: { control: "text" },
29
+ hintContent: { control: "text" }
30
+ },
31
+ args: {
32
+ // type: "text",
33
+ // buttonLabel: "Test"
34
+ // borderRadius: 15,
35
+ hintTitle: "test",
36
+ hintContent: "more test",
37
+ buttonColor: "#f9f9f9"
38
+ }
39
+ };
40
+
41
+ export const Light = Template.bind({});
42
+ Light.args = {
43
+ showText: true,
44
+ buttonLabel: "test",
45
+ borderRadius: 5,
46
+ icon: <CastIcon />,
47
+ textColor: "#000000",
48
+ buttonColor: "#f9f9f9"
49
+ // placeholder: "Example ...",
50
+ // defaultValue: "This is default value",
51
+ // inputLabel: "Text Field",
52
+ // padding: 10
53
+ };
54
+
55
+ export const Dark = Template.bind({});
56
+ Dark.args = {
57
+ showText: true,
58
+ buttonLabel: "test",
59
+ borderRadius: 5,
60
+ buttonColor: "#878787",
61
+ textColor: "#ffffff",
62
+ icon: <CastIcon />
63
+ // placeholder: "Exemple ...",
64
+ // defaultValue: "This is default value",
65
+ // inputLabel: "Text Field",
66
+ // padding: 10
67
+ };
68
+ export const Danger = Template.bind({});
69
+ Danger.args = {
70
+ showText: true,
71
+ buttonLabel: "test",
72
+ borderRadius: 5,
73
+ buttonColor: "#c0c0c0",
74
+ danger: true,
75
+ icon: <CastIcon />
76
+ // placeholder: "Exemple ...",
77
+ // defaultValue: "This is default value",
78
+ // inputLabel: "Text Field",
79
+ // padding: 10
80
+ };
@@ -1,48 +1,41 @@
1
- import React from "react";
2
-
3
- import { HawaProvider } from "../components/Hawa/HawaProvider";
4
- import { StyledAlert } from "../components/Hawa/StyledAlert/StyledAlert";
5
-
6
- const Template = (args) => {
7
- const theme = {
8
- borderRadius: 10,
9
- primaryColor: "green",
10
- secondaryColor: "red",
11
- // margins: "10px",
12
- paperColors: "#c6c6c6",
13
- paddings: 10,
14
- margins: 10
15
- };
16
- return (
17
- <HawaProvider theme={theme}>
18
- <StyledAlert text="teshht" />
19
- </HawaProvider>
20
- );
21
- };
22
- //types:
23
- //error (red)
24
- //warning (red)
25
- //notice (blue)
26
-
27
- export default {
28
- title: "Components/Alert",
29
- component: StyledAlert
30
- };
31
-
32
- export const Light = Template.bind({});
33
- Light.args = {
34
- showText: true,
35
- buttonLabel: "test",
36
- borderRadius: 5,
37
- textColor: "#000000",
38
- buttonColor: "#f9f9f9"
39
- };
40
-
41
- export const Dark = Template.bind({});
42
- Dark.args = {
43
- showText: true,
44
- buttonLabel: "test",
45
- borderRadius: 5,
46
- buttonColor: "#878787",
47
- textColor: "#ffffff"
48
- };
1
+ import React from "react";
2
+
3
+ import { HawaProvider } from "../themes/HawaProvider";
4
+ import { StyledAlert } from "../ui";
5
+
6
+ const Template = (args) => {
7
+ const theme = {
8
+ borderRadius: 10,
9
+ primaryColor: "green",
10
+ secondaryColor: "red",
11
+ // margins: "10px",
12
+ paperColors: "#c6c6c6",
13
+ paddings: 10,
14
+ margins: 10
15
+ };
16
+ return (
17
+ <HawaProvider theme={theme}>
18
+ <StyledAlert text="This is a warning" type="warning" />
19
+ <StyledAlert text="This is a regular notification" type="notification" />
20
+ <StyledAlert text="This is a danger alert" type="danger" />
21
+ </HawaProvider>
22
+ );
23
+ };
24
+ //types:
25
+ //error (red)
26
+ //warning (red)
27
+ //notice (blue)
28
+
29
+ export default {
30
+ title: "UI/Alert",
31
+ component: StyledAlert
32
+ };
33
+
34
+ export const Default = Template.bind({});
35
+ Default.args = {
36
+ showText: true,
37
+ buttonLabel: "test",
38
+ borderRadius: 5,
39
+ textColor: "#000000",
40
+ buttonColor: "#f9f9f9"
41
+ };
@@ -1,76 +1,79 @@
1
- import React from "react";
2
- import { NewPasswordForm } from "../components/Hawa/AuthForms/NewPasswordForm";
3
- import { ResetPasswordForm } from "../components/Hawa/AuthForms/ResetPasswordForm";
4
- import { SignInForm } from "../components/Hawa/AuthForms/SignInForm";
5
- import { SignUpForm } from "../components/Hawa/AuthForms/SignUpForm";
6
- import { HawaProvider } from "../components/Hawa/HawaProvider";
7
-
8
- export default {
9
- title: "Blocks/AuthForms",
10
- component: SignInForm,
11
- argsTypes: {
12
- viaGoogle: { control: "boolean" },
13
- viaGithub: { control: "boolean" },
14
- viaTwitter: { control: "boolean" },
15
- viaFacebook: { control: "boolean" }
16
- },
17
- args: {}
18
- };
19
-
20
- const theme = {
21
- borderRadius: 20,
22
- primaryColor: "green",
23
- secondaryColor: "red",
24
- inputColor: "lightGrey",
25
- paddings: 10
26
- };
27
-
28
- const SignInTemplate = (args) => {
29
- return (
30
- <HawaProvider theme={theme}>
31
- <SignInForm {...args} />
32
- </HawaProvider>
33
- );
34
- };
35
-
36
- export const SignIn = SignInTemplate.bind({});
37
- SignIn.args = {
38
- viaGoogle: true,
39
- viaGithub: true,
40
- viaTwitter: true,
41
- viaFacebook: true
42
- };
43
-
44
- const SignUpTemplate = (args) => {
45
- return (
46
- <HawaProvider theme={theme}>
47
- <SignUpForm {...args} />
48
- </HawaProvider>
49
- );
50
- };
51
- export const SignUp = SignUpTemplate.bind({});
52
- SignUp.args = {
53
- viaGoogle: true,
54
- viaGithub: true,
55
- viaTwitter: true,
56
- viaFacebook: true
57
- };
58
-
59
- const ResetPasswordTemplate = (args) => {
60
- return (
61
- <HawaProvider theme={theme}>
62
- <ResetPasswordForm {...args} />
63
- </HawaProvider>
64
- );
65
- };
66
- export const ResetPassword = ResetPasswordTemplate.bind({});
67
- ResetPassword.args = {};
68
- const NewPasswordTemplate = (args) => {
69
- return (
70
- <HawaProvider theme={theme}>
71
- <NewPasswordForm {...args} />
72
- </HawaProvider>
73
- );
74
- };
75
- export const NewPassword = NewPasswordTemplate.bind({});
76
- NewPassword.args = {};
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/AuthForms",
12
+ component: SignInForm,
13
+ argsTypes: {
14
+ viaGoogle: { control: "boolean" },
15
+ viaGithub: { control: "boolean" },
16
+ viaTwitter: { control: "boolean" },
17
+ viaFacebook: { control: "boolean" }
18
+ },
19
+ args: {}
20
+ };
21
+
22
+ const theme = {
23
+ borderRadius: 20,
24
+ primaryColor: "green",
25
+ secondaryColor: "red",
26
+ inputColor: "lightGrey",
27
+ paddings: 10,
28
+ paperColors: 'blue'
29
+ };
30
+
31
+ const SignInTemplate = (args) => {
32
+ return (
33
+ <HawaProvider theme={{ ...defaultTheme }}>
34
+ <SignInForm {...args} />
35
+ </HawaProvider>
36
+ );
37
+ };
38
+
39
+ export const SignIn = SignInTemplate.bind({});
40
+ SignIn.args = {
41
+ viaGoogle: true,
42
+ viaGithub: true,
43
+ viaTwitter: true,
44
+ viaFacebook: true
45
+ };
46
+
47
+ const SignUpTemplate = (args) => {
48
+ return (
49
+ <HawaProvider theme={{ ...defaultTheme }}>
50
+ <SignUpForm {...args} />
51
+ </HawaProvider>
52
+ );
53
+ };
54
+ export const SignUp = SignUpTemplate.bind({});
55
+ SignUp.args = {
56
+ viaGoogle: true,
57
+ viaGithub: true,
58
+ viaTwitter: true,
59
+ viaFacebook: true
60
+ };
61
+
62
+ const ResetPasswordTemplate = (args) => {
63
+ return (
64
+ <HawaProvider theme={{ ...defaultTheme }}>
65
+ <ResetPasswordForm {...args} />
66
+ </HawaProvider>
67
+ );
68
+ };
69
+ export const ResetPassword = ResetPasswordTemplate.bind({});
70
+ ResetPassword.args = {};
71
+ const NewPasswordTemplate = (args) => {
72
+ return (
73
+ <HawaProvider theme={{ ...defaultTheme }}>
74
+ <NewPasswordForm {...args} />
75
+ </HawaProvider>
76
+ );
77
+ };
78
+ export const NewPassword = NewPasswordTemplate.bind({});
79
+ NewPassword.args = {};