@veracity/vui 1.1.2 → 1.1.3
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/core/index.d.ts +1 -0
- package/dist/cjs/core/index.d.ts.map +1 -1
- package/dist/cjs/core/index.js +1 -0
- package/dist/cjs/core/media.d.ts +4 -3
- package/dist/cjs/core/media.d.ts.map +1 -1
- package/dist/cjs/core/types.d.ts +5 -0
- package/dist/cjs/core/types.d.ts.map +1 -0
- package/dist/cjs/core/types.js +2 -0
- package/dist/cjs/core/vuiProvider/vuiProvider.d.ts +2 -1
- package/dist/cjs/core/vuiProvider/vuiProvider.d.ts.map +1 -1
- package/dist/cjs/core/vuiProvider/vuiProvider.js +7 -9
- package/dist/cjs/modal/focusLock.d.ts +2 -1
- package/dist/cjs/modal/focusLock.d.ts.map +1 -1
- package/dist/cjs/portal/portal.d.ts +2 -1
- package/dist/cjs/portal/portal.d.ts.map +1 -1
- package/dist/esm/core/index.d.ts +1 -0
- package/dist/esm/core/index.d.ts.map +1 -1
- package/dist/esm/core/index.js +1 -0
- package/dist/esm/core/media.d.ts +4 -3
- package/dist/esm/core/media.d.ts.map +1 -1
- package/dist/esm/core/types.d.ts +5 -0
- package/dist/esm/core/types.d.ts.map +1 -0
- package/dist/esm/core/types.js +1 -0
- package/dist/esm/core/vuiProvider/vuiProvider.d.ts +2 -1
- package/dist/esm/core/vuiProvider/vuiProvider.d.ts.map +1 -1
- package/dist/esm/core/vuiProvider/vuiProvider.js +7 -9
- package/dist/esm/modal/focusLock.d.ts +2 -1
- package/dist/esm/modal/focusLock.d.ts.map +1 -1
- package/dist/esm/portal/portal.d.ts +2 -1
- package/dist/esm/portal/portal.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/index.ts +1 -0
- package/src/core/media.tsx +4 -3
- package/src/core/types.ts +5 -0
- package/src/core/vuiProvider/vuiProvider.tsx +13 -14
- package/src/modal/focusLock.tsx +2 -1
- package/src/portal/portal.tsx +2 -1
package/dist/cjs/core/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,eAAe,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,eAAe,CAAA"}
|
package/dist/cjs/core/index.js
CHANGED
|
@@ -19,5 +19,6 @@ __exportStar(require("./links"), exports);
|
|
|
19
19
|
__exportStar(require("./media"), exports);
|
|
20
20
|
__exportStar(require("./styled"), exports);
|
|
21
21
|
__exportStar(require("./theme"), exports);
|
|
22
|
+
__exportStar(require("./types"), exports);
|
|
22
23
|
__exportStar(require("./vui"), exports);
|
|
23
24
|
__exportStar(require("./vuiProvider"), exports);
|
package/dist/cjs/core/media.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { FC } from 'react';
|
|
|
2
2
|
import { StyledProps } from 'styled-components';
|
|
3
3
|
import { Screen } from '../theme';
|
|
4
4
|
import { AnyNumber, AnyString } from '../utils';
|
|
5
|
+
import { ChildrenProp } from './types';
|
|
5
6
|
declare type ScreenWidth = Screen | AnyNumber | AnyString;
|
|
6
7
|
export declare type RenderOnScreenProps = {
|
|
7
8
|
/** Changes direction to below the breakpoint. */
|
|
@@ -16,14 +17,14 @@ export declare const mediaDown: (width: ScreenWidth) => (props: StyledProps<unkn
|
|
|
16
17
|
/** Returns CSS media string with appropriate min-width value. */
|
|
17
18
|
export declare const mediaUp: (width: ScreenWidth) => (props: StyledProps<unknown>) => string;
|
|
18
19
|
/** Renders its content when viewport width is at or above 'md' breakpoint (default: 960px and more). */
|
|
19
|
-
export declare const RenderOnDesktop: FC<RenderOnScreenProps>;
|
|
20
|
+
export declare const RenderOnDesktop: FC<RenderOnScreenProps & ChildrenProp>;
|
|
20
21
|
/** Renders its content when viewport width is below 'md' breakpoint (default: below 960px). */
|
|
21
|
-
export declare const RenderOnMobile: FC<RenderOnScreenProps>;
|
|
22
|
+
export declare const RenderOnMobile: FC<RenderOnScreenProps & ChildrenProp>;
|
|
22
23
|
/**
|
|
23
24
|
* Renders its content when viewport width is at or above a provided breakpoint.
|
|
24
25
|
* Optionally, direction can be set to down, or below, the breakpoint.
|
|
25
26
|
*/
|
|
26
|
-
export declare const RenderOnScreen: FC<RenderOnScreenProps>;
|
|
27
|
+
export declare const RenderOnScreen: FC<RenderOnScreenProps & ChildrenProp>;
|
|
27
28
|
/** Returns true if current viewport width is between provided min and max widths. */
|
|
28
29
|
export declare function useBetween(minWidth: ScreenWidth, maxWidth: ScreenWidth): boolean;
|
|
29
30
|
/** Returns true if current viewport width is smaller than provided width. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../src/core/media.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../src/core/media.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,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0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAE3E,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC,OAAO,GAAG,aAAa,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,IAAI,CAAA;CACvG"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { VuiTheme } from '../../theme';
|
|
3
|
+
import { ChildrenProp } from '../types';
|
|
3
4
|
declare type VuiProviderProps = {
|
|
4
5
|
/** Adds basic styles to body @default true */
|
|
5
6
|
globalStyle?: boolean;
|
|
@@ -9,6 +10,6 @@ declare type VuiProviderProps = {
|
|
|
9
10
|
theme?: VuiTheme;
|
|
10
11
|
};
|
|
11
12
|
/** Provides theme to all wrapped components and by default includes CSS reset and global styles. */
|
|
12
|
-
declare const VuiProvider: FC<VuiProviderProps>;
|
|
13
|
+
declare const VuiProvider: FC<VuiProviderProps & ChildrenProp>;
|
|
13
14
|
export default VuiProvider;
|
|
14
15
|
//# sourceMappingURL=vuiProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vuiProvider.d.ts","sourceRoot":"","sources":["../../../../src/core/vuiProvider/vuiProvider.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAKjC,OAAqB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"vuiProvider.d.ts","sourceRoot":"","sources":["../../../../src/core/vuiProvider/vuiProvider.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAKjC,OAAqB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAIvC,aAAK,gBAAgB,GAAG;IACtB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,wDAAwD;IACxD,KAAK,CAAC,EAAE,QAAQ,CAAA;CACjB,CAAA;AAED,oGAAoG;AACpG,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,GAAG,YAAY,CAepD,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -11,13 +11,11 @@ const theme_1 = __importDefault(require("../../theme"));
|
|
|
11
11
|
const globalStyle_1 = __importDefault(require("./globalStyle"));
|
|
12
12
|
const resetCSS_1 = __importDefault(require("./resetCSS"));
|
|
13
13
|
/** Provides theme to all wrapped components and by default includes CSS reset and global styles. */
|
|
14
|
-
const VuiProvider = ({ children, globalStyle = true, resetCSS = true, theme = theme_1.default }) => {
|
|
15
|
-
|
|
16
|
-
react_1.default.createElement(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
children)));
|
|
22
|
-
};
|
|
14
|
+
const VuiProvider = ({ children, globalStyle = true, resetCSS = true, theme = theme_1.default }) => (react_1.default.createElement(styled_components_1.ThemeProvider, { theme: theme },
|
|
15
|
+
react_1.default.createElement(react_1.default.Fragment, null,
|
|
16
|
+
resetCSS && react_1.default.createElement(resetCSS_1.default, null),
|
|
17
|
+
react_1.default.createElement(globalStyle_1.default, { globalStyle: globalStyle }),
|
|
18
|
+
react_1.default.createElement(modalStyle_1.default, null),
|
|
19
|
+
react_1.default.createElement(popoverStyle_1.default, null),
|
|
20
|
+
children)));
|
|
23
21
|
exports.default = VuiProvider;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
+
import { ChildrenProp } from '../core/types';
|
|
2
3
|
import { FocusLockProps } from './focusLock.types';
|
|
3
4
|
/**
|
|
4
5
|
* Traps the focus within the provided content. That is, tabbing with keyboard will
|
|
5
6
|
* only cycle through the children and won't leave the boundary of the FocusLock.
|
|
6
7
|
* This behavior enhances accessibility of the Modal component.
|
|
7
8
|
*/
|
|
8
|
-
export declare const FocusLock: FC<FocusLockProps>;
|
|
9
|
+
export declare const FocusLock: FC<FocusLockProps & ChildrenProp>;
|
|
9
10
|
export default FocusLock;
|
|
10
11
|
//# sourceMappingURL=focusLock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focusLock.d.ts","sourceRoot":"","sources":["../../../src/modal/focusLock.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAe,MAAM,OAAO,CAAA;AAG9C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"focusLock.d.ts","sourceRoot":"","sources":["../../../src/modal/focusLock.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAe,MAAM,OAAO,CAAA;AAG9C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,GAAG,YAAY,CAmCvD,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
+
import { ChildrenProp } from '../core/types';
|
|
2
3
|
import { PortalProps } from './portal.types';
|
|
3
4
|
/** Provided children are portaled to document.body or custom container. */
|
|
4
|
-
export declare const Portal: FC<PortalProps>;
|
|
5
|
+
export declare const Portal: FC<PortalProps & ChildrenProp>;
|
|
5
6
|
export default Portal;
|
|
6
7
|
//# sourceMappingURL=portal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../src/portal/portal.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAA;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,2EAA2E;AAC3E,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../src/portal/portal.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAA;AAGtD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,2EAA2E;AAC3E,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,GAAG,YAAY,CAajD,CAAA;AAED,eAAe,MAAM,CAAA"}
|
package/dist/esm/core/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,eAAe,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,eAAe,CAAA"}
|
package/dist/esm/core/index.js
CHANGED
package/dist/esm/core/media.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { FC } from 'react';
|
|
|
2
2
|
import { StyledProps } from 'styled-components';
|
|
3
3
|
import { Screen } from '../theme';
|
|
4
4
|
import { AnyNumber, AnyString } from '../utils';
|
|
5
|
+
import { ChildrenProp } from './types';
|
|
5
6
|
declare type ScreenWidth = Screen | AnyNumber | AnyString;
|
|
6
7
|
export declare type RenderOnScreenProps = {
|
|
7
8
|
/** Changes direction to below the breakpoint. */
|
|
@@ -16,14 +17,14 @@ export declare const mediaDown: (width: ScreenWidth) => (props: StyledProps<unkn
|
|
|
16
17
|
/** Returns CSS media string with appropriate min-width value. */
|
|
17
18
|
export declare const mediaUp: (width: ScreenWidth) => (props: StyledProps<unknown>) => string;
|
|
18
19
|
/** Renders its content when viewport width is at or above 'md' breakpoint (default: 960px and more). */
|
|
19
|
-
export declare const RenderOnDesktop: FC<RenderOnScreenProps>;
|
|
20
|
+
export declare const RenderOnDesktop: FC<RenderOnScreenProps & ChildrenProp>;
|
|
20
21
|
/** Renders its content when viewport width is below 'md' breakpoint (default: below 960px). */
|
|
21
|
-
export declare const RenderOnMobile: FC<RenderOnScreenProps>;
|
|
22
|
+
export declare const RenderOnMobile: FC<RenderOnScreenProps & ChildrenProp>;
|
|
22
23
|
/**
|
|
23
24
|
* Renders its content when viewport width is at or above a provided breakpoint.
|
|
24
25
|
* Optionally, direction can be set to down, or below, the breakpoint.
|
|
25
26
|
*/
|
|
26
|
-
export declare const RenderOnScreen: FC<RenderOnScreenProps>;
|
|
27
|
+
export declare const RenderOnScreen: FC<RenderOnScreenProps & ChildrenProp>;
|
|
27
28
|
/** Returns true if current viewport width is between provided min and max widths. */
|
|
28
29
|
export declare function useBetween(minWidth: ScreenWidth, maxWidth: ScreenWidth): boolean;
|
|
29
30
|
/** Returns true if current viewport width is smaller than provided width. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../src/core/media.tsx"],"names":[],"m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AAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,GAAG,YAAY,CAGjE,CAAA;AAED,qFAAqF;AACrF,wBAAgB,UAAU,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,WAKtE;AAED,6EAA6E;AAC7E,wBAAgB,OAAO,CAAC,KAAK,EAAE,WAAW,WAIzC;AAED,oEAAoE;AACpE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,WAAW;;;EAO1C;AAED,wFAAwF;AACxF,wBAAgB,KAAK,CAAC,KAAK,EAAE,WAAW,WAIvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAE3E,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC,OAAO,GAAG,aAAa,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,IAAI,CAAA;CACvG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { VuiTheme } from '../../theme';
|
|
3
|
+
import { ChildrenProp } from '../types';
|
|
3
4
|
declare type VuiProviderProps = {
|
|
4
5
|
/** Adds basic styles to body @default true */
|
|
5
6
|
globalStyle?: boolean;
|
|
@@ -9,6 +10,6 @@ declare type VuiProviderProps = {
|
|
|
9
10
|
theme?: VuiTheme;
|
|
10
11
|
};
|
|
11
12
|
/** Provides theme to all wrapped components and by default includes CSS reset and global styles. */
|
|
12
|
-
declare const VuiProvider: FC<VuiProviderProps>;
|
|
13
|
+
declare const VuiProvider: FC<VuiProviderProps & ChildrenProp>;
|
|
13
14
|
export default VuiProvider;
|
|
14
15
|
//# sourceMappingURL=vuiProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vuiProvider.d.ts","sourceRoot":"","sources":["../../../../src/core/vuiProvider/vuiProvider.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAKjC,OAAqB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"vuiProvider.d.ts","sourceRoot":"","sources":["../../../../src/core/vuiProvider/vuiProvider.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAKjC,OAAqB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAIvC,aAAK,gBAAgB,GAAG;IACtB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,wDAAwD;IACxD,KAAK,CAAC,EAAE,QAAQ,CAAA;CACjB,CAAA;AAED,oGAAoG;AACpG,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,GAAG,YAAY,CAepD,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -6,13 +6,11 @@ import defaultTheme from '../../theme';
|
|
|
6
6
|
import GlobalStyle from './globalStyle';
|
|
7
7
|
import ResetCSS from './resetCSS';
|
|
8
8
|
/** Provides theme to all wrapped components and by default includes CSS reset and global styles. */
|
|
9
|
-
const VuiProvider = ({ children, globalStyle = true, resetCSS = true, theme = defaultTheme }) => {
|
|
10
|
-
|
|
11
|
-
React.createElement(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
children)));
|
|
17
|
-
};
|
|
9
|
+
const VuiProvider = ({ children, globalStyle = true, resetCSS = true, theme = defaultTheme }) => (React.createElement(ThemeProvider, { theme: theme },
|
|
10
|
+
React.createElement(React.Fragment, null,
|
|
11
|
+
resetCSS && React.createElement(ResetCSS, null),
|
|
12
|
+
React.createElement(GlobalStyle, { globalStyle: globalStyle }),
|
|
13
|
+
React.createElement(ModalStyle, null),
|
|
14
|
+
React.createElement(PopoverStyle, null),
|
|
15
|
+
children)));
|
|
18
16
|
export default VuiProvider;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
+
import { ChildrenProp } from '../core/types';
|
|
2
3
|
import { FocusLockProps } from './focusLock.types';
|
|
3
4
|
/**
|
|
4
5
|
* Traps the focus within the provided content. That is, tabbing with keyboard will
|
|
5
6
|
* only cycle through the children and won't leave the boundary of the FocusLock.
|
|
6
7
|
* This behavior enhances accessibility of the Modal component.
|
|
7
8
|
*/
|
|
8
|
-
export declare const FocusLock: FC<FocusLockProps>;
|
|
9
|
+
export declare const FocusLock: FC<FocusLockProps & ChildrenProp>;
|
|
9
10
|
export default FocusLock;
|
|
10
11
|
//# sourceMappingURL=focusLock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focusLock.d.ts","sourceRoot":"","sources":["../../../src/modal/focusLock.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAe,MAAM,OAAO,CAAA;AAG9C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"focusLock.d.ts","sourceRoot":"","sources":["../../../src/modal/focusLock.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAe,MAAM,OAAO,CAAA;AAG9C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,GAAG,YAAY,CAmCvD,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
+
import { ChildrenProp } from '../core/types';
|
|
2
3
|
import { PortalProps } from './portal.types';
|
|
3
4
|
/** Provided children are portaled to document.body or custom container. */
|
|
4
|
-
export declare const Portal: FC<PortalProps>;
|
|
5
|
+
export declare const Portal: FC<PortalProps & ChildrenProp>;
|
|
5
6
|
export default Portal;
|
|
6
7
|
//# sourceMappingURL=portal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../src/portal/portal.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAA;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,2EAA2E;AAC3E,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../src/portal/portal.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAA;AAGtD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,2EAA2E;AAC3E,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,GAAG,YAAY,CAajD,CAAA;AAED,eAAe,MAAM,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veracity/vui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
package/src/core/index.ts
CHANGED
package/src/core/media.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import { StyledProps } from 'styled-components'
|
|
|
5
5
|
import { Screen } from '../theme'
|
|
6
6
|
import { AnyNumber, AnyString } from '../utils'
|
|
7
7
|
import { th, useTheme } from './theme'
|
|
8
|
+
import { ChildrenProp } from './types'
|
|
8
9
|
|
|
9
10
|
type ScreenWidth = Screen | AnyNumber | AnyString
|
|
10
11
|
|
|
@@ -29,16 +30,16 @@ export const mediaUp = (width: ScreenWidth) => (props: StyledProps<unknown>) =>
|
|
|
29
30
|
`@media (min-width: ${th.screen(width)(props)})`
|
|
30
31
|
|
|
31
32
|
/** Renders its content when viewport width is at or above 'md' breakpoint (default: 960px and more). */
|
|
32
|
-
export const RenderOnDesktop: FC<RenderOnScreenProps> = props => <RenderOnScreen {...props} />
|
|
33
|
+
export const RenderOnDesktop: FC<RenderOnScreenProps & ChildrenProp> = props => <RenderOnScreen {...props} />
|
|
33
34
|
|
|
34
35
|
/** Renders its content when viewport width is below 'md' breakpoint (default: below 960px). */
|
|
35
|
-
export const RenderOnMobile: FC<RenderOnScreenProps> = props => <RenderOnScreen isDown {...props} />
|
|
36
|
+
export const RenderOnMobile: FC<RenderOnScreenProps & ChildrenProp> = props => <RenderOnScreen isDown {...props} />
|
|
36
37
|
|
|
37
38
|
/**
|
|
38
39
|
* Renders its content when viewport width is at or above a provided breakpoint.
|
|
39
40
|
* Optionally, direction can be set to down, or below, the breakpoint.
|
|
40
41
|
*/
|
|
41
|
-
export const RenderOnScreen: FC<RenderOnScreenProps> = ({ children, isDown, screen = 'md' }) => {
|
|
42
|
+
export const RenderOnScreen: FC<RenderOnScreenProps & ChildrenProp> = ({ children, isDown, screen = 'md' }) => {
|
|
42
43
|
const mediaFn = isDown ? useDown : useUp
|
|
43
44
|
return mediaFn(screen) ? <>{children}</> : null
|
|
44
45
|
}
|
|
@@ -4,6 +4,7 @@ import { ThemeProvider } from 'styled-components'
|
|
|
4
4
|
import ModalStyle from '../../modal/modalStyle'
|
|
5
5
|
import PopoverStyle from '../../popover/popoverStyle'
|
|
6
6
|
import defaultTheme, { VuiTheme } from '../../theme'
|
|
7
|
+
import { ChildrenProp } from '../types'
|
|
7
8
|
import GlobalStyle from './globalStyle'
|
|
8
9
|
import ResetCSS from './resetCSS'
|
|
9
10
|
|
|
@@ -17,23 +18,21 @@ type VuiProviderProps = {
|
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
/** Provides theme to all wrapped components and by default includes CSS reset and global styles. */
|
|
20
|
-
const VuiProvider: FC<VuiProviderProps> = ({
|
|
21
|
+
const VuiProvider: FC<VuiProviderProps & ChildrenProp> = ({
|
|
21
22
|
children,
|
|
22
23
|
globalStyle = true,
|
|
23
24
|
resetCSS = true,
|
|
24
25
|
theme = defaultTheme as VuiTheme
|
|
25
|
-
}) =>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
)
|
|
37
|
-
}
|
|
26
|
+
}) => (
|
|
27
|
+
<ThemeProvider theme={theme}>
|
|
28
|
+
<>
|
|
29
|
+
{resetCSS && <ResetCSS />}
|
|
30
|
+
<GlobalStyle globalStyle={globalStyle} />
|
|
31
|
+
<ModalStyle />
|
|
32
|
+
<PopoverStyle />
|
|
33
|
+
{children}
|
|
34
|
+
</>
|
|
35
|
+
</ThemeProvider>
|
|
36
|
+
)
|
|
38
37
|
|
|
39
38
|
export default VuiProvider
|
package/src/modal/focusLock.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { FC, useCallback } from 'react'
|
|
2
2
|
import ReactFocusLock from 'react-focus-lock'
|
|
3
3
|
|
|
4
|
+
import { ChildrenProp } from '../core/types'
|
|
4
5
|
import { FocusLockProps } from './focusLock.types'
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -8,7 +9,7 @@ import { FocusLockProps } from './focusLock.types'
|
|
|
8
9
|
* only cycle through the children and won't leave the boundary of the FocusLock.
|
|
9
10
|
* This behavior enhances accessibility of the Modal component.
|
|
10
11
|
*/
|
|
11
|
-
export const FocusLock: FC<FocusLockProps> = props => {
|
|
12
|
+
export const FocusLock: FC<FocusLockProps & ChildrenProp> = props => {
|
|
12
13
|
const {
|
|
13
14
|
autoFocus,
|
|
14
15
|
children,
|
package/src/portal/portal.tsx
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React, { FC, useEffect, useState } from 'react'
|
|
2
2
|
import { createPortal } from 'react-dom'
|
|
3
3
|
|
|
4
|
+
import { ChildrenProp } from '../core/types'
|
|
4
5
|
import { PortalProps } from './portal.types'
|
|
5
6
|
|
|
6
7
|
/** Provided children are portaled to document.body or custom container. */
|
|
7
|
-
export const Portal: FC<PortalProps> = props => {
|
|
8
|
+
export const Portal: FC<PortalProps & ChildrenProp> = props => {
|
|
8
9
|
const { children, containerRef, disablePortal } = props
|
|
9
10
|
const [mountNode, setMountNode] = useState<HTMLElement>()
|
|
10
11
|
|