@zendeskgarden/react-buttons 8.74.2 → 8.75.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.
- package/dist/index.cjs.js +19 -19
- package/dist/index.esm.js +20 -20
- package/dist/typings/styled/StyledAnchor.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -61,7 +61,7 @@ const SIZE = ['small', 'medium', 'large'];
|
|
|
61
61
|
const COMPONENT_ID$5 = 'buttons.button_group_view';
|
|
62
62
|
const StyledButtonGroup = styled__default.default.div.attrs({
|
|
63
63
|
'data-garden-id': COMPONENT_ID$5,
|
|
64
|
-
'data-garden-version': '8.
|
|
64
|
+
'data-garden-version': '8.75.0'
|
|
65
65
|
}).withConfig({
|
|
66
66
|
displayName: "StyledButtonGroup",
|
|
67
67
|
componentId: "sc-1fbpzef-0"
|
|
@@ -90,7 +90,7 @@ const StyledIcon = styled__default.default(_ref => {
|
|
|
90
90
|
return React__namespace.default.cloneElement(React.Children.only(children), props);
|
|
91
91
|
}).attrs({
|
|
92
92
|
'data-garden-id': COMPONENT_ID$4,
|
|
93
|
-
'data-garden-version': '8.
|
|
93
|
+
'data-garden-version': '8.75.0'
|
|
94
94
|
}).withConfig({
|
|
95
95
|
displayName: "StyledIcon",
|
|
96
96
|
componentId: "sc-19meqgg-0"
|
|
@@ -107,7 +107,7 @@ const getBorderRadius = props => {
|
|
|
107
107
|
return props.theme.borderRadii.md;
|
|
108
108
|
};
|
|
109
109
|
const getDisabledBackgroundColor = props => {
|
|
110
|
-
return reactTheming.
|
|
110
|
+
return reactTheming.getColorV8('neutralHue', 200, props.theme);
|
|
111
111
|
};
|
|
112
112
|
const getHeight = props => {
|
|
113
113
|
if (props.size === 'small') {
|
|
@@ -128,12 +128,12 @@ const colorStyles = props => {
|
|
|
128
128
|
hue = 'primaryHue';
|
|
129
129
|
}
|
|
130
130
|
const shade = 600;
|
|
131
|
-
const baseColor = reactTheming.
|
|
132
|
-
const hoverColor = reactTheming.
|
|
133
|
-
const activeColor = reactTheming.
|
|
134
|
-
const focusColor = reactTheming.
|
|
131
|
+
const baseColor = reactTheming.getColorV8(hue, shade, props.theme);
|
|
132
|
+
const hoverColor = reactTheming.getColorV8(hue, shade + 100, props.theme);
|
|
133
|
+
const activeColor = reactTheming.getColorV8(hue, shade + 200, props.theme);
|
|
134
|
+
const focusColor = reactTheming.getColorV8('primaryHue', shade, props.theme);
|
|
135
135
|
const disabledBackgroundColor = getDisabledBackgroundColor(props);
|
|
136
|
-
const disabledForegroundColor = reactTheming.
|
|
136
|
+
const disabledForegroundColor = reactTheming.getColorV8(hue, shade - 200, props.theme);
|
|
137
137
|
if (props.isLink) {
|
|
138
138
|
retVal = styled.css(["outline-color:transparent;background-color:transparent;color:", ";", " &:hover{color:", ";}&:active,&[aria-pressed='true'],&[aria-pressed='mixed']{color:", ";}&:disabled{color:", ";}"], baseColor, reactTheming.focusStyles({
|
|
139
139
|
theme: props.theme,
|
|
@@ -154,8 +154,8 @@ const colorStyles = props => {
|
|
|
154
154
|
} : undefined
|
|
155
155
|
}), activeColor, props.isPrimary && activeColor, disabledBackgroundColor, disabledForegroundColor);
|
|
156
156
|
} else {
|
|
157
|
-
const borderColor = props.isNeutral && !props.isDanger ? reactTheming.
|
|
158
|
-
const foregroundColor = props.isNeutral ? props.theme
|
|
157
|
+
const borderColor = props.isNeutral && !props.isDanger ? reactTheming.getColorV8('neutralHue', 300, props.theme) : baseColor;
|
|
158
|
+
const foregroundColor = props.isNeutral ? reactTheming.getColorV8('foreground', 600 , props.theme) : baseColor;
|
|
159
159
|
const hoverBorderColor = props.isNeutral && !props.isDanger ? baseColor : hoverColor;
|
|
160
160
|
const hoverForegroundColor = props.isNeutral ? foregroundColor : hoverColor;
|
|
161
161
|
retVal = styled.css(["outline-color:transparent;border-color:", ";background-color:transparent;color:", ";&:hover{border-color:", ";background-color:", ";color:", ";}", " &:active,&[aria-pressed='true'],&[aria-pressed='mixed']{border-color:", ";background-color:", ";color:", ";}&:disabled{border-color:transparent;background-color:", ";color:", ";}& ", "{color:", ";}&:hover ", ",&:focus-visible ", ",&[data-garden-focus-visible] ", "{color:", ";}&:active ", "{color:", ";}&:disabled ", "{color:", ";}"], !props.isBasic && borderColor, foregroundColor, !props.isBasic && hoverBorderColor, polished.rgba(baseColor, 0.08), hoverForegroundColor, reactTheming.focusStyles({
|
|
@@ -164,7 +164,7 @@ const colorStyles = props => {
|
|
|
164
164
|
styles: props.isNeutral ? {
|
|
165
165
|
borderColor: baseColor
|
|
166
166
|
} : undefined
|
|
167
|
-
}), !props.isBasic && activeColor, polished.rgba(baseColor, 0.2), !props.isNeutral && activeColor, disabledBackgroundColor, disabledForegroundColor, StyledIcon, props.isNeutral && reactTheming.
|
|
167
|
+
}), !props.isBasic && activeColor, polished.rgba(baseColor, 0.2), !props.isNeutral && activeColor, disabledBackgroundColor, disabledForegroundColor, StyledIcon, props.isNeutral && reactTheming.getColorV8('neutralHue', shade, props.theme), StyledIcon, StyledIcon, StyledIcon, props.isNeutral && reactTheming.getColorV8('neutralHue', shade + 100, props.theme), StyledIcon, props.isNeutral && foregroundColor, StyledIcon, disabledForegroundColor);
|
|
168
168
|
}
|
|
169
169
|
return retVal;
|
|
170
170
|
};
|
|
@@ -189,7 +189,7 @@ const groupStyles = props => {
|
|
|
189
189
|
const iconMarginDisplacement = isPill && '-2px';
|
|
190
190
|
const disabledBackgroundColor = !isPrimary && getDisabledBackgroundColor(props);
|
|
191
191
|
const borderColor = isBasic ? 'transparent' : 'revert';
|
|
192
|
-
const focusColor = reactTheming.
|
|
192
|
+
const focusColor = reactTheming.getColorV8('primaryHue', 600, theme);
|
|
193
193
|
const focusBoxShadow = isBasic && !isSelected && !isPrimary && reactTheming.getFocusBoxShadow({
|
|
194
194
|
theme,
|
|
195
195
|
inset: focusInset,
|
|
@@ -228,7 +228,7 @@ const sizeStyles = props => {
|
|
|
228
228
|
};
|
|
229
229
|
const StyledButton = styled__default.default.button.attrs(props => ({
|
|
230
230
|
'data-garden-id': COMPONENT_ID$3,
|
|
231
|
-
'data-garden-version': '8.
|
|
231
|
+
'data-garden-version': '8.75.0',
|
|
232
232
|
type: props.type || 'button'
|
|
233
233
|
})).withConfig({
|
|
234
234
|
displayName: "StyledButton",
|
|
@@ -241,7 +241,7 @@ StyledButton.defaultProps = {
|
|
|
241
241
|
const COMPONENT_ID$2 = 'buttons.anchor';
|
|
242
242
|
const StyledAnchor = styled__default.default(StyledButton).attrs(props => ({
|
|
243
243
|
'data-garden-id': COMPONENT_ID$2,
|
|
244
|
-
'data-garden-version': '8.
|
|
244
|
+
'data-garden-version': '8.75.0',
|
|
245
245
|
as: 'a',
|
|
246
246
|
dir: props.theme.rtl ? 'rtl' : undefined,
|
|
247
247
|
isLink: true,
|
|
@@ -275,7 +275,7 @@ var SvgNewWindowStroke = function SvgNewWindowStroke(props) {
|
|
|
275
275
|
const COMPONENT_ID$1 = 'buttons.external_icon';
|
|
276
276
|
const StyledExternalIcon = styled__default.default(SvgNewWindowStroke).attrs({
|
|
277
277
|
'data-garden-id': COMPONENT_ID$1,
|
|
278
|
-
'data-garden-version': '8.
|
|
278
|
+
'data-garden-version': '8.75.0'
|
|
279
279
|
}).withConfig({
|
|
280
280
|
displayName: "StyledExternalIcon",
|
|
281
281
|
componentId: "sc-16oz07e-0"
|
|
@@ -287,9 +287,9 @@ StyledExternalIcon.defaultProps = {
|
|
|
287
287
|
const COMPONENT_ID = 'buttons.icon_button';
|
|
288
288
|
const iconColorStyles = props => {
|
|
289
289
|
const shade = 600;
|
|
290
|
-
const baseColor = reactTheming.
|
|
291
|
-
const hoverColor = reactTheming.
|
|
292
|
-
const activeColor = reactTheming.
|
|
290
|
+
const baseColor = reactTheming.getColorV8('neutralHue', shade, props.theme);
|
|
291
|
+
const hoverColor = reactTheming.getColorV8('neutralHue', shade + 100, props.theme);
|
|
292
|
+
const activeColor = reactTheming.getColorV8('neutralHue', shade + 200, props.theme);
|
|
293
293
|
return styled.css(["color:", ";&:hover{color:", ";}&:active,&[aria-pressed='true'],&[aria-pressed='mixed']{color:", ";}"], baseColor, hoverColor, activeColor);
|
|
294
294
|
};
|
|
295
295
|
const iconButtonStyles = props => {
|
|
@@ -302,7 +302,7 @@ const iconStyles = props => {
|
|
|
302
302
|
};
|
|
303
303
|
const StyledIconButton = styled__default.default(StyledButton).attrs({
|
|
304
304
|
'data-garden-id': COMPONENT_ID,
|
|
305
|
-
'data-garden-version': '8.
|
|
305
|
+
'data-garden-version': '8.75.0'
|
|
306
306
|
}).withConfig({
|
|
307
307
|
displayName: "StyledIconButton",
|
|
308
308
|
componentId: "sc-1t0ughp-0"
|
package/dist/index.esm.js
CHANGED
|
@@ -10,7 +10,7 @@ import React__default, { Children, createContext, useContext, forwardRef, useSta
|
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import mergeRefs from 'react-merge-refs';
|
|
12
12
|
import styled, { css, ThemeContext } from 'styled-components';
|
|
13
|
-
import { retrieveComponentStyles, DEFAULT_THEME, SELECTOR_FOCUS_VISIBLE,
|
|
13
|
+
import { retrieveComponentStyles, DEFAULT_THEME, SELECTOR_FOCUS_VISIBLE, getColorV8, focusStyles, getFocusBoxShadow, useText } from '@zendeskgarden/react-theming';
|
|
14
14
|
import { rgba, math, em } from 'polished';
|
|
15
15
|
import { useSelection } from '@zendeskgarden/container-selection';
|
|
16
16
|
import { getControlledValue } from '@zendeskgarden/container-utilities';
|
|
@@ -35,7 +35,7 @@ const SIZE = ['small', 'medium', 'large'];
|
|
|
35
35
|
const COMPONENT_ID$5 = 'buttons.button_group_view';
|
|
36
36
|
const StyledButtonGroup = styled.div.attrs({
|
|
37
37
|
'data-garden-id': COMPONENT_ID$5,
|
|
38
|
-
'data-garden-version': '8.
|
|
38
|
+
'data-garden-version': '8.75.0'
|
|
39
39
|
}).withConfig({
|
|
40
40
|
displayName: "StyledButtonGroup",
|
|
41
41
|
componentId: "sc-1fbpzef-0"
|
|
@@ -64,7 +64,7 @@ const StyledIcon = styled(_ref => {
|
|
|
64
64
|
return React__default.cloneElement(Children.only(children), props);
|
|
65
65
|
}).attrs({
|
|
66
66
|
'data-garden-id': COMPONENT_ID$4,
|
|
67
|
-
'data-garden-version': '8.
|
|
67
|
+
'data-garden-version': '8.75.0'
|
|
68
68
|
}).withConfig({
|
|
69
69
|
displayName: "StyledIcon",
|
|
70
70
|
componentId: "sc-19meqgg-0"
|
|
@@ -81,7 +81,7 @@ const getBorderRadius = props => {
|
|
|
81
81
|
return props.theme.borderRadii.md;
|
|
82
82
|
};
|
|
83
83
|
const getDisabledBackgroundColor = props => {
|
|
84
|
-
return
|
|
84
|
+
return getColorV8('neutralHue', 200, props.theme);
|
|
85
85
|
};
|
|
86
86
|
const getHeight = props => {
|
|
87
87
|
if (props.size === 'small') {
|
|
@@ -102,12 +102,12 @@ const colorStyles = props => {
|
|
|
102
102
|
hue = 'primaryHue';
|
|
103
103
|
}
|
|
104
104
|
const shade = 600;
|
|
105
|
-
const baseColor =
|
|
106
|
-
const hoverColor =
|
|
107
|
-
const activeColor =
|
|
108
|
-
const focusColor =
|
|
105
|
+
const baseColor = getColorV8(hue, shade, props.theme);
|
|
106
|
+
const hoverColor = getColorV8(hue, shade + 100, props.theme);
|
|
107
|
+
const activeColor = getColorV8(hue, shade + 200, props.theme);
|
|
108
|
+
const focusColor = getColorV8('primaryHue', shade, props.theme);
|
|
109
109
|
const disabledBackgroundColor = getDisabledBackgroundColor(props);
|
|
110
|
-
const disabledForegroundColor =
|
|
110
|
+
const disabledForegroundColor = getColorV8(hue, shade - 200, props.theme);
|
|
111
111
|
if (props.isLink) {
|
|
112
112
|
retVal = css(["outline-color:transparent;background-color:transparent;color:", ";", " &:hover{color:", ";}&:active,&[aria-pressed='true'],&[aria-pressed='mixed']{color:", ";}&:disabled{color:", ";}"], baseColor, focusStyles({
|
|
113
113
|
theme: props.theme,
|
|
@@ -128,8 +128,8 @@ const colorStyles = props => {
|
|
|
128
128
|
} : undefined
|
|
129
129
|
}), activeColor, props.isPrimary && activeColor, disabledBackgroundColor, disabledForegroundColor);
|
|
130
130
|
} else {
|
|
131
|
-
const borderColor = props.isNeutral && !props.isDanger ?
|
|
132
|
-
const foregroundColor = props.isNeutral ? props.theme
|
|
131
|
+
const borderColor = props.isNeutral && !props.isDanger ? getColorV8('neutralHue', 300, props.theme) : baseColor;
|
|
132
|
+
const foregroundColor = props.isNeutral ? getColorV8('foreground', 600 , props.theme) : baseColor;
|
|
133
133
|
const hoverBorderColor = props.isNeutral && !props.isDanger ? baseColor : hoverColor;
|
|
134
134
|
const hoverForegroundColor = props.isNeutral ? foregroundColor : hoverColor;
|
|
135
135
|
retVal = css(["outline-color:transparent;border-color:", ";background-color:transparent;color:", ";&:hover{border-color:", ";background-color:", ";color:", ";}", " &:active,&[aria-pressed='true'],&[aria-pressed='mixed']{border-color:", ";background-color:", ";color:", ";}&:disabled{border-color:transparent;background-color:", ";color:", ";}& ", "{color:", ";}&:hover ", ",&:focus-visible ", ",&[data-garden-focus-visible] ", "{color:", ";}&:active ", "{color:", ";}&:disabled ", "{color:", ";}"], !props.isBasic && borderColor, foregroundColor, !props.isBasic && hoverBorderColor, rgba(baseColor, 0.08), hoverForegroundColor, focusStyles({
|
|
@@ -138,7 +138,7 @@ const colorStyles = props => {
|
|
|
138
138
|
styles: props.isNeutral ? {
|
|
139
139
|
borderColor: baseColor
|
|
140
140
|
} : undefined
|
|
141
|
-
}), !props.isBasic && activeColor, rgba(baseColor, 0.2), !props.isNeutral && activeColor, disabledBackgroundColor, disabledForegroundColor, StyledIcon, props.isNeutral &&
|
|
141
|
+
}), !props.isBasic && activeColor, rgba(baseColor, 0.2), !props.isNeutral && activeColor, disabledBackgroundColor, disabledForegroundColor, StyledIcon, props.isNeutral && getColorV8('neutralHue', shade, props.theme), StyledIcon, StyledIcon, StyledIcon, props.isNeutral && getColorV8('neutralHue', shade + 100, props.theme), StyledIcon, props.isNeutral && foregroundColor, StyledIcon, disabledForegroundColor);
|
|
142
142
|
}
|
|
143
143
|
return retVal;
|
|
144
144
|
};
|
|
@@ -163,7 +163,7 @@ const groupStyles = props => {
|
|
|
163
163
|
const iconMarginDisplacement = isPill && '-2px';
|
|
164
164
|
const disabledBackgroundColor = !isPrimary && getDisabledBackgroundColor(props);
|
|
165
165
|
const borderColor = isBasic ? 'transparent' : 'revert';
|
|
166
|
-
const focusColor =
|
|
166
|
+
const focusColor = getColorV8('primaryHue', 600, theme);
|
|
167
167
|
const focusBoxShadow = isBasic && !isSelected && !isPrimary && getFocusBoxShadow({
|
|
168
168
|
theme,
|
|
169
169
|
inset: focusInset,
|
|
@@ -202,7 +202,7 @@ const sizeStyles = props => {
|
|
|
202
202
|
};
|
|
203
203
|
const StyledButton = styled.button.attrs(props => ({
|
|
204
204
|
'data-garden-id': COMPONENT_ID$3,
|
|
205
|
-
'data-garden-version': '8.
|
|
205
|
+
'data-garden-version': '8.75.0',
|
|
206
206
|
type: props.type || 'button'
|
|
207
207
|
})).withConfig({
|
|
208
208
|
displayName: "StyledButton",
|
|
@@ -215,7 +215,7 @@ StyledButton.defaultProps = {
|
|
|
215
215
|
const COMPONENT_ID$2 = 'buttons.anchor';
|
|
216
216
|
const StyledAnchor = styled(StyledButton).attrs(props => ({
|
|
217
217
|
'data-garden-id': COMPONENT_ID$2,
|
|
218
|
-
'data-garden-version': '8.
|
|
218
|
+
'data-garden-version': '8.75.0',
|
|
219
219
|
as: 'a',
|
|
220
220
|
dir: props.theme.rtl ? 'rtl' : undefined,
|
|
221
221
|
isLink: true,
|
|
@@ -249,7 +249,7 @@ var SvgNewWindowStroke = function SvgNewWindowStroke(props) {
|
|
|
249
249
|
const COMPONENT_ID$1 = 'buttons.external_icon';
|
|
250
250
|
const StyledExternalIcon = styled(SvgNewWindowStroke).attrs({
|
|
251
251
|
'data-garden-id': COMPONENT_ID$1,
|
|
252
|
-
'data-garden-version': '8.
|
|
252
|
+
'data-garden-version': '8.75.0'
|
|
253
253
|
}).withConfig({
|
|
254
254
|
displayName: "StyledExternalIcon",
|
|
255
255
|
componentId: "sc-16oz07e-0"
|
|
@@ -261,9 +261,9 @@ StyledExternalIcon.defaultProps = {
|
|
|
261
261
|
const COMPONENT_ID = 'buttons.icon_button';
|
|
262
262
|
const iconColorStyles = props => {
|
|
263
263
|
const shade = 600;
|
|
264
|
-
const baseColor =
|
|
265
|
-
const hoverColor =
|
|
266
|
-
const activeColor =
|
|
264
|
+
const baseColor = getColorV8('neutralHue', shade, props.theme);
|
|
265
|
+
const hoverColor = getColorV8('neutralHue', shade + 100, props.theme);
|
|
266
|
+
const activeColor = getColorV8('neutralHue', shade + 200, props.theme);
|
|
267
267
|
return css(["color:", ";&:hover{color:", ";}&:active,&[aria-pressed='true'],&[aria-pressed='mixed']{color:", ";}"], baseColor, hoverColor, activeColor);
|
|
268
268
|
};
|
|
269
269
|
const iconButtonStyles = props => {
|
|
@@ -276,7 +276,7 @@ const iconStyles = props => {
|
|
|
276
276
|
};
|
|
277
277
|
const StyledIconButton = styled(StyledButton).attrs({
|
|
278
278
|
'data-garden-id': COMPONENT_ID,
|
|
279
|
-
'data-garden-version': '8.
|
|
279
|
+
'data-garden-version': '8.75.0'
|
|
280
280
|
}).withConfig({
|
|
281
281
|
displayName: "StyledIconButton",
|
|
282
282
|
componentId: "sc-1t0ughp-0"
|
|
@@ -14,4 +14,4 @@ export declare const StyledAnchor: import("styled-components").StyledComponent<"
|
|
|
14
14
|
dir: "rtl" | undefined;
|
|
15
15
|
isLink: boolean;
|
|
16
16
|
type: undefined;
|
|
17
|
-
}, "type" | "dir" | "data-garden-id" | "data-garden-version" | "
|
|
17
|
+
}, "type" | "dir" | "as" | "data-garden-id" | "data-garden-version" | "isLink">;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-buttons",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.75.0",
|
|
4
4
|
"description": "Components relating to buttons in the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"styled-components": "^4.2.0 || ^5.0.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@zendeskgarden/react-theming": "^8.
|
|
37
|
+
"@zendeskgarden/react-theming": "^8.75.0",
|
|
38
38
|
"@zendeskgarden/svg-icons": "7.0.0"
|
|
39
39
|
},
|
|
40
40
|
"keywords": [
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"zendeskgarden:src": "src/index.ts",
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "56a54793a611efc223b8e36262d428365613c853"
|
|
51
51
|
}
|