@zendeskgarden/react-tags 9.11.1 → 9.11.3

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.
@@ -18,7 +18,7 @@ const TagComponent = forwardRef((_ref, ref) => {
18
18
  isPill,
19
19
  isRound,
20
20
  isRegular,
21
- size,
21
+ size = 'medium',
22
22
  hue,
23
23
  ...other
24
24
  } = _ref;
@@ -39,9 +39,6 @@ TagComponent.propTypes = {
39
39
  isRound: PropTypes.bool,
40
40
  isRegular: PropTypes.bool
41
41
  };
42
- TagComponent.defaultProps = {
43
- size: 'medium'
44
- };
45
42
  const Tag = TagComponent;
46
43
  Tag.Avatar = Avatar;
47
44
  Tag.Close = Close;
@@ -10,7 +10,7 @@ import { StyledBaseIcon, componentStyles } from '@zendeskgarden/react-theming';
10
10
  const COMPONENT_ID = 'tags.avatar';
11
11
  const StyledAvatar = styled(StyledBaseIcon).attrs({
12
12
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.11.1'
13
+ 'data-garden-version': '9.11.3'
14
14
  }).withConfig({
15
15
  displayName: "StyledAvatar",
16
16
  componentId: "sc-3kdmgt-0"
@@ -10,7 +10,7 @@ import { componentStyles } from '@zendeskgarden/react-theming';
10
10
  const COMPONENT_ID = 'tags.close';
11
11
  const StyledClose = styled.button.attrs({
12
12
  'data-garden-id': COMPONENT_ID,
13
- 'data-garden-version': '9.11.1'
13
+ 'data-garden-version': '9.11.3'
14
14
  }).withConfig({
15
15
  displayName: "StyledClose",
16
16
  componentId: "sc-d6lrpn-0"
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import styled, { css } from 'styled-components';
8
8
  import { readableColor, math } from 'polished';
9
- import { SELECTOR_FOCUS_VISIBLE, componentStyles, DEFAULT_THEME, getColor, focusStyles, getLineHeight } from '@zendeskgarden/react-theming';
9
+ import { SELECTOR_FOCUS_VISIBLE, componentStyles, getColor, focusStyles, getLineHeight } from '@zendeskgarden/react-theming';
10
10
  import { StyledAvatar } from './StyledAvatar.js';
11
11
  import { StyledClose } from './StyledClose.js';
12
12
 
@@ -189,16 +189,13 @@ const sizeStyles = _ref2 => {
189
189
  }
190
190
  return css(["border-radius:", ";padding:0 ", "px;min-width:", ";height:", "px;line-height:", ";font-size:", ";& > *{width:100%;min-width:", ";}& ", "{margin-", ":-", "px;margin-", ":", "px;border-radius:", ";width:", "px;min-width:", "px;height:", "px;}& ", "{margin-", ":-", "px;border-radius:", ";width:", "px;height:", "px;}"], borderRadius, padding, minWidth ? `${minWidth}px` : `calc(${padding * 2}px + 1ch)`, height, getLineHeight(height, fontSize), fontSize, minWidth ? `${minWidth - padding * 2}px` : '1ch', StyledAvatar, theme.rtl ? 'right' : 'left', padding - avatarMargin, theme.rtl ? 'left' : 'right', avatarTextMargin, avatarBorderRadius, avatarSize, avatarSize, avatarSize, StyledClose, theme.rtl ? 'left' : 'right', padding, borderRadius, height, height);
191
191
  };
192
- const StyledTag = styled.div.attrs({
192
+ const StyledTag = styled.div.attrs(props => ({
193
193
  'data-garden-id': COMPONENT_ID,
194
- 'data-garden-version': '9.11.1'
195
- }).withConfig({
194
+ 'data-garden-version': '9.11.3',
195
+ $size: props.$size ?? 'medium'
196
+ })).withConfig({
196
197
  displayName: "StyledTag",
197
198
  componentId: "sc-1jvbe03-0"
198
199
  })(["display:inline-flex;flex-wrap:nowrap;align-items:center;justify-content:", ";transition:box-shadow 0.1s ease-in-out;box-sizing:border-box;border:0;max-width:100%;overflow:hidden;vertical-align:middle;text-decoration:none;white-space:nowrap;font-weight:", ";direction:", ";", ";&:hover{cursor:default;text-decoration:none;}&:link:hover,&:visited:hover{cursor:pointer;}&:any-link:hover{cursor:pointer;}", "{text-decoration:none;}", ";& > *{overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap;}& b{font-weight:", ";}& ", "{display:", ";}& ", "{display:", ";}", ";"], props => props.$isRound && 'center', props => !props.$isRegular && props.theme.fontWeights.semibold, props => props.theme.rtl ? 'rtl' : 'ltr', props => sizeStyles(props), SELECTOR_FOCUS_VISIBLE, props => colorStyles(props), props => props.theme.fontWeights.semibold, StyledAvatar, props => (props.$isRound || props.$size === 'small') && 'none', StyledClose, props => props.$isRound && 'none', componentStyles);
199
- StyledTag.defaultProps = {
200
- $size: 'medium',
201
- theme: DEFAULT_THEME
202
- };
203
200
 
204
201
  export { StyledTag };
package/dist/index.cjs.js CHANGED
@@ -41,7 +41,7 @@ const SIZE = ['small', 'medium', 'large'];
41
41
  const COMPONENT_ID$2 = 'tags.avatar';
42
42
  const StyledAvatar = styled__default.default(reactTheming.StyledBaseIcon).attrs({
43
43
  'data-garden-id': COMPONENT_ID$2,
44
- 'data-garden-version': '9.11.1'
44
+ 'data-garden-version': '9.11.3'
45
45
  }).withConfig({
46
46
  displayName: "StyledAvatar",
47
47
  componentId: "sc-3kdmgt-0"
@@ -50,7 +50,7 @@ const StyledAvatar = styled__default.default(reactTheming.StyledBaseIcon).attrs(
50
50
  const COMPONENT_ID$1 = 'tags.close';
51
51
  const StyledClose = styled__default.default.button.attrs({
52
52
  'data-garden-id': COMPONENT_ID$1,
53
- 'data-garden-version': '9.11.1'
53
+ 'data-garden-version': '9.11.3'
54
54
  }).withConfig({
55
55
  displayName: "StyledClose",
56
56
  componentId: "sc-d6lrpn-0"
@@ -235,17 +235,14 @@ const sizeStyles = _ref2 => {
235
235
  }
236
236
  return styled.css(["border-radius:", ";padding:0 ", "px;min-width:", ";height:", "px;line-height:", ";font-size:", ";& > *{width:100%;min-width:", ";}& ", "{margin-", ":-", "px;margin-", ":", "px;border-radius:", ";width:", "px;min-width:", "px;height:", "px;}& ", "{margin-", ":-", "px;border-radius:", ";width:", "px;height:", "px;}"], borderRadius, padding, minWidth ? `${minWidth}px` : `calc(${padding * 2}px + 1ch)`, height, reactTheming.getLineHeight(height, fontSize), fontSize, minWidth ? `${minWidth - padding * 2}px` : '1ch', StyledAvatar, theme.rtl ? 'right' : 'left', padding - avatarMargin, theme.rtl ? 'left' : 'right', avatarTextMargin, avatarBorderRadius, avatarSize, avatarSize, avatarSize, StyledClose, theme.rtl ? 'left' : 'right', padding, borderRadius, height, height);
237
237
  };
238
- const StyledTag = styled__default.default.div.attrs({
238
+ const StyledTag = styled__default.default.div.attrs(props => ({
239
239
  'data-garden-id': COMPONENT_ID,
240
- 'data-garden-version': '9.11.1'
241
- }).withConfig({
240
+ 'data-garden-version': '9.11.3',
241
+ $size: props.$size ?? 'medium'
242
+ })).withConfig({
242
243
  displayName: "StyledTag",
243
244
  componentId: "sc-1jvbe03-0"
244
245
  })(["display:inline-flex;flex-wrap:nowrap;align-items:center;justify-content:", ";transition:box-shadow 0.1s ease-in-out;box-sizing:border-box;border:0;max-width:100%;overflow:hidden;vertical-align:middle;text-decoration:none;white-space:nowrap;font-weight:", ";direction:", ";", ";&:hover{cursor:default;text-decoration:none;}&:link:hover,&:visited:hover{cursor:pointer;}&:any-link:hover{cursor:pointer;}", "{text-decoration:none;}", ";& > *{overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap;}& b{font-weight:", ";}& ", "{display:", ";}& ", "{display:", ";}", ";"], props => props.$isRound && 'center', props => !props.$isRegular && props.theme.fontWeights.semibold, props => props.theme.rtl ? 'rtl' : 'ltr', props => sizeStyles(props), reactTheming.SELECTOR_FOCUS_VISIBLE, props => colorStyles(props), props => props.theme.fontWeights.semibold, StyledAvatar, props => (props.$isRound || props.$size === 'small') && 'none', StyledClose, props => props.$isRound && 'none', reactTheming.componentStyles);
245
- StyledTag.defaultProps = {
246
- $size: 'medium',
247
- theme: reactTheming.DEFAULT_THEME
248
- };
249
246
 
250
247
  var _path;
251
248
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
@@ -286,7 +283,7 @@ const TagComponent = React.forwardRef((_ref, ref) => {
286
283
  isPill,
287
284
  isRound,
288
285
  isRegular,
289
- size,
286
+ size = 'medium',
290
287
  hue,
291
288
  ...other
292
289
  } = _ref;
@@ -307,9 +304,6 @@ TagComponent.propTypes = {
307
304
  isRound: PropTypes__default.default.bool,
308
305
  isRegular: PropTypes__default.default.bool
309
306
  };
310
- TagComponent.defaultProps = {
311
- size: 'medium'
312
- };
313
307
  const Tag = TagComponent;
314
308
  Tag.Avatar = Avatar;
315
309
  Tag.Close = Close;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zendeskgarden/react-tags",
3
- "version": "9.11.1",
3
+ "version": "9.11.3",
4
4
  "description": "Components relating to tags in the Garden Design System",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Zendesk Garden <garden@zendesk.com>",
@@ -32,7 +32,7 @@
32
32
  "styled-components": "^5.3.1 || ^6.0.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@zendeskgarden/react-theming": "^9.11.1",
35
+ "@zendeskgarden/react-theming": "^9.11.3",
36
36
  "@zendeskgarden/svg-icons": "7.5.0"
37
37
  },
38
38
  "keywords": [
@@ -45,5 +45,5 @@
45
45
  "access": "public"
46
46
  },
47
47
  "zendeskgarden:src": "src/index.ts",
48
- "gitHead": "c45a8893e0ed1fd9f1cf257b2badf6bbeae90bc0"
48
+ "gitHead": "3f20a4270555169d6fc00ecd93e85346a5ee50f5"
49
49
  }