@sikka/hawa 0.0.10 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/es/index.es.js +1 -1
  2. package/lib/index.js +1 -1
  3. package/package.json +5 -4
  4. package/src/blocks/Account/UserProfileForm.js +79 -0
  5. package/src/blocks/Account/UserSettingsForm.js +13 -0
  6. package/src/blocks/Account/index.js +2 -2
  7. package/src/blocks/AuthForms/NewPasswordForm.js +58 -86
  8. package/src/blocks/AuthForms/ResetPasswordForm.js +44 -43
  9. package/src/blocks/AuthForms/SignInForm.js +99 -103
  10. package/src/blocks/AuthForms/SignUpForm.js +106 -104
  11. package/src/blocks/Payment/ChargeWalletForm.js +40 -37
  12. package/src/blocks/Payment/CreditCardForm.js +50 -45
  13. package/src/blocks/Payment/PayWithWallet.js +17 -7
  14. package/src/blocks/Payment/PaymentMethod.js +0 -1
  15. package/src/blocks/Payment/SelectPayment.js +54 -56
  16. package/src/blocks/Pricing/SignInForm.js +126 -0
  17. package/src/elements/ActionButton.js +38 -0
  18. package/src/elements/AdaptiveButton.js +32 -0
  19. package/src/{ui → elements}/AutoCompleteField.js +0 -0
  20. package/src/{ui → elements}/DragDropImages.js +0 -0
  21. package/src/{ui → elements}/Hawa.js +0 -0
  22. package/src/elements/HawaAlert.js +35 -0
  23. package/src/elements/HawaButton.js +47 -0
  24. package/src/elements/HawaCard.js +77 -0
  25. package/src/{ui → elements}/HawaCheckbox.js +0 -0
  26. package/src/elements/HawaInputLabel.js +31 -0
  27. package/src/{ui → elements}/HawaLogoButton.js +7 -45
  28. package/src/elements/HawaRadio.js +32 -0
  29. package/src/elements/HawaSettingsRow.js +27 -0
  30. package/src/elements/HawaSwitch.js +6 -0
  31. package/src/{ui → elements}/HawaTextArea.js +1 -1
  32. package/src/elements/HawaTextField.js +160 -0
  33. package/src/elements/HawaTypography.js +26 -0
  34. package/src/{ui → elements}/RadioBox.js +0 -0
  35. package/src/{ui → elements}/Row.js +1 -1
  36. package/src/{ui → elements}/SelectedField.js +0 -0
  37. package/src/{ui → elements}/StyledTooltip.js +1 -1
  38. package/src/{ui → elements}/TabPanel.js +1 -1
  39. package/src/{ui → elements}/index.js +1 -1
  40. package/src/index.js +0 -2
  41. package/src/layout/Box.js +36 -33
  42. package/src/stories/BlocksStories/Account/UserProfile.stories.js +21 -0
  43. package/src/stories/BlocksStories/Account/UserSettings.stories.js +55 -0
  44. package/src/stories/BlocksStories/Auth/NewPassword.stories.js +60 -0
  45. package/src/stories/BlocksStories/Auth/ResetPassword.stories.js +59 -0
  46. package/src/stories/BlocksStories/Auth/SignIn.stories.js +89 -0
  47. package/src/stories/BlocksStories/Auth/SignUp.stories.js +90 -0
  48. package/src/stories/BlocksStories/Payment/ChargeWallet.stories.js +30 -0
  49. package/src/stories/BlocksStories/Payment/PayWithCreditCard.stories.js +37 -0
  50. package/src/stories/BlocksStories/Payment/PayWithWallet.stories.js +17 -0
  51. package/src/stories/BlocksStories/Payment/PaymentSelection.stories.js +60 -0
  52. package/src/stories/ElementsStories/AdaptiveButton.stories.js +51 -0
  53. package/src/stories/{UIStories → ElementsStories}/Alert.stories.js +3 -4
  54. package/src/stories/{UIStories → ElementsStories}/InputLabel.stories.js +1 -1
  55. package/src/stories/ElementsStories/ItemCard.stories.js +18 -0
  56. package/src/stories/ElementsStories/LogoButtons.stories.js +73 -0
  57. package/src/stories/ElementsStories/PricingCard.stories.js +27 -0
  58. package/src/stories/ElementsStories/RadioSelector.stories.js +36 -0
  59. package/src/stories/ElementsStories/SettingsRow.stories.js +63 -0
  60. package/src/stories/{UIStories → ElementsStories}/TextField.stories.js +1 -1
  61. package/src/stories/LayoutStories/Box.stories.js +11 -31
  62. package/storybook-static/8.1bf48ea7.iframe.bundle.js +1 -0
  63. package/storybook-static/iframe.html +1 -1
  64. package/storybook-static/index.html +1 -1
  65. package/storybook-static/main.00b064cb.iframe.bundle.js +1 -0
  66. package/storybook-static/{runtime~main.cfefe972.iframe.bundle.js → runtime~main.f1ebae9b.iframe.bundle.js} +1 -1
  67. package/storybook-static/vendors~main.5eab66d3.iframe.bundle.js +76 -0
  68. package/storybook-static/{vendors~main.aa1d952a.iframe.bundle.js.LICENSE.txt → vendors~main.5eab66d3.iframe.bundle.js.LICENSE.txt} +0 -0
  69. package/storybook-static/vendors~main.5eab66d3.iframe.bundle.js.map +1 -0
  70. package/src/blocks/Account/UserProfile.js +0 -65
  71. package/src/blocks/Account/UserSettings.js +0 -15
  72. package/src/stories/BlocksStories/AuthForm.stories.js +0 -105
  73. package/src/stories/BlocksStories/PaymentForm.stories.js +0 -86
  74. package/src/stories/BlocksStories/UserForm.stories.js +0 -41
  75. package/src/stories/HawaProvider.stories.js +0 -22
  76. package/src/stories/UIStories/ActionButton.stories.js +0 -46
  77. package/src/stories/UIStories/AdaptiveButton.stories.js +0 -81
  78. package/src/stories/UIStories/CheckBox.stories.js +0 -34
  79. package/src/stories/UIStories/LogoButtons.stories.js +0 -90
  80. package/src/stories/UIStories/RadioSelector.stories.js +0 -53
  81. package/src/stories/UIStories/SettingsRow.stories.js +0 -64
  82. package/src/themes/HawaProvider.js +0 -183
  83. package/src/ui/ActionButton.js +0 -41
  84. package/src/ui/AdaptiveButton.js +0 -136
  85. package/src/ui/HawaAlert.js +0 -37
  86. package/src/ui/HawaButton.js +0 -48
  87. package/src/ui/HawaInputLabel.js +0 -32
  88. package/src/ui/HawaRadio.js +0 -73
  89. package/src/ui/HawaSettingsRow.js +0 -71
  90. package/src/ui/HawaTextField.js +0 -107
  91. package/src/ui/HawaTypography.js +0 -28
  92. package/storybook-static/8.c4cb6081.iframe.bundle.js +0 -1
  93. package/storybook-static/main.5731dbe3.iframe.bundle.js +0 -1
  94. package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js +0 -76
  95. package/storybook-static/vendors~main.aa1d952a.iframe.bundle.js.map +0 -1
