@instructure/ui-themes 10.0.1-snapshot-14 → 10.2.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 (97) hide show
  1. package/CHANGELOG.md +16 -2
  2. package/README.md +4 -4
  3. package/es/index.js +5 -3
  4. package/es/sharedThemeTokens/borders.js +45 -0
  5. package/es/sharedThemeTokens/breakpoints.js +57 -0
  6. package/es/sharedThemeTokens/colors/dataVisualization.js +138 -0
  7. package/es/sharedThemeTokens/colors/primitives.js +172 -0
  8. package/es/sharedThemeTokens/forms.js +31 -0
  9. package/es/sharedThemeTokens/index.js +46 -0
  10. package/es/sharedThemeTokens/media.js +32 -0
  11. package/es/sharedThemeTokens/shadows.js +36 -0
  12. package/es/sharedThemeTokens/spacing.js +45 -0
  13. package/es/sharedThemeTokens/stacking.js +32 -0
  14. package/es/sharedThemeTokens/transitions.js +30 -0
  15. package/es/sharedThemeTokens/typography.js +54 -0
  16. package/es/themes/canvas/colors.js +67 -0
  17. package/es/themes/canvas/index.js +54 -0
  18. package/es/themes/canvasHighContrast/colors.js +67 -0
  19. package/es/themes/canvasHighContrast/index.js +36 -0
  20. package/es/utils/getUIColors.js +59 -0
  21. package/lib/index.js +26 -5
  22. package/lib/sharedThemeTokens/borders.js +50 -0
  23. package/lib/sharedThemeTokens/breakpoints.js +62 -0
  24. package/lib/sharedThemeTokens/colors/dataVisualization.js +144 -0
  25. package/lib/sharedThemeTokens/colors/primitives.js +178 -0
  26. package/lib/sharedThemeTokens/forms.js +36 -0
  27. package/lib/sharedThemeTokens/index.js +51 -0
  28. package/lib/sharedThemeTokens/media.js +37 -0
  29. package/lib/sharedThemeTokens/shadows.js +41 -0
  30. package/lib/sharedThemeTokens/spacing.js +50 -0
  31. package/lib/sharedThemeTokens/stacking.js +37 -0
  32. package/lib/sharedThemeTokens/transitions.js +35 -0
  33. package/lib/sharedThemeTokens/typography.js +59 -0
  34. package/lib/themes/canvas/colors.js +73 -0
  35. package/lib/themes/canvas/index.js +60 -0
  36. package/lib/themes/canvasHighContrast/colors.js +73 -0
  37. package/lib/themes/canvasHighContrast/index.js +43 -0
  38. package/lib/utils/getUIColors.js +66 -0
  39. package/package.json +4 -6
  40. package/src/index.ts +28 -9
  41. package/src/sharedThemeTokens/borders.ts +42 -0
  42. package/src/sharedThemeTokens/breakpoints.ts +54 -0
  43. package/src/sharedThemeTokens/colors/dataVisualization.ts +151 -0
  44. package/src/sharedThemeTokens/colors/primitives.ts +190 -0
  45. package/src/sharedThemeTokens/forms.ts +34 -0
  46. package/src/sharedThemeTokens/index.ts +48 -0
  47. package/src/sharedThemeTokens/media.ts +35 -0
  48. package/src/sharedThemeTokens/shadows.ts +45 -0
  49. package/src/sharedThemeTokens/spacing.ts +40 -0
  50. package/src/sharedThemeTokens/stacking.ts +34 -0
  51. package/src/sharedThemeTokens/transitions.ts +33 -0
  52. package/src/sharedThemeTokens/typography.ts +53 -0
  53. package/src/themes/canvas/colors.ts +76 -0
  54. package/src/themes/canvas/index.ts +69 -0
  55. package/src/themes/canvasHighContrast/colors.ts +76 -0
  56. package/src/themes/canvasHighContrast/index.ts +44 -0
  57. package/src/utils/getUIColors.ts +68 -0
  58. package/tokens/canvas/scss/_variables.scss +151 -0
  59. package/tokens/canvas/source.json +1 -0
  60. package/tsconfig.build.json +1 -7
  61. package/tsconfig.build.tsbuildinfo +1 -1
  62. package/types/index.d.ts +9 -7
  63. package/types/index.d.ts.map +1 -1
  64. package/types/sharedThemeTokens/borders.d.ts +5 -0
  65. package/types/sharedThemeTokens/borders.d.ts.map +1 -0
  66. package/types/sharedThemeTokens/breakpoints.d.ts +5 -0
  67. package/types/sharedThemeTokens/breakpoints.d.ts.map +1 -0
  68. package/types/sharedThemeTokens/colors/dataVisualization.d.ts +4 -0
  69. package/types/sharedThemeTokens/colors/dataVisualization.d.ts.map +1 -0
  70. package/types/sharedThemeTokens/colors/primitives.d.ts +4 -0
  71. package/types/sharedThemeTokens/colors/primitives.d.ts.map +1 -0
  72. package/types/sharedThemeTokens/forms.d.ts +5 -0
  73. package/types/sharedThemeTokens/forms.d.ts.map +1 -0
  74. package/types/sharedThemeTokens/index.d.ts +14 -0
  75. package/types/sharedThemeTokens/index.d.ts.map +1 -0
  76. package/types/sharedThemeTokens/media.d.ts +5 -0
  77. package/types/sharedThemeTokens/media.d.ts.map +1 -0
  78. package/types/sharedThemeTokens/shadows.d.ts +5 -0
  79. package/types/sharedThemeTokens/shadows.d.ts.map +1 -0
  80. package/types/sharedThemeTokens/spacing.d.ts +5 -0
  81. package/types/sharedThemeTokens/spacing.d.ts.map +1 -0
  82. package/types/sharedThemeTokens/stacking.d.ts +5 -0
  83. package/types/sharedThemeTokens/stacking.d.ts.map +1 -0
  84. package/types/sharedThemeTokens/transitions.d.ts +5 -0
  85. package/types/sharedThemeTokens/transitions.d.ts.map +1 -0
  86. package/types/sharedThemeTokens/typography.d.ts +5 -0
  87. package/types/sharedThemeTokens/typography.d.ts.map +1 -0
  88. package/types/themes/canvas/colors.d.ts +16 -0
  89. package/types/themes/canvas/colors.d.ts.map +1 -0
  90. package/types/themes/canvas/index.d.ts +27 -0
  91. package/types/themes/canvas/index.d.ts.map +1 -0
  92. package/types/themes/canvasHighContrast/colors.d.ts +16 -0
  93. package/types/themes/canvasHighContrast/colors.d.ts.map +1 -0
  94. package/types/themes/canvasHighContrast/index.d.ts +10 -0
  95. package/types/themes/canvasHighContrast/index.d.ts.map +1 -0
  96. package/types/utils/getUIColors.d.ts +4 -0
  97. package/types/utils/getUIColors.d.ts.map +1 -0
