@sikka/hawa 0.0.4 → 0.0.5
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/es/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +10 -7
- package/src/blocks/Account/UserProfile.js +11 -11
- package/src/blocks/Account/UserSettings.js +11 -11
- package/src/blocks/AuthForms/NewPasswordForm.js +15 -8
- package/src/blocks/AuthForms/ResetPasswordForm.js +7 -8
- package/src/blocks/AuthForms/SignInForm.js +49 -13
- package/src/blocks/AuthForms/SignUpForm.js +61 -13
- package/src/blocks/Payment/CreditCardForm.js +31 -0
- package/src/blocks/Payment/Form/CForm.js +10 -8
- package/src/blocks/Payment/Gateway/Wallet.js +5 -5
- package/src/blocks/Payment/PaymentMethod.js +2 -2
- package/src/blocks/Payment/SelectPayment.js +95 -0
- package/src/blocks/Payment/index.js +16 -0
- package/src/index.js +3 -1
- package/src/layout/Box.js +31 -17
- package/src/stories/ActionButton.stories.js +23 -19
- package/src/stories/AdaptiveButton.stories.js +1 -1
- package/src/stories/BlocksStories/AuthForm.stories.js +99 -0
- package/src/stories/BlocksStories/PaymentForm.stories.js +111 -0
- package/src/stories/{UserAccount.stories.js → BlocksStories/UserAccount.stories.js} +2 -2
- package/src/stories/GlobalVariables.stories.js +33 -90
- package/src/stories/HawaProvider.stories.js +0 -1
- package/src/stories/LayoutStories/Box.stories.js +56 -0
- package/src/themes/HawaProvider.js +59 -17
- package/src/ui/ActionButton.js +35 -10
- package/src/ui/AdaptiveButton.js +29 -29
- package/src/ui/ApplePayButton.js +94 -0
- package/src/ui/AutoCompleteField.js +0 -1
- package/src/ui/Checkbox.js +2 -2
- package/src/ui/DragDropImages.js +2 -2
- package/src/ui/GithubButton.js +91 -0
- package/src/ui/GoogleButton.js +83 -0
- package/src/ui/GooglePayButton.js +94 -0
- package/src/ui/HawaInputLabel.js +33 -0
- package/src/ui/{TextArea.js → HawaTextArea.js} +2 -2
- package/src/ui/HawaTextField.js +118 -0
- package/src/ui/MadaButton.js +94 -0
- package/src/ui/PayPalButton.js +94 -0
- package/src/ui/RadioBox.js +2 -2
- package/src/ui/STCPayButton.js +94 -0
- package/src/ui/SelectedField.js +4 -4
- package/src/ui/StyledTooltip.js +1 -1
- package/src/ui/TabPanel.js +1 -1
- package/src/ui/TwitterButton.js +84 -0
- package/src/ui/VisaMasterButton.js +94 -0
- package/src/ui/WalletButton.js +91 -0
- package/src/ui/index.js +21 -12
- package/storybook-static/0.54f7e52e.iframe.bundle.js +1 -0
- package/storybook-static/0.f47eb24a4893a96ec307.manager.bundle.js +1 -0
- package/storybook-static/1.95be85dd.iframe.bundle.js +3 -0
- package/storybook-static/{1.4e43f671.iframe.bundle.js.LICENSE.txt → 1.95be85dd.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/1.95be85dd.iframe.bundle.js.map +1 -0
- package/storybook-static/2.eb601582.iframe.bundle.js +1 -0
- package/storybook-static/{3.c1dc7159.iframe.bundle.js → 3.d72f7fac.iframe.bundle.js} +0 -0
- package/storybook-static/4.0fcda1281dc1961dbe94.manager.bundle.js +2 -0
- package/storybook-static/{4.8c311a6b48cad9f29317.manager.bundle.js.LICENSE.txt → 4.0fcda1281dc1961dbe94.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/{5.88fe62ee92ff5ca67829.manager.bundle.js → 5.63ab4f94d50a3acf080d.manager.bundle.js} +1 -1
- package/storybook-static/{6.96d184f368dea006cb52.manager.bundle.js → 6.a6d45262f7e98f3f18d3.manager.bundle.js} +2 -2
- package/storybook-static/{6.96d184f368dea006cb52.manager.bundle.js.LICENSE.txt → 6.a6d45262f7e98f3f18d3.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/{7.5ec31f3702b08ab0b71c.manager.bundle.js → 7.097710753af9a1c41b80.manager.bundle.js} +1 -1
- package/storybook-static/{7.69d2e532.iframe.bundle.js → 7.ffb0d84b.iframe.bundle.js} +1 -1
- package/storybook-static/{8.5ce13be7612bd3a6b864.manager.bundle.js → 8.76c3cbf398692028e834.manager.bundle.js} +1 -1
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +1 -1
- package/storybook-static/main.044648aa.iframe.bundle.js +1 -0
- package/storybook-static/main.ac6e4b72b033097dad76.manager.bundle.js +1 -0
- package/storybook-static/{runtime~main.6e2e1544.iframe.bundle.js → runtime~main.3e280e98.iframe.bundle.js} +1 -1
- package/storybook-static/{runtime~main.cc29f4c2175f187a3707.manager.bundle.js → runtime~main.c8dac23bc753439736f0.manager.bundle.js} +1 -1
- package/storybook-static/vendors~main.a697e07137d366f95f76.manager.bundle.js +2 -0
- package/storybook-static/{vendors~main.f228d62e92b69563cefb.manager.bundle.js.LICENSE.txt → vendors~main.a697e07137d366f95f76.manager.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/vendors~main.d75dc38b.iframe.bundle.js +76 -0
- package/storybook-static/{vendors~main.d144d840.iframe.bundle.js.LICENSE.txt → vendors~main.d75dc38b.iframe.bundle.js.LICENSE.txt} +3 -45
- package/storybook-static/vendors~main.d75dc38b.iframe.bundle.js.map +1 -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/index.js +0 -13
- package/src/stories/AuthForm.stories.js +0 -79
- package/src/stories/Box.stories.js +0 -64
- package/src/ui/StyledInputLabel.js +0 -19
- package/src/ui/TextField.js +0 -62
- package/storybook-static/0.d3bc3395610cf5d3ee94.manager.bundle.js +0 -1
- package/storybook-static/0.dd3d47f5.iframe.bundle.js +0 -1
- package/storybook-static/1.4e43f671.iframe.bundle.js +0 -3
- package/storybook-static/1.4e43f671.iframe.bundle.js.map +0 -1
- package/storybook-static/2.9a757207.iframe.bundle.js +0 -1
- package/storybook-static/4.8c311a6b48cad9f29317.manager.bundle.js +0 -2
- package/storybook-static/main.65cb2769.iframe.bundle.js +0 -1
- package/storybook-static/main.7e391cf7bf72b0d18ea5.manager.bundle.js +0 -1
- package/storybook-static/vendors~main.d144d840.iframe.bundle.js +0 -3
- package/storybook-static/vendors~main.d144d840.iframe.bundle.js.map +0 -1
- package/storybook-static/vendors~main.f228d62e92b69563cefb.manager.bundle.js +0 -2
- package/yarn-error.log +0 -10910
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SelectPayment, CreditCardForm } from "../../blocks/Payment";
|
|
3
|
+
import { defaultTheme, HawaProvider } from "../../themes/HawaProvider";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: "Blocks/PaymentBlocks",
|
|
7
|
+
component: [SelectPayment, CreditCardForm],
|
|
8
|
+
argTypes: {
|
|
9
|
+
theme: {
|
|
10
|
+
options: ["primary", "secondary", "default"],
|
|
11
|
+
control: { type: "select" }
|
|
12
|
+
},
|
|
13
|
+
viaWallet: { control: "boolean" },
|
|
14
|
+
viaApplePay: { control: "boolean" },
|
|
15
|
+
viaGooglePay: { control: "boolean" },
|
|
16
|
+
viaSTCPay: { control: "boolean" },
|
|
17
|
+
viaCreditCard: { control: "boolean" },
|
|
18
|
+
viaPayPal: { control: "boolean" }
|
|
19
|
+
},
|
|
20
|
+
args: {
|
|
21
|
+
theme: "primary",
|
|
22
|
+
viaWallet: true,
|
|
23
|
+
viaApplePay: true,
|
|
24
|
+
viaGooglePay: true,
|
|
25
|
+
viaSTCPay: true,
|
|
26
|
+
viaCreditCard: true,
|
|
27
|
+
viaPayPal: true
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const PaymentSelection = (args) => {
|
|
32
|
+
return (
|
|
33
|
+
<HawaProvider theme={{ ...defaultTheme }}>
|
|
34
|
+
<SelectPayment
|
|
35
|
+
{...args}
|
|
36
|
+
theme={args.theme}
|
|
37
|
+
walletLabel="Wallet Balance"
|
|
38
|
+
handleWallet={() => console.log("paying via wallet")}
|
|
39
|
+
visaMasterLabel="Credit Card"
|
|
40
|
+
handleCreditCard={() => console.log("paying via Credit Card")}
|
|
41
|
+
madaLabel="Mada"
|
|
42
|
+
handleMada={() => console.log("paying via Mada")}
|
|
43
|
+
paypalLabel="PayPal"
|
|
44
|
+
handlePayPal={() => console.log("paying via PayPal")}
|
|
45
|
+
applePayLabel="Apple Pay"
|
|
46
|
+
handleApplePay={() => console.log("paying via Apple Pay")}
|
|
47
|
+
googlePayLabel="Google Pay"
|
|
48
|
+
handleGooglePay={() => console.log("paying via Google Pay")}
|
|
49
|
+
stcPayLabel="STC Pay"
|
|
50
|
+
handleSTCPay={() => console.log("paying via STC Pay")}
|
|
51
|
+
/>
|
|
52
|
+
</HawaProvider>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const PayViaWallet = (args) => {
|
|
57
|
+
return (
|
|
58
|
+
<HawaProvider theme={{ ...defaultTheme }}>
|
|
59
|
+
<SelectPayment
|
|
60
|
+
{...args}
|
|
61
|
+
theme={args.theme}
|
|
62
|
+
walletLabel="Wallet Balance"
|
|
63
|
+
handleWallet={() => console.log("paying via wallet")}
|
|
64
|
+
visaMasterLabel="Credit Card"
|
|
65
|
+
handleCreditCard={() => console.log("paying via Credit Card")}
|
|
66
|
+
madaLabel="Mada"
|
|
67
|
+
handleMada={() => console.log("paying via Mada")}
|
|
68
|
+
paypalLabel="PayPal"
|
|
69
|
+
handlePayPal={() => console.log("paying via PayPal")}
|
|
70
|
+
applePayLabel="Apple Pay"
|
|
71
|
+
handleApplePay={() => console.log("paying via Apple Pay")}
|
|
72
|
+
googlePayLabel="Google Pay"
|
|
73
|
+
handleGooglePay={() => console.log("paying via Google Pay")}
|
|
74
|
+
stcPayLabel="STC Pay"
|
|
75
|
+
handleSTCPay={() => console.log("paying via STC Pay")}
|
|
76
|
+
/>
|
|
77
|
+
</HawaProvider>
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
export const PayViaCreditCard = (args) => {
|
|
81
|
+
return (
|
|
82
|
+
<HawaProvider theme={{ ...defaultTheme }}>
|
|
83
|
+
<CreditCardForm />
|
|
84
|
+
</HawaProvider>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const ChargeWallet = (args) => {
|
|
89
|
+
return (
|
|
90
|
+
<HawaProvider theme={{ ...defaultTheme }}>
|
|
91
|
+
<SelectPayment
|
|
92
|
+
{...args}
|
|
93
|
+
theme={args.theme}
|
|
94
|
+
walletLabel="Wallet Balance"
|
|
95
|
+
handleWallet={() => console.log("paying via wallet")}
|
|
96
|
+
visaMasterLabel="Credit Card"
|
|
97
|
+
handleCreditCard={() => console.log("paying via Credit Card")}
|
|
98
|
+
madaLabel="Mada"
|
|
99
|
+
handleMada={() => console.log("paying via Mada")}
|
|
100
|
+
paypalLabel="PayPal"
|
|
101
|
+
handlePayPal={() => console.log("paying via PayPal")}
|
|
102
|
+
applePayLabel="Apple Pay"
|
|
103
|
+
handleApplePay={() => console.log("paying via Apple Pay")}
|
|
104
|
+
googlePayLabel="Google Pay"
|
|
105
|
+
handleGooglePay={() => console.log("paying via Google Pay")}
|
|
106
|
+
stcPayLabel="STC Pay"
|
|
107
|
+
handleSTCPay={() => console.log("paying via STC Pay")}
|
|
108
|
+
/>
|
|
109
|
+
</HawaProvider>
|
|
110
|
+
);
|
|
111
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import {
|
|
3
3
|
UserProfile
|
|
4
|
-
} from "
|
|
5
|
-
import { defaultTheme, HawaProvider } from "
|
|
4
|
+
} from "../../blocks/Account";
|
|
5
|
+
import { defaultTheme, HawaProvider } from "../../themes/HawaProvider";
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
title: "Blocks/UserProfile",
|
|
@@ -1,101 +1,44 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import "../styles.css";
|
|
5
|
-
|
|
6
|
-
const stories = storiesOf("Test", module);
|
|
7
|
-
|
|
8
|
-
stories.add("Global Variables", () => {
|
|
9
|
-
return <div>test</div>;
|
|
10
|
-
});
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
11
3
|
|
|
12
4
|
export const GlobalVariables = (args) => {
|
|
13
5
|
// const methods = useForm();
|
|
14
|
-
return <div>
|
|
6
|
+
return <div>TESTING COMPONENT</div>;
|
|
7
|
+
};
|
|
8
|
+
export const AnotherComponent = (args) => {
|
|
9
|
+
// const methods = useForm();
|
|
10
|
+
return <div>TESTING COMPONENT</div>;
|
|
11
|
+
};
|
|
12
|
+
AnotherComponent.propTypes = {
|
|
13
|
+
textLabel: PropTypes.string
|
|
15
14
|
};
|
|
16
15
|
export default {
|
|
17
|
-
title: "
|
|
18
|
-
component: [
|
|
19
|
-
StyledCheckBox,
|
|
20
|
-
StyledTextFieldT,
|
|
21
|
-
StyledTextAreaT,
|
|
22
|
-
StyledRadioSeletorT
|
|
23
|
-
],
|
|
16
|
+
title: "TestTitle",
|
|
17
|
+
component: [GlobalVariables, AnotherComponent],
|
|
24
18
|
argTypes: {
|
|
25
19
|
resize: {
|
|
20
|
+
description: "overwritten description",
|
|
21
|
+
table: {
|
|
22
|
+
type: {
|
|
23
|
+
summary: "something short"
|
|
24
|
+
},
|
|
25
|
+
defaultValue: { summary: "Hello" }
|
|
26
|
+
},
|
|
26
27
|
options: ["vertical", "horizontal", "both"],
|
|
27
|
-
control: { type: "
|
|
28
|
+
control: { type: "select" }
|
|
29
|
+
},
|
|
30
|
+
label: {
|
|
31
|
+
description: "overwritten description",
|
|
32
|
+
table: {
|
|
33
|
+
type: {
|
|
34
|
+
summary: "something short",
|
|
35
|
+
detail: "something really really long"
|
|
36
|
+
},
|
|
37
|
+
defaultValue: { summary: "Hello" }
|
|
38
|
+
},
|
|
39
|
+
control: {
|
|
40
|
+
type: null
|
|
41
|
+
}
|
|
28
42
|
}
|
|
29
43
|
}
|
|
30
44
|
};
|
|
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
|
-
/****************************/
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Box } from "../../layout";
|
|
3
|
+
import { HawaProvider, defaultTheme } from "../../themes/HawaProvider";
|
|
4
|
+
const theme = {
|
|
5
|
+
...defaultTheme
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = (args) => {
|
|
9
|
+
return (
|
|
10
|
+
<HawaProvider size={args.size} theme={{ ...defaultTheme, ...args.theme }}>
|
|
11
|
+
<Box themeType="primary">Box 1</Box>
|
|
12
|
+
<Box themeType="secondary">
|
|
13
|
+
<div style={{ backgroundColor: "white", padding: 10, color: "black" }}>
|
|
14
|
+
testing box in box
|
|
15
|
+
</div>
|
|
16
|
+
</Box>
|
|
17
|
+
<Box themeType="secondary">Box 3</Box>
|
|
18
|
+
</HawaProvider>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
export default {
|
|
22
|
+
title: "Layout/Box",
|
|
23
|
+
component: <Box />,
|
|
24
|
+
parameters: {
|
|
25
|
+
backgrounds: {
|
|
26
|
+
default: "light",
|
|
27
|
+
values: [
|
|
28
|
+
{ name: "light", value: theme.lightBackground },
|
|
29
|
+
{ name: "dark", value: theme.darkBackground }
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const Normal = Template.bind({});
|
|
36
|
+
Normal.args = {
|
|
37
|
+
size: "large",
|
|
38
|
+
showText: true,
|
|
39
|
+
buttonLabel: "test",
|
|
40
|
+
borderRadius: 5,
|
|
41
|
+
padding: theme.paddings,
|
|
42
|
+
textColor: "#000000",
|
|
43
|
+
buttonColor: "#f9f9f9"
|
|
44
|
+
};
|
|
45
|
+
export const Compact = Template.bind({});
|
|
46
|
+
Compact.args = {
|
|
47
|
+
size: "small",
|
|
48
|
+
showText: true,
|
|
49
|
+
buttonLabel: "test",
|
|
50
|
+
theme: {
|
|
51
|
+
borderRadius: 5,
|
|
52
|
+
paddings: theme.paddings / 2,
|
|
53
|
+
textColor: "#000000",
|
|
54
|
+
buttonColor: "#f9f9f9"
|
|
55
|
+
}
|
|
56
|
+
};
|
|
@@ -5,37 +5,79 @@ export const defaultTheme = {
|
|
|
5
5
|
borderRadius: 10,
|
|
6
6
|
primaryColor: "blue",
|
|
7
7
|
secondaryColor: "grey",
|
|
8
|
-
primaryActionColor: '#f72585', //Colors of the buttons
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
// primaryActionColor: '#f72585', //Colors of the buttons
|
|
9
|
+
primaryActionColor: "grey", //Colors of the buttons
|
|
10
|
+
secondaryActionColor: "#4cc9f0", //Colors of the buttons
|
|
11
|
+
layoutColor: "#d3d4d9", //Colors of boxes and cards
|
|
12
|
+
textColor: "black", //Colors of text everywhere
|
|
13
|
+
inputColor: "white", //Color of input fields
|
|
14
|
+
lightBackground: "#FBF5F3", //
|
|
15
|
+
darkBackground: "#0F0E0E",
|
|
16
|
+
margins: 10,
|
|
17
|
+
paddings: 10,
|
|
18
|
+
allBorderRadius: 10,
|
|
19
|
+
actionButton: {
|
|
20
|
+
primary: {
|
|
21
|
+
borderRadius: 10,
|
|
22
|
+
backgroundColor: "#f90900",
|
|
23
|
+
color: "white",
|
|
24
|
+
margin: 10,
|
|
25
|
+
padding: 10
|
|
26
|
+
},
|
|
27
|
+
secondary: {
|
|
28
|
+
borderRadius: 10,
|
|
29
|
+
margin: 10,
|
|
30
|
+
padding: 10,
|
|
31
|
+
backgroundColor: "#FF8811",
|
|
32
|
+
color: "black"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
20
35
|
layout: {
|
|
21
36
|
primary: {
|
|
22
|
-
backgroundColor:
|
|
37
|
+
backgroundColor: "#d3d4d9",
|
|
38
|
+
color: "black",
|
|
39
|
+
margin: 10,
|
|
40
|
+
padding: 10,
|
|
41
|
+
borderRadius: 10
|
|
23
42
|
},
|
|
24
43
|
secondary: {
|
|
25
|
-
backgroundColor:
|
|
44
|
+
backgroundColor: "#001E3C",
|
|
45
|
+
// backgroundColor: "red",
|
|
46
|
+
color: "white",
|
|
47
|
+
margin: 10,
|
|
48
|
+
padding: 10,
|
|
49
|
+
borderRadius: 10
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
inputFields: {
|
|
53
|
+
primary: {
|
|
54
|
+
backgroundColor: "white",
|
|
55
|
+
display: "flex",
|
|
56
|
+
flexDirection: "column",
|
|
57
|
+
alignItems: "flex-start",
|
|
58
|
+
justifyContent: "flex-start",
|
|
59
|
+
borderRadius: 10
|
|
60
|
+
},
|
|
61
|
+
secondary: {
|
|
62
|
+
backgroundColor: "white",
|
|
63
|
+
display: "flex",
|
|
64
|
+
flexDirection: "column",
|
|
65
|
+
alignItems: "flex-start",
|
|
66
|
+
justifyContent: "flex-start",
|
|
67
|
+
borderRadius: 10
|
|
26
68
|
}
|
|
27
69
|
}
|
|
28
|
-
}
|
|
70
|
+
};
|
|
29
71
|
|
|
30
72
|
export const ThemeProvider = createContext(defaultTheme);
|
|
31
73
|
|
|
32
74
|
export const HawaProvider = ({ theme, ...props }) => {
|
|
33
|
-
if (props.size ===
|
|
75
|
+
if (props.size === "large") {
|
|
34
76
|
theme = {
|
|
35
77
|
...theme,
|
|
36
78
|
paddings: 20,
|
|
37
79
|
margins: 20
|
|
38
|
-
}
|
|
80
|
+
};
|
|
39
81
|
}
|
|
40
82
|
return (
|
|
41
83
|
<ThemeProvider.Provider value={theme || defaultTheme}>
|
package/src/ui/ActionButton.js
CHANGED
|
@@ -1,15 +1,40 @@
|
|
|
1
|
-
import Button from "@material
|
|
1
|
+
import Button from "@mui/material/Button";
|
|
2
2
|
import { useContext } from "react";
|
|
3
3
|
import { ThemeProvider } from "../themes/HawaProvider";
|
|
4
|
+
import { styled, darken } from "@mui/material/styles";
|
|
4
5
|
|
|
5
6
|
export const ActionButton = (props) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
const theme = useContext(ThemeProvider);
|
|
8
|
+
const currentTheme = Object.keys(theme.actionButton).find(
|
|
9
|
+
(themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
|
|
10
|
+
);
|
|
11
|
+
let actionButtonStyle = {};
|
|
12
|
+
|
|
13
|
+
if (currentTheme) {
|
|
14
|
+
actionButtonStyle = {
|
|
15
|
+
...theme.actionButton[currentTheme],
|
|
16
|
+
margin: props.last ? 0 : theme.actionButton[currentTheme].margin,
|
|
17
|
+
marginTop: props.last ? theme.actionButton[currentTheme].margin * 2 : 0,
|
|
18
|
+
"&:hover": {
|
|
19
|
+
backgroundColor: darken(
|
|
20
|
+
theme.actionButton[currentTheme]?.backgroundColor,
|
|
21
|
+
0.1
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
} else {
|
|
26
|
+
actionButtonStyle = {
|
|
27
|
+
backgroundColor: "black",
|
|
28
|
+
color: "white",
|
|
29
|
+
padding: 10,
|
|
30
|
+
marginTop: props.last ? 10 * 2 : 0
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const StyledButton = styled(Button)(({ theme }) => {
|
|
35
|
+
return {
|
|
36
|
+
...actionButtonStyle
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
return <StyledButton {...props}>{props.text}</StyledButton>;
|
|
15
40
|
};
|
package/src/ui/AdaptiveButton.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useContext } from "react";
|
|
2
|
-
import Button from "@material
|
|
3
|
-
import Tooltip from "@material
|
|
2
|
+
import Button from "@mui/material/Button";
|
|
3
|
+
import Tooltip from "@mui/material/Tooltip";
|
|
4
4
|
import { motion } from "framer-motion";
|
|
5
5
|
import PropTypes from "prop-types";
|
|
6
6
|
import { ThemeProvider } from "../themes/HawaProvider";
|
|
@@ -101,30 +101,30 @@ export const AdaptiveButton = (props) => {
|
|
|
101
101
|
props.hint ? (
|
|
102
102
|
props.hint
|
|
103
103
|
) : (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
</div>
|
|
116
|
-
<div
|
|
117
|
-
style={{
|
|
118
|
-
fontSize: 13,
|
|
119
|
-
fontWeight: 100,
|
|
120
|
-
padding: 10,
|
|
121
|
-
textAlign: "center"
|
|
122
|
-
}}
|
|
123
|
-
>
|
|
124
|
-
{props.hintContent}
|
|
125
|
-
</div>
|
|
104
|
+
<div>
|
|
105
|
+
<div
|
|
106
|
+
style={{
|
|
107
|
+
fontSize: 20,
|
|
108
|
+
fontWeight: 800,
|
|
109
|
+
padding: 10,
|
|
110
|
+
paddingBottom: 5,
|
|
111
|
+
textAlign: "center"
|
|
112
|
+
}}
|
|
113
|
+
>
|
|
114
|
+
{props.hintTitle}
|
|
126
115
|
</div>
|
|
127
|
-
|
|
116
|
+
<div
|
|
117
|
+
style={{
|
|
118
|
+
fontSize: 13,
|
|
119
|
+
fontWeight: 100,
|
|
120
|
+
padding: 10,
|
|
121
|
+
textAlign: "center"
|
|
122
|
+
}}
|
|
123
|
+
>
|
|
124
|
+
{props.hintContent}
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
)
|
|
128
128
|
}
|
|
129
129
|
>
|
|
130
130
|
<Button
|
|
@@ -139,8 +139,8 @@ export const AdaptiveButton = (props) => {
|
|
|
139
139
|
color: hovered
|
|
140
140
|
? "#ffffff"
|
|
141
141
|
: props.danger
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
? "#f50057"
|
|
143
|
+
: "var(--blue)"
|
|
144
144
|
}}
|
|
145
145
|
>
|
|
146
146
|
{props.buttonLabel}
|
|
@@ -197,8 +197,8 @@ export const AdaptiveButton = (props) => {
|
|
|
197
197
|
color: hovered
|
|
198
198
|
? "#ffffff"
|
|
199
199
|
: props.danger
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
? "#f50057"
|
|
201
|
+
: "var(--blue)"
|
|
202
202
|
}}
|
|
203
203
|
>
|
|
204
204
|
{props.icon}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { ThemeProvider } from "../themes/HawaProvider";
|
|
3
|
+
import Button from "@mui/material/Button";
|
|
4
|
+
import { styled, darken } from "@mui/material/styles";
|
|
5
|
+
|
|
6
|
+
import GitHubIcon from "@mui/icons-material/GitHub";
|
|
7
|
+
|
|
8
|
+
export const ApplePayButton = (props) => {
|
|
9
|
+
const theme = useContext(ThemeProvider);
|
|
10
|
+
let buttonStyle = {};
|
|
11
|
+
|
|
12
|
+
console.log(Object.keys(theme.actionButton));
|
|
13
|
+
let currentTheme = Object.keys(theme.actionButton).find(
|
|
14
|
+
(themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
|
|
15
|
+
);
|
|
16
|
+
if (currentTheme) {
|
|
17
|
+
buttonStyle = {
|
|
18
|
+
cursor: "pointer",
|
|
19
|
+
display: "flex",
|
|
20
|
+
flexDirection: "row",
|
|
21
|
+
alignItems: "center",
|
|
22
|
+
justifyContent: "center",
|
|
23
|
+
padding: 0,
|
|
24
|
+
marginTop: theme.actionButton[currentTheme].margin,
|
|
25
|
+
border: props.outlined ? "2px solid black" : "none",
|
|
26
|
+
borderRadius: theme.actionButton[currentTheme].borderRadius,
|
|
27
|
+
backgroundColor: "white",
|
|
28
|
+
"&:hover": {
|
|
29
|
+
backgroundColor: darken("#ffffff", 0.1)
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
} else {
|
|
33
|
+
buttonStyle = {
|
|
34
|
+
cursor: "pointer",
|
|
35
|
+
display: "flex",
|
|
36
|
+
flexDirection: "row",
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
justifyContent: "center",
|
|
39
|
+
marginTop: theme.margins,
|
|
40
|
+
border: props.outlined ? "2px solid black" : "none",
|
|
41
|
+
borderRadius: 0,
|
|
42
|
+
backgroundColor: "white",
|
|
43
|
+
"&:hover": {
|
|
44
|
+
backgroundColor: darken("#ffffff", 0.1)
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const StyledButton = styled(Button)(({ theme }) => {
|
|
50
|
+
return {
|
|
51
|
+
// "label + &": {
|
|
52
|
+
// marginTop: theme.spacing(3)
|
|
53
|
+
// },
|
|
54
|
+
|
|
55
|
+
borderRadius: 4,
|
|
56
|
+
position: "relative",
|
|
57
|
+
border: "1px solid #ced4da",
|
|
58
|
+
fontSize: 16,
|
|
59
|
+
// width: "auto",
|
|
60
|
+
height: 50,
|
|
61
|
+
// padding: "10px 12px",
|
|
62
|
+
...buttonStyle,
|
|
63
|
+
"&:focus": {
|
|
64
|
+
// boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
|
|
65
|
+
borderColor: theme.palette.primary.main
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<StyledButton
|
|
72
|
+
// style={buttonStyle}
|
|
73
|
+
onClick={props.handleClick}
|
|
74
|
+
>
|
|
75
|
+
<img
|
|
76
|
+
src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/apple-pay.png"
|
|
77
|
+
height={40}
|
|
78
|
+
/>{" "}
|
|
79
|
+
<div style={{ width: 10 }} />
|
|
80
|
+
<p
|
|
81
|
+
style={{
|
|
82
|
+
color: "black",
|
|
83
|
+
fontSize: 14,
|
|
84
|
+
textAlign: "center",
|
|
85
|
+
letterSpacing: 0.4,
|
|
86
|
+
fontFamily: "Roboto",
|
|
87
|
+
fontWeight: 500
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
{props.buttonText}
|
|
91
|
+
</p>
|
|
92
|
+
</StyledButton>
|
|
93
|
+
);
|
|
94
|
+
};
|
package/src/ui/Checkbox.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import FormControlLabel from "@material
|
|
3
|
-
import Checkbox from "@material
|
|
2
|
+
import FormControlLabel from "@mui/material/FormControlLabel";
|
|
3
|
+
import Checkbox from "@mui/material/Checkbox";
|
|
4
4
|
// import PropTypes from "prop-types";
|
|
5
5
|
|
|
6
6
|
export const StyledCheckbox = (props) => {
|
package/src/ui/DragDropImages.js
CHANGED
|
@@ -3,8 +3,8 @@ import React, { useEffect, useState } from "react";
|
|
|
3
3
|
import { getToken } from "../token";
|
|
4
4
|
import { useDropzone } from "react-dropzone";
|
|
5
5
|
import useTranslation from "next-translate/useTranslation";
|
|
6
|
-
import Badge from "@material
|
|
7
|
-
import CloseIcon from "@
|
|
6
|
+
import Badge from "@mui/material/Badge";
|
|
7
|
+
import CloseIcon from "@mui/icons-material/Close";
|
|
8
8
|
import styles from "../styles/Theme.module.css";
|
|
9
9
|
|
|
10
10
|
const thumbsContainer = {
|