@primer/react 0.0.0-20260220194645 → 0.0.0-20260220200446

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 (83) hide show
  1. package/CHANGELOG.md +2 -24
  2. package/dist/ActionList/ActionList-f4ac3b54.css +2 -0
  3. package/dist/ActionList/ActionList-f4ac3b54.css.map +1 -0
  4. package/dist/ActionList/ActionList.module.css.js +1 -1
  5. package/dist/ActionList/Item.d.ts.map +1 -1
  6. package/dist/ActionList/Item.js +0 -1
  7. package/dist/Autocomplete/Autocomplete.js +159 -76
  8. package/dist/Autocomplete/AutocompleteMenu.js +333 -128
  9. package/dist/Autocomplete/AutocompleteOverlay.js +130 -49
  10. package/dist/Banner/Banner.js +238 -64
  11. package/dist/Blankslate/{Blankslate-a039d79a.css → Blankslate-f5a9755a.css} +2 -2
  12. package/dist/Blankslate/Blankslate-f5a9755a.css.map +1 -0
  13. package/dist/Blankslate/Blankslate.module.css.js +1 -1
  14. package/dist/Button/Button.js +34 -11
  15. package/dist/Button/IconButton.js +140 -51
  16. package/dist/Button/LinkButton.js +39 -11
  17. package/dist/Checkbox/Checkbox.js +163 -55
  18. package/dist/Dialog/Dialog.js +347 -105
  19. package/dist/FilteredActionList/FilteredActionList.d.ts +1 -16
  20. package/dist/FilteredActionList/FilteredActionList.d.ts.map +1 -1
  21. package/dist/FilteredActionList/FilteredActionList.js +42 -147
  22. package/dist/PageLayout/PageLayout-cb491b47.css +2 -0
  23. package/dist/PageLayout/PageLayout-cb491b47.css.map +1 -0
  24. package/dist/PageLayout/PageLayout.d.ts +2 -72
  25. package/dist/PageLayout/PageLayout.d.ts.map +1 -1
  26. package/dist/PageLayout/PageLayout.js +1235 -750
  27. package/dist/PageLayout/PageLayout.module.css.js +2 -2
  28. package/dist/PageLayout/usePaneWidth.d.ts +5 -18
  29. package/dist/PageLayout/usePaneWidth.d.ts.map +1 -1
  30. package/dist/PageLayout/usePaneWidth.js +111 -125
  31. package/dist/SelectPanel/SelectPanel.d.ts +1 -1
  32. package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
  33. package/dist/SelectPanel/SelectPanel.js +1 -3
  34. package/dist/SplitPageLayout/SplitPageLayout.d.ts +1 -4
  35. package/dist/SplitPageLayout/SplitPageLayout.d.ts.map +1 -1
  36. package/dist/SplitPageLayout/SplitPageLayout.js +2 -54
  37. package/dist/Text/Text.d.ts +1 -1
  38. package/dist/Text/Text.d.ts.map +1 -1
  39. package/dist/Text/Text.js +13 -10
  40. package/dist/UnderlineNav/UnderlineNav-1e84e6f4.css +2 -0
  41. package/dist/UnderlineNav/UnderlineNav-1e84e6f4.css.map +1 -0
  42. package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
  43. package/dist/UnderlineNav/UnderlineNav.js +87 -324
  44. package/dist/UnderlineNav/UnderlineNav.module.css.js +2 -2
  45. package/dist/UnderlineNav/UnderlineNavContext.d.ts +4 -11
  46. package/dist/UnderlineNav/UnderlineNavContext.d.ts.map +1 -1
  47. package/dist/UnderlineNav/UnderlineNavContext.js +2 -3
  48. package/dist/UnderlineNav/UnderlineNavItem-db9dc5d0.css +2 -0
  49. package/dist/UnderlineNav/UnderlineNavItem-db9dc5d0.css.map +1 -0
  50. package/dist/UnderlineNav/UnderlineNavItem.d.ts.map +1 -1
  51. package/dist/UnderlineNav/UnderlineNavItem.js +163 -59
  52. package/dist/UnderlineNav/UnderlineNavItem.module.css.js +1 -1
  53. package/dist/experimental/SelectPanel2/SelectPanel.js +593 -209
  54. package/dist/experimental/UnderlinePanels/UnderlinePanels.js +1 -1
  55. package/dist/hooks/useRefObjectAsForwardedRef.d.ts.map +1 -1
  56. package/dist/hooks/useRefObjectAsForwardedRef.js +2 -10
  57. package/dist/hooks/useScrollFlash.d.ts.map +1 -1
  58. package/dist/hooks/useScrollFlash.js +22 -14
  59. package/dist/hooks/useSlots.d.ts +6 -50
  60. package/dist/hooks/useSlots.d.ts.map +1 -1
  61. package/dist/hooks/useSlots.js +36 -114
  62. package/dist/internal/components/UnderlineTabbedInterface-66fdf174.css +2 -0
  63. package/dist/internal/components/UnderlineTabbedInterface-66fdf174.css.map +1 -0
  64. package/dist/internal/components/UnderlineTabbedInterface.d.ts +0 -1
  65. package/dist/internal/components/UnderlineTabbedInterface.d.ts.map +1 -1
  66. package/dist/internal/components/UnderlineTabbedInterface.js +66 -60
  67. package/dist/internal/components/UnderlineTabbedInterface.module.css.js +1 -1
  68. package/generated/components.json +4 -196
  69. package/package.json +2 -2
  70. package/dist/ActionList/ActionList-c04a02d6.css +0 -2
  71. package/dist/ActionList/ActionList-c04a02d6.css.map +0 -1
  72. package/dist/Blankslate/Blankslate-a039d79a.css.map +0 -1
  73. package/dist/PageLayout/PageLayout-06f4c069.css +0 -2
  74. package/dist/PageLayout/PageLayout-06f4c069.css.map +0 -1
  75. package/dist/UnderlineNav/UnderlineNav-4344d9b0.css +0 -2
  76. package/dist/UnderlineNav/UnderlineNav-4344d9b0.css.map +0 -1
  77. package/dist/UnderlineNav/UnderlineNavItem-b65e8fd3.css +0 -2
  78. package/dist/UnderlineNav/UnderlineNavItem-b65e8fd3.css.map +0 -1
  79. package/dist/UnderlineNav/styles.d.ts +0 -16
  80. package/dist/UnderlineNav/styles.d.ts.map +0 -1
  81. package/dist/UnderlineNav/styles.js +0 -19
  82. package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css +0 -2
  83. package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css.map +0 -1
