@primer/react 0.0.0-20260306145046 → 0.0.0-20260306164000

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