@instructure/ui-drawer-layout 10.26.1 → 11.0.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/CHANGELOG.md +23 -2
- package/es/DrawerLayout/DrawerContent/index.js +6 -6
- package/es/DrawerLayout/DrawerContent/props.js +1 -9
- package/es/DrawerLayout/DrawerTray/index.js +6 -6
- package/es/DrawerLayout/DrawerTray/props.js +1 -32
- package/es/DrawerLayout/__fixtures__/DrawerLayout.fixture.js +0 -8
- package/es/DrawerLayout/index.js +6 -6
- package/es/DrawerLayout/props.js +1 -12
- package/lib/DrawerLayout/DrawerContent/index.js +5 -5
- package/lib/DrawerLayout/DrawerContent/props.js +1 -10
- package/lib/DrawerLayout/DrawerTray/index.js +5 -5
- package/lib/DrawerLayout/DrawerTray/props.js +1 -33
- package/lib/DrawerLayout/__fixtures__/DrawerLayout.fixture.js +0 -9
- package/lib/DrawerLayout/index.js +5 -5
- package/lib/DrawerLayout/props.js +1 -13
- package/package.json +19 -22
- package/src/DrawerLayout/DrawerContent/index.tsx +2 -4
- package/src/DrawerLayout/DrawerContent/props.ts +1 -12
- package/src/DrawerLayout/DrawerTray/index.tsx +2 -4
- package/src/DrawerLayout/DrawerTray/props.ts +1 -41
- package/src/DrawerLayout/__fixtures__/DrawerLayout.fixture.tsx +0 -9
- package/src/DrawerLayout/index.tsx +2 -4
- package/src/DrawerLayout/props.ts +1 -18
- package/tsconfig.build.json +0 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/DrawerLayout/DrawerContent/index.d.ts +0 -7
- package/types/DrawerLayout/DrawerContent/index.d.ts.map +1 -1
- package/types/DrawerLayout/DrawerContent/props.d.ts +2 -3
- package/types/DrawerLayout/DrawerContent/props.d.ts.map +1 -1
- package/types/DrawerLayout/DrawerTray/index.d.ts +0 -17
- package/types/DrawerLayout/DrawerTray/index.d.ts.map +1 -1
- package/types/DrawerLayout/DrawerTray/props.d.ts +2 -3
- package/types/DrawerLayout/DrawerTray/props.d.ts.map +1 -1
- package/types/DrawerLayout/__fixtures__/DrawerLayout.fixture.d.ts +0 -8
- package/types/DrawerLayout/__fixtures__/DrawerLayout.fixture.d.ts.map +1 -1
- package/types/DrawerLayout/index.d.ts +0 -1
- package/types/DrawerLayout/index.d.ts.map +1 -1
- package/types/DrawerLayout/props.d.ts +1 -3
- package/types/DrawerLayout/props.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,9 +3,30 @@
|
|
|
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
|
-
|
|
6
|
+
# [11.0.0](https://github.com/instructure/instructure-ui/compare/v10.26.0...v11.0.0) (2025-10-06)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **many:** instUI v11 release ([36f5438](https://github.com/instructure/instructure-ui/commit/36f54382669186227ba24798bbf7201ef2f5cd4c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* **many:** InstUI v11 contains the following breaking changes:
|
|
17
|
+
- React 16 and 17 are no longer supported
|
|
18
|
+
- remove `PropTypes` from all packages
|
|
19
|
+
- remove `CodeEditor` component
|
|
20
|
+
- remove `@instui/theme-registry` package
|
|
21
|
+
- remove `@testable`, `@experimental`, `@hack` decorators
|
|
22
|
+
- InstUISettingsProvider's `as` prop is removed
|
|
23
|
+
- `canvas.use()`, `canvasHighContrast.use()` functions are removed
|
|
24
|
+
- `canvasThemeLocal`, `canvasHighContrastThemeLocal` are removed
|
|
25
|
+
- `variables` field on theme objects are removed
|
|
26
|
+
- remove deprecated props from Table: Row's `isStacked`, Body's
|
|
27
|
+
`isStacked`, `hover`, and `headers`
|
|
28
|
+
- `Table`'s `caption` prop is now required
|
|
29
|
+
- `ui-dom-utils`'s `getComputedStyle` can now return `undefined`
|
|
9
30
|
|
|
10
31
|
|
|
11
32
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec,
|
|
1
|
+
var _dec, _class, _DrawerContent;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -27,11 +27,10 @@ import { Component } from 'react';
|
|
|
27
27
|
import { debounce } from '@instructure/debounce';
|
|
28
28
|
import { getBoundingClientRect } from '@instructure/ui-dom-utils';
|
|
29
29
|
import { omitProps } from '@instructure/ui-react-utils';
|
|
30
|
-
import { testable } from '@instructure/ui-testable';
|
|
31
30
|
import { withStyle } from '@instructure/emotion';
|
|
32
31
|
import generateStyle from './styles';
|
|
33
32
|
import generateComponentTheme from './theme';
|
|
34
|
-
import {
|
|
33
|
+
import { allowedProps } from './props';
|
|
35
34
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
36
35
|
/**
|
|
37
36
|
---
|
|
@@ -39,7 +38,7 @@ parent: DrawerLayout
|
|
|
39
38
|
id: DrawerLayout.Content
|
|
40
39
|
---
|
|
41
40
|
**/
|
|
42
|
-
let DrawerContent = (_dec = withStyle(generateStyle, generateComponentTheme),
|
|
41
|
+
let DrawerContent = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_DrawerContent = class DrawerContent extends Component {
|
|
43
42
|
constructor(...args) {
|
|
44
43
|
super(...args);
|
|
45
44
|
this.ref = null;
|
|
@@ -115,11 +114,12 @@ let DrawerContent = (_dec = withStyle(generateStyle, generateComponentTheme), _d
|
|
|
115
114
|
ref: this.handleContentRef,
|
|
116
115
|
"aria-label": label,
|
|
117
116
|
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.drawerContent,
|
|
117
|
+
"data-cid": "DrawerContent",
|
|
118
118
|
children: this.props.children
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
|
-
}, _DrawerContent.displayName = "DrawerContent", _DrawerContent.componentId = 'DrawerLayout.Content', _DrawerContent.locatorAttribute = 'data-drawer-content', _DrawerContent.
|
|
121
|
+
}, _DrawerContent.displayName = "DrawerContent", _DrawerContent.componentId = 'DrawerLayout.Content', _DrawerContent.locatorAttribute = 'data-drawer-content', _DrawerContent.allowedProps = allowedProps, _DrawerContent.defaultProps = {
|
|
122
122
|
role: 'region'
|
|
123
|
-
}, _DrawerContent)) || _class)
|
|
123
|
+
}, _DrawerContent)) || _class);
|
|
124
124
|
export default DrawerContent;
|
|
125
125
|
export { DrawerContent };
|
|
@@ -22,13 +22,5 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
const propTypes = {
|
|
27
|
-
label: PropTypes.string.isRequired,
|
|
28
|
-
children: PropTypes.node,
|
|
29
|
-
contentRef: PropTypes.func,
|
|
30
|
-
onSizeChange: PropTypes.func,
|
|
31
|
-
role: PropTypes.string
|
|
32
|
-
};
|
|
33
25
|
const allowedProps = ['label', 'children', 'contentRef', 'onSizeChange', 'role'];
|
|
34
|
-
export {
|
|
26
|
+
export { allowedProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
const _excluded = ["label", "children", "render", "placement", "open", "onOpen", "onClose", "border", "shadow", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "contentRef", "mountNode", "defaultFocusElement", "liveRegion", "onDismiss", "onTransition", "shouldReturnFocus", "shouldCloseOnEscape", "shouldCloseOnDocumentClick", "shouldContainFocus", "styles"];
|
|
3
|
-
var _dec, _dec2,
|
|
3
|
+
var _dec, _dec2, _class, _DrawerTray;
|
|
4
4
|
/*
|
|
5
5
|
* The MIT License (MIT)
|
|
6
6
|
*
|
|
@@ -31,14 +31,13 @@ import { textDirectionContextConsumer } from '@instructure/ui-i18n';
|
|
|
31
31
|
import { Transition } from '@instructure/ui-motion';
|
|
32
32
|
import { omitProps } from '@instructure/ui-react-utils';
|
|
33
33
|
import { createChainedFunction } from '@instructure/ui-utils';
|
|
34
|
-
import { testable } from '@instructure/ui-testable';
|
|
35
34
|
import { Dialog } from '@instructure/ui-dialog';
|
|
36
35
|
import { Portal } from '@instructure/ui-portal';
|
|
37
36
|
import { mirrorHorizontalPlacement } from '@instructure/ui-position';
|
|
38
37
|
import generateStyle from './styles';
|
|
39
38
|
import generateComponentTheme from './theme';
|
|
40
39
|
import { DrawerLayoutContext } from '../index';
|
|
41
|
-
import {
|
|
40
|
+
import { allowedProps } from './props';
|
|
42
41
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
43
42
|
/**
|
|
44
43
|
---
|
|
@@ -46,7 +45,7 @@ parent: DrawerLayout
|
|
|
46
45
|
id: DrawerLayout.Tray
|
|
47
46
|
---
|
|
48
47
|
**/
|
|
49
|
-
let DrawerTray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = textDirectionContextConsumer(),
|
|
48
|
+
let DrawerTray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = textDirectionContextConsumer(), _dec(_class = _dec2(_class = (_DrawerTray = class DrawerTray extends Component {
|
|
50
49
|
get _content() {
|
|
51
50
|
return this.ref;
|
|
52
51
|
}
|
|
@@ -184,6 +183,7 @@ let DrawerTray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
184
183
|
...omitProps(props, DrawerTray.allowedProps),
|
|
185
184
|
ref: this.handleContentRef,
|
|
186
185
|
css: trayStyles,
|
|
186
|
+
"data-cid": "DrawerTray",
|
|
187
187
|
children: _jsx(Dialog, {
|
|
188
188
|
open: true,
|
|
189
189
|
role: shouldOverlayTray ? 'dialog' : 'region',
|
|
@@ -214,7 +214,7 @@ let DrawerTray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
214
214
|
}
|
|
215
215
|
});
|
|
216
216
|
}
|
|
217
|
-
}, _DrawerTray.displayName = "DrawerTray", _DrawerTray.componentId = 'DrawerLayout.Tray', _DrawerTray.locatorAttribute = 'data-drawer-tray', _DrawerTray.
|
|
217
|
+
}, _DrawerTray.displayName = "DrawerTray", _DrawerTray.componentId = 'DrawerLayout.Tray', _DrawerTray.locatorAttribute = 'data-drawer-tray', _DrawerTray.allowedProps = allowedProps, _DrawerTray.defaultProps = {
|
|
218
218
|
shouldContainFocus: true,
|
|
219
219
|
shouldCloseOnEscape: true,
|
|
220
220
|
shouldCloseOnDocumentClick: true,
|
|
@@ -223,6 +223,6 @@ let DrawerTray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
223
223
|
shadow: true,
|
|
224
224
|
border: true,
|
|
225
225
|
placement: 'start'
|
|
226
|
-
}, _DrawerTray)) || _class) || _class)
|
|
226
|
+
}, _DrawerTray)) || _class) || _class);
|
|
227
227
|
export default DrawerTray;
|
|
228
228
|
export { DrawerTray };
|
|
@@ -22,36 +22,5 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
import { element } from '@instructure/ui-prop-types';
|
|
27
|
-
import { textDirectionContextConsumer } from '@instructure/ui-i18n';
|
|
28
|
-
const propTypes = {
|
|
29
|
-
label: PropTypes.string.isRequired,
|
|
30
|
-
children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
31
|
-
render: PropTypes.func,
|
|
32
|
-
placement: PropTypes.oneOf(['start', 'end']),
|
|
33
|
-
open: PropTypes.bool,
|
|
34
|
-
onOpen: PropTypes.func,
|
|
35
|
-
onClose: PropTypes.func,
|
|
36
|
-
border: PropTypes.bool,
|
|
37
|
-
shadow: PropTypes.bool,
|
|
38
|
-
onTransition: PropTypes.func,
|
|
39
|
-
onEnter: PropTypes.func,
|
|
40
|
-
onEntering: PropTypes.func,
|
|
41
|
-
onEntered: PropTypes.func,
|
|
42
|
-
onExit: PropTypes.func,
|
|
43
|
-
onExiting: PropTypes.func,
|
|
44
|
-
onExited: PropTypes.func,
|
|
45
|
-
contentRef: PropTypes.func,
|
|
46
|
-
mountNode: PropTypes.oneOfType([element, PropTypes.func]),
|
|
47
|
-
defaultFocusElement: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
|
|
48
|
-
liveRegion: PropTypes.oneOfType([element, PropTypes.arrayOf(element), PropTypes.func]),
|
|
49
|
-
onDismiss: PropTypes.func,
|
|
50
|
-
shouldContainFocus: PropTypes.bool,
|
|
51
|
-
shouldReturnFocus: PropTypes.bool,
|
|
52
|
-
shouldCloseOnDocumentClick: PropTypes.bool,
|
|
53
|
-
shouldCloseOnEscape: PropTypes.bool,
|
|
54
|
-
dir: PropTypes.oneOf(Object.values(textDirectionContextConsumer.DIRECTION))
|
|
55
|
-
};
|
|
56
25
|
const allowedProps = ['label', 'children', 'render', 'placement', 'open', 'onOpen', 'onClose', 'border', 'shadow', 'onTransition', 'onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited', 'contentRef', 'mountNode', 'defaultFocusElement', 'liveRegion', 'onDismiss', 'shouldContainFocus', 'shouldReturnFocus', 'shouldCloseOnDocumentClick', 'shouldCloseOnEscape', 'dir'];
|
|
57
|
-
export { allowedProps
|
|
26
|
+
export { allowedProps };
|
|
@@ -24,7 +24,6 @@ var _DrawerLayout$Content;
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
import { Component } from 'react';
|
|
27
|
-
import PropTypes from 'prop-types';
|
|
28
27
|
import { DrawerLayout } from '../index';
|
|
29
28
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
30
29
|
export default class DrawerLayoutFixture extends Component {
|
|
@@ -65,13 +64,6 @@ export default class DrawerLayoutFixture extends Component {
|
|
|
65
64
|
}
|
|
66
65
|
}
|
|
67
66
|
DrawerLayoutFixture.displayName = "DrawerLayoutFixture";
|
|
68
|
-
DrawerLayoutFixture.propTypes = {
|
|
69
|
-
layoutWidth: PropTypes.string,
|
|
70
|
-
trayWidth: PropTypes.string,
|
|
71
|
-
placement: PropTypes.string,
|
|
72
|
-
open: PropTypes.bool,
|
|
73
|
-
onOverlayTrayChange: PropTypes.func
|
|
74
|
-
};
|
|
75
67
|
DrawerLayoutFixture.defaultProps = {
|
|
76
68
|
layoutWidth: '600px',
|
|
77
69
|
trayWidth: '200px',
|
package/es/DrawerLayout/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _dec, _dec2, _dec3,
|
|
1
|
+
var _dec, _dec2, _dec3, _class, _DrawerLayout;
|
|
2
2
|
/*
|
|
3
3
|
* The MIT License (MIT)
|
|
4
4
|
*
|
|
@@ -29,20 +29,19 @@ import { matchComponentTypes, safeCloneElement, withDeterministicId } from '@ins
|
|
|
29
29
|
import { getBoundingClientRect } from '@instructure/ui-dom-utils';
|
|
30
30
|
import { createChainedFunction, px } from '@instructure/ui-utils';
|
|
31
31
|
import { logError as error } from '@instructure/console';
|
|
32
|
-
import { testable } from '@instructure/ui-testable';
|
|
33
32
|
import { mirrorHorizontalPlacement } from '@instructure/ui-position';
|
|
34
33
|
import { DrawerContent } from './DrawerContent';
|
|
35
34
|
import { DrawerTray } from './DrawerTray';
|
|
36
35
|
import { withStyle } from '@instructure/emotion';
|
|
37
36
|
import generateStyle from './styles';
|
|
38
|
-
import {
|
|
37
|
+
import { allowedProps } from './props';
|
|
39
38
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
40
39
|
/**
|
|
41
40
|
---
|
|
42
41
|
category: components
|
|
43
42
|
---
|
|
44
43
|
**/
|
|
45
|
-
let DrawerLayout = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, null), _dec3 = textDirectionContextConsumer(),
|
|
44
|
+
let DrawerLayout = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, null), _dec3 = textDirectionContextConsumer(), _dec(_class = _dec2(_class = _dec3(_class = (_DrawerLayout = class DrawerLayout extends Component {
|
|
46
45
|
constructor(_props) {
|
|
47
46
|
super(_props);
|
|
48
47
|
this._id = void 0;
|
|
@@ -212,13 +211,14 @@ let DrawerLayout = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyl
|
|
|
212
211
|
...props,
|
|
213
212
|
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.drawerLayout,
|
|
214
213
|
ref: this.handleRef,
|
|
214
|
+
"data-cid": "DrawerLayout",
|
|
215
215
|
children: this.renderChildren()
|
|
216
216
|
})
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
|
-
}, _DrawerLayout.displayName = "DrawerLayout", _DrawerLayout.componentId = 'DrawerLayout', _DrawerLayout.locatorAttribute = 'data-drawer-layout', _DrawerLayout.
|
|
219
|
+
}, _DrawerLayout.displayName = "DrawerLayout", _DrawerLayout.componentId = 'DrawerLayout', _DrawerLayout.locatorAttribute = 'data-drawer-layout', _DrawerLayout.allowedProps = allowedProps, _DrawerLayout.defaultProps = {
|
|
220
220
|
minWidth: '30rem'
|
|
221
|
-
}, _DrawerLayout.Content = DrawerContent, _DrawerLayout.Tray = DrawerTray, _DrawerLayout)) || _class) || _class) || _class)
|
|
221
|
+
}, _DrawerLayout.Content = DrawerContent, _DrawerLayout.Tray = DrawerTray, _DrawerLayout)) || _class) || _class) || _class);
|
|
222
222
|
export default DrawerLayout;
|
|
223
223
|
export { DrawerLayout, DrawerContent, DrawerTray };
|
|
224
224
|
export const DrawerLayoutContext = /*#__PURE__*/createContext(false);
|
package/es/DrawerLayout/props.js
CHANGED
|
@@ -22,16 +22,5 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types';
|
|
26
|
-
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types';
|
|
27
|
-
import { textDirectionContextConsumer } from '@instructure/ui-i18n';
|
|
28
|
-
import { DrawerContent } from './DrawerContent';
|
|
29
|
-
import { DrawerTray } from './DrawerTray';
|
|
30
|
-
const propTypes = {
|
|
31
|
-
children: ChildrenPropTypes.oneOfEach([DrawerContent, DrawerTray]),
|
|
32
|
-
minWidth: PropTypes.string,
|
|
33
|
-
onOverlayTrayChange: PropTypes.func,
|
|
34
|
-
dir: PropTypes.oneOf(Object.values(textDirectionContextConsumer.DIRECTION))
|
|
35
|
-
};
|
|
36
25
|
const allowedProps = ['children', 'minWidth', 'onOverlayTrayChange', 'dir'];
|
|
37
|
-
export {
|
|
26
|
+
export { allowedProps };
|
|
@@ -9,13 +9,12 @@ var _react = require("react");
|
|
|
9
9
|
var _debounce = require("@instructure/debounce");
|
|
10
10
|
var _getBoundingClientRect = require("@instructure/ui-dom-utils/lib/getBoundingClientRect.js");
|
|
11
11
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
12
|
-
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
13
12
|
var _emotion = require("@instructure/emotion");
|
|
14
13
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
15
14
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
16
15
|
var _props = require("./props");
|
|
17
16
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
18
|
-
var _dec,
|
|
17
|
+
var _dec, _class, _DrawerContent;
|
|
19
18
|
/*
|
|
20
19
|
* The MIT License (MIT)
|
|
21
20
|
*
|
|
@@ -45,7 +44,7 @@ parent: DrawerLayout
|
|
|
45
44
|
id: DrawerLayout.Content
|
|
46
45
|
---
|
|
47
46
|
**/
|
|
48
|
-
let DrawerContent = exports.DrawerContent = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
47
|
+
let DrawerContent = exports.DrawerContent = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_DrawerContent = class DrawerContent extends _react.Component {
|
|
49
48
|
constructor(...args) {
|
|
50
49
|
super(...args);
|
|
51
50
|
this.ref = null;
|
|
@@ -121,10 +120,11 @@ let DrawerContent = exports.DrawerContent = (_dec = (0, _emotion.withStyle)(_sty
|
|
|
121
120
|
ref: this.handleContentRef,
|
|
122
121
|
"aria-label": label,
|
|
123
122
|
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.drawerContent,
|
|
123
|
+
"data-cid": "DrawerContent",
|
|
124
124
|
children: this.props.children
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
|
-
}, _DrawerContent.displayName = "DrawerContent", _DrawerContent.componentId = 'DrawerLayout.Content', _DrawerContent.locatorAttribute = 'data-drawer-content', _DrawerContent.
|
|
127
|
+
}, _DrawerContent.displayName = "DrawerContent", _DrawerContent.componentId = 'DrawerLayout.Content', _DrawerContent.locatorAttribute = 'data-drawer-content', _DrawerContent.allowedProps = _props.allowedProps, _DrawerContent.defaultProps = {
|
|
128
128
|
role: 'region'
|
|
129
|
-
}, _DrawerContent)) || _class)
|
|
129
|
+
}, _DrawerContent)) || _class);
|
|
130
130
|
var _default = exports.default = DrawerContent;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
6
|
+
exports.allowedProps = void 0;
|
|
9
7
|
/*
|
|
10
8
|
* The MIT License (MIT)
|
|
11
9
|
*
|
|
@@ -30,11 +28,4 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
30
28
|
* SOFTWARE.
|
|
31
29
|
*/
|
|
32
30
|
|
|
33
|
-
const propTypes = exports.propTypes = {
|
|
34
|
-
label: _propTypes.default.string.isRequired,
|
|
35
|
-
children: _propTypes.default.node,
|
|
36
|
-
contentRef: _propTypes.default.func,
|
|
37
|
-
onSizeChange: _propTypes.default.func,
|
|
38
|
-
role: _propTypes.default.string
|
|
39
|
-
};
|
|
40
31
|
const allowedProps = exports.allowedProps = ['label', 'children', 'contentRef', 'onSizeChange', 'role'];
|
|
@@ -12,7 +12,6 @@ var _textDirectionContextConsumer = require("@instructure/ui-i18n/lib/textDirect
|
|
|
12
12
|
var _Transition = require("@instructure/ui-motion/lib/Transition");
|
|
13
13
|
var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
|
|
14
14
|
var _createChainedFunction = require("@instructure/ui-utils/lib/createChainedFunction.js");
|
|
15
|
-
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
16
15
|
var _Dialog = require("@instructure/ui-dialog/lib/Dialog");
|
|
17
16
|
var _Portal = require("@instructure/ui-portal/lib/Portal");
|
|
18
17
|
var _mirrorHorizontalPlacement = require("@instructure/ui-position/lib/mirrorHorizontalPlacement.js");
|
|
@@ -22,7 +21,7 @@ var _index = require("../index");
|
|
|
22
21
|
var _props = require("./props");
|
|
23
22
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
24
23
|
const _excluded = ["label", "children", "render", "placement", "open", "onOpen", "onClose", "border", "shadow", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "contentRef", "mountNode", "defaultFocusElement", "liveRegion", "onDismiss", "onTransition", "shouldReturnFocus", "shouldCloseOnEscape", "shouldCloseOnDocumentClick", "shouldContainFocus", "styles"];
|
|
25
|
-
var _dec, _dec2,
|
|
24
|
+
var _dec, _dec2, _class, _DrawerTray;
|
|
26
25
|
/*
|
|
27
26
|
* The MIT License (MIT)
|
|
28
27
|
*
|
|
@@ -52,7 +51,7 @@ parent: DrawerLayout
|
|
|
52
51
|
id: DrawerLayout.Tray
|
|
53
52
|
---
|
|
54
53
|
**/
|
|
55
|
-
let DrawerTray = exports.DrawerTray = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _textDirectionContextConsumer.textDirectionContextConsumer)(),
|
|
54
|
+
let DrawerTray = exports.DrawerTray = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _textDirectionContextConsumer.textDirectionContextConsumer)(), _dec(_class = _dec2(_class = (_DrawerTray = class DrawerTray extends _react.Component {
|
|
56
55
|
get _content() {
|
|
57
56
|
return this.ref;
|
|
58
57
|
}
|
|
@@ -190,6 +189,7 @@ let DrawerTray = exports.DrawerTray = (_dec = (0, _emotion.withStyle)(_styles.de
|
|
|
190
189
|
...(0, _omitProps.omitProps)(props, DrawerTray.allowedProps),
|
|
191
190
|
ref: this.handleContentRef,
|
|
192
191
|
css: trayStyles,
|
|
192
|
+
"data-cid": "DrawerTray",
|
|
193
193
|
children: (0, _jsxRuntime.jsx)(_Dialog.Dialog, {
|
|
194
194
|
open: true,
|
|
195
195
|
role: shouldOverlayTray ? 'dialog' : 'region',
|
|
@@ -220,7 +220,7 @@ let DrawerTray = exports.DrawerTray = (_dec = (0, _emotion.withStyle)(_styles.de
|
|
|
220
220
|
}
|
|
221
221
|
});
|
|
222
222
|
}
|
|
223
|
-
}, _DrawerTray.displayName = "DrawerTray", _DrawerTray.componentId = 'DrawerLayout.Tray', _DrawerTray.locatorAttribute = 'data-drawer-tray', _DrawerTray.
|
|
223
|
+
}, _DrawerTray.displayName = "DrawerTray", _DrawerTray.componentId = 'DrawerLayout.Tray', _DrawerTray.locatorAttribute = 'data-drawer-tray', _DrawerTray.allowedProps = _props.allowedProps, _DrawerTray.defaultProps = {
|
|
224
224
|
shouldContainFocus: true,
|
|
225
225
|
shouldCloseOnEscape: true,
|
|
226
226
|
shouldCloseOnDocumentClick: true,
|
|
@@ -229,5 +229,5 @@ let DrawerTray = exports.DrawerTray = (_dec = (0, _emotion.withStyle)(_styles.de
|
|
|
229
229
|
shadow: true,
|
|
230
230
|
border: true,
|
|
231
231
|
placement: 'start'
|
|
232
|
-
}, _DrawerTray)) || _class) || _class)
|
|
232
|
+
}, _DrawerTray)) || _class) || _class);
|
|
233
233
|
var _default = exports.default = DrawerTray;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _element = require("@instructure/ui-prop-types/lib/element.js");
|
|
10
|
-
var _textDirectionContextConsumer = require("@instructure/ui-i18n/lib/textDirectionContextConsumer.js");
|
|
6
|
+
exports.allowedProps = void 0;
|
|
11
7
|
/*
|
|
12
8
|
* The MIT License (MIT)
|
|
13
9
|
*
|
|
@@ -32,32 +28,4 @@ var _textDirectionContextConsumer = require("@instructure/ui-i18n/lib/textDirect
|
|
|
32
28
|
* SOFTWARE.
|
|
33
29
|
*/
|
|
34
30
|
|
|
35
|
-
const propTypes = exports.propTypes = {
|
|
36
|
-
label: _propTypes.default.string.isRequired,
|
|
37
|
-
children: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
38
|
-
render: _propTypes.default.func,
|
|
39
|
-
placement: _propTypes.default.oneOf(['start', 'end']),
|
|
40
|
-
open: _propTypes.default.bool,
|
|
41
|
-
onOpen: _propTypes.default.func,
|
|
42
|
-
onClose: _propTypes.default.func,
|
|
43
|
-
border: _propTypes.default.bool,
|
|
44
|
-
shadow: _propTypes.default.bool,
|
|
45
|
-
onTransition: _propTypes.default.func,
|
|
46
|
-
onEnter: _propTypes.default.func,
|
|
47
|
-
onEntering: _propTypes.default.func,
|
|
48
|
-
onEntered: _propTypes.default.func,
|
|
49
|
-
onExit: _propTypes.default.func,
|
|
50
|
-
onExiting: _propTypes.default.func,
|
|
51
|
-
onExited: _propTypes.default.func,
|
|
52
|
-
contentRef: _propTypes.default.func,
|
|
53
|
-
mountNode: _propTypes.default.oneOfType([_element.element, _propTypes.default.func]),
|
|
54
|
-
defaultFocusElement: _propTypes.default.oneOfType([_propTypes.default.element, _propTypes.default.func]),
|
|
55
|
-
liveRegion: _propTypes.default.oneOfType([_element.element, _propTypes.default.arrayOf(_element.element), _propTypes.default.func]),
|
|
56
|
-
onDismiss: _propTypes.default.func,
|
|
57
|
-
shouldContainFocus: _propTypes.default.bool,
|
|
58
|
-
shouldReturnFocus: _propTypes.default.bool,
|
|
59
|
-
shouldCloseOnDocumentClick: _propTypes.default.bool,
|
|
60
|
-
shouldCloseOnEscape: _propTypes.default.bool,
|
|
61
|
-
dir: _propTypes.default.oneOf(Object.values(_textDirectionContextConsumer.textDirectionContextConsumer.DIRECTION))
|
|
62
|
-
};
|
|
63
31
|
const allowedProps = exports.allowedProps = ['label', 'children', 'render', 'placement', 'open', 'onOpen', 'onClose', 'border', 'shadow', 'onTransition', 'onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited', 'contentRef', 'mountNode', 'defaultFocusElement', 'liveRegion', 'onDismiss', 'shouldContainFocus', 'shouldReturnFocus', 'shouldCloseOnDocumentClick', 'shouldCloseOnEscape', 'dir'];
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
8
|
var _index = require("../index");
|
|
11
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
12
10
|
var _DrawerLayout$Content;
|
|
@@ -72,13 +70,6 @@ class DrawerLayoutFixture extends _react.Component {
|
|
|
72
70
|
}
|
|
73
71
|
exports.default = DrawerLayoutFixture;
|
|
74
72
|
DrawerLayoutFixture.displayName = "DrawerLayoutFixture";
|
|
75
|
-
DrawerLayoutFixture.propTypes = {
|
|
76
|
-
layoutWidth: _propTypes.default.string,
|
|
77
|
-
trayWidth: _propTypes.default.string,
|
|
78
|
-
placement: _propTypes.default.string,
|
|
79
|
-
open: _propTypes.default.bool,
|
|
80
|
-
onOverlayTrayChange: _propTypes.default.func
|
|
81
|
-
};
|
|
82
73
|
DrawerLayoutFixture.defaultProps = {
|
|
83
74
|
layoutWidth: '600px',
|
|
84
75
|
trayWidth: '200px',
|
|
@@ -27,7 +27,6 @@ var _getBoundingClientRect = require("@instructure/ui-dom-utils/lib/getBoundingC
|
|
|
27
27
|
var _createChainedFunction = require("@instructure/ui-utils/lib/createChainedFunction.js");
|
|
28
28
|
var _px = require("@instructure/ui-utils/lib/px.js");
|
|
29
29
|
var _console = require("@instructure/console");
|
|
30
|
-
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
31
30
|
var _mirrorHorizontalPlacement = require("@instructure/ui-position/lib/mirrorHorizontalPlacement.js");
|
|
32
31
|
var _DrawerContent = require("./DrawerContent");
|
|
33
32
|
var _DrawerTray = require("./DrawerTray");
|
|
@@ -35,7 +34,7 @@ var _emotion = require("@instructure/emotion");
|
|
|
35
34
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
36
35
|
var _props2 = require("./props");
|
|
37
36
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
38
|
-
var _dec, _dec2, _dec3,
|
|
37
|
+
var _dec, _dec2, _dec3, _class, _DrawerLayout;
|
|
39
38
|
/*
|
|
40
39
|
* The MIT License (MIT)
|
|
41
40
|
*
|
|
@@ -64,7 +63,7 @@ var _dec, _dec2, _dec3, _dec4, _class, _DrawerLayout;
|
|
|
64
63
|
category: components
|
|
65
64
|
---
|
|
66
65
|
**/
|
|
67
|
-
let DrawerLayout = exports.DrawerLayout = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, null), _dec3 = (0, _textDirectionContextConsumer.textDirectionContextConsumer)(),
|
|
66
|
+
let DrawerLayout = exports.DrawerLayout = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, null), _dec3 = (0, _textDirectionContextConsumer.textDirectionContextConsumer)(), _dec(_class = _dec2(_class = _dec3(_class = (_DrawerLayout = class DrawerLayout extends _react.Component {
|
|
68
67
|
constructor(_props) {
|
|
69
68
|
super(_props);
|
|
70
69
|
this._id = void 0;
|
|
@@ -234,12 +233,13 @@ let DrawerLayout = exports.DrawerLayout = (_dec = (0, _withDeterministicId.withD
|
|
|
234
233
|
...props,
|
|
235
234
|
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.drawerLayout,
|
|
236
235
|
ref: this.handleRef,
|
|
236
|
+
"data-cid": "DrawerLayout",
|
|
237
237
|
children: this.renderChildren()
|
|
238
238
|
})
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
|
-
}, _DrawerLayout.displayName = "DrawerLayout", _DrawerLayout.componentId = 'DrawerLayout', _DrawerLayout.locatorAttribute = 'data-drawer-layout', _DrawerLayout.
|
|
241
|
+
}, _DrawerLayout.displayName = "DrawerLayout", _DrawerLayout.componentId = 'DrawerLayout', _DrawerLayout.locatorAttribute = 'data-drawer-layout', _DrawerLayout.allowedProps = _props2.allowedProps, _DrawerLayout.defaultProps = {
|
|
242
242
|
minWidth: '30rem'
|
|
243
|
-
}, _DrawerLayout.Content = _DrawerContent.DrawerContent, _DrawerLayout.Tray = _DrawerTray.DrawerTray, _DrawerLayout)) || _class) || _class) || _class)
|
|
243
|
+
}, _DrawerLayout.Content = _DrawerContent.DrawerContent, _DrawerLayout.Tray = _DrawerTray.DrawerTray, _DrawerLayout)) || _class) || _class) || _class);
|
|
244
244
|
var _default = exports.default = DrawerLayout;
|
|
245
245
|
const DrawerLayoutContext = exports.DrawerLayoutContext = /*#__PURE__*/(0, _react.createContext)(false);
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _Children = require("@instructure/ui-prop-types/lib/Children.js");
|
|
10
|
-
var _textDirectionContextConsumer = require("@instructure/ui-i18n/lib/textDirectionContextConsumer.js");
|
|
11
|
-
var _DrawerContent = require("./DrawerContent");
|
|
12
|
-
var _DrawerTray = require("./DrawerTray");
|
|
6
|
+
exports.allowedProps = void 0;
|
|
13
7
|
/*
|
|
14
8
|
* The MIT License (MIT)
|
|
15
9
|
*
|
|
@@ -34,10 +28,4 @@ var _DrawerTray = require("./DrawerTray");
|
|
|
34
28
|
* SOFTWARE.
|
|
35
29
|
*/
|
|
36
30
|
|
|
37
|
-
const propTypes = exports.propTypes = {
|
|
38
|
-
children: _Children.Children.oneOfEach([_DrawerContent.DrawerContent, _DrawerTray.DrawerTray]),
|
|
39
|
-
minWidth: _propTypes.default.string,
|
|
40
|
-
onOverlayTrayChange: _propTypes.default.func,
|
|
41
|
-
dir: _propTypes.default.oneOf(Object.values(_textDirectionContextConsumer.textDirectionContextConsumer.DIRECTION))
|
|
42
|
-
};
|
|
43
31
|
const allowedProps = exports.allowedProps = ['children', 'minWidth', 'onOverlayTrayChange', 'dir'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-drawer-layout",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"description": "A main-content-plus-tray layout component",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -24,33 +24,30 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.27.6",
|
|
27
|
-
"@instructure/console": "
|
|
28
|
-
"@instructure/debounce": "
|
|
29
|
-
"@instructure/emotion": "
|
|
30
|
-
"@instructure/shared-types": "
|
|
31
|
-
"@instructure/ui-dialog": "
|
|
32
|
-
"@instructure/ui-dom-utils": "
|
|
33
|
-
"@instructure/ui-i18n": "
|
|
34
|
-
"@instructure/ui-motion": "
|
|
35
|
-
"@instructure/ui-portal": "
|
|
36
|
-
"@instructure/ui-position": "
|
|
37
|
-
"@instructure/ui-
|
|
38
|
-
"@instructure/ui-
|
|
39
|
-
"@instructure/ui-
|
|
40
|
-
"@instructure/
|
|
41
|
-
"@instructure/ui-view": "10.26.1",
|
|
42
|
-
"@instructure/uid": "10.26.1",
|
|
43
|
-
"prop-types": "^15.8.1"
|
|
27
|
+
"@instructure/console": "11.0.0",
|
|
28
|
+
"@instructure/debounce": "11.0.0",
|
|
29
|
+
"@instructure/emotion": "11.0.0",
|
|
30
|
+
"@instructure/shared-types": "11.0.0",
|
|
31
|
+
"@instructure/ui-dialog": "11.0.0",
|
|
32
|
+
"@instructure/ui-dom-utils": "11.0.0",
|
|
33
|
+
"@instructure/ui-i18n": "11.0.0",
|
|
34
|
+
"@instructure/ui-motion": "11.0.0",
|
|
35
|
+
"@instructure/ui-portal": "11.0.0",
|
|
36
|
+
"@instructure/ui-position": "11.0.0",
|
|
37
|
+
"@instructure/ui-react-utils": "11.0.0",
|
|
38
|
+
"@instructure/ui-utils": "11.0.0",
|
|
39
|
+
"@instructure/ui-view": "11.0.0",
|
|
40
|
+
"@instructure/uid": "11.0.0"
|
|
44
41
|
},
|
|
45
42
|
"devDependencies": {
|
|
46
|
-
"@instructure/ui-babel-preset": "
|
|
47
|
-
"@instructure/ui-themes": "
|
|
43
|
+
"@instructure/ui-babel-preset": "11.0.0",
|
|
44
|
+
"@instructure/ui-themes": "11.0.0",
|
|
48
45
|
"@testing-library/jest-dom": "^6.6.3",
|
|
49
|
-
"@testing-library/react": "
|
|
46
|
+
"@testing-library/react": "15.0.7",
|
|
50
47
|
"vitest": "^3.2.2"
|
|
51
48
|
},
|
|
52
49
|
"peerDependencies": {
|
|
53
|
-
"react": ">=
|
|
50
|
+
"react": ">=18 <=19"
|
|
54
51
|
},
|
|
55
52
|
"publishConfig": {
|
|
56
53
|
"access": "public"
|
|
@@ -28,13 +28,12 @@ import { debounce } from '@instructure/debounce'
|
|
|
28
28
|
import type { Debounced } from '@instructure/debounce'
|
|
29
29
|
import { getBoundingClientRect } from '@instructure/ui-dom-utils'
|
|
30
30
|
import { omitProps } from '@instructure/ui-react-utils'
|
|
31
|
-
import { testable } from '@instructure/ui-testable'
|
|
32
31
|
import { withStyle } from '@instructure/emotion'
|
|
33
32
|
|
|
34
33
|
import generateStyle from './styles'
|
|
35
34
|
import generateComponentTheme from './theme'
|
|
36
35
|
|
|
37
|
-
import {
|
|
36
|
+
import { allowedProps } from './props'
|
|
38
37
|
import type {
|
|
39
38
|
DrawerLayoutContentProps,
|
|
40
39
|
DrawerLayoutContentStyleProps
|
|
@@ -47,12 +46,10 @@ id: DrawerLayout.Content
|
|
|
47
46
|
---
|
|
48
47
|
**/
|
|
49
48
|
@withStyle(generateStyle, generateComponentTheme)
|
|
50
|
-
@testable()
|
|
51
49
|
class DrawerContent extends Component<DrawerLayoutContentProps> {
|
|
52
50
|
static readonly componentId = 'DrawerLayout.Content'
|
|
53
51
|
|
|
54
52
|
static locatorAttribute = 'data-drawer-content'
|
|
55
|
-
static propTypes = propTypes
|
|
56
53
|
static allowedProps = allowedProps
|
|
57
54
|
static defaultProps = {
|
|
58
55
|
role: 'region'
|
|
@@ -139,6 +136,7 @@ class DrawerContent extends Component<DrawerLayoutContentProps> {
|
|
|
139
136
|
ref={this.handleContentRef}
|
|
140
137
|
aria-label={label}
|
|
141
138
|
css={this.props.styles?.drawerContent}
|
|
139
|
+
data-cid="DrawerContent"
|
|
142
140
|
>
|
|
143
141
|
{this.props.children}
|
|
144
142
|
</div>
|