@sikka/hawa 0.0.10 → 0.0.13
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 +5 -4
- package/src/blocks/Account/UserProfileForm.js +79 -0
- package/src/blocks/Account/UserSettingsForm.js +13 -0
- package/src/blocks/Account/index.js +2 -2
- package/src/blocks/AuthForms/NewPasswordForm.js +58 -86
- package/src/blocks/AuthForms/ResetPasswordForm.js +44 -43
- package/src/blocks/AuthForms/SignInForm.js +99 -103
- package/src/blocks/AuthForms/SignUpForm.js +106 -104
- package/src/blocks/Payment/ChargeWalletForm.js +40 -37
- package/src/blocks/Payment/CreditCardForm.js +50 -45
- package/src/blocks/Payment/PayWithWallet.js +17 -7
- package/src/blocks/Payment/PaymentMethod.js +0 -1
- package/src/blocks/Payment/SelectPayment.js +54 -56
- package/src/blocks/Pricing/SignInForm.js +126 -0
- package/src/elements/ActionButton.js +38 -0
- package/src/elements/AdaptiveButton.js +32 -0
- package/src/{ui → elements}/AutoCompleteField.js +0 -0
- package/src/{ui → elements}/DragDropImages.js +0 -0
- package/src/{ui → elements}/Hawa.js +0 -0
- package/src/elements/HawaAlert.js +35 -0
- package/src/elements/HawaButton.js +47 -0
- package/src/elements/HawaCard.js +77 -0
- package/src/{ui → elements}/HawaCheckbox.js +0 -0
- package/src/elements/HawaInputLabel.js +31 -0
- package/src/{ui → elements}/HawaLogoButton.js +7 -45
- package/src/elements/HawaRadio.js +32 -0
- package/src/elements/HawaSettingsRow.js +27 -0
- package/src/elements/HawaSwitch.js +6 -0
- package/src/{ui → elements}/HawaTextArea.js +1 -1
- package/src/elements/HawaTextField.js +160 -0
- package/src/elements/HawaTypography.js +26 -0
- package/src/{ui → elements}/RadioBox.js +0 -0
- package/src/{ui → elements}/Row.js +1 -1
- package/src/{ui → elements}/SelectedField.js +0 -0
- package/src/{ui → elements}/StyledTooltip.js +1 -1
- package/src/{ui → elements}/TabPanel.js +1 -1
- package/src/{ui → elements}/index.js +1 -1
- package/src/index.js +0 -2
- package/src/layout/Box.js +36 -33
- package/src/stories/BlocksStories/Account/UserProfile.stories.js +21 -0
- package/src/stories/BlocksStories/Account/UserSettings.stories.js +55 -0
- package/src/stories/BlocksStories/Auth/NewPassword.stories.js +60 -0
- package/src/stories/BlocksStories/Auth/ResetPassword.stories.js +59 -0
- package/src/stories/BlocksStories/Auth/SignIn.stories.js +89 -0
- package/src/stories/BlocksStories/Auth/SignUp.stories.js +90 -0
- package/src/stories/BlocksStories/Payment/ChargeWallet.stories.js +30 -0
- package/src/stories/BlocksStories/Payment/PayWithCreditCard.stories.js +37 -0
- package/src/stories/BlocksStories/Payment/PayWithWallet.stories.js +17 -0
- package/src/stories/BlocksStories/Payment/PaymentSelection.stories.js +60 -0
- package/src/stories/ElementsStories/AdaptiveButton.stories.js +51 -0
- package/src/stories/{UIStories → ElementsStories}/Alert.stories.js +3 -4
- package/src/stories/{UIStories → ElementsStories}/InputLabel.stories.js +1 -1
- package/src/stories/ElementsStories/ItemCard.stories.js +18 -0
- package/src/stories/ElementsStories/LogoButtons.stories.js +73 -0
- package/src/stories/ElementsStories/PricingCard.stories.js +27 -0
- package/src/stories/ElementsStories/RadioSelector.stories.js +36 -0
- package/src/stories/ElementsStories/SettingsRow.stories.js +63 -0
- package/src/stories/{UIStories → ElementsStories}/TextField.stories.js +1 -1
- package/src/stories/LayoutStories/Box.stories.js +11 -31
- package/storybook-static/8.1bf48ea7.iframe.bundle.js +1 -0
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +1 -1
- package/storybook-static/main.00b064cb.iframe.bundle.js +1 -0
- package/storybook-static/{runtime~main.cfefe972.iframe.bundle.js → runtime~main.f1ebae9b.iframe.bundle.js} +1 -1
- package/storybook-static/vendors~main.5eab66d3.iframe.bundle.js +76 -0
- package/storybook-static/{vendors~main.aa1d952a.iframe.bundle.js.LICENSE.txt → vendors~main.5eab66d3.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/vendors~main.5eab66d3.iframe.bundle.js.map +1 -0
- package/src/blocks/Account/UserProfile.js +0 -65
- package/src/blocks/Account/UserSettings.js +0 -15
- package/src/stories/BlocksStories/AuthForm.stories.js +0 -105
- package/src/stories/BlocksStories/PaymentForm.stories.js +0 -86
- package/src/stories/BlocksStories/UserForm.stories.js +0 -41
- package/src/stories/HawaProvider.stories.js +0 -22
- package/src/stories/UIStories/ActionButton.stories.js +0 -46
- package/src/stories/UIStories/AdaptiveButton.stories.js +0 -81
- package/src/stories/UIStories/CheckBox.stories.js +0 -34
- package/src/stories/UIStories/LogoButtons.stories.js +0 -90
- package/src/stories/UIStories/RadioSelector.stories.js +0 -53
- package/src/stories/UIStories/SettingsRow.stories.js +0 -64
- package/src/themes/HawaProvider.js +0 -183
- package/src/ui/ActionButton.js +0 -41
- package/src/ui/AdaptiveButton.js +0 -136
- package/src/ui/HawaAlert.js +0 -37
- package/src/ui/HawaButton.js +0 -48
- package/src/ui/HawaInputLabel.js +0 -32
- package/src/ui/HawaRadio.js +0 -73
- package/src/ui/HawaSettingsRow.js +0 -71
- package/src/ui/HawaTextField.js +0 -107
- package/src/ui/HawaTypography.js +0 -28
- package/storybook-static/8.c4cb6081.iframe.bundle.js +0 -1
- package/storybook-static/main.5731dbe3.iframe.bundle.js +0 -1
- package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js +0 -76
- package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js.map +0 -1
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendors~main.5eab66d3.iframe.bundle.js","sources":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A","sourceRoot":""}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { HawaInputLabel, ActionButton, HawaTextField } from "../../ui";
|
|
3
|
-
import { Box } from "../../layout";
|
|
4
|
-
import { FormProvider, useForm } from "react-hook-form";
|
|
5
|
-
|
|
6
|
-
export const UserProfile = (props) => {
|
|
7
|
-
const methods = useForm();
|
|
8
|
-
const {
|
|
9
|
-
formState: { errors },
|
|
10
|
-
handleSubmit
|
|
11
|
-
} = methods;
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<Box maxWidth={400} noMargin>
|
|
15
|
-
<Box noMargin noColor>
|
|
16
|
-
<FormProvider {...methods}>
|
|
17
|
-
<form>
|
|
18
|
-
<HawaTextField
|
|
19
|
-
type="text"
|
|
20
|
-
name="fullName"
|
|
21
|
-
inputLabel="Full Name"
|
|
22
|
-
placeholder="Fulan AlFulani"
|
|
23
|
-
rules={{
|
|
24
|
-
required: "Email is required"
|
|
25
|
-
}}
|
|
26
|
-
helperText={errors.fullName?.message}
|
|
27
|
-
/>
|
|
28
|
-
<HawaTextField
|
|
29
|
-
type="text"
|
|
30
|
-
name="email"
|
|
31
|
-
inputLabel="New Email"
|
|
32
|
-
placeholder="Enter your new email"
|
|
33
|
-
rules={{
|
|
34
|
-
required: "Email is required"
|
|
35
|
-
}}
|
|
36
|
-
helperText={errors.email?.message}
|
|
37
|
-
/>
|
|
38
|
-
<HawaTextField
|
|
39
|
-
type="password"
|
|
40
|
-
name="password"
|
|
41
|
-
inputLabel="New password"
|
|
42
|
-
placeholder="Enter your new password"
|
|
43
|
-
rules={{
|
|
44
|
-
required: "Email is required"
|
|
45
|
-
}}
|
|
46
|
-
helperText={errors.password?.message}
|
|
47
|
-
/>
|
|
48
|
-
<HawaTextField
|
|
49
|
-
type="password"
|
|
50
|
-
name="confirmPassword"
|
|
51
|
-
inputLabel="Confirm new password"
|
|
52
|
-
placeholder="Confirm new password"
|
|
53
|
-
rules={{
|
|
54
|
-
required: "Email is required"
|
|
55
|
-
}}
|
|
56
|
-
helperText={errors.confirmPassword?.message}
|
|
57
|
-
/>
|
|
58
|
-
|
|
59
|
-
<ActionButton fullWidth last text="Update Account" />
|
|
60
|
-
</form>
|
|
61
|
-
</FormProvider>
|
|
62
|
-
</Box>
|
|
63
|
-
</Box>
|
|
64
|
-
);
|
|
65
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { HawaTextField, ActionButton } from "../../ui";
|
|
3
|
-
import { Box } from "../../layout";
|
|
4
|
-
|
|
5
|
-
export const UserSettings = (props) => {
|
|
6
|
-
return (
|
|
7
|
-
<Box maxWidth={400}>
|
|
8
|
-
<HawaTextField type="text" inputLabel="First Name" />
|
|
9
|
-
<HawaTextField type="text" inputLabel="Last Name" />
|
|
10
|
-
<HawaTextField type="email" inputLabel="Email" />
|
|
11
|
-
<HawaTextField type="password" inputLabel="Password" />
|
|
12
|
-
<ActionButton last text="Update Account" />
|
|
13
|
-
</Box>
|
|
14
|
-
);
|
|
15
|
-
};
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
NewPasswordForm,
|
|
4
|
-
ResetPasswordForm,
|
|
5
|
-
SignInForm,
|
|
6
|
-
SignUpForm
|
|
7
|
-
} from "../../blocks/AuthForms";
|
|
8
|
-
import { HawaProvider } from "../../themes/HawaProvider";
|
|
9
|
-
|
|
10
|
-
export default {
|
|
11
|
-
title: "Blocks/AuthBlocks",
|
|
12
|
-
component: [SignInForm, SignUpForm, NewPasswordForm, NewPasswordForm],
|
|
13
|
-
argTypes: {
|
|
14
|
-
theme: {
|
|
15
|
-
options: ["primary", "secondary", "default"],
|
|
16
|
-
control: { type: "select" }
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const SignInTemplate = (args) => {
|
|
22
|
-
return (
|
|
23
|
-
<HawaProvider themeName={args.theme}>
|
|
24
|
-
<SignInForm
|
|
25
|
-
{...args}
|
|
26
|
-
error={args.showError}
|
|
27
|
-
handleSignIn={(e) => console.log("singing in via email", e)}
|
|
28
|
-
viaGoogle={args.viaGoogle}
|
|
29
|
-
googleButtonLabel={"Sign in with Google"}
|
|
30
|
-
handleGoogleSignIn={() => console.log("signing in via google")}
|
|
31
|
-
viaGithub={args.viaGithub}
|
|
32
|
-
githubButtonLabel={"Sign in with Github"}
|
|
33
|
-
handleGithubSignIn={() => console.log("signing in via github")}
|
|
34
|
-
viaTwitter={args.viaTwitter}
|
|
35
|
-
twitterButtonLabel={"Sign in with Twitter"}
|
|
36
|
-
handleTwitterSignIn={() => console.log("signing in via Twitter")}
|
|
37
|
-
/>
|
|
38
|
-
</HawaProvider>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const SignIn = SignInTemplate.bind({});
|
|
43
|
-
SignIn.args = {
|
|
44
|
-
viaGoogle: true,
|
|
45
|
-
viaGithub: true,
|
|
46
|
-
viaTwitter: true,
|
|
47
|
-
showError: false,
|
|
48
|
-
theme: "primary"
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const SignUpTemplate = (args) => {
|
|
52
|
-
return (
|
|
53
|
-
<HawaProvider themeName={args.theme}>
|
|
54
|
-
<SignUpForm
|
|
55
|
-
{...args}
|
|
56
|
-
error={args.showError}
|
|
57
|
-
handleSignUp={() => console.log("singing up via email")}
|
|
58
|
-
viaGoogle={args.viaGoogle}
|
|
59
|
-
googleButtonLabel={"Sign up with Google"}
|
|
60
|
-
handleGoogleSignUp={() => console.log("signing up via google")}
|
|
61
|
-
viaGithub={args.viaGithub}
|
|
62
|
-
githubButtonLabel={"Sign up with Github"}
|
|
63
|
-
handleGithubSignUp={() => console.log("signing up via github")}
|
|
64
|
-
viaTwitter={args.viaTwitter}
|
|
65
|
-
twitterButtonLabel={"Sign up with Twitter"}
|
|
66
|
-
handleTwitterSignUp={() => console.log("signing up via Twitter")}
|
|
67
|
-
/>
|
|
68
|
-
</HawaProvider>
|
|
69
|
-
);
|
|
70
|
-
};
|
|
71
|
-
export const SignUp = SignUpTemplate.bind({});
|
|
72
|
-
SignUp.args = {
|
|
73
|
-
viaGoogle: true,
|
|
74
|
-
viaGithub: true,
|
|
75
|
-
viaTwitter: true,
|
|
76
|
-
showError: false,
|
|
77
|
-
theme: "primary"
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const ResetPasswordTemplate = (args) => {
|
|
81
|
-
return (
|
|
82
|
-
<HawaProvider themeName={args.theme}>
|
|
83
|
-
<ResetPasswordForm error={args.showError} theme={args.theme} {...args} />
|
|
84
|
-
</HawaProvider>
|
|
85
|
-
);
|
|
86
|
-
};
|
|
87
|
-
export const ResetPassword = ResetPasswordTemplate.bind({});
|
|
88
|
-
ResetPassword.args = {
|
|
89
|
-
theme: "primary",
|
|
90
|
-
showError: false,
|
|
91
|
-
sent: false
|
|
92
|
-
};
|
|
93
|
-
const NewPasswordTemplate = (args) => {
|
|
94
|
-
return (
|
|
95
|
-
<HawaProvider themeName={args.theme}>
|
|
96
|
-
<NewPasswordForm error={args.showError} theme={args.theme} {...args} />
|
|
97
|
-
</HawaProvider>
|
|
98
|
-
);
|
|
99
|
-
};
|
|
100
|
-
export const NewPassword = NewPasswordTemplate.bind({});
|
|
101
|
-
NewPassword.args = {
|
|
102
|
-
theme: "primary",
|
|
103
|
-
showError: false,
|
|
104
|
-
passwordChanged: false
|
|
105
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
SelectPayment,
|
|
4
|
-
CreditCardForm,
|
|
5
|
-
ChargeWalletForm,
|
|
6
|
-
PayWithWallet
|
|
7
|
-
} from "../../blocks/Payment";
|
|
8
|
-
import { defaultTheme, HawaProvider } from "../../themes/HawaProvider";
|
|
9
|
-
|
|
10
|
-
export default {
|
|
11
|
-
title: "Blocks/PaymentBlocks",
|
|
12
|
-
component: [SelectPayment, CreditCardForm],
|
|
13
|
-
argTypes: {
|
|
14
|
-
theme: {
|
|
15
|
-
options: ["primary", "secondary", "default"],
|
|
16
|
-
control: { type: "select" }
|
|
17
|
-
},
|
|
18
|
-
viaWallet: { control: "boolean" },
|
|
19
|
-
viaApplePay: { control: "boolean" },
|
|
20
|
-
viaGooglePay: { control: "boolean" },
|
|
21
|
-
viaSTCPay: { control: "boolean" },
|
|
22
|
-
viaCreditCard: { control: "boolean" },
|
|
23
|
-
viaPayPal: { control: "boolean" }
|
|
24
|
-
},
|
|
25
|
-
args: {
|
|
26
|
-
theme: "primary",
|
|
27
|
-
viaWallet: true,
|
|
28
|
-
viaMada: true,
|
|
29
|
-
viaApplePay: true,
|
|
30
|
-
viaGooglePay: true,
|
|
31
|
-
viaSTCPay: true,
|
|
32
|
-
viaCreditCard: true,
|
|
33
|
-
viaPayPal: true
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const PaymentSelection = (args) => {
|
|
38
|
-
return (
|
|
39
|
-
<HawaProvider themeName={args.theme}>
|
|
40
|
-
<SelectPayment
|
|
41
|
-
{...args}
|
|
42
|
-
walletLabel="Wallet Balance"
|
|
43
|
-
handleWallet={() => console.log("paying via wallet")}
|
|
44
|
-
visaMasterLabel="Credit Card"
|
|
45
|
-
handleCreditCard={() => console.log("paying via Credit Card")}
|
|
46
|
-
madaLabel="Mada"
|
|
47
|
-
handleMada={() => console.log("paying via Mada")}
|
|
48
|
-
paypalLabel="PayPal"
|
|
49
|
-
handlePayPal={() => console.log("paying via PayPal")}
|
|
50
|
-
applePayLabel="Apple Pay"
|
|
51
|
-
handleApplePay={() => console.log("paying via Apple Pay")}
|
|
52
|
-
googlePayLabel="Google Pay"
|
|
53
|
-
handleGooglePay={() => console.log("paying via Google Pay")}
|
|
54
|
-
stcPayLabel="STC Pay"
|
|
55
|
-
handleSTCPay={() => console.log("paying via STC Pay")}
|
|
56
|
-
/>
|
|
57
|
-
</HawaProvider>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const PayViaWallet = (args) => {
|
|
62
|
-
return (
|
|
63
|
-
<HawaProvider theme={{ ...defaultTheme }}>
|
|
64
|
-
<PayWithWallet theme={args.theme} />
|
|
65
|
-
</HawaProvider>
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
export const PayViaCreditCard = (args) => {
|
|
69
|
-
return (
|
|
70
|
-
<HawaProvider theme={{ ...defaultTheme }}>
|
|
71
|
-
<CreditCardForm />
|
|
72
|
-
</HawaProvider>
|
|
73
|
-
);
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export const ChargeWallet = (args) => {
|
|
77
|
-
return (
|
|
78
|
-
<HawaProvider themeName={args.theme}>
|
|
79
|
-
<ChargeWalletForm currency="SAR" />
|
|
80
|
-
</HawaProvider>
|
|
81
|
-
);
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
ChargeWallet.args = {
|
|
85
|
-
theme: "secondary"
|
|
86
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { UserProfile } from "../../blocks/Account";
|
|
3
|
-
import { defaultTheme, HawaProvider } from "../../themes/HawaProvider";
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: "Blocks/UserBlocks",
|
|
7
|
-
component: UserProfile,
|
|
8
|
-
argTypes: {
|
|
9
|
-
theme: {
|
|
10
|
-
options: ["primary", "secondary", "default"],
|
|
11
|
-
control: { type: "select" }
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const theme = {
|
|
17
|
-
...defaultTheme,
|
|
18
|
-
paddings: 20
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const UserAccount = (args) => {
|
|
22
|
-
return (
|
|
23
|
-
<HawaProvider theme={{ ...defaultTheme, ...theme }}>
|
|
24
|
-
<UserProfile {...args} />
|
|
25
|
-
</HawaProvider>
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
UserAccount.args = {
|
|
30
|
-
theme: "primary"
|
|
31
|
-
};
|
|
32
|
-
export const UserSettings = (args) => {
|
|
33
|
-
return (
|
|
34
|
-
<HawaProvider theme={{ ...defaultTheme, ...theme }}>
|
|
35
|
-
<UserProfile {...args} />
|
|
36
|
-
</HawaProvider>
|
|
37
|
-
);
|
|
38
|
-
};
|
|
39
|
-
UserSettings.args = {
|
|
40
|
-
theme: "primary"
|
|
41
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { HawaProvider } from "../themes/HawaProvider";
|
|
3
|
-
|
|
4
|
-
const Template = (args) => {
|
|
5
|
-
const theme = {
|
|
6
|
-
borderRadius: 20,
|
|
7
|
-
primaryColor: "green",
|
|
8
|
-
secondaryColor: "red",
|
|
9
|
-
// margins: "10px",
|
|
10
|
-
paddings: 10
|
|
11
|
-
};
|
|
12
|
-
return (
|
|
13
|
-
<HawaProvider theme={theme}>
|
|
14
|
-
<div>test</div>
|
|
15
|
-
</HawaProvider>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default {
|
|
20
|
-
title: "Globals/HawaProvider",
|
|
21
|
-
component: HawaProvider
|
|
22
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { HawaProvider } from "../../themes/HawaProvider";
|
|
3
|
-
import { ActionButton } from "../../ui";
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: "Elements/Buttons/ActionButton",
|
|
7
|
-
component: ActionButton,
|
|
8
|
-
argTypes: {
|
|
9
|
-
theme: {
|
|
10
|
-
options: ["primary", "secondary", "default"],
|
|
11
|
-
control: { type: "select" }
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
const Template = (args) => {
|
|
16
|
-
return (
|
|
17
|
-
<HawaProvider themeName={args.theme}>
|
|
18
|
-
<ActionButton text={args.buttonLabel} />
|
|
19
|
-
</HawaProvider>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
Template.args = {
|
|
24
|
-
showText: true,
|
|
25
|
-
buttonLabel: "test",
|
|
26
|
-
theme: "primary"
|
|
27
|
-
};
|
|
28
|
-
export const Primary = Template.bind({});
|
|
29
|
-
Primary.args = {
|
|
30
|
-
showText: true,
|
|
31
|
-
buttonLabel: "test",
|
|
32
|
-
theme: "primary"
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const Secondary = Template.bind({});
|
|
36
|
-
Secondary.args = {
|
|
37
|
-
showText: true,
|
|
38
|
-
buttonLabel: "test",
|
|
39
|
-
theme: "secondary"
|
|
40
|
-
};
|
|
41
|
-
export const Default = Template.bind({});
|
|
42
|
-
Default.args = {
|
|
43
|
-
showText: true,
|
|
44
|
-
buttonLabel: "test",
|
|
45
|
-
theme: "default"
|
|
46
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import CastIcon from "@mui/icons-material/Cast";
|
|
3
|
-
import { HawaProvider } from "../../themes/HawaProvider";
|
|
4
|
-
import { AdaptiveButton } from "../../ui";
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: "Elements/Buttons/AdaptiveButton",
|
|
8
|
-
component: AdaptiveButton,
|
|
9
|
-
argsTypes: {
|
|
10
|
-
buttonLabel: { control: "text" },
|
|
11
|
-
borderRadius: { control: "number" },
|
|
12
|
-
buttonColor: { control: "color" },
|
|
13
|
-
padding: { control: "number" },
|
|
14
|
-
hintTitle: { control: "text" },
|
|
15
|
-
hintContent: { control: "text" },
|
|
16
|
-
theme: {
|
|
17
|
-
options: ["primary", "secondary", "default"],
|
|
18
|
-
control: { type: "select" }
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
args: {
|
|
22
|
-
hintTitle: "test",
|
|
23
|
-
hintContent: "more test",
|
|
24
|
-
buttonColor: "#f9f9f9",
|
|
25
|
-
theme: "primary"
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const Template = (args) => {
|
|
30
|
-
return (
|
|
31
|
-
<HawaProvider themeName={args.theme}>
|
|
32
|
-
<AdaptiveButton {...args} />
|
|
33
|
-
</HawaProvider>
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const FullButton = Template.bind({});
|
|
38
|
-
FullButton.args = {
|
|
39
|
-
// showText: true,
|
|
40
|
-
// buttonLabel: "test",
|
|
41
|
-
// borderRadius: 5,
|
|
42
|
-
// icon: <CastIcon />,
|
|
43
|
-
// textColor: "#000000",
|
|
44
|
-
// buttonColor: "#f9f9f9",
|
|
45
|
-
theme: "primary"
|
|
46
|
-
// placeholder: "Example ...",
|
|
47
|
-
// defaultValue: "This is default value",
|
|
48
|
-
// inputLabel: "Text Field",
|
|
49
|
-
// padding: 10
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export const IconOnly = Template.bind({});
|
|
53
|
-
IconOnly.args = {
|
|
54
|
-
// showText: true,
|
|
55
|
-
// buttonLabel: "test",
|
|
56
|
-
// borderRadius: 5,
|
|
57
|
-
// buttonColor: "#878787",
|
|
58
|
-
// textColor: "#ffffff",
|
|
59
|
-
// icon: <CastIcon />,
|
|
60
|
-
theme: "primary"
|
|
61
|
-
|
|
62
|
-
// placeholder: "Exemple ...",
|
|
63
|
-
// defaultValue: "This is default value",
|
|
64
|
-
// inputLabel: "Text Field",
|
|
65
|
-
// padding: 10
|
|
66
|
-
};
|
|
67
|
-
export const Danger = Template.bind({});
|
|
68
|
-
Danger.args = {
|
|
69
|
-
// showText: true,
|
|
70
|
-
// buttonLabel: "test",
|
|
71
|
-
// borderRadius: 5,
|
|
72
|
-
// buttonColor: "#c0c0c0",
|
|
73
|
-
// danger: true,
|
|
74
|
-
// icon: <CastIcon />,
|
|
75
|
-
theme: "primary"
|
|
76
|
-
|
|
77
|
-
// placeholder: "Exemple ...",
|
|
78
|
-
// defaultValue: "This is default value",
|
|
79
|
-
// inputLabel: "Text Field",
|
|
80
|
-
// padding: 10
|
|
81
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { HawaCheckbox } from "../../ui";
|
|
3
|
-
|
|
4
|
-
const Template = (args) => {
|
|
5
|
-
return <HawaCheckbox {...args} />;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title: "UI/Checkbox",
|
|
10
|
-
component: HawaCheckbox,
|
|
11
|
-
argsTypes: {
|
|
12
|
-
defaultValue: {
|
|
13
|
-
options: [true, false],
|
|
14
|
-
control: { type: "radio" }
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
args: {
|
|
18
|
-
defaultValue: true,
|
|
19
|
-
disabled: true
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const Light = Template.bind({});
|
|
24
|
-
export const Dark = Template.bind({});
|
|
25
|
-
|
|
26
|
-
Light.args = {
|
|
27
|
-
color: "red",
|
|
28
|
-
defaultValue: false,
|
|
29
|
-
label: "test"
|
|
30
|
-
};
|
|
31
|
-
Dark.args = {
|
|
32
|
-
color: "gray",
|
|
33
|
-
defaultValue: false
|
|
34
|
-
};
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { HawaProvider } from "../../themes/HawaProvider";
|
|
3
|
-
import { ActionButton, HawaLogoButton } from "../../ui";
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: "Elements/Buttons/LogoButtons",
|
|
7
|
-
component: ActionButton,
|
|
8
|
-
argTypes: {
|
|
9
|
-
theme: {
|
|
10
|
-
options: ["primary", "secondary", "default"],
|
|
11
|
-
control: { type: "select" }
|
|
12
|
-
},
|
|
13
|
-
buttonLabel: { control: "text" },
|
|
14
|
-
logo: { control: "text" }
|
|
15
|
-
},
|
|
16
|
-
args: {
|
|
17
|
-
buttonLabel: "test",
|
|
18
|
-
logo: "google",
|
|
19
|
-
theme: "primary"
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
const Template = (args) => {
|
|
23
|
-
return (
|
|
24
|
-
<HawaProvider themeName={args.theme}>
|
|
25
|
-
<HawaLogoButton logo={args.logo} buttonText={args.buttonLabel} />
|
|
26
|
-
</HawaProvider>
|
|
27
|
-
);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const Google = Template.bind({});
|
|
31
|
-
Google.args = {
|
|
32
|
-
buttonLabel: "Sign in via Google",
|
|
33
|
-
logo: "google",
|
|
34
|
-
theme: "primary"
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const Twitter = Template.bind({});
|
|
38
|
-
Twitter.args = {
|
|
39
|
-
buttonLabel: "Sign in via Twitter",
|
|
40
|
-
logo: "twitter",
|
|
41
|
-
theme: "primary"
|
|
42
|
-
};
|
|
43
|
-
export const Github = Template.bind({});
|
|
44
|
-
Github.args = {
|
|
45
|
-
buttonLabel: "Sign in via Github",
|
|
46
|
-
logo: "github",
|
|
47
|
-
theme: "primary"
|
|
48
|
-
};
|
|
49
|
-
export const WalletPay = Template.bind({});
|
|
50
|
-
WalletPay.args = {
|
|
51
|
-
buttonLabel: "Pay with Wallet",
|
|
52
|
-
logo: "wallet",
|
|
53
|
-
theme: "primary"
|
|
54
|
-
};
|
|
55
|
-
export const GooglePay = Template.bind({});
|
|
56
|
-
GooglePay.args = {
|
|
57
|
-
buttonLabel: "Google Pay",
|
|
58
|
-
logo: "googlepay",
|
|
59
|
-
theme: "primary"
|
|
60
|
-
};
|
|
61
|
-
export const ApplePay = Template.bind({});
|
|
62
|
-
ApplePay.args = {
|
|
63
|
-
buttonLabel: "Apple Pay",
|
|
64
|
-
logo: "applepay",
|
|
65
|
-
theme: "primary"
|
|
66
|
-
};
|
|
67
|
-
export const STCPay = Template.bind({});
|
|
68
|
-
STCPay.args = {
|
|
69
|
-
buttonLabel: "STC Pay",
|
|
70
|
-
logo: "stcpay",
|
|
71
|
-
theme: "primary"
|
|
72
|
-
};
|
|
73
|
-
export const VisaMasterPay = Template.bind({});
|
|
74
|
-
VisaMasterPay.args = {
|
|
75
|
-
buttonLabel: "Visa / Mastercard",
|
|
76
|
-
logo: "visa/master",
|
|
77
|
-
theme: "primary"
|
|
78
|
-
};
|
|
79
|
-
export const PayPal = Template.bind({});
|
|
80
|
-
PayPal.args = {
|
|
81
|
-
buttonLabel: "PayPal",
|
|
82
|
-
logo: "paypal",
|
|
83
|
-
theme: "primary"
|
|
84
|
-
};
|
|
85
|
-
export const Mada = Template.bind({});
|
|
86
|
-
Mada.args = {
|
|
87
|
-
buttonLabel: "Mada",
|
|
88
|
-
logo: "mada",
|
|
89
|
-
theme: "primary"
|
|
90
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { HawaProvider } from "../../themes/HawaProvider";
|
|
3
|
-
import { HawaRadio } from "../../ui";
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: "UI/RadioSelector",
|
|
7
|
-
component: HawaRadio,
|
|
8
|
-
argTypes: {
|
|
9
|
-
theme: {
|
|
10
|
-
options: ["primary", "secondary", "default"],
|
|
11
|
-
control: { type: "select" }
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
args: {
|
|
15
|
-
theme: "primary"
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const Template = (args) => {
|
|
20
|
-
return (
|
|
21
|
-
<HawaProvider themeName={args.theme}>
|
|
22
|
-
<HawaRadio
|
|
23
|
-
defaultValue="option1"
|
|
24
|
-
options={[
|
|
25
|
-
{ text: "Option 1", label: "option1" },
|
|
26
|
-
{ text: "Option 2", label: "option2" },
|
|
27
|
-
{ text: "Option 3", label: "option3" }
|
|
28
|
-
]}
|
|
29
|
-
/>
|
|
30
|
-
</HawaProvider>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
export const Light = Template.bind({});
|
|
34
|
-
|
|
35
|
-
Light.args = {
|
|
36
|
-
theme: "primary",
|
|
37
|
-
|
|
38
|
-
handleChange: () => {
|
|
39
|
-
console.log("handleChange goes here");
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
export const Dark = Template.bind({});
|
|
43
|
-
Dark.args = {
|
|
44
|
-
options: [
|
|
45
|
-
{ text: "Option 1", label: "option1" },
|
|
46
|
-
{ text: "Option 2", label: "option2" },
|
|
47
|
-
{ text: "Option 3", label: "option3" }
|
|
48
|
-
],
|
|
49
|
-
defaultValue: "option2",
|
|
50
|
-
handleChange: () => {
|
|
51
|
-
console.log("handleChange goes here");
|
|
52
|
-
}
|
|
53
|
-
};
|