@instructure/ui-buttons 8.18.0 → 8.18.1-snapshot.12

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.
@@ -82,8 +82,8 @@ const generateComponentTheme = theme => {
82
82
  primaryGhostHoverBackground: (0, _alpha.alpha)(theme['ic-brand-button--primary-bgd'], 10)
83
83
  },
84
84
  'canvas-high-contrast': {
85
- secondaryBorderColor: colors?.borderMedium,
86
- primaryInverseBorderColor: colors?.borderMedium
85
+ secondaryBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderMedium,
86
+ primaryInverseBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderMedium
87
87
  },
88
88
  instructure: {
89
89
  borderRadius: '999em',
@@ -99,29 +99,29 @@ const generateComponentTheme = theme => {
99
99
  const componentVariables = {
100
100
  transform: 'none',
101
101
  hoverTransform: 'none',
102
- fontFamily: typography?.fontFamily,
103
- fontWeight: typography?.fontWeightNormal,
102
+ fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
103
+ fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
104
104
  textTransform: 'none',
105
105
  letterSpacing: 'normal',
106
- borderRadius: borders?.radiusMedium,
107
- borderStyle: borders?.style,
108
- borderWidth: borders?.widthSmall,
109
- smallHeight: forms?.inputHeightSmall,
110
- smallFontSize: typography?.fontSizeSmall,
111
- smallPaddingHorizontal: spacing?.xSmall,
106
+ borderRadius: borders === null || borders === void 0 ? void 0 : borders.radiusMedium,
107
+ borderStyle: borders === null || borders === void 0 ? void 0 : borders.style,
108
+ borderWidth: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
109
+ smallHeight: forms === null || forms === void 0 ? void 0 : forms.inputHeightSmall,
110
+ smallFontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeSmall,
111
+ smallPaddingHorizontal: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
112
112
  smallPaddingTop: '0.375rem',
113
113
  smallPaddingBottom: '0.3125rem',
114
- mediumHeight: forms?.inputHeightMedium,
115
- mediumFontSize: typography?.fontSizeMedium,
116
- mediumPaddingHorizontal: spacing?.small,
114
+ mediumHeight: forms === null || forms === void 0 ? void 0 : forms.inputHeightMedium,
115
+ mediumFontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
116
+ mediumPaddingHorizontal: spacing === null || spacing === void 0 ? void 0 : spacing.small,
117
117
  mediumPaddingTop: '0.5625rem',
118
118
  mediumPaddingBottom: '0.5625rem',
119
- largeHeight: forms?.inputHeightLarge,
120
- largeFontSize: typography?.fontSizeLarge,
121
- largePaddingHorizontal: spacing?.medium,
119
+ largeHeight: forms === null || forms === void 0 ? void 0 : forms.inputHeightLarge,
120
+ largeFontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeLarge,
121
+ largePaddingHorizontal: spacing === null || spacing === void 0 ? void 0 : spacing.medium,
122
122
  largePaddingTop: '0.6875rem',
123
123
  largePaddingBottom: '0.6875rem',
124
- lineHeight: typography?.lineHeightFit,
124
+ lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightFit,
125
125
  iconSizeSmall: '1rem',
126
126
  iconSizeMedium: '1.25rem',
127
127
  iconSizeLarge: '1.625rem',
@@ -129,47 +129,47 @@ const generateComponentTheme = theme => {
129
129
  iconTextGapCondensed: spacing.xxSmall,
130
130
  ...generateButtonThemeVars({
131
131
  style: 'primary',
132
- backgroundColor: colors?.backgroundBrand,
133
- borderColor: colors?.borderBrand,
134
- textColor: colors?.textLightest,
135
- ghostTextColor: colors?.textBrand
132
+ backgroundColor: colors === null || colors === void 0 ? void 0 : colors.backgroundBrand,
133
+ borderColor: colors === null || colors === void 0 ? void 0 : colors.borderBrand,
134
+ textColor: colors === null || colors === void 0 ? void 0 : colors.textLightest,
135
+ ghostTextColor: colors === null || colors === void 0 ? void 0 : colors.textBrand
136
136
  }),
137
137
  ...generateButtonThemeVars({
138
138
  style: 'secondary',
139
- backgroundColor: colors?.backgroundLight,
140
- borderColor: colors?.borderLight,
141
- ghostBorderColor: colors?.borderDarkest,
142
- textColor: colors?.textDarkest,
143
- ghostTextColor: colors?.textDarkest
139
+ backgroundColor: colors === null || colors === void 0 ? void 0 : colors.backgroundLight,
140
+ borderColor: colors === null || colors === void 0 ? void 0 : colors.borderLight,
141
+ ghostBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderDarkest,
142
+ textColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
143
+ ghostTextColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest
144
144
  }),
145
145
  ...generateButtonThemeVars({
146
146
  style: 'success',
147
- backgroundColor: colors?.backgroundSuccess,
148
- borderColor: colors?.borderSuccess,
149
- textColor: colors?.textLightest,
150
- ghostTextColor: colors?.textSuccess
147
+ backgroundColor: colors === null || colors === void 0 ? void 0 : colors.backgroundSuccess,
148
+ borderColor: colors === null || colors === void 0 ? void 0 : colors.borderSuccess,
149
+ textColor: colors === null || colors === void 0 ? void 0 : colors.textLightest,
150
+ ghostTextColor: colors === null || colors === void 0 ? void 0 : colors.textSuccess
151
151
  }),
152
152
  ...generateButtonThemeVars({
153
153
  style: 'danger',
154
- backgroundColor: colors?.backgroundDanger,
155
- borderColor: colors?.borderDanger,
156
- textColor: colors?.textLightest,
157
- ghostTextColor: colors?.textDanger
154
+ backgroundColor: colors === null || colors === void 0 ? void 0 : colors.backgroundDanger,
155
+ borderColor: colors === null || colors === void 0 ? void 0 : colors.borderDanger,
156
+ textColor: colors === null || colors === void 0 ? void 0 : colors.textLightest,
157
+ ghostTextColor: colors === null || colors === void 0 ? void 0 : colors.textDanger
158
158
  }),
159
159
  ...generateButtonThemeVars({
160
160
  style: 'primaryInverse',
161
- backgroundColor: colors?.backgroundLightest,
162
- borderColor: colors?.borderLightest,
163
- textColor: colors?.textDarkest,
164
- ghostTextColor: colors?.textLightest
161
+ backgroundColor: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
162
+ borderColor: colors === null || colors === void 0 ? void 0 : colors.borderLightest,
163
+ textColor: colors === null || colors === void 0 ? void 0 : colors.textDarkest,
164
+ ghostTextColor: colors === null || colors === void 0 ? void 0 : colors.textLightest
165
165
  }),
166
166
  // Overrides for primary-inverse to match what was previously the `light` button variant
167
- primaryInverseBorderColor: (0, _darken.darken)(colors?.borderLight, 10),
168
- primaryInverseHoverBackground: (0, _darken.darken)(colors?.backgroundLightest, 5),
169
- primaryInverseActiveBackground: colors?.backgroundLightest,
170
- primaryInverseActiveBoxShadow: `${activeShadow} ${(0, _darken.darken)(colors?.borderLightest, 25)}`,
167
+ primaryInverseBorderColor: (0, _darken.darken)(colors === null || colors === void 0 ? void 0 : colors.borderLight, 10),
168
+ primaryInverseHoverBackground: (0, _darken.darken)(colors === null || colors === void 0 ? void 0 : colors.backgroundLightest, 5),
169
+ primaryInverseActiveBackground: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
170
+ primaryInverseActiveBoxShadow: `${activeShadow} ${(0, _darken.darken)(colors === null || colors === void 0 ? void 0 : colors.borderLightest, 25)}`,
171
171
  // Overrides for ghost hover states to ensure correct color contrast for a11y
172
- successGhostHoverBackground: (0, _alpha.alpha)(colors?.textSuccess, 1)
172
+ successGhostHoverBackground: (0, _alpha.alpha)(colors === null || colors === void 0 ? void 0 : colors.textSuccess, 1)
173
173
  };
174
174
  return { ...componentVariables,
175
175
  ...themeSpecificStyle[themeName]
@@ -57,11 +57,15 @@ let CloseButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
57
57
  }
58
58
 
59
59
  componentDidMount() {
60
- this.props.makeStyles?.();
60
+ var _this$props$makeStyle, _this$props;
61
+
62
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
61
63
  }
62
64
 
63
65
  componentDidUpdate() {
64
- this.props.makeStyles?.();
66
+ var _this$props$makeStyle2, _this$props2;
67
+
68
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
65
69
  }
66
70
 
67
71
  get interaction() {
@@ -76,23 +80,23 @@ let CloseButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
76
80
  }
77
81
 
78
82
  render() {
79
- const _this$props = this.props,
80
- screenReaderLabel = _this$props.screenReaderLabel,
81
- elementRef = _this$props.elementRef,
82
- size = _this$props.size,
83
- onClick = _this$props.onClick,
84
- margin = _this$props.margin,
85
- placement = _this$props.placement,
86
- offset = _this$props.offset,
87
- type = _this$props.type,
88
- as = _this$props.as,
89
- href = _this$props.href,
90
- cursor = _this$props.cursor,
91
- tabIndex = _this$props.tabIndex,
92
- styles = _this$props.styles,
93
- props = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
83
+ const _this$props3 = this.props,
84
+ screenReaderLabel = _this$props3.screenReaderLabel,
85
+ elementRef = _this$props3.elementRef,
86
+ size = _this$props3.size,
87
+ onClick = _this$props3.onClick,
88
+ margin = _this$props3.margin,
89
+ placement = _this$props3.placement,
90
+ offset = _this$props3.offset,
91
+ type = _this$props3.type,
92
+ as = _this$props3.as,
93
+ href = _this$props3.href,
94
+ cursor = _this$props3.cursor,
95
+ tabIndex = _this$props3.tabIndex,
96
+ styles = _this$props3.styles,
97
+ props = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
94
98
  return (0, _emotion.jsx)("span", Object.assign({}, (0, _passthroughProps.passthroughProps)(props), {
95
- css: styles?.closeButton
99
+ css: styles === null || styles === void 0 ? void 0 : styles.closeButton
96
100
  }), (0, _emotion.jsx)(_BaseButton.BaseButton, {
97
101
  renderIcon: _IconXSolid.IconXSolid,
98
102
  elementRef: this.handleRef,
@@ -38,10 +38,10 @@ const generateComponentTheme = theme => {
38
38
  const spacing = theme.spacing,
39
39
  stacking = theme.stacking;
40
40
  const componentVariables = {
41
- offsetMedium: spacing?.medium,
42
- offsetSmall: spacing?.small,
43
- offsetXSmall: spacing?.xSmall,
44
- zIndex: stacking?.above
41
+ offsetMedium: spacing === null || spacing === void 0 ? void 0 : spacing.medium,
42
+ offsetSmall: spacing === null || spacing === void 0 ? void 0 : spacing.small,
43
+ offsetXSmall: spacing === null || spacing === void 0 ? void 0 : spacing.xSmall,
44
+ zIndex: stacking === null || stacking === void 0 ? void 0 : stacking.above
45
45
  };
46
46
  return { ...componentVariables
47
47
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-buttons",
3
- "version": "8.18.0",
3
+ "version": "8.18.1-snapshot.12+ca14b3dc8",
4
4
  "description": "Accessible button components",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,28 +23,28 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "8.18.0",
27
- "@instructure/ui-test-locator": "8.18.0",
28
- "@instructure/ui-test-queries": "8.18.0",
29
- "@instructure/ui-test-utils": "8.18.0",
30
- "@instructure/ui-themes": "8.18.0"
26
+ "@instructure/ui-babel-preset": "8.18.1-snapshot.12+ca14b3dc8",
27
+ "@instructure/ui-test-locator": "8.18.1-snapshot.12+ca14b3dc8",
28
+ "@instructure/ui-test-queries": "8.18.1-snapshot.12+ca14b3dc8",
29
+ "@instructure/ui-test-utils": "8.18.1-snapshot.12+ca14b3dc8",
30
+ "@instructure/ui-themes": "8.18.1-snapshot.12+ca14b3dc8"
31
31
  },
32
32
  "dependencies": {
33
33
  "@babel/runtime": "^7.13.10",
34
- "@instructure/console": "8.18.0",
35
- "@instructure/emotion": "8.18.0",
36
- "@instructure/shared-types": "8.18.0",
37
- "@instructure/ui-a11y-content": "8.18.0",
38
- "@instructure/ui-a11y-utils": "8.18.0",
39
- "@instructure/ui-color-utils": "8.18.0",
40
- "@instructure/ui-dom-utils": "8.18.0",
41
- "@instructure/ui-icons": "8.18.0",
42
- "@instructure/ui-position": "8.18.0",
43
- "@instructure/ui-react-utils": "8.18.0",
44
- "@instructure/ui-testable": "8.18.0",
45
- "@instructure/ui-tooltip": "8.18.0",
46
- "@instructure/ui-utils": "8.18.0",
47
- "@instructure/ui-view": "8.18.0",
34
+ "@instructure/console": "8.18.1-snapshot.12+ca14b3dc8",
35
+ "@instructure/emotion": "8.18.1-snapshot.12+ca14b3dc8",
36
+ "@instructure/shared-types": "8.18.1-snapshot.12+ca14b3dc8",
37
+ "@instructure/ui-a11y-content": "8.18.1-snapshot.12+ca14b3dc8",
38
+ "@instructure/ui-a11y-utils": "8.18.1-snapshot.12+ca14b3dc8",
39
+ "@instructure/ui-color-utils": "8.18.1-snapshot.12+ca14b3dc8",
40
+ "@instructure/ui-dom-utils": "8.18.1-snapshot.12+ca14b3dc8",
41
+ "@instructure/ui-icons": "8.18.1-snapshot.12+ca14b3dc8",
42
+ "@instructure/ui-position": "8.18.1-snapshot.12+ca14b3dc8",
43
+ "@instructure/ui-react-utils": "8.18.1-snapshot.12+ca14b3dc8",
44
+ "@instructure/ui-testable": "8.18.1-snapshot.12+ca14b3dc8",
45
+ "@instructure/ui-tooltip": "8.18.1-snapshot.12+ca14b3dc8",
46
+ "@instructure/ui-utils": "8.18.1-snapshot.12+ca14b3dc8",
47
+ "@instructure/ui-view": "8.18.1-snapshot.12+ca14b3dc8",
48
48
  "keycode": "^2",
49
49
  "prop-types": "^15"
50
50
  },
@@ -54,5 +54,6 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
- "sideEffects": false
57
+ "sideEffects": false,
58
+ "gitHead": "ca14b3dc8f0315daef7b86aa05f711e6d6684c58"
58
59
  }