@zendeskgarden/react-buttons 9.0.0-next.9 → 9.1.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.
@@ -5,35 +5,57 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled, { css } from 'styled-components';
8
- import { retrieveComponentStyles, DEFAULT_THEME, getColorV8 } from '@zendeskgarden/react-theming';
9
- import { StyledButton, getHeight } from './StyledButton.js';
8
+ import { retrieveComponentStyles, getColor } from '@zendeskgarden/react-theming';
9
+ import { StyledButton, COMPONENT_ID as COMPONENT_ID$1, getHeight } from './StyledButton.js';
10
10
  import { StyledIcon } from './StyledIcon.js';
11
11
 
12
12
  const COMPONENT_ID = 'buttons.icon_button';
13
- const iconColorStyles = props => {
14
- const shade = 600;
15
- const baseColor = getColorV8('neutralHue', shade, props.theme);
16
- const hoverColor = getColorV8('neutralHue', shade + 100, props.theme);
17
- const activeColor = getColorV8('neutralHue', shade + 200, props.theme);
13
+ const iconColorStyles = _ref => {
14
+ let {
15
+ theme
16
+ } = _ref;
17
+ const options = {
18
+ theme,
19
+ variable: 'foreground.subtle'
20
+ };
21
+ const baseColor = getColor(options);
22
+ const hoverColor = getColor({
23
+ ...options,
24
+ dark: {
25
+ offset: -100
26
+ },
27
+ light: {
28
+ offset: 100
29
+ }
30
+ });
31
+ const activeColor = getColor({
32
+ ...options,
33
+ dark: {
34
+ offset: -200
35
+ },
36
+ light: {
37
+ offset: 200
38
+ }
39
+ });
18
40
  return css(["color:", ";&:hover{color:", ";}&:active,&[aria-pressed='true'],&[aria-pressed='mixed']{color:", ";}"], baseColor, hoverColor, activeColor);
19
41
  };
20
42
  const iconButtonStyles = props => {
21
43
  const width = getHeight(props);
22
- return css(["border:", ";padding:0;width:", ";min-width:", ";", ";&:disabled{background-color:", ";}"], props.isBasic && 'none', width, width, props.isBasic && !(props.isPrimary || props.isDanger || props.disabled) && iconColorStyles(props), !props.isPrimary && 'transparent');
44
+ return css(["border:", ";padding:0;width:", ";min-width:", ";", ";&:disabled{background-color:", ";}"], props.$isBasic && 'none', width, width, props.$isBasic && !(props.$isPrimary || props.$isDanger || props.disabled) && iconColorStyles(props), !props.$isPrimary && 'transparent');
23
45
  };
24
46
  const iconStyles = props => {
25
47
  const size = props.theme.iconSizes.md;
26
48
  return css(["width:", ";height:", ";& > svg{transition:opacity 0.15s ease-in-out;}"], size, size);
27
49
  };
28
- const StyledIconButton = styled(StyledButton).attrs({
29
- 'data-garden-id': COMPONENT_ID,
30
- 'data-garden-version': '9.0.0-next.9'
50
+ const StyledIconButton = styled(StyledButton).attrs(props => {
51
+ const externalId = props['data-garden-id'];
52
+ return {
53
+ 'data-garden-id': externalId && externalId !== COMPONENT_ID$1 ? externalId : COMPONENT_ID,
54
+ 'data-garden-version': '9.1.0'
55
+ };
31
56
  }).withConfig({
32
57
  displayName: "StyledIconButton",
33
58
  componentId: "sc-1t0ughp-0"
34
- })(["", ";& ", "{", "}", ";"], props => iconButtonStyles(props), StyledIcon, props => iconStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
35
- StyledIconButton.defaultProps = {
36
- theme: DEFAULT_THEME
37
- };
59
+ })(["", ";& ", "{", "}", ";"], iconButtonStyles, StyledIcon, iconStyles, props => retrieveComponentStyles(props['data-garden-id'], props));
38
60
 
39
- export { StyledIconButton };
61
+ export { COMPONENT_ID, StyledIconButton };
@@ -5,18 +5,15 @@
5
5
  * found at http://www.apache.org/licenses/LICENSE-2.0.
6
6
  */
7
7
  import styled from 'styled-components';
8
- import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
8
+ import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
9
9
 
10
10
  const COMPONENT_ID = 'buttons.button_group_view';
11
11
  const StyledSplitButton = styled.div.attrs({
12
12
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.0.0-next.9'
13
+ 'data-garden-version': '9.1.0'
14
14
  }).withConfig({
15
15
  displayName: "StyledSplitButton",
16
16
  componentId: "sc-1u4v04v-0"
17
17
  })(["display:inline-flex;position:relative;z-index:0;direction:", ";white-space:nowrap;", ";"], props => props.theme.rtl && 'rtl', props => retrieveComponentStyles(COMPONENT_ID, props));
18
- StyledSplitButton.defaultProps = {
19
- theme: DEFAULT_THEME
20
- };
21
18
 
22
19
  export { StyledSplitButton };