@@ -0,0 +1,32 @@
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
+ const stacking = Object.freeze({
26
+ topmost: 9999,
27
+ above: 1,
28
+ below: -1,
29
+ deepest: -9999
30
+ });
31
+ export default stacking;
32
+ export { stacking };
@@ -0,0 +1,30 @@
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
+ const transitions = Object.freeze({
26
+ duration: '300ms',
27
+ timing: 'ease-in-out'
28
+ });
29
+ export default transitions;
30
+ export { transitions };
@@ -0,0 +1,54 @@
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
+ const typography = Object.freeze({
26
+ fontFamily: 'LatoWeb, Lato, "Helvetica Neue", Helvetica, Arial, sans-serif',
27
+ fontFamilyMonospace: 'Menlo, Consolas, Monaco, "Andale Mono", monospace',
28
+ fontSizeXSmall: '0.75rem',
29
+ // 12px
30
+ fontSizeSmall: '0.875rem',
31
+ // 14px
32
+ fontSizeMedium: '1rem',
33
+ // 16px
34
+ fontSizeLarge: '1.375rem',
35
+ // 22px
36
+ fontSizeXLarge: '1.75rem',
37
+ // 28px
38
+ fontSizeXXLarge: '2.375rem',
39
+ // 38px
40
+
41
+ fontWeightLight: 300,
42
+ fontWeightNormal: 400,
43
+ fontWeightBold: 700,
44
+ lineHeight: 1.5,
45
+ // 24px
46
+ lineHeightFit: 1.125,
47
+ lineHeightCondensed: 1.25,
48
+ lineHeightDouble: 2,
49
+ letterSpacingNormal: 0,
50
+ letterSpacingCondensed: '-0.0625rem',
51
+ letterSpacingExpanded: '0.0625rem'
52
+ });
53
+ export default typography;
54
+ export { typography };
@@ -0,0 +1,67 @@
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 { primitives, additionalPrimitives } from '../../sharedThemeTokens/colors/primitives';
26
+ import dataVisualization from '../../sharedThemeTokens/colors/dataVisualization';
27
+ import getUIColors from '../../utils/getUIColors';
28
+ const contrasts = {
29
+ white1010: primitives.white,
30
+ white1010op75: primitives.white10op75,
31
+ grey1111: primitives.grey11,
32
+ grey1214: primitives.grey12,
33
+ grey1424: primitives.grey14,
34
+ grey2424: primitives.grey24,
35
+ grey4570: primitives.grey45,
36
+ grey5782: primitives.grey57,
37
+ grey100100: primitives.grey100,
38
+ grey100100op75: primitives.grey100op75,
39
+ grey125125: primitives.grey125,
40
+ blue1212: primitives.blue12,
41
+ blue4570: primitives.blue45,
42
+ blue5782: primitives.blue57,
43
+ green1212: primitives.green12,
44
+ green4570: primitives.green45,
45
+ green5782: primitives.green57,
46
+ orange1212: primitives.orange12,
47
+ orange3045: primitives.orange30,
48
+ orange4570: primitives.orange45,
49
+ orange5782: primitives.orange57,
50
+ red1212: primitives.red12,
51
+ red4570: primitives.red45,
52
+ red5782: primitives.red57
53
+ };
54
+ const ui = getUIColors(contrasts);
55
+ const colors = {
56
+ primitives,
57
+ additionalPrimitives,
58
+ contrasts,
59
+ ui,
60
+ dataVisualization
61
+ };
62
+ export default {
63
+ primitives,
64
+ contrasts,
65
+ ui
66
+ };
67
+ export { colors };
@@ -0,0 +1,54 @@
1
+ var _colors$contrasts, _colors$contrasts2, _colors$contrasts3, _colors$contrasts4, _colors$contrasts5, _colors$contrasts6, _colors$contrasts7, _colors$contrasts8, _colors$contrasts9, _colors$contrasts10, _colors$contrasts11, _colors$contrasts12, _colors$contrasts13;
2
+ /*
3
+ * The MIT License (MIT)
4
+ *
5
+ * Copyright (c) 2015 - present Instructure, Inc.
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+
26
+ import sharedThemeTokens from '../../sharedThemeTokens';
27
+ import { ThemeRegistry } from '@instructure/theme-registry';
28
+ import colors from './colors';
29
+ const key = 'canvas';
30
+ const brandVariables = {
31
+ /* Defaults for Canvas account branding variables: */
32
+ 'ic-brand-primary': colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.blue4570,
33
+ 'ic-brand-font-color-dark': colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.grey125125,
34
+ 'ic-link-color': colors === null || colors === void 0 ? void 0 : (_colors$contrasts3 = colors.contrasts) === null || _colors$contrasts3 === void 0 ? void 0 : _colors$contrasts3.blue4570,
35
+ 'ic-link-decoration': 'none',
36
+ 'ic-brand-button--primary-bgd': colors === null || colors === void 0 ? void 0 : (_colors$contrasts4 = colors.contrasts) === null || _colors$contrasts4 === void 0 ? void 0 : _colors$contrasts4.blue4570,
37
+ 'ic-brand-button--primary-text': colors === null || colors === void 0 ? void 0 : (_colors$contrasts5 = colors.contrasts) === null || _colors$contrasts5 === void 0 ? void 0 : _colors$contrasts5.white1010,
38
+ 'ic-brand-button--secondary-bgd': colors === null || colors === void 0 ? void 0 : (_colors$contrasts6 = colors.contrasts) === null || _colors$contrasts6 === void 0 ? void 0 : _colors$contrasts6.grey125125,
39
+ 'ic-brand-button--secondary-text': colors === null || colors === void 0 ? void 0 : (_colors$contrasts7 = colors.contrasts) === null || _colors$contrasts7 === void 0 ? void 0 : _colors$contrasts7.white1010,
40
+ 'ic-brand-global-nav-bgd': colors === null || colors === void 0 ? void 0 : (_colors$contrasts8 = colors.contrasts) === null || _colors$contrasts8 === void 0 ? void 0 : _colors$contrasts8.grey100100,
41
+ 'ic-global-nav-link-hover': colors === null || colors === void 0 ? void 0 : (_colors$contrasts9 = colors.contrasts) === null || _colors$contrasts9 === void 0 ? void 0 : _colors$contrasts9.grey125125,
42
+ 'ic-brand-global-nav-ic-icon-svg-fill': colors === null || colors === void 0 ? void 0 : (_colors$contrasts10 = colors.contrasts) === null || _colors$contrasts10 === void 0 ? void 0 : _colors$contrasts10.white1010,
43
+ 'ic-brand-global-nav-ic-icon-svg-fill--active': colors === null || colors === void 0 ? void 0 : (_colors$contrasts11 = colors.contrasts) === null || _colors$contrasts11 === void 0 ? void 0 : _colors$contrasts11.blue4570,
44
+ 'ic-brand-global-nav-menu-item__text-color': colors === null || colors === void 0 ? void 0 : (_colors$contrasts12 = colors.contrasts) === null || _colors$contrasts12 === void 0 ? void 0 : _colors$contrasts12.white1010,
45
+ 'ic-brand-global-nav-menu-item__text-color--active': colors === null || colors === void 0 ? void 0 : (_colors$contrasts13 = colors.contrasts) === null || _colors$contrasts13 === void 0 ? void 0 : _colors$contrasts13.blue4570
46
+ };
47
+ const __theme = {
48
+ key,
49
+ ...sharedThemeTokens,
50
+ colors,
51
+ ...brandVariables
52
+ };
53
+ const theme = ThemeRegistry.registerTheme(__theme);
54
+ export default theme;
@@ -0,0 +1,67 @@
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 { primitives, additionalPrimitives } from '../../sharedThemeTokens/colors/primitives';
26
+ import dataVisualization from '../../sharedThemeTokens/colors/dataVisualization';
27
+ import getUIColors from '../../utils/getUIColors';
28
+ const contrasts = {
29
+ white1010: primitives.white,
30
+ white1010op75: primitives.white10op75,
31
+ grey1111: primitives.grey11,
32
+ grey1214: primitives.grey14,
33
+ grey1424: primitives.grey24,
34
+ grey2424: primitives.grey24,
35
+ grey4570: primitives.grey70,
36
+ grey5782: primitives.grey82,
37
+ grey100100: primitives.grey100,
38
+ grey100100op75: primitives.grey100op75,
39
+ grey125125: primitives.grey125,
40
+ blue1212: primitives.blue12,
41
+ blue4570: primitives.blue70,
42
+ blue5782: primitives.blue82,
43
+ green1212: primitives.green12,
44
+ green4570: primitives.green70,
45
+ green5782: primitives.green82,
46
+ orange1212: primitives.orange12,
47
+ orange3045: primitives.orange45,
48
+ orange4570: primitives.orange70,
49
+ orange5782: primitives.orange82,
50
+ red1212: primitives.red12,
51
+ red4570: primitives.red70,
52
+ red5782: primitives.red82
53
+ };
54
+ const ui = getUIColors(contrasts);
55
+ const colors = {
56
+ primitives,
57
+ additionalPrimitives,
58
+ contrasts,
59
+ ui,
60
+ dataVisualization
61
+ };
62
+ export default {
63
+ primitives,
64
+ contrasts,
65
+ ui
66
+ };
67
+ export { colors };
@@ -0,0 +1,36 @@
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 sharedThemeTokens from '../../sharedThemeTokens';
26
+ import { ThemeRegistry } from '@instructure/theme-registry';
27
+ import colors from './colors';
28
+ const key = 'canvas-high-contrast';
29
+ const __theme = {
30
+ key,
31
+ description: 'This theme meets WCAG 2.0 AA rules for color contrast.',
32
+ ...sharedThemeTokens,
33
+ colors
34
+ };
35
+ const theme = ThemeRegistry.registerTheme(__theme);
36
+ export default theme;
@@ -0,0 +1,59 @@
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 const getUIColors = contrasts => ({
26
+ surfacePagePrimary: contrasts === null || contrasts === void 0 ? void 0 : contrasts.white1010,
27
+ surfacePageSecondary: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey1111,
28
+ surfaceCardPrimary: contrasts === null || contrasts === void 0 ? void 0 : contrasts.white1010,
29
+ surfaceCardSecondary: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey1111,
30
+ surfaceDark: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey100100,
31
+ textTitle: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey125125,
32
+ textDescription: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey125125,
33
+ textBody: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey125125,
34
+ textTimestamp: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey5782,
35
+ textAuthor: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey5782,
36
+ textDatapoint: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey5782,
37
+ textLink: contrasts === null || contrasts === void 0 ? void 0 : contrasts.blue5782,
38
+ textPlaceholder: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey2424,
39
+ textSuccess: contrasts === null || contrasts === void 0 ? void 0 : contrasts.green5782,
40
+ textWarning: contrasts === null || contrasts === void 0 ? void 0 : contrasts.orange5782,
41
+ textError: contrasts === null || contrasts === void 0 ? void 0 : contrasts.red5782,
42
+ lineStroke: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey1424,
43
+ lineDivider: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey1214,
44
+ surfaceOverlayGrey: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey100100op75,
45
+ surfaceOverlayWhite: contrasts === null || contrasts === void 0 ? void 0 : contrasts.white1010op75,
46
+ surfaceAttention: contrasts === null || contrasts === void 0 ? void 0 : contrasts.blue4570,
47
+ surfaceSuccess: contrasts === null || contrasts === void 0 ? void 0 : contrasts.green4570,
48
+ surfaceWarning: contrasts === null || contrasts === void 0 ? void 0 : contrasts.orange4570,
49
+ surfaceError: contrasts === null || contrasts === void 0 ? void 0 : contrasts.red4570,
50
+ surfaceDivider: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey1214,
51
+ textSurfaceColored: contrasts === null || contrasts === void 0 ? void 0 : contrasts.white1010,
52
+ iconDefault: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey125125,
53
+ iconSuccess: contrasts === null || contrasts === void 0 ? void 0 : contrasts.green4570,
54
+ iconWarning: contrasts === null || contrasts === void 0 ? void 0 : contrasts.orange4570,
55
+ iconError: contrasts === null || contrasts === void 0 ? void 0 : contrasts.red4570,
56
+ iconSurfaceColored: contrasts === null || contrasts === void 0 ? void 0 : contrasts.white1010,
57
+ lineConnector: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey1424
58
+ });
59
+ export default getUIColors;
package/lib/index.js CHANGED
@@ -1,23 +1,44 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
7
+ Object.defineProperty(exports, "additionalPrimitives", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _primitives.additionalPrimitives;
11
+ }
12
+ });
6
13
  Object.defineProperty(exports, "canvas", {
7
14
  enumerable: true,
8
15
  get: function () {
9
- return _canvasTheme.theme;
16
+ return _canvas.default;
10
17
  }
11
18
  });
