@crystaltech/hsms-shared-ui 0.5.29 → 0.5.30
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.
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
declare const ColorSettings: ({ onColorSubmit, }: {
|
|
3
|
+
onColorSubmit: (theme: Theme) => void;
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
2
5
|
export default ColorSettings;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
declare const ThemeSetting: ({ onColorSubmit, onTypographySubmit, }: {
|
|
3
|
+
onColorSubmit: (theme: Theme) => void;
|
|
4
|
+
onTypographySubmit: (theme: Theme) => void;
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
2
6
|
export default ThemeSetting;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const TypographySettings:
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
declare const TypographySettings: ({ onTypographySubmit, }: {
|
|
3
|
+
onTypographySubmit: (theme: Theme) => void;
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
3
5
|
export default TypographySettings;
|
package/dist/index.es.js
CHANGED
|
@@ -15566,36 +15566,38 @@ const ll = ({
|
|
|
15566
15566
|
foreground: s.foreground
|
|
15567
15567
|
}
|
|
15568
15568
|
}
|
|
15569
|
-
}), q3 = (
|
|
15570
|
-
|
|
15569
|
+
}), q3 = ({
|
|
15570
|
+
onColorSubmit: e
|
|
15571
|
+
}) => {
|
|
15572
|
+
const [t, n] = ht(
|
|
15571
15573
|
JSON.parse(localStorage.getItem("theme") || "{}").palette.primary.main
|
|
15572
|
-
), [
|
|
15574
|
+
), [r, s] = ht(
|
|
15573
15575
|
JSON.parse(localStorage.getItem("theme") || "{}").palette.secondary.main
|
|
15574
|
-
), [
|
|
15576
|
+
), [i, a] = ht(
|
|
15575
15577
|
JSON.parse(localStorage.getItem("theme") || "{}").palette.navbar
|
|
15576
|
-
), [
|
|
15578
|
+
), [l, c] = ht(
|
|
15577
15579
|
JSON.parse(localStorage.getItem("theme") || "{}").palette.sidebar
|
|
15578
|
-
),
|
|
15579
|
-
|
|
15580
|
-
},
|
|
15581
|
-
|
|
15582
|
-
},
|
|
15583
|
-
|
|
15584
|
-
},
|
|
15585
|
-
|
|
15586
|
-
},
|
|
15587
|
-
|
|
15588
|
-
},
|
|
15589
|
-
|
|
15590
|
-
},
|
|
15591
|
-
const
|
|
15592
|
-
|
|
15593
|
-
|
|
15594
|
-
|
|
15595
|
-
|
|
15596
|
-
|
|
15580
|
+
), u = (w) => {
|
|
15581
|
+
n(w);
|
|
15582
|
+
}, d = (w) => {
|
|
15583
|
+
s(w);
|
|
15584
|
+
}, A = (w) => {
|
|
15585
|
+
a({ ...i, background: w });
|
|
15586
|
+
}, f = (w) => {
|
|
15587
|
+
a({ ...i, foreground: w });
|
|
15588
|
+
}, h = (w) => {
|
|
15589
|
+
c({ ...l, background: w });
|
|
15590
|
+
}, v = (w) => {
|
|
15591
|
+
c({ ...l, foreground: w });
|
|
15592
|
+
}, g = () => {
|
|
15593
|
+
const w = JSON.parse(localStorage.getItem("theme") || "{}"), C = U3(
|
|
15594
|
+
w,
|
|
15595
|
+
t,
|
|
15596
|
+
r,
|
|
15597
|
+
i,
|
|
15598
|
+
l
|
|
15597
15599
|
);
|
|
15598
|
-
localStorage.setItem("theme", JSON.stringify(
|
|
15600
|
+
localStorage.setItem("theme", JSON.stringify(C)), e(C);
|
|
15599
15601
|
};
|
|
15600
15602
|
return /* @__PURE__ */ p.jsxs(
|
|
15601
15603
|
Tr,
|
|
@@ -15615,8 +15617,8 @@ const ll = ({
|
|
|
15615
15617
|
so,
|
|
15616
15618
|
{
|
|
15617
15619
|
label: "Color",
|
|
15618
|
-
initialColor:
|
|
15619
|
-
onChange:
|
|
15620
|
+
initialColor: t,
|
|
15621
|
+
onChange: u
|
|
15620
15622
|
}
|
|
15621
15623
|
) })
|
|
15622
15624
|
] }),
|
|
@@ -15626,8 +15628,8 @@ const ll = ({
|
|
|
15626
15628
|
so,
|
|
15627
15629
|
{
|
|
15628
15630
|
label: "Color",
|
|
15629
|
-
initialColor:
|
|
15630
|
-
onChange:
|
|
15631
|
+
initialColor: r,
|
|
15632
|
+
onChange: d
|
|
15631
15633
|
}
|
|
15632
15634
|
) })
|
|
15633
15635
|
] }),
|
|
@@ -15638,16 +15640,16 @@ const ll = ({
|
|
|
15638
15640
|
so,
|
|
15639
15641
|
{
|
|
15640
15642
|
label: "Background",
|
|
15641
|
-
initialColor:
|
|
15642
|
-
onChange:
|
|
15643
|
+
initialColor: i.background,
|
|
15644
|
+
onChange: A
|
|
15643
15645
|
}
|
|
15644
15646
|
),
|
|
15645
15647
|
/* @__PURE__ */ p.jsx(
|
|
15646
15648
|
so,
|
|
15647
15649
|
{
|
|
15648
15650
|
label: "Foreground",
|
|
15649
|
-
initialColor:
|
|
15650
|
-
onChange:
|
|
15651
|
+
initialColor: i.foreground,
|
|
15652
|
+
onChange: f
|
|
15651
15653
|
}
|
|
15652
15654
|
)
|
|
15653
15655
|
] })
|
|
@@ -15659,21 +15661,21 @@ const ll = ({
|
|
|
15659
15661
|
so,
|
|
15660
15662
|
{
|
|
15661
15663
|
label: "Background",
|
|
15662
|
-
initialColor:
|
|
15663
|
-
onChange:
|
|
15664
|
+
initialColor: l.background,
|
|
15665
|
+
onChange: h
|
|
15664
15666
|
}
|
|
15665
15667
|
),
|
|
15666
15668
|
/* @__PURE__ */ p.jsx(
|
|
15667
15669
|
so,
|
|
15668
15670
|
{
|
|
15669
15671
|
label: "Foreground",
|
|
15670
|
-
initialColor:
|
|
15671
|
-
onChange:
|
|
15672
|
+
initialColor: l.foreground,
|
|
15673
|
+
onChange: v
|
|
15672
15674
|
}
|
|
15673
15675
|
)
|
|
15674
15676
|
] })
|
|
15675
15677
|
] }),
|
|
15676
|
-
/* @__PURE__ */ p.jsx(ll, { onClick:
|
|
15678
|
+
/* @__PURE__ */ p.jsx(ll, { onClick: g, children: "Apply" })
|
|
15677
15679
|
]
|
|
15678
15680
|
}
|
|
15679
15681
|
);
|
|
@@ -26641,33 +26643,35 @@ const yM = ({
|
|
|
26641
26643
|
], DM = () => JSON.parse(localStorage.getItem("theme") || "{}").typography.fontFamily.split(",").map((s) => s.trim()).map((s) => ({
|
|
26642
26644
|
value: s,
|
|
26643
26645
|
title: s.replace(/['"]/g, "")
|
|
26644
|
-
})), xM = (
|
|
26645
|
-
|
|
26646
|
-
|
|
26647
|
-
|
|
26648
|
-
|
|
26649
|
-
|
|
26650
|
-
|
|
26651
|
-
|
|
26652
|
-
|
|
26653
|
-
|
|
26646
|
+
})), xM = ({
|
|
26647
|
+
onTypographySubmit: e
|
|
26648
|
+
}) => {
|
|
26649
|
+
const [t, n] = ht(() => {
|
|
26650
|
+
const u = localStorage.getItem("theme");
|
|
26651
|
+
return u ? JSON.parse(u).typography : {};
|
|
26652
|
+
}), [r, s] = ht(DM()), i = (u, d, A) => {
|
|
26653
|
+
n((f) => ({
|
|
26654
|
+
...f,
|
|
26655
|
+
[u]: {
|
|
26656
|
+
...f[u],
|
|
26657
|
+
[d]: d === "fontWeight" ? Number(A) : `${A}rem`
|
|
26654
26658
|
}
|
|
26655
26659
|
}));
|
|
26656
|
-
},
|
|
26657
|
-
if (
|
|
26658
|
-
const
|
|
26659
|
-
|
|
26660
|
-
},
|
|
26661
|
-
const
|
|
26662
|
-
...
|
|
26660
|
+
}, a = (u, d, A) => {
|
|
26661
|
+
if (A === "0") return;
|
|
26662
|
+
const f = A.replace(/[^\d.]/g, "");
|
|
26663
|
+
i(u, d, f);
|
|
26664
|
+
}, l = () => {
|
|
26665
|
+
const u = JSON.parse(localStorage.getItem("theme") || "{}"), A = r.map((h) => h.value).join(",").replace(/"/g, "'"), f = {
|
|
26666
|
+
...u,
|
|
26663
26667
|
typography: {
|
|
26664
|
-
...
|
|
26665
|
-
fontFamily:
|
|
26668
|
+
...t,
|
|
26669
|
+
fontFamily: A
|
|
26666
26670
|
}
|
|
26667
26671
|
};
|
|
26668
|
-
localStorage.setItem("theme", JSON.stringify(
|
|
26669
|
-
},
|
|
26670
|
-
Array.isArray(
|
|
26672
|
+
localStorage.setItem("theme", JSON.stringify(f)), e(f);
|
|
26673
|
+
}, c = (u) => {
|
|
26674
|
+
Array.isArray(u) ? s(u) : s(u ? [u] : []);
|
|
26671
26675
|
};
|
|
26672
26676
|
return /* @__PURE__ */ p.jsxs(Je, { children: [
|
|
26673
26677
|
/* @__PURE__ */ p.jsx(Ge, { variant: "h4", gutterBottom: !0, children: "Typography Settings" }),
|
|
@@ -26678,24 +26682,24 @@ const yM = ({
|
|
|
26678
26682
|
yM,
|
|
26679
26683
|
{
|
|
26680
26684
|
label: "Select Font Families",
|
|
26681
|
-
defaultValue:
|
|
26685
|
+
defaultValue: r,
|
|
26682
26686
|
options: EM,
|
|
26683
|
-
getOptionLabel: (
|
|
26684
|
-
onChange:
|
|
26687
|
+
getOptionLabel: (u) => u.title,
|
|
26688
|
+
onChange: c,
|
|
26685
26689
|
multiple: !0
|
|
26686
26690
|
}
|
|
26687
26691
|
)
|
|
26688
26692
|
] }),
|
|
26689
|
-
|
|
26690
|
-
if (
|
|
26693
|
+
t && Object.keys(t).map((u) => {
|
|
26694
|
+
if (u !== "fontFamily")
|
|
26691
26695
|
return /* @__PURE__ */ p.jsxs(Fs, { size: { xs: 12, sm: 6, md: 4 }, children: [
|
|
26692
|
-
/* @__PURE__ */ p.jsx(Ge, { variant: "h6", gutterBottom: !0, children:
|
|
26696
|
+
/* @__PURE__ */ p.jsx(Ge, { variant: "h6", gutterBottom: !0, children: u }),
|
|
26693
26697
|
/* @__PURE__ */ p.jsx(
|
|
26694
26698
|
Sl,
|
|
26695
26699
|
{
|
|
26696
26700
|
label: "Font Size (rem)",
|
|
26697
|
-
value:
|
|
26698
|
-
onChange: (
|
|
26701
|
+
value: t[u].fontSize.replace(/rem$/, ""),
|
|
26702
|
+
onChange: (d) => a(u, "fontSize", d.target.value),
|
|
26699
26703
|
fullWidth: !0,
|
|
26700
26704
|
inputProps: { inputMode: "numeric", pattern: "[0-9]*" }
|
|
26701
26705
|
}
|
|
@@ -26704,8 +26708,8 @@ const yM = ({
|
|
|
26704
26708
|
Sl,
|
|
26705
26709
|
{
|
|
26706
26710
|
label: "Font Weight",
|
|
26707
|
-
value:
|
|
26708
|
-
onChange: (
|
|
26711
|
+
value: t[u].fontWeight,
|
|
26712
|
+
onChange: (d) => i(u, "fontWeight", d.target.value),
|
|
26709
26713
|
fullWidth: !0,
|
|
26710
26714
|
margin: "normal"
|
|
26711
26715
|
}
|
|
@@ -26714,18 +26718,18 @@ const yM = ({
|
|
|
26714
26718
|
Sl,
|
|
26715
26719
|
{
|
|
26716
26720
|
label: "Line Height (rem)",
|
|
26717
|
-
value:
|
|
26718
|
-
onChange: (
|
|
26719
|
-
|
|
26721
|
+
value: t[u].lineHeight.replace(/rem$/, ""),
|
|
26722
|
+
onChange: (d) => a(
|
|
26723
|
+
u,
|
|
26720
26724
|
"lineHeight",
|
|
26721
|
-
|
|
26725
|
+
d.target.value
|
|
26722
26726
|
),
|
|
26723
26727
|
fullWidth: !0,
|
|
26724
26728
|
margin: "normal",
|
|
26725
26729
|
inputProps: { inputMode: "numeric", pattern: "[0-9]*" }
|
|
26726
26730
|
}
|
|
26727
26731
|
)
|
|
26728
|
-
] },
|
|
26732
|
+
] }, u);
|
|
26729
26733
|
})
|
|
26730
26734
|
] }),
|
|
26731
26735
|
/* @__PURE__ */ p.jsx(
|
|
@@ -26733,7 +26737,7 @@ const yM = ({
|
|
|
26733
26737
|
{
|
|
26734
26738
|
variant: "contained",
|
|
26735
26739
|
color: "primary",
|
|
26736
|
-
onClick:
|
|
26740
|
+
onClick: l,
|
|
26737
26741
|
sx: { marginTop: 2 },
|
|
26738
26742
|
children: "Apply Settings"
|
|
26739
26743
|
}
|
|
@@ -28011,16 +28015,19 @@ const WM = ({
|
|
|
28011
28015
|
}, Gi = [
|
|
28012
28016
|
{ label: "Color", value: "color" },
|
|
28013
28017
|
{ label: "Typography", value: "typography" }
|
|
28014
|
-
], Jk = (
|
|
28015
|
-
|
|
28018
|
+
], Jk = ({
|
|
28019
|
+
onColorSubmit: e,
|
|
28020
|
+
onTypographySubmit: t
|
|
28021
|
+
}) => {
|
|
28022
|
+
const [n, r] = ht(
|
|
28016
28023
|
JSON.parse(localStorage.getItem("tabs") || JSON.stringify(Gi[0].value))
|
|
28017
|
-
),
|
|
28018
|
-
|
|
28024
|
+
), s = (i, a) => {
|
|
28025
|
+
r(a), localStorage.setItem("tabs", JSON.stringify(a)), console.log(i);
|
|
28019
28026
|
};
|
|
28020
28027
|
return /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
|
|
28021
|
-
/* @__PURE__ */ p.jsx(WM, { tabs: Gi, value:
|
|
28022
|
-
|
|
28023
|
-
|
|
28028
|
+
/* @__PURE__ */ p.jsx(WM, { tabs: Gi, value: n, onChange: s }),
|
|
28029
|
+
n === Gi[0].value && /* @__PURE__ */ p.jsx(q3, { onColorSubmit: e }),
|
|
28030
|
+
n === Gi[1].value && /* @__PURE__ */ p.jsx(xM, { onTypographySubmit: t })
|
|
28024
28031
|
] });
|
|
28025
28032
|
}, KM = rt(/* @__PURE__ */ p.jsx("path", {
|
|
28026
28033
|
d: "M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"
|