@sikka/hawa 0.0.4 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/es/index.es.js +1 -1
  2. package/lib/index.js +1 -1
  3. package/package.json +9 -8
  4. package/src/blocks/Account/UserProfile.js +61 -11
  5. package/src/blocks/Account/UserSettings.js +11 -11
  6. package/src/blocks/AuthForms/NewPasswordForm.js +85 -11
  7. package/src/blocks/AuthForms/ResetPasswordForm.js +47 -8
  8. package/src/blocks/AuthForms/SignInForm.js +91 -13
  9. package/src/blocks/AuthForms/SignUpForm.js +119 -12
  10. package/src/blocks/Payment/ChargeWalletForm.js +53 -0
  11. package/src/blocks/Payment/CreditCardForm.js +60 -0
  12. package/src/blocks/Payment/Form/CForm.js +10 -8
  13. package/src/blocks/Payment/Gateway/Wallet.js +5 -5
  14. package/src/blocks/Payment/PayWithWallet.js +14 -0
  15. package/src/blocks/Payment/PaymentMethod.js +2 -2
  16. package/src/blocks/Payment/SelectPayment.js +76 -0
  17. package/src/blocks/Payment/index.js +18 -0
  18. package/src/index.js +3 -1
  19. package/src/layout/Box.js +31 -18
  20. package/src/stories/BlocksStories/AuthForm.stories.js +103 -0
  21. package/src/stories/BlocksStories/PaymentForm.stories.js +86 -0
  22. package/src/stories/BlocksStories/UserForm.stories.js +41 -0
  23. package/src/stories/GlobalVariables.stories.js +33 -90
  24. package/src/stories/HawaProvider.stories.js +0 -1
  25. package/src/stories/Introduction.stories.js +132 -110
  26. package/src/stories/LayoutStories/Box.stories.js +56 -0
  27. package/src/stories/UIStories/ActionButton.stories.js +53 -0
  28. package/src/stories/{AdaptiveButton.stories.js → UIStories/AdaptiveButton.stories.js} +3 -3
  29. package/src/stories/UIStories/Alert.stories.js +42 -0
  30. package/src/stories/{CheckBox.stories.js → UIStories/CheckBox.stories.js} +3 -4
  31. package/src/stories/UIStories/InputLabel.stories.js +13 -0
  32. package/src/stories/UIStories/RadioSelector.stories.js +53 -0
  33. package/src/stories/UIStories/SettingsRow.stories.js +64 -0
  34. package/src/stories/{TextField.stories.js → UIStories/TextField.stories.js} +4 -5
  35. package/src/themes/HawaProvider.js +151 -18
  36. package/src/ui/ActionButton.js +38 -10
  37. package/src/ui/AdaptiveButton.js +29 -29
  38. package/src/ui/ApplePayButton.js +26 -0
  39. package/src/ui/AutoCompleteField.js +0 -1
  40. package/src/ui/DragDropImages.js +2 -2
  41. package/src/ui/GithubButton.js +24 -0
  42. package/src/ui/GoogleButton.js +23 -0
  43. package/src/ui/GooglePayButton.js +26 -0
  44. package/src/ui/HawaAlert.js +37 -0
  45. package/src/ui/HawaButton.js +48 -0
  46. package/src/ui/{Checkbox.js → HawaCheckbox.js} +3 -3
  47. package/src/ui/HawaInputLabel.js +32 -0
  48. package/src/ui/HawaLogoButton.js +43 -0
  49. package/src/ui/HawaRadio.js +73 -0
  50. package/src/ui/HawaSettingsRow.js +71 -0
  51. package/src/ui/{TextArea.js → HawaTextArea.js} +2 -2
  52. package/src/ui/HawaTextField.js +110 -0
  53. package/src/ui/HawaTypography.js +29 -0
  54. package/src/ui/MadaButton.js +26 -0
  55. package/src/ui/PayPalButton.js +26 -0
  56. package/src/ui/RadioBox.js +2 -2
  57. package/src/ui/STCPayButton.js +26 -0
  58. package/src/ui/SelectedField.js +4 -4
  59. package/src/ui/StyledTooltip.js +1 -1
  60. package/src/ui/TabPanel.js +1 -1
  61. package/src/ui/TwitterButton.js +27 -0
  62. package/src/ui/VisaMasterButton.js +26 -0
  63. package/src/ui/WalletButton.js +24 -0
  64. package/src/ui/index.js +23 -11
  65. package/storybook-static/0.0d994c92.iframe.bundle.js +3 -0
  66. package/storybook-static/{1.4e43f671.iframe.bundle.js.LICENSE.txt → 0.0d994c92.iframe.bundle.js.LICENSE.txt} +0 -0
  67. package/storybook-static/0.0d994c92.iframe.bundle.js.map +1 -0
  68. package/storybook-static/0.f47eb24a4893a96ec307.manager.bundle.js +1 -0
  69. package/storybook-static/1.aabc3f3a.iframe.bundle.js +1 -0
  70. package/storybook-static/{3.c1dc7159.iframe.bundle.js → 2.430bf1e3.iframe.bundle.js} +1 -1
  71. package/storybook-static/4.0fcda1281dc1961dbe94.manager.bundle.js +2 -0
  72. package/storybook-static/{4.8c311a6b48cad9f29317.manager.bundle.js.LICENSE.txt → 4.0fcda1281dc1961dbe94.manager.bundle.js.LICENSE.txt} +0 -0
  73. package/storybook-static/{5.88fe62ee92ff5ca67829.manager.bundle.js → 5.63ab4f94d50a3acf080d.manager.bundle.js} +1 -1
  74. package/storybook-static/{7.69d2e532.iframe.bundle.js → 6.704d1e8d.iframe.bundle.js} +1 -1
  75. package/storybook-static/{6.96d184f368dea006cb52.manager.bundle.js → 6.a6d45262f7e98f3f18d3.manager.bundle.js} +2 -2
  76. package/storybook-static/{6.96d184f368dea006cb52.manager.bundle.js.LICENSE.txt → 6.a6d45262f7e98f3f18d3.manager.bundle.js.LICENSE.txt} +0 -0
  77. package/storybook-static/{7.5ec31f3702b08ab0b71c.manager.bundle.js → 7.097710753af9a1c41b80.manager.bundle.js} +1 -1
  78. package/storybook-static/{8.68cd1217.iframe.bundle.js → 7.9ce807e3.iframe.bundle.js} +3 -3
  79. package/storybook-static/{8.68cd1217.iframe.bundle.js.LICENSE.txt → 7.9ce807e3.iframe.bundle.js.LICENSE.txt} +0 -0
  80. package/storybook-static/7.9ce807e3.iframe.bundle.js.map +1 -0
  81. package/storybook-static/{8.5ce13be7612bd3a6b864.manager.bundle.js → 8.76c3cbf398692028e834.manager.bundle.js} +1 -1
  82. package/storybook-static/{9.488e3969.iframe.bundle.js → 8.c4cb6081.iframe.bundle.js} +1 -1
  83. package/storybook-static/iframe.html +1 -1
  84. package/storybook-static/index.html +1 -1
  85. package/storybook-static/main.ac6e4b72b033097dad76.manager.bundle.js +1 -0
  86. package/storybook-static/main.b7ffaed0.iframe.bundle.js +1 -0
  87. package/storybook-static/{runtime~main.cc29f4c2175f187a3707.manager.bundle.js → runtime~main.c8dac23bc753439736f0.manager.bundle.js} +1 -1
  88. package/storybook-static/runtime~main.cfefe972.iframe.bundle.js +1 -0
  89. package/storybook-static/vendors~main.8ebae370.iframe.bundle.js +76 -0
  90. package/storybook-static/{vendors~main.d144d840.iframe.bundle.js.LICENSE.txt → vendors~main.8ebae370.iframe.bundle.js.LICENSE.txt} +3 -30
  91. package/storybook-static/vendors~main.8ebae370.iframe.bundle.js.map +1 -0
  92. package/storybook-static/vendors~main.a697e07137d366f95f76.manager.bundle.js +2 -0
  93. package/storybook-static/{vendors~main.f228d62e92b69563cefb.manager.bundle.js.LICENSE.txt → vendors~main.a697e07137d366f95f76.manager.bundle.js.LICENSE.txt} +0 -0
  94. package/src/blocks/AuthForms/viaFacebook.js +0 -0
  95. package/src/blocks/AuthForms/viaGithub.js +0 -0
  96. package/src/blocks/AuthForms/viaGoogle.js +0 -0
  97. package/src/blocks/AuthForms/viaTwitter.js +0 -0
  98. package/src/blocks/index.js +0 -13
  99. package/src/stories/ActionButton.stories.js +0 -49
  100. package/src/stories/Alert.stories.js +0 -41
  101. package/src/stories/AuthForm.stories.js +0 -79
  102. package/src/stories/Box.stories.js +0 -64
  103. package/src/stories/InputLabel.stories.js +0 -92
  104. package/src/stories/RadioSelector.stories.js +0 -69
  105. package/src/stories/UserAccount.stories.js +0 -46
  106. package/src/ui/RadioSelector.js +0 -51
  107. package/src/ui/StyledAlert.js +0 -30
  108. package/src/ui/StyledInputLabel.js +0 -19
  109. package/src/ui/TextField.js +0 -62
  110. package/storybook-static/0.d3bc3395610cf5d3ee94.manager.bundle.js +0 -1
  111. package/storybook-static/0.dd3d47f5.iframe.bundle.js +0 -1
  112. package/storybook-static/1.4e43f671.iframe.bundle.js +0 -3
  113. package/storybook-static/1.4e43f671.iframe.bundle.js.map +0 -1
  114. package/storybook-static/2.9a757207.iframe.bundle.js +0 -1
  115. package/storybook-static/4.8c311a6b48cad9f29317.manager.bundle.js +0 -2
  116. package/storybook-static/8.68cd1217.iframe.bundle.js.map +0 -1
  117. package/storybook-static/main.65cb2769.iframe.bundle.js +0 -1
  118. package/storybook-static/main.7e391cf7bf72b0d18ea5.manager.bundle.js +0 -1
  119. package/storybook-static/runtime~main.6e2e1544.iframe.bundle.js +0 -1
  120. package/storybook-static/vendors~main.d144d840.iframe.bundle.js +0 -3
  121. package/storybook-static/vendors~main.d144d840.iframe.bundle.js.map +0 -1
  122. package/storybook-static/vendors~main.f228d62e92b69563cefb.manager.bundle.js +0 -2
  123. package/yarn-error.log +0 -10910
