@instructure/ui-drawer-layout 10.26.1-snapshot-2 → 10.26.1

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +2 -23
  2. package/es/DrawerLayout/DrawerContent/index.js +6 -6
  3. package/es/DrawerLayout/DrawerContent/props.js +9 -1
  4. package/es/DrawerLayout/DrawerTray/index.js +6 -6
  5. package/es/DrawerLayout/DrawerTray/props.js +32 -1
  6. package/es/DrawerLayout/__fixtures__/DrawerLayout.fixture.js +8 -0
  7. package/es/DrawerLayout/index.js +6 -6
  8. package/es/DrawerLayout/props.js +12 -1
  9. package/lib/DrawerLayout/DrawerContent/index.js +5 -5
  10. package/lib/DrawerLayout/DrawerContent/props.js +10 -1
  11. package/lib/DrawerLayout/DrawerTray/index.js +5 -5
  12. package/lib/DrawerLayout/DrawerTray/props.js +33 -1
  13. package/lib/DrawerLayout/__fixtures__/DrawerLayout.fixture.js +9 -0
  14. package/lib/DrawerLayout/index.js +5 -5
  15. package/lib/DrawerLayout/props.js +13 -1
  16. package/package.json +22 -19
  17. package/src/DrawerLayout/DrawerContent/index.tsx +4 -2
  18. package/src/DrawerLayout/DrawerContent/props.ts +12 -1
  19. package/src/DrawerLayout/DrawerTray/index.tsx +4 -2
  20. package/src/DrawerLayout/DrawerTray/props.ts +41 -1
  21. package/src/DrawerLayout/__fixtures__/DrawerLayout.fixture.tsx +9 -0
  22. package/src/DrawerLayout/index.tsx +4 -2
  23. package/src/DrawerLayout/props.ts +18 -1
  24. package/tsconfig.build.json +2 -0
  25. package/tsconfig.build.tsbuildinfo +1 -1
  26. package/types/DrawerLayout/DrawerContent/index.d.ts +7 -0
  27. package/types/DrawerLayout/DrawerContent/index.d.ts.map +1 -1
  28. package/types/DrawerLayout/DrawerContent/props.d.ts +3 -2
  29. package/types/DrawerLayout/DrawerContent/props.d.ts.map +1 -1
  30. package/types/DrawerLayout/DrawerTray/index.d.ts +17 -0
  31. package/types/DrawerLayout/DrawerTray/index.d.ts.map +1 -1
  32. package/types/DrawerLayout/DrawerTray/props.d.ts +3 -2
  33. package/types/DrawerLayout/DrawerTray/props.d.ts.map +1 -1
  34. package/types/DrawerLayout/__fixtures__/DrawerLayout.fixture.d.ts +8 -0
  35. package/types/DrawerLayout/__fixtures__/DrawerLayout.fixture.d.ts.map +1 -1
  36. package/types/DrawerLayout/index.d.ts +1 -0
  37. package/types/DrawerLayout/index.d.ts.map +1 -1
  38. package/types/DrawerLayout/props.d.ts +3 -1
  39. package/types/DrawerLayout/props.d.ts.map +1 -1
