@primer/components 0.0.0-2021927182528 → 0.0.0-202192718387

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.
@@ -25,6 +25,8 @@ var _TextInputWrapper = _interopRequireDefault(require("./_TextInputWrapper"));
25
25
 
26
26
  var _Box = _interopRequireDefault(require("./Box"));
27
27
 
28
+ var _iterateFocusableElements = require("./utils/iterateFocusableElements");
29
+
28
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
31
 
30
32
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -98,14 +100,25 @@ function TextInputWithTokensInnerComponent({
98
100
  }, [selectedTokenIndex]);
99
101
 
100
102
  const handleTokenRemove = tokenId => {
101
- onTokenRemove(tokenId);
103
+ onTokenRemove(tokenId); // HACK: wait a tick for the the token node to be removed from the DOM
102
104
 
103
- if (selectedTokenIndex) {
104
- var _containerRef$current2;
105
+ setTimeout(() => {
106
+ var _containerRef$current2, _containerRef$current3;
105
107
 
106
- const nextElementToFocus = (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.children[selectedTokenIndex];
107
- nextElementToFocus.focus();
108
- }
108
+ const nextElementToFocus = (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.children[selectedTokenIndex || 0]; // when removing the first token by keying "Backspace" or "Delete",
109
+ // `nextFocusableElement` is the div that wraps the input
110
+
111
+ const firstFocusable = nextElementToFocus && (0, _iterateFocusableElements.isFocusable)(nextElementToFocus) ? nextElementToFocus : Array.from(((_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.children) || []).find(el => (0, _iterateFocusableElements.isFocusable)(el));
112
+
113
+ if (firstFocusable) {
114
+ firstFocusable.focus();
115
+ } else {
116
+ var _ref$current;
117
+
118
+ // if there are no tokens left, focus the input
119
+ (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
120
+ }
121
+ }, 0);
109
122
  };
110
123
 
111
124
  const handleTokenFocus = tokenIndex => () => {
@@ -118,9 +131,9 @@ function TextInputWithTokensInnerComponent({
118
131
 
119
132
  const handleTokenKeyUp = e => {
120
133
  if (e.key === 'Escape') {
121
- var _ref$current;
134
+ var _ref$current2;
122
135
 
123
- (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
136
+ (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.focus();
124
137
  }
125
138
  };
126
139
 
@@ -130,13 +143,13 @@ function TextInputWithTokensInnerComponent({
130
143
  };
131
144
 
132
145
  const handleInputKeyDown = e => {
133
- var _ref$current2;
146
+ var _ref$current3;
134
147
 
135
148
  if (onKeyDown) {
136
149
  onKeyDown(e);
137
150
  }
138
151
 
139
- if ((_ref$current2 = ref.current) !== null && _ref$current2 !== void 0 && _ref$current2.value) {
152
+ if ((_ref$current3 = ref.current) !== null && _ref$current3 !== void 0 && _ref$current3.value) {
140
153
  return;
141
154
  }
142
155
 
@@ -157,9 +170,9 @@ function TextInputWithTokensInnerComponent({
157
170
 
158
171
 
159
172
  setTimeout(() => {
160
- var _ref$current3;
173
+ var _ref$current4;
161
174
 
162
- (_ref$current3 = ref.current) === null || _ref$current3 === void 0 ? void 0 : _ref$current3.select();
175
+ (_ref$current4 = ref.current) === null || _ref$current4 === void 0 ? void 0 : _ref$current4.select();
163
176
  }, 0);
164
177
  }
165
178
  };
@@ -175,7 +188,15 @@ function TextInputWithTokensInnerComponent({
175
188
  minWidth: minWidthProp,
176
189
  maxWidth: maxWidthProp,
177
190
  variant: variantProp,
178
- sx: { ...(block ? {
191
+ ref: containerRef,
192
+ sx: {
193
+ alignItems: 'center',
194
+ flexWrap: preventTokenWrapping ? 'nowrap' : 'wrap',
195
+ gap: '0.25rem',
196
+ '> *': {
197
+ flexShrink: 0
198
+ },
199
+ ...(block ? {
179
200
  display: 'flex',
180
201
  width: '100%'
181
202
  } : {}),
@@ -188,21 +209,6 @@ function TextInputWithTokensInnerComponent({
188
209
  } : {}),
189
210
  ...sxProp
190
211
  }
191
- }, /*#__PURE__*/_react.default.createElement(_Box.default, {
192
- ref: containerRef,
193
- display: "flex",
194
- sx: {
195
- alignItems: 'center',
196
- flexWrap: preventTokenWrapping ? 'nowrap' : 'wrap',
197
- marginLeft: '-0.25rem',
198
- marginBottom: '-0.25rem',
199
- flexGrow: 1,
200
- '> *': {
201
- flexShrink: 0,
202
- marginLeft: '0.25rem',
203
- marginBottom: '0.25rem'
204
- }
205
- }
206
212
  }, /*#__PURE__*/_react.default.createElement(_Box.default, {
207
213
  sx: {
208
214
  order: 1,
@@ -234,7 +240,7 @@ function TextInputWithTokensInnerComponent({
234
240
  hideRemoveButton: hideTokenRemoveButtons,
235
241
  size: size,
236
242
  tabIndex: 0
237
- }, tokenRest))) : null));
243
+ }, tokenRest))) : null);
238
244
  }
239
245
 
240
246
  TextInputWithTokensInnerComponent.displayName = "TextInputWithTokensInnerComponent";
@@ -39,16 +39,7 @@ const DefaultTokenStyled = (0, _styledComponents.default)(_TokenBase.default).wi
39
39
  const LeadingVisualContainer = (0, _styledComponents.default)('span').withConfig({
40
40
  displayName: "Token__LeadingVisualContainer",
41
41
  componentId: "sc-1dg52pw-1"
42
- })(["flex-shrink:0;line-height:0;", ""], props => {
43
- switch (props.size) {
44
- case 'large':
45
- case 'extralarge':
46
- return (0, _styledComponents.css)(["margin-right:", ";"], (0, _constants.get)('space.2'));
47
-
48
- default:
49
- return (0, _styledComponents.css)(["margin-right:", ";"], (0, _constants.get)('space.1'));
50
- }
51
- });
42
+ })(["flex-shrink:0;line-height:0;"]);
52
43
  const Token = /*#__PURE__*/(0, _react.forwardRef)((props, forwardedRef) => {
53
44
  const {
54
45
  as,
@@ -83,9 +74,7 @@ const Token = /*#__PURE__*/(0, _react.forwardRef)((props, forwardedRef) => {
83
74
  isTokenInteractive: (0, _TokenBase.isTokenInteractive)(props)
84
75
  }, !hasMultipleActionTargets ? interactiveTokenProps : {}, rest, {
85
76
  ref: forwardedRef
86
- }), LeadingVisual ? /*#__PURE__*/_react.default.createElement(LeadingVisualContainer, {
87
- size: size
88
- }, /*#__PURE__*/_react.default.createElement(LeadingVisual, null)) : null, /*#__PURE__*/_react.default.createElement(_TokenTextContainer.default, hasMultipleActionTargets ? interactiveTokenProps : {}, text), !hideRemoveButton && onRemove ? /*#__PURE__*/_react.default.createElement(_RemoveTokenButton.default, {
77
+ }), LeadingVisual ? /*#__PURE__*/_react.default.createElement(LeadingVisualContainer, null, /*#__PURE__*/_react.default.createElement(LeadingVisual, null)) : null, /*#__PURE__*/_react.default.createElement(_TokenTextContainer.default, hasMultipleActionTargets ? interactiveTokenProps : {}, text), !hideRemoveButton && onRemove ? /*#__PURE__*/_react.default.createElement(_RemoveTokenButton.default, {
89
78
  borderOffset: tokenBorderWidthPx,
90
79
  onClick: onRemoveClick,
91
80
  size: size,
@@ -38,6 +38,7 @@ const variants = (0, _styledSystem.variant)({
38
38
  variants: {
39
39
  small: {
40
40
  fontSize: 0,
41
+ gap: 1,
41
42
  height: tokenSizes.small,
42
43
  // without setting lineHeight to match height, the "x" appears vertically mis-aligned
43
44
  lineHeight: tokenSizes.small,
@@ -50,6 +51,7 @@ const variants = (0, _styledSystem.variant)({
50
51
  },
51
52
  medium: {
52
53
  fontSize: 0,
54
+ gap: 1,
53
55
  height: tokenSizes.medium,
54
56
  lineHeight: tokenSizes.medium,
55
57
  paddingLeft: 2,
@@ -59,6 +61,7 @@ const variants = (0, _styledSystem.variant)({
59
61
  },
60
62
  large: {
61
63
  fontSize: 0,
64
+ gap: 2,
62
65
  height: tokenSizes.large,
63
66
  lineHeight: tokenSizes.large,
64
67
  paddingLeft: 2,
@@ -68,6 +71,7 @@ const variants = (0, _styledSystem.variant)({
68
71
  },
69
72
  extralarge: {
70
73
  fontSize: 1,
74
+ gap: 2,
71
75
  height: tokenSizes.extralarge,
72
76
  lineHeight: tokenSizes.extralarge,
73
77
  paddingLeft: 3,
@@ -9,7 +9,7 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _octiconsReact = require("@primer/octicons-react");
11
11
 
12
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
12
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
13
13
 
14
14
  var _styledSystem = require("styled-system");
15
15
 
@@ -19,10 +19,6 @@ var _sx = _interopRequireDefault(require("../sx"));
19
19
 
20
20
  var _TokenBase = require("./TokenBase");
21
21
 
22
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
-
24
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
-
26
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
23
 
28
24
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -54,16 +50,7 @@ const getTokenButtonIconSize = size => parseInt(_TokenBase.tokenSizes[size || _T
54
50
  const StyledTokenButton = _styledComponents.default.span.withConfig({
55
51
  displayName: "_RemoveTokenButton__StyledTokenButton",
56
52
  componentId: "sc-14lvcw1-0"
57
- })(["background-color:transparent;font-family:inherit;color:currentColor;cursor:pointer;display:inline-flex;justify-content:center;align-items:center;user-select:none;appearance:none;text-decoration:none;padding:0;transform:", ";align-self:baseline;border:0;border-radius:999px;", " &:hover,&:focus{background-color:", ";}&:active{background-color:", ";}", " ", ""], props => `translate(${props.borderOffset}px, -${props.borderOffset}px)`, props => {
58
- switch (props.size) {
59
- case 'large':
60
- case 'extralarge':
61
- return (0, _styledComponents.css)(["margin-left:", ";"], (0, _constants.get)('space.2'));
62
-
63
- default:
64
- return (0, _styledComponents.css)(["margin-left:", ";"], (0, _constants.get)('space.1'));
65
- }
66
- }, (0, _constants.get)('colors.neutral.muted'), (0, _constants.get)('colors.neutral.subtle'), variants, _sx.default);
53
+ })(["background-color:transparent;font-family:inherit;color:currentColor;cursor:pointer;display:inline-flex;justify-content:center;align-items:center;user-select:none;appearance:none;text-decoration:none;padding:0;transform:", ";align-self:baseline;border:0;border-radius:999px;&:hover,&:focus{background-color:", ";}&:active{background-color:", ";}", " ", ""], props => `translate(${props.borderOffset}px, -${props.borderOffset}px)`, (0, _constants.get)('colors.neutral.muted'), (0, _constants.get)('colors.neutral.subtle'), variants, _sx.default);
67
54
 
68
55
  const RemoveTokenButton = ({
69
56
  'aria-label': ariaLabel,
@@ -9,7 +9,8 @@ import Token from './Token/Token';
9
9
  import { useProvidedRefOrCreate } from './hooks';
10
10
  import UnstyledTextInput from './_UnstyledTextInput';
11
11
  import TextInputWrapper from './_TextInputWrapper';
12
- import Box from './Box'; // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
+ import Box from './Box';
13
+ import { isFocusable } from './utils/iterateFocusableElements'; // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
14
 
14
15
  // using forwardRef is important so that other components (ex. Autocomplete) can use the ref
15
16
  function TextInputWithTokensInnerComponent({
@@ -76,14 +77,25 @@ function TextInputWithTokensInnerComponent({
76
77
  }, [selectedTokenIndex]);
77
78
 
78
79
  const handleTokenRemove = tokenId => {
79
- onTokenRemove(tokenId);
80
+ onTokenRemove(tokenId); // HACK: wait a tick for the the token node to be removed from the DOM
80
81
 
81
- if (selectedTokenIndex) {
82
- var _containerRef$current2;
82
+ setTimeout(() => {
83
+ var _containerRef$current2, _containerRef$current3;
83
84
 
84
- const nextElementToFocus = (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.children[selectedTokenIndex];
85
- nextElementToFocus.focus();
86
- }
85
+ const nextElementToFocus = (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.children[selectedTokenIndex || 0]; // when removing the first token by keying "Backspace" or "Delete",
86
+ // `nextFocusableElement` is the div that wraps the input
87
+
88
+ const firstFocusable = nextElementToFocus && isFocusable(nextElementToFocus) ? nextElementToFocus : Array.from(((_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.children) || []).find(el => isFocusable(el));
89
+
90
+ if (firstFocusable) {
91
+ firstFocusable.focus();
92
+ } else {
93
+ var _ref$current;
94
+
95
+ // if there are no tokens left, focus the input
96
+ (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
97
+ }
98
+ }, 0);
87
99
  };
88
100
 
89
101
  const handleTokenFocus = tokenIndex => () => {
@@ -96,9 +108,9 @@ function TextInputWithTokensInnerComponent({
96
108
 
97
109
  const handleTokenKeyUp = e => {
98
110
  if (e.key === 'Escape') {
99
- var _ref$current;
111
+ var _ref$current2;
100
112
 
101
- (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
113
+ (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.focus();
102
114
  }
103
115
  };
104
116
 
@@ -108,13 +120,13 @@ function TextInputWithTokensInnerComponent({
108
120
  };
109
121
 
110
122
  const handleInputKeyDown = e => {
111
- var _ref$current2;
123
+ var _ref$current3;
112
124
 
113
125
  if (onKeyDown) {
114
126
  onKeyDown(e);
115
127
  }
116
128
 
117
- if ((_ref$current2 = ref.current) !== null && _ref$current2 !== void 0 && _ref$current2.value) {
129
+ if ((_ref$current3 = ref.current) !== null && _ref$current3 !== void 0 && _ref$current3.value) {
118
130
  return;
119
131
  }
120
132
 
@@ -135,9 +147,9 @@ function TextInputWithTokensInnerComponent({
135
147
 
136
148
 
137
149
  setTimeout(() => {
138
- var _ref$current3;
150
+ var _ref$current4;
139
151
 
140
- (_ref$current3 = ref.current) === null || _ref$current3 === void 0 ? void 0 : _ref$current3.select();
152
+ (_ref$current4 = ref.current) === null || _ref$current4 === void 0 ? void 0 : _ref$current4.select();
141
153
  }, 0);
142
154
  }
143
155
  };
@@ -153,7 +165,15 @@ function TextInputWithTokensInnerComponent({
153
165
  minWidth: minWidthProp,
154
166
  maxWidth: maxWidthProp,
155
167
  variant: variantProp,
156
- sx: { ...(block ? {
168
+ ref: containerRef,
169
+ sx: {
170
+ alignItems: 'center',
171
+ flexWrap: preventTokenWrapping ? 'nowrap' : 'wrap',
172
+ gap: '0.25rem',
173
+ '> *': {
174
+ flexShrink: 0
175
+ },
176
+ ...(block ? {
157
177
  display: 'flex',
158
178
  width: '100%'
159
179
  } : {}),
@@ -166,21 +186,6 @@ function TextInputWithTokensInnerComponent({
166
186
  } : {}),
167
187
  ...sxProp
168
188
  }
169
- }, /*#__PURE__*/React.createElement(Box, {
170
- ref: containerRef,
171
- display: "flex",
172
- sx: {
173
- alignItems: 'center',
174
- flexWrap: preventTokenWrapping ? 'nowrap' : 'wrap',
175
- marginLeft: '-0.25rem',
176
- marginBottom: '-0.25rem',
177
- flexGrow: 1,
178
- '> *': {
179
- flexShrink: 0,
180
- marginLeft: '0.25rem',
181
- marginBottom: '0.25rem'
182
- }
183
- }
184
189
  }, /*#__PURE__*/React.createElement(Box, {
185
190
  sx: {
186
191
  order: 1,
@@ -212,7 +217,7 @@ function TextInputWithTokensInnerComponent({
212
217
  hideRemoveButton: hideTokenRemoveButtons,
213
218
  size: size,
214
219
  tabIndex: 0
215
- }, tokenRest))) : null));
220
+ }, tokenRest))) : null);
216
221
  }
217
222
 
218
223
  TextInputWithTokensInnerComponent.displayName = "TextInputWithTokensInnerComponent";
@@ -19,16 +19,7 @@ const DefaultTokenStyled = styled(TokenBase).withConfig({
19
19
  const LeadingVisualContainer = styled('span').withConfig({
20
20
  displayName: "Token__LeadingVisualContainer",
21
21
  componentId: "sc-1dg52pw-1"
22
- })(["flex-shrink:0;line-height:0;", ""], props => {
23
- switch (props.size) {
24
- case 'large':
25
- case 'extralarge':
26
- return css(["margin-right:", ";"], get('space.2'));
27
-
28
- default:
29
- return css(["margin-right:", ";"], get('space.1'));
30
- }
31
- });
22
+ })(["flex-shrink:0;line-height:0;"]);
32
23
  const Token = /*#__PURE__*/forwardRef((props, forwardedRef) => {
33
24
  const {
34
25
  as,
@@ -63,9 +54,7 @@ const Token = /*#__PURE__*/forwardRef((props, forwardedRef) => {
63
54
  isTokenInteractive: isTokenInteractive(props)
64
55
  }, !hasMultipleActionTargets ? interactiveTokenProps : {}, rest, {
65
56
  ref: forwardedRef
66
- }), LeadingVisual ? /*#__PURE__*/React.createElement(LeadingVisualContainer, {
67
- size: size
68
- }, /*#__PURE__*/React.createElement(LeadingVisual, null)) : null, /*#__PURE__*/React.createElement(TokenTextContainer, hasMultipleActionTargets ? interactiveTokenProps : {}, text), !hideRemoveButton && onRemove ? /*#__PURE__*/React.createElement(RemoveTokenButton, {
57
+ }), LeadingVisual ? /*#__PURE__*/React.createElement(LeadingVisualContainer, null, /*#__PURE__*/React.createElement(LeadingVisual, null)) : null, /*#__PURE__*/React.createElement(TokenTextContainer, hasMultipleActionTargets ? interactiveTokenProps : {}, text), !hideRemoveButton && onRemove ? /*#__PURE__*/React.createElement(RemoveTokenButton, {
69
58
  borderOffset: tokenBorderWidthPx,
70
59
  onClick: onRemoveClick,
71
60
  size: size,
@@ -20,6 +20,7 @@ const variants = variant({
20
20
  variants: {
21
21
  small: {
22
22
  fontSize: 0,
23
+ gap: 1,
23
24
  height: tokenSizes.small,
24
25
  // without setting lineHeight to match height, the "x" appears vertically mis-aligned
25
26
  lineHeight: tokenSizes.small,
@@ -32,6 +33,7 @@ const variants = variant({
32
33
  },
33
34
  medium: {
34
35
  fontSize: 0,
36
+ gap: 1,
35
37
  height: tokenSizes.medium,
36
38
  lineHeight: tokenSizes.medium,
37
39
  paddingLeft: 2,
@@ -41,6 +43,7 @@ const variants = variant({
41
43
  },
42
44
  large: {
43
45
  fontSize: 0,
46
+ gap: 2,
44
47
  height: tokenSizes.large,
45
48
  lineHeight: tokenSizes.large,
46
49
  paddingLeft: 2,
@@ -50,6 +53,7 @@ const variants = variant({
50
53
  },
51
54
  extralarge: {
52
55
  fontSize: 1,
56
+ gap: 2,
53
57
  height: tokenSizes.extralarge,
54
58
  lineHeight: tokenSizes.extralarge,
55
59
  paddingLeft: 3,
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
2
2
 
3
3
  import React from 'react';
4
4
  import { XIcon } from '@primer/octicons-react';
5
- import styled, { css } from 'styled-components';
5
+ import styled from 'styled-components';
6
6
  import { variant } from 'styled-system';
7
7
  import { get } from '../constants';
8
8
  import sx from '../sx';
@@ -34,16 +34,7 @@ const getTokenButtonIconSize = size => parseInt(tokenSizes[size || defaultTokenS
34
34
  const StyledTokenButton = styled.span.withConfig({
35
35
  displayName: "_RemoveTokenButton__StyledTokenButton",
36
36
  componentId: "sc-14lvcw1-0"
37
- })(["background-color:transparent;font-family:inherit;color:currentColor;cursor:pointer;display:inline-flex;justify-content:center;align-items:center;user-select:none;appearance:none;text-decoration:none;padding:0;transform:", ";align-self:baseline;border:0;border-radius:999px;", " &:hover,&:focus{background-color:", ";}&:active{background-color:", ";}", " ", ""], props => `translate(${props.borderOffset}px, -${props.borderOffset}px)`, props => {
38
- switch (props.size) {
39
- case 'large':
40
- case 'extralarge':
41
- return css(["margin-left:", ";"], get('space.2'));
42
-
43
- default:
44
- return css(["margin-left:", ";"], get('space.1'));
45
- }
46
- }, get('colors.neutral.muted'), get('colors.neutral.subtle'), variants, sx);
37
+ })(["background-color:transparent;font-family:inherit;color:currentColor;cursor:pointer;display:inline-flex;justify-content:center;align-items:center;user-select:none;appearance:none;text-decoration:none;padding:0;transform:", ";align-self:baseline;border:0;border-radius:999px;&:hover,&:focus{background-color:", ";}&:active{background-color:", ";}", " ", ""], props => `translate(${props.borderOffset}px, -${props.borderOffset}px)`, get('colors.neutral.muted'), get('colors.neutral.subtle'), variants, sx);
47
38
 
48
39
  const RemoveTokenButton = ({
49
40
  'aria-label': ariaLabel,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/components",
3
- "version": "0.0.0-2021927182528",
3
+ "version": "0.0.0-202192718387",
4
4
  "description": "Primer react components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",