@sikka/hawa 0.0.1
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.
- package/.prettierrc +28 -0
- package/README.md +119 -0
- package/package.json +47 -0
- package/rollup.config.js +40 -0
- package/src/components/Hawa/AdaptiveButton/AdaptiveButton.jsx +261 -0
- package/src/components/Hawa/AdaptiveButton/index.js +1 -0
- package/src/components/Hawa/AutoCompleteField/AutoCompleteField.jsx +33 -0
- package/src/components/Hawa/AutoCompleteField/index.js +1 -0
- package/src/components/Hawa/Checkbox/Checkbox.jsx +20 -0
- package/src/components/Hawa/Checkbox/index.js +1 -0
- package/src/components/Hawa/DragDropImages/DragDropImages.jsx +180 -0
- package/src/components/Hawa/DragDropImages/index.js +1 -0
- package/src/components/Hawa/Hawa.jsx +3 -0
- package/src/components/Hawa/HawaProvider/HawaProvider.js +19 -0
- package/src/components/Hawa/HawaProvider/index.js +1 -0
- package/src/components/Hawa/InputLabel/StyledInputLabel.jsx +36 -0
- package/src/components/Hawa/InputLabel/index.js +1 -0
- package/src/components/Hawa/RadioBox/RadioBox.jsx +29 -0
- package/src/components/Hawa/RadioBox/index.js +1 -0
- package/src/components/Hawa/RadioSelector/RadioSelector.jsx +51 -0
- package/src/components/Hawa/RadioSelector/index.js +1 -0
- package/src/components/Hawa/Row/Row.jsx +23 -0
- package/src/components/Hawa/Row/index.js +1 -0
- package/src/components/Hawa/SelectedField/SelectedField.jsx +46 -0
- package/src/components/Hawa/SelectedField/index.js +1 -0
- package/src/components/Hawa/TabPanel/TabPanel.jsx +38 -0
- package/src/components/Hawa/TabPanel/index.js +1 -0
- package/src/components/Hawa/TextArea/TextArea.jsx +39 -0
- package/src/components/Hawa/TextArea/index.js +1 -0
- package/src/components/Hawa/TextField/TextField.jsx +41 -0
- package/src/components/Hawa/TextField/index.js +1 -0
- package/src/components/Hawa/index.js +11 -0
- package/src/index.js +1 -0
- package/src/stories/AdaptiveButton.stories.js +84 -0
- package/src/stories/CheckBox.stories.js +33 -0
- package/src/stories/GlobalVariables.stories.js +108 -0
- package/src/stories/HawaProvider.stories.js +23 -0
- package/src/stories/InputLabel.stories.js +100 -0
- package/src/stories/RadioSelector.stories.js +69 -0
- package/src/stories/TextField.stories.js +59 -0
- package/src/styles.css +403 -0
- package/storybook-static/0.86a7edfd.iframe.bundle.js +1 -0
- package/storybook-static/0.b73eaee9a88f178d62ed.manager.bundle.js +1 -0
- package/storybook-static/1.f296d183a17268696d73.manager.bundle.js +1 -0
- package/storybook-static/10.9998ba67d65d81d20896.manager.bundle.js +1 -0
- package/storybook-static/11.49c687eaa6261f8b7be2.manager.bundle.js +2 -0
- package/storybook-static/11.49c687eaa6261f8b7be2.manager.bundle.js.LICENSE.txt +12 -0
- package/storybook-static/12.c9538ed3766c96f289e7.manager.bundle.js +1 -0
- package/storybook-static/4.f6eb74f4.iframe.bundle.js +3 -0
- package/storybook-static/4.f6eb74f4.iframe.bundle.js.LICENSE.txt +8 -0
- package/storybook-static/4.f6eb74f4.iframe.bundle.js.map +1 -0
- package/storybook-static/5.ec6f37af.iframe.bundle.js +1 -0
- package/storybook-static/5.fa71488e730c5c7f885f.manager.bundle.js +2 -0
- package/storybook-static/5.fa71488e730c5c7f885f.manager.bundle.js.LICENSE.txt +8 -0
- package/storybook-static/6.8096ae4aadde0743697b.manager.bundle.js +1 -0
- package/storybook-static/6.fbc7b90b.iframe.bundle.js +3 -0
- package/storybook-static/6.fbc7b90b.iframe.bundle.js.LICENSE.txt +12 -0
- package/storybook-static/6.fbc7b90b.iframe.bundle.js.map +1 -0
- package/storybook-static/7.a806a38f.iframe.bundle.js +1 -0
- package/storybook-static/7.b34baecbd082bc7b188d.manager.bundle.js +1 -0
- package/storybook-static/8.15577edffecf900a8de2.manager.bundle.js +1 -0
- package/storybook-static/9.d7d85aa0a49a98f17218.manager.bundle.js +1 -0
- package/storybook-static/favicon.ico +0 -0
- package/storybook-static/iframe.html +138 -0
- package/storybook-static/index.html +47 -0
- package/storybook-static/main.355ffc59.iframe.bundle.js +1 -0
- package/storybook-static/main.ce406c7e93b98325390e.manager.bundle.js +1 -0
- package/storybook-static/runtime~main.3d81579b.iframe.bundle.js +1 -0
- package/storybook-static/runtime~main.909d038f912f063e8837.manager.bundle.js +1 -0
- package/storybook-static/vendors~main.73411ca9.iframe.bundle.js +3 -0
- package/storybook-static/vendors~main.73411ca9.iframe.bundle.js.LICENSE.txt +148 -0
- package/storybook-static/vendors~main.73411ca9.iframe.bundle.js.map +1 -0
- package/storybook-static/vendors~main.d3455eed64b243c89325.manager.bundle.js +2 -0
- package/storybook-static/vendors~main.d3455eed64b243c89325.manager.bundle.js.LICENSE.txt +88 -0
|
@@ -0,0 +1,108 @@
|
|
|
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
|
+
/****************************/
|
|
@@ -0,0 +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
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
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
|
+
/****************************/
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StyledRadioSelector } from "../components/Hawa/RadioSelector";
|
|
3
|
+
import { HawaProvider } from "../components/Hawa/HawaProvider";
|
|
4
|
+
import "../styles.css";
|
|
5
|
+
|
|
6
|
+
const Template = (args) => {
|
|
7
|
+
const theme = {
|
|
8
|
+
borderRadius: 5,
|
|
9
|
+
primaryColor: "green",
|
|
10
|
+
secondaryColor: "red",
|
|
11
|
+
// margins: "10px",
|
|
12
|
+
paddings: 10
|
|
13
|
+
};
|
|
14
|
+
return (
|
|
15
|
+
<HawaProvider theme={theme}>
|
|
16
|
+
<StyledRadioSelector {...args} />
|
|
17
|
+
</HawaProvider>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
export default {
|
|
21
|
+
title: "Components/RadioSelector",
|
|
22
|
+
component: Light,
|
|
23
|
+
argTypes: {
|
|
24
|
+
options: {
|
|
25
|
+
control: "array"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
args: {
|
|
29
|
+
options: [
|
|
30
|
+
{ text: "Option 1", label: "option1" },
|
|
31
|
+
{ text: "Option 2", label: "option2" },
|
|
32
|
+
{ text: "Option 3", label: "option3" }
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Light = Template.bind({});
|
|
38
|
+
export const Dark = Template.bind({});
|
|
39
|
+
|
|
40
|
+
Light.args = {
|
|
41
|
+
options: [
|
|
42
|
+
{ text: "Option 1", label: "option1" },
|
|
43
|
+
{ text: "Option 2", label: "option2" },
|
|
44
|
+
{ text: "Option 3", label: "option3" }
|
|
45
|
+
],
|
|
46
|
+
selectedColor: "blue",
|
|
47
|
+
borderRadius: 12,
|
|
48
|
+
defaultValue: "option2",
|
|
49
|
+
bgSelectedColor: "red",
|
|
50
|
+
textSelectedColor: "black",
|
|
51
|
+
handleChange: () => {
|
|
52
|
+
console.log("handleChange goes here");
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
Dark.args = {
|
|
56
|
+
options: [
|
|
57
|
+
{ text: "Option 1", label: "option1" },
|
|
58
|
+
{ text: "Option 2", label: "option2" },
|
|
59
|
+
{ text: "Option 3", label: "option3" }
|
|
60
|
+
],
|
|
61
|
+
selectedColor: "blue",
|
|
62
|
+
borderRadius: 12,
|
|
63
|
+
defaultValue: "option2",
|
|
64
|
+
bgSelectedColor: "blue",
|
|
65
|
+
textSelectedColor: "white",
|
|
66
|
+
handleChange: () => {
|
|
67
|
+
console.log("handleChange goes here");
|
|
68
|
+
}
|
|
69
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { StyledTextField } from "../components/Hawa/TextField/TextField";
|
|
3
|
+
import "../styles.css";
|
|
4
|
+
|
|
5
|
+
const Template = (args) => {
|
|
6
|
+
return <StyledTextField {...args} />;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: "Components/TextField",
|
|
11
|
+
component: Light,
|
|
12
|
+
argsTypes: {
|
|
13
|
+
defaultValue: {
|
|
14
|
+
control: { type: "text" }
|
|
15
|
+
},
|
|
16
|
+
value: {
|
|
17
|
+
control: { type: "text" }
|
|
18
|
+
},
|
|
19
|
+
inputLabel: {
|
|
20
|
+
control: { type: "text" }
|
|
21
|
+
},
|
|
22
|
+
bdRadius: {
|
|
23
|
+
contol: { type: "number" }
|
|
24
|
+
},
|
|
25
|
+
placeholder: {
|
|
26
|
+
control: { type: "text" }
|
|
27
|
+
},
|
|
28
|
+
type: {
|
|
29
|
+
options: ["text", "number", "date"],
|
|
30
|
+
control: { type: "radio" }
|
|
31
|
+
},
|
|
32
|
+
padding: {
|
|
33
|
+
type: "number"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
args: {
|
|
37
|
+
bdRadius: 15,
|
|
38
|
+
defaultValue: "Test",
|
|
39
|
+
type: "date"
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const Light = Template.bind({});
|
|
44
|
+
export const Dark = Template.bind({});
|
|
45
|
+
|
|
46
|
+
Light.args = {
|
|
47
|
+
placeholder: "Exemple ...",
|
|
48
|
+
defaultValue: "This is default value",
|
|
49
|
+
inputLabel: "Text Field",
|
|
50
|
+
bgColor: "lightgray",
|
|
51
|
+
padding: 10
|
|
52
|
+
};
|
|
53
|
+
Dark.args = {
|
|
54
|
+
placeholder: "Exemple ...",
|
|
55
|
+
defaultValue: "This is default value",
|
|
56
|
+
inputLabel: "Text Field",
|
|
57
|
+
bgColor: "lightgray",
|
|
58
|
+
padding: 10
|
|
59
|
+
};
|