package/CHANGELOG.md CHANGED
@@ -3,30 +3,9 @@
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
- ## [10.26.1-snapshot-2](https://github.com/instructure/instructure-ui/compare/v10.26.0...v10.26.1-snapshot-2) (2025-10-06)
6
+ ## [10.26.1](https://github.com/instructure/instructure-ui/compare/v10.26.0...v10.26.1) (2025-10-06)
7
7
 
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`
8
+ **Note:** Version bump only for package @instructure/ui-drawer-layout
30
9
 
31
10
 
32
11
 
@@ -1,4 +1,4 @@
1
- var _dec, _class, _DrawerContent;
1
+ var _dec, _dec2, _class, _DrawerContent;
2
2
  /*
3
3
  * The MIT License (MIT)
4
4
  *
@@ -27,10 +27,11 @@ 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';
30
31
  import { withStyle } from '@instructure/emotion';
31
32
  import generateStyle from './styles';
32
33
  import generateComponentTheme from './theme';
33
- import { allowedProps } from './props';
34
+ import { propTypes, allowedProps } from './props';
34
35
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
35
36
  /**
36
37
  ---
@@ -38,7 +39,7 @@ parent: DrawerLayout
38
39
  id: DrawerLayout.Content
39
40
  ---
40
41
  **/
41
- let DrawerContent = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_DrawerContent = class DrawerContent extends Component {
42
+ let DrawerContent = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_DrawerContent = class DrawerContent extends Component {
42
43
  constructor(...args) {
43
44
  super(...args);
44
45
  this.ref = null;
@@ -114,12 +115,11 @@ let DrawerContent = (_dec = withStyle(generateStyle, generateComponentTheme), _d
114
115
  ref: this.handleContentRef,
115
116
  "aria-label": label,
116
117
  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.allowedProps = allowedProps, _DrawerContent.defaultProps = {
121
+ }, _DrawerContent.displayName = "DrawerContent", _DrawerContent.componentId = 'DrawerLayout.Content', _DrawerContent.locatorAttribute = 'data-drawer-content', _DrawerContent.propTypes = propTypes, _DrawerContent.allowedProps = allowedProps, _DrawerContent.defaultProps = {
122
122
  role: 'region'
123
- }, _DrawerContent)) || _class);
123
+ }, _DrawerContent)) || _class) || _class);
124
124
  export default DrawerContent;
125
125
  export { DrawerContent };
@@ -22,5 +22,13 @@
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
+ };
25
33
  const allowedProps = ['label', 'children', 'contentRef', 'onSizeChange', 'role'];
26
- export { allowedProps };
34
+ export { propTypes, 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, _class, _DrawerTray;
3
+ var _dec, _dec2, _dec3, _class, _DrawerTray;
4
4
  /*
5
5
  * The MIT License (MIT)
6
6
  *
@@ -31,13 +31,14 @@ 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';
34
35
  import { Dialog } from '@instructure/ui-dialog';
35
36
  import { Portal } from '@instructure/ui-portal';
36
37
  import { mirrorHorizontalPlacement } from '@instructure/ui-position';
37
38
  import generateStyle from './styles';
38
39
  import generateComponentTheme from './theme';
39
40
  import { DrawerLayoutContext } from '../index';
40
- import { allowedProps } from './props';
41
+ import { propTypes, allowedProps } from './props';
41
42
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
42
43
  /**
43
44
  ---
@@ -45,7 +46,7 @@ parent: DrawerLayout
45
46
  id: DrawerLayout.Tray
46
47
  ---
47
48
  **/
48
- let DrawerTray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = textDirectionContextConsumer(), _dec(_class = _dec2(_class = (_DrawerTray = class DrawerTray extends Component {
49
+ let DrawerTray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = textDirectionContextConsumer(), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = (_DrawerTray = class DrawerTray extends Component {
49
50
  get _content() {
50
51
  return this.ref;
51
52
  }
@@ -183,7 +184,6 @@ let DrawerTray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
183
184
  ...omitProps(props, DrawerTray.allowedProps),
184
185
  ref: this.handleContentRef,
185
186
  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.allowedProps = allowedProps, _DrawerTray.defaultProps = {
217
+ }, _DrawerTray.displayName = "DrawerTray", _DrawerTray.componentId = 'DrawerLayout.Tray', _DrawerTray.locatorAttribute = 'data-drawer-tray', _DrawerTray.propTypes = propTypes, _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) || _class);
227
227
  export default DrawerTray;
228
228
  export { DrawerTray };
@@ -22,5 +22,36 @@
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
+ };
25
56
  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'];
26
- export { allowedProps };
57
+ export { allowedProps, propTypes };
@@ -24,6 +24,7 @@ var _DrawerLayout$Content;
24
24
  */
25
25
 
26
26
  import { Component } from 'react';
27
+ import PropTypes from 'prop-types';
27
28
  import { DrawerLayout } from '../index';
28
29
  import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
29
30
  export default class DrawerLayoutFixture extends Component {
@@ -64,6 +65,13 @@ export default class DrawerLayoutFixture extends Component {
64
65
  }
65
66
  }
66
67
  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
+ };
67
75
  DrawerLayoutFixture.defaultProps = {
68
76
  layoutWidth: '600px',
69
77
  trayWidth: '200px',
@@ -1,4 +1,4 @@
1
- var _dec, _dec2, _dec3, _class, _DrawerLayout;
1
+ var _dec, _dec2, _dec3, _dec4, _class, _DrawerLayout;
2
2
  /*
3
3
  * The MIT License (MIT)
4
4
  *
@@ -29,19 +29,20 @@ 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';
32
33
  import { mirrorHorizontalPlacement } from '@instructure/ui-position';
33
34
  import { DrawerContent } from './DrawerContent';
34
35
  import { DrawerTray } from './DrawerTray';
35
36
  import { withStyle } from '@instructure/emotion';
36
37
  import generateStyle from './styles';
37
- import { allowedProps } from './props';
38
+ import { propTypes, allowedProps } from './props';
38
39
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
39
40
  /**
40
41
  ---
41
42
  category: components
42
43
  ---
43
44
  **/
44
- let DrawerLayout = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, null), _dec3 = textDirectionContextConsumer(), _dec(_class = _dec2(_class = _dec3(_class = (_DrawerLayout = class DrawerLayout extends Component {
45
+ let DrawerLayout = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, null), _dec3 = textDirectionContextConsumer(), _dec4 = testable(), _dec(_class = _dec2(_class = _dec3(_class = _dec4(_class = (_DrawerLayout = class DrawerLayout extends Component {
45
46
  constructor(_props) {
46
47
  super(_props);
47
48
  this._id = void 0;
@@ -211,14 +212,13 @@ let DrawerLayout = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyl
211
212
  ...props,
212
213
  css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.drawerLayout,
213
214
  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.allowedProps = allowedProps, _DrawerLayout.defaultProps = {
219
+ }, _DrawerLayout.displayName = "DrawerLayout", _DrawerLayout.componentId = 'DrawerLayout', _DrawerLayout.locatorAttribute = 'data-drawer-layout', _DrawerLayout.propTypes = propTypes, _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) || _class);
222
222
  export default DrawerLayout;
223
223
  export { DrawerLayout, DrawerContent, DrawerTray };
224
224
  export const DrawerLayoutContext = /*#__PURE__*/createContext(false);
@@ -22,5 +22,16 @@
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
+ };
25
36
  const allowedProps = ['children', 'minWidth', 'onOverlayTrayChange', 'dir'];
26
- export { allowedProps };
37
+ export { propTypes, allowedProps };
@@ -9,12 +9,13 @@ 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");
12
13
  var _emotion = require("@instructure/emotion");
13
14
  var _styles = _interopRequireDefault(require("./styles"));
14
15
  var _theme = _interopRequireDefault(require("./theme"));
15
16
  var _props = require("./props");
16
17
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
17
- var _dec, _class, _DrawerContent;
18
+ var _dec, _dec2, _class, _DrawerContent;
18
19
  /*
19
20
  * The MIT License (MIT)
20
21
  *
@@ -44,7 +45,7 @@ parent: DrawerLayout
44
45
  id: DrawerLayout.Content
45
46
  ---
46
47
  **/
47
- let DrawerContent = exports.DrawerContent = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_DrawerContent = class DrawerContent extends _react.Component {
48
+ let DrawerContent = exports.DrawerContent = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_DrawerContent = class DrawerContent extends _react.Component {
48
49
  constructor(...args) {
49
50
  super(...args);
50
51
  this.ref = null;
@@ -120,11 +121,10 @@ let DrawerContent = exports.DrawerContent = (_dec = (0, _emotion.withStyle)(_sty
120
121
  ref: this.handleContentRef,
121
122
  "aria-label": label,
122
123
  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.allowedProps = _props.allowedProps, _DrawerContent.defaultProps = {
127
+ }, _DrawerContent.displayName = "DrawerContent", _DrawerContent.componentId = 'DrawerLayout.Content', _DrawerContent.locatorAttribute = 'data-drawer-content', _DrawerContent.propTypes = _props.propTypes, _DrawerContent.allowedProps = _props.allowedProps, _DrawerContent.defaultProps = {
128
128
  role: 'region'
129
- }, _DrawerContent)) || _class);
129
+ }, _DrawerContent)) || _class) || _class);
130
130
  var _default = exports.default = DrawerContent;
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
- exports.allowedProps = void 0;
7
+ exports.propTypes = exports.allowedProps = void 0;
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
7
9
  /*
8
10
  * The MIT License (MIT)
9
11
  *
@@ -28,4 +30,11 @@ exports.allowedProps = void 0;
28
30
  * SOFTWARE.
29
31
  */
30
32
 
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
+ };
31
40
  const allowedProps = exports.allowedProps = ['label', 'children', 'contentRef', 'onSizeChange', 'role'];
@@ -12,6 +12,7 @@ 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");
15
16
  var _Dialog = require("@instructure/ui-dialog/lib/Dialog");
16
17
  var _Portal = require("@instructure/ui-portal/lib/Portal");
17
18
  var _mirrorHorizontalPlacement = require("@instructure/ui-position/lib/mirrorHorizontalPlacement.js");
@@ -21,7 +22,7 @@ var _index = require("../index");
21
22
  var _props = require("./props");
22
23
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
23
24
  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"];
24
- var _dec, _dec2, _class, _DrawerTray;
25
+ var _dec, _dec2, _dec3, _class, _DrawerTray;
25
26
  /*
26
27
  * The MIT License (MIT)
27
28
  *
@@ -51,7 +52,7 @@ parent: DrawerLayout
51
52
  id: DrawerLayout.Tray
52
53
  ---
53
54
  **/
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 {
55
+ let DrawerTray = exports.DrawerTray = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _textDirectionContextConsumer.textDirectionContextConsumer)(), _dec3 = (0, _testable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = (_DrawerTray = class DrawerTray extends _react.Component {
55
56
  get _content() {
56
57
  return this.ref;
57
58
  }
@@ -189,7 +190,6 @@ let DrawerTray = exports.DrawerTray = (_dec = (0, _emotion.withStyle)(_styles.de
189
190
  ...(0, _omitProps.omitProps)(props, DrawerTray.allowedProps),
190
191
  ref: this.handleContentRef,
191
192
  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.allowedProps = _props.allowedProps, _DrawerTray.defaultProps = {
223
+ }, _DrawerTray.displayName = "DrawerTray", _DrawerTray.componentId = 'DrawerLayout.Tray', _DrawerTray.locatorAttribute = 'data-drawer-tray', _DrawerTray.propTypes = _props.propTypes, _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) || _class);
233
233
  var _default = exports.default = DrawerTray;
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
- exports.allowedProps = void 0;
7
+ exports.propTypes = exports.allowedProps = void 0;
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");
7
11
  /*
8
12
  * The MIT License (MIT)
9
13
  *
@@ -28,4 +32,32 @@ exports.allowedProps = void 0;
28
32
  * SOFTWARE.
29
33
  */
30
34
 
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
+ };
31
63
  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,10 +1,12 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.default = void 0;
7
8
  var _react = require("react");
9
+ var _propTypes = _interopRequireDefault(require("prop-types"));
8
10
  var _index = require("../index");
9
11
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
10
12
  var _DrawerLayout$Content;
@@ -70,6 +72,13 @@ class DrawerLayoutFixture extends _react.Component {
70
72
  }
71
73
  exports.default = DrawerLayoutFixture;
72
74
  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
+ };
73
82
  DrawerLayoutFixture.defaultProps = {
74
83
  layoutWidth: '600px',
75
84
  trayWidth: '200px',
@@ -27,6 +27,7 @@ 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");
30
31
  var _mirrorHorizontalPlacement = require("@instructure/ui-position/lib/mirrorHorizontalPlacement.js");
31
32
  var _DrawerContent = require("./DrawerContent");
32
33
  var _DrawerTray = require("./DrawerTray");
@@ -34,7 +35,7 @@ var _emotion = require("@instructure/emotion");
34
35
  var _styles = _interopRequireDefault(require("./styles"));
35
36
  var _props2 = require("./props");
36
37
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
37
- var _dec, _dec2, _dec3, _class, _DrawerLayout;
38
+ var _dec, _dec2, _dec3, _dec4, _class, _DrawerLayout;
38
39
  /*
39
40
  * The MIT License (MIT)
40
41
  *
@@ -63,7 +64,7 @@ var _dec, _dec2, _dec3, _class, _DrawerLayout;
63
64
  category: components
64
65
  ---
65
66
  **/
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 {
67
+ let DrawerLayout = exports.DrawerLayout = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, null), _dec3 = (0, _textDirectionContextConsumer.textDirectionContextConsumer)(), _dec4 = (0, _testable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = _dec4(_class = (_DrawerLayout = class DrawerLayout extends _react.Component {
67
68
  constructor(_props) {
68
69
  super(_props);
69
70
  this._id = void 0;
@@ -233,13 +234,12 @@ let DrawerLayout = exports.DrawerLayout = (_dec = (0, _withDeterministicId.withD
233
234
  ...props,
234
235
  css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.drawerLayout,
235
236
  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.allowedProps = _props2.allowedProps, _DrawerLayout.defaultProps = {
241
+ }, _DrawerLayout.displayName = "DrawerLayout", _DrawerLayout.componentId = 'DrawerLayout', _DrawerLayout.locatorAttribute = 'data-drawer-layout', _DrawerLayout.propTypes = _props2.propTypes, _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) || _class);
244
244
  var _default = exports.default = DrawerLayout;
245
245
  const DrawerLayoutContext = exports.DrawerLayoutContext = /*#__PURE__*/(0, _react.createContext)(false);
@@ -1,9 +1,15 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
- exports.allowedProps = void 0;
7
+ exports.propTypes = exports.allowedProps = void 0;
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");
7
13
  /*
8
14
  * The MIT License (MIT)
9
15
  *
@@ -28,4 +34,10 @@ exports.allowedProps = void 0;
28
34
  * SOFTWARE.
29
35
  */
30
36
 
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
+ };
31
43
  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": "10.26.1-snapshot-2",
3
+ "version": "10.26.1",
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,30 +24,33 @@
24
24
  "license": "MIT",
25
25
  "dependencies": {
26
26
  "@babel/runtime": "^7.27.6",
27
- "@instructure/console": "10.26.1-snapshot-2",
28
- "@instructure/debounce": "10.26.1-snapshot-2",
29
- "@instructure/emotion": "10.26.1-snapshot-2",
30
- "@instructure/shared-types": "10.26.1-snapshot-2",
31
- "@instructure/ui-dialog": "10.26.1-snapshot-2",
32
- "@instructure/ui-dom-utils": "10.26.1-snapshot-2",
33
- "@instructure/ui-i18n": "10.26.1-snapshot-2",
34
- "@instructure/ui-motion": "10.26.1-snapshot-2",
35
- "@instructure/ui-portal": "10.26.1-snapshot-2",
36
- "@instructure/ui-position": "10.26.1-snapshot-2",
37
- "@instructure/ui-react-utils": "10.26.1-snapshot-2",
38
- "@instructure/ui-utils": "10.26.1-snapshot-2",
39
- "@instructure/ui-view": "10.26.1-snapshot-2",
40
- "@instructure/uid": "10.26.1-snapshot-2"
27
+ "@instructure/console": "10.26.1",
28
+ "@instructure/debounce": "10.26.1",
29
+ "@instructure/emotion": "10.26.1",
30
+ "@instructure/shared-types": "10.26.1",
31
+ "@instructure/ui-dialog": "10.26.1",
32
+ "@instructure/ui-dom-utils": "10.26.1",
33
+ "@instructure/ui-i18n": "10.26.1",
34
+ "@instructure/ui-motion": "10.26.1",
35
+ "@instructure/ui-portal": "10.26.1",
36
+ "@instructure/ui-position": "10.26.1",
37
+ "@instructure/ui-prop-types": "10.26.1",
38
+ "@instructure/ui-react-utils": "10.26.1",
39
+ "@instructure/ui-testable": "10.26.1",
40
+ "@instructure/ui-utils": "10.26.1",
41
+ "@instructure/ui-view": "10.26.1",
42
+ "@instructure/uid": "10.26.1",
43
+ "prop-types": "^15.8.1"
41
44
  },
42
45
  "devDependencies": {
43
- "@instructure/ui-babel-preset": "10.26.1-snapshot-2",
44
- "@instructure/ui-themes": "10.26.1-snapshot-2",
46
+ "@instructure/ui-babel-preset": "10.26.1",
47
+ "@instructure/ui-themes": "10.26.1",
45
48
  "@testing-library/jest-dom": "^6.6.3",
46
- "@testing-library/react": "15.0.7",
49
+ "@testing-library/react": "^16.0.1",
47
50
  "vitest": "^3.2.2"
48
51
  },
49
52
  "peerDependencies": {
50
- "react": ">=18 <=19"
53
+ "react": ">=16.14 <=18"
51
54
  },
52
55
  "publishConfig": {
53
56
  "access": "public"
@@ -28,12 +28,13 @@ 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'
31
32
  import { withStyle } from '@instructure/emotion'
32
33
 
33
34
  import generateStyle from './styles'
34
35
  import generateComponentTheme from './theme'
35
36
 
36
- import { allowedProps } from './props'
37
+ import { propTypes, allowedProps } from './props'
37
38
  import type {
38
39
  DrawerLayoutContentProps,
39
40
  DrawerLayoutContentStyleProps
@@ -46,10 +47,12 @@ id: DrawerLayout.Content
46
47
  ---
47
48
  **/
48
49
  @withStyle(generateStyle, generateComponentTheme)
50
+ @testable()
49
51
  class DrawerContent extends Component<DrawerLayoutContentProps> {
50
52
  static readonly componentId = 'DrawerLayout.Content'
51
53
 
52
54
  static locatorAttribute = 'data-drawer-content'
55
+ static propTypes = propTypes
53
56
  static allowedProps = allowedProps
54
57
  static defaultProps = {
55
58
  role: 'region'
@@ -136,7 +139,6 @@ class DrawerContent extends Component<DrawerLayoutContentProps> {
136
139
  ref={this.handleContentRef}
137
140
  aria-label={label}
138
141
  css={this.props.styles?.drawerContent}
139
- data-cid="DrawerContent"
140
142
  >
141
143
  {this.props.children}
142
144
  </div>