@broxus/react-uikit 0.15.0 → 0.15.2
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/cjs/components/Cover/index.js +8 -4
- package/dist/cjs/components/Inverse/index.d.ts +2 -2
- package/dist/cjs/components/Inverse/index.js +6 -2
- package/dist/cjs/components/Text/index.scss +2 -0
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/components/Cover/index.js +9 -5
- package/dist/esm/components/Inverse/index.d.ts +2 -2
- package/dist/esm/components/Inverse/index.js +7 -3
- package/dist/esm/components/Text/index.scss +2 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dimensions, debounce } from '@broxus/js-utils';
|
|
1
|
+
import { Dimensions, debounce, isBrowser } from '@broxus/js-utils';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useConfig } from '../../components/ConfigProvider';
|
|
@@ -60,12 +60,16 @@ export function Cover(props) {
|
|
|
60
60
|
})?.pop();
|
|
61
61
|
React.useEffect(() => {
|
|
62
62
|
const debounced = debounce(resize, 50);
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
if (isBrowser()) {
|
|
64
|
+
window.addEventListener('resize', debounced);
|
|
65
|
+
window.addEventListener('orientationchange', debounced);
|
|
66
|
+
}
|
|
65
67
|
resize();
|
|
66
68
|
return () => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
if (isBrowser()) {
|
|
70
|
+
window.removeEventListener('resize', debounced);
|
|
71
|
+
window.removeEventListener('orientationchange', debounced);
|
|
72
|
+
}
|
|
69
73
|
};
|
|
70
74
|
}, [resize]);
|
|
71
75
|
return (React.createElement("div", { ref: container, className: classNames(`${rootCls}-container`, className), ...restProps }, childrenWithCoverClass));
|
|
@@ -11,8 +11,8 @@ export interface InverseConfig {
|
|
|
11
11
|
export interface InverseProviderProps {
|
|
12
12
|
globalDarkClassName?: string;
|
|
13
13
|
globalLightClassName?: string;
|
|
14
|
-
primaryColorDark
|
|
15
|
-
primaryColorLight
|
|
14
|
+
primaryColorDark?: string;
|
|
15
|
+
primaryColorLight?: string;
|
|
16
16
|
}
|
|
17
17
|
export declare const lib: Record<ColorMode, () => React.JSX.Element>;
|
|
18
18
|
export declare const InverseContext: React.Context<InverseConfig | null>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { addClass, removeClass, storage } from '@broxus/js-utils';
|
|
2
|
+
import { addClass, isBrowser, removeClass, storage } from '@broxus/js-utils';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useContext } from '../../hooks';
|
|
5
5
|
export var ColorMode;
|
|
@@ -42,9 +42,13 @@ export const InverseProvider = React.memo(({ children, globalDarkClassName = 'tm
|
|
|
42
42
|
addClass(document.documentElement, colorMode === ColorMode.Dark ? globalLightClassName : globalDarkClassName);
|
|
43
43
|
}, [colorMode, globalDarkClassName, globalLightClassName]);
|
|
44
44
|
React.useEffect(() => {
|
|
45
|
-
|
|
45
|
+
if (isBrowser()) {
|
|
46
|
+
window.addEventListener('storage', onChangeStorageValue);
|
|
47
|
+
}
|
|
46
48
|
return () => {
|
|
47
|
-
|
|
49
|
+
if (isBrowser()) {
|
|
50
|
+
window.removeEventListener('storage', onChangeStorageValue);
|
|
51
|
+
}
|
|
48
52
|
};
|
|
49
53
|
}, [onChangeStorageValue]);
|
|
50
54
|
return React.createElement(InverseContext.Provider, { value: context }, children);
|
|
@@ -122,6 +122,7 @@
|
|
|
122
122
|
.uk-text-emphasis { color: var(--text-emphasis-color) !important; }
|
|
123
123
|
.uk-text-primary { color: var(--text-primary-color) !important; }
|
|
124
124
|
.uk-text-secondary { color: var(--text-secondary-color) !important; }
|
|
125
|
+
.uk-text-tertiary { color: var(--text-tertiary-color) !important; }
|
|
125
126
|
.uk-text-success { color: var(--text-success-color) !important; }
|
|
126
127
|
.uk-text-warning { color: var(--text-warning-color) !important; }
|
|
127
128
|
.uk-text-danger { color: var(--text-danger-color) !important; }
|
|
@@ -299,6 +300,7 @@ td.uk-text-break { word-break: break-all; }
|
|
|
299
300
|
--text-emphasis-color: var(--global-emphasis-color);
|
|
300
301
|
--text-primary-color: var(--global-primary-background);
|
|
301
302
|
--text-secondary-color: var(--global-secondary-background);
|
|
303
|
+
--text-tertiary-color: var(--global-tertiary-background);
|
|
302
304
|
--text-success-color: var(--global-success-background);
|
|
303
305
|
--text-warning-color: var(--global-warning-background);
|
|
304
306
|
--text-danger-color: var(--global-danger-background);
|