@norges-domstoler/dds-components 10.0.0 → 10.0.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/cjs/components/FormGenerator/FormGenerator.styles.d.ts +1 -0
- package/dist/cjs/components/FormGenerator/FormGenerator.tokens.d.ts +3 -0
- package/dist/cjs/components/Typography/Paragraph/Paragraph.stories.d.ts +1 -0
- package/dist/cjs/index.js +52 -15
- package/dist/components/Drawer/Drawer.js +1 -1
- package/dist/components/FormGenerator/FormGenerator.styles.d.ts +1 -0
- package/dist/components/FormGenerator/FormGenerator.tokens.d.ts +3 -0
- package/dist/components/OverflowMenu/OverflowMenu.js +1 -1
- package/dist/components/Popover/Popover.js +1 -1
- package/dist/components/Search/Search.js +1 -1
- package/dist/components/Search/SearchAutocompleteWrapper.js +5 -2
- package/dist/components/Search/SearchSuggestions.js +1 -1
- package/dist/components/Select/Select.styles.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +40 -6
- package/dist/components/Tooltip/Tooltip.styles.js +1 -1
- package/dist/components/Typography/Paragraph/Paragraph.stories.d.ts +1 -0
- package/dist/helpers/Backdrop/Backdrop.js +1 -1
- package/package.json +1 -1
|
@@ -7,3 +7,4 @@ export declare const SubContainer: import("styled-components").StyledComponent<"
|
|
|
7
7
|
length: number;
|
|
8
8
|
breakpoint?: ScreenSize | undefined;
|
|
9
9
|
}, never>;
|
|
10
|
+
export declare const ButtonRow: import("styled-components").StyledComponent<(props: import("../Grid").GridChildProps) => JSX.Element, any, {}, never>;
|
package/dist/cjs/index.js
CHANGED
|
@@ -693,7 +693,7 @@ var Typography = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
693
693
|
var Backdrop = styled__default["default"].div.withConfig({
|
|
694
694
|
displayName: "Backdrop",
|
|
695
695
|
componentId: "sc-vimg90-0"
|
|
696
|
-
})(["position:fixed;display:flex;align-items:center;justify-content:center;background-color:", ";overflow-y:auto;top:0;right:0;bottom:0;left:0;z-index:
|
|
696
|
+
})(["position:fixed;display:flex;align-items:center;justify-content:center;background-color:", ";overflow-y:auto;top:0;right:0;bottom:0;left:0;z-index:200;opacity:", ";@media (prefers-reduced-motion:no-preference){transition:opacity 0.2s;}"], changeRGBAAlpha(ddsDesignTokens.ddsBaseTokens.colors.DdsColorNeutralsGray9, 0.5), function (_ref) {
|
|
697
697
|
var isOpen = _ref.isOpen;
|
|
698
698
|
return isOpen ? 1 : 0;
|
|
699
699
|
});
|
|
@@ -4166,7 +4166,7 @@ var getCustomStyles = function getCustomStyles() {
|
|
|
4166
4166
|
},
|
|
4167
4167
|
menu: function menu(provided) {
|
|
4168
4168
|
return Object.assign(Object.assign({}, provided), {
|
|
4169
|
-
zIndex:
|
|
4169
|
+
zIndex: 100,
|
|
4170
4170
|
transition: '0.2s',
|
|
4171
4171
|
width: 'calc(100% + 2px)',
|
|
4172
4172
|
transform: 'translate(-1px)',
|
|
@@ -5457,7 +5457,7 @@ var suggestionsContainer = searchTokens.suggestionsContainer,
|
|
|
5457
5457
|
var SuggestionsContainer = styled__default["default"](Paper).withConfig({
|
|
5458
5458
|
displayName: "SearchSuggestions__SuggestionsContainer",
|
|
5459
5459
|
componentId: "sc-nlwf4s-0"
|
|
5460
|
-
})(["", ";position:absolute;top:100%;width:100%;max-height:300px;margin-top:", ";border:", ";box-shadow:", ";z-index:
|
|
5460
|
+
})(["", ";position:absolute;top:100%;width:100%;max-height:300px;margin-top:", ";border:", ";box-shadow:", ";z-index:100;overflow-y:scroll;", " ", ""], function (_ref) {
|
|
5461
5461
|
var isHidden = _ref.isHidden;
|
|
5462
5462
|
return visibilityTransition(!isHidden);
|
|
5463
5463
|
}, suggestionsContainer.marginTop, suggestionsContainer.border, suggestionsContainer.boxShadow, scrollbarStyling.firefox, scrollbarStyling.webkit);
|
|
@@ -5639,7 +5639,7 @@ var Search$1 = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
5639
5639
|
type: 'search',
|
|
5640
5640
|
id: uniqueId,
|
|
5641
5641
|
'aria-describedby': spaceSeparatedIdListGenerator([tip ? tipId : undefined, context.suggestions ? suggestionsDescriptionId : undefined, ariaDescribedby]),
|
|
5642
|
-
value: context.inputValue !== undefined ? context.inputValue : value
|
|
5642
|
+
value: context.inputValue !== undefined ? context.inputValue : value,
|
|
5643
5643
|
onChange: handleChange,
|
|
5644
5644
|
autoComplete: 'off'
|
|
5645
5645
|
});
|
|
@@ -5733,7 +5733,7 @@ var SearchAutocompleteWrapper = function SearchAutocompleteWrapper(props) {
|
|
|
5733
5733
|
};
|
|
5734
5734
|
var handleChange = function handleChange(e) {
|
|
5735
5735
|
var query = e.target.value;
|
|
5736
|
-
|
|
5736
|
+
handleSetInputValue(query);
|
|
5737
5737
|
var finalSuggestions = [];
|
|
5738
5738
|
if (query.length >= queryLength) {
|
|
5739
5739
|
if (data) {
|
|
@@ -5767,10 +5767,13 @@ var SearchAutocompleteWrapper = function SearchAutocompleteWrapper(props) {
|
|
|
5767
5767
|
};
|
|
5768
5768
|
var handleSuggestionClick = function handleSuggestionClick(e) {
|
|
5769
5769
|
setSuggestions([]);
|
|
5770
|
-
|
|
5770
|
+
handleSetInputValue(e.target.innerText);
|
|
5771
5771
|
onSuggestionSelection && onSuggestionSelection();
|
|
5772
5772
|
closeSuggestions();
|
|
5773
5773
|
};
|
|
5774
|
+
var handleSetInputValue = function handleSetInputValue(value) {
|
|
5775
|
+
setInputValue(value || '');
|
|
5776
|
+
};
|
|
5774
5777
|
var inputRef = React.useRef(null);
|
|
5775
5778
|
var suggestionsRef = React.useRef(null);
|
|
5776
5779
|
useOnClickOutside([inputRef.current, suggestionsRef.current], function () {
|
|
@@ -7133,7 +7136,7 @@ var container$7 = overflowMenuTokens.container,
|
|
|
7133
7136
|
var Container$a = styled__default["default"].div.withConfig({
|
|
7134
7137
|
displayName: "OverflowMenu__Container",
|
|
7135
7138
|
componentId: "sc-kh744b-0"
|
|
7136
|
-
})(["box-sizing:border-box;z-index:
|
|
7139
|
+
})(["box-sizing:border-box;z-index:100;overflow-y:auto;min-width:180px;max-width:300px;", " border:", ";background-color:", ";border-radius:", ";", " ", " *::selection{", "}"], function (_ref) {
|
|
7137
7140
|
var isOpen = _ref.isOpen;
|
|
7138
7141
|
return visibilityTransition(isOpen);
|
|
7139
7142
|
}, container$7.border, container$7.backgroundColor, container$7.borderRadius, scrollbarStyling.webkit, scrollbarStyling.firefox, selection);
|
|
@@ -7730,7 +7733,7 @@ var Container$9 = styled__default["default"].div.withConfig({
|
|
|
7730
7733
|
var TooltipWrapper = styled__default["default"](Paper).withConfig({
|
|
7731
7734
|
displayName: "Tooltipstyles__TooltipWrapper",
|
|
7732
7735
|
componentId: "sc-1cna5tc-3"
|
|
7733
|
-
})(["", " width:fit-content;position:absolute;z-index:
|
|
7736
|
+
})(["", " width:fit-content;position:absolute;z-index:100;text-align:center;padding:", ";", ";"], function (_ref) {
|
|
7734
7737
|
var open = _ref.open;
|
|
7735
7738
|
return visibilityTransition(open);
|
|
7736
7739
|
}, wrapper$4.padding, getFontStyling(defaultTypographyType));
|
|
@@ -7757,17 +7760,51 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
7757
7760
|
_useState2 = _slicedToArray(_useState, 2),
|
|
7758
7761
|
open = _useState2[0],
|
|
7759
7762
|
setOpen = _useState2[1];
|
|
7760
|
-
var _useState3 = React.useState(
|
|
7763
|
+
var _useState3 = React.useState(false),
|
|
7761
7764
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
7762
|
-
|
|
7763
|
-
|
|
7765
|
+
inView = _useState4[0],
|
|
7766
|
+
setInView = _useState4[1];
|
|
7767
|
+
var _useState5 = React.useState(null),
|
|
7768
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
7769
|
+
arrowElement = _useState6[0],
|
|
7770
|
+
setArrowElement = _useState6[1];
|
|
7764
7771
|
var _useFloatPosition = useFloatPosition(arrowElement, {
|
|
7765
7772
|
placement: placement
|
|
7766
7773
|
}),
|
|
7767
7774
|
reference = _useFloatPosition.reference,
|
|
7768
7775
|
floating = _useFloatPosition.floating,
|
|
7769
7776
|
styles = _useFloatPosition.styles;
|
|
7770
|
-
var
|
|
7777
|
+
var tooltipRef = React.useRef(null);
|
|
7778
|
+
var combinedRef = useCombinedRef(ref, floating, tooltipRef);
|
|
7779
|
+
var closeWhenNotInView = function closeWhenNotInView(entries) {
|
|
7780
|
+
var _entries = _slicedToArray(entries, 1),
|
|
7781
|
+
entry = _entries[0];
|
|
7782
|
+
entry.isIntersecting ? setInView(true) : setInView(false);
|
|
7783
|
+
};
|
|
7784
|
+
React.useEffect(function () {
|
|
7785
|
+
var options = {
|
|
7786
|
+
root: null,
|
|
7787
|
+
rootMargin: '0px'
|
|
7788
|
+
};
|
|
7789
|
+
var ref = tooltipRef.current;
|
|
7790
|
+
var observer = new IntersectionObserver(closeWhenNotInView, options);
|
|
7791
|
+
if (ref) observer.observe(ref);
|
|
7792
|
+
return function () {
|
|
7793
|
+
if (ref) observer.unobserve(ref);
|
|
7794
|
+
};
|
|
7795
|
+
}, [tooltipRef]);
|
|
7796
|
+
React.useEffect(function () {
|
|
7797
|
+
if (tooltipRef.current) {
|
|
7798
|
+
window.addEventListener('scroll', function () {
|
|
7799
|
+
closeTooltip();
|
|
7800
|
+
});
|
|
7801
|
+
}
|
|
7802
|
+
return function () {
|
|
7803
|
+
if (tooltipRef.current) {
|
|
7804
|
+
window.removeEventListener('scroll', function () {});
|
|
7805
|
+
}
|
|
7806
|
+
};
|
|
7807
|
+
}, []);
|
|
7771
7808
|
var timer;
|
|
7772
7809
|
React.useEffect(function () {
|
|
7773
7810
|
return function () {
|
|
@@ -7806,7 +7843,7 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
7806
7843
|
ref: combinedRef,
|
|
7807
7844
|
role: 'tooltip',
|
|
7808
7845
|
'aria-hidden': !open,
|
|
7809
|
-
open: open,
|
|
7846
|
+
open: open && inView,
|
|
7810
7847
|
style: Object.assign({}, styles.floating)
|
|
7811
7848
|
};
|
|
7812
7849
|
var arrowWrapperProps = {
|
|
@@ -8012,7 +8049,7 @@ var getMaxWidth = function getMaxWidth(size) {
|
|
|
8012
8049
|
var Container$5 = styled__default["default"](Paper).withConfig({
|
|
8013
8050
|
displayName: "Drawer__Container",
|
|
8014
8051
|
componentId: "sc-i9luw3-0"
|
|
8015
|
-
})(["position:fixed;top:0;height:100%;display:flex;flex-direction:column-reverse;justify-content:flex-end;min-width:300px;z-index:
|
|
8052
|
+
})(["position:fixed;top:0;height:100%;display:flex;flex-direction:column-reverse;justify-content:flex-end;min-width:300px;z-index:100;padding:", ";", " ", " ", " @media (prefers-reduced-motion:no-preference){transition:transform 0.5s;}&:focus-visible,&.focus-visible{", "}"], container$3.padding, function (_ref) {
|
|
8016
8053
|
var size = _ref.size;
|
|
8017
8054
|
return styled.css(["max-width:", ";"], getMaxWidth(size));
|
|
8018
8055
|
}, function (_ref2) {
|
|
@@ -8184,7 +8221,7 @@ var wrapper$2 = popoverTokens.wrapper,
|
|
|
8184
8221
|
var Wrapper$1 = styled__default["default"](Paper).withConfig({
|
|
8185
8222
|
displayName: "Popover__Wrapper",
|
|
8186
8223
|
componentId: "sc-1fecd7e-0"
|
|
8187
|
-
})(["opacity:0;", " position:absolute;width:fit-content;z-index:
|
|
8224
|
+
})(["opacity:0;", " position:absolute;width:fit-content;z-index:100;padding:", ";&:focus-visible{", "}", ""], function (_ref) {
|
|
8188
8225
|
var hasTransitionedIn = _ref.hasTransitionedIn,
|
|
8189
8226
|
isOpen = _ref.isOpen;
|
|
8190
8227
|
return hasTransitionedIn && visibilityTransition(hasTransitionedIn && isOpen);
|
|
@@ -43,7 +43,7 @@ var getMaxWidth = function getMaxWidth(size) {
|
|
|
43
43
|
var Container = styled(Paper).withConfig({
|
|
44
44
|
displayName: "Drawer__Container",
|
|
45
45
|
componentId: "sc-i9luw3-0"
|
|
46
|
-
})(["position:fixed;top:0;height:100%;display:flex;flex-direction:column-reverse;justify-content:flex-end;min-width:300px;z-index:
|
|
46
|
+
})(["position:fixed;top:0;height:100%;display:flex;flex-direction:column-reverse;justify-content:flex-end;min-width:300px;z-index:100;padding:", ";", " ", " ", " @media (prefers-reduced-motion:no-preference){transition:transform 0.5s;}&:focus-visible,&.focus-visible{", "}"], container.padding, function (_ref) {
|
|
47
47
|
var size = _ref.size;
|
|
48
48
|
return css(["max-width:", ";"], getMaxWidth(size));
|
|
49
49
|
}, function (_ref2) {
|
|
@@ -7,3 +7,4 @@ export declare const SubContainer: import("styled-components").StyledComponent<"
|
|
|
7
7
|
length: number;
|
|
8
8
|
breakpoint?: ScreenSize | undefined;
|
|
9
9
|
}, never>;
|
|
10
|
+
export declare const ButtonRow: import("styled-components").StyledComponent<(props: import("../Grid").GridChildProps) => JSX.Element, any, {}, never>;
|
|
@@ -31,7 +31,7 @@ var container = overflowMenuTokens.container,
|
|
|
31
31
|
var Container = styled.div.withConfig({
|
|
32
32
|
displayName: "OverflowMenu__Container",
|
|
33
33
|
componentId: "sc-kh744b-0"
|
|
34
|
-
})(["box-sizing:border-box;z-index:
|
|
34
|
+
})(["box-sizing:border-box;z-index:100;overflow-y:auto;min-width:180px;max-width:300px;", " border:", ";background-color:", ";border-radius:", ";", " ", " *::selection{", "}"], function (_ref) {
|
|
35
35
|
var isOpen = _ref.isOpen;
|
|
36
36
|
return visibilityTransition(isOpen);
|
|
37
37
|
}, container.border, container.backgroundColor, container.borderRadius, scrollbarStyling.webkit, scrollbarStyling.firefox, selection);
|
|
@@ -40,7 +40,7 @@ var wrapper = popoverTokens.wrapper,
|
|
|
40
40
|
var Wrapper = styled(Paper).withConfig({
|
|
41
41
|
displayName: "Popover__Wrapper",
|
|
42
42
|
componentId: "sc-1fecd7e-0"
|
|
43
|
-
})(["opacity:0;", " position:absolute;width:fit-content;z-index:
|
|
43
|
+
})(["opacity:0;", " position:absolute;width:fit-content;z-index:100;padding:", ";&:focus-visible{", "}", ""], function (_ref) {
|
|
44
44
|
var hasTransitionedIn = _ref.hasTransitionedIn,
|
|
45
45
|
isOpen = _ref.isOpen;
|
|
46
46
|
return hasTransitionedIn && visibilityTransition(hasTransitionedIn && isOpen);
|
|
@@ -107,7 +107,7 @@ var Search = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
107
107
|
type: 'search',
|
|
108
108
|
id: uniqueId,
|
|
109
109
|
'aria-describedby': spaceSeparatedIdListGenerator([tip ? tipId : undefined, context.suggestions ? suggestionsDescriptionId : undefined, ariaDescribedby]),
|
|
110
|
-
value: context.inputValue !== undefined ? context.inputValue : value
|
|
110
|
+
value: context.inputValue !== undefined ? context.inputValue : value,
|
|
111
111
|
onChange: handleChange,
|
|
112
112
|
autoComplete: 'off'
|
|
113
113
|
});
|
|
@@ -48,7 +48,7 @@ var SearchAutocompleteWrapper = function SearchAutocompleteWrapper(props) {
|
|
|
48
48
|
};
|
|
49
49
|
var handleChange = function handleChange(e) {
|
|
50
50
|
var query = e.target.value;
|
|
51
|
-
|
|
51
|
+
handleSetInputValue(query);
|
|
52
52
|
var finalSuggestions = [];
|
|
53
53
|
if (query.length >= queryLength) {
|
|
54
54
|
if (data) {
|
|
@@ -82,10 +82,13 @@ var SearchAutocompleteWrapper = function SearchAutocompleteWrapper(props) {
|
|
|
82
82
|
};
|
|
83
83
|
var handleSuggestionClick = function handleSuggestionClick(e) {
|
|
84
84
|
setSuggestions([]);
|
|
85
|
-
|
|
85
|
+
handleSetInputValue(e.target.innerText);
|
|
86
86
|
onSuggestionSelection && onSuggestionSelection();
|
|
87
87
|
closeSuggestions();
|
|
88
88
|
};
|
|
89
|
+
var handleSetInputValue = function handleSetInputValue(value) {
|
|
90
|
+
setInputValue(value || '');
|
|
91
|
+
};
|
|
89
92
|
var inputRef = useRef(null);
|
|
90
93
|
var suggestionsRef = useRef(null);
|
|
91
94
|
useOnClickOutside([inputRef.current, suggestionsRef.current], function () {
|
|
@@ -38,7 +38,7 @@ var suggestionsContainer = searchTokens.suggestionsContainer,
|
|
|
38
38
|
var SuggestionsContainer = styled(Paper).withConfig({
|
|
39
39
|
displayName: "SearchSuggestions__SuggestionsContainer",
|
|
40
40
|
componentId: "sc-nlwf4s-0"
|
|
41
|
-
})(["", ";position:absolute;top:100%;width:100%;max-height:300px;margin-top:", ";border:", ";box-shadow:", ";z-index:
|
|
41
|
+
})(["", ";position:absolute;top:100%;width:100%;max-height:300px;margin-top:", ";border:", ";box-shadow:", ";z-index:100;overflow-y:scroll;", " ", ""], function (_ref) {
|
|
42
42
|
var isHidden = _ref.isHidden;
|
|
43
43
|
return visibilityTransition(!isHidden);
|
|
44
44
|
}, suggestionsContainer.marginTop, suggestionsContainer.border, suggestionsContainer.boxShadow, scrollbarStyling.firefox, scrollbarStyling.webkit);
|
|
@@ -149,7 +149,7 @@ var getCustomStyles = function getCustomStyles() {
|
|
|
149
149
|
},
|
|
150
150
|
menu: function menu(provided) {
|
|
151
151
|
return Object.assign(Object.assign({}, provided), {
|
|
152
|
-
zIndex:
|
|
152
|
+
zIndex: 100,
|
|
153
153
|
transition: '0.2s',
|
|
154
154
|
width: 'calc(100% + 2px)',
|
|
155
155
|
transform: 'translate(-1px)',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import { __rest } from 'tslib';
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { forwardRef, useId, useState, useEffect, Children, isValidElement, cloneElement } from 'react';
|
|
4
|
+
import { forwardRef, useId, useState, useRef, useEffect, Children, isValidElement, cloneElement } from 'react';
|
|
5
5
|
import { useCombinedRef } from '../../hooks/useCombinedRefs.js';
|
|
6
6
|
import { useOnKeyDown } from '../../hooks/useOnKeyDown.js';
|
|
7
7
|
import { useFloatPosition } from '../../hooks/useFloatPosition.js';
|
|
@@ -34,17 +34,51 @@ var Tooltip = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
34
34
|
_useState2 = _slicedToArray(_useState, 2),
|
|
35
35
|
open = _useState2[0],
|
|
36
36
|
setOpen = _useState2[1];
|
|
37
|
-
var _useState3 = useState(
|
|
37
|
+
var _useState3 = useState(false),
|
|
38
38
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
inView = _useState4[0],
|
|
40
|
+
setInView = _useState4[1];
|
|
41
|
+
var _useState5 = useState(null),
|
|
42
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
43
|
+
arrowElement = _useState6[0],
|
|
44
|
+
setArrowElement = _useState6[1];
|
|
41
45
|
var _useFloatPosition = useFloatPosition(arrowElement, {
|
|
42
46
|
placement: placement
|
|
43
47
|
}),
|
|
44
48
|
reference = _useFloatPosition.reference,
|
|
45
49
|
floating = _useFloatPosition.floating,
|
|
46
50
|
styles = _useFloatPosition.styles;
|
|
47
|
-
var
|
|
51
|
+
var tooltipRef = useRef(null);
|
|
52
|
+
var combinedRef = useCombinedRef(ref, floating, tooltipRef);
|
|
53
|
+
var closeWhenNotInView = function closeWhenNotInView(entries) {
|
|
54
|
+
var _entries = _slicedToArray(entries, 1),
|
|
55
|
+
entry = _entries[0];
|
|
56
|
+
entry.isIntersecting ? setInView(true) : setInView(false);
|
|
57
|
+
};
|
|
58
|
+
useEffect(function () {
|
|
59
|
+
var options = {
|
|
60
|
+
root: null,
|
|
61
|
+
rootMargin: '0px'
|
|
62
|
+
};
|
|
63
|
+
var ref = tooltipRef.current;
|
|
64
|
+
var observer = new IntersectionObserver(closeWhenNotInView, options);
|
|
65
|
+
if (ref) observer.observe(ref);
|
|
66
|
+
return function () {
|
|
67
|
+
if (ref) observer.unobserve(ref);
|
|
68
|
+
};
|
|
69
|
+
}, [tooltipRef]);
|
|
70
|
+
useEffect(function () {
|
|
71
|
+
if (tooltipRef.current) {
|
|
72
|
+
window.addEventListener('scroll', function () {
|
|
73
|
+
closeTooltip();
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return function () {
|
|
77
|
+
if (tooltipRef.current) {
|
|
78
|
+
window.removeEventListener('scroll', function () {});
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}, []);
|
|
48
82
|
var timer;
|
|
49
83
|
useEffect(function () {
|
|
50
84
|
return function () {
|
|
@@ -83,7 +117,7 @@ var Tooltip = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
83
117
|
ref: combinedRef,
|
|
84
118
|
role: 'tooltip',
|
|
85
119
|
'aria-hidden': !open,
|
|
86
|
-
open: open,
|
|
120
|
+
open: open && inView,
|
|
87
121
|
style: Object.assign({}, styles.floating)
|
|
88
122
|
};
|
|
89
123
|
var arrowWrapperProps = {
|
|
@@ -33,7 +33,7 @@ var Container = styled.div.withConfig({
|
|
|
33
33
|
var TooltipWrapper = styled(Paper).withConfig({
|
|
34
34
|
displayName: "Tooltipstyles__TooltipWrapper",
|
|
35
35
|
componentId: "sc-1cna5tc-3"
|
|
36
|
-
})(["", " width:fit-content;position:absolute;z-index:
|
|
36
|
+
})(["", " width:fit-content;position:absolute;z-index:100;text-align:center;padding:", ";", ";"], function (_ref) {
|
|
37
37
|
var open = _ref.open;
|
|
38
38
|
return visibilityTransition(open);
|
|
39
39
|
}, wrapper.padding, getFontStyling(defaultTypographyType));
|
|
@@ -5,7 +5,7 @@ import { changeRGBAAlpha } from '../../utils/color.js';
|
|
|
5
5
|
var Backdrop = styled.div.withConfig({
|
|
6
6
|
displayName: "Backdrop",
|
|
7
7
|
componentId: "sc-vimg90-0"
|
|
8
|
-
})(["position:fixed;display:flex;align-items:center;justify-content:center;background-color:", ";overflow-y:auto;top:0;right:0;bottom:0;left:0;z-index:
|
|
8
|
+
})(["position:fixed;display:flex;align-items:center;justify-content:center;background-color:", ";overflow-y:auto;top:0;right:0;bottom:0;left:0;z-index:200;opacity:", ";@media (prefers-reduced-motion:no-preference){transition:opacity 0.2s;}"], changeRGBAAlpha(ddsBaseTokens.colors.DdsColorNeutralsGray9, 0.5), function (_ref) {
|
|
9
9
|
var isOpen = _ref.isOpen;
|
|
10
10
|
return isOpen ? 1 : 0;
|
|
11
11
|
});
|