@instructure/ui-navigation 8.56.0 → 9.0.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.
Files changed (70) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +2 -23
  3. package/es/index.js +1 -2
  4. package/lib/index.js +1 -14
  5. package/package.json +24 -24
  6. package/src/index.ts +0 -3
  7. package/tsconfig.build.tsbuildinfo +1 -1
  8. package/types/index.d.ts +0 -3
  9. package/types/index.d.ts.map +1 -1
  10. package/es/Navigation/NavigationItem/NavigationItemLocator.js +0 -33
  11. package/es/Navigation/NavigationItem/index.js +0 -106
  12. package/es/Navigation/NavigationItem/locator.js +0 -26
  13. package/es/Navigation/NavigationItem/props.js +0 -36
  14. package/es/Navigation/NavigationItem/styles.js +0 -93
  15. package/es/Navigation/NavigationItem/theme.js +0 -73
  16. package/es/Navigation/NavigationLocator.js +0 -37
  17. package/es/Navigation/index.js +0 -129
  18. package/es/Navigation/locator.js +0 -27
  19. package/es/Navigation/props.js +0 -42
  20. package/es/Navigation/styles.js +0 -77
  21. package/es/Navigation/theme.js +0 -61
  22. package/lib/Navigation/NavigationItem/NavigationItemLocator.js +0 -40
  23. package/lib/Navigation/NavigationItem/index.js +0 -112
  24. package/lib/Navigation/NavigationItem/locator.js +0 -37
  25. package/lib/Navigation/NavigationItem/props.js +0 -43
  26. package/lib/Navigation/NavigationItem/styles.js +0 -99
  27. package/lib/Navigation/NavigationItem/theme.js +0 -79
  28. package/lib/Navigation/NavigationLocator.js +0 -48
  29. package/lib/Navigation/index.js +0 -145
  30. package/lib/Navigation/locator.js +0 -43
  31. package/lib/Navigation/props.js +0 -49
  32. package/lib/Navigation/styles.js +0 -83
  33. package/lib/Navigation/theme.js +0 -67
  34. package/src/Navigation/NavigationItem/NavigationItemLocator.ts +0 -34
  35. package/src/Navigation/NavigationItem/index.tsx +0 -117
  36. package/src/Navigation/NavigationItem/locator.ts +0 -27
  37. package/src/Navigation/NavigationItem/props.ts +0 -102
  38. package/src/Navigation/NavigationItem/styles.ts +0 -103
  39. package/src/Navigation/NavigationItem/theme.ts +0 -82
  40. package/src/Navigation/NavigationLocator.ts +0 -40
  41. package/src/Navigation/README.md +0 -85
  42. package/src/Navigation/index.tsx +0 -168
  43. package/src/Navigation/locator.ts +0 -29
  44. package/src/Navigation/props.ts +0 -118
  45. package/src/Navigation/styles.ts +0 -83
  46. package/src/Navigation/theme.ts +0 -66
  47. package/types/Navigation/NavigationItem/NavigationItemLocator.d.ts +0 -576
  48. package/types/Navigation/NavigationItem/NavigationItemLocator.d.ts.map +0 -1
  49. package/types/Navigation/NavigationItem/index.d.ts +0 -47
  50. package/types/Navigation/NavigationItem/index.d.ts.map +0 -1
  51. package/types/Navigation/NavigationItem/locator.d.ts +0 -4
  52. package/types/Navigation/NavigationItem/locator.d.ts.map +0 -1
  53. package/types/Navigation/NavigationItem/props.d.ts +0 -46
  54. package/types/Navigation/NavigationItem/props.d.ts.map +0 -1
  55. package/types/Navigation/NavigationItem/styles.d.ts +0 -15
  56. package/types/Navigation/NavigationItem/styles.d.ts.map +0 -1
  57. package/types/Navigation/NavigationItem/theme.d.ts +0 -10
  58. package/types/Navigation/NavigationItem/theme.d.ts.map +0 -1
  59. package/types/Navigation/NavigationLocator.d.ts +0 -1983
  60. package/types/Navigation/NavigationLocator.d.ts.map +0 -1
  61. package/types/Navigation/index.d.ts +0 -58
  62. package/types/Navigation/index.d.ts.map +0 -1
  63. package/types/Navigation/locator.d.ts +0 -5
  64. package/types/Navigation/locator.d.ts.map +0 -1
  65. package/types/Navigation/props.d.ts +0 -49
  66. package/types/Navigation/props.d.ts.map +0 -1
  67. package/types/Navigation/styles.d.ts +0 -15
  68. package/types/Navigation/styles.d.ts.map +0 -1
  69. package/types/Navigation/theme.d.ts +0 -10
  70. package/types/Navigation/theme.d.ts.map +0 -1
