@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.
Files changed (139) hide show
  1. package/CHANGELOG.md +36 -295
  2. package/es/DrawerLayout/{DrawerContent → v1/DrawerContent}/index.js +1 -1
  3. package/es/DrawerLayout/{DrawerTray → v1/DrawerTray}/index.js +1 -1
  4. package/es/DrawerLayout/{index.js → v1/index.js} +1 -1
  5. package/es/DrawerLayout/v2/DrawerContent/index.js +124 -0
  6. package/es/DrawerLayout/v2/DrawerContent/props.js +26 -0
  7. package/es/DrawerLayout/v2/DrawerContent/styles.js +51 -0
  8. package/es/DrawerLayout/v2/DrawerTray/index.js +227 -0
  9. package/es/DrawerLayout/v2/DrawerTray/props.js +26 -0
  10. package/es/DrawerLayout/v2/DrawerTray/styles.js +94 -0
  11. package/es/DrawerLayout/v2/__fixtures__/DrawerLayout.fixture.js +73 -0
  12. package/es/DrawerLayout/v2/index.js +224 -0
  13. package/es/DrawerLayout/v2/props.js +26 -0
  14. package/es/DrawerLayout/v2/styles.js +44 -0
  15. package/es/{index.js → exports/a.js} +1 -1
  16. package/es/exports/b.js +24 -0
  17. package/lib/DrawerLayout/{DrawerContent → v1/DrawerContent}/index.js +1 -1
  18. package/lib/DrawerLayout/{DrawerTray → v1/DrawerTray}/index.js +1 -1
  19. package/lib/DrawerLayout/v1/index.js +245 -0
  20. package/lib/DrawerLayout/v2/DrawerContent/index.js +129 -0
  21. package/lib/DrawerLayout/v2/DrawerContent/props.js +31 -0
  22. package/lib/DrawerLayout/v2/DrawerContent/styles.js +57 -0
  23. package/lib/DrawerLayout/v2/DrawerTray/index.js +232 -0
  24. package/lib/DrawerLayout/v2/DrawerTray/props.js +31 -0
  25. package/lib/DrawerLayout/v2/DrawerTray/styles.js +100 -0
  26. package/lib/DrawerLayout/v2/__fixtures__/DrawerLayout.fixture.js +79 -0
  27. package/lib/DrawerLayout/{index.js → v2/index.js} +1 -1
  28. package/lib/DrawerLayout/v2/props.js +31 -0
  29. package/lib/DrawerLayout/v2/styles.js +50 -0
  30. package/lib/{index.js → exports/a.js} +4 -4
  31. package/lib/exports/b.js +24 -0
  32. package/package.json +47 -25
  33. package/src/DrawerLayout/{DrawerContent → v1/DrawerContent}/index.tsx +1 -1
  34. package/src/DrawerLayout/{DrawerTray → v1/DrawerTray}/index.tsx +1 -1
  35. package/src/DrawerLayout/v1/index.tsx +334 -0
  36. package/src/DrawerLayout/v2/DrawerContent/index.tsx +147 -0
  37. package/src/DrawerLayout/v2/DrawerContent/props.ts +73 -0
  38. package/src/DrawerLayout/v2/DrawerContent/styles.ts +68 -0
  39. package/src/DrawerLayout/v2/DrawerTray/index.tsx +288 -0
  40. package/src/DrawerLayout/v2/DrawerTray/props.ts +228 -0
  41. package/src/DrawerLayout/v2/DrawerTray/styles.ts +106 -0
  42. package/src/DrawerLayout/v2/README.md +231 -0
  43. package/src/DrawerLayout/v2/__fixtures__/DrawerLayout.fixture.tsx +75 -0
  44. package/src/DrawerLayout/{index.tsx → v2/index.tsx} +1 -1
  45. package/src/DrawerLayout/v2/props.ts +72 -0
  46. package/src/DrawerLayout/v2/styles.ts +47 -0
  47. package/src/{index.ts → exports/a.ts} +4 -4
  48. package/src/exports/b.ts +29 -0
  49. package/tsconfig.build.tsbuildinfo +1 -1
  50. package/types/DrawerLayout/v1/DrawerContent/index.d.ts.map +1 -0
  51. package/types/DrawerLayout/v1/DrawerContent/props.d.ts.map +1 -0
  52. package/types/DrawerLayout/v1/DrawerContent/styles.d.ts.map +1 -0
  53. package/types/DrawerLayout/v1/DrawerContent/theme.d.ts.map +1 -0
  54. package/types/DrawerLayout/v1/DrawerTray/index.d.ts.map +1 -0
  55. package/types/DrawerLayout/v1/DrawerTray/props.d.ts.map +1 -0
  56. package/types/DrawerLayout/v1/DrawerTray/styles.d.ts.map +1 -0
  57. package/types/DrawerLayout/v1/DrawerTray/theme.d.ts.map +1 -0
  58. package/types/DrawerLayout/v1/__fixtures__/DrawerLayout.fixture.d.ts.map +1 -0
  59. package/types/DrawerLayout/v1/index.d.ts.map +1 -0
  60. package/types/DrawerLayout/v1/props.d.ts.map +1 -0
  61. package/types/DrawerLayout/v1/styles.d.ts.map +1 -0
  62. package/types/DrawerLayout/v2/DrawerContent/index.d.ts +35 -0
  63. package/types/DrawerLayout/v2/DrawerContent/index.d.ts.map +1 -0
  64. package/types/DrawerLayout/v2/DrawerContent/props.d.ts +28 -0
  65. package/types/DrawerLayout/v2/DrawerContent/props.d.ts.map +1 -0
  66. package/types/DrawerLayout/v2/DrawerContent/styles.d.ts +16 -0
  67. package/types/DrawerLayout/v2/DrawerContent/styles.d.ts.map +1 -0
  68. package/types/DrawerLayout/v2/DrawerTray/index.d.ts +61 -0
  69. package/types/DrawerLayout/v2/DrawerTray/index.d.ts.map +1 -0
  70. package/types/DrawerLayout/v2/DrawerTray/props.d.ts +120 -0
  71. package/types/DrawerLayout/v2/DrawerTray/props.d.ts.map +1 -0
  72. package/types/DrawerLayout/v2/DrawerTray/styles.d.ts +16 -0
  73. package/types/DrawerLayout/v2/DrawerTray/styles.d.ts.map +1 -0
  74. package/types/DrawerLayout/v2/__fixtures__/DrawerLayout.fixture.d.ts +22 -0
  75. package/types/DrawerLayout/v2/__fixtures__/DrawerLayout.fixture.d.ts.map +1 -0
  76. package/types/DrawerLayout/v2/index.d.ts +146 -0
  77. package/types/DrawerLayout/v2/index.d.ts.map +1 -0
  78. package/types/DrawerLayout/v2/props.d.ts +33 -0
  79. package/types/DrawerLayout/v2/props.d.ts.map +1 -0
  80. package/types/DrawerLayout/v2/styles.d.ts +14 -0
  81. package/types/DrawerLayout/v2/styles.d.ts.map +1 -0
  82. package/types/exports/a.d.ts +5 -0
  83. package/types/exports/a.d.ts.map +1 -0
  84. package/types/exports/b.d.ts +5 -0
  85. package/types/exports/b.d.ts.map +1 -0
  86. package/types/DrawerLayout/DrawerContent/index.d.ts.map +0 -1
  87. package/types/DrawerLayout/DrawerContent/props.d.ts.map +0 -1
  88. package/types/DrawerLayout/DrawerContent/styles.d.ts.map +0 -1
  89. package/types/DrawerLayout/DrawerContent/theme.d.ts.map +0 -1
  90. package/types/DrawerLayout/DrawerTray/index.d.ts.map +0 -1
  91. package/types/DrawerLayout/DrawerTray/props.d.ts.map +0 -1
  92. package/types/DrawerLayout/DrawerTray/styles.d.ts.map +0 -1
  93. package/types/DrawerLayout/DrawerTray/theme.d.ts.map +0 -1
  94. package/types/DrawerLayout/__fixtures__/DrawerLayout.fixture.d.ts.map +0 -1
  95. package/types/DrawerLayout/index.d.ts.map +0 -1
  96. package/types/DrawerLayout/props.d.ts.map +0 -1
  97. package/types/DrawerLayout/styles.d.ts.map +0 -1
  98. package/types/index.d.ts +0 -5
  99. package/types/index.d.ts.map +0 -1
  100. /package/es/DrawerLayout/{DrawerContent → v1/DrawerContent}/props.js +0 -0
  101. /package/es/DrawerLayout/{DrawerContent → v1/DrawerContent}/styles.js +0 -0
  102. /package/es/DrawerLayout/{DrawerContent → v1/DrawerContent}/theme.js +0 -0
  103. /package/es/DrawerLayout/{DrawerTray → v1/DrawerTray}/props.js +0 -0
  104. /package/es/DrawerLayout/{DrawerTray → v1/DrawerTray}/styles.js +0 -0
  105. /package/es/DrawerLayout/{DrawerTray → v1/DrawerTray}/theme.js +0 -0
  106. /package/es/DrawerLayout/{__fixtures__ → v1/__fixtures__}/DrawerLayout.fixture.js +0 -0
  107. /package/es/DrawerLayout/{props.js → v1/props.js} +0 -0
  108. /package/es/DrawerLayout/{styles.js → v1/styles.js} +0 -0
  109. /package/lib/DrawerLayout/{DrawerContent → v1/DrawerContent}/props.js +0 -0
  110. /package/lib/DrawerLayout/{DrawerContent → v1/DrawerContent}/styles.js +0 -0
  111. /package/lib/DrawerLayout/{DrawerContent → v1/DrawerContent}/theme.js +0 -0
  112. /package/lib/DrawerLayout/{DrawerTray → v1/DrawerTray}/props.js +0 -0
  113. /package/lib/DrawerLayout/{DrawerTray → v1/DrawerTray}/styles.js +0 -0
  114. /package/lib/DrawerLayout/{DrawerTray → v1/DrawerTray}/theme.js +0 -0
  115. /package/lib/DrawerLayout/{__fixtures__ → v1/__fixtures__}/DrawerLayout.fixture.js +0 -0
  116. /package/lib/DrawerLayout/{props.js → v1/props.js} +0 -0
  117. /package/lib/DrawerLayout/{styles.js → v1/styles.js} +0 -0
  118. /package/src/DrawerLayout/{DrawerContent → v1/DrawerContent}/props.ts +0 -0
  119. /package/src/DrawerLayout/{DrawerContent → v1/DrawerContent}/styles.ts +0 -0
  120. /package/src/DrawerLayout/{DrawerContent → v1/DrawerContent}/theme.ts +0 -0
  121. /package/src/DrawerLayout/{DrawerTray → v1/DrawerTray}/props.ts +0 -0
  122. /package/src/DrawerLayout/{DrawerTray → v1/DrawerTray}/styles.ts +0 -0
  123. /package/src/DrawerLayout/{DrawerTray → v1/DrawerTray}/theme.ts +0 -0
  124. /package/src/DrawerLayout/{README.md → v1/README.md} +0 -0
  125. /package/src/DrawerLayout/{__fixtures__ → v1/__fixtures__}/DrawerLayout.fixture.tsx +0 -0
  126. /package/src/DrawerLayout/{props.ts → v1/props.ts} +0 -0
  127. /package/src/DrawerLayout/{styles.ts → v1/styles.ts} +0 -0
  128. /package/types/DrawerLayout/{DrawerContent → v1/DrawerContent}/index.d.ts +0 -0
  129. /package/types/DrawerLayout/{DrawerContent → v1/DrawerContent}/props.d.ts +0 -0
  130. /package/types/DrawerLayout/{DrawerContent → v1/DrawerContent}/styles.d.ts +0 -0
  131. /package/types/DrawerLayout/{DrawerContent → v1/DrawerContent}/theme.d.ts +0 -0
  132. /package/types/DrawerLayout/{DrawerTray → v1/DrawerTray}/index.d.ts +0 -0
  133. /package/types/DrawerLayout/{DrawerTray → v1/DrawerTray}/props.d.ts +0 -0
  134. /package/types/DrawerLayout/{DrawerTray → v1/DrawerTray}/styles.d.ts +0 -0
  135. /package/types/DrawerLayout/{DrawerTray → v1/DrawerTray}/theme.d.ts +0 -0
  136. /package/types/DrawerLayout/{__fixtures__ → v1/__fixtures__}/DrawerLayout.fixture.d.ts +0 -0
  137. /package/types/DrawerLayout/{index.d.ts → v1/index.d.ts} +0 -0
  138. /package/types/DrawerLayout/{props.d.ts → v1/props.d.ts} +0 -0
  139. /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 './DrawerLayout'
25
+ export { DrawerLayout, DrawerContent, DrawerTray } from '../DrawerLayout/v1'
26
26
 
27
- export type { DrawerLayoutProps } from './DrawerLayout/props'
28
- export type { DrawerLayoutContentProps } from './DrawerLayout/DrawerContent/props'
29
- export type { DrawerLayoutTrayProps } from './DrawerLayout/DrawerTray/props'
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'
@@ -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'