@sinco/react 1.0.11-rc.0 → 1.0.11-rc.1
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +26 -26
- package/package.json +1 -1
- package/src/index.d.ts +4 -0
- package/src/lib/Hooks/index.d.ts +1 -0
- package/src/lib/Utils/DynamicColor.d.ts +1 -2
- package/src/Index.d.ts +0 -4
- package/src/lib/Hooks/Index.d.ts +0 -1
- /package/src/lib/Components/{Index.d.ts → index.d.ts} +0 -0
- /package/src/lib/Hooks/{UseDynamicColor.d.ts → useDynamicColor.d.ts} +0 -0
- /package/src/lib/Theme/{Index.d.ts → index.d.ts} +0 -0
- /package/src/lib/Utils/{Index.d.ts → index.d.ts} +0 -0
package/index.js
CHANGED
@@ -17467,6 +17467,31 @@ const PageHeaderComponent = ({
|
|
17467
17467
|
}, actions)))));
|
17468
17468
|
};
|
17469
17469
|
|
17470
|
+
const UseDynamicColor = url => {
|
17471
|
+
const [primary, setPrimary] = useState(SincoTheme.palette.primary);
|
17472
|
+
const [secondary, setSecondary] = useState(SincoTheme.palette.secondary);
|
17473
|
+
const [background, setBackground] = useState(SincoTheme.palette.background);
|
17474
|
+
const [loading, setLoading] = useState(false);
|
17475
|
+
useEffect(() => {
|
17476
|
+
DynamicColor(url).then(({
|
17477
|
+
primaryColor,
|
17478
|
+
secondaryColor,
|
17479
|
+
backgroundColor
|
17480
|
+
}) => {
|
17481
|
+
setPrimary(primaryColor);
|
17482
|
+
setSecondary(secondaryColor);
|
17483
|
+
setBackground(backgroundColor);
|
17484
|
+
setLoading(true);
|
17485
|
+
});
|
17486
|
+
}, [url]);
|
17487
|
+
SincoTheme.palette.primary = primary;
|
17488
|
+
SincoTheme.palette.secondary = secondary;
|
17489
|
+
SincoTheme.palette.background = background;
|
17490
|
+
return {
|
17491
|
+
loading
|
17492
|
+
};
|
17493
|
+
};
|
17494
|
+
|
17470
17495
|
var classof$2 = classofRaw$2;
|
17471
17496
|
|
17472
17497
|
var engineIsNode = typeof process != 'undefined' && classof$2(process) == 'process';
|
@@ -22897,29 +22922,4 @@ const DynamicColor = async src => {
|
|
22897
22922
|
};
|
22898
22923
|
};
|
22899
22924
|
|
22900
|
-
|
22901
|
-
const [primary, setPrimary] = useState(SincoTheme.palette.primary);
|
22902
|
-
const [secondary, setSecondary] = useState(SincoTheme.palette.secondary);
|
22903
|
-
const [background, setBackground] = useState(SincoTheme.palette.background);
|
22904
|
-
const [loading, setLoading] = useState(false);
|
22905
|
-
useEffect(() => {
|
22906
|
-
DynamicColor(url).then(({
|
22907
|
-
primaryColor,
|
22908
|
-
secondaryColor,
|
22909
|
-
backgroundColor
|
22910
|
-
}) => {
|
22911
|
-
setPrimary(primaryColor);
|
22912
|
-
setSecondary(secondaryColor);
|
22913
|
-
setBackground(backgroundColor);
|
22914
|
-
setLoading(true);
|
22915
|
-
});
|
22916
|
-
}, [url]);
|
22917
|
-
SincoTheme.palette.primary = primary;
|
22918
|
-
SincoTheme.palette.secondary = secondary;
|
22919
|
-
SincoTheme.palette.background = background;
|
22920
|
-
return {
|
22921
|
-
loading
|
22922
|
-
};
|
22923
|
-
};
|
22924
|
-
|
22925
|
-
export { DrawerComponent, EmptyStateComponent, EmptyStateImageUrls, PageHeaderComponent, PageHeaderContent, SincoTheme, ToastNotification, UseDynamicColor };
|
22925
|
+
export { DrawerComponent, DynamicColor, EmptyStateComponent, EmptyStateImageUrls, PageHeaderComponent, PageHeaderContent, SincoTheme, ToastNotification, UseDynamicColor };
|
package/package.json
CHANGED
package/src/index.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export * from './useDynamicColor';
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { PaletteColor, TypeBackground } from "@mui/material";
|
2
|
-
declare const DynamicColor: (src: string) => Promise<{
|
2
|
+
export declare const DynamicColor: (src: string) => Promise<{
|
3
3
|
primaryColor: PaletteColor;
|
4
4
|
secondaryColor: PaletteColor;
|
5
5
|
backgroundColor: TypeBackground;
|
6
6
|
}>;
|
7
|
-
export default DynamicColor;
|
package/src/Index.d.ts
DELETED
package/src/lib/Hooks/Index.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './UseDynamicColor';
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|