@sikka/hawa 0.0.7 → 0.0.8
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 +2 -1
- package/src/blocks/AuthForms/NewPasswordForm.js +54 -38
- package/src/blocks/AuthForms/ResetPasswordForm.js +41 -25
- package/src/blocks/AuthForms/SignInForm.js +40 -7
- package/src/blocks/AuthForms/SignUpForm.js +30 -8
- package/src/blocks/Payment/PayWithWallet.js +1 -1
- package/src/blocks/Payment/SelectPayment.js +15 -18
- package/src/stories/BlocksStories/AuthForm.stories.js +5 -3
- package/src/stories/Introduction.stories.mdx +229 -0
- package/src/stories/UIStories/ActionButton.stories.js +15 -22
- package/src/stories/UIStories/AdaptiveButton.stories.js +43 -42
- package/src/stories/UIStories/LogoButtons.stories.js +90 -0
- package/src/themes/HawaProvider.js +7 -2
- package/src/ui/ActionButton.js +1 -3
- package/src/ui/AdaptiveButton.js +43 -159
- package/src/ui/HawaAlert.js +1 -1
- package/src/ui/HawaLogoButton.js +96 -1
- package/src/ui/HawaSettingsRow.js +2 -2
- package/src/ui/HawaTextField.js +1 -4
- package/src/ui/HawaTypography.js +1 -2
- package/src/ui/index.js +1 -14
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.5731dbe3.iframe.bundle.js +1 -0
- package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js +76 -0
- package/storybook-static/{vendors~main.8ebae370.iframe.bundle.js.LICENSE.txt → vendors~main.aa1d952a.iframe.bundle.js.LICENSE.txt} +0 -15
- package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js.map +1 -0
- package/src/stories/GlobalVariables.stories.js +0 -44
- package/src/stories/Introduction.stories.js +0 -233
- package/src/ui/ApplePayButton.js +0 -26
- package/src/ui/GithubButton.js +0 -24
- package/src/ui/GoogleButton.js +0 -23
- package/src/ui/GooglePayButton.js +0 -26
- package/src/ui/MadaButton.js +0 -26
- package/src/ui/PayPalButton.js +0 -26
- package/src/ui/STCPayButton.js +0 -26
- package/src/ui/TwitterButton.js +0 -27
- package/src/ui/VisaMasterButton.js +0 -26
- package/src/ui/WalletButton.js +0 -24
- package/storybook-static/main.b7ffaed0.iframe.bundle.js +0 -1
- package/storybook-static/vendors~main.8ebae370.iframe.bundle.js +0 -76
- package/storybook-static/vendors~main.8ebae370.iframe.bundle.js.map +0 -1
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import { Box } from "../../layout";
|
|
4
|
-
import {
|
|
5
|
-
HawaTextField,
|
|
6
|
-
VisaMasterButton,
|
|
7
|
-
MadaButton,
|
|
8
|
-
STCPayButton,
|
|
9
|
-
PayPalButton,
|
|
10
|
-
GooglePayButton,
|
|
11
|
-
ApplePayButton,
|
|
12
|
-
WalletButton,
|
|
13
|
-
HawaTypography
|
|
14
|
-
} from "../../ui";
|
|
4
|
+
import { HawaTextField, HawaTypography, HawaLogoButton } from "../../ui";
|
|
15
5
|
|
|
16
6
|
export const SelectPayment = (props) => {
|
|
17
7
|
return (
|
|
@@ -19,43 +9,50 @@ export const SelectPayment = (props) => {
|
|
|
19
9
|
<Box noMargin>
|
|
20
10
|
<HawaTypography align="center">Choose Payment Method</HawaTypography>
|
|
21
11
|
{props.viaWallet && (
|
|
22
|
-
<
|
|
12
|
+
<HawaLogoButton
|
|
13
|
+
logo="wallet"
|
|
23
14
|
buttonText={props.walletLabel}
|
|
24
15
|
onClick={props.handleWallet}
|
|
25
16
|
/>
|
|
26
17
|
)}
|
|
27
18
|
{props.viaCreditCard && (
|
|
28
|
-
<
|
|
19
|
+
<HawaLogoButton
|
|
20
|
+
logo="visa/master"
|
|
29
21
|
buttonText={props.visaMasterLabel}
|
|
30
22
|
handleClick={props.handleCreditCard}
|
|
31
23
|
/>
|
|
32
24
|
)}
|
|
33
25
|
{props.viaMada && (
|
|
34
|
-
<
|
|
26
|
+
<HawaLogoButton
|
|
27
|
+
logo="mada"
|
|
35
28
|
buttonText={props.madaLabel}
|
|
36
29
|
handleClick={props.handleMada}
|
|
37
30
|
/>
|
|
38
31
|
)}
|
|
39
32
|
{props.viaSTCPay && (
|
|
40
|
-
<
|
|
33
|
+
<HawaLogoButton
|
|
34
|
+
logo="stcpay"
|
|
41
35
|
buttonText={props.stcPayLabel}
|
|
42
36
|
handleClick={props.handleSTCPay}
|
|
43
37
|
/>
|
|
44
38
|
)}
|
|
45
39
|
{props.viaPayPal && (
|
|
46
|
-
<
|
|
40
|
+
<HawaLogoButton
|
|
41
|
+
logo="paypal"
|
|
47
42
|
buttonText={props.paypalLabel}
|
|
48
43
|
handleClick={props.handlePayPal}
|
|
49
44
|
/>
|
|
50
45
|
)}
|
|
51
46
|
{props.viaGooglePay && (
|
|
52
|
-
<
|
|
47
|
+
<HawaLogoButton
|
|
48
|
+
logo="googlepay"
|
|
53
49
|
buttonText={props.googlePayLabel}
|
|
54
50
|
handleClick={props.handleGooglePay}
|
|
55
51
|
/>
|
|
56
52
|
)}
|
|
57
53
|
{props.viaApplePay && (
|
|
58
|
-
<
|
|
54
|
+
<HawaLogoButton
|
|
55
|
+
logo="applepay"
|
|
59
56
|
buttonText={props.applePayLabel}
|
|
60
57
|
handleClick={props.handleApplePay}
|
|
61
58
|
/>
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
SignInForm,
|
|
6
6
|
SignUpForm
|
|
7
7
|
} from "../../blocks/AuthForms";
|
|
8
|
-
import {
|
|
8
|
+
import { HawaProvider } from "../../themes/HawaProvider";
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
11
|
title: "Blocks/AuthBlocks",
|
|
@@ -87,7 +87,8 @@ const ResetPasswordTemplate = (args) => {
|
|
|
87
87
|
export const ResetPassword = ResetPasswordTemplate.bind({});
|
|
88
88
|
ResetPassword.args = {
|
|
89
89
|
theme: "primary",
|
|
90
|
-
showError: false
|
|
90
|
+
showError: false,
|
|
91
|
+
sent: false
|
|
91
92
|
};
|
|
92
93
|
const NewPasswordTemplate = (args) => {
|
|
93
94
|
return (
|
|
@@ -99,5 +100,6 @@ const NewPasswordTemplate = (args) => {
|
|
|
99
100
|
export const NewPassword = NewPasswordTemplate.bind({});
|
|
100
101
|
NewPassword.args = {
|
|
101
102
|
theme: "primary",
|
|
102
|
-
showError: false
|
|
103
|
+
showError: false,
|
|
104
|
+
passwordChanged: false
|
|
103
105
|
};
|
|
@@ -0,0 +1,229 @@
|
|
|
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="Introduction" />
|
|
12
|
+
|
|
13
|
+
<style>{`
|
|
14
|
+
.subheading {
|
|
15
|
+
--mediumdark: '#999999';
|
|
16
|
+
font-weight: 900;
|
|
17
|
+
font-size: 13px;
|
|
18
|
+
color: #999;
|
|
19
|
+
letter-spacing: 6px;
|
|
20
|
+
line-height: 24px;
|
|
21
|
+
text-transform: uppercase;
|
|
22
|
+
margin-bottom: 12px;
|
|
23
|
+
margin-top: 40px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.link-list {
|
|
27
|
+
display: grid;
|
|
28
|
+
grid-template-columns: 1fr;
|
|
29
|
+
grid-template-rows: 1fr 1fr;
|
|
30
|
+
row-gap: 10px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@media (min-width: 620px) {
|
|
34
|
+
.link-list {
|
|
35
|
+
row-gap: 20px;
|
|
36
|
+
column-gap: 20px;
|
|
37
|
+
grid-template-columns: 1fr 1fr;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@media all and (-ms-high-contrast:none) {
|
|
42
|
+
.link-list {
|
|
43
|
+
display: -ms-grid;
|
|
44
|
+
-ms-grid-columns: 1fr 1fr;
|
|
45
|
+
-ms-grid-rows: 1fr 1fr;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.link-item {
|
|
50
|
+
display: block;
|
|
51
|
+
padding: 20px 30px 20px 15px;
|
|
52
|
+
border: 1px solid #00000010;
|
|
53
|
+
border-radius: 5px;
|
|
54
|
+
transition: background 150ms ease-out, border 150ms ease-out, transform 150ms ease-out;
|
|
55
|
+
color: #333333;
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction:column;
|
|
58
|
+
align-items: flex-start;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.link-item:hover {
|
|
62
|
+
border-color: #1EA7FD50;
|
|
63
|
+
transform: translate3d(0, -3px, 0);
|
|
64
|
+
box-shadow: rgba(0, 0, 0, 0.08) 0 3px 10px 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.link-item:active {
|
|
68
|
+
border-color: #1EA7FD;
|
|
69
|
+
transform: translate3d(0, 0, 0);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.link-item strong {
|
|
73
|
+
font-weight: 700;
|
|
74
|
+
display: block;
|
|
75
|
+
margin-bottom: 2px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.link-item img {
|
|
79
|
+
height: 40px;
|
|
80
|
+
width: 40px;
|
|
81
|
+
margin-right: 15px;
|
|
82
|
+
flex: none;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.link-item span {
|
|
86
|
+
font-size: 14px;
|
|
87
|
+
line-height: 20px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.tip {
|
|
91
|
+
display: inline-block;
|
|
92
|
+
border-radius: 1em;
|
|
93
|
+
font-size: 11px;
|
|
94
|
+
line-height: 12px;
|
|
95
|
+
font-weight: 700;
|
|
96
|
+
background: #E7FDD8;
|
|
97
|
+
color: #66BF3C;
|
|
98
|
+
padding: 4px 12px;
|
|
99
|
+
margin-right: 10px;
|
|
100
|
+
vertical-align: top;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.tip-wrapper {
|
|
104
|
+
font-size: 13px;
|
|
105
|
+
line-height: 20px;
|
|
106
|
+
margin-top: 40px;
|
|
107
|
+
margin-bottom: 40px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.tip-wrapper code {
|
|
111
|
+
font-size: 12px;
|
|
112
|
+
display: inline-block;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
`}</style>
|
|
117
|
+
|
|
118
|
+
# Welcome to Hawa
|
|
119
|
+
|
|
120
|
+
<div className="tip-wrapper">
|
|
121
|
+
<span className="tip">Notice</span>This page is still in progress
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
Storybook helps you build UI components in isolation from your app's business logic, data, and context.
|
|
125
|
+
That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA.
|
|
126
|
+
|
|
127
|
+
Browse example stories now by navigating to them in the sidebar.
|
|
128
|
+
View their code in the `src/stories` directory to learn how they work.
|
|
129
|
+
We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages.
|
|
130
|
+
|
|
131
|
+
<div className="subheading">Structure</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
|
+
<h3>Layout</h3>
|
|
141
|
+
<span>
|
|
142
|
+
<strong>Presets for popular tools</strong>
|
|
143
|
+
Easy setup for TypeScript, SCSS and more.
|
|
144
|
+
</span>
|
|
145
|
+
</a>
|
|
146
|
+
<a
|
|
147
|
+
className="link-item"
|
|
148
|
+
href="https://storybook.js.org/docs/react/configure/webpack"
|
|
149
|
+
target="_blank"
|
|
150
|
+
>
|
|
151
|
+
{/* <img src={StackAlt} alt="Build" /> */}
|
|
152
|
+
<h3>Blocks</h3>
|
|
153
|
+
<span>
|
|
154
|
+
<strong>Build configuration</strong>
|
|
155
|
+
How to customize webpack and Babel
|
|
156
|
+
</span>
|
|
157
|
+
|
|
158
|
+
</a>
|
|
159
|
+
<a
|
|
160
|
+
className="link-item"
|
|
161
|
+
href="https://storybook.js.org/docs/react/configure/styling-and-css"
|
|
162
|
+
target="_blank"
|
|
163
|
+
>
|
|
164
|
+
{/* <img src={Colors} alt="colors" /> */}
|
|
165
|
+
<h3>Elements</h3>
|
|
166
|
+
<span>
|
|
167
|
+
<strong>Styling</strong>
|
|
168
|
+
How to load and configure CSS libraries
|
|
169
|
+
</span>
|
|
170
|
+
</a>
|
|
171
|
+
<a
|
|
172
|
+
className="link-item"
|
|
173
|
+
href="https://storybook.js.org/docs/react/get-started/setup#configure-storybook-for-your-stack"
|
|
174
|
+
target="_blank"
|
|
175
|
+
>
|
|
176
|
+
{/* <img src={Flow} alt="flow" /> */}
|
|
177
|
+
<h3>UI</h3>
|
|
178
|
+
<span>
|
|
179
|
+
<strong>Data</strong>
|
|
180
|
+
Providers and mocking for data libraries
|
|
181
|
+
</span>
|
|
182
|
+
</a>
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
<div className="subheading">Learn</div>
|
|
186
|
+
|
|
187
|
+
<div className="link-list">
|
|
188
|
+
<a className="link-item" href="https://storybook.js.org/docs" target="_blank">
|
|
189
|
+
{/* <img src={Repo} alt="repo" /> */}
|
|
190
|
+
<span>
|
|
191
|
+
<strong>Storybook documentation</strong>
|
|
192
|
+
Configure, customize, and extend
|
|
193
|
+
</span>
|
|
194
|
+
</a>
|
|
195
|
+
<a
|
|
196
|
+
className="link-item"
|
|
197
|
+
href="https://storybook.js.org/tutorials/"
|
|
198
|
+
target="_blank"
|
|
199
|
+
>
|
|
200
|
+
{/* <img src={Direction} alt="direction" /> */}
|
|
201
|
+
<span>
|
|
202
|
+
<strong>In-depth guides</strong>
|
|
203
|
+
Best practices from leading teams
|
|
204
|
+
</span>
|
|
205
|
+
</a>
|
|
206
|
+
<a
|
|
207
|
+
className="link-item"
|
|
208
|
+
href="https://github.com/storybookjs/storybook"
|
|
209
|
+
target="_blank"
|
|
210
|
+
>
|
|
211
|
+
{/* <img src={Code} alt="code" /> */}
|
|
212
|
+
<span>
|
|
213
|
+
<strong>GitHub project</strong>
|
|
214
|
+
View the source and add issues
|
|
215
|
+
</span>
|
|
216
|
+
</a>
|
|
217
|
+
<a className="link-item" href="https://discord.gg/storybook" target="_blank">
|
|
218
|
+
{/* <img src={Comments} alt="comments" /> */}
|
|
219
|
+
<span>
|
|
220
|
+
<strong>Discord chat</strong>
|
|
221
|
+
Chat with maintainers and the community
|
|
222
|
+
</span>
|
|
223
|
+
</a>
|
|
224
|
+
</div>
|
|
225
|
+
|
|
226
|
+
<div className="tip-wrapper">
|
|
227
|
+
<span className="tip">Tip</span>Edit the Markdown in{" "}
|
|
228
|
+
<code>src/stories/Introduction.stories.mdx</code>
|
|
229
|
+
</div>
|
|
@@ -1,37 +1,24 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
import { defaultTheme, HawaProvider } from "../../themes/HawaProvider";
|
|
2
|
+
import { HawaProvider } from "../../themes/HawaProvider";
|
|
4
3
|
import { ActionButton } from "../../ui";
|
|
5
4
|
|
|
6
|
-
const Template = (args) => {
|
|
7
|
-
return (
|
|
8
|
-
<HawaProvider themeName={args.theme}>
|
|
9
|
-
<ActionButton text={args.buttonLabel} />
|
|
10
|
-
</HawaProvider>
|
|
11
|
-
);
|
|
12
|
-
};
|
|
13
|
-
//types:
|
|
14
|
-
//error (red)
|
|
15
|
-
//warning (red)
|
|
16
|
-
//notice (blue)
|
|
17
|
-
|
|
18
5
|
export default {
|
|
19
|
-
title: "
|
|
6
|
+
title: "Elements/Buttons/ActionButton",
|
|
20
7
|
component: ActionButton,
|
|
21
8
|
argTypes: {
|
|
22
9
|
theme: {
|
|
23
|
-
description: "overwritten description",
|
|
24
|
-
table: {
|
|
25
|
-
type: {
|
|
26
|
-
summary: "something short"
|
|
27
|
-
},
|
|
28
|
-
defaultValue: { summary: "Hello" }
|
|
29
|
-
},
|
|
30
10
|
options: ["primary", "secondary", "default"],
|
|
31
11
|
control: { type: "select" }
|
|
32
12
|
}
|
|
33
13
|
}
|
|
34
14
|
};
|
|
15
|
+
const Template = (args) => {
|
|
16
|
+
return (
|
|
17
|
+
<HawaProvider themeName={args.theme}>
|
|
18
|
+
<ActionButton text={args.buttonLabel} />
|
|
19
|
+
</HawaProvider>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
35
22
|
|
|
36
23
|
Template.args = {
|
|
37
24
|
showText: true,
|
|
@@ -51,3 +38,9 @@ Secondary.args = {
|
|
|
51
38
|
buttonLabel: "test",
|
|
52
39
|
theme: "secondary"
|
|
53
40
|
};
|
|
41
|
+
export const Default = Template.bind({});
|
|
42
|
+
Default.args = {
|
|
43
|
+
showText: true,
|
|
44
|
+
buttonLabel: "test",
|
|
45
|
+
theme: "default"
|
|
46
|
+
};
|
|
@@ -3,22 +3,8 @@ import CastIcon from "@mui/icons-material/Cast";
|
|
|
3
3
|
import { HawaProvider } from "../../themes/HawaProvider";
|
|
4
4
|
import { AdaptiveButton } from "../../ui";
|
|
5
5
|
|
|
6
|
-
const Template = (args) => {
|
|
7
|
-
const theme = {
|
|
8
|
-
borderRadius: 10,
|
|
9
|
-
primaryColor: "#004fff",
|
|
10
|
-
secondaryColor: "red",
|
|
11
|
-
// margins: "10px",
|
|
12
|
-
paddings: 10
|
|
13
|
-
};
|
|
14
|
-
return (
|
|
15
|
-
<HawaProvider theme={theme}>
|
|
16
|
-
<AdaptiveButton {...args} />
|
|
17
|
-
</HawaProvider>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
20
6
|
export default {
|
|
21
|
-
title: "
|
|
7
|
+
title: "Elements/Buttons/AdaptiveButton",
|
|
22
8
|
component: AdaptiveButton,
|
|
23
9
|
argsTypes: {
|
|
24
10
|
buttonLabel: { control: "text" },
|
|
@@ -26,40 +12,53 @@ export default {
|
|
|
26
12
|
buttonColor: { control: "color" },
|
|
27
13
|
padding: { control: "number" },
|
|
28
14
|
hintTitle: { control: "text" },
|
|
29
|
-
hintContent: { control: "text" }
|
|
15
|
+
hintContent: { control: "text" },
|
|
16
|
+
theme: {
|
|
17
|
+
options: ["primary", "secondary", "default"],
|
|
18
|
+
control: { type: "select" }
|
|
19
|
+
}
|
|
30
20
|
},
|
|
31
21
|
args: {
|
|
32
|
-
// type: "text",
|
|
33
|
-
// buttonLabel: "Test"
|
|
34
|
-
// borderRadius: 15,
|
|
35
22
|
hintTitle: "test",
|
|
36
23
|
hintContent: "more test",
|
|
37
|
-
buttonColor: "#f9f9f9"
|
|
24
|
+
buttonColor: "#f9f9f9",
|
|
25
|
+
theme: "primary"
|
|
38
26
|
}
|
|
39
27
|
};
|
|
40
28
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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"
|
|
49
46
|
// placeholder: "Example ...",
|
|
50
47
|
// defaultValue: "This is default value",
|
|
51
48
|
// inputLabel: "Text Field",
|
|
52
49
|
// padding: 10
|
|
53
50
|
};
|
|
54
51
|
|
|
55
|
-
export const
|
|
56
|
-
|
|
57
|
-
showText: true,
|
|
58
|
-
buttonLabel: "test",
|
|
59
|
-
borderRadius: 5,
|
|
60
|
-
buttonColor: "#878787",
|
|
61
|
-
textColor: "#ffffff",
|
|
62
|
-
icon: <CastIcon
|
|
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
|
+
|
|
63
62
|
// placeholder: "Exemple ...",
|
|
64
63
|
// defaultValue: "This is default value",
|
|
65
64
|
// inputLabel: "Text Field",
|
|
@@ -67,12 +66,14 @@ Dark.args = {
|
|
|
67
66
|
};
|
|
68
67
|
export const Danger = Template.bind({});
|
|
69
68
|
Danger.args = {
|
|
70
|
-
showText: true,
|
|
71
|
-
buttonLabel: "test",
|
|
72
|
-
borderRadius: 5,
|
|
73
|
-
buttonColor: "#c0c0c0",
|
|
74
|
-
danger: true,
|
|
75
|
-
icon: <CastIcon
|
|
69
|
+
// showText: true,
|
|
70
|
+
// buttonLabel: "test",
|
|
71
|
+
// borderRadius: 5,
|
|
72
|
+
// buttonColor: "#c0c0c0",
|
|
73
|
+
// danger: true,
|
|
74
|
+
// icon: <CastIcon />,
|
|
75
|
+
theme: "primary"
|
|
76
|
+
|
|
76
77
|
// placeholder: "Exemple ...",
|
|
77
78
|
// defaultValue: "This is default value",
|
|
78
79
|
// inputLabel: "Text Field",
|
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
};
|
|
@@ -22,6 +22,7 @@ export const defaultTheme = {
|
|
|
22
22
|
margins: 10,
|
|
23
23
|
paddings: 10,
|
|
24
24
|
typography: {
|
|
25
|
+
fontFamily: ["IBMPlex"].join(","),
|
|
25
26
|
primary: { color: "black" },
|
|
26
27
|
secondary: { color: "white" }
|
|
27
28
|
},
|
|
@@ -31,7 +32,9 @@ export const defaultTheme = {
|
|
|
31
32
|
backgroundColor: allPrimaryAction,
|
|
32
33
|
// margin: 10,
|
|
33
34
|
marginTop: 10,
|
|
34
|
-
padding:
|
|
35
|
+
padding: 30,
|
|
36
|
+
paddingTop: 0,
|
|
37
|
+
paddingBottom: 0,
|
|
35
38
|
border: "1px solid #ced4da",
|
|
36
39
|
height: 50,
|
|
37
40
|
"&:focus": {
|
|
@@ -42,7 +45,9 @@ export const defaultTheme = {
|
|
|
42
45
|
borderRadius: 10,
|
|
43
46
|
backgroundColor: "#f90900",
|
|
44
47
|
marginTop: 10,
|
|
45
|
-
padding:
|
|
48
|
+
padding: 30,
|
|
49
|
+
paddingTop: 0,
|
|
50
|
+
paddingBottom: 0,
|
|
46
51
|
border: "1px solid #ced4da",
|
|
47
52
|
height: 50,
|
|
48
53
|
"&:focus": {
|
package/src/ui/ActionButton.js
CHANGED
|
@@ -35,9 +35,7 @@ export const ActionButton = (props) => {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
const StyledButton = styled(Button)(({ theme }) => {
|
|
38
|
-
return {
|
|
39
|
-
...actionButtonStyle
|
|
40
|
-
};
|
|
38
|
+
return { ...actionButtonStyle };
|
|
41
39
|
});
|
|
42
40
|
return <StyledButton {...props}>{props.text}</StyledButton>;
|
|
43
41
|
};
|