@axzydev/axzy_ui_system 1.0.170 → 1.1.0
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/index.cjs +20 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +20 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -916,6 +916,7 @@ interface ITThemePalette {
|
|
|
916
916
|
interface ITThemeProviderProps {
|
|
917
917
|
theme?: Partial<ITThemePalette>;
|
|
918
918
|
children: React.ReactNode;
|
|
919
|
+
showFab?: boolean;
|
|
919
920
|
}
|
|
920
921
|
|
|
921
922
|
interface ITThemeContextType {
|
|
@@ -935,7 +936,7 @@ declare const useITTheme: () => ITThemeContextType;
|
|
|
935
936
|
* si se usa fuera de ITThemeProvider (no lanza error).
|
|
936
937
|
*/
|
|
937
938
|
declare const useITThemeSafe: () => ITThemeContextType | undefined;
|
|
938
|
-
declare function ITThemeProvider({ children, theme, }: ITThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
939
|
+
declare function ITThemeProvider({ children, theme, showFab, }: ITThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
939
940
|
|
|
940
941
|
interface ITTimePickerProps {
|
|
941
942
|
name: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -916,6 +916,7 @@ interface ITThemePalette {
|
|
|
916
916
|
interface ITThemeProviderProps {
|
|
917
917
|
theme?: Partial<ITThemePalette>;
|
|
918
918
|
children: React.ReactNode;
|
|
919
|
+
showFab?: boolean;
|
|
919
920
|
}
|
|
920
921
|
|
|
921
922
|
interface ITThemeContextType {
|
|
@@ -935,7 +936,7 @@ declare const useITTheme: () => ITThemeContextType;
|
|
|
935
936
|
* si se usa fuera de ITThemeProvider (no lanza error).
|
|
936
937
|
*/
|
|
937
938
|
declare const useITThemeSafe: () => ITThemeContextType | undefined;
|
|
938
|
-
declare function ITThemeProvider({ children, theme, }: ITThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
939
|
+
declare function ITThemeProvider({ children, theme, showFab, }: ITThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
939
940
|
|
|
940
941
|
interface ITTimePickerProps {
|
|
941
942
|
name: string;
|
package/dist/index.js
CHANGED
|
@@ -1611,7 +1611,8 @@ var isVeryDarkColor = (hex) => {
|
|
|
1611
1611
|
};
|
|
1612
1612
|
function ITThemeProvider({
|
|
1613
1613
|
children,
|
|
1614
|
-
theme: theme2
|
|
1614
|
+
theme: theme2,
|
|
1615
|
+
showFab = true
|
|
1615
1616
|
}) {
|
|
1616
1617
|
const [palette2, setPaletteState] = useState4(() => {
|
|
1617
1618
|
const basePalette = {
|
|
@@ -1620,6 +1621,9 @@ function ITThemeProvider({
|
|
|
1620
1621
|
layout: { ...DEFAULT_PALETTE.layout, ...theme2?.layout },
|
|
1621
1622
|
table: { ...DEFAULT_PALETTE.table, ...theme2?.table }
|
|
1622
1623
|
};
|
|
1624
|
+
if (!showFab) {
|
|
1625
|
+
return basePalette;
|
|
1626
|
+
}
|
|
1623
1627
|
try {
|
|
1624
1628
|
const saved = localStorage.getItem(STORAGE_KEY);
|
|
1625
1629
|
if (saved) {
|
|
@@ -1703,6 +1707,16 @@ function ITThemeProvider({
|
|
|
1703
1707
|
applyDarkMode(darkModeMode === "dark");
|
|
1704
1708
|
}
|
|
1705
1709
|
}, [darkModeMode]);
|
|
1710
|
+
useEffect4(() => {
|
|
1711
|
+
if (!showFab) {
|
|
1712
|
+
setPaletteState({
|
|
1713
|
+
...DEFAULT_PALETTE,
|
|
1714
|
+
...theme2,
|
|
1715
|
+
layout: { ...DEFAULT_PALETTE.layout, ...theme2?.layout },
|
|
1716
|
+
table: { ...DEFAULT_PALETTE.table, ...theme2?.table }
|
|
1717
|
+
});
|
|
1718
|
+
}
|
|
1719
|
+
}, [theme2, showFab]);
|
|
1706
1720
|
useEffect4(() => {
|
|
1707
1721
|
const injectStyles = (obj, prefix = "") => {
|
|
1708
1722
|
Object.entries(obj).forEach(([key, val]) => {
|
|
@@ -1723,7 +1737,9 @@ function ITThemeProvider({
|
|
|
1723
1737
|
});
|
|
1724
1738
|
};
|
|
1725
1739
|
injectStyles(palette2);
|
|
1726
|
-
|
|
1740
|
+
if (showFab) {
|
|
1741
|
+
localStorage.setItem(STORAGE_KEY, JSON.stringify(palette2));
|
|
1742
|
+
}
|
|
1727
1743
|
let styleTag = document.getElementById(
|
|
1728
1744
|
"it-theme-dynamic-overrides"
|
|
1729
1745
|
);
|
|
@@ -2897,7 +2913,7 @@ function ITThemeProvider({
|
|
|
2897
2913
|
},
|
|
2898
2914
|
children: [
|
|
2899
2915
|
children,
|
|
2900
|
-
/* @__PURE__ */ jsx7(
|
|
2916
|
+
showFab && /* @__PURE__ */ jsx7(
|
|
2901
2917
|
"button",
|
|
2902
2918
|
{
|
|
2903
2919
|
onClick: () => setIsOpen((prev) => !prev),
|
|
@@ -2916,7 +2932,7 @@ function ITThemeProvider({
|
|
|
2916
2932
|
children: /* @__PURE__ */ jsx7(MdPalette, { style: { width: "28px", height: "28px" } })
|
|
2917
2933
|
}
|
|
2918
2934
|
),
|
|
2919
|
-
/* @__PURE__ */ jsx7(
|
|
2935
|
+
showFab && /* @__PURE__ */ jsx7(
|
|
2920
2936
|
ITDialog,
|
|
2921
2937
|
{
|
|
2922
2938
|
isOpen,
|