12
19
  Object.defineProperty(exports, "canvasHighContrast", {
13
20
  enumerable: true,
14
21
  get: function () {
15
- return _canvasHighContrastTheme.theme;
22
+ return _canvasHighContrast.default;
23
+ }
24
+ });
25
+ Object.defineProperty(exports, "dataVisualization", {
26
+ enumerable: true,
27
+ get: function () {
28
+ return _dataVisualization.default;
16
29
  }
17
30
  });
18
31
  exports.default = void 0;
19
- var _canvasHighContrastTheme = require("@instructure/canvas-high-contrast-theme");
20
- var _canvasTheme = require("@instructure/canvas-theme");
32
+ Object.defineProperty(exports, "primitives", {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _primitives.primitives;
36
+ }
37
+ });
38
+ var _canvasHighContrast = _interopRequireDefault(require("./themes/canvasHighContrast"));
39
+ var _canvas = _interopRequireDefault(require("./themes/canvas"));
40
+ var _primitives = require("./sharedThemeTokens/colors/primitives");
41
+ var _dataVisualization = _interopRequireDefault(require("./sharedThemeTokens/colors/dataVisualization"));
21
42
  /*
22
43
  * The MIT License (MIT)
23
44
  *
@@ -41,4 +62,4 @@ var _canvasTheme = require("@instructure/canvas-theme");
41
62
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
42
63
  * SOFTWARE.
43
64
  */
