@instructure/ui-side-nav-bar 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 (95) hide show
  1. package/CHANGELOG.md +34 -290
  2. package/es/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/index.js +2 -2
  3. package/es/SideNavBar/{index.js → v1/index.js} +1 -1
  4. package/es/SideNavBar/v2/SideNavBarItem/index.js +109 -0
  5. package/{src/index.ts → es/SideNavBar/v2/SideNavBarItem/props.js} +2 -4
  6. package/es/SideNavBar/v2/SideNavBarItem/styles.js +101 -0
  7. package/es/SideNavBar/v2/index.js +135 -0
  8. package/es/SideNavBar/v2/props.js +26 -0
  9. package/es/SideNavBar/v2/styles.js +95 -0
  10. package/es/{index.js → exports/a.js} +1 -1
  11. package/es/exports/b.js +24 -0
  12. package/lib/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/index.js +3 -3
  13. package/lib/SideNavBar/{index.js → v1/index.js} +2 -2
  14. package/lib/SideNavBar/v2/SideNavBarItem/index.js +115 -0
  15. package/lib/SideNavBar/v2/SideNavBarItem/props.js +31 -0
  16. package/lib/SideNavBar/v2/SideNavBarItem/styles.js +107 -0
  17. package/lib/SideNavBar/v2/index.js +149 -0
  18. package/lib/SideNavBar/v2/props.js +31 -0
  19. package/lib/SideNavBar/v2/styles.js +100 -0
  20. package/lib/{index.js → exports/a.js} +3 -3
  21. package/lib/exports/b.js +18 -0
  22. package/package.json +43 -21
  23. package/src/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/index.tsx +2 -2
  24. package/src/SideNavBar/{index.tsx → v1/index.tsx} +1 -1
  25. package/src/SideNavBar/v2/README.md +108 -0
  26. package/src/SideNavBar/v2/SideNavBarItem/index.tsx +112 -0
  27. package/src/SideNavBar/v2/SideNavBarItem/props.ts +89 -0
  28. package/src/SideNavBar/v2/SideNavBarItem/styles.ts +111 -0
  29. package/src/SideNavBar/v2/index.tsx +162 -0
  30. package/src/SideNavBar/v2/props.ts +94 -0
  31. package/src/SideNavBar/v2/styles.ts +105 -0
  32. package/src/exports/a.ts +28 -0
  33. package/src/exports/b.ts +28 -0
  34. package/tsconfig.build.tsbuildinfo +1 -1
  35. package/types/SideNavBar/v1/SideNavBarItem/index.d.ts.map +1 -0
  36. package/types/SideNavBar/v1/SideNavBarItem/props.d.ts.map +1 -0
  37. package/types/SideNavBar/v1/SideNavBarItem/styles.d.ts.map +1 -0
  38. package/types/SideNavBar/v1/SideNavBarItem/theme.d.ts.map +1 -0
  39. package/types/SideNavBar/v1/index.d.ts.map +1 -0
  40. package/types/SideNavBar/v1/props.d.ts.map +1 -0
  41. package/types/SideNavBar/v1/styles.d.ts.map +1 -0
  42. package/types/SideNavBar/v1/theme.d.ts.map +1 -0
  43. package/types/SideNavBar/v2/SideNavBarItem/index.d.ts +35 -0
  44. package/types/SideNavBar/v2/SideNavBarItem/index.d.ts.map +1 -0
  45. package/types/SideNavBar/v2/SideNavBarItem/props.d.ts +45 -0
  46. package/types/SideNavBar/v2/SideNavBarItem/props.d.ts.map +1 -0
  47. package/types/SideNavBar/v2/SideNavBarItem/styles.d.ts +16 -0
  48. package/types/SideNavBar/v2/SideNavBarItem/styles.d.ts.map +1 -0
  49. package/types/SideNavBar/v2/index.d.ts +44 -0
  50. package/types/SideNavBar/v2/index.d.ts.map +1 -0
  51. package/types/SideNavBar/v2/props.d.ts +48 -0
  52. package/types/SideNavBar/v2/props.d.ts.map +1 -0
  53. package/types/SideNavBar/v2/styles.d.ts +16 -0
  54. package/types/SideNavBar/v2/styles.d.ts.map +1 -0
  55. package/types/exports/a.d.ts +4 -0
  56. package/types/exports/a.d.ts.map +1 -0
  57. package/types/exports/b.d.ts +4 -0
  58. package/types/exports/b.d.ts.map +1 -0
  59. package/types/SideNavBar/SideNavBarItem/index.d.ts.map +0 -1
  60. package/types/SideNavBar/SideNavBarItem/props.d.ts.map +0 -1
  61. package/types/SideNavBar/SideNavBarItem/styles.d.ts.map +0 -1
  62. package/types/SideNavBar/SideNavBarItem/theme.d.ts.map +0 -1
  63. package/types/SideNavBar/index.d.ts.map +0 -1
  64. package/types/SideNavBar/props.d.ts.map +0 -1
  65. package/types/SideNavBar/styles.d.ts.map +0 -1
  66. package/types/SideNavBar/theme.d.ts.map +0 -1
  67. package/types/index.d.ts +0 -4
  68. package/types/index.d.ts.map +0 -1
  69. /package/es/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/props.js +0 -0
  70. /package/es/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/styles.js +0 -0
  71. /package/es/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/theme.js +0 -0
  72. /package/es/SideNavBar/{props.js → v1/props.js} +0 -0
  73. /package/es/SideNavBar/{styles.js → v1/styles.js} +0 -0
  74. /package/es/SideNavBar/{theme.js → v1/theme.js} +0 -0
  75. /package/lib/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/props.js +0 -0
  76. /package/lib/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/styles.js +0 -0
  77. /package/lib/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/theme.js +0 -0
  78. /package/lib/SideNavBar/{props.js → v1/props.js} +0 -0
  79. /package/lib/SideNavBar/{styles.js → v1/styles.js} +0 -0
  80. /package/lib/SideNavBar/{theme.js → v1/theme.js} +0 -0
  81. /package/src/SideNavBar/{README.md → v1/README.md} +0 -0
  82. /package/src/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/props.ts +0 -0
  83. /package/src/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/styles.ts +0 -0
  84. /package/src/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/theme.ts +0 -0
  85. /package/src/SideNavBar/{props.ts → v1/props.ts} +0 -0
  86. /package/src/SideNavBar/{styles.ts → v1/styles.ts} +0 -0
  87. /package/src/SideNavBar/{theme.ts → v1/theme.ts} +0 -0
  88. /package/types/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/index.d.ts +0 -0
  89. /package/types/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/props.d.ts +0 -0
  90. /package/types/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/styles.d.ts +0 -0
  91. /package/types/SideNavBar/{SideNavBarItem → v1/SideNavBarItem}/theme.d.ts +0 -0
  92. /package/types/SideNavBar/{index.d.ts → v1/index.d.ts} +0 -0
  93. /package/types/SideNavBar/{props.d.ts → v1/props.d.ts} +0 -0
  94. /package/types/SideNavBar/{styles.d.ts → v1/styles.d.ts} +0 -0
  95. /package/types/SideNavBar/{theme.d.ts → v1/theme.d.ts} +0 -0
