@autoguru/overdrive 4.11.4 → 4.12.0
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/Columns/Column.d.ts +1 -1
- package/dist/components/Columns/Columns.d.ts +1 -1
- package/dist/components/OverdriveProvider/OverdriveProvider.d.ts +1 -1
- package/dist/components/OverdriveProvider/OverdriveProvider.d.ts.map +1 -1
- package/dist/components/OverdriveProvider/OverdriveProvider.js +5 -11
- package/dist/components/Portal/Portal.d.ts +2 -2
- package/dist/components/Portal/Portal.d.ts.map +1 -1
- package/dist/components/Portal/Portal.js +10 -4
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +3 -4
- package/dist/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/components/ThemeProvider/ThemeProvider.js +4 -2
- package/dist/hooks/useDocumentBodyStyles/index.d.ts +2 -0
- package/dist/hooks/useDocumentBodyStyles/index.d.ts.map +1 -0
- package/dist/hooks/useDocumentBodyStyles/index.js +12 -0
- package/package.json +1 -1
|
@@ -11,6 +11,6 @@ export interface Props extends Omit<ComponentProps<typeof Box>, 'width' | 'css'>
|
|
|
11
11
|
className?: string;
|
|
12
12
|
children: ReactNode | ReactNode[];
|
|
13
13
|
}
|
|
14
|
-
export declare const Column: React.ForwardRefExoticComponent<Pick<Props, "
|
|
14
|
+
export declare const Column: React.ForwardRefExoticComponent<Pick<Props, "value" | "id" | "colour" | "backgroundColour" | "width" | "min" | "size" | "muted" | "name" | "alignItems" | "alignSelf" | "boxShadow" | "color" | "content" | "display" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "height" | "justifyContent" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "opacity" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "pointerEvents" | "position" | "textAlign" | "translate" | "userSelect" | "borderRadius" | "borderWidth" | "margin" | "overflow" | "padding" | "start" | "hidden" | "style" | "default" | "wrap" | "open" | "multiple" | "disabled" | "children" | "cite" | "data" | "form" | "label" | "slot" | "span" | "summary" | "title" | "pattern" | "key" | "is" | "className" | "paddingX" | "paddingY" | "marginX" | "marginY" | "borderWidthX" | "borderWidthY" | "borderWidthTop" | "borderWidthRight" | "borderWidthBottom" | "borderWidthLeft" | "borderColour" | "borderColourX" | "borderColourY" | "borderColourTop" | "borderColourRight" | "borderColourBottom" | "borderColourLeft" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "minLength" | "nonce" | "noValidate" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "target" | "type" | "useMap" | "wmode" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "noShrink" | "grow"> & React.RefAttributes<HTMLElement>>;
|
|
15
15
|
export default Column;
|
|
16
16
|
//# sourceMappingURL=Column.d.ts.map
|
|
@@ -21,6 +21,6 @@ interface ColumnContextValue {
|
|
|
21
21
|
isList: boolean;
|
|
22
22
|
}
|
|
23
23
|
export declare const ColumnContext: React.Context<ColumnContextValue | null>;
|
|
24
|
-
export declare const Columns: React.ForwardRefExoticComponent<Pick<Props, "
|
|
24
|
+
export declare const Columns: React.ForwardRefExoticComponent<Pick<Props, "value" | "id" | "colour" | "backgroundColour" | "space" | "width" | "min" | "size" | "muted" | "name" | "alignItems" | "boxShadow" | "color" | "content" | "display" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "height" | "justifyContent" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "opacity" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "pointerEvents" | "position" | "textAlign" | "translate" | "userSelect" | "borderRadius" | "borderWidth" | "columns" | "margin" | "overflow" | "padding" | "start" | "hidden" | "style" | "default" | "wrap" | "open" | "multiple" | "disabled" | "children" | "cite" | "data" | "form" | "label" | "slot" | "span" | "summary" | "title" | "pattern" | "key" | "is" | "className" | "paddingX" | "paddingY" | "marginX" | "marginY" | "borderWidthX" | "borderWidthY" | "borderWidthTop" | "borderWidthRight" | "borderWidthBottom" | "borderWidthLeft" | "borderColour" | "borderColourX" | "borderColourY" | "borderColourTop" | "borderColourRight" | "borderColourBottom" | "borderColourLeft" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "minLength" | "nonce" | "noValidate" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "target" | "type" | "useMap" | "wmode" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "align" | "noWrap" | "spaceX" | "spaceY" | "wrappingDirection"> & React.RefAttributes<HTMLElement>>;
|
|
25
25
|
export default Columns;
|
|
26
26
|
//# sourceMappingURL=Columns.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentProps, FunctionComponent, ReactNode } from 'react';
|
|
2
2
|
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
3
3
|
export interface Props extends ComponentProps<typeof ThemeProvider> {
|
|
4
|
-
noBodyLevelTheming
|
|
4
|
+
noBodyLevelTheming?: boolean;
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
}
|
|
7
7
|
export declare const OverdriveProvider: FunctionComponent<Props>;
|
|
@@ -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;AAEhF,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"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useEffect } from 'react';
|
|
5
|
-
import { tokens } from "../../themes/base/tokens.js";
|
|
6
5
|
import { isBrowser } from "../../utils/index.js";
|
|
7
6
|
import { ThemeProvider } from "../ThemeProvider/ThemeProvider.js";
|
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -12,23 +11,18 @@ export const OverdriveProvider = _ref => {
|
|
|
12
11
|
vars,
|
|
13
12
|
themeClass,
|
|
14
13
|
breakpoints,
|
|
14
|
+
portalMountPoint,
|
|
15
15
|
children
|
|
16
16
|
} = _ref;
|
|
17
17
|
useEffect(() => {
|
|
18
|
-
if (!isBrowser) return;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
document.body.style.backgroundColor = vars.body.backgroundColour;
|
|
22
|
-
document.body.style.color = vars.body.colour;
|
|
23
|
-
} else {
|
|
24
|
-
document.body.style.backgroundColor = tokens.body.backgroundColour;
|
|
25
|
-
document.body.style.color = tokens.body.colour;
|
|
26
|
-
}
|
|
27
|
-
}, [vars, themeClass]);
|
|
18
|
+
if (!isBrowser || noBodyLevelTheming) return;
|
|
19
|
+
document.body.classList.add(themeClass);
|
|
20
|
+
}, [themeClass]);
|
|
28
21
|
return _jsx(ThemeProvider, {
|
|
29
22
|
vars: vars,
|
|
30
23
|
themeClass: themeClass,
|
|
31
24
|
breakpoints: breakpoints,
|
|
25
|
+
portalMountPoint: portalMountPoint,
|
|
32
26
|
children: children
|
|
33
27
|
});
|
|
34
28
|
};
|
|
@@ -2,11 +2,11 @@ import type { ReactNode, Ref } from 'react';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
export interface Props {
|
|
4
4
|
children?: ReactNode;
|
|
5
|
-
container?:
|
|
5
|
+
container?: HTMLElement;
|
|
6
6
|
noThemedWrapper?: boolean;
|
|
7
7
|
}
|
|
8
8
|
declare function Portal({ children, container, noThemedWrapper }: Props, ref: Ref<typeof container>): React.ReactPortal | null;
|
|
9
|
-
declare const _Portal: React.ForwardRefExoticComponent<Props & React.RefAttributes<
|
|
9
|
+
declare const _Portal: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement | undefined>>;
|
|
10
10
|
export { _Portal as Portal };
|
|
11
11
|
export default Portal;
|
|
12
12
|
//# sourceMappingURL=Portal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../../../lib/components/Portal/Portal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAa,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,WAAW,KAAK;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../../../lib/components/Portal/Portal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAa,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,WAAW,KAAK;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC1B;AAID,iBAAS,MAAM,CACd,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,KAAK,EAC/C,GAAG,EAAE,GAAG,CAAC,OAAO,SAAS,CAAC,4BAmC1B;AAED,QAAA,MAAM,OAAO,uFAAqB,CAAC;AACnC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,CAAC;AAE7B,eAAe,MAAM,CAAC"}
|
|
@@ -7,18 +7,24 @@ import { isBrowser, isHtmlElement, setRef } from "../../utils/index.js";
|
|
|
7
7
|
import { useTheme } from "../ThemeProvider/index.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
function Portal(_ref, ref) {
|
|
10
|
-
var _useTheme;
|
|
11
10
|
let {
|
|
12
11
|
children,
|
|
13
12
|
container,
|
|
14
13
|
noThemedWrapper
|
|
15
14
|
} = _ref;
|
|
16
|
-
const
|
|
15
|
+
const {
|
|
16
|
+
themeClass,
|
|
17
|
+
portalMountPoint
|
|
18
|
+
} = useTheme();
|
|
17
19
|
const [mountNode, setMountNode] = useState(null);
|
|
18
20
|
if (isBrowser) {
|
|
19
21
|
useLayoutEffect(() => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
let mountElement = document.body;
|
|
23
|
+
if (isHtmlElement(container)) mountElement = container;else if (isHtmlElement(portalMountPoint === null || portalMountPoint === void 0 ? void 0 : portalMountPoint.current)) {
|
|
24
|
+
mountElement = portalMountPoint.current;
|
|
25
|
+
}
|
|
26
|
+
setMountNode(mountElement);
|
|
27
|
+
}, [container, portalMountPoint === null || portalMountPoint === void 0 ? void 0 : portalMountPoint.current]);
|
|
22
28
|
useLayoutEffect(() => {
|
|
23
29
|
if (mountNode) {
|
|
24
30
|
setRef(ref, mountNode);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FunctionComponent, ReactNode } from 'react';
|
|
1
|
+
import { FunctionComponent, MutableRefObject, ReactNode } from 'react';
|
|
2
2
|
import { RuntimeTokens } from '../../themes/makeTheme';
|
|
3
3
|
import { themeContractVars } from '../../themes/theme.css';
|
|
4
4
|
import { BreakPoints } from '../../themes/tokens';
|
|
@@ -6,11 +6,10 @@ declare type ThemeVars = typeof themeContractVars;
|
|
|
6
6
|
declare type ThemeContextType = {
|
|
7
7
|
vars: ThemeVars;
|
|
8
8
|
themeClass: string;
|
|
9
|
+
portalMountPoint?: MutableRefObject<typeof HTMLElement>;
|
|
9
10
|
};
|
|
10
|
-
export interface Props {
|
|
11
|
+
export interface Props extends ThemeContextType {
|
|
11
12
|
children?: ReactNode;
|
|
12
|
-
vars: ThemeVars;
|
|
13
|
-
themeClass: string;
|
|
14
13
|
breakpoints?: BreakPoints;
|
|
15
14
|
}
|
|
16
15
|
export declare const ThemeProvider: FunctionComponent<Props>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../lib/components/ThemeProvider/ThemeProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAiB,iBAAiB,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../lib/components/ThemeProvider/ThemeProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAiB,iBAAiB,EAAE,gBAAgB,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE3G,OAAO,EAAqB,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,aAAK,SAAS,GAAG,OAAO,iBAAiB,CAAC;AAC1C,aAAK,gBAAgB,GAAG;IACvB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,OAAO,WAAW,CAAC,CAAC;CACxD,CAAC;AAIF,MAAM,WAAW,KAAM,SAAQ,gBAAgB;IAC9C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC1B;AAED,eAAO,MAAM,aAAa,EAAE,iBAAiB,CAAC,KAAK,CAgBlD,CAAC;AAEF,eAAO,MAAM,QAAQ,wBAMpB,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAO,aAInC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -12,12 +12,14 @@ export const ThemeProvider = _ref => {
|
|
|
12
12
|
vars,
|
|
13
13
|
themeClass,
|
|
14
14
|
children,
|
|
15
|
-
breakpoints
|
|
15
|
+
breakpoints,
|
|
16
|
+
portalMountPoint
|
|
16
17
|
} = _ref;
|
|
17
18
|
return _jsx(themeContext.Provider, {
|
|
18
19
|
value: useMemo(() => ({
|
|
19
20
|
vars,
|
|
20
|
-
themeClass
|
|
21
|
+
themeClass,
|
|
22
|
+
portalMountPoint
|
|
21
23
|
}), [vars]),
|
|
22
24
|
children: _jsx(runtimeTokensContext.Provider, {
|
|
23
25
|
value: useMemo(() => makeRuntimeTokens(breakpoints), []),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/hooks/useDocumentBodyStyles/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,YAOjC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { tokens } from "../../themes/base/tokens.js";
|
|
4
|
+
import { useEffect } from 'react';
|
|
5
|
+
import { isBrowser } from "../../utils/index.js";
|
|
6
|
+
export const useDocumentBodyStyles = () => {
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (!isBrowser) return;
|
|
9
|
+
document.body.style.backgroundColor = tokens.body.backgroundColour;
|
|
10
|
+
document.body.style.color = tokens.body.colour;
|
|
11
|
+
}, []);
|
|
12
|
+
};
|