@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,73 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = exports.colors = void 0;
8
+ var _primitives = require("../../sharedThemeTokens/colors/primitives");
9
+ var _dataVisualization = _interopRequireDefault(require("../../sharedThemeTokens/colors/dataVisualization"));
10
+ var _getUIColors = _interopRequireDefault(require("../../utils/getUIColors"));
11
+ /*
12
+ * The MIT License (MIT)
13
+ *
14
+ * Copyright (c) 2015 - present Instructure, Inc.
15
+ *
16
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
17
+ * of this software and associated documentation files (the "Software"), to deal
18
+ * in the Software without restriction, including without limitation the rights
19
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20
+ * copies of the Software, and to permit persons to whom the Software is
21
+ * furnished to do so, subject to the following conditions:
22
+ *
23
+ * The above copyright notice and this permission notice shall be included in all
24
+ * copies or substantial portions of the Software.
25
+ *
26
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32
+ * SOFTWARE.
33
+ */
34
+
35
+ const contrasts = {
36
+ white1010: _primitives.primitives.white,
37
+ white1010op75: _primitives.primitives.white10op75,
38
+ grey1111: _primitives.primitives.grey11,
39
+ grey1214: _primitives.primitives.grey12,
40
+ grey1424: _primitives.primitives.grey14,
41
+ grey2424: _primitives.primitives.grey24,
42
+ grey4570: _primitives.primitives.grey45,
43
+ grey5782: _primitives.primitives.grey57,
44
+ grey100100: _primitives.primitives.grey100,
45
+ grey100100op75: _primitives.primitives.grey100op75,
46
+ grey125125: _primitives.primitives.grey125,
47
+ blue1212: _primitives.primitives.blue12,
48
+ blue4570: _primitives.primitives.blue45,
49
+ blue5782: _primitives.primitives.blue57,
50
+ green1212: _primitives.primitives.green12,
51
+ green4570: _primitives.primitives.green45,
52
+ green5782: _primitives.primitives.green57,
53
+ orange1212: _primitives.primitives.orange12,
54
+ orange3045: _primitives.primitives.orange30,
55
+ orange4570: _primitives.primitives.orange45,
56
+ orange5782: _primitives.primitives.orange57,
57
+ red1212: _primitives.primitives.red12,
58
+ red4570: _primitives.primitives.red45,
59
+ red5782: _primitives.primitives.red57
60
+ };
61
+ const ui = (0, _getUIColors.default)(contrasts);
62
+ const colors = exports.colors = {
63
+ primitives: _primitives.primitives,
64
+ additionalPrimitives: _primitives.additionalPrimitives,
65
+ contrasts,
66
+ ui,
67
+ dataVisualization: _dataVisualization.default
68
+ };
69
+ var _default = exports.default = {
70
+ primitives: _primitives.primitives,
71
+ contrasts,
72
+ ui
73
+ };
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _sharedThemeTokens = _interopRequireDefault(require("../../sharedThemeTokens"));
9
+ var _themeRegistry = require("@instructure/theme-registry");
10
+ var _colors = _interopRequireDefault(require("./colors"));
11
+ 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;
12
+ /*
13
+ * The MIT License (MIT)
14
+ *
15
+ * Copyright (c) 2015 - present Instructure, Inc.
16
+ *
17
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
18
+ * of this software and associated documentation files (the "Software"), to deal
19
+ * in the Software without restriction, including without limitation the rights
20
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21
+ * copies of the Software, and to permit persons to whom the Software is
22
+ * furnished to do so, subject to the following conditions:
23
+ *
24
+ * The above copyright notice and this permission notice shall be included in all
25
+ * copies or substantial portions of the Software.
26
+ *
27
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
+ * SOFTWARE.
34
+ */
35
+ const key = 'canvas';
36
+ const brandVariables = {
37
+ /* Defaults for Canvas account branding variables: */
38
+ 'ic-brand-primary': _colors.default === null || _colors.default === void 0 ? void 0 : (_colors$contrasts = _colors.default.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.blue4570,
39
+ 'ic-brand-font-color-dark': _colors.default === null || _colors.default === void 0 ? void 0 : (_colors$contrasts2 = _colors.default.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.grey125125,
40
+ 'ic-link-color': _colors.default === null || _colors.default === void 0 ? void 0 : (_colors$contrasts3 = _colors.default.contrasts) === null || _colors$contrasts3 === void 0 ? void 0 : _colors$contrasts3.blue4570,
41
+ 'ic-link-decoration': 'none',
42
+ 'ic-brand-button--primary-bgd': _colors.default === null || _colors.default === void 0 ? void 0 : (_colors$contrasts4 = _colors.default.contrasts) === null || _colors$contrasts4 === void 0 ? void 0 : _colors$contrasts4.blue4570,
43
+ 'ic-brand-button--primary-text': _colors.default === null || _colors.default === void 0 ? void 0 : (_colors$contrasts5 = _colors.default.contrasts) === null || _colors$contrasts5 === void 0 ? void 0 : _colors$contrasts5.white1010,
44
+ 'ic-brand-button--secondary-bgd': _colors.default === null || _colors.default === void 0 ? void 0 : (_colors$contrasts6 = _colors.default.contrasts) === null || _colors$contrasts6 === void 0 ? void 0 : _colors$contrasts6.grey125125,
45
+ 'ic-brand-button--secondary-text': _colors.default === null || _colors.default === void 0 ? void 0 : (_colors$contrasts7 = _colors.default.contrasts) === null || _colors$contrasts7 === void 0 ? void 0 : _colors$contrasts7.white1010,
46
+ 'ic-brand-global-nav-bgd': _colors.default === null || _colors.default === void 0 ? void 0 : (_colors$contrasts8 = _colors.default.contrasts) === null || _colors$contrasts8 === void 0 ? void 0 : _colors$contrasts8.grey100100,
47
+ 'ic-global-nav-link-hover': _colors.default === null || _colors.default === void 0 ? void 0 : (_colors$contrasts9 = _colors.default.contrasts) === null || _colors$contrasts9 === void 0 ? void 0 : _colors$contrasts9.grey125125,
48
+ 'ic-brand-global-nav-ic-icon-svg-fill': _colors.default === null || _colors.default === void 0 ? void 0 : (_colors$contrasts10 = _colors.default.contrasts) === null || _colors$contrasts10 === void 0 ? void 0 : _colors$contrasts10.white1010,
49
+ 'ic-brand-global-nav-ic-icon-svg-fill--active': _colors.default === null || _colors.default === void 0 ? void 0 : (_colors$contrasts11 = _colors.default.contrasts) === null || _colors$contrasts11 === void 0 ? void 0 : _colors$contrasts11.blue4570,
50
+ 'ic-brand-global-nav-menu-item__text-color': _colors.default === null || _colors.default === void 0 ? void 0 : (_colors$contrasts12 = _colors.default.contrasts) === null || _colors$contrasts12 === void 0 ? void 0 : _colors$contrasts12.white1010,
51
+ 'ic-brand-global-nav-menu-item__text-color--active': _colors.default === null || _colors.default === void 0 ? void 0 : (_colors$contrasts13 = _colors.default.contrasts) === null || _colors$contrasts13 === void 0 ? void 0 : _colors$contrasts13.blue4570
52
+ };
53
+ const __theme = {
54
+ key,
55
+ ..._sharedThemeTokens.default,
56
+ colors: _colors.default,
57
+ ...brandVariables
58
+ };
59
+ const theme = _themeRegistry.ThemeRegistry.registerTheme(__theme);
60
+ var _default = exports.default = theme;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = exports.colors = void 0;
8
+ var _primitives = require("../../sharedThemeTokens/colors/primitives");
9
+ var _dataVisualization = _interopRequireDefault(require("../../sharedThemeTokens/colors/dataVisualization"));
10
+ var _getUIColors = _interopRequireDefault(require("../../utils/getUIColors"));
11
+ /*
12
+ * The MIT License (MIT)
13
+ *
14
+ * Copyright (c) 2015 - present Instructure, Inc.
15
+ *
16
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
17
+ * of this software and associated documentation files (the "Software"), to deal
18
+ * in the Software without restriction, including without limitation the rights
19
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20
+ * copies of the Software, and to permit persons to whom the Software is
21
+ * furnished to do so, subject to the following conditions:
22
+ *
23
+ * The above copyright notice and this permission notice shall be included in all
24
+ * copies or substantial portions of the Software.
25
+ *
26
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32
+ * SOFTWARE.
33
+ */
34
+
35
+ const contrasts = {
36
+ white1010: _primitives.primitives.white,
37
+ white1010op75: _primitives.primitives.white10op75,
38
+ grey1111: _primitives.primitives.grey11,
39
+ grey1214: _primitives.primitives.grey14,
40
+ grey1424: _primitives.primitives.grey24,
41
+ grey2424: _primitives.primitives.grey24,
42
+ grey4570: _primitives.primitives.grey70,
43
+ grey5782: _primitives.primitives.grey82,
44
+ grey100100: _primitives.primitives.grey100,
45
+ grey100100op75: _primitives.primitives.grey100op75,
46
+ grey125125: _primitives.primitives.grey125,
47
+ blue1212: _primitives.primitives.blue12,
48
+ blue4570: _primitives.primitives.blue70,
49
+ blue5782: _primitives.primitives.blue82,
50
+ green1212: _primitives.primitives.green12,
51
+ green4570: _primitives.primitives.green70,
52
+ green5782: _primitives.primitives.green82,
53
+ orange1212: _primitives.primitives.orange12,
54
+ orange3045: _primitives.primitives.orange45,
55
+ orange4570: _primitives.primitives.orange70,
56
+ orange5782: _primitives.primitives.orange82,
57
+ red1212: _primitives.primitives.red12,
58
+ red4570: _primitives.primitives.red70,
59
+ red5782: _primitives.primitives.red82
60
+ };
61
+ const ui = (0, _getUIColors.default)(contrasts);
62
+ const colors = exports.colors = {
63
+ primitives: _primitives.primitives,
64
+ additionalPrimitives: _primitives.additionalPrimitives,
65
+ contrasts,
66
+ ui,
67
+ dataVisualization: _dataVisualization.default
68
+ };
69
+ var _default = exports.default = {
70
+ primitives: _primitives.primitives,
71
+ contrasts,
72
+ ui
73
+ };
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _sharedThemeTokens = _interopRequireDefault(require("../../sharedThemeTokens"));
9
+ var _themeRegistry = require("@instructure/theme-registry");
10
+ var _colors = _interopRequireDefault(require("./colors"));
11
+ /*
12
+ * The MIT License (MIT)
13
+ *
14
+ * Copyright (c) 2015 - present Instructure, Inc.
15
+ *
16
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
17
+ * of this software and associated documentation files (the "Software"), to deal
18
+ * in the Software without restriction, including without limitation the rights
19
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20
+ * copies of the Software, and to permit persons to whom the Software is
21
+ * furnished to do so, subject to the following conditions:
22
+ *
23
+ * The above copyright notice and this permission notice shall be included in all
24
+ * copies or substantial portions of the Software.
25
+ *
26
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32
+ * SOFTWARE.
33
+ */
34
+
35
+ const key = 'canvas-high-contrast';
36
+ const __theme = {
37
+ key,
38
+ description: 'This theme meets WCAG 2.0 AA rules for color contrast.',
39
+ ..._sharedThemeTokens.default,
40
+ colors: _colors.default
41
+ };
42
+ const theme = _themeRegistry.ThemeRegistry.registerTheme(__theme);
43
+ var _default = exports.default = theme;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getUIColors = exports.default = 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 getUIColors = contrasts => ({
32
+ surfacePagePrimary: contrasts === null || contrasts === void 0 ? void 0 : contrasts.white1010,
33
+ surfacePageSecondary: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey1111,
34
+ surfaceCardPrimary: contrasts === null || contrasts === void 0 ? void 0 : contrasts.white1010,
35
+ surfaceCardSecondary: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey1111,
36
+ surfaceDark: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey100100,
37
+ textTitle: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey125125,
38
+ textDescription: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey125125,
39
+ textBody: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey125125,
40
+ textTimestamp: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey5782,
41
+ textAuthor: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey5782,
42
+ textDatapoint: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey5782,
43
+ textLink: contrasts === null || contrasts === void 0 ? void 0 : contrasts.blue5782,
44
+ textPlaceholder: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey2424,
45
+ textSuccess: contrasts === null || contrasts === void 0 ? void 0 : contrasts.green5782,
46
+ textWarning: contrasts === null || contrasts === void 0 ? void 0 : contrasts.orange5782,
47
+ textError: contrasts === null || contrasts === void 0 ? void 0 : contrasts.red5782,
48
+ lineStroke: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey1424,
49
+ lineDivider: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey1214,
50
+ surfaceOverlayGrey: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey100100op75,
51
+ surfaceOverlayWhite: contrasts === null || contrasts === void 0 ? void 0 : contrasts.white1010op75,
52
+ surfaceAttention: contrasts === null || contrasts === void 0 ? void 0 : contrasts.blue4570,
53
+ surfaceSuccess: contrasts === null || contrasts === void 0 ? void 0 : contrasts.green4570,
54
+ surfaceWarning: contrasts === null || contrasts === void 0 ? void 0 : contrasts.orange4570,
55
+ surfaceError: contrasts === null || contrasts === void 0 ? void 0 : contrasts.red4570,
56
+ surfaceDivider: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey1214,
57
+ textSurfaceColored: contrasts === null || contrasts === void 0 ? void 0 : contrasts.white1010,
58
+ iconDefault: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey125125,
59
+ iconSuccess: contrasts === null || contrasts === void 0 ? void 0 : contrasts.green4570,
60
+ iconWarning: contrasts === null || contrasts === void 0 ? void 0 : contrasts.orange4570,
61
+ iconError: contrasts === null || contrasts === void 0 ? void 0 : contrasts.red4570,
62
+ iconSurfaceColored: contrasts === null || contrasts === void 0 ? void 0 : contrasts.white1010,
63
+ lineConnector: contrasts === null || contrasts === void 0 ? void 0 : contrasts.grey1424
64
+ });
65
+ exports.getUIColors = getUIColors;
66
+ var _default = exports.default = getUIColors;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-themes",
3
- "version": "10.0.1-snapshot-14",
3
+ "version": "10.2.0",
4
4
  "description": "A library of instructure themes",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -22,16 +22,14 @@
22
22
  },
23
23
  "license": "MIT",
24
24
  "devDependencies": {
25
- "@instructure/ui-babel-preset": "10.0.1-snapshot-14",
26
- "@instructure/ui-theme-tokens": "10.0.1-snapshot-14",
25
+ "@instructure/ui-babel-preset": "10.2.0",
27
26
  "@testing-library/jest-dom": "^6.4.6",
28
27
  "@testing-library/react": "^15.0.7",
29
28
  "vitest": "^2.0.2"
30
29
  },
31
30
  "dependencies": {
32
- "@instructure/canvas-high-contrast-theme": "10.0.1-snapshot-14",
33
- "@instructure/canvas-theme": "10.0.1-snapshot-14",
34
- "@instructure/shared-types": "10.0.1-snapshot-14"
31
+ "@instructure/shared-types": "10.2.0",
32
+ "@instructure/theme-registry": "10.2.0"
35
33
  },
36
34
  "publishConfig": {
37
35
  "access": "public"
package/src/index.ts CHANGED
@@ -22,15 +22,24 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import type { CanvasHighContrastTheme } from '@instructure/canvas-high-contrast-theme'
25
+ import type { CanvasHighContrastTheme } from './themes/canvasHighContrast'
26
+ import type { CanvasTheme, CanvasBrandVariables } from './themes/canvas'
26
27
  import type {
27
- CanvasTheme,
28
- CanvasBrandVariables
29
- } from '@instructure/canvas-theme'
30
- import type { BaseTheme } from '@instructure/shared-types'
28
+ BaseTheme,
29
+ Primitives,
30
+ AdditionalPrimitives,
31
+ DataVisualization,
32
+ UI
33
+ } from '@instructure/shared-types'
31
34
 
32
- import { theme as canvasHighContrast } from '@instructure/canvas-high-contrast-theme'
33
- import { theme as canvas } from '@instructure/canvas-theme'
35
+ import canvasHighContrast from './themes/canvasHighContrast'
36
+ import canvas from './themes/canvas'
37
+
38
+ import {
39
+ primitives,
40
+ additionalPrimitives
41
+ } from './sharedThemeTokens/colors/primitives'
42
+ import dataVisualization from './sharedThemeTokens/colors/dataVisualization'
34
43
 
35
44
  type ThemeMap = {
36
45
  canvas: CanvasTheme
@@ -50,7 +59,13 @@ type ThemeSpecificStyle<ComponentTheme> = {
50
59
  [themeKey in ThemeKeys]?: Partial<ComponentTheme>
51
60
  }
52
61
 
53
- export { canvas, canvasHighContrast }
62
+ export {
63
+ canvas,
64
+ canvasHighContrast,
65
+ primitives,
66
+ additionalPrimitives,
67
+ dataVisualization
68
+ }
54
69
  export default canvas
55
70
  export type {
56
71
  ThemeMap,
@@ -60,5 +75,9 @@ export type {
60
75
  ThemeSpecificStyle,
61
76
  CanvasTheme,
62
77
  CanvasBrandVariables,
63
- CanvasHighContrastTheme
78
+ CanvasHighContrastTheme,
79
+ Primitives,
80
+ AdditionalPrimitives,
81
+ DataVisualization,
82
+ UI
64
83
  }
@@ -0,0 +1,42 @@
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 { Border } from '@instructure/shared-types'
26
+
27
+ // use for consistency between buttons, text inputs, etc.
28
+
29
+ const borders: Border = Object.freeze({
30
+ radiusSmall: '0.125rem', // 2px
31
+ radiusMedium: '0.25rem', // 4px
32
+ radiusLarge: '0.5rem', // 8px
33
+
34
+ widthSmall: '0.0625rem', // 1px
35
+ widthMedium: '0.125rem', // 2px
36
+ widthLarge: '0.25rem', // 4px
37
+
38
+ style: 'solid'
39
+ } as const)
40
+
41
+ export default borders
42
+ export { borders }
@@ -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
+ import { Breakpoints } from '@instructure/shared-types'
26
+
27
+ const onePixel = 0.0625
28
+
29
+ // base = 16px
30
+ const values = {
31
+ xxSmall: 8, // 128px
32
+ xSmall: 16, // 256px
33
+ small: 30, // 480px
34
+ medium: 48, // 768px
35
+ tablet: 48, // 768px
36
+ large: 62, // 992px
37
+ desktop: 64, // 1024px
38
+ xLarge: 75 // 1200px
39
+ }
40
+
41
+ const breakpoints: Breakpoints = Object.freeze({
42
+ xxSmall: `${values.xxSmall}em`,
43
+ xSmall: `${values.xSmall}em`,
44
+ small: `${values.small}em`,
45
+ medium: `${values.medium}em`,
46
+ tablet: `${values.tablet}em`,
47
+ large: `${values.large}em`,
48
+ desktop: `${values.desktop}em`,
49
+ xLarge: `${values.xLarge}em`,
50
+ maxWidth: `${values.large - onePixel}em`
51
+ })
52
+
53
+ export default breakpoints
54
+ export { breakpoints }
@@ -0,0 +1,151 @@
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 { additionalPrimitives } from './primitives'
26
+ import type { DataVisualization } from '@instructure/shared-types'
27
+
28
+ const dataVisualization: DataVisualization = {
29
+ rose12Primary: additionalPrimitives.rose12,
30
+ rose30Primary: additionalPrimitives.rose30,
31
+ rose45Primary: additionalPrimitives.rose45,
32
+ rose70Primary: additionalPrimitives.rose70,
33
+ rose110Primary: additionalPrimitives.rose110,
34
+ rose35Secondary: additionalPrimitives.rose35,
35
+ rose40Secondary: additionalPrimitives.rose40,
36
+ rose50Secondary: additionalPrimitives.rose50,
37
+ rose57Secondary: additionalPrimitives.rose57,
38
+ rose90Secondary: additionalPrimitives.rose90,
39
+
40
+ copper12Primary: additionalPrimitives.copper12,
41
+ copper30Primary: additionalPrimitives.copper30,
42
+ copper45Primary: additionalPrimitives.copper45,
43
+ copper70Primary: additionalPrimitives.copper70,
44
+ copper110Primary: additionalPrimitives.copper110,
45
+ copper35Secondary: additionalPrimitives.copper35,
46
+ copper40Secondary: additionalPrimitives.copper40,
47
+ copper50Secondary: additionalPrimitives.copper50,
48
+ copper57Secondary: additionalPrimitives.copper57,
49
+ copper90Secondary: additionalPrimitives.copper90,
50
+
51
+ honey12Primary: additionalPrimitives.honey12,
52
+ honey30Primary: additionalPrimitives.honey30,
53
+ honey45Primary: additionalPrimitives.honey45,
54
+ honey70Primary: additionalPrimitives.honey70,
55
+ honey110Primary: additionalPrimitives.honey110,
56
+ honey35Secondary: additionalPrimitives.honey35,
57
+ honey40Secondary: additionalPrimitives.honey40,
58
+ honey50Secondary: additionalPrimitives.honey50,
59
+ honey57Secondary: additionalPrimitives.honey57,
60
+ honey90Secondary: additionalPrimitives.honey90,
61
+
62
+ forest12Primary: additionalPrimitives.forest12,
63
+ forest30Primary: additionalPrimitives.forest30,
64
+ forest45Primary: additionalPrimitives.forest45,
65
+ forest70Primary: additionalPrimitives.forest70,
66
+ forest110Primary: additionalPrimitives.forest110,
67
+ forest35Secondary: additionalPrimitives.forest35,
68
+ forest40Secondary: additionalPrimitives.forest40,
69
+ forest50Secondary: additionalPrimitives.forest50,
70
+ forest57Secondary: additionalPrimitives.forest57,
71
+ forest90Secondary: additionalPrimitives.forest90,
72
+
73
+ aurora12Primary: additionalPrimitives.aurora12,
74
+ aurora30Primary: additionalPrimitives.aurora30,
75
+ aurora45Primary: additionalPrimitives.aurora45,
76
+ aurora70Primary: additionalPrimitives.aurora70,
77
+ aurora110Primary: additionalPrimitives.aurora110,
78
+ aurora35Secondary: additionalPrimitives.aurora35,
79
+ aurora40Secondary: additionalPrimitives.aurora40,
80
+ aurora50Secondary: additionalPrimitives.aurora50,
81
+ aurora57Secondary: additionalPrimitives.aurora57,
82
+ aurora90Secondary: additionalPrimitives.aurora90,
83
+
84
+ sea12Primary: additionalPrimitives.sea12,
85
+ sea30Primary: additionalPrimitives.sea30,
86
+ sea45Primary: additionalPrimitives.sea45,
87
+ sea70Primary: additionalPrimitives.sea70,
88
+ sea110Primary: additionalPrimitives.sea110,
89
+ sea35Secondary: additionalPrimitives.sea35,
90
+ sea40Secondary: additionalPrimitives.sea40,
91
+ sea50Secondary: additionalPrimitives.sea50,
92
+ sea57Secondary: additionalPrimitives.sea57,
93
+ sea90Secondary: additionalPrimitives.sea90,
94
+
95
+ sky12Primary: additionalPrimitives.sky12,
96
+ sky30Primary: additionalPrimitives.sky30,
97
+ sky45Primary: additionalPrimitives.sky45,
98
+ sky70Primary: additionalPrimitives.sky70,
99
+ sky110Primary: additionalPrimitives.sky110,
100
+ sky35Secondary: additionalPrimitives.sky35,
101
+ sky40Secondary: additionalPrimitives.sky40,
102
+ sky50Secondary: additionalPrimitives.sky50,
103
+ sky57Secondary: additionalPrimitives.sky57,
104
+ sky90Secondary: additionalPrimitives.sky90,
105
+
106
+ ocean12Primary: additionalPrimitives.ocean12,
107
+ ocean30Primary: additionalPrimitives.ocean30,
108
+ ocean45Primary: additionalPrimitives.ocean45,
109
+ ocean70Primary: additionalPrimitives.ocean70,
110
+ ocean110Primary: additionalPrimitives.ocean110,
111
+ ocean35Secondary: additionalPrimitives.ocean35,
112
+ ocean40Secondary: additionalPrimitives.ocean40,
113
+ ocean50Secondary: additionalPrimitives.ocean50,
114
+ ocean57Secondary: additionalPrimitives.ocean57,
115
+ ocean90Secondary: additionalPrimitives.ocean90,
116
+
117
+ violet12Primary: additionalPrimitives.violet12,
118
+ violet30Primary: additionalPrimitives.violet30,
119
+ violet45Primary: additionalPrimitives.violet45,
120
+ violet70Primary: additionalPrimitives.violet70,
121
+ violet110Primary: additionalPrimitives.violet110,
122
+ violet35Secondary: additionalPrimitives.violet35,
123
+ violet40Secondary: additionalPrimitives.violet40,
124
+ violet50Secondary: additionalPrimitives.violet50,
125
+ violet57Secondary: additionalPrimitives.violet57,
126
+ violet90Secondary: additionalPrimitives.violet90,
127
+
128
+ plum12Primary: additionalPrimitives.plum12,
129
+ plum30Primary: additionalPrimitives.plum30,
130
+ plum45Primary: additionalPrimitives.plum45,
131
+ plum70Primary: additionalPrimitives.plum70,
132
+ plum110Primary: additionalPrimitives.plum110,
133
+ plum35Secondary: additionalPrimitives.plum35,
134
+ plum40Secondary: additionalPrimitives.plum40,
135
+ plum50Secondary: additionalPrimitives.plum50,
136
+ plum57Secondary: additionalPrimitives.plum57,
137
+ plum90Secondary: additionalPrimitives.plum90,
138
+
139
+ stone12Primary: additionalPrimitives.stone12,
140
+ stone30Primary: additionalPrimitives.stone30,
141
+ stone45Primary: additionalPrimitives.stone45,
142
+ stone70Primary: additionalPrimitives.stone70,
143
+ stone110Primary: additionalPrimitives.stone110,
144
+ stone35Secondary: additionalPrimitives.stone35,
145
+ stone40Secondary: additionalPrimitives.stone40,
146
+ stone50Secondary: additionalPrimitives.stone50,
147
+ stone57Secondary: additionalPrimitives.stone57,
148
+ stone90Secondary: additionalPrimitives.stone90
149
+ }
150
+
151
+ export default dataVisualization