44
- var _default = exports.default = _canvasTheme.theme;
65
+ var _default = exports.default = _canvas.default;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.borders = void 0;
7
+ /*
8
+ * The MIT License (MIT)
9
+ *
10
+ * Copyright (c) 2015 - present Instructure, Inc.
11
+ *
12
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ * of this software and associated documentation files (the "Software"), to deal
14
+ * in the Software without restriction, including without limitation the rights
15
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ * copies of the Software, and to permit persons to whom the Software is
17
+ * furnished to do so, subject to the following conditions:
18
+ *
19
+ * The above copyright notice and this permission notice shall be included in all
20
+ * copies or substantial portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ * SOFTWARE.
29
+ */
30
+
31
+ // use for consistency between buttons, text inputs, etc.
32
+
33
+ const borders = exports.borders = Object.freeze({
34
+ radiusSmall: '0.125rem',
35
+ // 2px
36
+ radiusMedium: '0.25rem',
37
+ // 4px
38
+ radiusLarge: '0.5rem',
39
+ // 8px
40
+
41
+ widthSmall: '0.0625rem',
42
+ // 1px
43
+ widthMedium: '0.125rem',
44
+ // 2px
45
+ widthLarge: '0.25rem',
46
+ // 4px
47
+
48
+ style: 'solid'
49
+ });
50
+ var _default = exports.default = borders;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.breakpoints = void 0;
7
+ /*
8
+ * The MIT License (MIT)
9
+ *
10
+ * Copyright (c) 2015 - present Instructure, Inc.
11
+ *
12
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ * of this software and associated documentation files (the "Software"), to deal
14
+ * in the Software without restriction, including without limitation the rights
15
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ * copies of the Software, and to permit persons to whom the Software is
17
+ * furnished to do so, subject to the following conditions:
18
+ *
19
+ * The above copyright notice and this permission notice shall be included in all
20
+ * copies or substantial portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ * SOFTWARE.
29
+ */
30
+
31
+ const onePixel = 0.0625;
32
+
33
+ // base = 16px
34
+ const values = {
35
+ xxSmall: 8,
36
+ // 128px
37
+ xSmall: 16,
38
+ // 256px
39
+ small: 30,
40
+ // 480px
41
+ medium: 48,
42
+ // 768px
43
+ tablet: 48,
44
+ // 768px
45
+ large: 62,
46
+ // 992px
47
+ desktop: 64,
48
+ // 1024px
49
+ xLarge: 75 // 1200px
50
+ };
51
+ const breakpoints = exports.breakpoints = Object.freeze({
52
+ xxSmall: `${values.xxSmall}em`,
53
+ xSmall: `${values.xSmall}em`,
54
+ small: `${values.small}em`,
55
+ medium: `${values.medium}em`,
56
+ tablet: `${values.tablet}em`,
57
+ large: `${values.large}em`,
58
+ desktop: `${values.desktop}em`,
59
+ xLarge: `${values.xLarge}em`,
60
+ maxWidth: `${values.large - onePixel}em`
61
+ });
62
+ var _default = exports.default = breakpoints;