@@ -0,0 +1,105 @@
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 { SideNavBarProps, SideNavBarState, SideNavBarStyle } from './props'
26
+ import type { NewComponentTypes, SharedTokens } from '@instructure/ui-themes'
27
+ import { boxShadowObjectsToCSSString } from '@instructure/ui-themes'
28
+
29
+ /**
30
+ * ---
31
+ * private: true
32
+ * ---
33
+ * Generates the style object from the theme and provided additional information
34
+ * @param {Object} componentTheme The theme variable object.
35
+ * @param {Object} props the props of the component, the style is applied to
36
+ * @param {Object} sharedTokens Shared theme token object
37
+ * @param {Object} state the state of the component, the style is applied to
38
+ * @return {Object} The final style object, which will be used in the component
39
+ */
40
+ const generateStyle = (
41
+ componentTheme: NewComponentTypes['SideNavBar'],
42
+ _props: SideNavBarProps,
43
+ _sharedTokens: SharedTokens,
44
+ state: SideNavBarState
45
+ ): SideNavBarStyle => {
46
+ const { minimized } = state
47
+
48
+ const layoutVariants = {
49
+ minimized: {
50
+ width: componentTheme.minimizedWidth,
51
+ margin: componentTheme.minimizedMargin,
52
+ borderRadius: componentTheme.minimizedBorderRadius
53
+ },
54
+ expanded: {
55
+ width: componentTheme.width,
56
+ margin: componentTheme.margin,
57
+ borderRadius: componentTheme.borderRadius
58
+ }
59
+ }
60
+
61
+ return {
62
+ navigation: {
63
+ label: 'navigation',
64
+ color: componentTheme.fontColor,
65
+ backgroundColor: componentTheme.backgroundColor,
66
+ boxSizing: 'border-box',
67
+ display: 'flex',
68
+ flexDirection: 'column',
69
+ height: '100%',
70
+ overflowY: 'auto',
71
+ boxShadow: boxShadowObjectsToCSSString(componentTheme.boxShadow),
72
+ ...layoutVariants[minimized ? 'minimized' : 'expanded'],
73
+ // The layout toggle button needs the nav's border radius to visually match the container corners.
74
+ '& > [data-cid="SideNavBarItem"]': {
75
+ borderRadius: minimized
76
+ ? componentTheme.minimizedBorderRadius
77
+ : componentTheme.borderRadius
78
+ }
79
+ },
80
+ list: {
81
+ label: 'navigation__list',
82
+ padding: 0,
83
+ margin: 0
84
+ },
85
+ content: {
86
+ label: 'navigation__content',
87
+ listStyleType: 'none',
88
+ margin: componentTheme.contentMargin,
89
+ padding: 0,
90
+ display: 'flex',
91
+ flex: '1 0 auto',
92
+ flexDirection: 'column',
93
+ gap: componentTheme.contentGap
94
+ },
95
+ toggleIcon: {
96
+ fill: componentTheme.fill,
97
+ margin: '0 auto',
98
+ transform: 'translate3d(0, 0, 0)',
99
+ transition: `all ${componentTheme.toggleTransition}`,
100
+ ...(minimized ? { transform: 'rotate3d(0, 1, 0, -180deg)' } : {})
101
+ }
102
+ }
103
+ }
104
+
105
+ export default generateStyle
@@ -0,0 +1,28 @@
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 { SideNavBar, SideNavBarItem } from '../SideNavBar/v1'
26
+
27
+ export type { SideNavBarProps } from '../SideNavBar/v1/props'
28
+ export type { SideNavBarItemProps } from '../SideNavBar/v1/SideNavBarItem/props'
@@ -0,0 +1,28 @@
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 { SideNavBar, SideNavBarItem } from '../SideNavBar/v2'
26
+
27
+ export type { SideNavBarProps } from '../SideNavBar/v2/props'
28
+ export type { SideNavBarItemProps } from '../SideNavBar/v2/SideNavBarItem/props'