@targetprocess/popover 12.22.3-alpha.0 → 12.22.6-alpha.4
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/PopoverContainer.tsx +8 -28
- package/dist/popover.es.js +5 -16
- package/dist/popover.js +5 -16
- package/package.json +2 -2
package/PopoverContainer.tsx
CHANGED
|
@@ -277,33 +277,13 @@ export class PopoverContainer extends React.Component<
|
|
|
277
277
|
}}
|
|
278
278
|
/>
|
|
279
279
|
)}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
<div
|
|
288
|
-
id={this.popoverContainerId}
|
|
289
|
-
ref={this.popoverContentRef}
|
|
290
|
-
style={{
|
|
291
|
-
position: 'absolute',
|
|
292
|
-
pointerEvents: 'all',
|
|
293
|
-
...position
|
|
294
|
-
}}
|
|
295
|
-
tabIndex={-1}
|
|
296
|
-
className={this.props.className}
|
|
297
|
-
role={this.props.role}
|
|
298
|
-
aria-modal={this.props.trapFocus ? 'true' : 'false'}
|
|
299
|
-
onKeyDown={this.handleKeyDown}
|
|
300
|
-
>
|
|
301
|
-
{this.props.children}
|
|
302
|
-
</div>
|
|
303
|
-
</FocusTrap>
|
|
304
|
-
)}
|
|
305
|
-
|
|
306
|
-
{!this.props.trapFocus && (
|
|
280
|
+
<FocusTrap
|
|
281
|
+
active={this.props.trapFocus}
|
|
282
|
+
focusTrapOptions={{
|
|
283
|
+
fallbackFocus: `#${this.popoverContainerId}`,
|
|
284
|
+
clickOutsideDeactivates: true
|
|
285
|
+
}}
|
|
286
|
+
>
|
|
307
287
|
<div
|
|
308
288
|
id={this.popoverContainerId}
|
|
309
289
|
ref={this.popoverContentRef}
|
|
@@ -320,7 +300,7 @@ export class PopoverContainer extends React.Component<
|
|
|
320
300
|
>
|
|
321
301
|
{this.props.children}
|
|
322
302
|
</div>
|
|
323
|
-
|
|
303
|
+
</FocusTrap>
|
|
324
304
|
</div>
|
|
325
305
|
)
|
|
326
306
|
}
|
package/dist/popover.es.js
CHANGED
|
@@ -209,8 +209,8 @@ function styleInject(css, ref) {
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
var css = "/*********************************************************************\n* © Copyright IBM Corp. 2024\n*********************************************************************/\n.popover-body-container__popover__12-22-
|
|
213
|
-
var styles = {"popover-body-container":"popover-body-container__popover__12-22-
|
|
212
|
+
var css = "/*********************************************************************\n* © Copyright IBM Corp. 2024\n*********************************************************************/\n.popover-body-container__popover__12-22-6-alpha-4 {\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.popover-body__popover__12-22-6-alpha-4 {\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.popover-body--no-padding__popover__12-22-6-alpha-4 {\n padding: 0;\n }\n.popover-tip__popover__12-22-6-alpha-4 {\n position: absolute;\n pointer-events: none;\n z-index: calc(var(--ZIndexModal, 10001) + 1);\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.popover-tip__popover__12-22-6-alpha-4: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: 11.2px;\n height: 11.2px;\n -webkit-transform: rotate(45deg);\n transform: rotate(45deg);\n }\n.popover-tip--bottom__popover__12-22-6-alpha-4,\n .popover-tip--top__popover__12-22-6-alpha-4 {\n width: 100%;\n border-top: 1px var(--BackgroundDefault, #FFFFFF);\n border-bottom: 1px var(--BackgroundDefault, #FFFFFF);\n height: 9px;\n }\n.popover-tip--left__popover__12-22-6-alpha-4,\n .popover-tip--right__popover__12-22-6-alpha-4 {\n border-left: 1px var(--BackgroundDefault, #FFFFFF);\n border-right: 1px var(--BackgroundDefault, #FFFFFF);\n height: 100%;\n width: 9px;\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.popover-tip--bottom__popover__12-22-6-alpha-4:before {\n -webkit-transform-origin: left top;\n transform-origin: left top;\n left: 50%;\n top: 0;\n }\n.popover-tip--top__popover__12-22-6-alpha-4:before {\n -webkit-transform-origin: right bottom;\n transform-origin: right bottom;\n right: 50%;\n bottom: 0;\n }\n.popover-tip--left__popover__12-22-6-alpha-4:before {\n -webkit-transform-origin: right top;\n transform-origin: right top;\n right: 0;\n top: 50%;\n }\n.popover-tip--right__popover__12-22-6-alpha-4:before {\n -webkit-transform-origin: left bottom;\n transform-origin: left bottom;\n left: 0;\n bottom: 50%;\n }\n";
|
|
213
|
+
var styles = {"popover-body-container":"popover-body-container__popover__12-22-6-alpha-4","popover-body":"popover-body__popover__12-22-6-alpha-4","popover-body--no-padding":"popover-body--no-padding__popover__12-22-6-alpha-4","popover-tip":"popover-tip__popover__12-22-6-alpha-4","popover-tip--bottom":"popover-tip--bottom__popover__12-22-6-alpha-4","popover-tip--top":"popover-tip--top__popover__12-22-6-alpha-4","popover-tip--left":"popover-tip--left__popover__12-22-6-alpha-4","popover-tip--right":"popover-tip--right__popover__12-22-6-alpha-4"};
|
|
214
214
|
styleInject(css);
|
|
215
215
|
|
|
216
216
|
/*********************************************************************
|
|
@@ -494,7 +494,8 @@ var PopoverContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
494
494
|
left: tipPosition === 'right' && position.left - 8,
|
|
495
495
|
right: tipPosition === 'left' && position.right - 8
|
|
496
496
|
}
|
|
497
|
-
}),
|
|
497
|
+
}), React.createElement(FocusTrap, {
|
|
498
|
+
active: this.props.trapFocus,
|
|
498
499
|
focusTrapOptions: {
|
|
499
500
|
fallbackFocus: "#".concat(this.popoverContainerId),
|
|
500
501
|
clickOutsideDeactivates: true
|
|
@@ -511,19 +512,7 @@ var PopoverContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
511
512
|
role: this.props.role,
|
|
512
513
|
"aria-modal": this.props.trapFocus ? 'true' : 'false',
|
|
513
514
|
onKeyDown: this.handleKeyDown
|
|
514
|
-
}, this.props.children))
|
|
515
|
-
id: this.popoverContainerId,
|
|
516
|
-
ref: this.popoverContentRef,
|
|
517
|
-
style: _extends({
|
|
518
|
-
position: 'absolute',
|
|
519
|
-
pointerEvents: 'all'
|
|
520
|
-
}, position),
|
|
521
|
-
tabIndex: -1,
|
|
522
|
-
className: this.props.className,
|
|
523
|
-
role: this.props.role,
|
|
524
|
-
"aria-modal": this.props.trapFocus ? 'true' : 'false',
|
|
525
|
-
onKeyDown: this.handleKeyDown
|
|
526
|
-
}, this.props.children));
|
|
515
|
+
}, this.props.children)));
|
|
527
516
|
}
|
|
528
517
|
}]);
|
|
529
518
|
return PopoverContainer;
|
package/dist/popover.js
CHANGED
|
@@ -216,8 +216,8 @@ function styleInject(css, ref) {
|
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
var css = "/*********************************************************************\n* © Copyright IBM Corp. 2024\n*********************************************************************/\n.popover-body-container__popover__12-22-
|
|
220
|
-
var styles = {"popover-body-container":"popover-body-container__popover__12-22-
|
|
219
|
+
var css = "/*********************************************************************\n* © Copyright IBM Corp. 2024\n*********************************************************************/\n.popover-body-container__popover__12-22-6-alpha-4 {\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.popover-body__popover__12-22-6-alpha-4 {\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.popover-body--no-padding__popover__12-22-6-alpha-4 {\n padding: 0;\n }\n.popover-tip__popover__12-22-6-alpha-4 {\n position: absolute;\n pointer-events: none;\n z-index: calc(var(--ZIndexModal, 10001) + 1);\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.popover-tip__popover__12-22-6-alpha-4: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: 11.2px;\n height: 11.2px;\n -webkit-transform: rotate(45deg);\n transform: rotate(45deg);\n }\n.popover-tip--bottom__popover__12-22-6-alpha-4,\n .popover-tip--top__popover__12-22-6-alpha-4 {\n width: 100%;\n border-top: 1px var(--BackgroundDefault, #FFFFFF);\n border-bottom: 1px var(--BackgroundDefault, #FFFFFF);\n height: 9px;\n }\n.popover-tip--left__popover__12-22-6-alpha-4,\n .popover-tip--right__popover__12-22-6-alpha-4 {\n border-left: 1px var(--BackgroundDefault, #FFFFFF);\n border-right: 1px var(--BackgroundDefault, #FFFFFF);\n height: 100%;\n width: 9px;\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.popover-tip--bottom__popover__12-22-6-alpha-4:before {\n -webkit-transform-origin: left top;\n transform-origin: left top;\n left: 50%;\n top: 0;\n }\n.popover-tip--top__popover__12-22-6-alpha-4:before {\n -webkit-transform-origin: right bottom;\n transform-origin: right bottom;\n right: 50%;\n bottom: 0;\n }\n.popover-tip--left__popover__12-22-6-alpha-4:before {\n -webkit-transform-origin: right top;\n transform-origin: right top;\n right: 0;\n top: 50%;\n }\n.popover-tip--right__popover__12-22-6-alpha-4:before {\n -webkit-transform-origin: left bottom;\n transform-origin: left bottom;\n left: 0;\n bottom: 50%;\n }\n";
|
|
220
|
+
var styles = {"popover-body-container":"popover-body-container__popover__12-22-6-alpha-4","popover-body":"popover-body__popover__12-22-6-alpha-4","popover-body--no-padding":"popover-body--no-padding__popover__12-22-6-alpha-4","popover-tip":"popover-tip__popover__12-22-6-alpha-4","popover-tip--bottom":"popover-tip--bottom__popover__12-22-6-alpha-4","popover-tip--top":"popover-tip--top__popover__12-22-6-alpha-4","popover-tip--left":"popover-tip--left__popover__12-22-6-alpha-4","popover-tip--right":"popover-tip--right__popover__12-22-6-alpha-4"};
|
|
221
221
|
styleInject(css);
|
|
222
222
|
|
|
223
223
|
/*********************************************************************
|
|
@@ -501,7 +501,8 @@ var PopoverContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
501
501
|
left: tipPosition === 'right' && position.left - 8,
|
|
502
502
|
right: tipPosition === 'left' && position.right - 8
|
|
503
503
|
}
|
|
504
|
-
}),
|
|
504
|
+
}), React__default.createElement(FocusTrap, {
|
|
505
|
+
active: this.props.trapFocus,
|
|
505
506
|
focusTrapOptions: {
|
|
506
507
|
fallbackFocus: "#".concat(this.popoverContainerId),
|
|
507
508
|
clickOutsideDeactivates: true
|
|
@@ -518,19 +519,7 @@ var PopoverContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
518
519
|
role: this.props.role,
|
|
519
520
|
"aria-modal": this.props.trapFocus ? 'true' : 'false',
|
|
520
521
|
onKeyDown: this.handleKeyDown
|
|
521
|
-
}, this.props.children))
|
|
522
|
-
id: this.popoverContainerId,
|
|
523
|
-
ref: this.popoverContentRef,
|
|
524
|
-
style: _extends({
|
|
525
|
-
position: 'absolute',
|
|
526
|
-
pointerEvents: 'all'
|
|
527
|
-
}, position),
|
|
528
|
-
tabIndex: -1,
|
|
529
|
-
className: this.props.className,
|
|
530
|
-
role: this.props.role,
|
|
531
|
-
"aria-modal": this.props.trapFocus ? 'true' : 'false',
|
|
532
|
-
onKeyDown: this.handleKeyDown
|
|
533
|
-
}, this.props.children));
|
|
522
|
+
}, this.props.children)));
|
|
534
523
|
}
|
|
535
524
|
}]);
|
|
536
525
|
return PopoverContainer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@targetprocess/popover",
|
|
3
|
-
"version": "12.22.
|
|
3
|
+
"version": "12.22.6-alpha.4",
|
|
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": "92a2836c7ebd25e8ca62c5ce0877aff1f2bc5cfe"
|
|
26
26
|
}
|