@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.
- package/LICENSE.md +27 -0
- package/es/BaseButton/index.js +47 -43
- package/es/BaseButton/theme.js +43 -43
- package/es/CloseButton/index.js +22 -18
- package/es/CloseButton/theme.js +4 -4
- package/lib/BaseButton/index.js +47 -43
- package/lib/BaseButton/theme.js +43 -43
- package/lib/CloseButton/index.js +22 -18
- package/lib/CloseButton/theme.js +4 -4
- package/package.json +22 -21
- package/tsconfig.build.tsbuildinfo +1 -1
package/lib/BaseButton/theme.js
CHANGED
|
@@ -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
|
|
86
|
-
primaryInverseBorderColor: colors
|
|
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
|
|
103
|
-
fontWeight: typography
|
|
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
|
|
107
|
-
borderStyle: borders
|
|
108
|
-
borderWidth: borders
|
|
109
|
-
smallHeight: forms
|
|
110
|
-
smallFontSize: typography
|
|
111
|
-
smallPaddingHorizontal: spacing
|
|
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
|
|
115
|
-
mediumFontSize: typography
|
|
116
|
-
mediumPaddingHorizontal: spacing
|
|
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
|
|
120
|
-
largeFontSize: typography
|
|
121
|
-
largePaddingHorizontal: spacing
|
|
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
|
|
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
|
|
133
|
-
borderColor: colors
|
|
134
|
-
textColor: colors
|
|
135
|
-
ghostTextColor: colors
|
|
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
|
|
140
|
-
borderColor: colors
|
|
141
|
-
ghostBorderColor: colors
|
|
142
|
-
textColor: colors
|
|
143
|
-
ghostTextColor: colors
|
|
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
|
|
148
|
-
borderColor: colors
|
|
149
|
-
textColor: colors
|
|
150
|
-
ghostTextColor: colors
|
|
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
|
|
155
|
-
borderColor: colors
|
|
156
|
-
textColor: colors
|
|
157
|
-
ghostTextColor: colors
|
|
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
|
|
162
|
-
borderColor: colors
|
|
163
|
-
textColor: colors
|
|
164
|
-
ghostTextColor: colors
|
|
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
|
|
168
|
-
primaryInverseHoverBackground: (0, _darken.darken)(colors
|
|
169
|
-
primaryInverseActiveBackground: colors
|
|
170
|
-
primaryInverseActiveBoxShadow: `${activeShadow} ${(0, _darken.darken)(colors
|
|
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
|
|
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]
|
package/lib/CloseButton/index.js
CHANGED
|
@@ -57,11 +57,15 @@ let CloseButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
componentDidMount() {
|
|
60
|
-
|
|
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
|
-
|
|
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$
|
|
80
|
-
screenReaderLabel = _this$
|
|
81
|
-
elementRef = _this$
|
|
82
|
-
size = _this$
|
|
83
|
-
onClick = _this$
|
|
84
|
-
margin = _this$
|
|
85
|
-
placement = _this$
|
|
86
|
-
offset = _this$
|
|
87
|
-
type = _this$
|
|
88
|
-
as = _this$
|
|
89
|
-
href = _this$
|
|
90
|
-
cursor = _this$
|
|
91
|
-
tabIndex = _this$
|
|
92
|
-
styles = _this$
|
|
93
|
-
props = (0, _objectWithoutProperties2.default)(_this$
|
|
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
|
|
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,
|
package/lib/CloseButton/theme.js
CHANGED
|
@@ -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
|
|
42
|
-
offsetSmall: spacing
|
|
43
|
-
offsetXSmall: spacing
|
|
44
|
-
zIndex: stacking
|
|
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.
|
|
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.
|
|
27
|
-
"@instructure/ui-test-locator": "8.18.
|
|
28
|
-
"@instructure/ui-test-queries": "8.18.
|
|
29
|
-
"@instructure/ui-test-utils": "8.18.
|
|
30
|
-
"@instructure/ui-themes": "8.18.
|
|
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.
|
|
35
|
-
"@instructure/emotion": "8.18.
|
|
36
|
-
"@instructure/shared-types": "8.18.
|
|
37
|
-
"@instructure/ui-a11y-content": "8.18.
|
|
38
|
-
"@instructure/ui-a11y-utils": "8.18.
|
|
39
|
-
"@instructure/ui-color-utils": "8.18.
|
|
40
|
-
"@instructure/ui-dom-utils": "8.18.
|
|
41
|
-
"@instructure/ui-icons": "8.18.
|
|
42
|
-
"@instructure/ui-position": "8.18.
|
|
43
|
-
"@instructure/ui-react-utils": "8.18.
|
|
44
|
-
"@instructure/ui-testable": "8.18.
|
|
45
|
-
"@instructure/ui-tooltip": "8.18.
|
|
46
|
-
"@instructure/ui-utils": "8.18.
|
|
47
|
-
"@instructure/ui-view": "8.18.
|
|
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
|
}
|