@antscorp/antsomi-ui 1.3.7-beta.54 → 1.3.7-beta.56
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,6 +1,7 @@
|
|
|
1
1
|
import { ConfigProviderProps as AntdConfigProviderProps } from 'antd/es/config-provider';
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
3
|
import '@antscorp/antsomi-ui/es/assets/css/main.scss';
|
|
4
|
+
import { type GlobalStyleProps } from './GlobalStyle';
|
|
4
5
|
import { TLocale } from '@antscorp/antsomi-ui/es/types';
|
|
5
6
|
import 'animate.css';
|
|
6
7
|
import { AppConfigProviderProps } from '../AppConfigProvider/contexts';
|
|
@@ -8,6 +9,7 @@ interface ConfigProviderProps extends Omit<AntdConfigProviderProps, 'locale'> {
|
|
|
8
9
|
children?: ReactNode;
|
|
9
10
|
locale?: TLocale;
|
|
10
11
|
appConfig?: AppConfigProviderProps;
|
|
12
|
+
globalStyle?: GlobalStyleProps;
|
|
11
13
|
}
|
|
12
14
|
declare const ConfigProvider: React.FC<ConfigProviderProps>;
|
|
13
15
|
export default ConfigProvider;
|
|
@@ -22,7 +22,6 @@ import 'animate.css';
|
|
|
22
22
|
import { AppConfigProvider } from '../AppConfigProvider/contexts';
|
|
23
23
|
// Hooks
|
|
24
24
|
import { useMutationObserver } from '../../hooks';
|
|
25
|
-
import { QueryDevtoolsAntsomiUI } from '../../queries';
|
|
26
25
|
// Providers
|
|
27
26
|
// import {
|
|
28
27
|
// QueryClientProviderAntsomiUI,
|
|
@@ -37,7 +36,7 @@ dayjs.extend(timezone);
|
|
|
37
36
|
dayjs.extend(relativeTime);
|
|
38
37
|
const ConfigProvider = props => {
|
|
39
38
|
// Props
|
|
40
|
-
const { children, locale, appConfig, theme = THEME, prefixCls = ANTSOMI_COMPONENT_PREFIX_CLS, ...restOfProps } = props;
|
|
39
|
+
const { children, locale, appConfig, theme = THEME, prefixCls = ANTSOMI_COMPONENT_PREFIX_CLS, globalStyle = {}, ...restOfProps } = props;
|
|
41
40
|
// Refs
|
|
42
41
|
const ref = useRef(null);
|
|
43
42
|
// Handlers
|
|
@@ -82,6 +81,6 @@ const ConfigProvider = props => {
|
|
|
82
81
|
const containers = document.getElementsByClassName('antsomi-scroll-box');
|
|
83
82
|
handleScrollAction(Array.from(containers));
|
|
84
83
|
}, []);
|
|
85
|
-
return (_jsx(AntdConfigProvider, { theme: theme, prefixCls: prefixCls, ...restOfProps, children: _jsx(AppConfigProvider, { value: appConfig, children: _jsx("div", { ref: ref, children: _jsxs(App, { children: [_jsx(GlobalStyle, {}), _jsx(StyleProvider, { hashPriority: "high", children: children })
|
|
84
|
+
return (_jsx(AntdConfigProvider, { theme: theme, prefixCls: prefixCls, ...restOfProps, children: _jsx(AppConfigProvider, { value: appConfig, children: _jsx("div", { ref: ref, children: _jsxs(App, { children: [_jsx(GlobalStyle, { ...globalStyle }), _jsx(StyleProvider, { hashPriority: "high", children: children })] }) }) }) }));
|
|
86
85
|
};
|
|
87
86
|
export default ConfigProvider;
|
|
@@ -9,7 +9,7 @@ import { far } from '@fortawesome/free-regular-svg-icons';
|
|
|
9
9
|
import { fab } from '@fortawesome/free-brands-svg-icons';
|
|
10
10
|
library.add(fas, far, fab);
|
|
11
11
|
const { accent7, gray5, scrollBarSize, bw3, bw4, bw5 } = THEME.token || {};
|
|
12
|
-
export const GlobalStyle =
|
|
12
|
+
export const GlobalStyle = props => (_jsx(Global, { styles: css `
|
|
13
13
|
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&display=swap');
|
|
14
14
|
|
|
15
15
|
:root {
|
|
@@ -18,69 +18,72 @@ export const GlobalStyle = () => (_jsx(Global, { styles: css `
|
|
|
18
18
|
--divider-3: ${bw5};
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
21
|
+
${props.resetStyles !== false &&
|
|
22
|
+
`
|
|
23
|
+
*,
|
|
24
|
+
*:before,
|
|
25
|
+
*:after {
|
|
26
|
+
-webkit-box-sizing: border-box;
|
|
27
|
+
-moz-box-sizing: border-box;
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
border-width: 0;
|
|
30
|
+
border-style: solid;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
blockquote,
|
|
34
|
+
dl,
|
|
35
|
+
dd,
|
|
36
|
+
h1,
|
|
37
|
+
h2,
|
|
38
|
+
h3,
|
|
39
|
+
h4,
|
|
40
|
+
h5,
|
|
41
|
+
h6,
|
|
42
|
+
hr,
|
|
43
|
+
figure,
|
|
44
|
+
p,
|
|
45
|
+
pre {
|
|
46
|
+
margin: 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
h1,
|
|
50
|
+
h2,
|
|
51
|
+
h3,
|
|
52
|
+
h4,
|
|
53
|
+
h5,
|
|
54
|
+
h6 {
|
|
55
|
+
font-size: inherit;
|
|
56
|
+
font-weight: inherit;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
ol,
|
|
60
|
+
ul {
|
|
61
|
+
list-style: none;
|
|
62
|
+
margin: 0;
|
|
63
|
+
padding: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
img,
|
|
67
|
+
svg,
|
|
68
|
+
video,
|
|
69
|
+
canvas,
|
|
70
|
+
audio,
|
|
71
|
+
iframe,
|
|
72
|
+
embed,
|
|
73
|
+
object {
|
|
74
|
+
vertical-align: middle;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
img,
|
|
78
|
+
video {
|
|
79
|
+
max-width: 100%;
|
|
80
|
+
height: auto;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
hr {
|
|
84
|
+
border-color: var(--divider-1);
|
|
85
|
+
}
|
|
86
|
+
`}
|
|
84
87
|
|
|
85
88
|
.rc-virtual-list-scrollbar {
|
|
86
89
|
width: 4px !important;
|