@@ -1,5 +1,6 @@
1
+ import { c } from 'react-compiler-runtime';
1
2
  import React, { useState, useEffect } from 'react';
2
- import { AlertIcon, SearchIcon, XCircleFillIcon, ArrowLeftIcon, FilterRemoveIcon, XIcon } from '@primer/octicons-react';
3
+ import { AlertIcon, XCircleFillIcon, SearchIcon, ArrowLeftIcon, FilterRemoveIcon, XIcon } from '@primer/octicons-react';
3
4
  import { ActionListContainerContext } from '../../ActionList/ActionListContainerContext.js';
4
5
  import { useSlots } from '../../hooks/useSlots.js';
5
6
  import { BaseOverlay, heightMap } from '../../Overlay/Overlay.js';
@@ -15,14 +16,14 @@ import { useId } from '../../hooks/useId.js';
15
16
  import { useAnchoredPosition } from '../../hooks/useAnchoredPosition.js';
16
17
  import { AriaStatus } from '../../live-region/AriaStatus.js';
17
18
  import Octicon from '../../Octicon/Octicon.js';
18
- import Spinner from '../../Spinner/Spinner.js';
19
- import { ButtonComponent } from '../../Button/Button.js';
20
19
  import TextInput from '../../TextInput/TextInput.js';
21
- import { IconButton } from '../../Button/IconButton.js';
22
- import Heading from '../../Heading/Heading.js';
23
20
  import { useFormControlForwardedProps } from '../../FormControl/_FormControlContext.js';
21
+ import { ButtonComponent } from '../../Button/Button.js';
24
22
  import Link from '../../Link/Link.js';
25
23
  import Checkbox from '../../Checkbox/Checkbox.js';
24
+ import { IconButton } from '../../Button/IconButton.js';
25
+ import Heading from '../../Heading/Heading.js';
26
+ import Spinner from '../../Spinner/Spinner.js';
26
27
 
