@sikka/hawa 0.0.5 → 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.
Files changed (83) hide show
  1. package/es/index.es.js +1 -1
  2. package/lib/index.js +1 -1
  3. package/package.json +4 -5
  4. package/src/blocks/Account/UserProfile.js +57 -7
  5. package/src/blocks/AuthForms/NewPasswordForm.js +100 -17
  6. package/src/blocks/AuthForms/ResetPasswordForm.js +61 -5
  7. package/src/blocks/AuthForms/SignInForm.js +101 -26
  8. package/src/blocks/AuthForms/SignUpForm.js +113 -32
  9. package/src/blocks/Payment/ChargeWalletForm.js +53 -0
  10. package/src/blocks/Payment/CreditCardForm.js +50 -21
  11. package/src/blocks/Payment/PayWithWallet.js +14 -0
  12. package/src/blocks/Payment/SelectPayment.js +20 -42
  13. package/src/blocks/Payment/index.js +2 -0
  14. package/src/layout/Box.js +9 -10
  15. package/src/stories/BlocksStories/AuthForm.stories.js +18 -12
  16. package/src/stories/BlocksStories/PaymentForm.stories.js +15 -40
  17. package/src/stories/BlocksStories/UserForm.stories.js +41 -0
  18. package/src/stories/{Introduction.stories.js → Introduction.stories.mdx} +45 -27
  19. package/src/stories/LayoutStories/Box.stories.js +4 -4
  20. package/src/stories/{ActionButton.stories.js → UIStories/ActionButton.stories.js} +16 -23
  21. package/src/stories/UIStories/AdaptiveButton.stories.js +81 -0
  22. package/src/stories/UIStories/Alert.stories.js +42 -0
  23. package/src/stories/{CheckBox.stories.js → UIStories/CheckBox.stories.js} +3 -4
  24. package/src/stories/UIStories/InputLabel.stories.js +13 -0
  25. package/src/stories/UIStories/LogoButtons.stories.js +90 -0
  26. package/src/stories/UIStories/RadioSelector.stories.js +53 -0
  27. package/src/stories/UIStories/SettingsRow.stories.js +64 -0
  28. package/src/stories/{TextField.stories.js → UIStories/TextField.stories.js} +4 -5
  29. package/src/themes/HawaProvider.js +107 -11
  30. package/src/ui/ActionButton.js +12 -11
  31. package/src/ui/AdaptiveButton.js +43 -159
  32. package/src/ui/HawaAlert.js +37 -0
  33. package/src/ui/HawaButton.js +48 -0
  34. package/src/ui/{Checkbox.js → HawaCheckbox.js} +1 -1
  35. package/src/ui/HawaInputLabel.js +4 -5
  36. package/src/ui/HawaLogoButton.js +138 -0
  37. package/src/ui/HawaRadio.js +73 -0
  38. package/src/ui/HawaSettingsRow.js +71 -0
  39. package/src/ui/HawaTextField.js +69 -80
  40. package/src/ui/HawaTypography.js +28 -0
  41. package/src/ui/index.js +9 -19
  42. package/storybook-static/{1.95be85dd.iframe.bundle.js → 0.0d994c92.iframe.bundle.js} +3 -3
  43. package/storybook-static/{1.95be85dd.iframe.bundle.js.LICENSE.txt → 0.0d994c92.iframe.bundle.js.LICENSE.txt} +0 -0
  44. package/storybook-static/0.0d994c92.iframe.bundle.js.map +1 -0
  45. package/storybook-static/1.aabc3f3a.iframe.bundle.js +1 -0
  46. package/storybook-static/{3.d72f7fac.iframe.bundle.js → 2.430bf1e3.iframe.bundle.js} +1 -1
  47. package/storybook-static/{7.ffb0d84b.iframe.bundle.js → 6.704d1e8d.iframe.bundle.js} +1 -1
  48. package/storybook-static/{8.68cd1217.iframe.bundle.js → 7.9ce807e3.iframe.bundle.js} +3 -3
  49. package/storybook-static/{8.68cd1217.iframe.bundle.js.LICENSE.txt → 7.9ce807e3.iframe.bundle.js.LICENSE.txt} +0 -0
  50. package/storybook-static/7.9ce807e3.iframe.bundle.js.map +1 -0
  51. package/storybook-static/{9.488e3969.iframe.bundle.js → 8.c4cb6081.iframe.bundle.js} +1 -1
  52. package/storybook-static/iframe.html +1 -1
  53. package/storybook-static/main.5731dbe3.iframe.bundle.js +1 -0
  54. package/storybook-static/runtime~main.cfefe972.iframe.bundle.js +1 -0
  55. package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js +76 -0
  56. package/storybook-static/{vendors~main.d75dc38b.iframe.bundle.js.LICENSE.txt → vendors~main.aa1d952a.iframe.bundle.js.LICENSE.txt} +0 -0
  57. package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js.map +1 -0
  58. package/src/stories/AdaptiveButton.stories.js +0 -80
  59. package/src/stories/Alert.stories.js +0 -41
  60. package/src/stories/BlocksStories/UserAccount.stories.js +0 -46
  61. package/src/stories/GlobalVariables.stories.js +0 -44
  62. package/src/stories/InputLabel.stories.js +0 -92
  63. package/src/stories/RadioSelector.stories.js +0 -69
  64. package/src/ui/ApplePayButton.js +0 -94
  65. package/src/ui/GithubButton.js +0 -91
  66. package/src/ui/GoogleButton.js +0 -83
  67. package/src/ui/GooglePayButton.js +0 -94
  68. package/src/ui/MadaButton.js +0 -94
  69. package/src/ui/PayPalButton.js +0 -94
  70. package/src/ui/RadioSelector.js +0 -51
  71. package/src/ui/STCPayButton.js +0 -94
  72. package/src/ui/StyledAlert.js +0 -30
  73. package/src/ui/TwitterButton.js +0 -84
  74. package/src/ui/VisaMasterButton.js +0 -94
  75. package/src/ui/WalletButton.js +0 -91
  76. package/storybook-static/0.54f7e52e.iframe.bundle.js +0 -1
  77. package/storybook-static/1.95be85dd.iframe.bundle.js.map +0 -1
  78. package/storybook-static/2.eb601582.iframe.bundle.js +0 -1
  79. package/storybook-static/8.68cd1217.iframe.bundle.js.map +0 -1
  80. package/storybook-static/main.044648aa.iframe.bundle.js +0 -1
  81. package/storybook-static/runtime~main.3e280e98.iframe.bundle.js +0 -1
  82. package/storybook-static/vendors~main.d75dc38b.iframe.bundle.js +0 -76
  83. package/storybook-static/vendors~main.d75dc38b.iframe.bundle.js.map +0 -1