File without changes
File without changes
File without changes
File without changes
@@ -1,13 +0,0 @@
1
- 'use strict';
2
-
3
- var _GooglePay = require('./Payment/Gateway/GooglePay');
4
- var _Payfort = require('./Payment/Gateway/Payfort');
5
- var _Paypal = require('./Payment/Gateway/Paypal');
6
- var _Wallet = require('./Payment/Gateway/Wallet');
7
- var _PaymentMethod = require('./Payment/PaymentMethod');
8
-
9
- exports.GooglePay = _GooglePay.default;
10
- exports.Payfort = _Payfort.default;
11
- exports.Paypal = _Paypal.default;
12
- exports.Wallet = _Wallet.default;
13
- exports.PaymentMethod = _PaymentMethod.default;
@@ -1,49 +0,0 @@
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,41 +0,0 @@
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,79 +0,0 @@
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 = {};
@@ -1,64 +0,0 @@
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,92 +0,0 @@
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
- /****************************/
@@ -1,69 +0,0 @@
1
- import React from "react";
2
- import { StyledRadioSelector } from "../ui";
3
- import { HawaProvider } from "../themes/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
-
39
- Light.args = {
40
- options: [
41
- { text: "Option 1", label: "option1" },
42
- { text: "Option 2", label: "option2" },
43
- { text: "Option 3", label: "option3" }
44
- ],
45
- selectedColor: "blue",
46
- borderRadius: 12,
47
- defaultValue: "option2",
48
- bgSelectedColor: "red",
49
- textSelectedColor: "white",
50
- handleChange: () => {
51
- console.log("handleChange goes here");
52
- }
53
- };
54
- export const Dark = Template.bind({});
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
- };
@@ -1,46 +0,0 @@
1
- import React from "react";
2
- import {
3
- UserProfile
4
- } from "../blocks/Account";
5
- import { defaultTheme, HawaProvider } from "../themes/HawaProvider";
6
-
7
- export default {
8
- title: "Blocks/UserProfile",
9
- component: UserProfile,
10
- argsTypes: {
11
- viaGoogle: { control: "boolean" },
12
- viaGithub: { control: "boolean" },
13
- viaTwitter: { control: "boolean" },
14
- viaFacebook: { control: "boolean" }
15
- },
16
- args: {}
17
- };
18
-
19
- const theme = {
20
- ...defaultTheme,
21
- paddings: 20
22
- };
23
-
24
- const UserProfileTemplate = (args) => {
25
- return (
26
- <HawaProvider theme={{ ...defaultTheme, ...theme }}>
27
- <UserProfile {...args} />
28
- </HawaProvider>
29
- );
30
- };
31
-
32
- export const Success = UserProfileTemplate.bind({});
33
- Success.args = {
34
- viaGoogle: true,
35
- viaGithub: true,
36
- viaTwitter: true,
37
- viaFacebook: true
38
- };
39
- export const Failed = UserProfileTemplate.bind({});
40
- Failed.args = {
41
- viaGoogle: true,
42
- viaGithub: true,
43
- viaTwitter: true,
44
- viaFacebook: true
45
- };
46
-
@@ -1,51 +0,0 @@
1
- import React, { useState, useContext } from "react";
2
- import { ThemeProvider } from "../themes/HawaProvider";
3
-
4
- export const StyledRadioSelector = (props) => {
5
- const [value, setValue] = useState(props.defaultValue);
6
- const theme = useContext(ThemeProvider);
7
-
8
- return (
9
- <div
10
- style={{
11
- backgroundColor: "white",
12
- display: "flex",
13
- flexDirection: "row",
14
- margin: theme.margins,
15
- padding: theme.paddings,
16
- marginBottom: 10
17
- }}
18
- >
19
- {props.options.map((singleOption) => {
20
- return (
21
- <div
22
- key={singleOption.label}
23
- className="radio_option"
24
- onClick={() => {
25
- setValue(singleOption.label);
26
- if (props.handleChange) {
27
- props.handleChange();
28
- }
29
- }}
30
- style={
31
- value.toLowerCase() === singleOption.label.toLowerCase()
32
- ? {
33
- borderRadius: theme.borderRadius,
34
- padding: theme.paddings,
35
- backgroundColor:
36
- theme.primaryColor || props.bgSelectedColor || "blue",
37
- color: props.textSelectedColor || "lightgray"
38
- }
39
- : {
40
- borderRadius: theme.borderRadius,
41
- padding: theme.paddings
42
- }
43
- }
44
- >
45
- {singleOption.text}
46
- </div>
47
- );
48
- })}
49
- </div>
50
- );
51
- };
@@ -1,30 +0,0 @@
1
- import React, { useContext } from "react";
2
- import { ThemeProvider } from "../themes/HawaProvider";
3
-
4
- export const StyledAlert = (props) => {
5
- const theme = useContext(ThemeProvider);
6
-
7
- let alertStyle = {
8
- backgroundColor: "green",
9
- padding: 10,
10
- marginTop: 10,
11
- marginBottom: 10,
12
- borderRadius: theme.borderRadius
13
- };
14
- switch (props.type) {
15
- case "warning":
16
- alertStyle.backgroundColor = "yellow";
17
- return <div style={alertStyle}>{props.text}</div>;
18
- break;
19
- case "danger":
20
- alertStyle.backgroundColor = "red";
21
- return <div style={alertStyle}>{props.text}</div>;
22
- break;
23
- case "notification":
24
- alertStyle.backgroundColor = "blue";
25
- return <div style={alertStyle}>{props.text}</div>;
26
- break;
27
- default:
28
- return <div style={alertStyle}>{props.text}</div>;
29
- }
30
- };
@@ -1,19 +0,0 @@
1
- import InputLabel from "@material-ui/core/InputLabel";
2
- import { useContext } from "react";
3
- import { ThemeProvider } from "../themes/HawaProvider";
4
-
5
- export const StyledInputLabel = (props) => {
6
- const theme = useContext(ThemeProvider);
7
- return (
8
- <InputLabel
9
- style={{
10
- margin: 15,
11
- marginRight: 0,
12
- marginLeft: 0,
13
- color: theme.textColor
14
- }}
15
- >
16
- <div style={{ fontSize: 15 }}>{props.label}</div>
17
- </InputLabel>
18
- );
19
- };
@@ -1,62 +0,0 @@
1
- import React, { useState, useContext } from "react";
2
- import TextField from "@material-ui/core/TextField";
3
- import { StyledInputLabel } from "../ui";
4
- import PropTypes from "prop-types";
5
- import { ThemeProvider } from "../themes/HawaProvider";
6
-
7
- export const StyledTextField = (props) => {
8
- const theme = useContext(ThemeProvider);
9
-
10
- return (
11
- <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-start', justifyContent: 'flex-start' }}>
12
- {props.inputLabel ? <StyledInputLabel label={props.inputLabel} /> : null}
13
- <TextField
14
- // fullWidth={true}
15
- style={{
16
- color: "white",
17
- backgroundColor: theme.inputColor,
18
- borderRadius: props.bdRadius || 10,
19
- borderBottom: "none",
20
- // padding: 5,
21
- // paddingLeft: 0,
22
- // paddingRight: 0,
23
- // margin: 5,
24
- border: "none",
25
- width: "100%"
26
- }}
27
- helperText={props.helperText}
28
- type={props.type ? props.type : "text"}
29
- placeholder={props.placeholder}
30
- inputProps={
31
-
32
- props.type === "number"
33
- ? {
34
- inputMode: "numeric",
35
- min: "0",
36
- max: "9999999",
37
- step: "0.01"
38
- }
39
- : {}
40
- }
41
- InputProps={{
42
- style: {
43
- padding: 5,
44
- paddingLeft: 10, paddingRight: 10
45
- },
46
- disableUnderline: true,
47
- onWheelCapture: (e) => e.target.blur()
48
- }}
49
- value={props.value ? props.value : null}
50
- />
51
- </div>
52
- );
53
- };
54
-
55
- StyledTextField.propTypes = {
56
- type: PropTypes.oneOf(["text", "number"]),
57
- helperText: PropTypes.string
58
- };
59
-
60
- // StyledTextField.defaultProps = {
61
- // type: "text"
62
- // };