@sikka/hawa 0.0.6 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/es/index.es.js +1 -1
  2. package/lib/index.js +1 -1
  3. package/package.json +2 -1
  4. package/src/blocks/Account/UserProfile.js +57 -7
  5. package/src/blocks/AuthForms/NewPasswordForm.js +59 -42
  6. package/src/blocks/AuthForms/ResetPasswordForm.js +46 -33
  7. package/src/blocks/AuthForms/SignInForm.js +60 -32
  8. package/src/blocks/AuthForms/SignUpForm.js +74 -45
  9. package/src/blocks/Payment/ChargeWalletForm.js +38 -17
  10. package/src/blocks/Payment/CreditCardForm.js +50 -21
  11. package/src/blocks/Payment/PayWithWallet.js +4 -25
  12. package/src/blocks/Payment/SelectPayment.js +18 -39
  13. package/src/layout/Box.js +9 -9
  14. package/src/stories/BlocksStories/AuthForm.stories.js +9 -9
  15. package/src/stories/BlocksStories/PaymentForm.stories.js +10 -6
  16. package/src/stories/BlocksStories/UserForm.stories.js +41 -0
  17. package/src/stories/Introduction.stories.mdx +229 -0
  18. package/src/stories/LayoutStories/Box.stories.js +4 -4
  19. package/src/stories/UIStories/ActionButton.stories.js +15 -22
  20. package/src/stories/UIStories/AdaptiveButton.stories.js +43 -42
  21. package/src/stories/UIStories/Alert.stories.js +4 -17
  22. package/src/stories/UIStories/LogoButtons.stories.js +90 -0
  23. package/src/stories/UIStories/RadioSelector.stories.js +20 -35
  24. package/src/stories/UIStories/SettingsRow.stories.js +64 -0
  25. package/src/themes/HawaProvider.js +64 -20
  26. package/src/ui/ActionButton.js +12 -11
  27. package/src/ui/AdaptiveButton.js +43 -159
  28. package/src/ui/HawaAlert.js +6 -6
  29. package/src/ui/HawaButton.js +6 -6
  30. package/src/ui/HawaInputLabel.js +4 -4
  31. package/src/ui/HawaLogoButton.js +102 -12
  32. package/src/ui/HawaRadio.js +50 -28
  33. package/src/ui/HawaSettingsRow.js +71 -0
  34. package/src/ui/HawaTextField.js +29 -35
  35. package/src/ui/HawaTypography.js +5 -6
  36. package/src/ui/index.js +2 -15
  37. package/storybook-static/iframe.html +1 -1
  38. package/storybook-static/main.5731dbe3.iframe.bundle.js +1 -0
  39. package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js +76 -0
  40. package/storybook-static/{vendors~main.30a2c5d7.iframe.bundle.js.LICENSE.txt → vendors~main.aa1d952a.iframe.bundle.js.LICENSE.txt} +0 -15
  41. package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js.map +1 -0
  42. package/src/stories/BlocksStories/UserAccount.stories.js +0 -46
  43. package/src/stories/GlobalVariables.stories.js +0 -44
  44. package/src/stories/Introduction.stories.js +0 -233
  45. package/src/ui/ApplePayButton.js +0 -93
  46. package/src/ui/GithubButton.js +0 -90
  47. package/src/ui/GoogleButton.js +0 -82
  48. package/src/ui/GooglePayButton.js +0 -93
  49. package/src/ui/MadaButton.js +0 -93
  50. package/src/ui/PayPalButton.js +0 -93
  51. package/src/ui/STCPayButton.js +0 -93
  52. package/src/ui/TwitterButton.js +0 -83
  53. package/src/ui/VisaMasterButton.js +0 -93
  54. package/src/ui/WalletButton.js +0 -24
  55. package/storybook-static/main.e55ce615.iframe.bundle.js +0 -1
  56. package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js +0 -76
  57. package/storybook-static/vendors~main.30a2c5d7.iframe.bundle.js.map +0 -1
@@ -41,21 +41,6 @@ object-assign
41
41
  * Released under the MIT License.
42
42
  */
43
43
 
