@primer/components 0.0.0-202194183411 → 0.0.0-202194215436

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.
Files changed (96) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/browser.esm.js +295 -299
  3. package/dist/browser.esm.js.map +1 -1
  4. package/dist/browser.umd.js +358 -362
  5. package/dist/browser.umd.js.map +1 -1
  6. package/lib/AnchoredOverlay/AnchoredOverlay.d.ts +1 -2
  7. package/lib/AnchoredOverlay/AnchoredOverlay.js +3 -11
  8. package/lib/FilteredActionList/FilteredActionList.js +31 -5
  9. package/lib/Overlay.d.ts +1 -2
  10. package/lib/Overlay.js +5 -10
  11. package/lib/SelectMenu/SelectMenu.d.ts +2 -8
  12. package/lib/TextInput.d.ts +3 -6
  13. package/lib/TextInput.js +10 -9
  14. package/{lib-esm/Token/TokenLabel.d.ts → lib/Token/LabelToken.d.ts} +3 -3
  15. package/lib/Token/{TokenLabel.js → LabelToken.js} +23 -23
  16. package/lib/Token/Token.d.ts +2 -2
  17. package/lib/Token/Token.js +13 -13
  18. package/lib/Token/TokenBase.d.ts +3 -3
  19. package/lib/Token/TokenBase.js +17 -16
  20. package/lib/Token/TokenProfile.d.ts +1 -1
  21. package/lib/Token/TokenProfile.js +3 -3
  22. package/lib/Token/_RemoveTokenButton.d.ts +7 -1
  23. package/lib/Token/_RemoveTokenButton.js +40 -11
  24. package/lib/Token/index.d.ts +1 -1
  25. package/lib/Token/index.js +3 -3
  26. package/lib/hooks/useOverlay.d.ts +1 -2
  27. package/lib/hooks/useOverlay.js +6 -11
  28. package/lib/index.d.ts +1 -3
  29. package/lib/index.js +2 -18
  30. package/lib/utils/types.d.ts +0 -3
  31. package/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts +1 -2
  32. package/lib-esm/AnchoredOverlay/AnchoredOverlay.js +3 -11
  33. package/lib-esm/FilteredActionList/FilteredActionList.js +31 -3
  34. package/lib-esm/Overlay.d.ts +1 -2
  35. package/lib-esm/Overlay.js +5 -8
  36. package/lib-esm/SelectMenu/SelectMenu.d.ts +2 -8
  37. package/lib-esm/TextInput.d.ts +3 -6
  38. package/lib-esm/TextInput.js +9 -8
  39. package/{lib/Token/TokenLabel.d.ts → lib-esm/Token/LabelToken.d.ts} +3 -3
  40. package/lib-esm/Token/{TokenLabel.js → LabelToken.js} +23 -23
  41. package/lib-esm/Token/Token.d.ts +2 -2
  42. package/lib-esm/Token/Token.js +13 -13
  43. package/lib-esm/Token/TokenBase.d.ts +3 -3
  44. package/lib-esm/Token/TokenBase.js +17 -16
  45. package/lib-esm/Token/TokenProfile.d.ts +1 -1
  46. package/lib-esm/Token/TokenProfile.js +3 -3
  47. package/lib-esm/Token/_RemoveTokenButton.d.ts +7 -1
  48. package/lib-esm/Token/_RemoveTokenButton.js +36 -10
  49. package/lib-esm/Token/index.d.ts +1 -1
  50. package/lib-esm/Token/index.js +1 -1
  51. package/lib-esm/hooks/useOverlay.d.ts +1 -2
  52. package/lib-esm/hooks/useOverlay.js +6 -11
  53. package/lib-esm/index.d.ts +1 -3
  54. package/lib-esm/index.js +1 -3
  55. package/lib-esm/utils/types.d.ts +0 -3
  56. package/package.json +1 -1
  57. package/lib/Autocomplete/Autocomplete.d.ts +0 -40
  58. package/lib/Autocomplete/Autocomplete.js +0 -68
  59. package/lib/Autocomplete/AutocompleteContext.d.ts +0 -17
  60. package/lib/Autocomplete/AutocompleteContext.js +0 -11
  61. package/lib/Autocomplete/AutocompleteInput.d.ts +0 -9
  62. package/lib/Autocomplete/AutocompleteInput.js +0 -146
  63. package/lib/Autocomplete/AutocompleteMenu.d.ts +0 -71
  64. package/lib/Autocomplete/AutocompleteMenu.js +0 -223
  65. package/lib/Autocomplete/AutocompleteOverlay.d.ts +0 -17
  66. package/lib/Autocomplete/AutocompleteOverlay.js +0 -71
  67. package/lib/Autocomplete/index.d.ts +0 -2
  68. package/lib/Autocomplete/index.js +0 -15
  69. package/lib/TextInputWithTokens.d.ts +0 -43
  70. package/lib/TextInputWithTokens.js +0 -236
  71. package/lib/Token/_tokenButtonUtils.d.ts +0 -10
  72. package/lib/Token/_tokenButtonUtils.js +0 -42
  73. package/lib/_UnstyledTextInput.d.ts +0 -2
  74. package/lib/_UnstyledTextInput.js +0 -20
  75. package/lib/utils/scrollIntoViewingArea.d.ts +0 -1
  76. package/lib/utils/scrollIntoViewingArea.js +0 -39
  77. package/lib-esm/Autocomplete/Autocomplete.d.ts +0 -40
  78. package/lib-esm/Autocomplete/Autocomplete.js +0 -47
  79. package/lib-esm/Autocomplete/AutocompleteContext.d.ts +0 -17
  80. package/lib-esm/Autocomplete/AutocompleteContext.js +0 -2
  81. package/lib-esm/Autocomplete/AutocompleteInput.d.ts +0 -9
  82. package/lib-esm/Autocomplete/AutocompleteInput.js +0 -127
  83. package/lib-esm/Autocomplete/AutocompleteMenu.d.ts +0 -71
  84. package/lib-esm/Autocomplete/AutocompleteMenu.js +0 -202
  85. package/lib-esm/Autocomplete/AutocompleteOverlay.d.ts +0 -17
  86. package/lib-esm/Autocomplete/AutocompleteOverlay.js +0 -53
  87. package/lib-esm/Autocomplete/index.d.ts +0 -2
  88. package/lib-esm/Autocomplete/index.js +0 -1
  89. package/lib-esm/TextInputWithTokens.d.ts +0 -43
  90. package/lib-esm/TextInputWithTokens.js +0 -209
  91. package/lib-esm/Token/_tokenButtonUtils.d.ts +0 -10
  92. package/lib-esm/Token/_tokenButtonUtils.js +0 -26
  93. package/lib-esm/_UnstyledTextInput.d.ts +0 -2
  94. package/lib-esm/_UnstyledTextInput.js +0 -7
  95. package/lib-esm/utils/scrollIntoViewingArea.d.ts +0 -1
  96. package/lib-esm/utils/scrollIntoViewingArea.js +0 -30
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import { OverlayProps } from '../Overlay';
3
3
  import { FocusTrapHookSettings } from '../hooks/useFocusTrap';
