@primer/react 0.0.0-20260306222928 → 0.0.0-20260307000205

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 (68) hide show
  1. package/CHANGELOG.md +3 -11
  2. package/dist/ActionList/{ActionList-8b212f46.css → ActionList-d0ad7f0b.css} +2 -2
  3. package/dist/ActionList/{ActionList-8b212f46.css.map → ActionList-d0ad7f0b.css.map} +1 -1
  4. package/dist/ActionList/ActionList.module.css.js +1 -1
  5. package/dist/ActionList/Description.d.ts.map +1 -1
  6. package/dist/ActionList/Description.js +25 -28
  7. package/dist/ActionList/Item.d.ts.map +1 -1
  8. package/dist/ActionList/Item.js +51 -95
  9. package/dist/ActionList/shared.d.ts +0 -1
  10. package/dist/ActionList/shared.d.ts.map +1 -1
  11. package/dist/ActionMenu/ActionMenu.d.ts.map +1 -1
  12. package/dist/ActionMenu/ActionMenu.js +9 -1
  13. package/dist/AnchoredOverlay/AnchoredOverlay-0f6f45b5.css +2 -0
  14. package/dist/AnchoredOverlay/AnchoredOverlay-0f6f45b5.css.map +1 -0
  15. package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
  16. package/dist/AnchoredOverlay/AnchoredOverlay.js +36 -9
  17. package/dist/AnchoredOverlay/AnchoredOverlay.module.css.js +2 -2
  18. package/dist/Autocomplete/AutocompleteInput.js +3 -3
  19. package/dist/Autocomplete/AutocompleteOverlay.js +3 -3
  20. package/dist/Button/ButtonBase.js +2 -2
  21. package/dist/Dialog/Dialog-b8e961f6.css +2 -0
  22. package/dist/Dialog/Dialog-b8e961f6.css.map +1 -0
  23. package/dist/Dialog/Dialog.d.ts +0 -11
  24. package/dist/Dialog/Dialog.d.ts.map +1 -1
  25. package/dist/Dialog/Dialog.js +3 -12
  26. package/dist/Dialog/Dialog.module.css.js +1 -1
  27. package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +1 -1
  28. package/dist/FeatureFlags/DefaultFeatureFlags.js +1 -0
  29. package/dist/FormControl/FormControl.d.ts.map +1 -1
  30. package/dist/FormControl/FormControl.js +64 -81
  31. package/dist/FormControl/FormControlLabel.d.ts.map +1 -1
  32. package/dist/FormControl/FormControlLabel.js +15 -20
  33. package/dist/FormControl/_FormControlContext.d.ts +0 -6
  34. package/dist/FormControl/_FormControlContext.d.ts.map +1 -1
  35. package/dist/Heading/Heading.js +2 -2
  36. package/dist/Link/Link.d.ts.map +1 -1
  37. package/dist/Link/Link.js +4 -3
  38. package/dist/Overlay/Overlay-d90d90cb.css +2 -0
  39. package/dist/Overlay/Overlay-d90d90cb.css.map +1 -0
  40. package/dist/Overlay/Overlay.d.ts.map +1 -1
  41. package/dist/Overlay/Overlay.js +27 -22
  42. package/dist/Overlay/Overlay.module.css.js +1 -1
  43. package/dist/PageLayout/PageLayout.js +5 -5
  44. package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
  45. package/dist/SelectPanel/SelectPanel.js +3 -17
  46. package/dist/TextInputWithTokens/TextInputWithTokens.d.ts.map +1 -1
  47. package/dist/TextInputWithTokens/TextInputWithTokens.js +264 -334
  48. package/dist/deprecated/DialogV1/Dialog.js +2 -2
  49. package/dist/hooks/index.d.ts +0 -1
  50. package/dist/hooks/index.d.ts.map +1 -1
  51. package/dist/hooks/useRefObjectAsForwardedRef.d.ts +0 -12
  52. package/dist/hooks/useRefObjectAsForwardedRef.d.ts.map +1 -1
  53. package/dist/hooks/useRefObjectAsForwardedRef.js +10 -14
  54. package/dist/index.d.ts +0 -1
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +0 -1
  57. package/generated/components.json +0 -21
  58. package/generated/hooks.json +0 -22
  59. package/package.json +2 -1
  60. package/dist/AnchoredOverlay/AnchoredOverlay-73c1b2d1.css +0 -2
  61. package/dist/AnchoredOverlay/AnchoredOverlay-73c1b2d1.css.map +0 -1
  62. package/dist/Dialog/Dialog-2d417a89.css +0 -2
  63. package/dist/Dialog/Dialog-2d417a89.css.map +0 -1
  64. package/dist/Overlay/Overlay-15519c09.css +0 -2
  65. package/dist/Overlay/Overlay-15519c09.css.map +0 -1
  66. package/dist/hooks/useCombinedRefs.d.ts +0 -51
  67. package/dist/hooks/useCombinedRefs.d.ts.map +0 -1
  68. package/dist/hooks/useCombinedRefs.js +0 -97
@@ -3,11 +3,9 @@ import { FocusKeys } from '@primer/behaviors';
3
3
  import { isFocusable } from '@primer/behaviors/utils';
