@sikka/hawa 0.0.217 → 0.0.218
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 +0 -14
- package/es/blocks/Account/UserSettingsForm.d.ts +3 -2
- package/es/elements/HawaSettingsRow.d.ts +3 -0
- package/es/index.es.js +1 -1
- package/lib/blocks/Account/UserSettingsForm.d.ts +3 -2
- package/lib/elements/HawaSettingsRow.d.ts +3 -0
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/blocks/Account/UserSettingsForm.tsx +12 -7
- package/src/elements/HawaSettingsRow.tsx +8 -4
- package/src/elements/HawaTextField.tsx +4 -3
- package/src/styles.css +0 -14
package/package.json
CHANGED
|
@@ -4,24 +4,29 @@ import { HawaContainer } from "../../layout"
|
|
|
4
4
|
|
|
5
5
|
type UserSettingsFormTypes = {
|
|
6
6
|
children: any
|
|
7
|
-
handleSaveSettings
|
|
8
|
-
saveSettingsText
|
|
7
|
+
handleSaveSettings?: any
|
|
8
|
+
saveSettingsText?: string
|
|
9
|
+
blockTitle?: string
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export const UserSettingsForm: React.FunctionComponent<
|
|
12
13
|
UserSettingsFormTypes
|
|
13
14
|
> = (props) => {
|
|
14
15
|
return (
|
|
15
|
-
<
|
|
16
|
-
{props.
|
|
17
|
-
<
|
|
16
|
+
<div>
|
|
17
|
+
<div className="mb-2 text-sm font-bold">{props.blockTitle}</div>
|
|
18
|
+
<div className="flex flex-col gap-4 rounded bg-white p-2">
|
|
19
|
+
{props.children}
|
|
20
|
+
</div>
|
|
21
|
+
{/* <HawaButton
|
|
18
22
|
color="primary"
|
|
19
23
|
// type="submit"
|
|
20
24
|
width="full"
|
|
25
|
+
margins="none"
|
|
21
26
|
onClick={props.handleSaveSettings}
|
|
22
27
|
>
|
|
23
28
|
{props.saveSettingsText}
|
|
24
|
-
</HawaButton>
|
|
25
|
-
</
|
|
29
|
+
</HawaButton> */}
|
|
30
|
+
</div>
|
|
26
31
|
)
|
|
27
32
|
}
|
|
@@ -22,6 +22,9 @@ type SettingsRowTypes = {
|
|
|
22
22
|
min?: any
|
|
23
23
|
max?: any
|
|
24
24
|
}
|
|
25
|
+
switchProps: {
|
|
26
|
+
size: "small" | "normal" | "large"
|
|
27
|
+
}
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
export const HawaSettingsRow: React.FunctionComponent<SettingsRowTypes> = ({
|
|
@@ -31,17 +34,18 @@ export const HawaSettingsRow: React.FunctionComponent<SettingsRowTypes> = ({
|
|
|
31
34
|
colorProps,
|
|
32
35
|
rangeProps,
|
|
33
36
|
radioProps,
|
|
37
|
+
switchProps,
|
|
34
38
|
}) => {
|
|
35
39
|
return (
|
|
36
|
-
<div className="
|
|
40
|
+
<div className="flex max-h-fit flex-row items-center justify-between rounded align-middle">
|
|
37
41
|
<div>
|
|
38
|
-
<div>{settingsLabel}</div>
|
|
42
|
+
<div className="text-sm">{settingsLabel}</div>
|
|
39
43
|
{settingsDescription && (
|
|
40
|
-
<div className="text-
|
|
44
|
+
<div className="text-xs">{settingsDescription}</div>
|
|
41
45
|
)}{" "}
|
|
42
46
|
</div>
|
|
43
47
|
{settingsType === "text" && <HawaTextField margin="none" width="small" />}
|
|
44
|
-
{settingsType === "boolean" && <HawaSwitch
|
|
48
|
+
{settingsType === "boolean" && <HawaSwitch {...switchProps} />}
|
|
45
49
|
{settingsType === "range" && <HawaRange {...rangeProps} />}
|
|
46
50
|
{settingsType === "color" && <HawaColorPicker {...colorProps} />}
|
|
47
51
|
{settingsType === "radio" && <HawaRadio {...radioProps} />}
|
|
@@ -35,16 +35,17 @@ export const HawaTextField: React.FunctionComponent<TextFieldTypes> = ({
|
|
|
35
35
|
large: "mb-5",
|
|
36
36
|
}
|
|
37
37
|
let widthStyles = {
|
|
38
|
-
|
|
38
|
+
|
|
39
|
+
small: "w-full max-w-2xs",
|
|
39
40
|
normal: "w-1/2",
|
|
40
41
|
full: "w-full",
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
let defaultStyle = "flex h-fit max-h-fit flex-col justify-center"
|
|
44
45
|
let defaultInputStyle =
|
|
45
|
-
"block w-full rounded border border-gray-300 bg-
|
|
46
|
+
"block w-full rounded border border-gray-300 bg-white p-2 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500"
|
|
46
47
|
let previewInputStyle =
|
|
47
|
-
"block w-full rounded
|
|
48
|
+
"block w-full rounded bg-gray-50 p-2 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500"
|
|
48
49
|
// "mb-0 block w-full rounded border border-gray-300 bg-gray-50 p-2 text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500",
|
|
49
50
|
|
|
50
51
|
return (
|
package/src/styles.css
CHANGED
|
@@ -672,10 +672,6 @@ video {
|
|
|
672
672
|
margin-top: 0px;
|
|
673
673
|
margin-bottom: 0px;
|
|
674
674
|
}
|
|
675
|
-
.my-0\.5 {
|
|
676
|
-
margin-top: 0.125rem;
|
|
677
|
-
margin-bottom: 0.125rem;
|
|
678
|
-
}
|
|
679
675
|
.my-1 {
|
|
680
676
|
margin-top: 0.25rem;
|
|
681
677
|
margin-bottom: 0.25rem;
|
|
@@ -684,10 +680,6 @@ video {
|
|
|
684
680
|
margin-top: 0.5rem;
|
|
685
681
|
margin-bottom: 0.5rem;
|
|
686
682
|
}
|
|
687
|
-
.my-3 {
|
|
688
|
-
margin-top: 0.75rem;
|
|
689
|
-
margin-bottom: 0.75rem;
|
|
690
|
-
}
|
|
691
683
|
.my-4 {
|
|
692
684
|
margin-top: 1rem;
|
|
693
685
|
margin-bottom: 1rem;
|
|
@@ -830,9 +822,6 @@ video {
|
|
|
830
822
|
.h-2\.5 {
|
|
831
823
|
height: 0.625rem;
|
|
832
824
|
}
|
|
833
|
-
.h-20 {
|
|
834
|
-
height: 5rem;
|
|
835
|
-
}
|
|
836
825
|
.h-24 {
|
|
837
826
|
height: 6rem;
|
|
838
827
|
}
|
|
@@ -1579,9 +1568,6 @@ video {
|
|
|
1579
1568
|
.p-5 {
|
|
1580
1569
|
padding: 1.25rem;
|
|
1581
1570
|
}
|
|
1582
|
-
.p-6 {
|
|
1583
|
-
padding: 1.5rem;
|
|
1584
|
-
}
|
|
1585
1571
|
.px-1 {
|
|
1586
1572
|
padding-left: 0.25rem;
|
|
1587
1573
|
padding-right: 0.25rem;
|