44
- /*! *****************************************************************************
45
- Copyright (c) Microsoft Corporation.
46
-
47
- Permission to use, copy, modify, and/or distribute this software for any
48
- purpose with or without fee is hereby granted.
49
-
50
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
51
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
52
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
53
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
54
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
55
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
56
- PERFORMANCE OF THIS SOFTWARE.
57
- ***************************************************************************** */
58
-
59
44
  /** @license MUI v5.4.4
60
45
  *
61
46
  * This source code is licensed under the MIT license found in the
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vendors~main.aa1d952a.iframe.bundle.js","sources":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A","sourceRoot":""}
@@ -1,46 +0,0 @@
1
- import React from "react";
2
- import {
3
- UserProfile
4
- } from "../../blocks/Account";
5
- import { defaultTheme, HawaProvider } from "../../themes/HawaProvider";
6
-
7
- export default {
8
- title: "Blocks/UserProfile",
9
- component: UserProfile,
10
- argsTypes: {
11
- viaGoogle: { control: "boolean" },
12
- viaGithub: { control: "boolean" },
13
- viaTwitter: { control: "boolean" },
14
- viaFacebook: { control: "boolean" }
15
- },
16
- args: {}
17
- };
18
-
19
- const theme = {
20
- ...defaultTheme,
21
- paddings: 20
22
- };
23
-
24
- const UserProfileTemplate = (args) => {
25
- return (
26
- <HawaProvider theme={{ ...defaultTheme, ...theme }}>
27
- <UserProfile {...args} />
28
- </HawaProvider>
29
- );
30
- };
31
-
32
- export const Success = UserProfileTemplate.bind({});
33
- Success.args = {
34
- viaGoogle: true,
35
- viaGithub: true,
36
- viaTwitter: true,
37
- viaFacebook: true
38
- };
39
- export const Failed = UserProfileTemplate.bind({});
40
- Failed.args = {
41
- viaGoogle: true,
42
- viaGithub: true,
43
- viaTwitter: true,
44
- viaFacebook: true
45
- };
46
-
@@ -1,44 +0,0 @@
1
- import React from "react";
2
- import PropTypes from "prop-types";
3
-
4
- export const GlobalVariables = (args) => {
5
- // const methods = useForm();
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
14
- };
15
- export default {
16
- title: "TestTitle",
17
- component: [GlobalVariables, AnotherComponent],
18
- argTypes: {
19
- resize: {
20
- description: "overwritten description",
21
- table: {
22
- type: {
23
- summary: "something short"
24
- },
25
- defaultValue: { summary: "Hello" }
26
- },
27
- options: ["vertical", "horizontal", "both"],
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
- }
42
- }
43
- }
44
- };
@@ -1,233 +0,0 @@
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
- {`
16
- .subheading {
17
- --mediumdark: '#999999';
18
- font-weight: 900;
19
- font-size: 13px;
20
- color: #999;
21
- letter-spacing: 6px;
22
- line-height: 24px;
23
- text-transform: uppercase;
24
- margin-bottom: 12px;
25
- margin-top: 40px;
26
- }
27
-
28
- .link-list {
29
- display: grid;
30
- grid-template-columns: 1fr;
31
- grid-template-rows: 1fr 1fr;
32
- row-gap: 10px;
33
- }
34
-
35
- @media (min-width: 620px) {
36
- .link-list {
37
- row-gap: 20px;
38
- column-gap: 20px;
39
- grid-template-columns: 1fr 1fr;
40
- }
41
- }
42
-
43
- @media all and (-ms-high-contrast:none) {
44
- .link-list {
45
- display: -ms-grid;
46
- -ms-grid-columns: 1fr 1fr;
47
- -ms-grid-rows: 1fr 1fr;
48
- }
49
- }
50
-
51
- .link-item {
52
- display: block;
53
- padding: 20px 30px 20px 15px;
54
- border: 1px solid #00000010;
55
- border-radius: 5px;
56
- transition: background 150ms ease-out, border 150ms ease-out, transform 150ms ease-out;
57
- color: #333333;
58
- display: flex;
59
- align-items: flex-start;
60
- }
61
-
62
- .link-item:hover {
63
- border-color: #1EA7FD50;
64
- transform: translate3d(0, -3px, 0);
65
- box-shadow: rgba(0, 0, 0, 0.08) 0 3px 10px 0;
66
- }
67
-
68
- .link-item:active {
69
- border-color: #1EA7FD;
70
- transform: translate3d(0, 0, 0);
71
- }
72
-
73
- .link-item strong {
74
- font-weight: 700;
75
- display: block;
76
- margin-bottom: 2px;
77
- }
78
-
79
- .link-item img {
80
- height: 40px;
81
- width: 40px;
82
- margin-right: 15px;
83
- flex: none;
84
- }
85
-
86
- .link-item span {
87
- font-size: 14px;
88
- line-height: 20px;
89
- }
90
-
91
- .tip {
92
- display: inline-block;
93
- border-radius: 1em;
94
- font-size: 11px;
95
- line-height: 12px;
96
- font-weight: 700;
97
- background: #E7FDD8;
98
- color: #66BF3C;
99
- padding: 4px 12px;
100
- margin-right: 10px;
101
- vertical-align: top;
102
- }
103
-
104
- .tip-wrapper {
105
- font-size: 13px;
106
- line-height: 20px;
107
- margin-top: 40px;
108
- margin-bottom: 40px;
109
- }
110
-
111
- .tip-wrapper code {
112
- font-size: 12px;
113
- display: inline-block;
114
- }
115
-
116
-
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
- </>;
@@ -1,93 +0,0 @@
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
- let currentTheme = Object.keys(theme.actionButton).find(
13
- (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
14
- );
15
- if (currentTheme) {
16
- buttonStyle = {
17
- cursor: "pointer",
18
- display: "flex",
19
- flexDirection: "row",
20
- alignItems: "center",
21
- justifyContent: "center",
22
- padding: 0,
23
- marginTop: theme.actionButton[currentTheme].margin,
24
- border: props.outlined ? "2px solid black" : "none",
25
- borderRadius: theme.actionButton[currentTheme].borderRadius,
26
- backgroundColor: "white",
27
- "&:hover": {
28
- backgroundColor: darken("#ffffff", 0.1)
29
- }
30
- };
31
- } else {
32
- buttonStyle = {
33
- cursor: "pointer",
34
- display: "flex",
35
- flexDirection: "row",
36
- alignItems: "center",
37
- justifyContent: "center",
38
- marginTop: theme.margins,
39
- border: props.outlined ? "2px solid black" : "none",
40
- borderRadius: 0,
41
- backgroundColor: "white",
42
- "&:hover": {
43
- backgroundColor: darken("#ffffff", 0.1)
44
- }
45
- };
46
- }
47
-
48
- const StyledButton = styled(Button)(({ theme }) => {
49
- return {
50
- // "label + &": {
51
- // marginTop: theme.spacing(3)
52
- // },
53
-
54
- borderRadius: 4,
55
- position: "relative",
56
- border: "1px solid #ced4da",
57
- fontSize: 16,
58
- // width: "auto",
59
- height: 50,
60
- // padding: "10px 12px",
61
- ...buttonStyle,
62
- "&:focus": {
63
- // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
64
- borderColor: theme.palette.primary.main
65
- }
66
- };
67
- });
68
-
69
- return (
70
- <StyledButton
71
- // style={buttonStyle}
72
- onClick={props.handleClick}
73
- >
74
- <img
75
- src="https://sikka-images.s3.ap-southeast-1.amazonaws.com/payments/apple-pay.png"
76
- height={40}
77
- />{" "}
78
- <div style={{ width: 10 }} />
79
- <p
80
- style={{
81
- color: "black",
82
- fontSize: 14,
83
- textAlign: "center",
84
- letterSpacing: 0.4,
85
- fontFamily: "Roboto",
86
- fontWeight: 500
87
- }}
88
- >
89
- {props.buttonText}
90
- </p>
91
- </StyledButton>
92
- );
93
- };
@@ -1,90 +0,0 @@
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 GithubButton = (props) => {
9
- const theme = useContext(ThemeProvider);
10
- let buttonStyle = {};
11
-
12
- let currentTheme = Object.keys(theme.actionButton).find(
13
- (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
14
- );
15
- if (currentTheme) {
16
- buttonStyle = {
17
- cursor: "pointer",
18
- display: "flex",
19
- flexDirection: "row",
20
- alignItems: "center",
21
- justifyContent: "center",
22
- padding: 0,
23
- marginTop: theme.actionButton[currentTheme].margin,
24
- border: props.outlined ? "2px solid black" : "none",
25
- borderRadius: theme.actionButton[currentTheme].borderRadius,
26
- backgroundColor: "white",
27
- "&:hover": {
28
- backgroundColor: darken("#ffffff", 0.1)
29
- }
30
- };
31
- } else {
32
- buttonStyle = {
33
- cursor: "pointer",
34
- display: "flex",
35
- flexDirection: "row",
36
- alignItems: "center",
37
- justifyContent: "center",
38
- marginTop: theme.margins,
39
- border: props.outlined ? "2px solid black" : "none",
40
- borderRadius: 0,
41
- backgroundColor: "white",
42
- "&:hover": {
43
- backgroundColor: darken("#ffffff", 0.1)
44
- }
45
- };
46
- }
47
-
48
- const StyledButton = styled(Button)(({ theme }) => {
49
- return {
50
- // "label + &": {
51
- // marginTop: theme.spacing(3)
52
- // },
53
-
54
- borderRadius: 4,
55
- position: "relative",
56
- border: "1px solid #ced4da",
57
- fontSize: 16,
58
- // width: "auto",
59
- height: 50,
60
- // padding: "10px 12px",
61
- ...buttonStyle,
62
- "&:focus": {
63
- // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
64
- borderColor: theme.palette.primary.main
65
- }
66
- };
67
- });
68
-
69
- return (
70
- <StyledButton
71
- // style={buttonStyle}
72
- onClick={props.handleClick}
73
- >
74
- <GitHubIcon />
75
- <div style={{ width: 10 }} />
76
- <p
77
- style={{
78
- color: "black",
79
- fontSize: 14,
80
- textAlign: "center",
81
- letterSpacing: 0.4,
82
- fontFamily: "Roboto",
83
- fontWeight: 500
84
- }}
85
- >
86
- {props.buttonText}
87
- </p>
88
- </StyledButton>
89
- );
90
- };
@@ -1,82 +0,0 @@
1
- import React, { useContext } from "react";
2
- import { ThemeProvider } from "../themes/HawaProvider";
3
- import { styled, darken } from "@mui/material/styles";
4
- import Button from "@mui/material/Button";
5
-
6
- export const GoogleButton = (props) => {
7
- const theme = useContext(ThemeProvider);
8
- let buttonStyle = {};
9
-
10
- let currentTheme = Object.keys(theme.actionButton).find(
11
- (themeName) => themeName.toLowerCase() === props.themeType?.toLowerCase()
12
- );
13
- if (currentTheme) {
14
- buttonStyle = {
15
- cursor: "pointer",
16
- display: "flex",
17
- flexDirection: "row",
18
- alignItems: "center",
19
- justifyContent: "center",
20
- marginTop: theme.layout[currentTheme].margin,
21
- border: props.outlined ? "2px solid black" : "none",
22
- borderRadius: theme.layout[currentTheme].borderRadius,
23
- backgroundColor: "white",
24
- "&:hover": {
25
- backgroundColor: darken("#ffffff", 0.1)
26
- }
27
- };
28
- } else {
29
- buttonStyle = {
30
- cursor: "pointer",
31
- display: "flex",
32
- flexDirection: "row",
33
- alignItems: "center",
34
- justifyContent: "center",
35
- marginTop: theme.margins,
36
- border: props.outlined ? "2px solid black" : "none",
37
- borderRadius: 0,
38
- backgroundColor: "white",
39
- "&:hover": {
40
- backgroundColor: darken("#ffffff", 0.1)
41
- }
42
- };
43
- }
44
- const StyledButton = styled(Button)(({ theme }) => {
45
- return {
46
- // "label + &": {
47
- // marginTop: theme.spacing(3)
48
- // },
49
-
50
- borderRadius: 4,
51
- position: "relative",
52
- border: "1px solid #ced4da",
53
- fontSize: 16,
54
- // width: "auto",
55
- height: 50,
56
- // padding: "10px 12px",
57
- ...buttonStyle,
58
- "&:focus": {
59
- // boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`,
60
- borderColor: theme.palette.primary.main
61
- }
62
- };
63
- });
64
- return (
65
- <StyledButton onClick={props.handleClick}>
66
- <img src="https://upload.wikimedia.org/wikipedia/commons/5/53/Google_%22G%22_Logo.svg" />
67
- <div style={{ width: 10 }} />
68
- <p
69
- style={{
70
- color: "black",
71
- fontSize: 14,
72
- textAlign: "center",
73
- letterSpacing: 0.4,
74
- fontFamily: "Roboto",
75
- fontWeight: 500
76
- }}
77
- >
78
- {props.buttonText}
79
- </p>
80
- </StyledButton>
81
- );
82
- };