27
28
  const SelectPanelContext = /*#__PURE__*/React.createContext({
28
29
  title: '',
@@ -113,10 +114,10 @@ const Panel = ({
113
114
  const onInternalClearSelection = () => {
114
115
  if (typeof propsOnClearSelection === 'function') propsOnClearSelection();
115
116
  };
116
- const internalAfterSelect = event => {
117
+ const internalAfterSelect = event_0 => {
117
118
  if (selectionVariant === 'instant') onInternalSubmit();
118
- if (event.type === 'keypress') {
119
- if (event.key === 'Enter') onInternalSubmit();
119
+ if (event_0.type === 'keypress') {
120
+ if (event_0.key === 'Enter') onInternalSubmit();
120
121
  }
121
122
  };
122
123
 
@@ -158,12 +159,12 @@ const Panel = ({
158
159
 
159
160
  // Esc handler
160
161
  React.useEffect(() => {
161
- const dialogEl = dialogRef.current;
162
- const handler = event => {
163
- if (event.key === 'Escape') onInternalCancel();
162
+ const dialogEl_0 = dialogRef.current;
163
+ const handler = event_1 => {
164
+ if (event_1.key === 'Escape') onInternalCancel();
164
165
  };
165
- dialogEl === null || dialogEl === void 0 ? void 0 : dialogEl.addEventListener('keydown', handler);
166
- return () => dialogEl === null || dialogEl === void 0 ? void 0 : dialogEl.removeEventListener('keydown', handler);
166
+ dialogEl_0 === null || dialogEl_0 === void 0 ? void 0 : dialogEl_0.addEventListener('keydown', handler);
167
+ return () => dialogEl_0 === null || dialogEl_0 === void 0 ? void 0 : dialogEl_0.removeEventListener('keydown', handler);
167
168
  }, [onInternalCancel]);
168
169
 
169
170
  // Autofocus hack: React doesn't support autoFocus for dialog: https://github.com/facebook/react/issues/23301
@@ -217,8 +218,8 @@ const Panel = ({
217
218
  },
218
219
  className: clsx(classes.Overlay, className),
219
220
  ...props,
220
- onClick: event => {
221
- if (event.target === event.currentTarget) onClickOutside();
221
+ onClick: event_2 => {
222
+ if (event_2.target === event_2.currentTarget) onClickOutside();
222
223
  },
223
224
  children: internalOpen && /*#__PURE__*/jsx(Fragment, {
224
225
  children: /*#__PURE__*/jsx(SelectPanelContext.Provider, {
@@ -286,15 +287,40 @@ const SelectPanelButton = /*#__PURE__*/React.forwardRef((props, anchorRef) => {
286
287
  }
287
288
  });
288
289
  SelectPanelButton.__SLOT__ = Symbol('SelectPanel.Button');
289
- const SelectPanelHeader = ({
290
- children,
291
- onBack,
292
- className,
293
- ...props
294
- }) => {
295
- const [slots, childrenWithoutSlots] = useSlots(children, {
296
- searchInput: SelectPanelSearchInput
297
- });
290
+ const SelectPanelHeader = t0 => {
291
+ const $ = c(42);
292
+ let children;
293
+ let className;
294
+ let onBack;
295
+ let props;
296
+ if ($[0] !== t0) {
297
+ ({
298
+ children,
299
+ onBack,
300
+ className,
301
+ ...props
302
+ } = t0);
303
+ $[0] = t0;
304
+ $[1] = children;
305
+ $[2] = className;
306
+ $[3] = onBack;
307
+ $[4] = props;
308
+ } else {
309
+ children = $[1];
310
+ className = $[2];
311
+ onBack = $[3];
312
+ props = $[4];
313
+ }
314
+ let t1;
315
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
316
+ t1 = {
317
+ searchInput: SelectPanelSearchInput
318
+ };
319
+ $[5] = t1;
320
+ } else {
321
+ t1 = $[5];
322
+ }
323
+ const [slots, childrenWithoutSlots] = useSlots(children, t1);
298
324
  const {
299
325
  title,
300
326
  description,
@@ -302,246 +328,604 @@ const SelectPanelHeader = ({
302
328
  onCancel,
303
329
  onClearSelection
304
330
  } = React.useContext(SelectPanelContext);
305
- return /*#__PURE__*/jsxs("div", {
306
- className: clsx(classes.Header, className),
307
- ...props,
308
- children: [/*#__PURE__*/jsxs("div", {
331
+ let t2;
332
+ if ($[6] !== className) {
333
+ t2 = clsx(classes.Header, className);
334
+ $[6] = className;
335
+ $[7] = t2;
336
+ } else {
337
+ t2 = $[7];
338
+ }
339
+ const t3 = description ? true : undefined;
340
+ const t4 = slots.searchInput ? true : undefined;
341
+ let t5;
342
+ if ($[8] !== onBack) {
343
+ t5 = onBack ? /*#__PURE__*/jsx(IconButton, {
344
+ type: "button",
345
+ variant: "invisible",
346
+ icon: ArrowLeftIcon,
347
+ "aria-label": "Back",
348
+ onClick: () => onBack()
349
+ }) : null;
350
+ $[8] = onBack;
351
+ $[9] = t5;
352
+ } else {
353
+ t5 = $[9];
354
+ }
355
+ const t6 = description ? true : undefined;
356
+ const t7 = onBack ? true : undefined;
357
+ const t8 = `${panelId}--title`;
358
+ let t9;
359
+ if ($[10] !== t8 || $[11] !== title) {
360
+ t9 = /*#__PURE__*/jsx(Heading, {
361
+ as: "h1",
362
+ id: t8,
363
+ className: classes.Title,
364
+ children: title
365
+ });
366
+ $[10] = t8;
367
+ $[11] = title;
368
+ $[12] = t9;
369
+ } else {
370
+ t9 = $[12];
371
+ }
372
+ let t10;
373
+ if ($[13] !== description || $[14] !== panelId) {
374
+ t10 = description ? /*#__PURE__*/jsx("span", {
375
+ id: `${panelId}--description`,
376
+ className: classes.Description,
377
+ children: description
378
+ }) : null;
379
+ $[13] = description;
380
+ $[14] = panelId;
381
+ $[15] = t10;
382
+ } else {
383
+ t10 = $[15];
384
+ }
385
+ let t11;
386
+ if ($[16] !== t10 || $[17] !== t6 || $[18] !== t7 || $[19] !== t9) {
387
+ t11 = /*#__PURE__*/jsxs("div", {
388
+ className: classes.TitleWrapper,
389
+ "data-description": t6,
390
+ "data-on-back": t7,
391
+ children: [t9, t10]
392
+ });
393
+ $[16] = t10;
394
+ $[17] = t6;
395
+ $[18] = t7;
396
+ $[19] = t9;
397
+ $[20] = t11;
398
+ } else {
399
+ t11 = $[20];
400
+ }
401
+ let t12;
402
+ if ($[21] !== t11 || $[22] !== t5) {
403
+ t12 = /*#__PURE__*/jsxs("div", {
404
+ className: classes.FlexBox,
405
+ children: [t5, t11]
406
+ });
407
+ $[21] = t11;
408
+ $[22] = t5;
409
+ $[23] = t12;
410
+ } else {
411
+ t12 = $[23];
412
+ }
413
+ let t13;
414
+ if ($[24] !== onClearSelection) {
415
+ t13 = onClearSelection ? /*#__PURE__*/jsx(IconButton, {
416
+ type: "button",
417
+ variant: "invisible",
418
+ icon: FilterRemoveIcon,
419
+ "aria-label": "Clear selection",
420
+ onClick: onClearSelection
421
+ }) : null;
422
+ $[24] = onClearSelection;
423
+ $[25] = t13;
424
+ } else {
425
+ t13 = $[25];
426
+ }
427
+ let t14;
428
+ if ($[26] !== onCancel) {
429
+ t14 = /*#__PURE__*/jsx(IconButton, {
430
+ type: "button",
431
+ variant: "invisible",
432
+ icon: XIcon,
433
+ "aria-label": "Close",
434
+ onClick: () => onCancel()
435
+ });
436
+ $[26] = onCancel;
437
+ $[27] = t14;
438
+ } else {
439
+ t14 = $[27];
440
+ }
441
+ let t15;
442
+ if ($[28] !== t13 || $[29] !== t14) {
443
+ t15 = /*#__PURE__*/jsxs("div", {
444
+ children: [t13, t14]
445
+ });
446
+ $[28] = t13;
447
+ $[29] = t14;
448
+ $[30] = t15;
449
+ } else {
450
+ t15 = $[30];
451
+ }
452
+ let t16;
453
+ if ($[31] !== t12 || $[32] !== t15 || $[33] !== t3 || $[34] !== t4) {
454
+ t16 = /*#__PURE__*/jsxs("div", {
309
455
  className: classes.HeaderContent,
310
- "data-description": description ? true : undefined,
311
- "data-search-input": slots.searchInput ? true : undefined,
312
- children: [/*#__PURE__*/jsxs("div", {
313
- className: classes.FlexBox,
314
- children: [onBack ? /*#__PURE__*/jsx(IconButton, {
315
- type: "button",
316
- variant: "invisible",
317
- icon: ArrowLeftIcon,
318
- "aria-label": "Back",
319
- onClick: () => onBack()
320
- }) : null, /*#__PURE__*/jsxs("div", {
321
- className: classes.TitleWrapper,
322
- "data-description": description ? true : undefined,
323
- "data-on-back": onBack ? true : undefined,
324
- children: [/*#__PURE__*/jsx(Heading, {
325
- as: "h1",
326
- id: `${panelId}--title`,
327
- className: classes.Title,
328
- children: title
329
- }), description ? /*#__PURE__*/jsx("span", {
330
- id: `${panelId}--description`,
331
- className: classes.Description,
332
- children: description
333
- }) : null]
334
- })]
335
- }), /*#__PURE__*/jsxs("div", {
336
- children: [onClearSelection ? /*#__PURE__*/jsx(IconButton, {
337
- type: "button",
338
- variant: "invisible",
339
- icon: FilterRemoveIcon,
340
- "aria-label": "Clear selection",
341
- onClick: onClearSelection
342
- }) : null, /*#__PURE__*/jsx(IconButton, {
343
- type: "button",
344
- variant: "invisible",
345
- icon: XIcon,
346
- "aria-label": "Close",
347
- onClick: () => onCancel()
348
- })]
349
- })]
350
- }), slots.searchInput, childrenWithoutSlots]
351
- });
456
+ "data-description": t3,
457
+ "data-search-input": t4,
458
+ children: [t12, t15]
459
+ });
460
+ $[31] = t12;
461
+ $[32] = t15;
462
+ $[33] = t3;
463
+ $[34] = t4;
464
+ $[35] = t16;
465
+ } else {
466
+ t16 = $[35];
467
+ }
468
+ let t17;
469
+ if ($[36] !== childrenWithoutSlots || $[37] !== props || $[38] !== slots.searchInput || $[39] !== t16 || $[40] !== t2) {
470
+ t17 = /*#__PURE__*/jsxs("div", {
471
+ className: t2,
472
+ ...props,
473
+ children: [t16, slots.searchInput, childrenWithoutSlots]
474
+ });
475
+ $[36] = childrenWithoutSlots;
476
+ $[37] = props;
477
+ $[38] = slots.searchInput;
478
+ $[39] = t16;
479
+ $[40] = t2;
480
+ $[41] = t17;
481
+ } else {
482
+ t17 = $[41];
483
+ }
484
+ return t17;
352
485
  };
353
- SelectPanelHeader.displayName = "SelectPanelHeader";
354
486
  SelectPanelHeader.__SLOT__ = Symbol('SelectPanel.Header');
355
- const SelectPanelSearchInput = ({
356
- onChange: propsOnChange,
357
- onKeyDown: propsOnKeyDown,
358
- className,
359
- ...props
360
- }) => {
361
- // TODO: use forwardedRef
362
- const inputRef = /*#__PURE__*/React.createRef();
487
+ const SelectPanelSearchInput = t0 => {
488
+ const $ = c(22);
489
+ let className;
490
+ let props;
491
+ let propsOnChange;
492
+ let propsOnKeyDown;
493
+ if ($[0] !== t0) {
494
+ ({
495
+ onChange: propsOnChange,
496
+ onKeyDown: propsOnKeyDown,
497
+ className,
498
+ ...props
499
+ } = t0);
500
+ $[0] = t0;
501
+ $[1] = className;
502
+ $[2] = props;
503
+ $[3] = propsOnChange;
504
+ $[4] = propsOnKeyDown;
505
+ } else {
506
+ className = $[1];
507
+ props = $[2];
508
+ propsOnChange = $[3];
509
+ propsOnKeyDown = $[4];
510
+ }
511
+ let t1;
512
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
513
+ t1 = /*#__PURE__*/React.createRef();
514
+ $[5] = t1;
515
+ } else {
516
+ t1 = $[5];
517
+ }
518
+ const inputRef = t1;
363
519
  const {
364
520
  setSearchQuery,
365
521
  moveFocusToList
366
522
  } = React.useContext(SelectPanelContext);
367
- const internalOnChange = event => {
368
- // If props.onChange is given, the application controls search,
369
- // otherwise the component does
370
- if (typeof propsOnChange === 'function') propsOnChange(event);else setSearchQuery(event.target.value);
371
- };
372
- const internalKeyDown = event => {
373
- if (event.key === 'ArrowDown') {
374
- event.preventDefault(); // prevent scroll
375
- moveFocusToList();
376
- }
377
- if (typeof propsOnKeyDown === 'function') propsOnKeyDown(event);
378
- };
379
- return /*#__PURE__*/jsx(TextInput, {
380
- ref: inputRef,
381
- block: true,
382
- leadingVisual: SearchIcon,
383
- placeholder: "Search",
384
- trailingAction: /*#__PURE__*/jsx(TextInput.Action, {
523
+ let t2;
524
+ if ($[6] !== propsOnChange || $[7] !== setSearchQuery) {
525
+ t2 = event => {
526
+ if (typeof propsOnChange === "function") {
527
+ propsOnChange(event);
528
+ } else {
529
+ setSearchQuery(event.target.value);
530
+ }
531
+ };
532
+ $[6] = propsOnChange;
533
+ $[7] = setSearchQuery;
534
+ $[8] = t2;
535
+ } else {
536
+ t2 = $[8];
537
+ }
538
+ const internalOnChange = t2;
539
+ let t3;
540
+ if ($[9] !== moveFocusToList || $[10] !== propsOnKeyDown) {
541
+ t3 = event_0 => {
542
+ if (event_0.key === "ArrowDown") {
543
+ event_0.preventDefault();
544
+ moveFocusToList();
545
+ }
546
+ if (typeof propsOnKeyDown === "function") {
547
+ propsOnKeyDown(event_0);
548
+ }
549
+ };
550
+ $[9] = moveFocusToList;
551
+ $[10] = propsOnKeyDown;
552
+ $[11] = t3;
553
+ } else {
554
+ t3 = $[11];
555
+ }
556
+ const internalKeyDown = t3;
557
+ let t4;
558
+ if ($[12] !== propsOnChange) {
559
+ t4 = /*#__PURE__*/jsx(TextInput.Action, {
385
560
  icon: XCircleFillIcon,
386
561
  "aria-label": "Clear",
387
562
  tooltipDirection: "w",
388
563
  className: classes.ClearAction,
389
564
  onClick: () => {
390
- if (inputRef.current) inputRef.current.value = '';
391
- if (typeof propsOnChange === 'function') {
392
- // @ts-ignore TODO this is a hacky solution to clear
565
+ if (inputRef.current) {
566
+ inputRef.current.value = "";
567
+ }
568
+ if (typeof propsOnChange === "function") {
393
569
  propsOnChange({
394
570
  target: inputRef.current,
395
571
  currentTarget: inputRef.current
396
572
  });
397
573
  }
398
574
  }
399
- }),
400
- className: clsx(classes.TextInput, className),
401
- onChange: internalOnChange,
402
- onKeyDown: internalKeyDown,
403
- ...props
404
- });
575
+ });
576
+ $[12] = propsOnChange;
577
+ $[13] = t4;
578
+ } else {
579
+ t4 = $[13];
580
+ }
581
+ let t5;
582
+ if ($[14] !== className) {
583
+ t5 = clsx(classes.TextInput, className);
584
+ $[14] = className;
585
+ $[15] = t5;
586
+ } else {
587
+ t5 = $[15];
588
+ }
589
+ let t6;
590
+ if ($[16] !== internalKeyDown || $[17] !== internalOnChange || $[18] !== props || $[19] !== t4 || $[20] !== t5) {
591
+ t6 = /*#__PURE__*/jsx(TextInput, {
592
+ ref: inputRef,
593
+ block: true,
594
+ leadingVisual: SearchIcon,
595
+ placeholder: "Search",
596
+ trailingAction: t4,
597
+ className: t5,
598
+ onChange: internalOnChange,
599
+ onKeyDown: internalKeyDown,
600
+ ...props
601
+ });
602
+ $[16] = internalKeyDown;
603
+ $[17] = internalOnChange;
604
+ $[18] = props;
605
+ $[19] = t4;
606
+ $[20] = t5;
607
+ $[21] = t6;
608
+ } else {
609
+ t6 = $[21];
610
+ }
611
+ return t6;
405
612
  };
406
- SelectPanelSearchInput.displayName = "SelectPanelSearchInput";
407
613
  SelectPanelSearchInput.__SLOT__ = Symbol('SelectPanel.SearchInput');
408
614
  const FooterContext = /*#__PURE__*/React.createContext(false);
409
- const SelectPanelFooter = ({
410
- ...props
411
- }) => {
615
+ const SelectPanelFooter = t0 => {
616
+ const $ = c(13);
617
+ let props;
618
+ if ($[0] !== t0) {
619
+ ({
620
+ ...props
621
+ } = t0);
622
+ $[0] = t0;
623
+ $[1] = props;
624
+ } else {
625
+ props = $[1];
626
+ }
412
627
  const {
413
628
  onCancel,
414
629
  selectionVariant
415
630
  } = React.useContext(SelectPanelContext);
416
- const hidePrimaryActions = selectionVariant === 'instant';
417
- const buttonSize = useResponsiveValue(responsiveButtonSizes, 'small');
631
+ const hidePrimaryActions = selectionVariant === "instant";
632
+ const buttonSize = useResponsiveValue(responsiveButtonSizes, "small");
418
633
  if (hidePrimaryActions && !props.children) {
419
- // nothing to render
420
- // todo: we can inform them the developer footer will render nothing
421
634
  return null;
422
635
  }
423
- return /*#__PURE__*/jsx(FooterContext.Provider, {
424
- value: true,
425
- children: /*#__PURE__*/jsxs("div", {
426
- className: classes.Footer,
427
- "data-hide-primary-actions": hidePrimaryActions || undefined,
428
- children: [/*#__PURE__*/jsx("div", {
429
- className: classes.FooterContent,
430
- "data-hide-primary-actions": hidePrimaryActions || undefined,
431
- children: props.children
432
- }), hidePrimaryActions ? null : /*#__PURE__*/jsxs("div", {
433
- className: classes.FooterActions,
434
- children: [/*#__PURE__*/jsx(ButtonComponent, {
435
- type: "button",
436
- size: buttonSize,
437
- onClick: () => onCancel(),
438
- children: "Cancel"
439
- }), /*#__PURE__*/jsx(ButtonComponent, {
440
- type: "submit",
441
- size: buttonSize,
442
- variant: "primary",
443
- children: "Save"
444
- })]
636
+ const t1 = hidePrimaryActions || undefined;
637
+ const t2 = hidePrimaryActions || undefined;
638
+ let t3;
639
+ if ($[2] !== props.children || $[3] !== t2) {
640
+ t3 = /*#__PURE__*/jsx("div", {
641
+ className: classes.FooterContent,
642
+ "data-hide-primary-actions": t2,
643
+ children: props.children
644
+ });
645
+ $[2] = props.children;
646
+ $[3] = t2;
647
+ $[4] = t3;
648
+ } else {
649
+ t3 = $[4];
650
+ }
651
+ let t4;
652
+ if ($[5] !== buttonSize || $[6] !== hidePrimaryActions || $[7] !== onCancel) {
653
+ t4 = hidePrimaryActions ? null : /*#__PURE__*/jsxs("div", {
654
+ className: classes.FooterActions,
655
+ children: [/*#__PURE__*/jsx(ButtonComponent, {
656
+ type: "button",
657
+ size: buttonSize,
658
+ onClick: () => onCancel(),
659
+ children: "Cancel"
660
+ }), /*#__PURE__*/jsx(ButtonComponent, {
661
+ type: "submit",
662
+ size: buttonSize,
663
+ variant: "primary",
664
+ children: "Save"
445
665
  })]
446
- })
447
- });
666
+ });
667
+ $[5] = buttonSize;
668
+ $[6] = hidePrimaryActions;
669
+ $[7] = onCancel;
670
+ $[8] = t4;
671
+ } else {
672
+ t4 = $[8];
673
+ }
674
+ let t5;
675
+ if ($[9] !== t1 || $[10] !== t3 || $[11] !== t4) {
676
+ t5 = /*#__PURE__*/jsx(FooterContext.Provider, {
677
+ value: true,
678
+ children: /*#__PURE__*/jsxs("div", {
679
+ className: classes.Footer,
680
+ "data-hide-primary-actions": t1,
681
+ children: [t3, t4]
682
+ })
683
+ });
684
+ $[9] = t1;
685
+ $[10] = t3;
686
+ $[11] = t4;
687
+ $[12] = t5;
688
+ } else {
689
+ t5 = $[12];
690
+ }
691
+ return t5;
448
692
  };
449
- SelectPanelFooter.displayName = "SelectPanelFooter";
450
693
  SelectPanelFooter.__SLOT__ = Symbol('SelectPanel.Footer');
451
694
  const SecondaryButton = props => {
452
- const size = useResponsiveValue(responsiveButtonSizes, 'small');
453
- return /*#__PURE__*/jsx(ButtonComponent, {
454
- type: "button",
455
- size: size,
456
- block: true,
457
- ...props
458
- });
695
+ const $ = c(3);
696
+ const size = useResponsiveValue(responsiveButtonSizes, "small");
697
+ let t0;
698
+ if ($[0] !== props || $[1] !== size) {
699
+ t0 = /*#__PURE__*/jsx(ButtonComponent, {
700
+ type: "button",
701
+ size: size,
702
+ block: true,
703
+ ...props
704
+ });
705
+ $[0] = props;
706
+ $[1] = size;
707
+ $[2] = t0;
708
+ } else {
709
+ t0 = $[2];
710
+ }
711
+ return t0;
459
712
  };
460
- SecondaryButton.displayName = "SecondaryButton";
461
- const SecondaryLink = ({
462
- className,
463
- ...props
464
- }) => {
465
- const size = useResponsiveValue(responsiveButtonSizes, 'small');
466
- return (
467
- /*#__PURE__*/
468
- // @ts-ignore TODO: is as prop is not recognised by button?
469
- jsx(ButtonComponent, {
713
+ const SecondaryLink = t0 => {
714
+ const $ = c(9);
715
+ let className;
716
+ let props;
717
+ if ($[0] !== t0) {
718
+ ({
719
+ className,
720
+ ...props
721
+ } = t0);
722
+ $[0] = t0;
723
+ $[1] = className;
724
+ $[2] = props;
725
+ } else {
726
+ className = $[1];
727
+ props = $[2];
728
+ }
729
+ const size = useResponsiveValue(responsiveButtonSizes, "small");
730
+ let t1;
731
+ if ($[3] !== className) {
732
+ t1 = clsx(classes.SmallText, className);
733
+ $[3] = className;
734
+ $[4] = t1;
735
+ } else {
736
+ t1 = $[4];
737
+ }
738
+ let t2;
739
+ if ($[5] !== props || $[6] !== size || $[7] !== t1) {
740
+ t2 = /*#__PURE__*/jsx(ButtonComponent, {
470
741
  as: Link,
471
742
  size: size,
472
743
  variant: "invisible",
473
744
  block: true,
474
745
  ...props,
475
- className: clsx(classes.SmallText, className),
746
+ className: t1,
476
747
  children: props.children
477
- })
478
- );
748
+ });
749
+ $[5] = props;
750
+ $[6] = size;
751
+ $[7] = t1;
752
+ $[8] = t2;
753
+ } else {
754
+ t2 = $[8];
755
+ }
756
+ return t2;
479
757
  };
480
- SecondaryLink.displayName = "SecondaryLink";
481
- const SecondaryCheckbox = ({
482
- id,
483
- children,
484
- className,
485
- ...props
486
- }) => {
758
+ const SecondaryCheckbox = t0 => {
759
+ const $ = c(17);
760
+ let children;
761
+ let className;
762
+ let id;
763
+ let props;
764
+ if ($[0] !== t0) {
765
+ ({
766
+ id,
767
+ children,
768
+ className,
769
+ ...props
770
+ } = t0);
771
+ $[0] = t0;
772
+ $[1] = children;
773
+ $[2] = className;
774
+ $[3] = id;
775
+ $[4] = props;
776
+ } else {
777
+ children = $[1];
778
+ className = $[2];
779
+ id = $[3];
780
+ props = $[4];
781
+ }
487
782
  const checkboxId = useId(id);
488
783
  const {
489
784
  selectionVariant
490
785
  } = React.useContext(SelectPanelContext);
491
-
492
- // Checkbox should not be used with instant selection
493
- !(selectionVariant !== 'instant') ? process.env.NODE_ENV !== "production" ? invariant(false, 'Sorry! SelectPanel.SecondaryAction with variant="checkbox" is not allowed inside selectionVariant="instant"') : invariant(false) : void 0;
494
- return /*#__PURE__*/jsxs("div", {
495
- className: classes.SecondaryCheckbox,
496
- children: [/*#__PURE__*/jsx(Checkbox, {
786
+ !(selectionVariant !== "instant") ? process.env.NODE_ENV !== "production" ? invariant(false, "Sorry! SelectPanel.SecondaryAction with variant=\"checkbox\" is not allowed inside selectionVariant=\"instant\"") : invariant(false) : void 0;
787
+ let t1;
788
+ if ($[5] !== className) {
789
+ t1 = clsx(classes.Checkbox, className);
790
+ $[5] = className;
791
+ $[6] = t1;
792
+ } else {
793
+ t1 = $[6];
794
+ }
795
+ let t2;
796
+ if ($[7] !== checkboxId || $[8] !== props || $[9] !== t1) {
797
+ t2 = /*#__PURE__*/jsx(Checkbox, {
497
798
  id: checkboxId,
498
- className: clsx(classes.Checkbox, className),
799
+ className: t1,
499
800
  ...props
500
- }), /*#__PURE__*/jsx(InputLabel, {
801
+ });
802
+ $[7] = checkboxId;
803
+ $[8] = props;
804
+ $[9] = t1;
805
+ $[10] = t2;
806
+ } else {
807
+ t2 = $[10];
808
+ }
809
+ let t3;
810
+ if ($[11] !== checkboxId || $[12] !== children) {
811
+ t3 = /*#__PURE__*/jsx(InputLabel, {
501
812
  htmlFor: checkboxId,
502
813
  className: classes.SmallText,
503
814
  children: children
504
- })]
505
- });
815
+ });
816
+ $[11] = checkboxId;
817
+ $[12] = children;
818
+ $[13] = t3;
819
+ } else {
820
+ t3 = $[13];
821
+ }
822
+ let t4;
823
+ if ($[14] !== t2 || $[15] !== t3) {
824
+ t4 = /*#__PURE__*/jsxs("div", {
825
+ className: classes.SecondaryCheckbox,
826
+ children: [t2, t3]
827
+ });
828
+ $[14] = t2;
829
+ $[15] = t3;
830
+ $[16] = t4;
831
+ } else {
832
+ t4 = $[16];
833
+ }
834
+ return t4;
506
835
  };
507
- SecondaryCheckbox.displayName = "SecondaryCheckbox";
508
- const SelectPanelSecondaryAction = ({
509
- variant,
510
- ...props
511
- }) => {
836
+ const SelectPanelSecondaryAction = t0 => {
837
+ const $ = c(9);
838
+ let props;
839
+ let variant;
840
+ if ($[0] !== t0) {
841
+ ({
842
+ variant,
843
+ ...props
844
+ } = t0);
845
+ $[0] = t0;
846
+ $[1] = props;
847
+ $[2] = variant;
848
+ } else {
849
+ props = $[1];
850
+ variant = $[2];
851
+ }
512
852
  const insideFooter = React.useContext(FooterContext);
513
- !insideFooter ? process.env.NODE_ENV !== "production" ? invariant(false, 'SelectPanel.SecondaryAction is only allowed inside SelectPanel.Footer') : invariant(false) : void 0;
514
-
515
- // @ts-ignore TODO
516
- if (variant === 'button') return /*#__PURE__*/jsx(SecondaryButton, {
517
- ...props
518
- });
519
- // @ts-ignore TODO
520
- else if (variant === 'link') return /*#__PURE__*/jsx(SecondaryLink, {
521
- ...props
522
- });
523
- // @ts-ignore TODO
524
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
525
- else if (variant === 'checkbox') return /*#__PURE__*/jsx(SecondaryCheckbox, {
526
- ...props
527
- });
853
+ !insideFooter ? process.env.NODE_ENV !== "production" ? invariant(false, "SelectPanel.SecondaryAction is only allowed inside SelectPanel.Footer") : invariant(false) : void 0;
854
+ if (variant === "button") {
855
+ let t1;
856
+ if ($[3] !== props) {
857
+ t1 = /*#__PURE__*/jsx(SecondaryButton, {
858
+ ...props
859
+ });
860
+ $[3] = props;
861
+ $[4] = t1;
862
+ } else {
863
+ t1 = $[4];
864
+ }
865
+ return t1;
866
+ } else {
867
+ if (variant === "link") {
868
+ let t1;
869
+ if ($[5] !== props) {
870
+ t1 = /*#__PURE__*/jsx(SecondaryLink, {
871
+ ...props
872
+ });
873
+ $[5] = props;
874
+ $[6] = t1;
875
+ } else {
876
+ t1 = $[6];
877
+ }
878
+ return t1;
879
+ } else {
880
+ if (variant === "checkbox") {
881
+ let t1;
882
+ if ($[7] !== props) {
883
+ t1 = /*#__PURE__*/jsx(SecondaryCheckbox, {
884
+ ...props
885
+ });
886
+ $[7] = props;
887
+ $[8] = t1;
888
+ } else {
889
+ t1 = $[8];
890
+ }
891
+ return t1;
892
+ }
893
+ }
894
+ }
528
895
  };
529
- const SelectPanelLoading = ({
530
- children = 'Fetching items...'
531
- }) => {
532
- return /*#__PURE__*/jsxs(AriaStatus, {
533
- announceOnShow: true,
534
- className: classes.SelectPanelLoading,
535
- children: [/*#__PURE__*/jsx(Spinner, {
896
+ const SelectPanelLoading = t0 => {
897
+ const $ = c(3);
898
+ const {
899
+ children: t1
900
+ } = t0;
901
+ const children = t1 === undefined ? "Fetching items..." : t1;
902
+ let t2;
903
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
904
+ t2 = /*#__PURE__*/jsx(Spinner, {
536
905
  size: "medium",
537
906
  srText: null
538
- }), /*#__PURE__*/jsx("span", {
539
- className: classes.LoadingText,
540
- children: children
541
- })]
542
- });
907
+ });
908
+ $[0] = t2;
909
+ } else {
910
+ t2 = $[0];
911
+ }
912
+ let t3;
913
+ if ($[1] !== children) {
914
+ t3 = /*#__PURE__*/jsxs(AriaStatus, {
915
+ announceOnShow: true,
916
+ className: classes.SelectPanelLoading,
917
+ children: [t2, /*#__PURE__*/jsx("span", {
918
+ className: classes.LoadingText,
919
+ children: children
920
+ })]
921
+ });
922
+ $[1] = children;
923
+ $[2] = t3;
924
+ } else {
925
+ t3 = $[2];
926
+ }
927
+ return t3;
543
928
  };
544
- SelectPanelLoading.displayName = "SelectPanelLoading";
545
929
  const SelectPanelMessage = ({
546
930
  variant = 'warning',
547
931
  size = variant === 'empty' ? 'full' : 'inline',