@instructure/ui-popover 11.7.3 → 11.7.4-pr-snapshot-1781695314229
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/CHANGELOG.md +16 -0
- package/LICENSE.md +1 -0
- package/{lib/Popover/v2/styles.js → babel.config.cjs} +12 -21
- package/es/Popover/v1/index.js +4 -4
- package/es/Popover/v2/index.js +9 -3
- package/es/Popover/v2/props.js +1 -1
- package/es/Popover/v2/styles.js +8 -1
- package/es/exports/a.js +1 -1
- package/es/exports/b.js +1 -1
- package/package.json +19 -24
- package/src/Popover/v1/index.tsx +4 -3
- package/src/Popover/v2/README.md +31 -0
- package/src/Popover/v2/index.tsx +9 -2
- package/src/Popover/v2/props.ts +19 -3
- package/src/Popover/v2/styles.ts +8 -1
- package/src/exports/a.ts +1 -1
- package/src/exports/b.ts +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Popover/v1/index.d.ts +1 -0
- package/types/Popover/v1/index.d.ts.map +1 -1
- package/types/Popover/v2/index.d.ts +1 -0
- package/types/Popover/v2/index.d.ts.map +1 -1
- package/types/Popover/v2/props.d.ts +8 -1
- package/types/Popover/v2/props.d.ts.map +1 -1
- package/types/Popover/v2/styles.d.ts.map +1 -1
- package/types/exports/a.d.ts +1 -1
- package/types/exports/a.d.ts.map +1 -1
- package/types/exports/b.d.ts +1 -1
- package/types/exports/b.d.ts.map +1 -1
- package/lib/Popover/v1/index.js +0 -529
- package/lib/Popover/v1/props.js +0 -31
- package/lib/Popover/v1/styles.js +0 -46
- package/lib/Popover/v1/theme.js +0 -47
- package/lib/Popover/v2/index.js +0 -531
- package/lib/Popover/v2/props.js +0 -31
- package/lib/exports/a.js +0 -12
- package/lib/exports/b.js +0 -12
- package/lib/package.json +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [11.7.4-pr-snapshot-1781695314229](https://github.com/instructure/instructure-ui/compare/v11.7.3...v11.7.4-pr-snapshot-1781695314229) (2026-06-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **ui-date-input:** add scrollbar to dateinput v2 ([84f11c1](https://github.com/instructure/instructure-ui/commit/84f11c1c5638f9a91946b29125869115f66c5f0f))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **ui-popover:** add shouldScrollContent prop ([288c43a](https://github.com/instructure/instructure-ui/commit/288c43ac739035424417e56dbd6a4659f938a492))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [11.7.3](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3) (2026-05-07)
|
|
7
23
|
|
|
8
24
|
|
package/LICENSE.md
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
1
|
/*
|
|
8
2
|
* The MIT License (MIT)
|
|
9
3
|
*
|
|
@@ -28,18 +22,15 @@ exports.default = void 0;
|
|
|
28
22
|
* SOFTWARE.
|
|
29
23
|
*/
|
|
30
24
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
var _default = exports.default = generateStyle;
|
|
25
|
+
module.exports = {
|
|
26
|
+
presets: [
|
|
27
|
+
[
|
|
28
|
+
require('@instructure/ui-babel-preset'),
|
|
29
|
+
{
|
|
30
|
+
esModules: Boolean(process.env.ES_MODULES),
|
|
31
|
+
removeConsole: process.env.NODE_ENV === 'production',
|
|
32
|
+
transformImports: Boolean(process.env.TRANSFORM_IMPORTS)
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
]
|
|
36
|
+
}
|
package/es/Popover/v1/index.js
CHANGED
|
@@ -35,9 +35,9 @@ import { createChainedFunction, shallowEqual, px, combineDataCid } from '@instru
|
|
|
35
35
|
import { logError as error } from '@instructure/console';
|
|
36
36
|
import { FocusRegion } from '@instructure/ui-a11y-utils';
|
|
37
37
|
import { withStyle } from '@instructure/emotion';
|
|
38
|
-
import generateStyle from
|
|
39
|
-
import generateComponentTheme from
|
|
40
|
-
import { allowedProps } from
|
|
38
|
+
import generateStyle from './styles.js';
|
|
39
|
+
import generateComponentTheme from './theme.js';
|
|
40
|
+
import { allowedProps } from '../v1/props.js';
|
|
41
41
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
42
42
|
/**
|
|
43
43
|
---
|
|
@@ -46,7 +46,7 @@ tags: overlay, portal, dialog
|
|
|
46
46
|
---
|
|
47
47
|
**/
|
|
48
48
|
let Popover = (_dec = withDeterministicId(), _dec2 = textDirectionContextConsumer(), _dec3 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = _dec3(_class = class Popover extends Component {
|
|
49
|
-
static displayName =
|
|
49
|
+
static displayName = 'Popover';
|
|
50
50
|
static componentId = 'Popover';
|
|
51
51
|
static allowedProps = allowedProps;
|
|
52
52
|
static defaultProps = {
|
package/es/Popover/v2/index.js
CHANGED
|
@@ -35,8 +35,8 @@ import { createChainedFunction, shallowEqual, px, combineDataCid } from '@instru
|
|
|
35
35
|
import { logError as error } from '@instructure/console';
|
|
36
36
|
import { FocusRegion } from '@instructure/ui-a11y-utils';
|
|
37
37
|
import { withStyleNew } from '@instructure/emotion';
|
|
38
|
-
import generateStyle from
|
|
39
|
-
import { allowedProps } from
|
|
38
|
+
import generateStyle from './styles.js';
|
|
39
|
+
import { allowedProps } from './props.js';
|
|
40
40
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
41
41
|
/**
|
|
42
42
|
---
|
|
@@ -45,7 +45,7 @@ tags: overlay, portal, dialog
|
|
|
45
45
|
---
|
|
46
46
|
**/
|
|
47
47
|
let Popover = (_dec = withDeterministicId(), _dec2 = textDirectionContextConsumer(), _dec3 = withStyleNew(generateStyle), _dec(_class = _dec2(_class = _dec3(_class = class Popover extends Component {
|
|
48
|
-
static displayName =
|
|
48
|
+
static displayName = 'Popover';
|
|
49
49
|
static componentId = 'Popover';
|
|
50
50
|
static allowedProps = allowedProps;
|
|
51
51
|
static defaultProps = {
|
|
@@ -408,6 +408,12 @@ let Popover = (_dec = withDeterministicId(), _dec2 = textDirectionContextConsume
|
|
|
408
408
|
}
|
|
409
409
|
renderContent() {
|
|
410
410
|
let content = callRenderProp(this.props.children);
|
|
411
|
+
if (this.props.shouldScrollContent) {
|
|
412
|
+
content = _jsx("div", {
|
|
413
|
+
css: this.props.styles?.scrollContainer,
|
|
414
|
+
children: content
|
|
415
|
+
});
|
|
416
|
+
}
|
|
411
417
|
if (this.shown && !this.isTooltip) {
|
|
412
418
|
// if popover is NOT being used as a tooltip, create a Dialog
|
|
413
419
|
// to manage the content FocusRegion, when showing
|
package/es/Popover/v2/props.js
CHANGED
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
const allowedProps = ['isShowingContent', 'defaultIsShowingContent', 'on', 'withArrow', 'color', 'placement', 'shadow', 'stacking', 'contentRef', 'defaultFocusElement', 'screenReaderLabel', 'offsetX', 'offsetY', 'constrain', 'positionTarget', 'positionContainerDisplay', 'mountNode', 'insertAt', 'liveRegion', 'id', 'shouldAlignArrow', 'shouldTrackPosition', 'shouldRenderOffscreen', 'shouldContainFocus', 'shouldReturnFocus', 'shouldCloseOnDocumentClick', 'shouldCloseOnEscape', 'shouldFocusContentOnTriggerBlur', 'onShowContent', 'onHideContent', 'onPositioned', 'onPositionChanged', 'onClick', 'onFocus', 'onBlur', 'onKeyDown', 'onKeyUp', 'onMouseOver', 'onMouseOut', 'renderTrigger', 'children', 'elementRef', 'borderWidth', 'shouldSetAriaExpanded'];
|
|
25
|
+
const allowedProps = ['isShowingContent', 'defaultIsShowingContent', 'on', 'withArrow', 'color', 'placement', 'shadow', 'stacking', 'contentRef', 'defaultFocusElement', 'screenReaderLabel', 'offsetX', 'offsetY', 'constrain', 'positionTarget', 'positionContainerDisplay', 'mountNode', 'insertAt', 'liveRegion', 'id', 'shouldAlignArrow', 'shouldTrackPosition', 'shouldRenderOffscreen', 'shouldContainFocus', 'shouldReturnFocus', 'shouldCloseOnDocumentClick', 'shouldCloseOnEscape', 'shouldFocusContentOnTriggerBlur', 'onShowContent', 'onHideContent', 'onPositioned', 'onPositionChanged', 'onClick', 'onFocus', 'onBlur', 'onKeyDown', 'onKeyUp', 'onMouseOver', 'onMouseOut', 'renderTrigger', 'children', 'elementRef', 'borderWidth', 'shouldSetAriaExpanded', 'shouldScrollContent'];
|
|
26
26
|
export { allowedProps };
|
package/es/Popover/v2/styles.js
CHANGED
|
@@ -33,7 +33,14 @@
|
|
|
33
33
|
const generateStyle = componentTheme => {
|
|
34
34
|
return {
|
|
35
35
|
borderColor: componentTheme.borderColor,
|
|
36
|
-
borderRadius: componentTheme.borderRadius
|
|
36
|
+
borderRadius: componentTheme.borderRadius,
|
|
37
|
+
scrollContainer: {
|
|
38
|
+
label: 'popover__scrollContainer',
|
|
39
|
+
maxHeight: 'var(--ui-position-available-height, 100vh)',
|
|
40
|
+
overflowY: 'auto',
|
|
41
|
+
overflowX: 'hidden',
|
|
42
|
+
borderRadius: componentTheme.borderRadius
|
|
43
|
+
}
|
|
37
44
|
};
|
|
38
45
|
};
|
|
39
46
|
export default generateStyle;
|
package/es/exports/a.js
CHANGED
package/es/exports/b.js
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-popover",
|
|
3
|
-
"version": "11.7.
|
|
3
|
+
"version": "11.7.4-pr-snapshot-1781695314229",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "A component for hiding or showing content based on user interaction.",
|
|
5
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
7
|
"module": "./es/index.js",
|
|
7
|
-
"main": "./lib/index.js",
|
|
8
8
|
"types": "./types/index.d.ts",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -16,28 +16,28 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@babel/runtime": "^7.29.2",
|
|
18
18
|
"keycode": "^2.2.1",
|
|
19
|
-
"@instructure/console": "11.7.
|
|
20
|
-
"@instructure/
|
|
21
|
-
"@instructure/
|
|
22
|
-
"@instructure/ui-
|
|
23
|
-
"@instructure/
|
|
24
|
-
"@instructure/ui-
|
|
25
|
-
"@instructure/ui-
|
|
26
|
-
"@instructure/ui-position": "11.7.
|
|
27
|
-
"@instructure/ui-react-utils": "11.7.
|
|
28
|
-
"@instructure/ui-
|
|
29
|
-
"@instructure/ui-
|
|
30
|
-
"@instructure/ui-
|
|
31
|
-
"@instructure/uid": "11.7.
|
|
19
|
+
"@instructure/console": "11.7.4-pr-snapshot-1781695314229",
|
|
20
|
+
"@instructure/emotion": "11.7.4-pr-snapshot-1781695314229",
|
|
21
|
+
"@instructure/shared-types": "11.7.4-pr-snapshot-1781695314229",
|
|
22
|
+
"@instructure/ui-a11y-utils": "11.7.4-pr-snapshot-1781695314229",
|
|
23
|
+
"@instructure/ui-dialog": "11.7.4-pr-snapshot-1781695314229",
|
|
24
|
+
"@instructure/ui-i18n": "11.7.4-pr-snapshot-1781695314229",
|
|
25
|
+
"@instructure/ui-dom-utils": "11.7.4-pr-snapshot-1781695314229",
|
|
26
|
+
"@instructure/ui-position": "11.7.4-pr-snapshot-1781695314229",
|
|
27
|
+
"@instructure/ui-react-utils": "11.7.4-pr-snapshot-1781695314229",
|
|
28
|
+
"@instructure/ui-utils": "11.7.4-pr-snapshot-1781695314229",
|
|
29
|
+
"@instructure/ui-view": "11.7.4-pr-snapshot-1781695314229",
|
|
30
|
+
"@instructure/ui-themes": "11.7.4-pr-snapshot-1781695314229",
|
|
31
|
+
"@instructure/uid": "11.7.4-pr-snapshot-1781695314229"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@testing-library/jest-dom": "^6.6.3",
|
|
35
35
|
"@testing-library/react": "15.0.7",
|
|
36
36
|
"@testing-library/user-event": "^14.6.1",
|
|
37
37
|
"vitest": "^3.2.2",
|
|
38
|
-
"@instructure/ui-axe-check": "11.7.
|
|
39
|
-
"@instructure/ui-babel-preset": "11.7.
|
|
40
|
-
"@instructure/ui-color-utils": "11.7.
|
|
38
|
+
"@instructure/ui-axe-check": "11.7.4-pr-snapshot-1781695314229",
|
|
39
|
+
"@instructure/ui-babel-preset": "11.7.4-pr-snapshot-1781695314229",
|
|
40
|
+
"@instructure/ui-color-utils": "11.7.4-pr-snapshot-1781695314229"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"react": ">=18 <=19"
|
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
},
|
|
48
48
|
"sideEffects": false,
|
|
49
49
|
"exports": {
|
|
50
|
-
"./lib/*": "./lib/*",
|
|
51
50
|
"./es/*": "./es/*",
|
|
52
51
|
"./types/*": "./types/*",
|
|
53
52
|
"./package.json": "./package.json",
|
|
@@ -56,28 +55,24 @@
|
|
|
56
55
|
"src": "./src/exports/a.ts",
|
|
57
56
|
"types": "./types/exports/a.d.ts",
|
|
58
57
|
"import": "./es/exports/a.js",
|
|
59
|
-
"require": "./lib/exports/a.js",
|
|
60
58
|
"default": "./es/exports/a.js"
|
|
61
59
|
},
|
|
62
60
|
"./v11_6": {
|
|
63
61
|
"src": "./src/exports/a.ts",
|
|
64
62
|
"types": "./types/exports/a.d.ts",
|
|
65
63
|
"import": "./es/exports/a.js",
|
|
66
|
-
"require": "./lib/exports/a.js",
|
|
67
64
|
"default": "./es/exports/a.js"
|
|
68
65
|
},
|
|
69
66
|
"./v11_7": {
|
|
70
67
|
"src": "./src/exports/b.ts",
|
|
71
68
|
"types": "./types/exports/b.d.ts",
|
|
72
69
|
"import": "./es/exports/b.js",
|
|
73
|
-
"require": "./lib/exports/b.js",
|
|
74
70
|
"default": "./es/exports/b.js"
|
|
75
71
|
},
|
|
76
72
|
"./latest": {
|
|
77
73
|
"src": "./src/exports/b.ts",
|
|
78
74
|
"types": "./types/exports/b.d.ts",
|
|
79
75
|
"import": "./es/exports/b.js",
|
|
80
|
-
"require": "./lib/exports/b.js",
|
|
81
76
|
"default": "./es/exports/b.js"
|
|
82
77
|
}
|
|
83
78
|
},
|
|
@@ -85,7 +80,7 @@
|
|
|
85
80
|
"lint": "ui-scripts lint",
|
|
86
81
|
"lint:fix": "ui-scripts lint --fix",
|
|
87
82
|
"clean": "ui-scripts clean",
|
|
88
|
-
"build": "ui-scripts build
|
|
83
|
+
"build": "ui-scripts build",
|
|
89
84
|
"build:watch": "pnpm run ts:check -- --watch & ui-scripts build --watch",
|
|
90
85
|
"build:types": "tsc -p tsconfig.build.json",
|
|
91
86
|
"ts:check": "tsc -p tsconfig.build.json --noEmit --emitDeclarationOnly false"
|
package/src/Popover/v1/index.tsx
CHANGED
|
@@ -61,11 +61,11 @@ import type { DialogProps } from '@instructure/ui-dialog'
|
|
|
61
61
|
|
|
62
62
|
import { withStyle } from '@instructure/emotion'
|
|
63
63
|
|
|
64
|
-
import generateStyle from './styles'
|
|
65
|
-
import generateComponentTheme from './theme'
|
|
64
|
+
import generateStyle from './styles.js'
|
|
65
|
+
import generateComponentTheme from './theme.js'
|
|
66
66
|
|
|
67
67
|
import type { PopoverProps, PopoverState } from '../v1/props'
|
|
68
|
-
import { allowedProps } from '../v1/props'
|
|
68
|
+
import { allowedProps } from '../v1/props.js'
|
|
69
69
|
import type { Renderable } from '@instructure/shared-types'
|
|
70
70
|
/**
|
|
71
71
|
---
|
|
@@ -77,6 +77,7 @@ tags: overlay, portal, dialog
|
|
|
77
77
|
@textDirectionContextConsumer()
|
|
78
78
|
@withStyle(generateStyle, generateComponentTheme)
|
|
79
79
|
class Popover extends Component<PopoverProps, PopoverState> {
|
|
80
|
+
static displayName = 'Popover'
|
|
80
81
|
static readonly componentId = 'Popover'
|
|
81
82
|
|
|
82
83
|
static allowedProps = allowedProps
|
package/src/Popover/v2/README.md
CHANGED
|
@@ -425,6 +425,37 @@ const Example = () => {
|
|
|
425
425
|
render(<Example />)
|
|
426
426
|
```
|
|
427
427
|
|
|
428
|
+
#### Scrolling content (`shouldScrollContent`)
|
|
429
|
+
|
|
430
|
+
When the popover content can grow taller than the available viewport space, set `shouldScrollContent` to wrap the content in a scroll container that fits to the room between the trigger element and the viewport edge. To try the example below, zoom in until the available space becomes small enough that a scrollbar is displayed in the Popover.
|
|
431
|
+
|
|
432
|
+
```js
|
|
433
|
+
---
|
|
434
|
+
type: example
|
|
435
|
+
---
|
|
436
|
+
const fpo = lorem.paragraphs(8)
|
|
437
|
+
class Example extends React.Component {
|
|
438
|
+
state = { isOpen: false }
|
|
439
|
+
render () {
|
|
440
|
+
return (
|
|
441
|
+
<Popover
|
|
442
|
+
on="click"
|
|
443
|
+
placement="bottom start"
|
|
444
|
+
isShowingContent={this.state.isOpen}
|
|
445
|
+
onShowContent={() => this.setState({ isOpen: true })}
|
|
446
|
+
onHideContent={() => this.setState({ isOpen: false })}
|
|
447
|
+
shouldScrollContent
|
|
448
|
+
screenReaderLabel="A long popover"
|
|
449
|
+
renderTrigger={<Button>Open scrollable popover</Button>}
|
|
450
|
+
>
|
|
451
|
+
<View as="div" padding="small" maxWidth="22rem">{fpo}</View>
|
|
452
|
+
</Popover>
|
|
453
|
+
)
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
render(<Example />)
|
|
457
|
+
```
|
|
458
|
+
|
|
428
459
|
### Guidelines
|
|
429
460
|
|
|
430
461
|
```js
|
package/src/Popover/v2/index.tsx
CHANGED
|
@@ -61,10 +61,10 @@ import type { DialogProps } from '@instructure/ui-dialog'
|
|
|
61
61
|
|
|
62
62
|
import { withStyleNew } from '@instructure/emotion'
|
|
63
63
|
|
|
64
|
-
import generateStyle from './styles'
|
|
64
|
+
import generateStyle from './styles.js'
|
|
65
65
|
|
|
66
66
|
import type { PopoverProps, PopoverState } from './props'
|
|
67
|
-
import { allowedProps } from './props'
|
|
67
|
+
import { allowedProps } from './props.js'
|
|
68
68
|
import type { Renderable } from '@instructure/shared-types'
|
|
69
69
|
/**
|
|
70
70
|
---
|
|
@@ -76,6 +76,7 @@ tags: overlay, portal, dialog
|
|
|
76
76
|
@textDirectionContextConsumer()
|
|
77
77
|
@withStyleNew(generateStyle)
|
|
78
78
|
class Popover extends Component<PopoverProps, PopoverState> {
|
|
79
|
+
static displayName = 'Popover'
|
|
79
80
|
static readonly componentId = 'Popover'
|
|
80
81
|
|
|
81
82
|
static allowedProps = allowedProps
|
|
@@ -519,6 +520,12 @@ class Popover extends Component<PopoverProps, PopoverState> {
|
|
|
519
520
|
renderContent() {
|
|
520
521
|
let content = callRenderProp(this.props.children)
|
|
521
522
|
|
|
523
|
+
if (this.props.shouldScrollContent) {
|
|
524
|
+
content = (
|
|
525
|
+
<div css={this.props.styles?.scrollContainer}>{content}</div>
|
|
526
|
+
)
|
|
527
|
+
}
|
|
528
|
+
|
|
522
529
|
if (this.shown && !this.isTooltip) {
|
|
523
530
|
// if popover is NOT being used as a tooltip, create a Dialog
|
|
524
531
|
// to manage the content FocusRegion, when showing
|
package/src/Popover/v2/props.ts
CHANGED
|
@@ -25,7 +25,12 @@ import React from 'react'
|
|
|
25
25
|
import { BorderWidth } from '@instructure/emotion'
|
|
26
26
|
import type { NewComponentTypes } from '@instructure/ui-themes'
|
|
27
27
|
|
|
28
|
-
import type {
|
|
28
|
+
import type {
|
|
29
|
+
Shadow,
|
|
30
|
+
Stacking,
|
|
31
|
+
StyleObject,
|
|
32
|
+
WithStyleProps
|
|
33
|
+
} from '@instructure/emotion'
|
|
29
34
|
|
|
30
35
|
import type {
|
|
31
36
|
PlacementPropValues,
|
|
@@ -284,6 +289,12 @@ type PopoverOwnProps = {
|
|
|
284
289
|
* otherwise its calculated automatically based on whether the content is shown.
|
|
285
290
|
*/
|
|
286
291
|
shouldSetAriaExpanded?: boolean
|
|
292
|
+
/**
|
|
293
|
+
* When `true`, wraps the popover content in a container that caps its
|
|
294
|
+
* height to the available viewport space and scrolls when content
|
|
295
|
+
* overflows.
|
|
296
|
+
*/
|
|
297
|
+
shouldScrollContent?: boolean
|
|
287
298
|
}
|
|
288
299
|
|
|
289
300
|
type PopoverProps = PopoverOwnProps &
|
|
@@ -302,7 +313,11 @@ type PropKeys = keyof PopoverOwnProps
|
|
|
302
313
|
|
|
303
314
|
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
304
315
|
|
|
305
|
-
type PopoverStyle = {
|
|
316
|
+
type PopoverStyle = {
|
|
317
|
+
borderRadius: string
|
|
318
|
+
borderColor: string
|
|
319
|
+
scrollContainer: StyleObject
|
|
320
|
+
}
|
|
306
321
|
const allowedProps: AllowedPropKeys = [
|
|
307
322
|
'isShowingContent',
|
|
308
323
|
'defaultIsShowingContent',
|
|
@@ -347,7 +362,8 @@ const allowedProps: AllowedPropKeys = [
|
|
|
347
362
|
'children',
|
|
348
363
|
'elementRef',
|
|
349
364
|
'borderWidth',
|
|
350
|
-
'shouldSetAriaExpanded'
|
|
365
|
+
'shouldSetAriaExpanded',
|
|
366
|
+
'shouldScrollContent'
|
|
351
367
|
]
|
|
352
368
|
|
|
353
369
|
export type { PopoverOwnProps, PopoverProps, PopoverState, PopoverStyle }
|
package/src/Popover/v2/styles.ts
CHANGED
|
@@ -38,7 +38,14 @@ const generateStyle = (
|
|
|
38
38
|
): PopoverStyle => {
|
|
39
39
|
return {
|
|
40
40
|
borderColor: componentTheme.borderColor,
|
|
41
|
-
borderRadius: componentTheme.borderRadius
|
|
41
|
+
borderRadius: componentTheme.borderRadius,
|
|
42
|
+
scrollContainer: {
|
|
43
|
+
label: 'popover__scrollContainer',
|
|
44
|
+
maxHeight: 'var(--ui-position-available-height, 100vh)',
|
|
45
|
+
overflowY: 'auto',
|
|
46
|
+
overflowX: 'hidden',
|
|
47
|
+
borderRadius: componentTheme.borderRadius
|
|
48
|
+
}
|
|
42
49
|
}
|
|
43
50
|
}
|
|
44
51
|
|
package/src/exports/a.ts
CHANGED
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
-
export { Popover } from '../Popover/v1'
|
|
24
|
+
export { Popover } from '../Popover/v1/index.js'
|
|
25
25
|
export type { PopoverOwnProps, PopoverProps } from '../Popover/v1/props'
|
package/src/exports/b.ts
CHANGED
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
-
export { Popover } from '../Popover/v2'
|
|
24
|
+
export { Popover } from '../Popover/v2/index.js'
|
|
25
25
|
export type { PopoverOwnProps, PopoverProps } from '../Popover/v2/props'
|