4
4
  import { FocusZoneHookSettings } from '../hooks/useFocusZone';
5
- import { PositionSettings } from '../behaviors/anchoredPosition';
6
5
  interface AnchoredOverlayPropsWithAnchor {
7
6
  /**
8
7
  * A custom function component used to render the anchor element.
@@ -53,7 +52,7 @@ interface AnchoredOverlayBaseProps extends Pick<OverlayProps, 'height' | 'width'
53
52
  */
54
53
  focusZoneSettings?: Partial<FocusZoneHookSettings>;
55
54
  }
56
- export declare type AnchoredOverlayProps = AnchoredOverlayBaseProps & (AnchoredOverlayPropsWithAnchor | AnchoredOverlayPropsWithoutAnchor) & Partial<Pick<PositionSettings, 'align' | 'side'>>;
55
+ export declare type AnchoredOverlayProps = AnchoredOverlayBaseProps & (AnchoredOverlayPropsWithAnchor | AnchoredOverlayPropsWithoutAnchor);
57
56
  /**
58
57
  * An `AnchoredOverlay` provides an anchor that will open a floating overlay positioned relative to the anchor.
59
58
  * The overlay can be opened and navigated using keyboard or mouse.
@@ -40,9 +40,7 @@ const AnchoredOverlay = ({
40
40
  width,
41
41
  overlayProps,
42
42
  focusTrapSettings,
43
- focusZoneSettings,
44
- side,
45
- align
43
+ focusZoneSettings
46
44
  }) => {
47
45
  const anchorRef = (0, _hooks.useProvidedRefOrCreate)(externalAnchorRef);
48
46
  const [overlayRef, updateOverlayRef] = (0, _hooks.useRenderForcingRef)();
@@ -72,9 +70,7 @@ const AnchoredOverlay = ({
72
70
  position
73
71
  } = (0, _hooks.useAnchoredPosition)({
74
72
  anchorElementRef: anchorRef,
75
- floatingElementRef: overlayRef,
76
- side,
77
- align
73
+ floatingElementRef: overlayRef
78
74
  }, [overlayRef.current]);
79
75
  (0, _react.useEffect)(() => {
80
76
  // ensure overlay ref gets cleared when closed, so position can reset between closing/re-opening
@@ -117,8 +113,4 @@ const AnchoredOverlay = ({
117
113
  };
118
114
 
119
115
  exports.AnchoredOverlay = AnchoredOverlay;
120
- AnchoredOverlay.displayName = 'AnchoredOverlay';
121
- AnchoredOverlay.defaultProps = {
122
- side: 'outside-bottom',
123
- align: 'start'
124
- };
116
+ AnchoredOverlay.displayName = 'AnchoredOverlay';
@@ -7,8 +7,6 @@ exports.FilteredActionList = FilteredActionList;
7
7
 
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
 
10
- var _ssr = require("@react-aria/ssr");
11
-
12
10
  var _TextInput = _interopRequireDefault(require("../TextInput"));
13
11
 
14
12
  var _Box = _interopRequireDefault(require("../Box"));
@@ -29,7 +27,7 @@ var _useProvidedRefOrCreate = require("../hooks/useProvidedRefOrCreate");
29
27
 
30
28
  var _useScrollFlash = _interopRequireDefault(require("../hooks/useScrollFlash"));
31
29
 
32
- var _scrollIntoViewingArea = require("../utils/scrollIntoViewingArea");
30
+ var _ssr = require("@react-aria/ssr");
33
31
 
34
32
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
35
33
 
@@ -39,6 +37,34 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
39
37
 
40
38
  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); }
41
39
 
40
+ function scrollIntoViewingArea(child, container, margin = 8, behavior = 'smooth') {
41
+ const {
42
+ top: childTop,
43
+ bottom: childBottom
44
+ } = child.getBoundingClientRect();
45
+ const {
46
+ top: containerTop,
47
+ bottom: containerBottom
48
+ } = container.getBoundingClientRect();
49
+ const isChildTopAboveViewingArea = childTop < containerTop + margin;
50
+ const isChildBottomBelowViewingArea = childBottom > containerBottom - margin;
51
+
52
+ if (isChildTopAboveViewingArea) {
53
+ const scrollHeightToChildTop = childTop - containerTop + container.scrollTop;
54
+ container.scrollTo({
55
+ behavior,
56
+ top: scrollHeightToChildTop - margin
57
+ });
58
+ } else if (isChildBottomBelowViewingArea) {
59
+ const scrollHeightToChildBottom = childBottom - containerBottom + container.scrollTop;
60
+ container.scrollTo({
61
+ behavior,
62
+ top: scrollHeightToChildBottom + margin
63
+ });
64
+ } // either completely in view or outside viewing area on both ends, don't scroll
65
+
66
+ }
67
+
42
68
  const StyledHeader = _styledComponents.default.div.withConfig({
43
69
  displayName: "FilteredActionList__StyledHeader",
44
70
  componentId: "yg3jkv-0"
@@ -85,7 +111,7 @@ function FilteredActionList({
85
111
  activeDescendantRef.current = current;
86
112
 
87
113
  if (current && scrollContainerRef.current && directlyActivated) {
88
- (0, _scrollIntoViewingArea.scrollIntoViewingArea)(current, scrollContainerRef.current);
114
+ scrollIntoViewingArea(current, scrollContainerRef.current);
89
115
  }
90
116
  }
91
117
  }, [// List ref isn't set while loading. Need to re-bind focus zone when it changes
@@ -93,7 +119,7 @@ function FilteredActionList({
93
119
  (0, _react.useEffect)(() => {
94
120
  // if items changed, we want to instantly move active descendant into view
95
121
  if (activeDescendantRef.current && scrollContainerRef.current) {
96
- (0, _scrollIntoViewingArea.scrollIntoViewingArea)(activeDescendantRef.current, scrollContainerRef.current, 'vertical', undefined, undefined, 'auto');
122
+ scrollIntoViewingArea(activeDescendantRef.current, scrollContainerRef.current, undefined, 'auto');
97
123
  }
98
124
  }, [items]);
99
125
  (0, _useScrollFlash.default)(scrollContainerRef);
package/lib/Overlay.d.ts CHANGED
@@ -4,7 +4,7 @@ import { ComponentProps } from './utils/types';
4
4
  import { TouchOrMouseEvent } from './hooks';
5
5
  import { SxProp } from './sx';
6
6
  import { AnchorSide } from './behaviors/anchoredPosition';
7
- export declare type StyledOverlayProps = {
7
+ declare type StyledOverlayProps = {
8
8
  width?: keyof typeof widthMap;
9
9
  height?: keyof typeof heightMap;
10
10
  maxHeight?: keyof Omit<typeof heightMap, 'auto' | 'initial'>;
@@ -40,7 +40,6 @@ export declare type OverlayProps = {
40
40
  top: number;
41
41
  left: number;
42
42
  portalContainerName?: string;
43
- preventFocusOnOpen?: boolean;
44
43
  } & Omit<ComponentProps<typeof StyledOverlay>, 'visibility' | keyof SystemPositionProps>;
45
44
  /**
46
45
  * An `Overlay` is a flexible floating surface, used to display transient content such as menus,
package/lib/Overlay.js CHANGED
@@ -113,7 +113,6 @@ const Overlay = /*#__PURE__*/_react.default.forwardRef(({
113
113
  left,
114
114
  anchorSide,
115
115
  portalContainerName,
116
- preventFocusOnOpen,
117
116
  ...rest
118
117
  }, forwardedRef) => {
119
118
  const overlayRef = (0, _react.useRef)(null);
@@ -129,8 +128,7 @@ const Overlay = /*#__PURE__*/_react.default.forwardRef(({
129
128
  onEscape,
130
129
  ignoreClickRefs,
131
130
  onClickOutside,
132
- initialFocusRef,
133
- preventFocusOnOpen
131
+ initialFocusRef
134
132
  });
135
133
  (0, _react.useEffect)(() => {
136
134
  var _combinedRef$current;
@@ -159,8 +157,9 @@ const Overlay = /*#__PURE__*/_react.default.forwardRef(({
159
157
  easing: slideAnimationEasing
160
158
  });
161
159
  }, [anchorSide, slideAnimationDistance, slideAnimationEasing, visibility]);
162
-
163
- const styledOverlay = /*#__PURE__*/_react.default.createElement(StyledOverlay, _extends({
160
+ return /*#__PURE__*/_react.default.createElement(_Portal.default, {
161
+ containerName: portalContainerName
162
+ }, /*#__PURE__*/_react.default.createElement(StyledOverlay, _extends({
164
163
  height: height,
165
164
  role: role
166
165
  }, rest, {
@@ -171,11 +170,7 @@ const Overlay = /*#__PURE__*/_react.default.forwardRef(({
171
170
  ...rest.style,
172
171
  '--styled-overlay-visibility': visibility
173
172
  }
174
- }));
175
-
176
- return /*#__PURE__*/_react.default.createElement(_Portal.default, {
177
- containerName: portalContainerName
178
- }, styledOverlay);
173
+ })));
179
174
  });
180
175
 
181
176
  Overlay.defaultProps = {
@@ -32,15 +32,11 @@ declare const _default: React.ForwardRefExoticComponent<Pick<SelectMenuInternalP
32
32
  Divider: import("styled-components").StyledComponent<"div", any, SystemCommonProps & SxProp, never>;
33
33
  Filter: React.ForwardRefExoticComponent<Pick<{
34
34
  value?: string | undefined;
35
- } & Omit<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & {
36
- ref?: ((instance: HTMLInputElement | null) => void) | React.RefObject<HTMLInputElement> | null | undefined;
37
- }, string | number | symbol> & {
35
+ } & Pick<{
38
36
  className?: string | undefined;
39
37
  icon?: React.ComponentType<{
40
38
  className?: string | undefined;
41
39
  }> | undefined;
42
- inputComponent?: React.ComponentType<HTMLInputElement> | undefined;
43
- wrapperRef?: React.RefObject<HTMLSpanElement> | undefined;
44
40
  } & Pick<{
45
41
  color?: string | undefined;
46
42
  maxWidth?: import("styled-system").ResponsiveValue<import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
@@ -319,9 +315,7 @@ declare const _default: React.ForwardRefExoticComponent<Pick<SelectMenuInternalP
319
315
  } & {
320
316
  as?: string | React.ComponentType<any> | undefined;
321
317
  forwardedAs?: string | React.ComponentType<any> | undefined;
322
- }, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "className" | "block" | "icon" | "sx" | "disabled" | "variant" | "contrast" | "inputComponent" | "wrapperRef"> & {
323
- as?: "input" | undefined;
324
- }, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
318
+ }, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "className" | "block" | "icon" | "sx" | "disabled" | "variant" | "contrast">, string | number | symbol> & React.RefAttributes<HTMLInputElement>, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
325
319
  Footer: import("styled-components").StyledComponent<"footer", any, SystemCommonProps & SxProp, never>;
326
320
  Item: React.ForwardRefExoticComponent<Pick<{
327
321
  as?: React.ElementType<any> | undefined;
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
2
  import { MaxWidthProps, MinWidthProps, WidthProps } from 'styled-system';
3
- import type * as Polymorphic from "@radix-ui/react-polymorphic";
4
3
  import { SxProp } from './sx';
5
4
  import { ComponentProps } from './utils/types';
6
- import UnstyledTextInput from './_UnstyledTextInput';
5
+ declare const Input: import("styled-components").StyledComponent<"input", any, {}, never>;
7
6
  declare const Wrapper: import("styled-components").StyledComponent<"span", any, {
8
7
  disabled?: boolean | undefined;
9
8
  hasIcon?: boolean | undefined;
@@ -16,10 +15,8 @@ declare type NonPassthroughProps = {
16
15
  icon?: React.ComponentType<{
17
16
  className?: string;
18
17
  }>;
19
- inputComponent?: React.ComponentType<HTMLInputElement>;
20
- wrapperRef?: React.RefObject<HTMLSpanElement>;
21
18
  } & Pick<ComponentProps<typeof Wrapper>, 'block' | 'contrast' | 'disabled' | 'sx' | 'theme' | 'width' | 'maxWidth' | 'minWidth' | 'variant'>;
22
- declare type TextInputInternalProps = NonPassthroughProps & Omit<React.ComponentPropsWithoutRef<typeof UnstyledTextInput>, keyof NonPassthroughProps>;
23
- declare const TextInput: Polymorphic.ForwardRefComponent<"input", TextInputInternalProps>;
19
+ declare type TextInputInternalProps = NonPassthroughProps & Omit<React.ComponentPropsWithoutRef<typeof Input>, keyof NonPassthroughProps>;
20
+ declare const TextInput: React.ForwardRefExoticComponent<Pick<TextInputInternalProps, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
24
21
  export declare type TextInputProps = ComponentProps<typeof TextInput>;
25
22
  export default TextInput;
package/lib/TextInput.js CHANGED
@@ -17,8 +17,6 @@ var _constants = require("./constants");
17
17
 
18
18
  var _sx = _interopRequireDefault(require("./sx"));
19
19
 
20
- var _UnstyledTextInput = _interopRequireDefault(require("./_UnstyledTextInput"));
21
-
22
20
  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
21
 
24
22
  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; }
@@ -44,20 +42,25 @@ const sizeVariants = (0, _styledSystem.variant)({
44
42
  }
45
43
  });
46
44
 
45
+ const Input = _styledComponents.default.input.withConfig({
46
+ displayName: "TextInput__Input",
47
+ componentId: "sc-1apmpmt-0"
48
+ })(["border:0;font-size:inherit;font-family:inherit;background-color:transparent;-webkit-appearance:none;color:inherit;width:100%;&:focus{outline:0;}"]);
49
+
47
50
  const Wrapper = _styledComponents.default.span.withConfig({
48
51
  displayName: "TextInput__Wrapper",
49
- componentId: "sc-1apmpmt-0"
52
+ componentId: "sc-1apmpmt-1"
50
53
  })(["display:inline-flex;align-items:stretch;min-height:34px;font-size:", ";line-height:20px;color:", ";vertical-align:middle;background-repeat:no-repeat;background-position:right 8px center;border:1px solid ", ";border-radius:", ";outline:none;box-shadow:", ";", " .TextInput-icon{align-self:center;color:", ";margin:0 ", ";flex-shrink:0;}&:focus-within{border-color:", ";box-shadow:", ";}", " ", " ", " @media (min-width:", "){font-size:", ";}", " ", " ", " ", " ", ";"], (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('shadows.primer.shadow.inset'), props => {
51
54
  if (props.hasIcon) {
52
55
  return (0, _styledComponents.css)(["padding:0;"]);
53
56
  } else {
54
57
  return (0, _styledComponents.css)(["padding:6px 12px;"]);
55
58
  }
56
- }, (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('space.2'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('shadows.primer.shadow.focus'), props => props.contrast && (0, _styledComponents.css)(["background-color:", ";"], (0, _constants.get)('colors.canvas.inset')), props => props.disabled && (0, _styledComponents.css)(["color:", ";background-color:", ";border-color:", ";"], (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('colors.input.disabledBg'), (0, _constants.get)('colors.border.default')), props => props.block && (0, _styledComponents.css)(["display:block;width:100%;"]), (0, _constants.get)('breakpoints.1'), (0, _constants.get)('fontSizes.1'), _styledSystem.width, _styledSystem.minWidth, _styledSystem.maxWidth, sizeVariants, _sx.default);
59
+ }, (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('space.2'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('shadows.primer.shadow.focus'), props => props.contrast && (0, _styledComponents.css)(["background-color:", ";"], (0, _constants.get)('colors.canvas.inset')), props => props.disabled && (0, _styledComponents.css)(["color:", ";background-color:", ";border-color:", ";"], (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('colors.input.disabledBg'), (0, _constants.get)('colors.border.default')), props => props.block && (0, _styledComponents.css)(["display:block;width:100%;"]), (0, _constants.get)('breakpoints.1'), (0, _constants.get)('fontSizes.1'), _styledSystem.width, _styledSystem.minWidth, _styledSystem.maxWidth, sizeVariants, _sx.default); // Props that are not passed through to Input:
60
+
57
61
 
58
62
  // using forwardRef is important so that other components (ex. SelectMenu) can autofocus the input
59
63
  const TextInput = /*#__PURE__*/_react.default.forwardRef(({
60
- inputComponent: InputComponent,
61
64
  icon: IconComponent,
62
65
  block,
63
66
  className,
@@ -69,7 +72,6 @@ const TextInput = /*#__PURE__*/_react.default.forwardRef(({
69
72
  minWidth: minWidthProp,
70
73
  maxWidth: maxWidthProp,
71
74
  variant: variantProp,
72
- wrapperRef,
73
75
  ...inputProps
74
76
  }, ref) => {
75
77
  // this class is necessary to style FilterSearch, plz no touchy!
@@ -85,11 +87,10 @@ const TextInput = /*#__PURE__*/_react.default.forwardRef(({
85
87
  width: widthProp,
86
88
  minWidth: minWidthProp,
87
89
  maxWidth: maxWidthProp,
88
- variant: variantProp,
89
- ref: wrapperRef
90
+ variant: variantProp
90
91
  }, IconComponent && /*#__PURE__*/_react.default.createElement(IconComponent, {
91
92
  className: "TextInput-icon"
92
- }), /*#__PURE__*/_react.default.createElement(_UnstyledTextInput.default, _extends({
93
+ }), /*#__PURE__*/_react.default.createElement(Input, _extends({
93
94
  ref: ref,
94
95
  disabled: disabled
95
96
  }, inputProps)));
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { TokenBaseProps } from './TokenBase';
3
- export interface TokenLabelProps extends TokenBaseProps {
3
+ export interface LabelTokenProps extends TokenBaseProps {
4
4
  /**
5
5
  * The color that corresponds to the label
6
6
  */
@@ -10,5 +10,5 @@ export interface TokenLabelProps extends TokenBaseProps {
10
10
  */
11
11
  hideRemoveButton?: boolean;
12
12
  }
13
- declare const TokenLabel: React.ForwardRefExoticComponent<Pick<TokenLabelProps, "sizes" | "color" | "content" | "height" | "translate" | "width" | "hidden" | "children" | "value" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "text" | "list" | "default" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "start" | "step" | "wrap" | "open" | "max" | "media" | "method" | "min" | "target" | "crossOrigin" | "href" | "classID" | "useMap" | "wmode" | "download" | "hrefLang" | "rel" | "alt" | "coords" | "shape" | "autoPlay" | "controls" | "loop" | "mediaGroup" | "muted" | "playsInline" | "preload" | "src" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "dateTime" | "acceptCharset" | "action" | "autoComplete" | "encType" | "noValidate" | "manifest" | "allowFullScreen" | "allowTransparency" | "frameBorder" | "marginHeight" | "marginWidth" | "sandbox" | "scrolling" | "seamless" | "srcDoc" | "srcSet" | "async" | "accept" | "capture" | "checked" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "challenge" | "keyType" | "keyParams" | "htmlFor" | "as" | "integrity" | "charSet" | "httpEquiv" | "high" | "low" | "optimum" | "reversed" | "selected" | "defer" | "nonce" | "scoped" | "cellPadding" | "cellSpacing" | "colSpan" | "headers" | "rowSpan" | "scope" | "cols" | "rows" | "kind" | "srcLang" | "poster" | "variant" | "handleRemove" | "isSelected" | "hideRemoveButton" | "fillColor"> & React.RefAttributes<HTMLElement>>;
14
- export default TokenLabel;
13
+ declare const LabelToken: React.ForwardRefExoticComponent<Pick<LabelTokenProps, "sizes" | "color" | "content" | "height" | "translate" | "width" | "hidden" | "children" | "value" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "text" | "list" | "default" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "start" | "step" | "size" | "wrap" | "open" | "max" | "media" | "method" | "min" | "target" | "crossOrigin" | "href" | "classID" | "useMap" | "wmode" | "download" | "hrefLang" | "rel" | "alt" | "coords" | "shape" | "autoPlay" | "controls" | "loop" | "mediaGroup" | "muted" | "playsInline" | "preload" | "src" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "dateTime" | "acceptCharset" | "action" | "autoComplete" | "encType" | "noValidate" | "manifest" | "allowFullScreen" | "allowTransparency" | "frameBorder" | "marginHeight" | "marginWidth" | "sandbox" | "scrolling" | "seamless" | "srcDoc" | "srcSet" | "async" | "accept" | "capture" | "checked" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "challenge" | "keyType" | "keyParams" | "htmlFor" | "as" | "integrity" | "charSet" | "httpEquiv" | "high" | "low" | "optimum" | "reversed" | "selected" | "defer" | "nonce" | "scoped" | "cellPadding" | "cellSpacing" | "colSpan" | "headers" | "rowSpan" | "scope" | "cols" | "rows" | "kind" | "srcLang" | "poster" | "onRemove" | "isSelected" | "hideRemoveButton" | "fillColor"> & React.RefAttributes<HTMLElement>>;
14
+ export default LabelToken;
@@ -40,28 +40,28 @@ const colorModeConfigs = {
40
40
  }
41
41
  };
42
42
  const tokenBorderWidthPx = 1;
43
- const StyledTokenLabel = (0, _styledComponents.default)(_TokenBase.default).withConfig({
44
- displayName: "TokenLabel__StyledTokenLabel",
45
- componentId: "sc-1bdmgzv-0"
43
+ const StyledLabelToken = (0, _styledComponents.default)(_TokenBase.default).withConfig({
44
+ displayName: "LabelToken__StyledLabelToken",
45
+ componentId: "sc-1udj0pr-0"
46
46
  })(["background-color:", ";border-width:", "px;border-style:solid;border-color:", ";color:", ";padding-right:", ";position:relative;", ""], props => props.bgColor, tokenBorderWidthPx, props => props.borderColor, props => props.textColor, props => !props.hideRemoveButton ? 0 : undefined, props => {
47
47
  if (props.isSelected) {
48
48
  return (0, _styledComponents.css)(["&:after{content:'';position:absolute;z-index:1;top:-2px;right:-2px;bottom:-2px;left:-2px;display:block;pointer-events:none;box-shadow:0 0 0 2px ", ";border-radius:999px;}"], props.bgColor);
49
49
  }
50
50
  });
51
51
  const TokenTextContainer = (0, _styledComponents.default)('span').withConfig({
52
- displayName: "TokenLabel__TokenTextContainer",
53
- componentId: "sc-1bdmgzv-1"
52
+ displayName: "LabelToken__TokenTextContainer",
53
+ componentId: "sc-1udj0pr-1"
54
54
  })(["flex-grow:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
55
- const TokenLabel = /*#__PURE__*/(0, _react.forwardRef)((props, forwardedRef) => {
55
+ const LabelToken = /*#__PURE__*/(0, _react.forwardRef)((props, forwardedRef) => {
56
56
  const {
57
57
  as,
58
58
  fillColor,
59
- handleRemove,
59
+ onRemove,
60
60
  id,
61
61
  isSelected,
62
62
  ref,
63
63
  text,
64
- variant,
64
+ size,
65
65
  hideRemoveButton,
66
66
  ...rest
67
67
  } = props;
@@ -94,23 +94,23 @@ const TokenLabel = /*#__PURE__*/(0, _react.forwardRef)((props, forwardedRef) =>
94
94
  }
95
95
 
96
96
  if (isSelected) {
97
- bgColor = isFillColorDark ? (0, _tinycolor.default)(fillColor).lighten(10).toString() // TODO: darken more than 10 if the fillColor is really bright and doesn't darken well
97
+ bgColor = isFillColorDark ? (0, _tinycolor.default)(fillColor).lighten(10).toString() : // TODO: darken more than 10 if the fillColor is really bright and doesn't darken well
98
98
  // Examples of colors that don't darken well:
99
99
  // - #a2eeef
100
100
  // - #ffd78e
101
101
  // - #a4f287
102
- : (0, _tinycolor.default)(fillColor).darken(10).toString();
102
+ (0, _tinycolor.default)(fillColor).darken(10).toString();
103
103
  }
104
104
  }
105
105
 
106
- const hasMultipleActionTargets = (0, _TokenBase.isTokenInteractive)(props) && Boolean(handleRemove) && !hideRemoveButton;
106
+ const hasMultipleActionTargets = (0, _TokenBase.isTokenInteractive)(props) && Boolean(onRemove) && !hideRemoveButton;
107
107
 
108
- const handleRemoveClick = e => {
108
+ const onRemoveClick = e => {
109
109
  e.stopPropagation();
110
- handleRemove && handleRemove();
110
+ onRemove && onRemove();
111
111
  };
112
112
 
113
- return /*#__PURE__*/_react.default.createElement(StyledTokenLabel // specific to labels
113
+ return /*#__PURE__*/_react.default.createElement(StyledLabelToken // specific to labels
114
114
  , _extends({
115
115
  fillColor: fillColor,
116
116
  bgColor: bgColor,
@@ -118,24 +118,24 @@ const TokenLabel = /*#__PURE__*/(0, _react.forwardRef)((props, forwardedRef) =>
118
118
  textColor: textColor // common token props
119
119
  ,
120
120
  as: as,
121
- hideRemoveButton: hideRemoveButton || !handleRemove,
122
- handleRemove: handleRemove,
121
+ hideRemoveButton: hideRemoveButton || !onRemove,
122
+ onRemove: onRemove,
123
123
  id: id === null || id === void 0 ? void 0 : id.toString(),
124
124
  isSelected: isSelected,
125
125
  ref: forwardedRef,
126
126
  text: text,
127
- variant: variant
128
- }, rest), /*#__PURE__*/_react.default.createElement(TokenTextContainer, null, text), !hideRemoveButton && handleRemove ? /*#__PURE__*/_react.default.createElement(_RemoveTokenButton.default, {
127
+ size: size
128
+ }, rest), /*#__PURE__*/_react.default.createElement(TokenTextContainer, null, text), !hideRemoveButton && onRemove ? /*#__PURE__*/_react.default.createElement(_RemoveTokenButton.default, {
129
129
  borderOffset: tokenBorderWidthPx,
130
130
  parentTokenTag: as || 'span',
131
131
  tabIndex: -1,
132
- onClick: handleRemoveClick,
133
- variant: variant,
134
- "aria-hidden": hasMultipleActionTargets ? "true" : "false"
132
+ onClick: onRemoveClick,
133
+ size: size,
134
+ "aria-hidden": hasMultipleActionTargets ? 'true' : 'false'
135
135
  }) : null);
136
136
  });
137
- TokenLabel.defaultProps = {
137
+ LabelToken.defaultProps = {
138
138
  fillColor: '#999'
139
139
  };
140
- var _default = TokenLabel;
140
+ var _default = LabelToken;
141
141
  exports.default = _default;
@@ -4,11 +4,11 @@ export interface TokenProps extends TokenBaseProps {
4
4
  /**
5
5
  * A function that renders a component before the token text
6
6
  */
7
- leadingVisual?: React.FunctionComponent<any>;
7
+ leadingVisual?: React.ComponentType<any>;
8
8
  /**
9
9
  * Whether the remove button should be rendered in the token
10
10
  */
11
11
  hideRemoveButton?: boolean;
12
12
  }
13
- declare const Token: React.ForwardRefExoticComponent<Pick<TokenProps, "sizes" | "color" | "content" | "height" | "translate" | "width" | "hidden" | "children" | "value" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "text" | "list" | "default" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "start" | "step" | "wrap" | "open" | "max" | "media" | "method" | "min" | "target" | "crossOrigin" | "href" | "classID" | "useMap" | "wmode" | "download" | "hrefLang" | "rel" | "alt" | "coords" | "shape" | "autoPlay" | "controls" | "loop" | "mediaGroup" | "muted" | "playsInline" | "preload" | "src" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "dateTime" | "acceptCharset" | "action" | "autoComplete" | "encType" | "noValidate" | "manifest" | "allowFullScreen" | "allowTransparency" | "frameBorder" | "marginHeight" | "marginWidth" | "sandbox" | "scrolling" | "seamless" | "srcDoc" | "srcSet" | "async" | "accept" | "capture" | "checked" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "challenge" | "keyType" | "keyParams" | "htmlFor" | "as" | "integrity" | "charSet" | "httpEquiv" | "high" | "low" | "optimum" | "reversed" | "selected" | "defer" | "nonce" | "scoped" | "cellPadding" | "cellSpacing" | "colSpan" | "headers" | "rowSpan" | "scope" | "cols" | "rows" | "kind" | "srcLang" | "poster" | "variant" | "leadingVisual" | "handleRemove" | "isSelected" | "hideRemoveButton"> & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement | HTMLSpanElement>>;
13
+ declare const Token: React.ForwardRefExoticComponent<Pick<TokenProps, "sizes" | "color" | "content" | "height" | "translate" | "width" | "hidden" | "children" | "value" | "cite" | "data" | "form" | "label" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "text" | "list" | "default" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "start" | "step" | "size" | "wrap" | "open" | "max" | "media" | "method" | "min" | "target" | "crossOrigin" | "href" | "classID" | "useMap" | "wmode" | "download" | "hrefLang" | "rel" | "alt" | "coords" | "shape" | "autoPlay" | "controls" | "loop" | "mediaGroup" | "muted" | "playsInline" | "preload" | "src" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "dateTime" | "acceptCharset" | "action" | "autoComplete" | "encType" | "noValidate" | "manifest" | "allowFullScreen" | "allowTransparency" | "frameBorder" | "marginHeight" | "marginWidth" | "sandbox" | "scrolling" | "seamless" | "srcDoc" | "srcSet" | "async" | "accept" | "capture" | "checked" | "maxLength" | "minLength" | "multiple" | "readOnly" | "required" | "challenge" | "keyType" | "keyParams" | "htmlFor" | "as" | "integrity" | "charSet" | "httpEquiv" | "high" | "low" | "optimum" | "reversed" | "selected" | "defer" | "nonce" | "scoped" | "cellPadding" | "cellSpacing" | "colSpan" | "headers" | "rowSpan" | "scope" | "cols" | "rows" | "kind" | "srcLang" | "poster" | "leadingVisual" | "onRemove" | "isSelected" | "hideRemoveButton"> & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement | HTMLSpanElement>>;
14
14
  export default Token;
@@ -39,37 +39,37 @@ const LeadingVisualContainer = (0, _styledComponents.default)('span').withConfig
39
39
  const Token = /*#__PURE__*/(0, _react.forwardRef)((props, forwardedRef) => {
40
40
  const {
41
41
  as,
42
- handleRemove,
42
+ onRemove,
43
43
  id,
44
44
  leadingVisual: LeadingVisual,
45
45
  ref,
46
46
  text,
47
- variant,
47
+ size,
48
48
  hideRemoveButton,
49
49
  ...rest
50
50
  } = props;
51
- const hasMultipleActionTargets = (0, _TokenBase.isTokenInteractive)(props) && Boolean(handleRemove) && !hideRemoveButton;
51
+ const hasMultipleActionTargets = (0, _TokenBase.isTokenInteractive)(props) && Boolean(onRemove) && !hideRemoveButton;
52
52
 
53
- const handleRemoveClick = e => {
53
+ const onRemoveClick = e => {
54
54
  e.stopPropagation();
55
- handleRemove && handleRemove();
55
+ onRemove && onRemove();
56
56
  };
57
57
 
58
58
  return /*#__PURE__*/_react.default.createElement(DefaultTokenStyled, _extends({
59
59
  as: as,
60
- handleRemove: handleRemove,
61
- hideRemoveButton: hideRemoveButton || !handleRemove,
60
+ onRemove: onRemove,
61
+ hideRemoveButton: hideRemoveButton || !onRemove,
62
62
  id: id === null || id === void 0 ? void 0 : id.toString(),
63
63
  text: text,
64
64
  ref: forwardedRef,
65
- variant: variant
66
- }, rest), LeadingVisual ? /*#__PURE__*/_react.default.createElement(LeadingVisualContainer, null, /*#__PURE__*/_react.default.createElement(LeadingVisual, null)) : null, /*#__PURE__*/_react.default.createElement(TokenTextContainer, null, text), !hideRemoveButton && handleRemove ? /*#__PURE__*/_react.default.createElement(_RemoveTokenButton.default, {
65
+ size: size
66
+ }, rest), LeadingVisual ? /*#__PURE__*/_react.default.createElement(LeadingVisualContainer, null, /*#__PURE__*/_react.default.createElement(LeadingVisual, null)) : null, /*#__PURE__*/_react.default.createElement(TokenTextContainer, null, text), !hideRemoveButton && onRemove ? /*#__PURE__*/_react.default.createElement(_RemoveTokenButton.default, {
67
67
  borderOffset: tokenBorderWidthPx,
68
68
  parentTokenTag: as || 'span',
69
- onClick: handleRemoveClick,
70
- variant: variant,
71
- parentTokenIsInteractive: (0, _TokenBase.isTokenInteractive)(props),
72
- "aria-hidden": hasMultipleActionTargets ? "true" : "false"
69
+ onClick: onRemoveClick,
70
+ size: size,
71
+ isParentInteractive: (0, _TokenBase.isTokenInteractive)(props),
72
+ "aria-hidden": hasMultipleActionTargets ? 'true' : 'false'
73
73
  }) : null);
74
74
  });
75
75
  var _default = Token;
@@ -1,15 +1,15 @@
1
1
  /// <reference types="react" />
2
2
  export declare type TokenSizeKeys = 'sm' | 'md' | 'lg' | 'xl';
3
- export declare const tokenSizes: Record<TokenSizeKeys, number>;
3
+ export declare const tokenSizes: Record<TokenSizeKeys, string>;
4
4
  export declare const defaultTokenSize = "md";
5
5
  export interface TokenBaseProps extends Omit<React.HTMLProps<HTMLSpanElement | HTMLButtonElement | HTMLAnchorElement>, 'size' | 'id'> {
6
6
  as?: 'button' | 'a' | 'span';
7
- handleRemove?: () => void;
7
+ onRemove?: () => void;
8
8
  isSelected?: boolean;
9
9
  tabIndex?: number;
10
10
  text: string;
11
11
  id?: number | string;
12
- variant?: TokenSizeKeys;
12
+ size?: TokenSizeKeys;
13
13
  }
14
14
  export declare const isTokenInteractive: ({ as, onClick, onFocus, tabIndex }: TokenBaseProps) => boolean;
15
15
  declare const TokenBase: import("styled-components").StyledComponent<"span", any, TokenBaseProps, never>;