@@ -1,83 +0,0 @@
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 { NavigationTheme } from '@instructure/shared-types'
26
- import type { NavigationProps, NavigationState, NavigationStyle } from './props'
27
-
28
- /**
29
- * ---
30
- * private: true
31
- * ---
32
- * Generates the style object from the theme and provided additional information
33
- * @param {Object} componentTheme The theme variable object.
34
- * @param {Object} props the props of the component, the style is applied to
35
- * @param {Object} state the state of the component, the style is applied to
36
- * @return {Object} The final style object, which will be used in the component
37
- */
38
- const generateStyle = (
39
- componentTheme: NavigationTheme,
40
- // @ts-expect-error no props used here
41
- props: NavigationProps,
42
- state: NavigationState
43
- ): NavigationStyle => {
44
- const { minimized } = state
45
-
46
- return {
47
- navigation: {
48
- label: 'navigation',
49
- color: componentTheme.fontColor,
50
- backgroundColor: componentTheme.backgroundColor,
51
- boxSizing: 'border-box',
52
- display: 'flex',
53
- flexDirection: 'column',
54
- width: componentTheme.width,
55
- height: '100%',
56
- overflowY: 'auto',
57
- ...(minimized ? { width: componentTheme.minimizedWidth } : {})
58
- },
59
- list: {
60
- label: 'navigation__list',
61
- padding: 0,
62
- margin: 0
63
- },
64
- content: {
65
- label: 'navigation__content',
66
- listStyleType: 'none',
67
- margin: '0',
68
- padding: '0',
69
- flex: '1 0 auto'
70
- },
71
- toggle: {
72
- transform: 'translate3d(0, 0, 0)',
73
- transition: `all ${componentTheme.toggleTransition}`,
74
- ...(minimized ? { transform: 'rotate3d(0, 1, 0, -180deg)' } : {})
75
- },
76
- toggleIcon: {
77
- fill: componentTheme.fill,
78
- margin: '0 auto'
79
- }
80
- }
81
- }
82
-
83
- export default generateStyle
@@ -1,66 +0,0 @@
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 { Theme, ThemeSpecificStyle } from '@instructure/ui-themes'
26
- import { NavigationTheme } from '@instructure/shared-types'
27
-
28
- /**
29
- * Generates the theme object for the component from the theme and provided additional information
30
- * @param {Object} theme The actual theme object.
31
- * @return {Object} The final theme object with the overrides and component variables
32
- */
33
- const generateComponentTheme = (theme: Theme): NavigationTheme => {
34
- const { colors, spacing, borders, transitions, key: themeName } = theme
35
-
36
- const themeSpecificStyle: ThemeSpecificStyle<NavigationTheme> = {
37
- canvas: {
38
- backgroundColor: theme['ic-brand-global-nav-bgd'],
39
- fontColor: theme['ic-brand-global-nav-menu-item__text-color'],
40
- fill: theme['ic-brand-global-nav-ic-icon-svg-fill']
41
- }
42
- }
43
-
44
- const componentVariables: NavigationTheme = {
45
- fontColor: colors?.textLightest,
46
- backgroundColor: colors?.backgroundBrandSecondary,
47
- width: '5.25rem',
48
- minimizedWidth: '3.375rem',
49
- fill: colors?.textLightest,
50
-
51
- focusOutlineInnerWidth: borders?.widthMedium,
52
- focusOutlineOuterWidth: borders?.widthSmall,
53
- focusOutlineInnerColor: colors?.borderBrand,
54
- focusOutlineOuterColor: colors?.borderLightest,
55
-
56
- marginBottom: spacing?.small,
57
- toggleTransition: transitions?.duration
58
- }
59
-
60
- return {
61
- ...componentVariables,
62
- ...themeSpecificStyle[themeName]
63
- }
64
- }
65
-
66
- export default generateComponentTheme