4
4
  import React, { useRef, useState } from 'react';
5
5
  import { isValidElementType } from 'react-is';
6
- import { useCombinedRefs } from '../hooks/useCombinedRefs.js';
6
+ import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
7
7
  import { useFocusZone } from '../hooks/useFocusZone.js';
8
- import { useId } from '../hooks/useId.js';
9
8
  import Token from '../Token/Token.js';
10
- import VisuallyHidden from '../_VisuallyHidden.js';
11
9
  import { TextInputWrapper } from '../internal/components/TextInputWrapper.js';
12
10
  import UnstyledTextInput from '../internal/components/UnstyledTextInput.js';
13
11
  import TextInputInnerVisualSlot from '../internal/components/TextInputInnerVisualSlot.js';
@@ -25,7 +23,7 @@ const overflowCountClassMap = {
25
23
 
26
24
  // using forwardRef is important so that other components (ex. Autocomplete) can use the ref
27
25
  function TextInputWithTokensInnerComponent(t0, forwardedRef) {
28
- const $ = c(152);
26
+ const $ = c(135);
29
27
  let IconComponent;
30
28
  let LeadingVisual;
31
29
  let TrailingVisual;
@@ -133,77 +131,46 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
133
131
  const preventTokenWrapping = t3 === undefined ? false : t3;
134
132
  const size = t4 === undefined ? "xlarge" : t4;
135
133
  const hideTokenRemoveButtons = t5 === undefined ? false : t5;
136
- let ariaDescribedByProp;
137
134
  let inputPropsRest;
138
135
  let onBlur;
139
136
  let onFocus;
140
137
  let onKeyDown;
141
- let role;
142
138
  if ($[25] !== rest) {
143
139
  ({
144
140
  onBlur,
145
141
  onFocus,
146
142
  onKeyDown,
147
- "aria-describedby": ariaDescribedByProp,
148
- role,
149
143
  ...inputPropsRest
150
144
  } = rest);
151
145
  $[25] = rest;
152
- $[26] = ariaDescribedByProp;
153
- $[27] = inputPropsRest;
154
- $[28] = onBlur;
155
- $[29] = onFocus;
156
- $[30] = onKeyDown;
157
- $[31] = role;
146
+ $[26] = inputPropsRest;
147
+ $[27] = onBlur;
148
+ $[28] = onFocus;
149
+ $[29] = onKeyDown;
158
150
  } else {
159
- ariaDescribedByProp = $[26];
160
- inputPropsRest = $[27];
161
- onBlur = $[28];
162
- onFocus = $[29];
163
- onKeyDown = $[30];
164
- role = $[31];
151
+ inputPropsRest = $[26];
152
+ onBlur = $[27];
153
+ onFocus = $[28];
154
+ onKeyDown = $[29];
165
155
  }
166
156
  const ref = useRef(null);
167
- const selectedValuesDescriptionId = useId();
168
- const combinedRef = useCombinedRefs(forwardedRef, ref);
157
+ useRefObjectAsForwardedRef(forwardedRef, ref);
169
158
  const [selectedTokenIndex, setSelectedTokenIndex] = useState();
170
159
  const [tokensAreTruncated, setTokensAreTruncated] = useState(Boolean(visibleTokenCount));
171
160
  let t6;
172
- if ($[32] !== tokens) {
173
- const selectedTokenTexts = tokens.map(_temp).filter(_temp2);
174
- t6 = selectedTokenTexts.length ? `Selected: ${selectedTokenTexts.join(", ")}` : "";
175
- $[32] = tokens;
176
- $[33] = t6;
161
+ if ($[30] !== selectedTokenIndex) {
162
+ t6 = [selectedTokenIndex];
163
+ $[30] = selectedTokenIndex;
164
+ $[31] = t6;
177
165
  } else {
178
- t6 = $[33];
179
- }
180
- const selectedValuesDescription = t6;
181
- const shouldExposeSelectedValuesDescription = role === "combobox" && Boolean(selectedValuesDescription);
182
- const t7 = shouldExposeSelectedValuesDescription ? selectedValuesDescriptionId : undefined;
183
- let t8;
184
- if ($[34] !== ariaDescribedByProp || $[35] !== t7) {
185
- t8 = [ariaDescribedByProp, t7].filter(Boolean);
186
- $[34] = ariaDescribedByProp;
187
- $[35] = t7;
188
- $[36] = t8;
189
- } else {
190
- t8 = $[36];
191
- }
192
- const ariaDescribedBy = t8.join(" ");
193
- let t9;
194
- if ($[37] !== selectedTokenIndex) {
195
- t9 = [selectedTokenIndex];
196
- $[37] = selectedTokenIndex;
197
- $[38] = t9;
198
- } else {
199
- t9 = $[38];
166
+ t6 = $[31];
200
167
  }
201
168
  const {
202
- containerRef: t10
169
+ containerRef: t7
203
170
  } = useFocusZone({
204
171
  focusOutBehavior: "wrap",
205
172
  bindKeys: FocusKeys.ArrowHorizontal | FocusKeys.HomeAndEnd,
206
- focusableElementFilter: _temp3,
173
+ focusableElementFilter: _temp,
207
174
  getNextFocusable: direction => {
208
175
  var _containerRef$current;
209
176
  if (!selectedTokenIndex && selectedTokenIndex !== 0) {
@@ -221,16 +188,16 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
221
188
  }
222
189
  return (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.children[nextIndex];
223
190
  }
224
- }, t9);
225
- const containerRef = t10;
226
- let t11;
227
- if ($[39] !== containerRef || $[40] !== onTokenRemove || $[41] !== selectedTokenIndex) {
228
- t11 = tokenId => {
191
+ }, t6);
192
+ const containerRef = t7;
193
+ let t8;
194
+ if ($[32] !== containerRef || $[33] !== onTokenRemove || $[34] !== selectedTokenIndex) {
195
+ t8 = tokenId => {
229
196
  onTokenRemove(tokenId);
230
197
  setTimeout(() => {
231
198
  var _containerRef$current2, _containerRef$current3;
232
199
  const nextElementToFocus = (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.children[selectedTokenIndex || 0];
233
- const firstFocusable = nextElementToFocus && isFocusable(nextElementToFocus) ? nextElementToFocus : Array.from(((_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.children) || []).find(_temp4);
200
+ const firstFocusable = nextElementToFocus && isFocusable(nextElementToFocus) ? nextElementToFocus : Array.from(((_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.children) || []).find(_temp2);
234
201
  if (firstFocusable) {
235
202
  firstFocusable.focus();
236
203
  } else {
@@ -239,30 +206,30 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
239
206
  }
240
207
  }, 0);
241
208
  };
242
- $[39] = containerRef;
243
- $[40] = onTokenRemove;
244
- $[41] = selectedTokenIndex;
245
- $[42] = t11;
209
+ $[32] = containerRef;
210
+ $[33] = onTokenRemove;
211
+ $[34] = selectedTokenIndex;
212
+ $[35] = t8;
246
213
  } else {
247
- t11 = $[42];
214
+ t8 = $[35];
248
215
  }
249
- const handleTokenRemove = t11;
250
- let t12;
251
- if ($[43] !== disabled) {
252
- t12 = tokenIndex => () => {
216
+ const handleTokenRemove = t8;
217
+ let t9;
218
+ if ($[36] !== disabled) {
219
+ t9 = tokenIndex => () => {
253
220
  if (!disabled) {
254
221
  setSelectedTokenIndex(tokenIndex);
255
222
  }
256
223
  };
257
- $[43] = disabled;
258
- $[44] = t12;
224
+ $[36] = disabled;
225
+ $[37] = t9;
259
226
  } else {
260
- t12 = $[44];
227
+ t9 = $[37];
261
228
  }
262
- const handleTokenFocus = t12;
263
- let t13;
264
- if ($[45] !== containerRef || $[46] !== visibleTokenCount) {
265
- t13 = () => {
229
+ const handleTokenFocus = t9;
230
+ let t10;
231
+ if ($[38] !== containerRef || $[39] !== visibleTokenCount) {
232
+ t10 = () => {
266
233
  setSelectedTokenIndex(undefined);
267
234
  setTimeout(() => {
268
235
  var _containerRef$current4;
@@ -271,43 +238,43 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
271
238
  }
272
239
  }, 0);
273
240
  };
274
- $[45] = containerRef;
275
- $[46] = visibleTokenCount;
276
- $[47] = t13;
241
+ $[38] = containerRef;
242
+ $[39] = visibleTokenCount;
243
+ $[40] = t10;
277
244
  } else {
278
- t13 = $[47];
245
+ t10 = $[40];
279
246
  }
280
- const handleTokenBlur = t13;
281
- let t14;
282
- if ($[48] === Symbol.for("react.memo_cache_sentinel")) {
283
- t14 = event => {
247
+ const handleTokenBlur = t10;
248
+ let t11;
249
+ if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
250
+ t11 = event => {
284
251
  if (event.key === "Escape") {
285
252
  var _ref$current2;
286
253
  (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.focus();
287
254
  }
288
255
  };
289
- $[48] = t14;
256
+ $[41] = t11;
290
257
  } else {
291
- t14 = $[48];
258
+ t11 = $[41];
292
259
  }
293
- const handleTokenKeyUp = t14;
294
- let t15;
295
- if ($[49] !== onFocus || $[50] !== visibleTokenCount) {
296
- t15 = event_0 => {
260
+ const handleTokenKeyUp = t11;
261
+ let t12;
262
+ if ($[42] !== onFocus || $[43] !== visibleTokenCount) {
263
+ t12 = event_0 => {
297
264
  onFocus && onFocus(event_0);
298
265
  setSelectedTokenIndex(undefined);
299
266
  visibleTokenCount && setTokensAreTruncated(false);
300
267
  };
301
- $[49] = onFocus;
302
- $[50] = visibleTokenCount;
303
- $[51] = t15;
268
+ $[42] = onFocus;
269
+ $[43] = visibleTokenCount;
270
+ $[44] = t12;
304
271
  } else {
305
- t15 = $[51];
272
+ t12 = $[44];
306
273
  }
307
- const handleInputFocus = t15;
308
- let t16;
309
- if ($[52] !== containerRef || $[53] !== onBlur || $[54] !== visibleTokenCount) {
310
- t16 = event_1 => {
274
+ const handleInputFocus = t12;
275
+ let t13;
276
+ if ($[45] !== containerRef || $[46] !== onBlur || $[47] !== visibleTokenCount) {
277
+ t13 = event_1 => {
311
278
  onBlur && onBlur(event_1);
312
279
  setTimeout(() => {
313
280
  var _containerRef$current5;
@@ -316,17 +283,17 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
316
283
  }
317
284
  }, 0);
318
285
  };
319
- $[52] = containerRef;
320
- $[53] = onBlur;
321
- $[54] = visibleTokenCount;
322
- $[55] = t16;
286
+ $[45] = containerRef;
287
+ $[46] = onBlur;
288
+ $[47] = visibleTokenCount;
289
+ $[48] = t13;
323
290
  } else {
324
- t16 = $[55];
291
+ t13 = $[48];
325
292
  }
326
- const handleInputBlur = t16;
327
- let t17;
328
- if ($[56] !== handleTokenRemove || $[57] !== onKeyDown || $[58] !== tokens) {
329
- t17 = e => {
293
+ const handleInputBlur = t13;
294
+ let t14;
295
+ if ($[49] !== handleTokenRemove || $[50] !== onKeyDown || $[51] !== tokens) {
296
+ t14 = e => {
330
297
  var _ref$current3;
331
298
  if (onKeyDown) {
332
299
  onKeyDown(e);
@@ -346,176 +313,148 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
346
313
  }, 0);
347
314
  }
348
315
  };
349
- $[56] = handleTokenRemove;
350
- $[57] = onKeyDown;
351
- $[58] = tokens;
352
- $[59] = t17;
316
+ $[49] = handleTokenRemove;
317
+ $[50] = onKeyDown;
318
+ $[51] = tokens;
319
+ $[52] = t14;
353
320
  } else {
354
- t17 = $[59];
321
+ t14 = $[52];
355
322
  }
356
- const handleInputKeyDown = t17;
357
- let t18;
358
- if ($[60] === Symbol.for("react.memo_cache_sentinel")) {
359
- t18 = () => {
323
+ const handleInputKeyDown = t14;
324
+ let t15;
325
+ if ($[53] === Symbol.for("react.memo_cache_sentinel")) {
326
+ t15 = () => {
360
327
  var _ref$current5;
361
328
  (_ref$current5 = ref.current) === null || _ref$current5 === void 0 ? void 0 : _ref$current5.focus();
362
329
  };
363
- $[60] = t18;
330
+ $[53] = t15;
364
331
  } else {
365
- t18 = $[60];
332
+ t15 = $[53];
366
333
  }
367
- const focusInput = t18;
368
- const preventTokenClickPropagation = _temp5;
369
- let t19;
370
- if ($[61] !== tokens || $[62] !== tokensAreTruncated || $[63] !== visibleTokenCount) {
371
- t19 = tokensAreTruncated ? tokens.slice(0, visibleTokenCount) : tokens;
372
- $[61] = tokens;
373
- $[62] = tokensAreTruncated;
374
- $[63] = visibleTokenCount;
375
- $[64] = t19;
334
+ const focusInput = t15;
335
+ const preventTokenClickPropagation = _temp3;
336
+ let t16;
337
+ if ($[54] !== tokens || $[55] !== tokensAreTruncated || $[56] !== visibleTokenCount) {
338
+ t16 = tokensAreTruncated ? tokens.slice(0, visibleTokenCount) : tokens;
339
+ $[54] = tokens;
340
+ $[55] = tokensAreTruncated;
341
+ $[56] = visibleTokenCount;
342
+ $[57] = t16;
376
343
  } else {
377
- t19 = $[64];
344
+ t16 = $[57];
378
345
  }
379
- const visibleTokens = t19;
380
- let t20;
381
- if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
382
- t20 = {
346
+ const visibleTokens = t16;
347
+ let t17;
348
+ if ($[58] === Symbol.for("react.memo_cache_sentinel")) {
349
+ t17 = {
383
350
  small: "small",
384
351
  medium: "small",
385
352
  large: "medium",
386
353
  xlarge: "medium"
387
354
  };
388
- $[65] = t20;
355
+ $[58] = t17;
389
356
  } else {
390
- t20 = $[65];
357
+ t17 = $[58];
391
358
  }
392
- const inputSizeMap = t20;
359
+ const inputSizeMap = t17;
393
360
  const showLeadingLoadingIndicator = loading && (loaderPosition === "leading" || Boolean(LeadingVisual && loaderPosition !== "trailing"));
394
361
  const showTrailingLoadingIndicator = loading && (loaderPosition === "trailing" || loaderPosition === "auto" && !LeadingVisual);
395
- const t21 = Boolean(LeadingVisual || showLeadingLoadingIndicator);
396
- const t22 = Boolean(TrailingVisual || showTrailingLoadingIndicator);
397
- const t23 = inputSizeMap[size];
398
- const t24 = Boolean(preventTokenWrapping || maxHeight) || undefined;
399
- let t25;
400
- if ($[66] !== className) {
401
- t25 = clsx(className, styles.TextInputWrapper);
402
- $[66] = className;
403
- $[67] = t25;
362
+ const t18 = Boolean(LeadingVisual || showLeadingLoadingIndicator);
363
+ const t19 = Boolean(TrailingVisual || showTrailingLoadingIndicator);
364
+ const t20 = inputSizeMap[size];
365
+ const t21 = Boolean(preventTokenWrapping || maxHeight) || undefined;
366
+ let t22;
367
+ if ($[59] !== className) {
368
+ t22 = clsx(className, styles.TextInputWrapper);
369
+ $[59] = className;
370
+ $[60] = t22;
404
371
  } else {
405
- t25 = $[67];
372
+ t22 = $[60];
406
373
  }
407
- let t26;
408
- if ($[68] !== maxHeight || $[69] !== style) {
409
- t26 = maxHeight ? {
374
+ let t23;
375
+ if ($[61] !== maxHeight || $[62] !== style) {
376
+ t23 = maxHeight ? {
410
377
  maxHeight,
411
378
  ...style
412
379
  } : style;
413
- $[68] = maxHeight;
414
- $[69] = style;
415
- $[70] = t26;
380
+ $[61] = maxHeight;
381
+ $[62] = style;
382
+ $[63] = t23;
416
383
  } else {
417
- t26 = $[70];
384
+ t23 = $[63];
418
385
  }
419
- let t27;
420
- if ($[71] !== IconComponent || $[72] !== LeadingVisual) {
421
- t27 = IconComponent && !LeadingVisual && /*#__PURE__*/jsx(IconComponent, {
386
+ let t24;
387
+ if ($[64] !== IconComponent || $[65] !== LeadingVisual) {
388
+ t24 = IconComponent && !LeadingVisual && /*#__PURE__*/jsx(IconComponent, {
422
389
  className: "TextInput-icon"
423
390
  });
424
- $[71] = IconComponent;
425
- $[72] = LeadingVisual;
426
- $[73] = t27;
391
+ $[64] = IconComponent;
392
+ $[65] = LeadingVisual;
393
+ $[66] = t24;
427
394
  } else {
428
- t27 = $[73];
395
+ t24 = $[66];
429
396
  }
430
- const t28 = typeof loading === "boolean";
431
- let t29;
432
- if ($[74] !== LeadingVisual) {
433
- t29 = typeof LeadingVisual !== "string" && isValidElementType(LeadingVisual) ? /*#__PURE__*/jsx(LeadingVisual, {}) : LeadingVisual;
434
- $[74] = LeadingVisual;
435
- $[75] = t29;
397
+ const t25 = typeof loading === "boolean";
398
+ let t26;
399
+ if ($[67] !== LeadingVisual) {
400
+ t26 = typeof LeadingVisual !== "string" && isValidElementType(LeadingVisual) ? /*#__PURE__*/jsx(LeadingVisual, {}) : LeadingVisual;
401
+ $[67] = LeadingVisual;
402
+ $[68] = t26;
436
403
  } else {
437
- t29 = $[75];
404
+ t26 = $[68];
438
405
  }
439
- let t30;
440
- if ($[76] !== showLeadingLoadingIndicator || $[77] !== t28 || $[78] !== t29) {
441
- t30 = /*#__PURE__*/jsx(TextInputInnerVisualSlot, {
442
- hasLoadingIndicator: t28,
406
+ let t27;
407
+ if ($[69] !== showLeadingLoadingIndicator || $[70] !== t25 || $[71] !== t26) {
408
+ t27 = /*#__PURE__*/jsx(TextInputInnerVisualSlot, {
409
+ hasLoadingIndicator: t25,
443
410
  visualPosition: "leading",
444
411
  showLoadingIndicator: showLeadingLoadingIndicator,
445
- children: t29
412
+ children: t26
446
413
  });
447
- $[76] = showLeadingLoadingIndicator;
448
- $[77] = t28;
449
- $[78] = t29;
450
- $[79] = t30;
414
+ $[69] = showLeadingLoadingIndicator;
415
+ $[70] = t25;
416
+ $[71] = t26;
417
+ $[72] = t27;
451
418
  } else {
452
- t30 = $[79];
419
+ t27 = $[72];
453
420
  }
454
- const t31 = containerRef;
455
- const t32 = validationStatus === "error" ? "true" : "false";
456
- const t33 = ariaDescribedBy || undefined;
457
- let t34;
458
- if ($[80] !== combinedRef || $[81] !== disabled || $[82] !== handleInputBlur || $[83] !== handleInputFocus || $[84] !== handleInputKeyDown || $[85] !== inputPropsRest || $[86] !== role || $[87] !== t32 || $[88] !== t33) {
459
- t34 = /*#__PURE__*/jsx(UnstyledTextInput, {
460
- ref: combinedRef,
461
- disabled: disabled,
462
- onFocus: handleInputFocus,
463
- onBlur: handleInputBlur,
464
- onKeyDown: handleInputKeyDown,
465
- type: "text",
466
- className: styles.UnstyledTextInput,
467
- "aria-invalid": t32,
468
- role: role,
469
- "aria-describedby": t33,
470
- ...inputPropsRest
471
- });
472
- $[80] = combinedRef;
473
- $[81] = disabled;
474
- $[82] = handleInputBlur;
475
- $[83] = handleInputFocus;
476
- $[84] = handleInputKeyDown;
477
- $[85] = inputPropsRest;
478
- $[86] = role;
479
- $[87] = t32;
480
- $[88] = t33;
481
- $[89] = t34;
482
- } else {
483
- t34 = $[89];
484
- }
485
- let t35;
486
- if ($[90] !== selectedValuesDescription || $[91] !== selectedValuesDescriptionId || $[92] !== shouldExposeSelectedValuesDescription) {
487
- t35 = shouldExposeSelectedValuesDescription ? /*#__PURE__*/jsx(VisuallyHidden, {
488
- id: selectedValuesDescriptionId,
489
- children: selectedValuesDescription
490
- }) : null;
491
- $[90] = selectedValuesDescription;
492
- $[91] = selectedValuesDescriptionId;
493
- $[92] = shouldExposeSelectedValuesDescription;
494
- $[93] = t35;
495
- } else {
496
- t35 = $[93];
497
- }
498
- let t36;
499
- if ($[94] !== t34 || $[95] !== t35) {
500
- t36 = /*#__PURE__*/jsxs("div", {
421
+ const t28 = containerRef;
422
+ const t29 = validationStatus === "error" ? "true" : "false";
423
+ let t30;
424
+ if ($[73] !== disabled || $[74] !== handleInputBlur || $[75] !== handleInputFocus || $[76] !== handleInputKeyDown || $[77] !== inputPropsRest || $[78] !== t29) {
425
+ t30 = /*#__PURE__*/jsx("div", {
501
426
  className: styles.InputWrapper,
502
- children: [t34, t35]
427
+ children: /*#__PURE__*/jsx(UnstyledTextInput, {
428
+ ref: ref,
429
+ disabled: disabled,
430
+ onFocus: handleInputFocus,
431
+ onBlur: handleInputBlur,
432
+ onKeyDown: handleInputKeyDown,
433
+ type: "text",
434
+ className: styles.UnstyledTextInput,
435
+ "aria-invalid": t29,
436
+ ...inputPropsRest
437
+ })
503
438
  });
504
- $[94] = t34;
505
- $[95] = t35;
506
- $[96] = t36;
439
+ $[73] = disabled;
440
+ $[74] = handleInputBlur;
441
+ $[75] = handleInputFocus;
442
+ $[76] = handleInputKeyDown;
443
+ $[77] = inputPropsRest;
444
+ $[78] = t29;
445
+ $[79] = t30;
507
446
  } else {
508
- t36 = $[96];
447
+ t30 = $[79];
509
448
  }
510
- let t37;
511
- if ($[97] !== TokenComponent || $[98] !== disabled || $[99] !== handleTokenBlur || $[100] !== handleTokenFocus || $[101] !== handleTokenRemove || $[102] !== hideTokenRemoveButtons || $[103] !== selectedTokenIndex || $[104] !== size || $[105] !== visibleTokens) {
512
- let t38;
513
- if ($[107] !== TokenComponent || $[108] !== disabled || $[109] !== handleTokenBlur || $[110] !== handleTokenFocus || $[111] !== handleTokenRemove || $[112] !== hideTokenRemoveButtons || $[113] !== selectedTokenIndex || $[114] !== size) {
514
- t38 = (t39, i) => {
449
+ let t31;
450
+ if ($[80] !== TokenComponent || $[81] !== disabled || $[82] !== handleTokenBlur || $[83] !== handleTokenFocus || $[84] !== handleTokenRemove || $[85] !== hideTokenRemoveButtons || $[86] !== selectedTokenIndex || $[87] !== size || $[88] !== visibleTokens) {
451
+ let t32;
452
+ if ($[90] !== TokenComponent || $[91] !== disabled || $[92] !== handleTokenBlur || $[93] !== handleTokenFocus || $[94] !== handleTokenRemove || $[95] !== hideTokenRemoveButtons || $[96] !== selectedTokenIndex || $[97] !== size) {
453
+ t32 = (t33, i) => {
515
454
  const {
516
455
  id,
517
456
  ...tokenRest
518
- } = t39;
457
+ } = t33;
519
458
  return /*#__PURE__*/jsx(TokenComponent, {
520
459
  disabled: disabled,
521
460
  onFocus: handleTokenFocus(i),
@@ -532,149 +471,140 @@ function TextInputWithTokensInnerComponent(t0, forwardedRef) {
532
471
  ...tokenRest
533
472
  }, id);
534
473
  };
535
- $[107] = TokenComponent;
536
- $[108] = disabled;
537
- $[109] = handleTokenBlur;
538
- $[110] = handleTokenFocus;
539
- $[111] = handleTokenRemove;
540
- $[112] = hideTokenRemoveButtons;
541
- $[113] = selectedTokenIndex;
542
- $[114] = size;
543
- $[115] = t38;
474
+ $[90] = TokenComponent;
475
+ $[91] = disabled;
476
+ $[92] = handleTokenBlur;
477
+ $[93] = handleTokenFocus;
478
+ $[94] = handleTokenRemove;
479
+ $[95] = hideTokenRemoveButtons;
480
+ $[96] = selectedTokenIndex;
481
+ $[97] = size;
482
+ $[98] = t32;
544
483
  } else {
545
- t38 = $[115];
484
+ t32 = $[98];
546
485
  }
547
- t37 = visibleTokens.map(t38);
548
- $[97] = TokenComponent;
549
- $[98] = disabled;
550
- $[99] = handleTokenBlur;
551
- $[100] = handleTokenFocus;
552
- $[101] = handleTokenRemove;
553
- $[102] = hideTokenRemoveButtons;
554
- $[103] = selectedTokenIndex;
555
- $[104] = size;
556
- $[105] = visibleTokens;
557
- $[106] = t37;
486
+ t31 = visibleTokens.map(t32);
487
+ $[80] = TokenComponent;
488
+ $[81] = disabled;
489
+ $[82] = handleTokenBlur;
490
+ $[83] = handleTokenFocus;
491
+ $[84] = handleTokenRemove;
492
+ $[85] = hideTokenRemoveButtons;
493
+ $[86] = selectedTokenIndex;
494
+ $[87] = size;
495
+ $[88] = visibleTokens;
496
+ $[89] = t31;
558
497
  } else {
559
- t37 = $[106];
498
+ t31 = $[89];
560
499
  }
561
- let t38;
562
- if ($[116] !== size || $[117] !== tokens.length || $[118] !== tokensAreTruncated || $[119] !== visibleTokens.length) {
563
- t38 = tokensAreTruncated && tokens.length - visibleTokens.length ? /*#__PURE__*/jsxs(Text, {
500
+ let t32;
501
+ if ($[99] !== size || $[100] !== tokens || $[101] !== tokensAreTruncated || $[102] !== visibleTokens.length) {
502
+ t32 = tokensAreTruncated && tokens.length - visibleTokens.length ? /*#__PURE__*/jsxs(Text, {
564
503
  className: overflowCountClassMap[size],
565
504
  children: ["+", tokens.length - visibleTokens.length]
566
505
  }) : null;
567
- $[116] = size;
568
- $[117] = tokens.length;
569
- $[118] = tokensAreTruncated;
570
- $[119] = visibleTokens.length;
571
- $[120] = t38;
506
+ $[99] = size;
507
+ $[100] = tokens;
508
+ $[101] = tokensAreTruncated;
509
+ $[102] = visibleTokens.length;
510
+ $[103] = t32;
572
511
  } else {
573
- t38 = $[120];
512
+ t32 = $[103];
574
513
  }
575
- let t39;
576
- if ($[121] !== preventTokenWrapping || $[122] !== t31 || $[123] !== t36 || $[124] !== t37 || $[125] !== t38) {
577
- t39 = /*#__PURE__*/jsxs("div", {
578
- ref: t31,
514
+ let t33;
515
+ if ($[104] !== preventTokenWrapping || $[105] !== t28 || $[106] !== t30 || $[107] !== t31 || $[108] !== t32) {
516
+ t33 = /*#__PURE__*/jsxs("div", {
517
+ ref: t28,
579
518
  className: styles.Container,
580
519
  "data-prevent-token-wrapping": preventTokenWrapping,
581
- children: [t36, t37, t38]
520
+ children: [t30, t31, t32]
582
521
  });
583
- $[121] = preventTokenWrapping;
584
- $[122] = t31;
585
- $[123] = t36;
586
- $[124] = t37;
587
- $[125] = t38;
588
- $[126] = t39;
522
+ $[104] = preventTokenWrapping;
523
+ $[105] = t28;
524
+ $[106] = t30;
525
+ $[107] = t31;
526
+ $[108] = t32;
527
+ $[109] = t33;
589
528
  } else {
590
- t39 = $[126];
529
+ t33 = $[109];
591
530
  }
592
- const t40 = typeof loading === "boolean";
593
- let t41;
594
- if ($[127] !== TrailingVisual) {
595
- t41 = typeof TrailingVisual !== "string" && isValidElementType(TrailingVisual) ? /*#__PURE__*/jsx(TrailingVisual, {}) : TrailingVisual;
596
- $[127] = TrailingVisual;
597
- $[128] = t41;
531
+ const t34 = typeof loading === "boolean";
532
+ let t35;
533
+ if ($[110] !== TrailingVisual) {
534
+ t35 = typeof TrailingVisual !== "string" && isValidElementType(TrailingVisual) ? /*#__PURE__*/jsx(TrailingVisual, {}) : TrailingVisual;
535
+ $[110] = TrailingVisual;
536
+ $[111] = t35;
598
537
  } else {
599
- t41 = $[128];
538
+ t35 = $[111];
600
539
  }
601
- let t42;
602
- if ($[129] !== showTrailingLoadingIndicator || $[130] !== t40 || $[131] !== t41) {
603
- t42 = /*#__PURE__*/jsx(TextInputInnerVisualSlot, {
604
- hasLoadingIndicator: t40,
540
+ let t36;
541
+ if ($[112] !== showTrailingLoadingIndicator || $[113] !== t34 || $[114] !== t35) {
542
+ t36 = /*#__PURE__*/jsx(TextInputInnerVisualSlot, {
543
+ hasLoadingIndicator: t34,
605
544
  visualPosition: "trailing",
606
545
  showLoadingIndicator: showTrailingLoadingIndicator,
607
- children: t41
546
+ children: t35
608
547
  });
609
- $[129] = showTrailingLoadingIndicator;
610
- $[130] = t40;
611
- $[131] = t41;
612
- $[132] = t42;
548
+ $[112] = showTrailingLoadingIndicator;
549
+ $[113] = t34;
550
+ $[114] = t35;
551
+ $[115] = t36;
613
552
  } else {
614
- t42 = $[132];
553
+ t36 = $[115];
615
554
  }
616
- let t43;
617
- if ($[133] !== block || $[134] !== contrast || $[135] !== disabled || $[136] !== maxWidthProp || $[137] !== minWidthProp || $[138] !== t21 || $[139] !== t22 || $[140] !== t23 || $[141] !== t24 || $[142] !== t25 || $[143] !== t26 || $[144] !== t27 || $[145] !== t30 || $[146] !== t39 || $[147] !== t42 || $[148] !== validationStatus || $[149] !== variantProp || $[150] !== widthProp) {
618
- t43 = /*#__PURE__*/jsxs(TextInputWrapper, {
555
+ let t37;
556
+ if ($[116] !== block || $[117] !== contrast || $[118] !== disabled || $[119] !== maxWidthProp || $[120] !== minWidthProp || $[121] !== t18 || $[122] !== t19 || $[123] !== t20 || $[124] !== t21 || $[125] !== t22 || $[126] !== t23 || $[127] !== t24 || $[128] !== t27 || $[129] !== t33 || $[130] !== t36 || $[131] !== validationStatus || $[132] !== variantProp || $[133] !== widthProp) {
557
+ t37 = /*#__PURE__*/jsxs(TextInputWrapper, {
619
558
  block: block,
620
559
  contrast: contrast,
621
560
  disabled: disabled,
622
- hasLeadingVisual: t21,
623
- hasTrailingVisual: t22,
561
+ hasLeadingVisual: t18,
562
+ hasTrailingVisual: t19,
624
563
  width: widthProp,
625
564
  minWidth: minWidthProp,
626
565
  maxWidth: maxWidthProp,
627
- size: t23,
566
+ size: t20,
628
567
  validationStatus: validationStatus,
629
568
  variant: variantProp,
630
569
  onClick: focusInput,
631
- "data-token-wrapping": t24,
632
- className: t25,
633
- style: t26,
634
- children: [t27, t30, t39, t42]
570
+ "data-token-wrapping": t21,
571
+ className: t22,
572
+ style: t23,
573
+ children: [t24, t27, t33, t36]
635
574
  });
636
- $[133] = block;
637
- $[134] = contrast;
638
- $[135] = disabled;
639
- $[136] = maxWidthProp;
640
- $[137] = minWidthProp;
641
- $[138] = t21;
642
- $[139] = t22;
643
- $[140] = t23;
644
- $[141] = t24;
645
- $[142] = t25;
646
- $[143] = t26;
647
- $[144] = t27;
648
- $[145] = t30;
649
- $[146] = t39;
650
- $[147] = t42;
651
- $[148] = validationStatus;
652
- $[149] = variantProp;
653
- $[150] = widthProp;
654
- $[151] = t43;
575
+ $[116] = block;
576
+ $[117] = contrast;
577
+ $[118] = disabled;
578
+ $[119] = maxWidthProp;
579
+ $[120] = minWidthProp;
580
+ $[121] = t18;
581
+ $[122] = t19;
582
+ $[123] = t20;
583
+ $[124] = t21;
584
+ $[125] = t22;
585
+ $[126] = t23;
586
+ $[127] = t24;
587
+ $[128] = t27;
588
+ $[129] = t33;
589
+ $[130] = t36;
590
+ $[131] = validationStatus;
591
+ $[132] = variantProp;
592
+ $[133] = widthProp;
593
+ $[134] = t37;
655
594
  } else {
656
- t43 = $[151];
595
+ t37 = $[134];
657
596
  }
658
- return t43;
597
+ return t37;
659
598
  }
660
- function _temp5(event_2) {
599
+ function _temp3(event_2) {
661
600
  event_2.stopPropagation();
662
601
  }
663
- function _temp4(el) {
602
+ function _temp2(el) {
664
603
  return isFocusable(el);
665
604
  }
666
- function _temp3(element) {
605
+ function _temp(element) {
667
606
  return !element.getAttributeNames().includes("aria-hidden");
668
607
  }
669
- function _temp2(tokenText) {
670
- return tokenText !== null;
671
- }
672
- function _temp(token) {
673
- if ("text" in token && typeof token.text === "string" && token.text.trim().length) {
674
- return token.text;
675
- }
676
- return null;
677
- }
678
608
  const TextInputWithTokens = /*#__PURE__*/React.forwardRef(TextInputWithTokensInnerComponent);
679
609
  TextInputWithTokens.displayName = 'TextInputWithTokens';
680
610
  TextInputWithTokens.__SLOT__ = Symbol('TextInputWithTokens');