@antscorp/antsomi-ui 1.3.7-beta.55 → 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 }), _jsx(QueryDevtoolsAntsomiUI, { position: "bottom" })] }) }) }) }));
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;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- interface GlobalStyleProps {
2
+ export interface GlobalStyleProps {
3
+ resetStyles?: boolean;
3
4
  }
4
5
  export declare const GlobalStyle: React.FC<GlobalStyleProps>;
5
- export {};
@@ -9,16 +9,17 @@ 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 = () => (_jsx(Global, { styles: css `
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
- @layer antsomi-reset {
16
- :root {
17
- --divider-1: ${bw3};
18
- --divider-2: ${bw4};
19
- --divider-3: ${bw5};
20
- }
15
+ :root {
16
+ --divider-1: ${bw3};
17
+ --divider-2: ${bw4};
18
+ --divider-3: ${bw5};
19
+ }
21
20
 
21
+ ${props.resetStyles !== false &&
22
+ `
22
23
  *,
23
24
  *:before,
24
25
  *:after {
@@ -82,7 +83,7 @@ export const GlobalStyle = () => (_jsx(Global, { styles: css `
82
83
  hr {
83
84
  border-color: var(--divider-1);
84
85
  }
85
- }
86
+ `}
86
87
 
87
88
  .rc-virtual-list-scrollbar {
88
89
  width: 4px !important;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.7-beta.55",
3
+ "version": "1.3.7-beta.56",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",