@sikka/hawa 0.0.3 → 0.0.6
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 +2 -0
- package/es/index.es.js +1 -0
- package/lib/index.js +1 -0
- package/package.json +24 -13
- package/rollup.config.js +2 -2
- 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 +11 -11
- package/src/blocks/Account/UserSettings.js +11 -11
- package/src/blocks/AuthForms/NewPasswordForm.js +83 -10
- package/src/blocks/AuthForms/ResetPasswordForm.js +50 -8
- package/src/blocks/AuthForms/SignInForm.js +96 -13
- package/src/blocks/AuthForms/SignUpForm.js +113 -13
- package/src/blocks/Payment/ChargeWalletForm.js +32 -0
- package/src/blocks/Payment/CreditCardForm.js +31 -0
- package/src/blocks/Payment/Form/CForm.js +328 -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/PayWithWallet.js +35 -0
- package/src/blocks/Payment/PaymentMethod.js +132 -0
- package/src/blocks/Payment/SelectPayment.js +94 -0
- package/src/blocks/Payment/index.js +18 -0
- package/src/index.js +4 -1
- package/src/layout/Box.js +30 -17
- package/src/stories/BlocksStories/AuthForm.stories.js +105 -0
- package/src/stories/BlocksStories/PaymentForm.stories.js +82 -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/Introduction.stories.js +132 -110
- package/src/stories/LayoutStories/Box.stories.js +56 -0
- package/src/stories/UIStories/ActionButton.stories.js +53 -0
- package/src/stories/{AdaptiveButton.stories.js → UIStories/AdaptiveButton.stories.js} +3 -3
- package/src/stories/UIStories/Alert.stories.js +55 -0
- package/src/stories/{CheckBox.stories.js → UIStories/CheckBox.stories.js} +3 -4
- package/src/stories/UIStories/InputLabel.stories.js +13 -0
- package/src/stories/{RadioSelector.stories.js → UIStories/RadioSelector.stories.js} +5 -6
- package/src/stories/{TextField.stories.js → UIStories/TextField.stories.js} +4 -5
- package/src/styles.scss +679 -0
- package/src/themes/HawaProvider.js +110 -16
- package/src/ui/ActionButton.js +35 -10
- package/src/ui/AdaptiveButton.js +29 -29
- package/src/ui/ApplePayButton.js +93 -0
- package/src/ui/AutoCompleteField.js +0 -1
- package/src/ui/DragDropImages.js +2 -2
- package/src/ui/GithubButton.js +90 -0
- package/src/ui/GoogleButton.js +82 -0
- package/src/ui/GooglePayButton.js +93 -0
- package/src/ui/HawaAlert.js +37 -0
- package/src/ui/HawaButton.js +48 -0
- package/src/ui/{Checkbox.js → HawaCheckbox.js} +3 -3
- package/src/ui/HawaInputLabel.js +32 -0
- package/src/ui/HawaLogoButton.js +48 -0
- package/src/ui/{RadioSelector.js → HawaRadio.js} +1 -1
- package/src/ui/{TextArea.js → HawaTextArea.js} +2 -2
- package/src/ui/HawaTextField.js +113 -0
- package/src/ui/HawaTypography.js +29 -0
- package/src/ui/MadaButton.js +93 -0
- package/src/ui/PayPalButton.js +93 -0
- package/src/ui/RadioBox.js +2 -2
- package/src/ui/STCPayButton.js +93 -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 +83 -0
- package/src/ui/VisaMasterButton.js +93 -0
- package/src/ui/WalletButton.js +24 -0
- package/src/ui/index.js +23 -11
- package/storybook-static/0.0d994c92.iframe.bundle.js +3 -0
- package/storybook-static/{1.4e43f671.iframe.bundle.js.LICENSE.txt → 0.0d994c92.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/0.0d994c92.iframe.bundle.js.map +1 -0
- package/storybook-static/0.f47eb24a4893a96ec307.manager.bundle.js +1 -0
- package/storybook-static/1.aabc3f3a.iframe.bundle.js +1 -0
- package/storybook-static/{3.c1dc7159.iframe.bundle.js → 2.430bf1e3.iframe.bundle.js} +1 -1
- 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/{7.69d2e532.iframe.bundle.js → 6.704d1e8d.iframe.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/{8.68cd1217.iframe.bundle.js → 7.9ce807e3.iframe.bundle.js} +3 -3
- package/storybook-static/{8.68cd1217.iframe.bundle.js.LICENSE.txt → 7.9ce807e3.iframe.bundle.js.LICENSE.txt} +0 -0
- package/storybook-static/7.9ce807e3.iframe.bundle.js.map +1 -0
- package/storybook-static/{8.5ce13be7612bd3a6b864.manager.bundle.js → 8.76c3cbf398692028e834.manager.bundle.js} +1 -1
- package/storybook-static/{9.488e3969.iframe.bundle.js → 8.c4cb6081.iframe.bundle.js} +1 -1
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +1 -1
- package/storybook-static/main.ac6e4b72b033097dad76.manager.bundle.js +1 -0
- package/storybook-static/main.e55ce615.iframe.bundle.js +1 -0
- package/storybook-static/{runtime~main.cc29f4c2175f187a3707.manager.bundle.js → runtime~main.c8dac23bc753439736f0.manager.bundle.js} +1 -1
- package/storybook-static/runtime~main.cfefe972.iframe.bundle.js +1 -0
- package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js +76 -0
- package/storybook-static/{vendors~main.d144d840.iframe.bundle.js.LICENSE.txt → vendors~main.30a2c5d7.iframe.bundle.js.LICENSE.txt} +3 -30
- package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js.map +1 -0
- 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/tools/build-styles.js +17 -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/stories/ActionButton.stories.js +0 -49
- package/src/stories/Alert.stories.js +0 -41
- package/src/stories/AuthForm.stories.js +0 -79
- package/src/stories/Box.stories.js +0 -64
- package/src/stories/InputLabel.stories.js +0 -92
- package/src/ui/StyledAlert.js +0 -30
- 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/8.68cd1217.iframe.bundle.js.map +0 -1
- package/storybook-static/main.65cb2769.iframe.bundle.js +0 -1
- package/storybook-static/main.7e391cf7bf72b0d18ea5.manager.bundle.js +0 -1
- package/storybook-static/runtime~main.6e2e1544.iframe.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,105 @@
|
|
|
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/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 theme={{ ...defaultTheme }}>
|
|
24
|
+
<SignInForm
|
|
25
|
+
{...args}
|
|
26
|
+
error={args.showError}
|
|
27
|
+
theme={args.theme}
|
|
28
|
+
handleSignIn={(e) => console.log("singing in via email", e)}
|
|
29
|
+
viaGoogle={args.viaGoogle}
|
|
30
|
+
googleButtonLabel={"Sign in with Google"}
|
|
31
|
+
handleGoogleSignIn={() => console.log("signing in via google")}
|
|
32
|
+
viaGithub={args.viaGithub}
|
|
33
|
+
githubButtonLabel={"Sign in with Github"}
|
|
34
|
+
handleGithubSignIn={() => console.log("signing in via github")}
|
|
35
|
+
viaTwitter={args.viaTwitter}
|
|
36
|
+
twitterButtonLabel={"Sign in with Twitter"}
|
|
37
|
+
handleTwitterSignIn={() => console.log("signing in via Twitter")}
|
|
38
|
+
/>
|
|
39
|
+
</HawaProvider>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const SignIn = SignInTemplate.bind({});
|
|
44
|
+
SignIn.args = {
|
|
45
|
+
viaGoogle: true,
|
|
46
|
+
viaGithub: true,
|
|
47
|
+
viaTwitter: true,
|
|
48
|
+
showError: false,
|
|
49
|
+
theme: "primary"
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const SignUpTemplate = (args) => {
|
|
53
|
+
return (
|
|
54
|
+
<HawaProvider theme={{ ...defaultTheme }}>
|
|
55
|
+
<SignUpForm
|
|
56
|
+
{...args}
|
|
57
|
+
theme={args.theme}
|
|
58
|
+
error={args.showError}
|
|
59
|
+
handleSignUp={() => console.log("singing up via email")}
|
|
60
|
+
viaGoogle={args.viaGoogle}
|
|
61
|
+
googleButtonLabel={"Sign up with Google"}
|
|
62
|
+
handleGoogleSignUp={() => console.log("signing up via google")}
|
|
63
|
+
viaGithub={args.viaGithub}
|
|
64
|
+
githubButtonLabel={"Sign up with Github"}
|
|
65
|
+
handleGithubSignUp={() => console.log("signing up via github")}
|
|
66
|
+
viaTwitter={args.viaTwitter}
|
|
67
|
+
twitterButtonLabel={"Sign up with Twitter"}
|
|
68
|
+
handleTwitterSignUp={() => console.log("signing up via Twitter")}
|
|
69
|
+
/>
|
|
70
|
+
</HawaProvider>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
export const SignUp = SignUpTemplate.bind({});
|
|
74
|
+
SignUp.args = {
|
|
75
|
+
viaGoogle: true,
|
|
76
|
+
viaGithub: true,
|
|
77
|
+
viaTwitter: true,
|
|
78
|
+
showError: false,
|
|
79
|
+
theme: "primary"
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const ResetPasswordTemplate = (args) => {
|
|
83
|
+
return (
|
|
84
|
+
<HawaProvider theme={{ ...defaultTheme }}>
|
|
85
|
+
<ResetPasswordForm error={args.showError} theme={args.theme} {...args} />
|
|
86
|
+
</HawaProvider>
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
export const ResetPassword = ResetPasswordTemplate.bind({});
|
|
90
|
+
ResetPassword.args = {
|
|
91
|
+
theme: "primary",
|
|
92
|
+
showError: false
|
|
93
|
+
};
|
|
94
|
+
const NewPasswordTemplate = (args) => {
|
|
95
|
+
return (
|
|
96
|
+
<HawaProvider theme={{ ...defaultTheme }}>
|
|
97
|
+
<NewPasswordForm error={args.showError} theme={args.theme} {...args} />
|
|
98
|
+
</HawaProvider>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
export const NewPassword = NewPasswordTemplate.bind({});
|
|
102
|
+
NewPassword.args = {
|
|
103
|
+
theme: "primary",
|
|
104
|
+
showError: false
|
|
105
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
viaApplePay: true,
|
|
29
|
+
viaGooglePay: true,
|
|
30
|
+
viaSTCPay: true,
|
|
31
|
+
viaCreditCard: true,
|
|
32
|
+
viaPayPal: true
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const PaymentSelection = (args) => {
|
|
37
|
+
return (
|
|
38
|
+
<HawaProvider theme={{ ...defaultTheme }}>
|
|
39
|
+
<SelectPayment
|
|
40
|
+
{...args}
|
|
41
|
+
theme={args.theme}
|
|
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 <ChargeWalletForm theme={args.theme} currency="SAR" />;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// ChargeWallet.args = {
|
|
81
|
+
// theme: "secondary"
|
|
82
|
+
// };
|
|
@@ -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
|
-
/****************************/
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { Meta } from
|
|
2
|
-
import Code from
|
|
3
|
-
import Colors from
|
|
4
|
-
import Comments from
|
|
5
|
-
import Direction from
|
|
6
|
-
import Flow from
|
|
7
|
-
import Plugin from
|
|
8
|
-
import Repo from
|
|
9
|
-
import StackAlt from
|
|
10
|
-
|
|
11
|
-
<Meta title="Example/Introduction"
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { Meta } from "@storybook/addon-docs";
|
|
2
|
+
// import Code from "./assets/code-brackets.svg";
|
|
3
|
+
// import Colors from "./assets/colors.svg";
|
|
4
|
+
// import Comments from "./assets/comments.svg";
|
|
5
|
+
// import Direction from "./assets/direction.svg";
|
|
6
|
+
// import Flow from "./assets/flow.svg";
|
|
7
|
+
// import Plugin from "./assets/plugin.svg";
|
|
8
|
+
// import Repo from "./assets/repo.svg";
|
|
9
|
+
// import StackAlt from "./assets/stackalt.svg";
|
|
10
|
+
|
|
11
|
+
<Meta title="Example/Introduction" />;
|
|
12
|
+
|
|
13
|
+
{
|
|
14
|
+
/* <style>
|
|
15
|
+
{`
|
|
14
16
|
.subheading {
|
|
15
17
|
--mediumdark: '#999999';
|
|
16
18
|
font-weight: 900;
|
|
@@ -112,100 +114,120 @@ import StackAlt from './assets/stackalt.svg';
|
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
|
|
115
|
-
`}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
<
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
<
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
<
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
117
|
+
`}
|
|
118
|
+
</style> */
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// # Welcome to Storybook
|
|
122
|
+
|
|
123
|
+
// Storybook helps you build UI components in isolation from your app's business logic, data, and context.
|
|
124
|
+
// That makes it easy to develop hard - to - reach states.Save these UI states as ** stories ** to revisit during development, testing, or QA.
|
|
125
|
+
|
|
126
|
+
// Browse example stories now by navigating to them in the sidebar.
|
|
127
|
+
// View their code in the`src/stories` directory to learn how they work.
|
|
128
|
+
// We recommend building UIs with a[** component - driven **](https://componentdriven.org) process starting with atomic components and ending with pages.
|
|
129
|
+
|
|
130
|
+
<>
|
|
131
|
+
<div className="subheading">Configure</div>
|
|
132
|
+
|
|
133
|
+
<div className="link-list">
|
|
134
|
+
<a
|
|
135
|
+
className="link-item"
|
|
136
|
+
href="https://storybook.js.org/docs/react/addons/addon-types"
|
|
137
|
+
target="_blank"
|
|
138
|
+
>
|
|
139
|
+
{/* <img src={Plugin} alt="plugin" /> */}
|
|
140
|
+
<span>
|
|
141
|
+
<strong>Presets for popular tools</strong>
|
|
142
|
+
Easy setup for TypeScript, SCSS and more.
|
|
143
|
+
</span>
|
|
144
|
+
</a>
|
|
145
|
+
<a
|
|
146
|
+
className="link-item"
|
|
147
|
+
href="https://storybook.js.org/docs/react/configure/webpack"
|
|
148
|
+
target="_blank"
|
|
149
|
+
>
|
|
150
|
+
{/* <img src={StackAlt} alt="Build" /> */}
|
|
151
|
+
<span>
|
|
152
|
+
<strong>Build configuration</strong>
|
|
153
|
+
How to customize webpack and Babel
|
|
154
|
+
</span>
|
|
155
|
+
</a>
|
|
156
|
+
<a
|
|
157
|
+
className="link-item"
|
|
158
|
+
href="https://storybook.js.org/docs/react/configure/styling-and-css"
|
|
159
|
+
target="_blank"
|
|
160
|
+
>
|
|
161
|
+
{/* <img src={Colors} alt="colors" /> */}
|
|
162
|
+
<span>
|
|
163
|
+
<strong>Styling</strong>
|
|
164
|
+
How to load and configure CSS libraries
|
|
165
|
+
</span>
|
|
166
|
+
</a>
|
|
167
|
+
<a
|
|
168
|
+
className="link-item"
|
|
169
|
+
href="https://storybook.js.org/docs/react/get-started/setup#configure-storybook-for-your-stack"
|
|
170
|
+
target="_blank"
|
|
171
|
+
>
|
|
172
|
+
{/* <img src={Flow} alt="flow" /> */}
|
|
173
|
+
<span>
|
|
174
|
+
<strong>Data</strong>
|
|
175
|
+
Providers and mocking for data libraries
|
|
176
|
+
</span>
|
|
177
|
+
</a>
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
<div className="subheading">Learn</div>
|
|
181
|
+
|
|
182
|
+
<div className="link-list">
|
|
183
|
+
<a
|
|
184
|
+
className="link-item"
|
|
185
|
+
href="https://storybook.js.org/docs"
|
|
186
|
+
target="_blank"
|
|
187
|
+
>
|
|
188
|
+
{/* <img src={Repo} alt="repo" /> */}
|
|
189
|
+
<span>
|
|
190
|
+
<strong>Storybook documentation</strong>
|
|
191
|
+
Configure, customize, and extend
|
|
192
|
+
</span>
|
|
193
|
+
</a>
|
|
194
|
+
<a
|
|
195
|
+
className="link-item"
|
|
196
|
+
href="https://storybook.js.org/tutorials/"
|
|
197
|
+
target="_blank"
|
|
198
|
+
>
|
|
199
|
+
{/* <img src={Direction} alt="direction" /> */}
|
|
200
|
+
<span>
|
|
201
|
+
<strong>In-depth guides</strong>
|
|
202
|
+
Best practices from leading teams
|
|
203
|
+
</span>
|
|
204
|
+
</a>
|
|
205
|
+
<a
|
|
206
|
+
className="link-item"
|
|
207
|
+
href="https://github.com/storybookjs/storybook"
|
|
208
|
+
target="_blank"
|
|
209
|
+
>
|
|
210
|
+
{/* <img src={Code} alt="code" /> */}
|
|
211
|
+
<span>
|
|
212
|
+
<strong>GitHub project</strong>
|
|
213
|
+
View the source and add issues
|
|
214
|
+
</span>
|
|
215
|
+
</a>
|
|
216
|
+
<a
|
|
217
|
+
className="link-item"
|
|
218
|
+
href="https://discord.gg/storybook"
|
|
219
|
+
target="_blank"
|
|
220
|
+
>
|
|
221
|
+
{/* <img src={Comments} alt="comments" /> */}
|
|
222
|
+
<span>
|
|
223
|
+
<strong>Discord chat</strong>
|
|
224
|
+
Chat with maintainers and the community
|
|
225
|
+
</span>
|
|
226
|
+
</a>
|
|
227
|
+
</div>
|
|
228
|
+
|
|
229
|
+
<div className="tip-wrapper">
|
|
230
|
+
<span className="tip">Tip</span>Edit the Markdown in{" "}
|
|
231
|
+
<code>src/stories/Introduction.stories.mdx</code>
|
|
232
|
+
</div>
|
|
233
|
+
</>;
|
|
@@ -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
|
+
};
|