@@ -1,64 +0,0 @@
1
- import React from "react";
2
- import {
3
- SelectPayment,
4
- CreditCardForm,
5
- ChargeWalletForm,
6
- PayWithWallet
7
- } from "../../blocks/Payment";
8
- import { defaultTheme, HawaProvider } from "../../themes/HawaProvider";
9
- import { HawaSettingsRow } from "../../ui";
10
-
11
- export default {
12
- title: "UI/SettingsRow",
13
- component: [SelectPayment, CreditCardForm],
14
- argTypes: {
15
- theme: {
16
- options: ["primary", "secondary", "default"],
17
- control: { type: "select" }
18
- },
19
- type: {
20
- options: ["checkbox", "text", "default"],
21
- control: { type: "select" }
22
- }
23
- },
24
- args: {
25
- theme: "primary",
26
- type: "checkbox"
27
- }
28
- };
29
-
30
- const HawaSettingsRowTemplate = (args) => {
31
- return (
32
- <HawaProvider themeName={args.theme}>
33
- <HawaSettingsRow settingsType={args.type} />
34
- </HawaProvider>
35
- );
36
- };
37
-
38
- export const Checkbox = HawaSettingsRowTemplate.bind({});
39
- Checkbox.args = {
40
- theme: "primary",
41
- type: "checkbox"
42
- };
43
- export const Text = (args) => {
44
- return (
45
- <HawaProvider themeName={args.theme}>
46
- <HawaSettingsRow settingsType={args.type} />
47
- </HawaProvider>
48
- );
49
- };
50
- Text.args = {
51
- theme: "primary",
52
- type: "text"
53
- };
54
- export const Radio = (args) => {
55
- return (
56
- <HawaProvider themeName={args.theme}>
57
- <HawaSettingsRow settingsType={args.type} />
58
- </HawaProvider>
59
- );
60
- };
61
- Radio.args = {
62
- theme: "primary",
63
- type: "radio"
64
- };
@@ -1,183 +0,0 @@
1
- import { createContext } from "react";
2
-
3
- //make the text color of the action buttons different from the text color of the layout
4
- let allPrimaryBG = "#f90900";
5
- let allPrimaryAction = "#B20D30";
6
- export const defaultTheme = {
7
- allPrimaryBG: "#f90900",
8
- allPrimaryAction: "#138A36",
9
- allBorderRadius: 10,
10
- borderRadius: 10,
11
- primaryColor: "blue",
12
- secondaryColor: "grey",
13
- // primaryActionColor: '#f72585', //Colors of the buttons
14
- primaryActionColor: "grey", //Colors of the buttons
15
- secondaryActionColor: "#4cc9f0", //Colors of the buttons
16
- layoutColor: "#d3d4d9", //Colors of boxes and cards
17
- textColor: "black", //Colors of text everywhere
18
- inputColor: "white", //Color of input fields
19
- lightBackground: "#FBF5F3", //
20
- darkBackground: "#0F0E0E",
21
- testcolor: "green",
22
- margins: 10,
23
- paddings: 10,
24
- typography: {
25
- fontFamily: ["IBMPlex"].join(","),
26
- primary: { color: "black" },
27
- secondary: { color: "white" }
28
- },
29
- logoButton: {
30
- primary: {
31
- borderRadius: 10,
32
- backgroundColor: allPrimaryAction,
33
- // margin: 10,
34
- marginTop: 10,
35
- padding: 30,
36
- paddingTop: 0,
37
- paddingBottom: 0,
38
- border: "1px solid #ced4da",
39
- height: 50,
40
- "&:focus": {
41
- borderColor: allPrimaryAction
42
- }
43
- },
44
- secondary: {
45
- borderRadius: 10,
46
- backgroundColor: "#f90900",
47
- marginTop: 10,
48
- padding: 30,
49
- paddingTop: 0,
50
- paddingBottom: 0,
51
- border: "1px solid #ced4da",
52
- height: 50,
53
- "&:focus": {
54
- borderColor: "green"
55
- }
56
- }
57
- },
58
- actionButton: {
59
- primary: {
60
- borderRadius: 10,
61
- // backgroundColor: "#f90900",
62
- backgroundColor: allPrimaryAction,
63
- color: "white",
64
- margin: 10,
65
- padding: 10,
66
- border: "1px solid #ced4da",
67
- fontSize: 16,
68
- height: 50,
69
- "&:focus": {
70
- borderColor: "red"
71
- }
72
- },
73
- secondary: {
74
- borderRadius: 10,
75
- margin: 10,
76
- padding: 10,
77
- backgroundColor: "#FF8811",
78
- color: "black"
79
- }
80
- },
81
- layout: {
82
- primary: {
83
- backgroundColor: "#d3d4d9",
84
- color: "black",
85
- margin: 10,
86
- padding: 10,
87
- borderRadius: 10
88
- },
89
- secondary: {
90
- backgroundColor: "#001E3C",
91
- // backgroundColor: "red",
92
- color: "white",
93
- margin: 10,
94
- padding: 10,
95
- borderRadius: 10
96
- }
97
- },
98
- inputFields: {
99
- primary: {
100
- backgroundColor: "white",
101
- borderRadius: 10,
102
- "&:focus": {
103
- borderColor: "red",
104
- borderWidth: 1,
105
- border: "1px solid black"
106
- },
107
- "&:hover": {
108
- borderColor: "red",
109
- borderWidth: 1,
110
- border: "1px solid black"
111
- }
112
- },
113
- secondary: {
114
- backgroundColor: "white",
115
-
116
- borderRadius: 10
117
- }
118
- },
119
- alerts: {
120
- primary: {
121
- marginBottom: 10,
122
- padding: 10,
123
- borderRadius: 10
124
- },
125
- secondary: {
126
- marginBottom: 10,
127
- padding: 10,
128
- borderRadius: 10
129
- }
130
- },
131
- settingsRow: {
132
- primary: {
133
- display: "flex",
134
- flexDirection: "row",
135
- justifyContent: "space-between",
136
- alignItems: "center",
137
- backgroundColor: "#F5F5F5",
138
- margin: 0,
139
- padding: 10,
140
- borderRadius: 10
141
- },
142
- secondary: {
143
- display: "flex",
144
- flexDirection: "row",
145
- justifyContent: "space-between",
146
- alignItems: "center",
147
- backgroundColor: "blue",
148
- margin: 0,
149
- padding: 5,
150
- borderRadius: 10
151
- }
152
- },
153
- radioSelector: {
154
- primary: {
155
- padding: 10,
156
- borderRadius: 10
157
- },
158
- secondary: {
159
- padding: 10,
160
- borderRadius: 10
161
- }
162
- }
163
- };
164
-
165
- export const ThemeProvider = createContext(defaultTheme);
166
-
167
- export const HawaProvider = ({ theme, ...props }) => {
168
- console.log("theme is ", theme);
169
- if (props.size === "large") {
170
- theme = {
171
- ...theme,
172
- paddings: 20,
173
- margins: 20
174
- };
175
- }
176
- return (
177
- <ThemeProvider.Provider
178
- value={{ hawaTheme: defaultTheme, themeName: props.themeName }}
179
- >
180
- {props.children}
181
- </ThemeProvider.Provider>
182
- );
183
- };
@@ -1,41 +0,0 @@
1
- import Button from "@mui/material/Button";
2
- import { useContext } from "react";
3
- import { ThemeProvider } from "../themes/HawaProvider";
4
- import { styled, darken } from "@mui/material/styles";
5
-
6
- export const ActionButton = (props) => {
7
- const { hawaTheme, themeName } = useContext(ThemeProvider);
8
- const currentTheme = Object.keys(hawaTheme.actionButton).find(
9
- (tName) => tName.toLowerCase() === themeName?.toLowerCase()
10
- );
11
- let actionButtonStyle = {};
12
-
13
- if (currentTheme) {
14
- actionButtonStyle = {
15
- ...hawaTheme.actionButton[currentTheme],
16
- margin: props.last ? 0 : hawaTheme.actionButton[currentTheme].margin,
17
- marginTop: props.last
18
- ? hawaTheme.actionButton[currentTheme].margin * 2
19
- : 0,
20
- "&:hover": {
21
- backgroundColor: darken(
22
- hawaTheme.actionButton[currentTheme]?.backgroundColor,
23
- 0.1
24
- )
25
- }
26
- };
27
- } else {
28
- actionButtonStyle = {
29
- backgroundColor: "black",
30
- color: "white",
31
- padding: 10,
32
- marginTop: props.last ? 10 * 2 : 0,
33
- borderRadius: 0
34
- };
35
- }
36
-
37
- const StyledButton = styled(Button)(({ theme }) => {
38
- return { ...actionButtonStyle };
39
- });
40
- return <StyledButton {...props}>{props.text}</StyledButton>;
41
- };
@@ -1,136 +0,0 @@
1
- import React, { useState, useContext } from "react";
2
- import Button from "@mui/material/Button";
3
- import Tooltip from "@mui/material/Tooltip";
4
- import PropTypes from "prop-types";
5
- import { ThemeProvider } from "../themes/HawaProvider";
6
- import { StyledTooltip } from "./StyledTooltip";
7
- import { getTextColor } from "../util";
8
-
9
- export const AdaptiveButton = (props) => {
10
- const { showText } = props;
11
- const theme = useContext(ThemeProvider);
12
- const screenSize = {
13
- width: 1500,
14
- height: 200
15
- };
16
- const [tooltip, setTooltip] = useState(false);
17
- const [hovered, setHovered] = useState(false);
18
- //full button
19
- if (showText) {
20
- return (
21
- <Button
22
- disableRipple
23
- disabled={props.disabled}
24
- aria-label={props.buttonLabel}
25
- color={props.danger ? "secondary" : "primary"}
26
- onClick={props.handleClick}
27
- style={{
28
- backgroundColor: theme.primaryColor,
29
- borderRadius: theme.borderRadius,
30
- padding: theme.paddings,
31
- color: getTextColor(theme.primaryColor)
32
- // color: hovered
33
- // ? "#ffffff"
34
- // : props.danger
35
- // ? "#f50057"
36
- // : "var(--blue)"
37
- }}
38
- >
39
- {props.icon}
40
- {props.showText ? (
41
- <span style={{ marginLeft: props.icon ? 5 : 0 }}>
42
- {props.buttonLabel}
43
- </span>
44
- ) : null}
45
- </Button>
46
- );
47
- } else if (props.buttonLabelOnly) {
48
- return (
49
- <>
50
- <Tooltip
51
- placement={screenSize.width > 400 ? "bottom-center" : "top-center"}
52
- enterTouchDelay={100}
53
- title={
54
- props.hint ? (
55
- props.hint
56
- ) : (
57
- <div>
58
- <div
59
- style={{
60
- fontSize: 20,
61
- fontWeight: 800,
62
- padding: 10,
63
- paddingBottom: 5,
64
- textAlign: "center"
65
- }}
66
- >
67
- {props.hintTitle}
68
- </div>
69
- <div
70
- style={{
71
- fontSize: 13,
72
- fontWeight: 100,
73
- padding: 10,
74
- textAlign: "center"
75
- }}
76
- >
77
- {props.hintContent}
78
- </div>
79
- </div>
80
- )
81
- }
82
- >
83
- <Button
84
- disabled={props.disabled}
85
- size="small"
86
- disableRipple
87
- aria-label={props.buttonLabel}
88
- onClick={props.handleClick}
89
- color={props.danger ? "secondary" : "primary"}
90
- style={{
91
- padding: 10,
92
- color: hovered
93
- ? "#ffffff"
94
- : props.danger
95
- ? "#f50057"
96
- : "var(--blue)"
97
- }}
98
- >
99
- {props.buttonLabel}
100
- </Button>
101
- </Tooltip>
102
- </>
103
- );
104
- } else {
105
- //icon only
106
- return (
107
- <StyledTooltip hintTitle="Example" hintContent="More explaination here">
108
- <Button
109
- disabled={props.disabled}
110
- size="small"
111
- disableRipple
112
- aria-label={props.buttonLabel}
113
- onClick={props.handleClick}
114
- color={props.danger ? "secondary" : "primary"}
115
- style={{
116
- padding: 10,
117
- color: hovered
118
- ? "#ffffff"
119
- : props.danger
120
- ? "#f50057"
121
- : "var(--blue)"
122
- }}
123
- >
124
- {props.icon}
125
- </Button>
126
- </StyledTooltip>
127
- );
128
- }
129
- };
130
-
131
- AdaptiveButton.propTypes = {
132
- buttonLabel: PropTypes.string,
133
- danger: PropTypes.bool,
134
- disabled: PropTypes.bool,
135
- showText: PropTypes.bool
136
- };
@@ -1,37 +0,0 @@
1
- import React, { useContext } from "react";
2
- import { ThemeProvider } from "../themes/HawaProvider";
3
- import { styled } from "@mui/material/styles";
4
-
5
- import Alert from "@mui/material/Alert";
6
- import AlertTitle from "@mui/material/AlertTitle";
7
-
8
- export const HawaAlert = (props) => {
9
- const { hawaTheme, themeName } = useContext(ThemeProvider);
10
- const currentTheme = Object.keys(hawaTheme.alerts).find(
11
- (tName) => tName.toLowerCase() === themeName?.toLowerCase()
12
- );
13
- let alertStyle = {};
14
-
15
- if (currentTheme) {
16
- alertStyle = {
17
- ...hawaTheme.alerts[currentTheme]
18
- };
19
- } else {
20
- alertStyle = {
21
- marginBottom: 10
22
- };
23
- }
24
-
25
- const StyledAlert = styled(Alert)(({ theme }) => {
26
- return {
27
- ...alertStyle
28
- };
29
- });
30
-
31
- return (
32
- <StyledAlert {...props}>
33
- {props.title && <AlertTitle>{props.title}</AlertTitle>}
34
- {props.text}
35
- </StyledAlert>
36
- );
37
- };
@@ -1,48 +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 HawaButton = (props) => {
7
- const { hawaTheme, themeName } = useContext(ThemeProvider);
8
- let buttonStyle = {};
9
- let currentTheme = Object.keys(hawaTheme.actionButton).find(
10
- (tName) => tName.toLowerCase() === themeName?.toLowerCase()
11
- );
12
- if (currentTheme) {
13
- buttonStyle = {
14
- ...hawaTheme.actionButton[currentTheme],
15
- // marginTop: theme.actionButton[currentTheme].margin,
16
- border: props.outlined ? "2px solid black" : "none",
17
- // borderRadius: theme.actionButton[currentTheme].borderRadius,
18
- backgroundColor: "white",
19
- // height: 50,
20
- "&:hover": {
21
- backgroundColor: darken("#ffffff", 0.1)
22
- }
23
- };
24
- } else {
25
- // Default theme
26
- buttonStyle = {
27
- cursor: "pointer",
28
- display: "flex",
29
- flexDirection: "row",
30
- alignItems: "center",
31
- justifyContent: "center",
32
- marginTop: hawaTheme.actionButton[currentTheme]?.margin,
33
- border: props.outlined ? "2px solid black" : "none",
34
- borderRadius: 0,
35
- //backgroundColor: "white",
36
- backgroundColor: "red",
37
- "&:hover": {
38
- backgroundColor: darken("#ffffff", 0.1)
39
- }
40
- };
41
- }
42
- const StyledButton = styled(Button)(({ theme }) => {
43
- return {
44
- ...buttonStyle
45
- };
46
- });
47
- return <StyledButton {...props}>{props.children}</StyledButton>;
48
- };
@@ -1,32 +0,0 @@
1
- import InputLabel from "@mui/material/InputLabel";
2
- import { useContext } from "react";
3
- import { ThemeProvider } from "../themes/HawaProvider";
4
-
5
- export const HawaInputLabel = (props) => {
6
- const { hawaTheme, themeName } = useContext(ThemeProvider);
7
- let labelStyle = {};
8
-
9
- let currentTheme = Object.keys(hawaTheme.actionButton).find(
10
- (tName) => tName.toLowerCase() === themeName?.toLowerCase()
11
- );
12
- if (currentTheme) {
13
- labelStyle = {
14
- margin: 15,
15
- marginRight: 5,
16
- marginLeft: 5,
17
- color: hawaTheme?.layout[currentTheme].color
18
- };
19
- } else {
20
- labelStyle = {
21
- margin: 15,
22
- marginRight: 0,
23
- marginLeft: 0,
24
- color: "black"
25
- };
26
- }
27
- return (
28
- <InputLabel style={labelStyle}>
29
- <div style={{ fontSize: 15 }}>{props.label}</div>
30
- </InputLabel>
31
- );
32
- };
@@ -1,73 +0,0 @@
1
- import { Typography } from "@mui/material";
2
- import React, { useState, useContext } from "react";
3
- import { Box } from "../layout";
4
- import { ThemeProvider } from "../themes/HawaProvider";
5
-
6
- export const HawaRadio = (props) => {
7
- const [value, setValue] = useState(props.defaultValue);
8
-
9
- const { hawaTheme, themeName } = useContext(ThemeProvider);
10
- const currentTheme = Object.keys(hawaTheme.radioSelector).find(
11
- (tName) => tName.toLowerCase() === themeName?.toLowerCase()
12
- );
13
- let radioSelectorStyle = {};
14
-
15
- if (currentTheme) {
16
- radioSelectorStyle = {
17
- ...hawaTheme.radioSelector[currentTheme],
18
- "-moz-user-select": "-moz-none",
19
- "-khtml-user-select": "none",
20
- "-webkit-user-select": "none",
21
- "-ms-user-select": "none",
22
- "user-select": "none"
23
- };
24
- } else {
25
- radioSelectorStyle = {
26
- display: "flex",
27
- flexDirection: "row",
28
- justifyContent: "space-between",
29
- alignItems: "center",
30
- backgroundColor: "#F5F5F5",
31
- margin: 0,
32
-
33
- backgroundColor: "lightGrey",
34
- color: "black",
35
- padding: 10
36
- };
37
- }
38
-
39
- return (
40
- <Box horizontal maxWidth={"fit-content"}>
41
- {props.options.map((singleOption) => {
42
- return (
43
- <div
44
- key={singleOption.label}
45
- onClick={() => {
46
- setValue(singleOption.label);
47
- if (props.handleChange) {
48
- props.handleChange();
49
- }
50
- }}
51
- style={{
52
- ...radioSelectorStyle,
53
- backgroundColor:
54
- value.toLowerCase() === singleOption.label.toLowerCase()
55
- ? currentTheme
56
- ? hawaTheme.actionButton[currentTheme]?.backgroundColor
57
- : "black"
58
- : hawaTheme?.layout[currentTheme]?.backgroundColor,
59
- color:
60
- value.toLowerCase() === singleOption.label.toLowerCase()
61
- ? hawaTheme.actionButton[currentTheme]?.color
62
- : currentTheme
63
- ? hawaTheme?.layout[currentTheme]?.color
64
- : "black"
65
- }}
66
- >
67
- <Typography>{singleOption.text}</Typography>
68
- </div>
69
- );
70
- })}
71
- </Box>
72
- );
73
- };
@@ -1,71 +0,0 @@
1
- import React, { useContext } from "react";
2
-
3
- import PropTypes from "prop-types";
4
- import { ThemeProvider } from "../themes/HawaProvider";
5
- import { Box } from "../layout";
6
- import Checkbox from "@mui/material/Checkbox";
7
- import TextField from "@mui/material/TextField";
8
- import { HawaTypography } from "./HawaTypography";
9
- export const HawaSettingsRow = (props) => {
10
- const { hawaTheme, themeName } = useContext(ThemeProvider);
11
- const currentTheme = Object.keys(hawaTheme.settingsRow).find(
12
- (tName) => tName.toLowerCase() === themeName?.toLowerCase()
13
- );
14
- let settingsRowStyle = {};
15
-
16
- if (currentTheme) {
17
- settingsRowStyle = {
18
- ...hawaTheme.settingsRow[currentTheme],
19
- margin: props.last ? 0 : hawaTheme.settingsRow[currentTheme].margin,
20
- marginTop: props.last ? hawaTheme.settingsRow[currentTheme].margin * 2 : 0
21
- };
22
- } else {
23
- settingsRowStyle = {
24
- display: "flex",
25
- flexDirection: "row",
26
- justifyContent: "space-between",
27
- alignItems: "center",
28
- backgroundColor: "#F5F5F5",
29
- margin: 0,
30
-
31
- backgroundColor: "lightGrey",
32
- color: "black",
33
- padding: 10
34
- };
35
- }
36
-
37
- return (
38
- <Box noColor>
39
- {props.settingsType === "checkbox" && (
40
- <div style={{ ...settingsRowStyle }}>
41
- <HawaTypography>Checkbox Label</HawaTypography> <Checkbox />
42
- </div>
43
- )}
44
- {props.settingsType === "text" && (
45
- <div style={{ ...settingsRowStyle }}>
46
- Text Label{" "}
47
- <TextField
48
- InputProps={{
49
- style: {
50
- ...hawaTheme.inputFields[currentTheme],
51
- // borderRadius: 0,
52
- // padding: 0,
53
- // backgroundColor: "white",
54
- height: 40
55
- }
56
- }}
57
- style={{
58
- padding: 0
59
- }}
60
- placeholder="test"
61
- />
62
- </div>
63
- )}
64
- </Box>
65
- );
66
- };
67
-
68
- HawaSettingsRow.propTypes = {
69
- type: PropTypes.oneOf(["text", "number", "password"]),
70
- helperText: PropTypes.string
71
- };