@sikka/hawa 0.0.211 → 0.0.213
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/dist/styles.css +49 -59
- package/es/blocks/Misc/Newsletter.d.ts +1 -0
- package/es/blocks/Misc/NotFound.d.ts +5 -0
- package/es/blocks/Pricing/ComparingPlans.d.ts +1 -0
- package/es/elements/HawaPanelTabs.d.ts +4 -1
- package/es/elements/HawaRange.d.ts +1 -1
- package/es/elements/HawaSelect.d.ts +5 -5
- package/es/elements/HawaSettingsRow.d.ts +1 -1
- package/es/elements/HawaSwitch.d.ts +1 -0
- package/es/elements/InvoiceAccordion.d.ts +4 -4
- package/es/index.es.js +1 -1
- package/es/layout/AppSidebar.d.ts +1 -1
- package/lib/blocks/Misc/Newsletter.d.ts +1 -0
- package/lib/blocks/Misc/NotFound.d.ts +5 -0
- package/lib/blocks/Pricing/ComparingPlans.d.ts +1 -0
- package/lib/elements/HawaPanelTabs.d.ts +4 -1
- package/lib/elements/HawaRange.d.ts +1 -1
- package/lib/elements/HawaSelect.d.ts +5 -5
- package/lib/elements/HawaSettingsRow.d.ts +1 -1
- package/lib/elements/HawaSwitch.d.ts +1 -0
- package/lib/elements/InvoiceAccordion.d.ts +4 -4
- package/lib/index.js +1 -1
- package/lib/layout/AppSidebar.d.ts +1 -1
- package/package.json +1 -1
- package/src/blocks/AuthForms/CodeConfirmation.tsx +1 -7
- package/src/blocks/Misc/EmptyState.tsx +1 -0
- package/src/blocks/Misc/Newsletter.tsx +8 -3
- package/src/blocks/Misc/NotFound.tsx +11 -3
- package/src/blocks/Payment/ChargeWalletForm.tsx +23 -14
- package/src/blocks/Payment/CheckoutForm.tsx +1 -14
- package/src/blocks/Payment/Confirmation.tsx +0 -1
- package/src/blocks/Payment/PayWithWallet.tsx +0 -1
- package/src/blocks/Payment/index.ts +6 -20
- package/src/blocks/Pricing/ComparingPlans.tsx +15 -10
- package/src/blocks/Pricing/PricingPlans.tsx +1 -0
- package/src/blocks/Referral/ReferralAccount.tsx +1 -1
- package/src/blocks/Referral/ReferralStats.tsx +0 -1
- package/src/elements/DragDropImages.tsx +156 -158
- package/src/elements/DraggableCard.tsx +2 -1
- package/src/elements/HawaAccordion.tsx +1 -1
- package/src/elements/HawaChip.tsx +2 -1
- package/src/elements/HawaColorPicker.tsx +3 -5
- package/src/elements/HawaItemCard.tsx +1 -2
- package/src/elements/HawaMenu.tsx +2 -3
- package/src/elements/HawaModal.tsx +1 -1
- package/src/elements/HawaPanelTabs.tsx +1 -7
- package/src/elements/HawaPricingCard.tsx +1 -7
- package/src/elements/HawaRadio.tsx +1 -1
- package/src/elements/HawaRange.tsx +1 -1
- package/src/elements/HawaSelect.tsx +38 -36
- package/src/elements/HawaSettingsRow.tsx +7 -5
- package/src/elements/HawaSnackbar.tsx +1 -1
- package/src/elements/HawaSpinner.tsx +2 -2
- package/src/elements/HawaSwitch.tsx +19 -2
- package/src/elements/HawaTable.tsx +3 -1
- package/src/elements/HawaTabs.tsx +2 -0
- package/src/elements/HawaTextField.tsx +1 -0
- package/src/elements/HawaTooltip.tsx +1 -3
- package/src/elements/InvoiceAccordion.tsx +5 -5
- package/src/layout/AppSidebar.tsx +1 -1
- package/src/layout/HawaAppLayout.tsx +5 -4
- package/src/layout/HawaContainer.tsx +0 -1
- package/src/layout/HawaSiteLayout.tsx +1 -3
- package/src/layout/SimpleGrid.tsx +2 -3
- package/src/styles.css +49 -59
- package/src/tailwind.css +4 -8
- package/tailwind.config.js +3 -1
|
@@ -29,178 +29,176 @@ export const DragDropImages: React.FunctionComponent<DragDropImagesTypes> = ({
|
|
|
29
29
|
files,
|
|
30
30
|
setFiles,
|
|
31
31
|
setDeletedFiles,
|
|
32
|
+
onAcceptedFiles,
|
|
33
|
+
errorMessages,
|
|
32
34
|
maxFiles,
|
|
33
35
|
accept,
|
|
34
|
-
onAcceptedFiles,
|
|
35
36
|
showPreview,
|
|
36
37
|
onDeleteFile,
|
|
37
38
|
onClearFiles,
|
|
38
39
|
maxSize,
|
|
39
|
-
errorMessages,
|
|
40
40
|
label,
|
|
41
|
-
}) =>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
preview: URL.createObjectURL(file),
|
|
63
|
-
})
|
|
64
|
-
)
|
|
41
|
+
}) => {
|
|
42
|
+
const [cmp, setCmp] = useState(0)
|
|
43
|
+
const [max, setMax] = useState<any>(0)
|
|
44
|
+
//const [thumbs, setThumbs] = useState("");
|
|
45
|
+
const {
|
|
46
|
+
getRootProps,
|
|
47
|
+
getInputProps,
|
|
48
|
+
fileRejections,
|
|
49
|
+
acceptedFiles,
|
|
50
|
+
isDragActive,
|
|
51
|
+
} = useDropzone({
|
|
52
|
+
multiple: true,
|
|
53
|
+
accept: accept,
|
|
54
|
+
maxSize: maxSize,
|
|
55
|
+
maxFiles: maxFiles,
|
|
56
|
+
onDrop: (acceptedFiles) => {
|
|
57
|
+
setFiles(
|
|
58
|
+
acceptedFiles.map((file, index) =>
|
|
59
|
+
Object.assign(file, {
|
|
60
|
+
preview: URL.createObjectURL(file),
|
|
61
|
+
})
|
|
65
62
|
)
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
63
|
+
)
|
|
64
|
+
},
|
|
65
|
+
})
|
|
66
|
+
useEffect(
|
|
67
|
+
() => () => {
|
|
68
|
+
files?.forEach((file: any) => {
|
|
69
|
+
URL.revokeObjectURL(file.preview)
|
|
70
|
+
})
|
|
71
|
+
},
|
|
72
|
+
[files]
|
|
73
|
+
)
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
setFiles(acceptedFiles)
|
|
76
|
+
}, [acceptedFiles, cmp])
|
|
77
|
+
onClearFiles = () => {
|
|
78
|
+
acceptedFiles.length = 0
|
|
79
|
+
acceptedFiles.splice(0, acceptedFiles.length)
|
|
80
|
+
setFiles([])
|
|
81
|
+
}
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
if (maxSize > 0) {
|
|
84
|
+
const k = 1024
|
|
85
|
+
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]
|
|
86
|
+
const i = Math.floor(Math.log(maxSize) / Math.log(1024))
|
|
89
87
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
)
|
|
93
|
-
}
|
|
94
|
-
}, [maxSize])
|
|
95
|
-
const errs = fileRejections.map((rej, i) => {
|
|
96
|
-
return (
|
|
97
|
-
<HawaAlert
|
|
98
|
-
text={rej.file.name}
|
|
99
|
-
title={rej.errors[0].code}
|
|
100
|
-
severity="error"
|
|
101
|
-
/>
|
|
88
|
+
setMax(
|
|
89
|
+
parseFloat((maxSize / Math.pow(1024, i)).toFixed(2)) + " " + sizes[i]
|
|
102
90
|
)
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
91
|
+
}
|
|
92
|
+
}, [maxSize])
|
|
93
|
+
const errs = fileRejections.map((rej, i) => {
|
|
94
|
+
return (
|
|
95
|
+
<HawaAlert
|
|
96
|
+
text={rej.file.name}
|
|
97
|
+
title={rej.errors[0].code}
|
|
98
|
+
severity="error"
|
|
99
|
+
/>
|
|
100
|
+
)
|
|
101
|
+
})
|
|
102
|
+
const thumbs = files?.map((file: any, index: any) => (
|
|
103
|
+
<div className="relative m-3 rounded ">
|
|
104
|
+
<button
|
|
105
|
+
onClick={(e) => {
|
|
106
|
+
e.stopPropagation()
|
|
107
|
+
acceptedFiles.splice(acceptedFiles.indexOf(file), 1)
|
|
108
|
+
setCmp(Math.random)
|
|
109
|
+
onDeleteFile(file)
|
|
110
|
+
}}
|
|
111
|
+
type="button"
|
|
112
|
+
className="absolute left-0 ml-auto inline-flex items-center rounded rounded-tr-none rounded-bl-none bg-gray-900 p-1.5 text-sm text-gray-400 hover:bg-gray-200 hover:text-gray-900 dark:hover:bg-gray-600 dark:hover:text-white"
|
|
113
|
+
data-modal-toggle="defaultModal"
|
|
114
|
+
>
|
|
115
|
+
<svg
|
|
116
|
+
aria-hidden="true"
|
|
117
|
+
className="h-5 w-5"
|
|
118
|
+
fill="currentColor"
|
|
119
|
+
viewBox="0 0 20 20"
|
|
120
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
116
121
|
>
|
|
117
|
-
<
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
fillRule="evenodd"
|
|
126
|
-
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
127
|
-
clipRule="evenodd"
|
|
128
|
-
></path>
|
|
129
|
-
</svg>
|
|
130
|
-
<span className="sr-only">Close modal</span>
|
|
131
|
-
</button>
|
|
122
|
+
<path
|
|
123
|
+
fillRule="evenodd"
|
|
124
|
+
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
125
|
+
clipRule="evenodd"
|
|
126
|
+
></path>
|
|
127
|
+
</svg>
|
|
128
|
+
<span className="sr-only">Close modal</span>
|
|
129
|
+
</button>
|
|
132
130
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
131
|
+
<div
|
|
132
|
+
style={{
|
|
133
|
+
display: "flex",
|
|
134
|
+
justifyContent: "center",
|
|
135
|
+
alignItems: "center",
|
|
136
|
+
overflow: "hidden",
|
|
137
|
+
height: 100,
|
|
138
|
+
width: 100,
|
|
139
|
+
backgroundImage: `url(${file.preview})`,
|
|
140
|
+
backgroundSize: "cover",
|
|
141
|
+
backgroundPosition: "center",
|
|
142
|
+
border: "1px solid black",
|
|
143
|
+
}}
|
|
144
|
+
className="rounded-lg"
|
|
145
|
+
key={file.name}
|
|
146
|
+
/>
|
|
147
|
+
</div>
|
|
148
|
+
))
|
|
151
149
|
|
|
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
|
-
Clear All
|
|
177
|
-
</HawaButton>
|
|
178
|
-
)}
|
|
179
|
-
</div>
|
|
180
|
-
{thumbs && showPreview ? (
|
|
181
|
-
<aside
|
|
182
|
-
style={{
|
|
183
|
-
display: "flex",
|
|
184
|
-
flexDirection: "row",
|
|
185
|
-
flexWrap: "wrap",
|
|
186
|
-
// marginTop: 10,
|
|
150
|
+
return (
|
|
151
|
+
<div>
|
|
152
|
+
{label && (
|
|
153
|
+
<div className="mb-2 block text-sm font-medium text-gray-900 dark:text-gray-300">
|
|
154
|
+
{label}
|
|
155
|
+
</div>
|
|
156
|
+
)}
|
|
157
|
+
<div
|
|
158
|
+
{...getRootProps({})}
|
|
159
|
+
className="flex flex-col justify-center rounded border border-dashed border-black bg-white transition-all hover:bg-gray-100 "
|
|
160
|
+
>
|
|
161
|
+
<input {...getInputProps()} />
|
|
162
|
+
<div className="pt-4 text-center">{texts.clickHereToUpload}</div>
|
|
163
|
+
<div className="pb-4 text-center text-xs">
|
|
164
|
+
{texts.maxFileSize} {max}
|
|
165
|
+
</div>
|
|
166
|
+
<div className="flex justify-center ">
|
|
167
|
+
{acceptedFiles.length > 0 && (
|
|
168
|
+
<HawaButton
|
|
169
|
+
onClick={(e) => {
|
|
170
|
+
e.stopPropagation()
|
|
171
|
+
onClearFiles(acceptedFiles)
|
|
187
172
|
}}
|
|
188
|
-
className="rounded-lg border-red-500"
|
|
189
173
|
>
|
|
190
|
-
|
|
191
|
-
</
|
|
192
|
-
)
|
|
193
|
-
<div className="px-2">
|
|
194
|
-
{fileRejections[0]?.errors[0]?.code === "too-many-files" ? (
|
|
195
|
-
<HawaAlert text={texts.tooManyFiles} severity="error" />
|
|
196
|
-
) : fileRejections[0]?.errors[0]?.code === "file-too-large" ? (
|
|
197
|
-
<HawaAlert text={texts.fileTooLarge} severity="error" />
|
|
198
|
-
) : (
|
|
199
|
-
errs
|
|
200
|
-
)}
|
|
201
|
-
</div>
|
|
202
|
-
{}
|
|
174
|
+
Clear All
|
|
175
|
+
</HawaButton>
|
|
176
|
+
)}
|
|
203
177
|
</div>
|
|
178
|
+
{thumbs && showPreview ? (
|
|
179
|
+
<aside
|
|
180
|
+
style={{
|
|
181
|
+
display: "flex",
|
|
182
|
+
flexDirection: "row",
|
|
183
|
+
flexWrap: "wrap",
|
|
184
|
+
// marginTop: 10,
|
|
185
|
+
}}
|
|
186
|
+
className="rounded-lg border-red-500"
|
|
187
|
+
>
|
|
188
|
+
{thumbs}
|
|
189
|
+
</aside>
|
|
190
|
+
) : null}
|
|
191
|
+
<div className="px-2">
|
|
192
|
+
{fileRejections[0]?.errors[0]?.code === "too-many-files" ? (
|
|
193
|
+
<HawaAlert text={texts.tooManyFiles} severity="error" />
|
|
194
|
+
) : fileRejections[0]?.errors[0]?.code === "file-too-large" ? (
|
|
195
|
+
<HawaAlert text={texts.fileTooLarge} severity="error" />
|
|
196
|
+
) : (
|
|
197
|
+
errs
|
|
198
|
+
)}
|
|
199
|
+
</div>
|
|
200
|
+
{}
|
|
204
201
|
</div>
|
|
205
|
-
|
|
206
|
-
|
|
202
|
+
</div>
|
|
203
|
+
)
|
|
204
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { ReactElement } from "react"
|
|
2
|
+
|
|
2
3
|
type DraggableCardTypes = {
|
|
3
4
|
children: ReactElement
|
|
4
5
|
}
|
|
@@ -7,7 +8,7 @@ export const DraggableCard: React.FunctionComponent<DraggableCardTypes> = (
|
|
|
7
8
|
props
|
|
8
9
|
) => {
|
|
9
10
|
return (
|
|
10
|
-
<div className="
|
|
11
|
+
<div className="flex flex-row rounded bg-layoutPrimary-500 p-4">
|
|
11
12
|
<button
|
|
12
13
|
className="inline-flex items-center rounded bg-white p-2 text-center text-sm font-medium text-gray-900 hover:bg-gray-100 focus:outline-none focus:ring-4 focus:ring-gray-50 dark:bg-gray-800 dark:text-white dark:hover:bg-gray-700 dark:focus:ring-gray-600"
|
|
13
14
|
type="button"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import clsx from "clsx"
|
|
2
1
|
import React from "react"
|
|
2
|
+
import clsx from "clsx"
|
|
3
3
|
|
|
4
4
|
type TChipTypes = {
|
|
5
5
|
label: string
|
|
@@ -9,6 +9,7 @@ type TChipTypes = {
|
|
|
9
9
|
dot?: boolean
|
|
10
10
|
dotType?: "available" | "unavailable"
|
|
11
11
|
}
|
|
12
|
+
|
|
12
13
|
export const HawaChip: React.FunctionComponent<TChipTypes> = ({
|
|
13
14
|
size = "normal",
|
|
14
15
|
label,
|
|
@@ -2,7 +2,7 @@ import React, { useState } from "react"
|
|
|
2
2
|
|
|
3
3
|
type ColorPickerTypes = {
|
|
4
4
|
color?: any
|
|
5
|
-
handleChange?: (e
|
|
5
|
+
handleChange?: (e: React.ChangeEvent<HTMLInputElement>) => void
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export const HawaColorPicker: React.FunctionComponent<ColorPickerTypes> = (
|
|
@@ -10,7 +10,7 @@ export const HawaColorPicker: React.FunctionComponent<ColorPickerTypes> = (
|
|
|
10
10
|
) => {
|
|
11
11
|
const [selectedColor, setSelectedColor] = useState(props.color)
|
|
12
12
|
return (
|
|
13
|
-
<div className={`flex w-fit flex-row p-0`}>
|
|
13
|
+
<div className={`flex w-fit flex-row rounded border-2 border-gray-200 p-0`}>
|
|
14
14
|
<div
|
|
15
15
|
style={{ backgroundColor: selectedColor }}
|
|
16
16
|
className="rounded-tl-lg rounded-bl-lg"
|
|
@@ -29,10 +29,8 @@ export const HawaColorPicker: React.FunctionComponent<ColorPickerTypes> = (
|
|
|
29
29
|
<input
|
|
30
30
|
type="text"
|
|
31
31
|
value={selectedColor}
|
|
32
|
-
className="w-24
|
|
32
|
+
className="w-24 rounded-tr-lg rounded-br-lg pr-2 pl-2"
|
|
33
33
|
/>
|
|
34
34
|
</div>
|
|
35
35
|
)
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import clsx from "clsx"
|
|
2
1
|
import React, { ReactNode, useEffect, useRef, useState } from "react"
|
|
2
|
+
import clsx from "clsx"
|
|
3
3
|
|
|
4
4
|
// TODO: add width to decrease width
|
|
5
5
|
|
|
@@ -28,7 +28,6 @@ interface TMenuTypes {
|
|
|
28
28
|
type MenuItems = {
|
|
29
29
|
icon?: JSX.Element
|
|
30
30
|
label: string
|
|
31
|
-
// action?: (item: any) => void
|
|
32
31
|
action?: (e: any) => void
|
|
33
32
|
isButton?: boolean
|
|
34
33
|
element?: any
|
|
@@ -70,7 +69,7 @@ export const HawaMenu: React.FunctionComponent<TMenuTypes> = ({
|
|
|
70
69
|
document.removeEventListener("click", handleClickOutside, true)
|
|
71
70
|
}
|
|
72
71
|
}, [onClickOutside])
|
|
73
|
-
|
|
72
|
+
|
|
74
73
|
let defaultStyles =
|
|
75
74
|
"border-none absolute ring-offset-1 absolute z-10 w-44 divide-y divide-gray-100 overflow-y-clip rounded bg-gray-50 shadow-lg transition-all dark:bg-gray-700"
|
|
76
75
|
let sizeStyles = {
|
|
@@ -2,13 +2,7 @@ import React, { useState } from "react"
|
|
|
2
2
|
|
|
3
3
|
type PanelTabsTypes = {
|
|
4
4
|
defaultValue: any
|
|
5
|
-
options:
|
|
6
|
-
// options: PropTypes.arrayOf(
|
|
7
|
-
// PropTypes.shape({
|
|
8
|
-
// label: PropTypes.string,
|
|
9
|
-
// value: PropTypes.string,
|
|
10
|
-
// })
|
|
11
|
-
// ),
|
|
5
|
+
options: [{ label: string; value: string }]
|
|
12
6
|
lang: any
|
|
13
7
|
handleChange: any
|
|
14
8
|
location: any
|
|
@@ -4,6 +4,7 @@ import { HawaButton } from "./HawaButton"
|
|
|
4
4
|
|
|
5
5
|
// TODO: if feature.excluded is false, show gray and x
|
|
6
6
|
// TODO: add badge to feature if soon
|
|
7
|
+
// TODO: add a discount element
|
|
7
8
|
|
|
8
9
|
type PricingCardTypes = {
|
|
9
10
|
direction?: "rtl" | "ltr"
|
|
@@ -94,13 +95,6 @@ export const HawaPricingCard: React.FunctionComponent<PricingCardTypes> = ({
|
|
|
94
95
|
})}
|
|
95
96
|
</ul>
|
|
96
97
|
)}
|
|
97
|
-
{/* <button
|
|
98
|
-
disabled={currentPlan}
|
|
99
|
-
type="button"
|
|
100
|
-
className="inline-flex w-full justify-center rounded bg-blue-600 px-5 py-2.5 text-center text-sm font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-4 focus:ring-blue-200 dark:focus:ring-blue-900"
|
|
101
|
-
>
|
|
102
|
-
{props.texts.buttonText}
|
|
103
|
-
</button> */}
|
|
104
98
|
<HawaButton
|
|
105
99
|
onClick={props.onPlanClicked}
|
|
106
100
|
margins="none"
|
|
@@ -2,32 +2,8 @@ import clsx from "clsx"
|
|
|
2
2
|
import React from "react"
|
|
3
3
|
import Select from "react-select"
|
|
4
4
|
import CreatableSelect from "react-select/creatable"
|
|
5
|
-
type OptionTypes = {
|
|
6
|
-
cx: any
|
|
7
|
-
children: any
|
|
8
|
-
getStyles: any
|
|
9
|
-
innerProps: any
|
|
10
|
-
innerRef: any
|
|
11
|
-
size?: "small" | "normal" | "large"
|
|
12
|
-
}
|
|
13
|
-
const Option: React.FunctionComponent<OptionTypes> = ({
|
|
14
|
-
cx,
|
|
15
|
-
children,
|
|
16
|
-
getStyles,
|
|
17
|
-
innerProps,
|
|
18
|
-
innerRef,
|
|
19
|
-
size = "normal",
|
|
20
|
-
...props
|
|
21
|
-
}) => (
|
|
22
|
-
<div
|
|
23
|
-
ref={innerRef}
|
|
24
|
-
className="m-2 flex flex-row items-center justify-between rounded p-1 px-3 hover:bg-buttonPrimary-500 hover:text-white"
|
|
25
|
-
{...innerProps}
|
|
26
|
-
>
|
|
27
|
-
{children}
|
|
28
|
-
</div>
|
|
29
|
-
)
|
|
30
5
|
|
|
6
|
+
// The select bar
|
|
31
7
|
type ControlTypes = {
|
|
32
8
|
cx: any
|
|
33
9
|
children: any
|
|
@@ -64,6 +40,7 @@ const Control: React.FunctionComponent<ControlTypes> = ({
|
|
|
64
40
|
</div>
|
|
65
41
|
)
|
|
66
42
|
}
|
|
43
|
+
// The options container
|
|
67
44
|
type MenuTypes = {
|
|
68
45
|
cx: any
|
|
69
46
|
children: any
|
|
@@ -81,7 +58,7 @@ const Menu: React.FunctionComponent<MenuTypes> = ({
|
|
|
81
58
|
}) => {
|
|
82
59
|
return (
|
|
83
60
|
<div
|
|
84
|
-
className="absolute z-10 mt-2 w-full rounded bg-white ring-1 ring-blue-200"
|
|
61
|
+
className="absolute z-10 mt-2 flex w-full flex-col justify-start rounded bg-white p-1 px-1.5 ring-1 ring-blue-200"
|
|
85
62
|
ref={innerRef}
|
|
86
63
|
{...innerProps}
|
|
87
64
|
// {...props}
|
|
@@ -90,14 +67,40 @@ const Menu: React.FunctionComponent<MenuTypes> = ({
|
|
|
90
67
|
</div>
|
|
91
68
|
)
|
|
92
69
|
}
|
|
93
|
-
|
|
70
|
+
// The single options
|
|
71
|
+
type OptionTypes = {
|
|
72
|
+
cx: any
|
|
73
|
+
children: any
|
|
74
|
+
getStyles: any
|
|
75
|
+
innerProps: any
|
|
76
|
+
innerRef: any
|
|
77
|
+
size?: "small" | "normal" | "large"
|
|
78
|
+
}
|
|
79
|
+
const Option: React.FunctionComponent<OptionTypes> = ({
|
|
80
|
+
cx,
|
|
81
|
+
children,
|
|
82
|
+
getStyles,
|
|
83
|
+
innerProps,
|
|
84
|
+
innerRef,
|
|
85
|
+
size = "normal",
|
|
86
|
+
...props
|
|
87
|
+
}) => (
|
|
88
|
+
<div
|
|
89
|
+
ref={innerRef}
|
|
90
|
+
className="flex flex-row items-center justify-between rounded p-1 px-2 hover:bg-buttonPrimary-500 hover:text-white"
|
|
91
|
+
{...innerProps}
|
|
92
|
+
>
|
|
93
|
+
{children}
|
|
94
|
+
</div>
|
|
95
|
+
)
|
|
96
|
+
// The main element
|
|
94
97
|
type SelectTypes = {
|
|
95
|
-
label?:
|
|
96
|
-
isCreatable?: any
|
|
98
|
+
label?: string
|
|
97
99
|
options?: any[any]
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
isCreatable?: boolean
|
|
101
|
+
isClearable?: boolean
|
|
102
|
+
isMulti?: boolean
|
|
103
|
+
isSearchable?: boolean
|
|
101
104
|
onChange?: any
|
|
102
105
|
helperText?: any
|
|
103
106
|
onInputChange?: any
|
|
@@ -106,15 +109,14 @@ type SelectTypes = {
|
|
|
106
109
|
value?: any
|
|
107
110
|
children?: any
|
|
108
111
|
getOptionLabel?: any
|
|
109
|
-
// size?
|
|
110
112
|
}
|
|
111
113
|
export const HawaSelect: React.FunctionComponent<SelectTypes> = (props) => {
|
|
112
114
|
return (
|
|
113
|
-
<div
|
|
115
|
+
<div>
|
|
114
116
|
{props.label && (
|
|
115
|
-
<
|
|
117
|
+
<div className="mb-2 block text-sm font-medium text-gray-900 dark:text-gray-300">
|
|
116
118
|
{props.label}
|
|
117
|
-
</
|
|
119
|
+
</div>
|
|
118
120
|
)}
|
|
119
121
|
{!props.isCreatable && (
|
|
120
122
|
<Select
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react"
|
|
2
|
-
import { HawaTypography } from "./HawaTypography"
|
|
3
2
|
import { HawaTextField } from "./HawaTextField"
|
|
4
3
|
import { HawaSwitch } from "./HawaSwitch"
|
|
5
4
|
import { HawaColorPicker } from "./HawaColorPicker"
|
|
@@ -7,7 +6,7 @@ import { HawaRange } from "./HawaRange"
|
|
|
7
6
|
import { HawaRadio } from "./HawaRadio"
|
|
8
7
|
|
|
9
8
|
type SettingsRowTypes = {
|
|
10
|
-
settingsLabel:
|
|
9
|
+
settingsLabel: string
|
|
11
10
|
settingsType: "text" | "radio" | "boolean" | "color" | "range"
|
|
12
11
|
radioProps: {
|
|
13
12
|
defaultValue: any
|
|
@@ -32,10 +31,13 @@ export const HawaSettingsRow: React.FunctionComponent<SettingsRowTypes> = ({
|
|
|
32
31
|
radioProps,
|
|
33
32
|
}) => {
|
|
34
33
|
return (
|
|
35
|
-
<div className="my-0.5
|
|
36
|
-
<
|
|
34
|
+
<div className="my-0.5 flex h-20 max-h-fit flex-row items-center justify-between rounded bg-white p-6 align-middle">
|
|
35
|
+
<div>
|
|
36
|
+
<div>{settingsLabel}</div>
|
|
37
|
+
<div className="text-sm">Text here like a description</div>
|
|
38
|
+
</div>
|
|
37
39
|
{settingsType === "text" && <HawaTextField margin="none" width="small" />}
|
|
38
|
-
{settingsType === "boolean" && <HawaSwitch />}
|
|
40
|
+
{settingsType === "boolean" && <HawaSwitch size="large" />}
|
|
39
41
|
{settingsType === "range" && <HawaRange {...rangeProps} />}
|
|
40
42
|
{settingsType === "color" && <HawaColorPicker {...colorProps} />}
|
|
41
43
|
{settingsType === "radio" && <HawaRadio {...radioProps} />}
|