@sikka/hawa 0.0.1 → 0.0.4
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/.github/workflows/hawa-publish-push.yml +45 -0
- package/.github/workflows/hawa-publish.yml +45 -0
- package/.prettierrc +28 -28
- package/README.md +149 -119
- package/es/index.es.js +1 -0
- package/lib/index.js +1 -0
- package/package.json +59 -47
- package/rollup.config.js +30 -40
- package/src/Assets/images/card-background/1.jpeg +0 -0
- package/src/Assets/images/card-background/10.jpeg +0 -0
- package/src/Assets/images/card-background/11.jpeg +0 -0
- package/src/Assets/images/card-background/12.jpeg +0 -0
- package/src/Assets/images/card-background/13.jpeg +0 -0
- package/src/Assets/images/card-background/14.jpeg +0 -0
- package/src/Assets/images/card-background/15.jpeg +0 -0
- package/src/Assets/images/card-background/16.jpeg +0 -0
- package/src/Assets/images/card-background/17.jpeg +0 -0
- package/src/Assets/images/card-background/18.jpeg +0 -0
- package/src/Assets/images/card-background/19.jpeg +0 -0
- package/src/Assets/images/card-background/2.jpeg +0 -0
- package/src/Assets/images/card-background/20.jpeg +0 -0
- package/src/Assets/images/card-background/21.jpeg +0 -0
- package/src/Assets/images/card-background/22.jpeg +0 -0
- package/src/Assets/images/card-background/23.jpeg +0 -0
- package/src/Assets/images/card-background/24.jpeg +0 -0
- package/src/Assets/images/card-background/25.jpeg +0 -0
- package/src/Assets/images/card-background/3.jpeg +0 -0
- package/src/Assets/images/card-background/4.jpeg +0 -0
- package/src/Assets/images/card-background/5.jpeg +0 -0
- package/src/Assets/images/card-background/6.jpeg +0 -0
- package/src/Assets/images/card-background/7.jpeg +0 -0
- package/src/Assets/images/card-background/8.jpeg +0 -0
- package/src/Assets/images/card-background/9.jpeg +0 -0
- package/src/Assets/images/card-type/amex.png +0 -0
- package/src/Assets/images/card-type/diners.png +0 -0
- package/src/Assets/images/card-type/discover.png +0 -0
- package/src/Assets/images/card-type/mastercard.png +0 -0
- package/src/Assets/images/card-type/troy.png +0 -0
- package/src/Assets/images/card-type/unionpay.png +0 -0
- package/src/Assets/images/card-type/visa.png +0 -0
- package/src/blocks/Account/UserProfile.js +15 -0
- package/src/blocks/Account/UserSettings.js +15 -0
- package/src/blocks/Account/index.js +2 -0
- package/src/blocks/AuthForms/NewPasswordForm.js +17 -0
- package/src/blocks/AuthForms/ResetPasswordForm.js +14 -0
- package/src/blocks/AuthForms/SignInForm.js +19 -0
- package/src/blocks/AuthForms/SignUpForm.js +20 -0
- package/src/blocks/AuthForms/index.js +4 -0
- package/src/blocks/AuthForms/viaFacebook.js +0 -0
- package/src/blocks/AuthForms/viaGithub.js +0 -0
- package/src/blocks/AuthForms/viaGoogle.js +0 -0
- package/src/blocks/AuthForms/viaTwitter.js +0 -0
- package/src/blocks/Payment/Form/CForm.js +326 -0
- package/src/blocks/Payment/Form/Card.js +242 -0
- package/src/blocks/Payment/Gateway/GooglePay.js +251 -0
- package/src/blocks/Payment/Gateway/Payfort.js +90 -0
- package/src/blocks/Payment/Gateway/Paypal.js +138 -0
- package/src/blocks/Payment/Gateway/Wallet.js +149 -0
- package/src/blocks/Payment/PaymentMethod.js +132 -0
- package/src/blocks/index.js +13 -0
- package/src/index.js +2 -1
- package/src/layout/Box.js +25 -0
- package/src/layout/index.js +1 -0
- package/src/stories/ActionButton.stories.js +49 -0
- package/src/stories/AdaptiveButton.stories.js +80 -84
- package/src/stories/Alert.stories.js +41 -0
- package/src/stories/AuthForm.stories.js +79 -0
- package/src/stories/Box.stories.js +64 -0
- package/src/stories/CheckBox.stories.js +35 -33
- package/src/stories/GlobalVariables.stories.js +101 -108
- package/src/stories/HawaProvider.stories.js +23 -23
- package/src/stories/InputLabel.stories.js +92 -100
- package/src/stories/Introduction.stories.js +211 -0
- package/src/stories/RadioSelector.stories.js +69 -69
- package/src/stories/TextField.stories.js +50 -59
- package/src/stories/UserAccount.stories.js +46 -0
- package/src/styles.css +400 -403
- package/src/styles.scss +679 -0
- package/src/themes/HawaProvider.js +45 -0
- package/src/ui/ActionButton.js +15 -0
- package/src/{components/Hawa/AdaptiveButton/AdaptiveButton.jsx → ui/AdaptiveButton.js} +252 -261
- package/src/{components/Hawa/AutoCompleteField/AutoCompleteField.jsx → ui/AutoCompleteField.js} +33 -33
- package/src/{components/Hawa/Checkbox/Checkbox.jsx → ui/Checkbox.js} +21 -20
- package/src/{components/Hawa/DragDropImages/DragDropImages.jsx → ui/DragDropImages.js} +180 -180
- package/src/{components/Hawa/Hawa.jsx → ui/Hawa.js} +3 -3
- package/src/{components/Hawa/RadioBox/RadioBox.jsx → ui/RadioBox.js} +29 -29
- package/src/{components/Hawa/RadioSelector/RadioSelector.jsx → ui/RadioSelector.js} +51 -51
- package/src/ui/Row.js +21 -0
- package/src/{components/Hawa/SelectedField/SelectedField.jsx → ui/SelectedField.js} +46 -46
- package/src/ui/StyledAlert.js +30 -0
- package/src/ui/StyledInputLabel.js +19 -0
- package/src/ui/StyledTooltip.js +46 -0
- package/src/{components/Hawa/TabPanel/TabPanel.jsx → ui/TabPanel.js} +37 -38
- package/src/{components/Hawa/TextArea/TextArea.jsx → ui/TextArea.js} +38 -39
- package/src/ui/TextField.js +62 -0
- package/src/{components/Hawa → ui}/index.js +13 -11
- package/src/util.js +20 -0
- package/storybook-static/0.d3bc3395610cf5d3ee94.manager.bundle.js +1 -0
- package/storybook-static/0.dd3d47f5.iframe.bundle.js +1 -0
- package/storybook-static/1.4e43f671.iframe.bundle.js +3 -0
- package/storybook-static/{4.f6eb74f4.iframe.bundle.js.LICENSE.txt → 1.4e43f671.iframe.bundle.js.LICENSE.txt} +8 -8
- package/storybook-static/1.4e43f671.iframe.bundle.js.map +1 -0
- package/storybook-static/2.9a757207.iframe.bundle.js +1 -0
- package/storybook-static/3.c1dc7159.iframe.bundle.js +1 -0
- package/storybook-static/4.8c311a6b48cad9f29317.manager.bundle.js +2 -0
- package/storybook-static/{5.fa71488e730c5c7f885f.manager.bundle.js.LICENSE.txt → 4.8c311a6b48cad9f29317.manager.bundle.js.LICENSE.txt} +8 -8
- package/storybook-static/5.88fe62ee92ff5ca67829.manager.bundle.js +1 -0
- package/storybook-static/6.96d184f368dea006cb52.manager.bundle.js +2 -0
- package/storybook-static/{11.49c687eaa6261f8b7be2.manager.bundle.js.LICENSE.txt → 6.96d184f368dea006cb52.manager.bundle.js.LICENSE.txt} +12 -12
- package/storybook-static/{7.a806a38f.iframe.bundle.js → 7.5ec31f3702b08ab0b71c.manager.bundle.js} +1 -1
- package/storybook-static/7.69d2e532.iframe.bundle.js +1 -0
- package/storybook-static/8.5ce13be7612bd3a6b864.manager.bundle.js +1 -0
- package/storybook-static/8.68cd1217.iframe.bundle.js +3 -0
- package/storybook-static/{6.fbc7b90b.iframe.bundle.js.LICENSE.txt → 8.68cd1217.iframe.bundle.js.LICENSE.txt} +12 -12
- package/storybook-static/8.68cd1217.iframe.bundle.js.map +1 -0
- package/storybook-static/9.488e3969.iframe.bundle.js +1 -0
- package/storybook-static/iframe.html +348 -138
- package/storybook-static/index.html +59 -47
- package/storybook-static/main.65cb2769.iframe.bundle.js +1 -0
- package/storybook-static/main.7e391cf7bf72b0d18ea5.manager.bundle.js +1 -0
- package/storybook-static/runtime~main.6e2e1544.iframe.bundle.js +1 -0
- package/storybook-static/runtime~main.cc29f4c2175f187a3707.manager.bundle.js +1 -0
- package/storybook-static/vendors~main.d144d840.iframe.bundle.js +3 -0
- package/storybook-static/{vendors~main.73411ca9.iframe.bundle.js.LICENSE.txt → vendors~main.d144d840.iframe.bundle.js.LICENSE.txt} +148 -148
- package/storybook-static/vendors~main.d144d840.iframe.bundle.js.map +1 -0
- package/storybook-static/vendors~main.f228d62e92b69563cefb.manager.bundle.js +2 -0
- package/storybook-static/{vendors~main.d3455eed64b243c89325.manager.bundle.js.LICENSE.txt → vendors~main.f228d62e92b69563cefb.manager.bundle.js.LICENSE.txt} +104 -88
- package/tools/build-styles.js +17 -0
- package/yarn-error.log +10910 -0
- package/src/components/Hawa/AdaptiveButton/index.js +0 -1
- package/src/components/Hawa/AutoCompleteField/index.js +0 -1
- package/src/components/Hawa/Checkbox/index.js +0 -1
- package/src/components/Hawa/DragDropImages/index.js +0 -1
- package/src/components/Hawa/HawaProvider/HawaProvider.js +0 -19
- package/src/components/Hawa/HawaProvider/index.js +0 -1
- package/src/components/Hawa/InputLabel/StyledInputLabel.jsx +0 -36
- package/src/components/Hawa/InputLabel/index.js +0 -1
- package/src/components/Hawa/RadioBox/index.js +0 -1
- package/src/components/Hawa/RadioSelector/index.js +0 -1
- package/src/components/Hawa/Row/Row.jsx +0 -23
- package/src/components/Hawa/Row/index.js +0 -1
- package/src/components/Hawa/SelectedField/index.js +0 -1
- package/src/components/Hawa/TabPanel/index.js +0 -1
- package/src/components/Hawa/TextArea/index.js +0 -1
- package/src/components/Hawa/TextField/TextField.jsx +0 -41
- package/src/components/Hawa/TextField/index.js +0 -1
- package/storybook-static/0.86a7edfd.iframe.bundle.js +0 -1
- package/storybook-static/0.b73eaee9a88f178d62ed.manager.bundle.js +0 -1
- package/storybook-static/1.f296d183a17268696d73.manager.bundle.js +0 -1
- package/storybook-static/10.9998ba67d65d81d20896.manager.bundle.js +0 -1
- package/storybook-static/11.49c687eaa6261f8b7be2.manager.bundle.js +0 -2
- package/storybook-static/12.c9538ed3766c96f289e7.manager.bundle.js +0 -1
- package/storybook-static/4.f6eb74f4.iframe.bundle.js +0 -3
- package/storybook-static/4.f6eb74f4.iframe.bundle.js.map +0 -1
- package/storybook-static/5.ec6f37af.iframe.bundle.js +0 -1
- package/storybook-static/5.fa71488e730c5c7f885f.manager.bundle.js +0 -2
- package/storybook-static/6.8096ae4aadde0743697b.manager.bundle.js +0 -1
- package/storybook-static/6.fbc7b90b.iframe.bundle.js +0 -3
- package/storybook-static/6.fbc7b90b.iframe.bundle.js.map +0 -1
- package/storybook-static/7.b34baecbd082bc7b188d.manager.bundle.js +0 -1
- package/storybook-static/8.15577edffecf900a8de2.manager.bundle.js +0 -1
- package/storybook-static/9.d7d85aa0a49a98f17218.manager.bundle.js +0 -1
- package/storybook-static/main.355ffc59.iframe.bundle.js +0 -1
- package/storybook-static/main.ce406c7e93b98325390e.manager.bundle.js +0 -1
- package/storybook-static/runtime~main.3d81579b.iframe.bundle.js +0 -1
- package/storybook-static/runtime~main.909d038f912f063e8837.manager.bundle.js +0 -1
- package/storybook-static/vendors~main.73411ca9.iframe.bundle.js +0 -3
- package/storybook-static/vendors~main.73411ca9.iframe.bundle.js.map +0 -1
- package/storybook-static/vendors~main.d3455eed64b243c89325.manager.bundle.js +0 -2
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
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 = {};
|
|
@@ -0,0 +1,64 @@
|
|
|
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,33 +1,35 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { StyledCheckbox } from "../
|
|
3
|
-
import "../styles.css";
|
|
4
|
-
|
|
5
|
-
const Template = (args) => {
|
|
6
|
-
return <StyledCheckbox {...args} />;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
title: "
|
|
11
|
-
component: Light,
|
|
12
|
-
argsTypes: {
|
|
13
|
-
defaultValue: {
|
|
14
|
-
options: [true, false],
|
|
15
|
-
control: { type: "radio" }
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
args: {
|
|
19
|
-
defaultValue: true
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
//
|
|
41
|
-
//
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
|
|
70
|
-
//
|
|
71
|
-
//
|
|
72
|
-
//
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
//
|
|
76
|
-
//
|
|
77
|
-
//
|
|
78
|
-
|
|
79
|
-
//
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
|
|
86
|
-
//
|
|
87
|
-
//
|
|
88
|
-
//
|
|
89
|
-
//
|
|
90
|
-
//
|
|
91
|
-
// }
|
|
92
|
-
|
|
93
|
-
//
|
|
94
|
-
//
|
|
95
|
-
//
|
|
96
|
-
//
|
|
97
|
-
//
|
|
98
|
-
//
|
|
99
|
-
//
|
|
100
|
-
//
|
|
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 "../
|
|
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
|
+
};
|