@instructure/ui-drawer-layout 11.6.0 → 11.6.1-snapshot-129
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 +36 -295
- package/es/DrawerLayout/{DrawerContent → v1/DrawerContent}/index.js +1 -1
- package/es/DrawerLayout/{DrawerTray → v1/DrawerTray}/index.js +1 -1
- package/es/DrawerLayout/{index.js → v1/index.js} +1 -1
- package/es/DrawerLayout/v2/DrawerContent/index.js +124 -0
- package/es/DrawerLayout/v2/DrawerContent/props.js +26 -0
- package/es/DrawerLayout/v2/DrawerContent/styles.js +51 -0
- package/es/DrawerLayout/v2/DrawerTray/index.js +227 -0
- package/es/DrawerLayout/v2/DrawerTray/props.js +26 -0
- package/es/DrawerLayout/v2/DrawerTray/styles.js +94 -0
- package/es/DrawerLayout/v2/__fixtures__/DrawerLayout.fixture.js +73 -0
- package/es/DrawerLayout/v2/index.js +224 -0
- package/es/DrawerLayout/v2/props.js +26 -0
- package/es/DrawerLayout/v2/styles.js +44 -0
- package/es/{index.js → exports/a.js} +1 -1
- package/es/exports/b.js +24 -0
- package/lib/DrawerLayout/{DrawerContent → v1/DrawerContent}/index.js +1 -1
- package/lib/DrawerLayout/{DrawerTray → v1/DrawerTray}/index.js +1 -1
- package/lib/DrawerLayout/v1/index.js +245 -0
- package/lib/DrawerLayout/v2/DrawerContent/index.js +129 -0
- package/lib/DrawerLayout/v2/DrawerContent/props.js +31 -0
- package/lib/DrawerLayout/v2/DrawerContent/styles.js +57 -0
- package/lib/DrawerLayout/v2/DrawerTray/index.js +232 -0
- package/lib/DrawerLayout/v2/DrawerTray/props.js +31 -0
- package/lib/DrawerLayout/v2/DrawerTray/styles.js +100 -0
- package/lib/DrawerLayout/v2/__fixtures__/DrawerLayout.fixture.js +79 -0
- package/lib/DrawerLayout/{index.js → v2/index.js} +1 -1
- package/lib/DrawerLayout/v2/props.js +31 -0
- package/lib/DrawerLayout/v2/styles.js +50 -0
- package/lib/{index.js → exports/a.js} +4 -4
- package/lib/exports/b.js +24 -0
- package/package.json +47 -25
- package/src/DrawerLayout/{DrawerContent → v1/DrawerContent}/index.tsx +1 -1
- package/src/DrawerLayout/{DrawerTray → v1/DrawerTray}/index.tsx +1 -1
- package/src/DrawerLayout/v1/index.tsx +334 -0
- package/src/DrawerLayout/v2/DrawerContent/index.tsx +147 -0
- package/src/DrawerLayout/v2/DrawerContent/props.ts +73 -0
- package/src/DrawerLayout/v2/DrawerContent/styles.ts +68 -0
- package/src/DrawerLayout/v2/DrawerTray/index.tsx +288 -0
- package/src/DrawerLayout/v2/DrawerTray/props.ts +228 -0
- package/src/DrawerLayout/v2/DrawerTray/styles.ts +106 -0
- package/src/DrawerLayout/v2/README.md +231 -0
- package/src/DrawerLayout/v2/__fixtures__/DrawerLayout.fixture.tsx +75 -0
- package/src/DrawerLayout/{index.tsx → v2/index.tsx} +1 -1
- package/src/DrawerLayout/v2/props.ts +72 -0
- package/src/DrawerLayout/v2/styles.ts +47 -0
- package/src/{index.ts → exports/a.ts} +4 -4
- package/src/exports/b.ts +29 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/DrawerLayout/v1/DrawerContent/index.d.ts.map +1 -0
- package/types/DrawerLayout/v1/DrawerContent/props.d.ts.map +1 -0
- package/types/DrawerLayout/v1/DrawerContent/styles.d.ts.map +1 -0
- package/types/DrawerLayout/v1/DrawerContent/theme.d.ts.map +1 -0
- package/types/DrawerLayout/v1/DrawerTray/index.d.ts.map +1 -0
- package/types/DrawerLayout/v1/DrawerTray/props.d.ts.map +1 -0
- package/types/DrawerLayout/v1/DrawerTray/styles.d.ts.map +1 -0
- package/types/DrawerLayout/v1/DrawerTray/theme.d.ts.map +1 -0
- package/types/DrawerLayout/v1/__fixtures__/DrawerLayout.fixture.d.ts.map +1 -0
- package/types/DrawerLayout/v1/index.d.ts.map +1 -0
- package/types/DrawerLayout/v1/props.d.ts.map +1 -0
- package/types/DrawerLayout/v1/styles.d.ts.map +1 -0
- package/types/DrawerLayout/v2/DrawerContent/index.d.ts +35 -0
- package/types/DrawerLayout/v2/DrawerContent/index.d.ts.map +1 -0
- package/types/DrawerLayout/v2/DrawerContent/props.d.ts +28 -0
- package/types/DrawerLayout/v2/DrawerContent/props.d.ts.map +1 -0
- package/types/DrawerLayout/v2/DrawerContent/styles.d.ts +16 -0
- package/types/DrawerLayout/v2/DrawerContent/styles.d.ts.map +1 -0
- package/types/DrawerLayout/v2/DrawerTray/index.d.ts +61 -0
- package/types/DrawerLayout/v2/DrawerTray/index.d.ts.map +1 -0
- package/types/DrawerLayout/v2/DrawerTray/props.d.ts +120 -0
- package/types/DrawerLayout/v2/DrawerTray/props.d.ts.map +1 -0
- package/types/DrawerLayout/v2/DrawerTray/styles.d.ts +16 -0
- package/types/DrawerLayout/v2/DrawerTray/styles.d.ts.map +1 -0
- package/types/DrawerLayout/v2/__fixtures__/DrawerLayout.fixture.d.ts +22 -0
- package/types/DrawerLayout/v2/__fixtures__/DrawerLayout.fixture.d.ts.map +1 -0
- package/types/DrawerLayout/v2/index.d.ts +146 -0
- package/types/DrawerLayout/v2/index.d.ts.map +1 -0
- package/types/DrawerLayout/v2/props.d.ts +33 -0
- package/types/DrawerLayout/v2/props.d.ts.map +1 -0
- package/types/DrawerLayout/v2/styles.d.ts +14 -0
- package/types/DrawerLayout/v2/styles.d.ts.map +1 -0
- package/types/exports/a.d.ts +5 -0
- package/types/exports/a.d.ts.map +1 -0
- package/types/exports/b.d.ts +5 -0
- package/types/exports/b.d.ts.map +1 -0
- package/types/DrawerLayout/DrawerContent/index.d.ts.map +0 -1
- package/types/DrawerLayout/DrawerContent/props.d.ts.map +0 -1
- package/types/DrawerLayout/DrawerContent/styles.d.ts.map +0 -1
- package/types/DrawerLayout/DrawerContent/theme.d.ts.map +0 -1
- package/types/DrawerLayout/DrawerTray/index.d.ts.map +0 -1
- package/types/DrawerLayout/DrawerTray/props.d.ts.map +0 -1
- package/types/DrawerLayout/DrawerTray/styles.d.ts.map +0 -1
- package/types/DrawerLayout/DrawerTray/theme.d.ts.map +0 -1
- package/types/DrawerLayout/__fixtures__/DrawerLayout.fixture.d.ts.map +0 -1
- package/types/DrawerLayout/index.d.ts.map +0 -1
- package/types/DrawerLayout/props.d.ts.map +0 -1
- package/types/DrawerLayout/styles.d.ts.map +0 -1
- package/types/index.d.ts +0 -5
- package/types/index.d.ts.map +0 -1
- /package/es/DrawerLayout/{DrawerContent → v1/DrawerContent}/props.js +0 -0
- /package/es/DrawerLayout/{DrawerContent → v1/DrawerContent}/styles.js +0 -0
- /package/es/DrawerLayout/{DrawerContent → v1/DrawerContent}/theme.js +0 -0
- /package/es/DrawerLayout/{DrawerTray → v1/DrawerTray}/props.js +0 -0
- /package/es/DrawerLayout/{DrawerTray → v1/DrawerTray}/styles.js +0 -0
- /package/es/DrawerLayout/{DrawerTray → v1/DrawerTray}/theme.js +0 -0
- /package/es/DrawerLayout/{__fixtures__ → v1/__fixtures__}/DrawerLayout.fixture.js +0 -0
- /package/es/DrawerLayout/{props.js → v1/props.js} +0 -0
- /package/es/DrawerLayout/{styles.js → v1/styles.js} +0 -0
- /package/lib/DrawerLayout/{DrawerContent → v1/DrawerContent}/props.js +0 -0
- /package/lib/DrawerLayout/{DrawerContent → v1/DrawerContent}/styles.js +0 -0
- /package/lib/DrawerLayout/{DrawerContent → v1/DrawerContent}/theme.js +0 -0
- /package/lib/DrawerLayout/{DrawerTray → v1/DrawerTray}/props.js +0 -0
- /package/lib/DrawerLayout/{DrawerTray → v1/DrawerTray}/styles.js +0 -0
- /package/lib/DrawerLayout/{DrawerTray → v1/DrawerTray}/theme.js +0 -0
- /package/lib/DrawerLayout/{__fixtures__ → v1/__fixtures__}/DrawerLayout.fixture.js +0 -0
- /package/lib/DrawerLayout/{props.js → v1/props.js} +0 -0
- /package/lib/DrawerLayout/{styles.js → v1/styles.js} +0 -0
- /package/src/DrawerLayout/{DrawerContent → v1/DrawerContent}/props.ts +0 -0
- /package/src/DrawerLayout/{DrawerContent → v1/DrawerContent}/styles.ts +0 -0
- /package/src/DrawerLayout/{DrawerContent → v1/DrawerContent}/theme.ts +0 -0
- /package/src/DrawerLayout/{DrawerTray → v1/DrawerTray}/props.ts +0 -0
- /package/src/DrawerLayout/{DrawerTray → v1/DrawerTray}/styles.ts +0 -0
- /package/src/DrawerLayout/{DrawerTray → v1/DrawerTray}/theme.ts +0 -0
- /package/src/DrawerLayout/{README.md → v1/README.md} +0 -0
- /package/src/DrawerLayout/{__fixtures__ → v1/__fixtures__}/DrawerLayout.fixture.tsx +0 -0
- /package/src/DrawerLayout/{props.ts → v1/props.ts} +0 -0
- /package/src/DrawerLayout/{styles.ts → v1/styles.ts} +0 -0
- /package/types/DrawerLayout/{DrawerContent → v1/DrawerContent}/index.d.ts +0 -0
- /package/types/DrawerLayout/{DrawerContent → v1/DrawerContent}/props.d.ts +0 -0
- /package/types/DrawerLayout/{DrawerContent → v1/DrawerContent}/styles.d.ts +0 -0
- /package/types/DrawerLayout/{DrawerContent → v1/DrawerContent}/theme.d.ts +0 -0
- /package/types/DrawerLayout/{DrawerTray → v1/DrawerTray}/index.d.ts +0 -0
- /package/types/DrawerLayout/{DrawerTray → v1/DrawerTray}/props.d.ts +0 -0
- /package/types/DrawerLayout/{DrawerTray → v1/DrawerTray}/styles.d.ts +0 -0
- /package/types/DrawerLayout/{DrawerTray → v1/DrawerTray}/theme.d.ts +0 -0
- /package/types/DrawerLayout/{__fixtures__ → v1/__fixtures__}/DrawerLayout.fixture.d.ts +0 -0
- /package/types/DrawerLayout/{index.d.ts → v1/index.d.ts} +0 -0
- /package/types/DrawerLayout/{props.d.ts → v1/props.d.ts} +0 -0
- /package/types/DrawerLayout/{styles.d.ts → v1/styles.d.ts} +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import React from 'react'
|
|
26
|
+
import type { TextDirectionContextConsumerProps } from '@instructure/ui-i18n'
|
|
27
|
+
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
|
|
28
|
+
import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
|
|
29
|
+
|
|
30
|
+
type DrawerLayoutOwnProps = {
|
|
31
|
+
/**
|
|
32
|
+
* Exactly one of each of the following child types: `DrawerLayout.Content`, `DrawerLayout.Tray`
|
|
33
|
+
*/
|
|
34
|
+
children?: React.ReactNode // TODO: oneOfEach([DrawerContent, DrawerTray])
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Min width for the `<DrawerLayout.Content />`
|
|
38
|
+
*/
|
|
39
|
+
minWidth?: string
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Function called when the `<DrawerLayout.Content />` is resized and hits the `minWidth` breakpoint
|
|
43
|
+
* Called with a boolean value, `true` if the tray is now overlaying the content or `false` if
|
|
44
|
+
* it is side by side
|
|
45
|
+
*/
|
|
46
|
+
onOverlayTrayChange?: (shouldOverlayTray: boolean) => void
|
|
47
|
+
} & TextDirectionContextConsumerProps
|
|
48
|
+
|
|
49
|
+
type PropKeys = keyof DrawerLayoutOwnProps
|
|
50
|
+
|
|
51
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
52
|
+
|
|
53
|
+
type DrawerLayoutProps = DrawerLayoutOwnProps &
|
|
54
|
+
WithStyleProps<null, DrawerLayoutStyle> &
|
|
55
|
+
WithDeterministicIdProps
|
|
56
|
+
|
|
57
|
+
type DrawerLayoutStyle = ComponentStyle<'drawerLayout'>
|
|
58
|
+
|
|
59
|
+
type DrawerLayoutState = {
|
|
60
|
+
shouldOverlayTray: boolean
|
|
61
|
+
trayWidth: number
|
|
62
|
+
contentWidth: number
|
|
63
|
+
}
|
|
64
|
+
const allowedProps: AllowedPropKeys = [
|
|
65
|
+
'children',
|
|
66
|
+
'minWidth',
|
|
67
|
+
'onOverlayTrayChange',
|
|
68
|
+
'dir'
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
export type { DrawerLayoutProps, DrawerLayoutState, DrawerLayoutStyle }
|
|
72
|
+
export { allowedProps }
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import type { DrawerLayoutStyle } from './props'
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* ---
|
|
29
|
+
* private: true
|
|
30
|
+
* ---
|
|
31
|
+
* Generates the style object from the theme and provided additional information
|
|
32
|
+
* @param {Object} componentTheme The theme variable object.
|
|
33
|
+
* @param {Object} props the props of the component, the style is applied to
|
|
34
|
+
* @param {Object} state the state of the component, the style is applied to
|
|
35
|
+
* @return {Object} The final style object, which will be used in the component
|
|
36
|
+
*/
|
|
37
|
+
const generateStyle = (): DrawerLayoutStyle => {
|
|
38
|
+
return {
|
|
39
|
+
drawerLayout: {
|
|
40
|
+
label: 'drawerLayout',
|
|
41
|
+
position: 'relative',
|
|
42
|
+
height: '100%'
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export default generateStyle
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
export { DrawerLayout, DrawerContent, DrawerTray } from '
|
|
25
|
+
export { DrawerLayout, DrawerContent, DrawerTray } from '../DrawerLayout/v1'
|
|
26
26
|
|
|
27
|
-
export type { DrawerLayoutProps } from '
|
|
28
|
-
export type { DrawerLayoutContentProps } from '
|
|
29
|
-
export type { DrawerLayoutTrayProps } from '
|
|
27
|
+
export type { DrawerLayoutProps } from '../DrawerLayout/v1/props'
|
|
28
|
+
export type { DrawerLayoutContentProps } from '../DrawerLayout/v1/DrawerContent/props'
|
|
29
|
+
export type { DrawerLayoutTrayProps } from '../DrawerLayout/v1/DrawerTray/props'
|
package/src/exports/b.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
export { DrawerLayout, DrawerContent, DrawerTray } from '../DrawerLayout/v2'
|
|
26
|
+
|
|
27
|
+
export type { DrawerLayoutProps } from '../DrawerLayout/v2/props'
|
|
28
|
+
export type { DrawerLayoutContentProps } from '../DrawerLayout/v2/DrawerContent/props'
|
|
29
|
+
export type { DrawerLayoutTrayProps } from '../DrawerLayout/v2/DrawerTray/props'
|