@@ -5,7 +5,7 @@ import {
5
5
  SignInForm,
6
6
  SignUpForm
7
7
  } from "../../blocks/AuthForms";
8
- import { defaultTheme, HawaProvider } from "../../themes/HawaProvider";
8
+ import { HawaProvider } from "../../themes/HawaProvider";
9
9
 
10
10
  export default {
11
11
  title: "Blocks/AuthBlocks",
@@ -20,11 +20,11 @@ export default {
20
20
 
21
21
  const SignInTemplate = (args) => {
22
22
  return (
23
- <HawaProvider theme={{ ...defaultTheme }}>
23
+ <HawaProvider themeName={args.theme}>
24
24
  <SignInForm
25
25
  {...args}
26
- theme={args.theme}
27
- handleSignIn={() => console.log("singing in via email")}
26
+ error={args.showError}
27
+ handleSignIn={(e) => console.log("singing in via email", e)}
28
28
  viaGoogle={args.viaGoogle}
29
29
  googleButtonLabel={"Sign in with Google"}
30
30
  handleGoogleSignIn={() => console.log("signing in via google")}
@@ -44,15 +44,16 @@ SignIn.args = {
44
44
  viaGoogle: true,
45
45
  viaGithub: true,
46
46
  viaTwitter: true,
47
+ showError: false,
47
48
  theme: "primary"
48
49
  };
49
50
 
50
51
  const SignUpTemplate = (args) => {
51
52
  return (
52
- <HawaProvider theme={{ ...defaultTheme }}>
53
+ <HawaProvider themeName={args.theme}>
53
54
  <SignUpForm
54
55
  {...args}
55
- theme={args.theme}
56
+ error={args.showError}
56
57
  handleSignUp={() => console.log("singing up via email")}
57
58
  viaGoogle={args.viaGoogle}
58
59
  googleButtonLabel={"Sign up with Google"}
@@ -72,28 +73,33 @@ SignUp.args = {
72
73
  viaGoogle: true,
73
74
  viaGithub: true,
74
75
  viaTwitter: true,
76
+ showError: false,
75
77
  theme: "primary"
76
78
  };
77
79
 
78
80
  const ResetPasswordTemplate = (args) => {
79
81
  return (
80
- <HawaProvider theme={{ ...defaultTheme }}>
81
- <ResetPasswordForm theme={args.theme} {...args} />
82
+ <HawaProvider themeName={args.theme}>
83
+ <ResetPasswordForm error={args.showError} theme={args.theme} {...args} />
82
84
  </HawaProvider>
83
85
  );
84
86
  };
85
87
  export const ResetPassword = ResetPasswordTemplate.bind({});
86
88
  ResetPassword.args = {
87
- theme: "primary"
89
+ theme: "primary",
90
+ showError: false,
91
+ sent: false
88
92
  };
89
93
  const NewPasswordTemplate = (args) => {
90
94
  return (
91
- <HawaProvider theme={{ ...defaultTheme }}>
92
- <NewPasswordForm theme={args.theme} {...args} />
95
+ <HawaProvider themeName={args.theme}>
96
+ <NewPasswordForm error={args.showError} theme={args.theme} {...args} />
93
97
  </HawaProvider>
94
98
  );
95
99
  };
96
100
  export const NewPassword = NewPasswordTemplate.bind({});
97
101
  NewPassword.args = {
98
- theme: "primary"
102
+ theme: "primary",
103
+ showError: false,
104
+ passwordChanged: false
99
105
  };
@@ -1,5 +1,10 @@
1
1
  import React from "react";
2
- import { SelectPayment, CreditCardForm } from "../../blocks/Payment";
2
+ import {
3
+ SelectPayment,
4
+ CreditCardForm,
5
+ ChargeWalletForm,
6
+ PayWithWallet
7
+ } from "../../blocks/Payment";
3
8
  import { defaultTheme, HawaProvider } from "../../themes/HawaProvider";
4
9
 
5
10
  export default {
@@ -20,6 +25,7 @@ export default {
20
25
  args: {
21
26
  theme: "primary",
22
27
  viaWallet: true,
28
+ viaMada: true,
23
29
  viaApplePay: true,
24
30
  viaGooglePay: true,
25
31
  viaSTCPay: true,
@@ -30,10 +36,9 @@ export default {
30
36
 
31
37
  export const PaymentSelection = (args) => {
32
38
  return (
33
- <HawaProvider theme={{ ...defaultTheme }}>
39
+ <HawaProvider themeName={args.theme}>
34
40
  <SelectPayment
35
41
  {...args}
36
- theme={args.theme}
37
42
  walletLabel="Wallet Balance"
38
43
  handleWallet={() => console.log("paying via wallet")}
39
44
  visaMasterLabel="Credit Card"
@@ -56,24 +61,7 @@ export const PaymentSelection = (args) => {
56
61
  export const PayViaWallet = (args) => {
57
62
  return (
58
63
  <HawaProvider theme={{ ...defaultTheme }}>
59
- <SelectPayment
60
- {...args}
61
- theme={args.theme}
62
- walletLabel="Wallet Balance"
63
- handleWallet={() => console.log("paying via wallet")}
64
- visaMasterLabel="Credit Card"
65
- handleCreditCard={() => console.log("paying via Credit Card")}
66
- madaLabel="Mada"
67
- handleMada={() => console.log("paying via Mada")}
68
- paypalLabel="PayPal"
69
- handlePayPal={() => console.log("paying via PayPal")}
70
- applePayLabel="Apple Pay"
71
- handleApplePay={() => console.log("paying via Apple Pay")}
72
- googlePayLabel="Google Pay"
73
- handleGooglePay={() => console.log("paying via Google Pay")}
74
- stcPayLabel="STC Pay"
75
- handleSTCPay={() => console.log("paying via STC Pay")}
76
- />
64
+ <PayWithWallet theme={args.theme} />
77
65
  </HawaProvider>
78
66
  );
79
67
  };
@@ -87,25 +75,12 @@ export const PayViaCreditCard = (args) => {
87
75
 
88
76
  export const ChargeWallet = (args) => {
89
77
  return (
90
- <HawaProvider theme={{ ...defaultTheme }}>
91
- <SelectPayment
92
- {...args}
93
- theme={args.theme}
94
- walletLabel="Wallet Balance"
95
- handleWallet={() => console.log("paying via wallet")}
96
- visaMasterLabel="Credit Card"
97
- handleCreditCard={() => console.log("paying via Credit Card")}
98
- madaLabel="Mada"
99
- handleMada={() => console.log("paying via Mada")}
100
- paypalLabel="PayPal"
101
- handlePayPal={() => console.log("paying via PayPal")}
102
- applePayLabel="Apple Pay"
103
- handleApplePay={() => console.log("paying via Apple Pay")}
104
- googlePayLabel="Google Pay"
105
- handleGooglePay={() => console.log("paying via Google Pay")}
106
- stcPayLabel="STC Pay"
107
- handleSTCPay={() => console.log("paying via STC Pay")}
108
- />
78
+ <HawaProvider themeName={args.theme}>
79
+ <ChargeWalletForm currency="SAR" />
109
80
  </HawaProvider>
110
81
  );
111
82
  };
83
+
84
+ ChargeWallet.args = {
85
+ theme: "secondary"
86
+ };
@@ -0,0 +1,41 @@
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,14 +1,14 @@
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" />
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
12
 
13
13
  <style>{`
14
14
  .subheading {
@@ -54,6 +54,7 @@ import StackAlt from './assets/stackalt.svg';
54
54
  transition: background 150ms ease-out, border 150ms ease-out, transform 150ms ease-out;
55
55
  color: #333333;
56
56
  display: flex;
57
+ flex-direction:column;
57
58
  align-items: flex-start;
58
59
  }
59
60
 
@@ -114,16 +115,20 @@ import StackAlt from './assets/stackalt.svg';
114
115
 
115
116
  `}</style>
116
117
 
117
- # Welcome to Storybook
118
+ # Welcome to Hawa
119
+
120
+ <div className="tip-wrapper">
121
+ <span className="tip">Notice</span>This page is still in progress
122
+ </div>
118
123
 
119
124
  Storybook helps you build UI components in isolation from your app's business logic, data, and context.
120
- That makes it easy to develop hard - to - reach states.Save these UI states as ** stories ** to revisit during development, testing, or QA.
125
+ That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA.
121
126
 
122
127
  Browse example stories now by navigating to them in the sidebar.
123
- View their code in the`src/stories` directory to learn how they work.
124
- We recommend building UIs with a[** component - driven **](https://componentdriven.org) process starting with atomic components and ending with pages.
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.
125
130
 
126
- <div className="subheading">Configure</div>
131
+ <div className="subheading">Structure</div>
127
132
 
128
133
  <div className="link-list">
129
134
  <a
@@ -131,7 +136,8 @@ We recommend building UIs with a[** component - driven **](https://componentdriv
131
136
  href="https://storybook.js.org/docs/react/addons/addon-types"
132
137
  target="_blank"
133
138
  >
134
- <img src={Plugin} alt="plugin" />
139
+ {/* <img src={Plugin} alt="plugin" /> */}
140
+ <h3>Layout</h3>
135
141
  <span>
136
142
  <strong>Presets for popular tools</strong>
137
143
  Easy setup for TypeScript, SCSS and more.
@@ -142,18 +148,21 @@ We recommend building UIs with a[** component - driven **](https://componentdriv
142
148
  href="https://storybook.js.org/docs/react/configure/webpack"
143
149
  target="_blank"
144
150
  >
145
- <img src={StackAlt} alt="Build" />
151
+ {/* <img src={StackAlt} alt="Build" /> */}
152
+ <h3>Blocks</h3>
146
153
  <span>
147
154
  <strong>Build configuration</strong>
148
155
  How to customize webpack and Babel
149
156
  </span>
157
+
150
158
  </a>
151
159
  <a
152
160
  className="link-item"
153
161
  href="https://storybook.js.org/docs/react/configure/styling-and-css"
154
162
  target="_blank"
155
163
  >
156
- <img src={Colors} alt="colors" />
164
+ {/* <img src={Colors} alt="colors" /> */}
165
+ <h3>Elements</h3>
157
166
  <span>
158
167
  <strong>Styling</strong>
159
168
  How to load and configure CSS libraries
@@ -164,7 +173,8 @@ We recommend building UIs with a[** component - driven **](https://componentdriv
164
173
  href="https://storybook.js.org/docs/react/get-started/setup#configure-storybook-for-your-stack"
165
174
  target="_blank"
166
175
  >
167
- <img src={Flow} alt="flow" />
176
+ {/* <img src={Flow} alt="flow" /> */}
177
+ <h3>UI</h3>
168
178
  <span>
169
179
  <strong>Data</strong>
170
180
  Providers and mocking for data libraries
@@ -176,28 +186,36 @@ We recommend building UIs with a[** component - driven **](https://componentdriv
176
186
 
177
187
  <div className="link-list">
178
188
  <a className="link-item" href="https://storybook.js.org/docs" target="_blank">
179
- <img src={Repo} alt="repo" />
189
+ {/* <img src={Repo} alt="repo" /> */}
180
190
  <span>
181
191
  <strong>Storybook documentation</strong>
182
192
  Configure, customize, and extend
183
193
  </span>
184
194
  </a>
185
- <a className="link-item" href="https://storybook.js.org/tutorials/" target="_blank">
186
- <img src={Direction} alt="direction" />
195
+ <a
196
+ className="link-item"
197
+ href="https://storybook.js.org/tutorials/"
198
+ target="_blank"
199
+ >
200
+ {/* <img src={Direction} alt="direction" /> */}
187
201
  <span>
188
202
  <strong>In-depth guides</strong>
189
203
  Best practices from leading teams
190
204
  </span>
191
205
  </a>
192
- <a className="link-item" href="https://github.com/storybookjs/storybook" target="_blank">
193
- <img src={Code} alt="code" />
206
+ <a
207
+ className="link-item"
208
+ href="https://github.com/storybookjs/storybook"
209
+ target="_blank"
210
+ >
211
+ {/* <img src={Code} alt="code" /> */}
194
212
  <span>
195
213
  <strong>GitHub project</strong>
196
214
  View the source and add issues
197
215
  </span>
198
216
  </a>
199
217
  <a className="link-item" href="https://discord.gg/storybook" target="_blank">
200
- <img src={Comments} alt="comments" />
218
+ {/* <img src={Comments} alt="comments" /> */}
201
219
  <span>
202
220
  <strong>Discord chat</strong>
203
221
  Chat with maintainers and the community
@@ -206,6 +224,6 @@ We recommend building UIs with a[** component - driven **](https://componentdriv
206
224
  </div>
207
225
 
208
226
  <div className="tip-wrapper">
209
- <span className="tip">Tip</span>Edit the Markdown in{' '}
227
+ <span className="tip">Tip</span>Edit the Markdown in{" "}
210
228
  <code>src/stories/Introduction.stories.mdx</code>
211
229
  </div>
@@ -7,14 +7,14 @@ const theme = {
7
7
 
8
8
  const Template = (args) => {
9
9
  return (
10
- <HawaProvider size={args.size} theme={{ ...defaultTheme, ...args.theme }}>
11
- <Box themeType="primary">Box 1</Box>
12
- <Box themeType="secondary">
10
+ <HawaProvider size={args.size} themeName={"secondary"}>
11
+ <Box>Box 1</Box>
12
+ <Box>
13
13
  <div style={{ backgroundColor: "white", padding: 10, color: "black" }}>
14
14
  testing box in box
15
15
  </div>
16
16
  </Box>
17
- <Box themeType="secondary">Box 3</Box>
17
+ <Box>Box 3</Box>
18
18
  </HawaProvider>
19
19
  );
20
20
  };
@@ -1,37 +1,24 @@
1
1
  import React from "react";
2
-
3
- import { defaultTheme, HawaProvider } from "../themes/HawaProvider";
4
- import { ActionButton } from "../ui";
5
-
6
- const Template = (args) => {
7
- return (
8
- <HawaProvider theme={{ ...defaultTheme }}>
9
- <ActionButton themeType={args.theme} text={args.buttonLabel} />
10
- </HawaProvider>
11
- );
12
- };
13
- //types:
14
- //error (red)
15
- //warning (red)
16
- //notice (blue)
2
+ import { HawaProvider } from "../../themes/HawaProvider";
3
+ import { ActionButton } from "../../ui";
17
4
 
18
5
  export default {
19
- title: "UI/ActionButton",
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
+ };
@@ -0,0 +1,81 @@
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
+ };
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+
3
+ import { defaultTheme, HawaProvider } from "../../themes/HawaProvider";
4
+ import { HawaAlert } from "../../ui";
5
+
6
+ const Template = (args) => {
7
+ return (
8
+ <HawaProvider themeName={args.theme}>
9
+ <HawaAlert
10
+ title="What?"
11
+ text="This is a success alert"
12
+ severity="success"
13
+ />
14
+ <HawaAlert text="This is an info alert" severity="info" />
15
+ <HawaAlert text="This is a warning alert" severity="warning" />
16
+ <HawaAlert text="This is an error alert" severity="error" />
17
+ </HawaProvider>
18
+ );
19
+ };
20
+ //types:
21
+ //error (red)
22
+ //warning (red)
23
+ //notice (blue)
24
+
25
+ export default {
26
+ title: "UI/Alert",
27
+ component: HawaAlert,
28
+ argTypes: {
29
+ theme: {
30
+ options: ["primary", "secondary", "default"],
31
+ control: { type: "select" }
32
+ }
33
+ },
34
+ args: {
35
+ theme: "primary"
36
+ }
37
+ };
38
+
39
+ export const Default = Template.bind({});
40
+ Default.args = {
41
+ theme: "primary"
42
+ };
@@ -1,14 +1,13 @@
1
1
  import React from "react";
2
- import { StyledCheckbox } from "../ui";
3
- import "../styles.css";
2
+ import { HawaCheckbox } from "../../ui";
4
3
 
5
4
  const Template = (args) => {
6
- return <StyledCheckbox {...args} />;
5
+ return <HawaCheckbox {...args} />;
7
6
  };
8
7
 
9
8
  export default {
10
9
  title: "UI/Checkbox",
11
- component: Light,
10
+ component: HawaCheckbox,
12
11
  argsTypes: {
13
12
  defaultValue: {
14
13
  options: [true, false],
@@ -0,0 +1,13 @@
1
+ import { storiesOf } from "@storybook/react";
2
+ import { HawaInputLabel } from "../../ui";
3
+
4
+ export default {
5
+ title: "Components/InputLabel",
6
+ component: [HawaInputLabel],
7
+ argTypes: {
8
+ resize: {
9
+ options: ["vertical", "horizontal", "both"],
10
+ control: { type: "radio" }
11
+ }
12
+ }
13
+ };