@instructure/canvas-rce 5.10.1 → 5.10.2

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.
@@ -24,7 +24,7 @@ import { Button, IconButton, CondensedButton } from '@instructure/ui-buttons';
24
24
  import { Flex } from '@instructure/ui-flex';
25
25
  import { View } from '@instructure/ui-view';
26
26
  import { Badge } from '@instructure/ui-badge';
27
- import { InstUISettingsProvider } from '@instructure/emotion';
27
+ import { ApplyTheme } from '@instructure/ui-themeable';
28
28
  import { Text } from '@instructure/ui-text';
29
29
  import { SVGIcon } from '@instructure/ui-svg-images';
30
30
  import { IconA11yLine, IconKeyboardShortcutsLine, IconMiniArrowEndLine, IconFullScreenLine, IconExitFullScreenLine } from '@instructure/ui-icons';
@@ -190,12 +190,10 @@ export default function StatusBar(props) {
190
190
  return button;
191
191
  }
192
192
 
193
- return /*#__PURE__*/React.createElement(InstUISettingsProvider, {
193
+ return /*#__PURE__*/React.createElement(ApplyTheme, {
194
194
  theme: {
195
- componentOverrides: {
196
- Badge: {
197
- colorPrimary: props.a11yBadgeColor
198
- }
195
+ [Badge.theme]: {
196
+ colorPrimary: props.a11yBadgeColor
199
197
  }
200
198
  }
201
199
  }, /*#__PURE__*/React.createElement(Badge, {
@@ -36,7 +36,7 @@ import { TextInput } from '@instructure/ui-text-input';
36
36
  import { TextArea } from '@instructure/ui-text-area';
37
37
  import { SimpleSelect } from '@instructure/ui-simple-select';
38
38
  import { IconQuestionLine } from '@instructure/ui-icons';
39
- import { InstUISettingsProvider } from '@instructure/emotion';
39
+ import { ApplyTheme } from '@instructure/ui-themeable';
40
40
  import { Alert } from '@instructure/ui-alerts';
41
41
  import ColorField from './color-field';
42
42
  import PlaceholderSVG from './placeholder-svg';
@@ -428,12 +428,10 @@ export default class Checker extends React.Component {
428
428
  onClick: () => this.setState({
429
429
  showWhyPopover: false
430
430
  })
431
- }, formatMessage('Close')), /*#__PURE__*/React.createElement(Text, null, /*#__PURE__*/React.createElement("p", null, rule.why()), /*#__PURE__*/React.createElement("p", null, rule.link && rule.link.length && /*#__PURE__*/React.createElement(InstUISettingsProvider, {
431
+ }, formatMessage('Close')), /*#__PURE__*/React.createElement(Text, null, /*#__PURE__*/React.createElement("p", null, rule.why()), /*#__PURE__*/React.createElement("p", null, rule.link && rule.link.length && /*#__PURE__*/React.createElement(ApplyTheme, {
432
432
  theme: {
433
- componentOverrides: {
434
- Link: {
435
- textDecoration: 'underline'
436
- }
433
+ [Link.theme]: {
434
+ textDecoration: 'underline'
437
435
  }
438
436
  }
439
437
  }, /*#__PURE__*/React.createElement(Link, {
@@ -0,0 +1,127 @@
1
+ /*
2
+ * Copyright (C) 2019 - present Instructure, Inc.
3
+ *
4
+ * This file is part of Canvas.
5
+ *
6
+ * Canvas is free software: you can redistribute it and/or modify it under
7
+ * the terms of the GNU Affero General Public License as published by the Free
8
+ * Software Foundation, version 3 of the License.
9
+ *
10
+ * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
11
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
+ * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
13
+ * details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License along
16
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { darken, lighten, alpha } from '@instructure/ui-color-utils'; // pull canvas theme values we need for the rce skin
19
+
20
+ export default function generator(_ref) {
21
+ let {
22
+ borders,
23
+ colors,
24
+ forms,
25
+ shadows,
26
+ spacing,
27
+ typography
28
+ } = _ref;
29
+ const vars = {
30
+ canvasBackgroundColor: colors.white,
31
+ canvasTextColor: colors.textDarkest,
32
+ canvasErrorColor: colors.textDanger,
33
+ canvasWarningColor: colors.textWarning,
34
+ canvasInfoColor: colors.textInfo,
35
+ canvasSuccessColor: colors.textSuccess,
36
+ canvasBorderColor: colors.borderMedium,
37
+ toolbarButtonHoverBackground: darken(colors.backgroundLightest, 5),
38
+ // copied from INSTUI "light" Button
39
+ canvasBrandColor: colors.brand,
40
+ activeMenuItemBackground: colors.backgroundBrand,
41
+ activeMenuItemLabelColor: colors.textLightest,
42
+ tableSelectorHighlightColor: alpha(lighten(colors.brand, 10), 50),
43
+ canvasLinkColor: colors.link,
44
+ canvasLinkDecoration: 'none',
45
+ // the instui default button
46
+ canvasButtonBackground: colors.backgroundLightest,
47
+ canvasButtonBorderColor: 'transparent',
48
+ canvasButtonColor: colors.textDarkest,
49
+ canvasButtonHoverBackground: colors.backgroundLightest,
50
+ canvasButtonHoverColor: colors.brand,
51
+ canvasButtonActiveBackground: colors.backgroundLightest,
52
+ canvasButtonFontWeight: typography.fontWeightNormal,
53
+ canvasButtonFontSize: typography.fontSizeMedium,
54
+ canvasButtonLineHeight: forms.inputHeightMedium,
55
+ canvasButtonPadding: `0 ${spacing.small}`,
56
+ // the instui primary button
57
+ canvasPrimaryButtonBackground: colors.backgroundBrand,
58
+ canvasPrimaryButtonColor: colors.textLightest,
59
+ canvasPrimaryButtonBorderColor: 'transparent',
60
+ canvasPrimaryButtonHoverBackground: darken(colors.backgroundBrand, 10),
61
+ canvasPrimaryButtonHoverColor: colors.textLightest,
62
+ // the instui secondary button
63
+ canvasSecondaryButtonBackground: colors.backgroundLight,
64
+ canvasSecondaryButtonColor: colors.textDarkest,
65
+ canvasSecondaryButtonBorderColor: darken(colors.backgroundLight, 10),
66
+ canvasSecondaryButtonHoverBackground: darken(colors.backgroundLight, 10),
67
+ canvasSecondaryButtonHoverColor: colors.textDarkest,
68
+ canvasFocusBorderColor: borders.brand,
69
+ canvasFocusBorderWidth: borders.widthSmall,
70
+ // canvas really uses widthMedium
71
+ canvasFocusBoxShadow: `0 0 0 2px ${colors.brand}`,
72
+ canvasEnabledColor: borders.brand,
73
+ canvasEnabledBoxShadow: `inset 0 0 0.1875rem 0.0625rem ${darken(colors.borderLightest, 25)}`,
74
+ canvasFontFamily: typography.fontFamily,
75
+ canvasFontSize: '1rem',
76
+ canvasFontSizeSmall: typography.fontSizeSmall,
77
+ // modal dialogs
78
+ canvasModalShadow: shadows.depth3,
79
+ canvasModalHeadingPadding: spacing.medium,
80
+ canvasModalHeadingFontSize: typography.fontSizeXLarge,
81
+ canvasModalHeadingFontWeight: typography.fontWeightNormal,
82
+ canvasModalBodyPadding: spacing.medium,
83
+ canvasModalFooterPadding: spacing.small,
84
+ canvasModalFooterBackground: colors.backgroundLight,
85
+ canvasFormElementMargin: `0 0 ${spacing.medium} 0`,
86
+ canvasFormElementLabelColor: colors.textDarkest,
87
+ canvasFormElementLabelMargin: `0 0 ${spacing.small} 0`,
88
+ canvasFormElementLabelFontSize: typography.fontSizeMedium,
89
+ canvasFormElementLabelFontWeight: typography.fontWeightBold,
90
+ // a11y button badge
91
+ canvasBadgeBackgroundColor: colors.textInfo
92
+ };
93
+ vars.tinySplitButtonChevronHoverBackground = darken(vars.toolbarButtonHoverBackground, 10);
94
+ return vars;
95
+ }
96
+
97
+ generator.canvas = function (variables) {
98
+ return {
99
+ canvasLinkColor: variables['ic-link-color'],
100
+ canvasLinkDecoration: variables['ic-link-decoration'],
101
+ canvasTextColor: variables['ic-brand-font-color-dark'],
102
+ canvasBrandColor: variables['ic-brand-primary'],
103
+ canvasFocusBorderColor: variables['ic-brand-primary'],
104
+ canvasFocusBoxShadow: `0 0 0 2px ${variables['ic-brand-primary']}`,
105
+ canvasEnabledColor: variables['ic-brand-primary'],
106
+ canvasPrimaryButtonBackground: variables['ic-brand-primary'],
107
+ canvasPrimaryButtonColor: variables['ic-brand-button--primary-text'],
108
+ canvasPrimaryButtonHoverBackground: darken(variables['ic-brand-button--primary-bgd'], 10),
109
+ activeMenuItemBackground: variables['ic-brand-button--primary-bgd'],
110
+ activeMenuItemLabelColor: variables['ic-brand-button--primary-text'],
111
+ tableSelectorHighlightColor: alpha(lighten(variables['ic-brand-primary'], 10), 50)
112
+ };
113
+ };
114
+
115
+ generator['canvas-a11y'] = generator['canvas-high-contrast'] = function (_ref2) {
116
+ let {
117
+ colors
118
+ } = _ref2;
119
+ return {
120
+ canvasButtonBackground: colors.backgroundLight,
121
+ canvasSecondaryButtonBorderColor: colors.borderMedium,
122
+ canvasLinkDecoration: 'underline',
123
+ canvasFocusBorderColor: colors.borderBrand,
124
+ canvasFocusBoxShadow: `0 0 0 2px ${colors.brand}`,
125
+ canvasBrandColor: colors.brand
126
+ };
127
+ };