@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,45 +1,64 @@
1
- import React from "react";
2
- import AdaptiveButton from "../components/Hawa/AdaptiveButton/AdaptiveButton";
3
- import { Box } from "../components/Hawa/Box";
4
- import { HawaProvider } from "../components/Hawa/HawaProvider";
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
- <Box>Box 1</Box>
19
- <Box>Box 2</Box>
20
- <Box>Box 3</Box>
21
- </HawaProvider>
22
- );
23
- };
24
- export default {
25
- title: "Layout/Box",
26
- component: AdaptiveButton
27
- };
28
-
29
- export const Light = Template.bind({});
30
- Light.args = {
31
- showText: true,
32
- buttonLabel: "test",
33
- borderRadius: 5,
34
- textColor: "#000000",
35
- buttonColor: "#f9f9f9"
36
- };
37
-
38
- export const Dark = Template.bind({});
39
- Dark.args = {
40
- showText: true,
41
- buttonLabel: "test",
42
- borderRadius: 5,
43
- buttonColor: "#878787",
44
- textColor: "#ffffff"
45
- };
1
+ import React from "react";
2
+ import { Box } from "../layout";
3
+ import { HawaProvider, defaultTheme } from "../themes/HawaProvider";
4
+ const theme = {
5
+ // paperColors: "#c6c6c6",
6
+ // paperColors: "blue",
7
+ // textColors: 'orange',
8
+ ...defaultTheme
9
+
10
+ // borderRadius: 10,
11
+ // primaryColor: "blue",
12
+ // secondaryColor: "grey",
13
+ // backgroundColor: 'red',
14
+ // layoutColor: 'orange',
15
+ // margins: 10,
16
+ // paddings: 5
17
+ };
18
+
19
+ const Template = (args) => {
20
+ return (
21
+ <HawaProvider size={args.size} theme={{ ...defaultTheme, ...args.theme }}>
22
+ <Box>Box 1</Box>
23
+ <Box><div style={{ backgroundColor: 'white', padding: 10 }}>testing box in box</div></Box>
24
+ <Box>Box 3</Box>
25
+ </HawaProvider >
26
+ );
27
+ };
28
+ export default {
29
+ title: "Layout/Box",
30
+ component: <Box />,
31
+ parameters: {
32
+ backgrounds: {
33
+ default: 'light',
34
+ values: [
35
+ { name: 'light', value: theme.lightBackground },
36
+ { name: 'dark', value: theme.darkBackground },
37
+ ],
38
+ },
39
+ },
40
+ };
41
+
42
+ export const Normal = Template.bind({});
43
+ Normal.args = {
44
+ size: 'large',
45
+ showText: true,
46
+ buttonLabel: "test",
47
+ borderRadius: 5,
48
+ padding: theme.paddings,
49
+ textColor: "#000000",
50
+ buttonColor: "#f9f9f9"
51
+ };
52
+ export const Compact = Template.bind({});
53
+ Compact.args = {
54
+ size: 'small',
55
+ showText: true,
56
+ buttonLabel: "test",
57
+ theme: {
58
+ borderRadius: 5,
59
+ paddings: theme.paddings / 2,
60
+ textColor: "#000000",
61
+ buttonColor: "#f9f9f9",
62
+
63
+ }
64
+ };
@@ -1,34 +1,35 @@
1
- import React from "react";
2
- import { StyledCheckbox } from "../components/Hawa/Checkbox/Checkbox";
3
- import "../styles.css";
4
-
5
- const Template = (args) => {
6
- return <StyledCheckbox {...args} />;
7
- };
8
-
9
- export default {
10
- title: "Components/Checkbox",
11
- component: Light,
12
- argsTypes: {
13
- defaultValue: {
14
- options: [true, false],
15
- control: { type: "radio" }
16
- }
17
- },
18
- args: {
19
- defaultValue: true,
20
- disabled: true
21
- }
22
- };
23
-
24
- export const Light = Template.bind({});
25
- export const Dark = Template.bind({});
26
-
27
- Light.args = {
28
- color: "gray",
29
- defaultValue: false
30
- };
31
- Dark.args = {
32
- color: "gray",
33
- defaultValue: false
34
- };
1
+ import React from "react";
2
+ import { StyledCheckbox } from "../ui";
3
+ import "../styles.css";
4
+
5
+ const Template = (args) => {
6
+ return <StyledCheckbox {...args} />;
7
+ };
8
+
9
+ export default {
10
+ title: "UI/Checkbox",
11
+ component: Light,
12
+ argsTypes: {
13
+ defaultValue: {
14
+ options: [true, false],
15
+ control: { type: "radio" }
16
+ }
17
+ },
18
+ args: {
19
+ defaultValue: true,
20
+ disabled: true
21
+ }
22
+ };
23
+
24
+ export const Light = Template.bind({});
25
+ export const Dark = Template.bind({});
26
+
27
+ Light.args = {
28
+ color: "red",
29
+ defaultValue: false,
30
+ label: "test"
31
+ };
32
+ Dark.args = {
33
+ color: "gray",
34
+ defaultValue: false
35
+ };
@@ -1,108 +1,101 @@
1
- import React, { useState } from "react";
2
- import { storiesOf } from "@storybook/react";
3
- import { Hawa } from "../components/Hawa/Hawa";
4
- import { StyledCheckbox } from "../components/Hawa/Checkbox/Checkbox";
5
- import { AutoCompleteField } from "../components/Hawa/AutoCompleteField/AutoCompleteField";
6
- import { StyledInputLabel } from "../components/Hawa/InputLabel/StyledInputLabel";
7
- import { StyledTextArea } from "../components/Hawa/TextArea/TextArea";
8
- import { StyledTextField } from "../components/Hawa/TextField/TextField";
9
- import { StyledRadioSelector } from "../components/Hawa/RadioSelector";
10
- import { FormProvider, useForm } from "react-hook-form";
11
- import "../styles.css";
12
-
13
- const stories = storiesOf("Test", module);
14
-
15
- stories.add("Global Variables", () => {
16
- return <div>test</div>;
17
- });
18
-
19
- export const GlobalVariables = (args) => {
20
- // const methods = useForm();
21
- return <div>test</div>;
22
- };
23
- export default {
24
- title: "GlobalVariables",
25
- component: [
26
- StyledCheckBox,
27
- StyledTextFieldT,
28
- StyledTextAreaT,
29
- StyledRadioSeletorT
30
- ],
31
- argTypes: {
32
- resize: {
33
- options: ["vertical", "horizontal", "both"],
34
- control: { type: "radio" }
35
- }
36
- }
37
- };
38
-
39
- /****************************/
40
- // STYLED CHECKBOX TEMPLATE
41
- // const StyledCheckBoxTemplate = (args) => {
42
- // const methods = useForm();
43
- // return (
44
- // <FormProvider {...methods}>
45
- // <StyledCheckbox {...args} />
46
- // </FormProvider>
47
- // );
48
- // };
49
- // export const StyledCheckBox = StyledCheckBoxTemplate.bind({});
50
- // StyledCheckBox.args = {
51
- // name: "checkbox",
52
- // label: "CheckBox",
53
- // color: "blue",
54
- // rules: { required: true },
55
- // defaultValue: true
56
- // };
57
- /****************************/
58
-
59
- /****************************/
60
- // STYLED TextField TEMPLATE
61
- // const StyledTextFieldTemplate = (args) => {
62
- // const methods = useForm();
63
- // return (
64
- // <FormProvider {...methods}>
65
- // <StyledTextField {...args} />
66
- // </FormProvider>
67
- // );
68
- // };
69
-
70
- // export const StyledTextFieldT = StyledTextFieldTemplate.bind({});
71
- // StyledTextFieldT.args = {
72
- // name: "styledtextfield",
73
- // inputLabel: "Label",
74
- // bdRadius: 12,
75
- // bgColor: "lightgray",
76
- // helperText: "This is HelperText",
77
- // type: "text",
78
- // placeholder: "exemple ..."
79
- // };
80
-
81
- /****************************/
82
- // Radio Selector Template
83
- // const styledRadioSelectorTempalte = (args) => {
84
- // const methods = useForm();
85
-
86
- // return (
87
- // <FormProvider {...methods}>
88
- // <StyledRadioSelector {...args} />
89
- // </FormProvider>
90
- // );
91
- // };
92
-
93
- // export const StyledRadioSeletorT = styledRadioSelectorTempalte.bind({});
94
- // StyledRadioSeletorT.args = {
95
- // name: "Radio Selector",
96
- // shouldUnregister: true,
97
- // options: [
98
- // { text: "Option 1", label: "option1" },
99
- // { text: "Option 2", label: "option2" },
100
- // { text: "Option 3", label: "option3" }
101
- // ],
102
- // selectedColor: "blue",
103
- // bdRadius: 12,
104
- // defaultValue: "option2",
105
- // bgSelectedColor: "red",
106
- // textSelectedColor: "black"
107
- // };
108
- /****************************/
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
+ });
11
+
12
+ export const GlobalVariables = (args) => {
13
+ // const methods = useForm();
14
+ return <div>test</div>;
15
+ };
16
+ export default {
17
+ title: "GlobalVariables",
18
+ component: [
19
+ StyledCheckBox,
20
+ StyledTextFieldT,
21
+ StyledTextAreaT,
22
+ StyledRadioSeletorT
23
+ ],
24
+ argTypes: {
25
+ resize: {
26
+ options: ["vertical", "horizontal", "both"],
27
+ control: { type: "radio" }
28
+ }
29
+ }
30
+ };
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,23 +1,23 @@
1
- import React from "react";
2
- import CastIcon from "@material-ui/icons/Cast";
3
- import { HawaProvider } from "../components/Hawa/HawaProvider";
4
-
5
- const Template = (args) => {
6
- const theme = {
7
- borderRadius: 20,
8
- primaryColor: "green",
9
- secondaryColor: "red",
10
- // margins: "10px",
11
- paddings: 10
12
- };
13
- return (
14
- <HawaProvider theme={theme}>
15
- <div>test</div>
16
- </HawaProvider>
17
- );
18
- };
19
-
20
- export default {
21
- title: "Globals/HawaProvider",
22
- component: HawaProvider
23
- };
1
+ import React from "react";
2
+ import CastIcon from "@material-ui/icons/Cast";
3
+ import { HawaProvider } from "../themes/HawaProvider";
4
+
5
+ const Template = (args) => {
6
+ const theme = {
7
+ borderRadius: 20,
8
+ primaryColor: "green",
9
+ secondaryColor: "red",
10
+ // margins: "10px",
11
+ paddings: 10
12
+ };
13
+ return (
14
+ <HawaProvider theme={theme}>
15
+ <div>test</div>
16
+ </HawaProvider>
17
+ );
18
+ };
19
+
20
+ export default {
21
+ title: "Globals/HawaProvider",
22
+ component: HawaProvider
23
+ };
@@ -1,100 +1,92 @@
1
- import React, { useState } from "react";
2
- import { storiesOf } from "@storybook/react";
3
- import { Hawa } from "../components/Hawa/Hawa";
4
- import { StyledCheckbox } from "../components/Hawa/Checkbox/Checkbox";
5
- import { AutoCompleteField } from "../components/Hawa/AutoCompleteField/AutoCompleteField";
6
- import { StyledInputLabel } from "../components/Hawa/InputLabel/StyledInputLabel";
7
- import { StyledTextArea } from "../components/Hawa/TextArea/TextArea";
8
- import { StyledTextField } from "../components/Hawa/TextField/TextField";
9
- import { StyledRadioSelector } from "../components/Hawa/RadioSelector";
10
- import { FormProvider, useForm } from "react-hook-form";
11
- import "../styles.css";
12
-
13
- const stories = storiesOf("InputLabel", module);
14
-
15
- export default {
16
- title: "Components/InputLabel",
17
- component: [
18
- StyledCheckBox,
19
- StyledTextFieldT,
20
- StyledTextAreaT,
21
- StyledRadioSeletorT
22
- ],
23
- argTypes: {
24
- resize: {
25
- options: ["vertical", "horizontal", "both"],
26
- control: { type: "radio" }
27
- }
28
- }
29
- };
30
-
31
- /****************************/
32
- // STYLED CHECKBOX TEMPLATE
33
- // const StyledCheckBoxTemplate = (args) => {
34
- // const methods = useForm();
35
- // return (
36
- // <FormProvider {...methods}>
37
- // <StyledCheckbox {...args} />
38
- // </FormProvider>
39
- // );
40
- // };
41
- // export const StyledCheckBox = StyledCheckBoxTemplate.bind({});
42
- // StyledCheckBox.args = {
43
- // name: "Components/InputLabel",
44
- // label: "CheckBox",
45
- // color: "blue",
46
- // rules: { required: true },
47
- // defaultValue: true
48
- // };
49
- /****************************/
50
-
51
- /****************************/
52
- // STYLED TextField TEMPLATE
53
- // const StyledTextFieldTemplate = (args) => {
54
- // const methods = useForm();
55
- // return (
56
- // <FormProvider {...methods}>
57
- // <StyledTextField {...args} />
58
- // </FormProvider>
59
- // );
60
- // };
61
-
62
- // export const StyledTextFieldT = StyledTextFieldTemplate.bind({});
63
- // StyledTextFieldT.args = {
64
- // name: "Components/InputLabel",
65
- // inputLabel: "Label",
66
- // bdRadius: 12,
67
- // bgColor: "lightgray",
68
- // helperText: "This is HelperText",
69
- // type: "text",
70
- // placeholder: "exemple ..."
71
- // };
72
-
73
- /****************************/
74
- // Radio Selector Template
75
- // const styledRadioSelectorTempalte = (args) => {
76
- // const methods = useForm();
77
-
78
- // return (
79
- // <FormProvider {...methods}>
80
- // <StyledRadioSelector {...args} />
81
- // </FormProvider>
82
- // );
83
- // };
84
-
85
- // export const StyledRadioSeletorT = styledRadioSelectorTempalte.bind({});
86
- // StyledRadioSeletorT.args = {
87
- // name: "Components/InputLabel",
88
- // shouldUnregister: true,
89
- // options: [
90
- // { text: "Option 1", label: "option1" },
91
- // { text: "Option 2", label: "option2" },
92
- // { text: "Option 3", label: "option3" }
93
- // ],
94
- // selectedColor: "blue",
95
- // bdRadius: 12,
96
- // defaultValue: "option2",
97
- // bgSelectedColor: "red",
98
- // textSelectedColor: "black"
99
- // };
100
- /****************************/
1
+ import { storiesOf } from "@storybook/react";
2
+
3
+ import "../styles.css";
4
+
5
+ const stories = storiesOf("InputLabel", module);
6
+
7
+ export default {
8
+ title: "Components/InputLabel",
9
+ component: [
10
+ StyledCheckBox,
11
+ StyledTextFieldT,
12
+ StyledTextAreaT,
13
+ StyledRadioSeletorT
14
+ ],
15
+ argTypes: {
16
+ resize: {
17
+ options: ["vertical", "horizontal", "both"],
18
+ control: { type: "radio" }
19
+ }
20
+ }
21
+ };
22
+
23
+ /****************************/
24
+ // STYLED CHECKBOX TEMPLATE
25
+ // const StyledCheckBoxTemplate = (args) => {
26
+ // const methods = useForm();
27
+ // return (
28
+ // <FormProvider {...methods}>
29
+ // <StyledCheckbox {...args} />
30
+ // </FormProvider>
31
+ // );
32
+ // };
33
+ // export const StyledCheckBox = StyledCheckBoxTemplate.bind({});
34
+ // StyledCheckBox.args = {
35
+ // name: "Components/InputLabel",
36
+ // label: "CheckBox",
37
+ // color: "blue",
38
+ // rules: { required: true },
39
+ // defaultValue: true
40
+ // };
41
+ /****************************/
42
+
43
+ /****************************/
44
+ // STYLED TextField TEMPLATE
45
+ // const StyledTextFieldTemplate = (args) => {
46
+ // const methods = useForm();
47
+ // return (
48
+ // <FormProvider {...methods}>
49
+ // <StyledTextField {...args} />
50
+ // </FormProvider>
51
+ // );
52
+ // };
53
+
54
+ // export const StyledTextFieldT = StyledTextFieldTemplate.bind({});
55
+ // StyledTextFieldT.args = {
56
+ // name: "Components/InputLabel",
57
+ // inputLabel: "Label",
58
+ // bdRadius: 12,
59
+ // bgColor: "lightgray",
60
+ // helperText: "This is HelperText",
61
+ // type: "text",
62
+ // placeholder: "exemple ..."
63
+ // };
64
+
65
+ /****************************/
66
+ // Radio Selector Template
67
+ // const styledRadioSelectorTempalte = (args) => {
68
+ // const methods = useForm();
69
+
70
+ // return (
71
+ // <FormProvider {...methods}>
72
+ // <StyledRadioSelector {...args} />
73
+ // </FormProvider>
74
+ // );
75
+ // };
76
+
77
+ // export const StyledRadioSeletorT = styledRadioSelectorTempalte.bind({});
78
+ // StyledRadioSeletorT.args = {
79
+ // name: "Components/InputLabel",
80
+ // shouldUnregister: true,
81
+ // options: [
82
+ // { text: "Option 1", label: "option1" },
83
+ // { text: "Option 2", label: "option2" },
84
+ // { text: "Option 3", label: "option3" }
85
+ // ],
86
+ // selectedColor: "blue",
87
+ // bdRadius: 12,
88
+ // defaultValue: "option2",
89
+ // bgSelectedColor: "red",
90
+ // textSelectedColor: "black"
91
+ // };
92
+ /****************************/