@autoguru/overdrive 4.12.0 → 4.12.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/components/MinimalModal/MinimalModal.d.ts.map +1 -1
- package/dist/components/MinimalModal/MinimalModal.js +6 -0
- package/dist/components/Modal/Modal.d.ts +3 -2
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.js +6 -0
- package/dist/components/OverdriveProvider/OverdriveProvider.d.ts.map +1 -1
- package/dist/components/Section/Section.d.ts +1 -1
- package/dist/components/Section/Section.d.ts.map +1 -1
- package/dist/components/Section/Section.js +3 -1
- package/dist/components/StandardModal/StandardModal.d.ts.map +1 -1
- package/dist/components/StandardModal/StandardModal.js +6 -0
- package/dist/components/ThemeOverrideProvider/ThemeOverrideProvider.d.ts +1 -1
- package/dist/components/ThemeOverrideProvider/ThemeOverrideProvider.d.ts.map +1 -1
- package/dist/components/ThemeOverrideProvider/ThemeOverrideProvider.js +1 -1
- package/dist/components/ThemeOverrideProvider/useBuildThemeOverrides.d.ts +1 -1
- package/dist/components/ThemeOverrideProvider/useBuildThemeOverrides.d.ts.map +1 -1
- package/dist/components/ThemeOverrideProvider/useBuildThemeOverrides.js +17 -4
- package/dist/hooks/useDocumentBodyStyles/index.d.ts.map +1 -1
- package/dist/hooks/useDocumentBodyStyles/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinimalModal.d.ts","sourceRoot":"","sources":["../../../lib/components/MinimalModal/MinimalModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,cAAc,EACd,iBAAiB,EAEjB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,SAAS,EAA2B,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAIjC,MAAM,WAAW,KAChB,SAAQ,cAAc,CAAC,OAAO,KAAK,CAAC,EACnC,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,EAAE,YAAY,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"MinimalModal.d.ts","sourceRoot":"","sources":["../../../lib/components/MinimalModal/MinimalModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,cAAc,EACd,iBAAiB,EAEjB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,SAAS,EAA2B,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAIjC,MAAM,WAAW,KAChB,SAAQ,cAAc,CAAC,OAAO,KAAK,CAAC,EACnC,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,EAAE,YAAY,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,KAAK,CA4EjD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -12,6 +12,9 @@ export const MinimalModal = _ref => {
|
|
|
12
12
|
isOpen,
|
|
13
13
|
alignItems = 'center',
|
|
14
14
|
className = '',
|
|
15
|
+
container,
|
|
16
|
+
noThemedWrapper,
|
|
17
|
+
ref,
|
|
15
18
|
onRequestClose,
|
|
16
19
|
children
|
|
17
20
|
} = _ref;
|
|
@@ -35,6 +38,9 @@ export const MinimalModal = _ref => {
|
|
|
35
38
|
return _jsx(Modal, {
|
|
36
39
|
isOpen: isOpen,
|
|
37
40
|
onRequestClose: onRequestClose,
|
|
41
|
+
ref: ref,
|
|
42
|
+
noThemedWrapper: noThemedWrapper,
|
|
43
|
+
container: container,
|
|
38
44
|
children: _jsx(Box, {
|
|
39
45
|
className: [styles.container, className],
|
|
40
46
|
height: "full",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { ComponentType, FunctionComponent } from 'react';
|
|
1
|
+
import type { ComponentProps, ComponentType, FunctionComponent } from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
|
|
3
|
+
import { Portal } from '../Portal';
|
|
4
|
+
export interface Props extends ComponentProps<typeof Portal> {
|
|
4
5
|
isOpen: boolean;
|
|
5
6
|
hideBackdrop?: boolean;
|
|
6
7
|
children?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../lib/components/Modal/Modal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../lib/components/Modal/Modal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAEvF,OAAO,EAAE,SAAS,EAAyB,MAAM,OAAO,CAAC;AAKzD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAInC,MAAM,WAAW,KAAM,SAAQ,cAAc,CAAC,OAAO,MAAM,CAAC;IAC3D,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB,cAAc,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,eAAe,GAAG,MAAM,GAAG,IAAI,CAAC;CAChE;AAqDD,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,KAAK,CA4E1C,CAAC;AAEF,eAAO,MAAM,SAAS,wIAmBpB,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -65,6 +65,9 @@ export const Modal = _ref => {
|
|
|
65
65
|
let {
|
|
66
66
|
isOpen,
|
|
67
67
|
hideBackdrop = false,
|
|
68
|
+
ref,
|
|
69
|
+
noThemedWrapper,
|
|
70
|
+
container,
|
|
68
71
|
onRequestClose,
|
|
69
72
|
children
|
|
70
73
|
} = _ref;
|
|
@@ -86,6 +89,9 @@ export const Modal = _ref => {
|
|
|
86
89
|
return undefined;
|
|
87
90
|
}, [state]);
|
|
88
91
|
return _jsx(Portal, {
|
|
92
|
+
ref: ref,
|
|
93
|
+
noThemedWrapper: noThemedWrapper,
|
|
94
|
+
container: container,
|
|
89
95
|
children: state === 'OPENING' || state === 'OPEN' || state === 'CLOSING' ? _jsxs(FocusLock, {
|
|
90
96
|
returnFocus: true,
|
|
91
97
|
autoFocus: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverdriveProvider.d.ts","sourceRoot":"","sources":["../../../lib/components/OverdriveProvider/OverdriveProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"OverdriveProvider.d.ts","sourceRoot":"","sources":["../../../lib/components/OverdriveProvider/OverdriveProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAGhF,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,MAAM,WAAW,KAAM,SAAQ,cAAc,CAAC,OAAO,aAAa,CAAC;IAIlE,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,KAAK,CAwBtD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentProps, FunctionComponent, ReactNode } from 'react';
|
|
2
2
|
import { Box } from '../Box';
|
|
3
3
|
import * as styles from './Section.css';
|
|
4
|
-
export interface Props extends Pick<ComponentProps<typeof Box>, 'paddingX'> {
|
|
4
|
+
export interface Props extends Pick<ComponentProps<typeof Box>, 'paddingX' | 'ref'> {
|
|
5
5
|
width?: keyof typeof styles.width;
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../../../lib/components/Section/Section.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErE,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE7B,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,MAAM,WAAW,KAAM,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,EAAE,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../../../lib/components/Section/Section.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErE,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE7B,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,MAAM,WAAW,KAAM,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,EAAE,UAAU,GAAG,KAAK,CAAC;IAClF,KAAK,CAAC,EAAE,MAAM,OAAO,MAAM,CAAC,KAAK,CAAC;IAClC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAc5C,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardModal.d.ts","sourceRoot":"","sources":["../../../lib/components/StandardModal/StandardModal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"StandardModal.d.ts","sourceRoot":"","sources":["../../../lib/components/StandardModal/StandardModal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAqB,MAAM,OAAO,CAAC;AASlF,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAKjC,oBAAY,KAAK;IAChB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,QAAQ,aAAa;CACrB;AAED,aAAK,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE7C,MAAM,WAAW,KAAM,SAAQ,cAAc,CAAC,OAAO,KAAK,CAAC;IAC1D,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,aAAa,EAAE,iBAAiB,CAAC,KAAK,CA6HlD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -26,6 +26,9 @@ export const StandardModal = _ref => {
|
|
|
26
26
|
size = 'standard',
|
|
27
27
|
className = '',
|
|
28
28
|
title,
|
|
29
|
+
container,
|
|
30
|
+
noThemedWrapper,
|
|
31
|
+
ref,
|
|
29
32
|
onRequestClose,
|
|
30
33
|
children
|
|
31
34
|
} = _ref;
|
|
@@ -51,6 +54,9 @@ export const StandardModal = _ref => {
|
|
|
51
54
|
}
|
|
52
55
|
return _jsx(Modal, {
|
|
53
56
|
isOpen: isOpen,
|
|
57
|
+
ref: ref,
|
|
58
|
+
noThemedWrapper: noThemedWrapper,
|
|
59
|
+
container: container,
|
|
54
60
|
onRequestClose: onRequestClose,
|
|
55
61
|
children: _jsx(Box, {
|
|
56
62
|
className: styles.container,
|
|
@@ -13,7 +13,7 @@ export interface ThemeOverridesValues {
|
|
|
13
13
|
overrideStyles: ReturnType<typeof assignInlineVars>;
|
|
14
14
|
setThemeValues: (values: Partial<OverrideValues>) => void;
|
|
15
15
|
}
|
|
16
|
-
interface Props extends Pick<ThemeOverridesValues, '
|
|
16
|
+
interface Props extends Pick<ThemeOverridesValues, 'theme' | 'primaryColourBackgroundMild' | 'primaryColourBackgroundStrong' | 'primaryColourBorder'>, Partial<Pick<ThemeOverridesValues, 'primaryColourBackground' | 'primaryColourForeground'>> {
|
|
17
17
|
children?: ReactNode | ReactNode[];
|
|
18
18
|
}
|
|
19
19
|
export declare const useThemeOverrides: () => ThemeOverridesValues;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeOverrideProvider.d.ts","sourceRoot":"","sources":["../../../lib/components/ThemeOverrideProvider/ThemeOverrideProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,
|
|
1
|
+
{"version":3,"file":"ThemeOverrideProvider.d.ts","sourceRoot":"","sources":["../../../lib/components/ThemeOverrideProvider/ThemeOverrideProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAA0B,iBAAiB,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAElG,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,cAAc,EAA0B,MAAM,0BAA0B,CAAC;AAElF,aAAK,KAAK,GAAG,OAAO,YAAY,CAAC;AAEjC,MAAM,WAAW,oBAAoB;IACpC,uBAAuB,EAAE,MAAM,CAAC;IAChC,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,uBAAuB,EAAE,MAAM,CAAC;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,cAAc,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;IAEpD,cAAc,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;CAC1D;AAED,UAAU,KACT,SAAQ,IAAI,CACX,oBAAoB,EAClB,OAAO,GACP,6BAA6B,GAC7B,+BAA+B,GAC/B,qBAAqB,CACvB,EAAE,OAAO,CAAC,IAAI,CACd,oBAAoB,EAClB,yBAAyB,GACzB,yBAAyB,CAC3B,CAAC;IACF,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;CACnC;AAKD,eAAO,MAAM,iBAAiB,4BAAsC,CAAC;AAErE,eAAO,MAAM,qBAAqB,EAAE,iBAAiB,CAAC,KAAK,CAuC1D,CAAC"}
|
|
@@ -30,7 +30,7 @@ export const ThemeOverrideProvider = _ref => {
|
|
|
30
30
|
return _jsx(themeOverridesCtx.Provider, {
|
|
31
31
|
value: useMemo(() => _objectSpread({
|
|
32
32
|
theme
|
|
33
|
-
}, overrides), [theme, overrides, primaryColourBackground, primaryColourForeground,
|
|
33
|
+
}, overrides), [theme, overrides, primaryColourBackground, primaryColourForeground, primaryColourBackgroundMild, primaryColourBackgroundStrong, primaryColourBorder]),
|
|
34
34
|
children: children
|
|
35
35
|
});
|
|
36
36
|
};
|
|
@@ -12,6 +12,6 @@ export interface OverrideValues {
|
|
|
12
12
|
primaryColourBackgroundStrong?: string;
|
|
13
13
|
primaryColourBorder?: string;
|
|
14
14
|
}
|
|
15
|
-
export declare const useBuildThemeOverrides: ({ primaryColourBackground: incomingPrimaryColourBackground, primaryColourForeground: incomingPrimaryColourForeground,
|
|
15
|
+
export declare const useBuildThemeOverrides: ({ mode, primaryColourBackground: incomingPrimaryColourBackground, primaryColourForeground: incomingPrimaryColourForeground, primaryColourBackgroundStrong: incomingPrimaryColourBackgroundStrong, primaryColourBackgroundMild: incomingPrimaryColourBackgroundMild, primaryColourBorder: incomingPrimaryColourBorder, }: Props) => Returns;
|
|
16
16
|
export {};
|
|
17
17
|
//# sourceMappingURL=useBuildThemeOverrides.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBuildThemeOverrides.d.ts","sourceRoot":"","sources":["../../../lib/components/ThemeOverrideProvider/useBuildThemeOverrides.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"useBuildThemeOverrides.d.ts","sourceRoot":"","sources":["../../../lib/components/ThemeOverrideProvider/useBuildThemeOverrides.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAA2C,MAAM,OAAO,CAAC;AAKhF,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEtF,UAAU,KACT,SAAQ,IAAI,CACX,cAAc,CAAC,OAAO,qBAAqB,CAAC,EAC5C,OAAO,GAAG,UAAU,CACpB;IACD,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;CACrB;AAED,aAAK,OAAO,GAAG,IAAI,CAClB,oBAAoB,EAClB,gBAAgB,GAChB,yBAAyB,GACzB,yBAAyB,GACzB,qBAAqB,GACrB,6BAA6B,GAC7B,+BAA+B,GAC/B,gBAAgB,CAClB,CAAC;AAOF,MAAM,WAAW,cAAc;IAC9B,uBAAuB,EAAE,MAAM,CAAC;IAChC,uBAAuB,EAAE,MAAM,CAAC;IAChC,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAeD,eAAO,MAAM,sBAAsB,4TAOpB,KAAK,KAAG,OA0GtB,CAAC"}
|
|
@@ -6,7 +6,8 @@ const _excluded = ["primaryColourBorder", "primaryColourForeground", "primaryCol
|
|
|
6
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
8
|
import { assignInlineVars } from '@vanilla-extract/dynamic';
|
|
9
|
-
import { useMemo, useReducer } from 'react';
|
|
9
|
+
import { useEffect, useMemo, useReducer } from 'react';
|
|
10
|
+
import { tokens } from "../../themes/base/tokens.js";
|
|
10
11
|
import { shadedColour } from "../../themes/helpers.js";
|
|
11
12
|
import { themeContractVars } from "../../themes/theme.css.js";
|
|
12
13
|
const reducer = (prevState, action) => {
|
|
@@ -21,9 +22,9 @@ const reducer = (prevState, action) => {
|
|
|
21
22
|
};
|
|
22
23
|
export const useBuildThemeOverrides = _ref => {
|
|
23
24
|
let {
|
|
24
|
-
primaryColourBackground: incomingPrimaryColourBackground,
|
|
25
|
-
primaryColourForeground: incomingPrimaryColourForeground,
|
|
26
25
|
mode,
|
|
26
|
+
primaryColourBackground: incomingPrimaryColourBackground = tokens.colours.intent.primary.background.standard,
|
|
27
|
+
primaryColourForeground: incomingPrimaryColourForeground = tokens.colours.intent.primary.foreground,
|
|
27
28
|
primaryColourBackgroundStrong: incomingPrimaryColourBackgroundStrong,
|
|
28
29
|
primaryColourBackgroundMild: incomingPrimaryColourBackgroundMild,
|
|
29
30
|
primaryColourBorder: incomingPrimaryColourBorder
|
|
@@ -43,6 +44,18 @@ export const useBuildThemeOverrides = _ref => {
|
|
|
43
44
|
primaryColourBackground
|
|
44
45
|
} = _ref2,
|
|
45
46
|
extraColours = _objectWithoutProperties(_ref2, _excluded);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
dispatch({
|
|
49
|
+
type: 'SET_THEME_VALUES',
|
|
50
|
+
payload: {
|
|
51
|
+
primaryColourBackground: incomingPrimaryColourBackground,
|
|
52
|
+
primaryColourForeground: incomingPrimaryColourForeground,
|
|
53
|
+
primaryColourBorder: incomingPrimaryColourBorder,
|
|
54
|
+
primaryColourBackgroundMild: incomingPrimaryColourBackgroundMild,
|
|
55
|
+
primaryColourBackgroundStrong: incomingPrimaryColourBackgroundStrong
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}, [mode, incomingPrimaryColourBackground, incomingPrimaryColourForeground, incomingPrimaryColourBackgroundStrong, incomingPrimaryColourBackgroundMild, incomingPrimaryColourBorder]);
|
|
46
59
|
const overrideStyles = useMemo(() => {
|
|
47
60
|
const mildPrimary = primaryColourBackgroundMild || shadedColour({
|
|
48
61
|
colour: primaryColourBackground,
|
|
@@ -76,7 +89,7 @@ export const useBuildThemeOverrides = _ref => {
|
|
|
76
89
|
}
|
|
77
90
|
}
|
|
78
91
|
}));
|
|
79
|
-
}, [primaryColourBackground, primaryColourBackgroundMild, primaryColourBackgroundStrong, primaryColourBorder, primaryColourForeground, incomingPrimaryColourBackground, incomingPrimaryColourForeground,
|
|
92
|
+
}, [primaryColourBackground, primaryColourBackgroundMild, primaryColourBackgroundStrong, primaryColourBorder, primaryColourForeground, mode, incomingPrimaryColourBackground, incomingPrimaryColourForeground, incomingPrimaryColourBackgroundStrong, incomingPrimaryColourBackgroundMild, incomingPrimaryColourBorder, extraColours]);
|
|
80
93
|
return useMemo(() => ({
|
|
81
94
|
overrideStyles,
|
|
82
95
|
primaryColourBackground,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/hooks/useDocumentBodyStyles/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/hooks/useDocumentBodyStyles/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,qBAAqB,YAOjC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { tokens } from "../../themes/base/tokens.js";
|
|
4
3
|
import { useEffect } from 'react';
|
|
4
|
+
import { tokens } from "../../themes/base/tokens.js";
|
|
5
5
|
import { isBrowser } from "../../utils/index.js";
|
|
6
6
|
export const useDocumentBodyStyles = () => {
|
|
7
7
|
useEffect(() => {
|