@targetprocess/popover 12.32.5-ci.0 → 12.32.5-ci.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/__tests__/Popover.tests.tsx +6 -11
- package/dist/popover.es.js +8 -6
- package/dist/popover.js +2 -2
- package/package.json +2 -2
|
@@ -20,15 +20,6 @@ const ComponentWithRef = React.forwardRef<HTMLElement>((prop, ref) => (
|
|
|
20
20
|
|
|
21
21
|
const originalFocus = HTMLElement.prototype.focus
|
|
22
22
|
|
|
23
|
-
const mockFocus = () => {
|
|
24
|
-
const focus = jest.fn(function (this: HTMLElement, options?: FocusOptions) {
|
|
25
|
-
originalFocus.call(this, options)
|
|
26
|
-
})
|
|
27
|
-
HTMLElement.prototype.focus = focus
|
|
28
|
-
|
|
29
|
-
return focus
|
|
30
|
-
}
|
|
31
|
-
|
|
32
23
|
describe('Popover', () => {
|
|
33
24
|
beforeEach(() => {
|
|
34
25
|
cleanDocumentBody()
|
|
@@ -96,7 +87,9 @@ describe('Popover', () => {
|
|
|
96
87
|
})
|
|
97
88
|
|
|
98
89
|
it('should focus container without scrolling when body has no focusable elements', () => {
|
|
99
|
-
const focus =
|
|
90
|
+
const focus = jest.fn(originalFocus)
|
|
91
|
+
|
|
92
|
+
HTMLElement.prototype.focus = focus
|
|
100
93
|
|
|
101
94
|
mount(
|
|
102
95
|
<Popover isOpen trapFocus={false} body={<PopoverBody>foo</PopoverBody>}>
|
|
@@ -110,7 +103,9 @@ describe('Popover', () => {
|
|
|
110
103
|
})
|
|
111
104
|
|
|
112
105
|
it('should focus first focusable element without scrolling', () => {
|
|
113
|
-
const focus =
|
|
106
|
+
const focus = jest.fn(originalFocus)
|
|
107
|
+
|
|
108
|
+
HTMLElement.prototype.focus = focus
|
|
114
109
|
|
|
115
110
|
mount(
|
|
116
111
|
<Popover
|
package/dist/popover.es.js
CHANGED
|
@@ -169,14 +169,15 @@ var PopoverPosition = {
|
|
|
169
169
|
};
|
|
170
170
|
|
|
171
171
|
function styleInject(css, ref) {
|
|
172
|
-
if (ref === void 0) ref = {};
|
|
172
|
+
if ( ref === void 0 ) ref = {};
|
|
173
173
|
var insertAt = ref.insertAt;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
|
|
175
|
+
if (typeof document === 'undefined') { return; }
|
|
176
|
+
|
|
177
177
|
var head = document.head || document.getElementsByTagName('head')[0];
|
|
178
178
|
var style = document.createElement('style');
|
|
179
179
|
style.type = 'text/css';
|
|
180
|
+
|
|
180
181
|
if (insertAt === 'top') {
|
|
181
182
|
if (head.firstChild) {
|
|
182
183
|
head.insertBefore(style, head.firstChild);
|
|
@@ -186,6 +187,7 @@ function styleInject(css, ref) {
|
|
|
186
187
|
} else {
|
|
187
188
|
head.appendChild(style);
|
|
188
189
|
}
|
|
190
|
+
|
|
189
191
|
if (style.styleSheet) {
|
|
190
192
|
style.styleSheet.cssText = css;
|
|
191
193
|
} else {
|
|
@@ -193,8 +195,8 @@ function styleInject(css, ref) {
|
|
|
193
195
|
}
|
|
194
196
|
}
|
|
195
197
|
|
|
196
|
-
var css_248z = "/*********************************************************************\n* © Copyright IBM Corp. 2024\n*********************************************************************/\n\n.popover-body-container__popover__12-32-5-ci-
|
|
197
|
-
var styles = {"popover-body-container":"popover-body-container__popover__12-32-5-ci-
|
|
198
|
+
var css_248z = "/*********************************************************************\n* © Copyright IBM Corp. 2024\n*********************************************************************/\n\n.popover-body-container__popover__12-32-5-ci-2 {\n -webkit-box-shadow: var(--BoxShadowL, 0 4px 16px 0 rgba(0, 0, 0, 0.12));\n box-shadow: var(--BoxShadowL, 0 4px 16px 0 rgba(0, 0, 0, 0.12));\n border-radius: var(--BorderRadiusL, 4px);\n border: 1px solid var(--HighlightBlockBorderColor, rgba(64, 66, 73, 0.1));\n background: var(--BackgroundDefault, #FFFFFF);\n z-index: var(--ZIndexModal, 10001);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n\n.popover-body__popover__12-32-5-ci-2 {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n padding: var(--SpaceSM, 12px);\n font-size: var(--FontSizeDefault, 13px);\n color: var(--FontColorDefault, #000000);\n}\n\n.popover-body--no-padding__popover__12-32-5-ci-2 {\n padding: 0;\n }\n\n.popover-tip__popover__12-32-5-ci-2 {\n position: absolute;\n pointer-events: none;\n z-index: calc(1 + var(--ZIndexModal, 10001));\n overflow: hidden;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n\n /*\n To determine tip position, we need to rotate it\n along the \"tip\" point, after that, the \"tip\" point\n can be placed with exactly 50% offset from the origin\n so that it is centered.\n */\n}\n\n.popover-tip__popover__12-32-5-ci-2:before {\n content: '';\n position: absolute;\n display: block;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n background-color: var(--BackgroundDefault, #FFFFFF);\n border: 1px solid var(--HighlightBlockBorderColor, rgba(64, 66, 73, 0.1));\n /*\n geometry FTW\n\n 2*$popoverTipSize\n _______ _______\n | /|\\ |\n | / | \\ | $popoverTipSize\n | / | \\ |\n |/______|______\\|\n since tip is rotated 45 degrees, its width and height is a\n diagonal of a square with side=$popoverTipSize, thus diagonal\n is sqrt(2) * $popoverTipSize.\n sqrt(2) ~= 1.414, 1.4 used here to prevent too much rounding\n */\n width: calc(11.2px);\n height: calc(11.2px);\n -webkit-transform: rotate(45deg);\n transform: rotate(45deg);\n }\n\n.popover-tip--bottom__popover__12-32-5-ci-2,\n .popover-tip--top__popover__12-32-5-ci-2 {\n width: 100%;\n border-top: 1px var(--BackgroundDefault, #FFFFFF);\n border-bottom: 1px var(--BackgroundDefault, #FFFFFF);\n height: calc(9px);\n }\n\n.popover-tip--left__popover__12-32-5-ci-2,\n .popover-tip--right__popover__12-32-5-ci-2 {\n border-left: 1px var(--BackgroundDefault, #FFFFFF);\n border-right: 1px var(--BackgroundDefault, #FFFFFF);\n height: 100%;\n width: calc(9px);\n }\n\n.popover-tip--bottom__popover__12-32-5-ci-2:before {\n -webkit-transform-origin: left top;\n transform-origin: left top;\n left: 50%;\n top: 0;\n }\n\n.popover-tip--top__popover__12-32-5-ci-2:before {\n -webkit-transform-origin: right bottom;\n transform-origin: right bottom;\n right: 50%;\n bottom: 0;\n }\n\n.popover-tip--left__popover__12-32-5-ci-2:before {\n -webkit-transform-origin: right top;\n transform-origin: right top;\n right: 0;\n top: 50%;\n }\n\n.popover-tip--right__popover__12-32-5-ci-2:before {\n -webkit-transform-origin: left bottom;\n transform-origin: left bottom;\n left: 0;\n bottom: 50%;\n }\n";
|
|
199
|
+
var styles = {"popover-body-container":"popover-body-container__popover__12-32-5-ci-2","popover-body":"popover-body__popover__12-32-5-ci-2","popover-body--no-padding":"popover-body--no-padding__popover__12-32-5-ci-2","popover-tip":"popover-tip__popover__12-32-5-ci-2","popover-tip--bottom":"popover-tip--bottom__popover__12-32-5-ci-2","popover-tip--top":"popover-tip--top__popover__12-32-5-ci-2","popover-tip--left":"popover-tip--left__popover__12-32-5-ci-2","popover-tip--right":"popover-tip--right__popover__12-32-5-ci-2"};
|
|
198
200
|
styleInject(css_248z);
|
|
199
201
|
|
|
200
202
|
/*********************************************************************
|
package/dist/popover.js
CHANGED
|
@@ -206,8 +206,8 @@ function styleInject(css, ref) {
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
var css_248z = "/*********************************************************************\n* © Copyright IBM Corp. 2024\n*********************************************************************/\n\n.popover-body-container__popover__12-32-5-ci-
|
|
210
|
-
var styles = {"popover-body-container":"popover-body-container__popover__12-32-5-ci-
|
|
209
|
+
var css_248z = "/*********************************************************************\n* © Copyright IBM Corp. 2024\n*********************************************************************/\n\n.popover-body-container__popover__12-32-5-ci-2 {\n -webkit-box-shadow: var(--BoxShadowL, 0 4px 16px 0 rgba(0, 0, 0, 0.12));\n box-shadow: var(--BoxShadowL, 0 4px 16px 0 rgba(0, 0, 0, 0.12));\n border-radius: var(--BorderRadiusL, 4px);\n border: 1px solid var(--HighlightBlockBorderColor, rgba(64, 66, 73, 0.1));\n background: var(--BackgroundDefault, #FFFFFF);\n z-index: var(--ZIndexModal, 10001);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n\n.popover-body__popover__12-32-5-ci-2 {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n padding: var(--SpaceSM, 12px);\n font-size: var(--FontSizeDefault, 13px);\n color: var(--FontColorDefault, #000000);\n}\n\n.popover-body--no-padding__popover__12-32-5-ci-2 {\n padding: 0;\n }\n\n.popover-tip__popover__12-32-5-ci-2 {\n position: absolute;\n pointer-events: none;\n z-index: calc(1 + var(--ZIndexModal, 10001));\n overflow: hidden;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n\n /*\n To determine tip position, we need to rotate it\n along the \"tip\" point, after that, the \"tip\" point\n can be placed with exactly 50% offset from the origin\n so that it is centered.\n */\n}\n\n.popover-tip__popover__12-32-5-ci-2:before {\n content: '';\n position: absolute;\n display: block;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n background-color: var(--BackgroundDefault, #FFFFFF);\n border: 1px solid var(--HighlightBlockBorderColor, rgba(64, 66, 73, 0.1));\n /*\n geometry FTW\n\n 2*$popoverTipSize\n _______ _______\n | /|\\ |\n | / | \\ | $popoverTipSize\n | / | \\ |\n |/______|______\\|\n since tip is rotated 45 degrees, its width and height is a\n diagonal of a square with side=$popoverTipSize, thus diagonal\n is sqrt(2) * $popoverTipSize.\n sqrt(2) ~= 1.414, 1.4 used here to prevent too much rounding\n */\n width: calc(11.2px);\n height: calc(11.2px);\n -webkit-transform: rotate(45deg);\n transform: rotate(45deg);\n }\n\n.popover-tip--bottom__popover__12-32-5-ci-2,\n .popover-tip--top__popover__12-32-5-ci-2 {\n width: 100%;\n border-top: 1px var(--BackgroundDefault, #FFFFFF);\n border-bottom: 1px var(--BackgroundDefault, #FFFFFF);\n height: calc(9px);\n }\n\n.popover-tip--left__popover__12-32-5-ci-2,\n .popover-tip--right__popover__12-32-5-ci-2 {\n border-left: 1px var(--BackgroundDefault, #FFFFFF);\n border-right: 1px var(--BackgroundDefault, #FFFFFF);\n height: 100%;\n width: calc(9px);\n }\n\n.popover-tip--bottom__popover__12-32-5-ci-2:before {\n -webkit-transform-origin: left top;\n transform-origin: left top;\n left: 50%;\n top: 0;\n }\n\n.popover-tip--top__popover__12-32-5-ci-2:before {\n -webkit-transform-origin: right bottom;\n transform-origin: right bottom;\n right: 50%;\n bottom: 0;\n }\n\n.popover-tip--left__popover__12-32-5-ci-2:before {\n -webkit-transform-origin: right top;\n transform-origin: right top;\n right: 0;\n top: 50%;\n }\n\n.popover-tip--right__popover__12-32-5-ci-2:before {\n -webkit-transform-origin: left bottom;\n transform-origin: left bottom;\n left: 0;\n bottom: 50%;\n }\n";
|
|
210
|
+
var styles = {"popover-body-container":"popover-body-container__popover__12-32-5-ci-2","popover-body":"popover-body__popover__12-32-5-ci-2","popover-body--no-padding":"popover-body--no-padding__popover__12-32-5-ci-2","popover-tip":"popover-tip__popover__12-32-5-ci-2","popover-tip--bottom":"popover-tip--bottom__popover__12-32-5-ci-2","popover-tip--top":"popover-tip--top__popover__12-32-5-ci-2","popover-tip--left":"popover-tip--left__popover__12-32-5-ci-2","popover-tip--right":"popover-tip--right__popover__12-32-5-ci-2"};
|
|
211
211
|
styleInject(css_248z);
|
|
212
212
|
|
|
213
213
|
/*********************************************************************
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@targetprocess/popover",
|
|
3
|
-
"version": "12.32.5-ci.
|
|
3
|
+
"version": "12.32.5-ci.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/popover.js",
|
|
6
6
|
"module": "dist/popover.es.js",
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "56b126be3263f90df6d7efeed855d56329cd007b"
|
|
26
26
|
}
|