@instructure/ui-drawer-layout 10.26.1 → 11.0.1-snapshot-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 +30 -1
- 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
|
@@ -23,10 +23,8 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import { AriaRole } from 'react'
|
|
26
|
-
import PropTypes from 'prop-types'
|
|
27
26
|
|
|
28
27
|
import type {
|
|
29
|
-
PropValidators,
|
|
30
28
|
DrawerLayoutContentTheme,
|
|
31
29
|
OtherHTMLAttributes
|
|
32
30
|
} from '@instructure/shared-types'
|
|
@@ -58,15 +56,6 @@ type DrawerLayoutContentProps = DrawerLayoutContentOwnProps &
|
|
|
58
56
|
OtherHTMLAttributes<DrawerLayoutContentOwnProps>
|
|
59
57
|
|
|
60
58
|
type DrawerLayoutContentStyle = ComponentStyle<'drawerContent'>
|
|
61
|
-
|
|
62
|
-
const propTypes: PropValidators<PropKeys> = {
|
|
63
|
-
label: PropTypes.string.isRequired,
|
|
64
|
-
children: PropTypes.node,
|
|
65
|
-
contentRef: PropTypes.func,
|
|
66
|
-
onSizeChange: PropTypes.func,
|
|
67
|
-
role: PropTypes.string
|
|
68
|
-
}
|
|
69
|
-
|
|
70
59
|
const allowedProps: AllowedPropKeys = [
|
|
71
60
|
'label',
|
|
72
61
|
'children',
|
|
@@ -81,4 +70,4 @@ export type {
|
|
|
81
70
|
DrawerLayoutContentStyle,
|
|
82
71
|
DrawerContentSize
|
|
83
72
|
}
|
|
84
|
-
export {
|
|
73
|
+
export { allowedProps }
|
|
@@ -30,7 +30,6 @@ import { Transition } from '@instructure/ui-motion'
|
|
|
30
30
|
import type { TransitionType } from '@instructure/ui-motion'
|
|
31
31
|
import { omitProps } from '@instructure/ui-react-utils'
|
|
32
32
|
import { createChainedFunction } from '@instructure/ui-utils'
|
|
33
|
-
import { testable } from '@instructure/ui-testable'
|
|
34
33
|
import { Dialog } from '@instructure/ui-dialog'
|
|
35
34
|
import { Portal } from '@instructure/ui-portal'
|
|
36
35
|
import type { PortalNode } from '@instructure/ui-portal'
|
|
@@ -40,7 +39,7 @@ import generateStyle from './styles'
|
|
|
40
39
|
import generateComponentTheme from './theme'
|
|
41
40
|
import { DrawerLayoutContext } from '../index'
|
|
42
41
|
|
|
43
|
-
import {
|
|
42
|
+
import { allowedProps } from './props'
|
|
44
43
|
import type {
|
|
45
44
|
DrawerLayoutTrayProps,
|
|
46
45
|
DrawerLayoutTrayState,
|
|
@@ -56,7 +55,6 @@ id: DrawerLayout.Tray
|
|
|
56
55
|
**/
|
|
57
56
|
@withStyle(generateStyle, generateComponentTheme)
|
|
58
57
|
@textDirectionContextConsumer()
|
|
59
|
-
@testable()
|
|
60
58
|
class DrawerTray extends Component<
|
|
61
59
|
DrawerLayoutTrayProps,
|
|
62
60
|
DrawerLayoutTrayState
|
|
@@ -65,7 +63,6 @@ class DrawerTray extends Component<
|
|
|
65
63
|
|
|
66
64
|
static locatorAttribute = 'data-drawer-tray'
|
|
67
65
|
|
|
68
|
-
static propTypes = propTypes
|
|
69
66
|
static allowedProps = allowedProps
|
|
70
67
|
static defaultProps = {
|
|
71
68
|
shouldContainFocus: true,
|
|
@@ -246,6 +243,7 @@ class DrawerTray extends Component<
|
|
|
246
243
|
{...omitProps(props, DrawerTray.allowedProps)}
|
|
247
244
|
ref={this.handleContentRef}
|
|
248
245
|
css={trayStyles}
|
|
246
|
+
data-cid="DrawerTray"
|
|
249
247
|
>
|
|
250
248
|
<Dialog
|
|
251
249
|
open
|
|
@@ -23,11 +23,6 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import React from 'react'
|
|
26
|
-
import PropTypes from 'prop-types'
|
|
27
|
-
|
|
28
|
-
import { element } from '@instructure/ui-prop-types'
|
|
29
|
-
import { textDirectionContextConsumer } from '@instructure/ui-i18n'
|
|
30
|
-
|
|
31
26
|
import type { PositionMountNode } from '@instructure/ui-position'
|
|
32
27
|
import type { TextDirectionContextConsumerProps } from '@instructure/ui-i18n'
|
|
33
28
|
import type { ComponentStyle, WithStyleProps } from '@instructure/emotion'
|
|
@@ -35,7 +30,6 @@ import type {
|
|
|
35
30
|
DrawerLayoutTrayTheme,
|
|
36
31
|
LiveRegion,
|
|
37
32
|
OtherHTMLAttributes,
|
|
38
|
-
PropValidators,
|
|
39
33
|
UIElement
|
|
40
34
|
} from '@instructure/shared-types'
|
|
41
35
|
import {
|
|
@@ -186,40 +180,6 @@ type DrawerLayoutTrayProps = DrawerLayoutTrayOwnProps &
|
|
|
186
180
|
type DrawerLayoutTrayStyle = ComponentStyle<
|
|
187
181
|
'drawerTray' | 'drawerTrayWithShadow' | 'drawerTrayContent'
|
|
188
182
|
>
|
|
189
|
-
|
|
190
|
-
const propTypes: PropValidators<PropKeys> = {
|
|
191
|
-
label: PropTypes.string.isRequired,
|
|
192
|
-
children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
193
|
-
render: PropTypes.func,
|
|
194
|
-
placement: PropTypes.oneOf(['start', 'end']),
|
|
195
|
-
open: PropTypes.bool,
|
|
196
|
-
onOpen: PropTypes.func,
|
|
197
|
-
onClose: PropTypes.func,
|
|
198
|
-
border: PropTypes.bool,
|
|
199
|
-
shadow: PropTypes.bool,
|
|
200
|
-
onTransition: PropTypes.func,
|
|
201
|
-
onEnter: PropTypes.func,
|
|
202
|
-
onEntering: PropTypes.func,
|
|
203
|
-
onEntered: PropTypes.func,
|
|
204
|
-
onExit: PropTypes.func,
|
|
205
|
-
onExiting: PropTypes.func,
|
|
206
|
-
onExited: PropTypes.func,
|
|
207
|
-
contentRef: PropTypes.func,
|
|
208
|
-
mountNode: PropTypes.oneOfType([element, PropTypes.func]),
|
|
209
|
-
defaultFocusElement: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
|
|
210
|
-
liveRegion: PropTypes.oneOfType([
|
|
211
|
-
element,
|
|
212
|
-
PropTypes.arrayOf(element),
|
|
213
|
-
PropTypes.func
|
|
214
|
-
]),
|
|
215
|
-
onDismiss: PropTypes.func,
|
|
216
|
-
shouldContainFocus: PropTypes.bool,
|
|
217
|
-
shouldReturnFocus: PropTypes.bool,
|
|
218
|
-
shouldCloseOnDocumentClick: PropTypes.bool,
|
|
219
|
-
shouldCloseOnEscape: PropTypes.bool,
|
|
220
|
-
dir: PropTypes.oneOf(Object.values(textDirectionContextConsumer.DIRECTION))
|
|
221
|
-
}
|
|
222
|
-
|
|
223
183
|
const allowedProps: AllowedPropKeys = [
|
|
224
184
|
'label',
|
|
225
185
|
'children',
|
|
@@ -256,4 +216,4 @@ export type {
|
|
|
256
216
|
DrawerLayoutTrayStyleProps,
|
|
257
217
|
DrawerTrayPlacement
|
|
258
218
|
}
|
|
259
|
-
export { allowedProps
|
|
219
|
+
export { allowedProps }
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import { Component } from 'react'
|
|
26
|
-
import PropTypes from 'prop-types'
|
|
27
26
|
|
|
28
27
|
import { DrawerLayout } from '../index'
|
|
29
28
|
import type { DrawerLayoutProps } from '../props'
|
|
@@ -38,14 +37,6 @@ type DrawerLayoutFixtureProps = {
|
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
export default class DrawerLayoutFixture extends Component<DrawerLayoutFixtureProps> {
|
|
41
|
-
static propTypes = {
|
|
42
|
-
layoutWidth: PropTypes.string,
|
|
43
|
-
trayWidth: PropTypes.string,
|
|
44
|
-
placement: PropTypes.string,
|
|
45
|
-
open: PropTypes.bool,
|
|
46
|
-
onOverlayTrayChange: PropTypes.func
|
|
47
|
-
}
|
|
48
|
-
|
|
49
40
|
static defaultProps = {
|
|
50
41
|
layoutWidth: '600px',
|
|
51
42
|
trayWidth: '200px',
|
|
@@ -33,7 +33,6 @@ import {
|
|
|
33
33
|
import { getBoundingClientRect } from '@instructure/ui-dom-utils'
|
|
34
34
|
import { createChainedFunction, px } from '@instructure/ui-utils'
|
|
35
35
|
import { logError as error } from '@instructure/console'
|
|
36
|
-
import { testable } from '@instructure/ui-testable'
|
|
37
36
|
|
|
38
37
|
import { mirrorHorizontalPlacement } from '@instructure/ui-position'
|
|
39
38
|
import type { PlacementPropValues } from '@instructure/ui-position'
|
|
@@ -49,7 +48,7 @@ import type { DrawerLayoutTrayProps } from './DrawerTray/props'
|
|
|
49
48
|
import { withStyle } from '@instructure/emotion'
|
|
50
49
|
import generateStyle from './styles'
|
|
51
50
|
|
|
52
|
-
import {
|
|
51
|
+
import { allowedProps } from './props'
|
|
53
52
|
import type { DrawerLayoutProps, DrawerLayoutState } from './props'
|
|
54
53
|
|
|
55
54
|
type TrayChild = ComponentElement<
|
|
@@ -70,12 +69,10 @@ category: components
|
|
|
70
69
|
@withDeterministicId()
|
|
71
70
|
@withStyle(generateStyle, null)
|
|
72
71
|
@textDirectionContextConsumer()
|
|
73
|
-
@testable()
|
|
74
72
|
class DrawerLayout extends Component<DrawerLayoutProps, DrawerLayoutState> {
|
|
75
73
|
static readonly componentId = 'DrawerLayout'
|
|
76
74
|
|
|
77
75
|
static locatorAttribute = 'data-drawer-layout'
|
|
78
|
-
static propTypes = propTypes
|
|
79
76
|
static allowedProps = allowedProps
|
|
80
77
|
static defaultProps = {
|
|
81
78
|
minWidth: '30rem'
|
|
@@ -324,6 +321,7 @@ class DrawerLayout extends Component<DrawerLayoutProps, DrawerLayoutState> {
|
|
|
324
321
|
{...props}
|
|
325
322
|
css={this.props.styles?.drawerLayout}
|
|
326
323
|
ref={this.handleRef}
|
|
324
|
+
data-cid="DrawerLayout"
|
|
327
325
|
>
|
|
328
326
|
{this.renderChildren()}
|
|
329
327
|
</div>
|
|
@@ -23,17 +23,8 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import React from 'react'
|
|
26
|
-
import PropTypes from 'prop-types'
|
|
27
|
-
|
|
28
|
-
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types'
|
|
29
|
-
import { textDirectionContextConsumer } from '@instructure/ui-i18n'
|
|
30
|
-
|
|
31
|
-
import { DrawerContent } from './DrawerContent'
|
|
32
|
-
import { DrawerTray } from './DrawerTray'
|
|
33
|
-
|
|
34
26
|
import type { TextDirectionContextConsumerProps } from '@instructure/ui-i18n'
|
|
35
27
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
|
|
36
|
-
import type { PropValidators } from '@instructure/shared-types'
|
|
37
28
|
import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
|
|
38
29
|
|
|
39
30
|
type DrawerLayoutOwnProps = {
|
|
@@ -70,14 +61,6 @@ type DrawerLayoutState = {
|
|
|
70
61
|
trayWidth: number
|
|
71
62
|
contentWidth: number
|
|
72
63
|
}
|
|
73
|
-
|
|
74
|
-
const propTypes: PropValidators<PropKeys> = {
|
|
75
|
-
children: ChildrenPropTypes.oneOfEach([DrawerContent, DrawerTray]),
|
|
76
|
-
minWidth: PropTypes.string,
|
|
77
|
-
onOverlayTrayChange: PropTypes.func,
|
|
78
|
-
dir: PropTypes.oneOf(Object.values(textDirectionContextConsumer.DIRECTION))
|
|
79
|
-
}
|
|
80
|
-
|
|
81
64
|
const allowedProps: AllowedPropKeys = [
|
|
82
65
|
'children',
|
|
83
66
|
'minWidth',
|
|
@@ -86,4 +69,4 @@ const allowedProps: AllowedPropKeys = [
|
|
|
86
69
|
]
|
|
87
70
|
|
|
88
71
|
export type { DrawerLayoutProps, DrawerLayoutState, DrawerLayoutStyle }
|
|
89
|
-
export {
|
|
72
|
+
export { allowedProps }
|
package/tsconfig.build.json
CHANGED
|
@@ -17,9 +17,7 @@
|
|
|
17
17
|
{ "path": "../ui-motion/tsconfig.build.json" },
|
|
18
18
|
{ "path": "../ui-portal/tsconfig.build.json" },
|
|
19
19
|
{ "path": "../ui-position/tsconfig.build.json" },
|
|
20
|
-
{ "path": "../ui-prop-types/tsconfig.build.json" },
|
|
21
20
|
{ "path": "../ui-react-utils/tsconfig.build.json" },
|
|
22
|
-
{ "path": "../ui-testable/tsconfig.build.json" },
|
|
23
21
|
{ "path": "../ui-utils/tsconfig.build.json" },
|
|
24
22
|
{ "path": "../ui-view/tsconfig.build.json" },
|
|
25
23
|
{ "path": "../uid/tsconfig.build.json" },
|